theKernel 10.0 NHI1 - theKernel - theLink - theConfig - theSq3Lite - theCompiler - theBrain - theGuard
c - tcl - py - jv - cc
Loading...
Searching...
No Matches
MkKernel_Parser_Callback_C_API

callback : define the __parser__ attribute related to the callback integration … More...

+ Collaboration diagram for MkKernel_Parser_Callback_C_API:

Macros

#define __parser__callback_name   callback-name=PREFIX
 prefix of the callback-identifer
 
#define __parser__callback_data   callback-data
 define the data-attribute of the callback-call
 
#define __parser__callback_call   callback-call
 define the function-pointer to call as callback
 
#define __parser__callback_free   callback-free
 define the function-pointer to free the callback-data
 
#define __parser__callback_copy   callback-copy
 define the function-pointer to copy the callback-data
 
#define __parser__callback_once   callback-once
 is the callback only used once ?
 
#define __parser__callback_null   callback-null
 is the MK_NULL value allowed for the callback ?
 

Detailed Description

callback : define the __parser__ attribute related to the callback integration …

A callback is a piece of code calling back from the C-API into the Target-Programming-Language (TPL) .

The callback is generally defined as a C function with :

FUNCTION ( ... , callback-call, callback-data, ?callback-free?, ?callback-copy?, ... )

DEFINITION

The attribute __parser__(callback-name) define the namespace of the callback-identifer :

attribute position name example
__parser__(callback-name) prefix Xxxx MyCallback
__parser__(callback-call) postfix Call MyCallbackCall
__parser__(callback-free) postfix Free MyCallbackFree
__parser__(callback-copy) postfix Copy MyCallbackCopy

A callback is defined on FUNCTION level :

what required? definition
__parser__(callback-name) yes prefix of the callback-identifer
__parser__(callback-null) no is the MK_NULL value allowed for the callback ?
__parser__(callback-once) no is the callback only used once ?
Definition
scopeglobal or function
usage__parser__global__(FUNCTION:callback-WHAT?=VALUE?
usage__parser__(callback-WHAT?=VALUE?) FUNCTION ...)

and the callback is defined on ARGUMENT level :

what required? definition
__parser__(callback-call) yes define the function-pointer to call as callback
__parser__(callback-data) yes define the data-attribute of the callback-call
__parser__(callback-free) no define the function-pointer to free the callback-data
__parser__(callback-copy) no define the function-pointer to copy the callback-data
Definition
scopeglobal or function
usage__parser__global__(FUNCTION:ARGUMENT:callback-WHAT
usageFUNCTION ( type ARGUMENT __parser__(callback-WHAT) ...)

USAGE

The meta-code-external-header-file (META-HEADER) from file sqlite3.h :

The meta-code-header-wrapper-file (META-WRAPPER) from file theSq3Lite/c/sqlite3_sq3.h :

The All-Language-Compiler (ALC) configuration for Python from theSq3Lite/py/compiler.tcl :

The generated code for the Python api at file theSq3Lite/tcl/Sq3LiteC_py.c :

The callback-call is defined by the All-Language-Compiler (ALC) :

The callback-call is designed by the programmer :

Macro Definition Documentation

◆ __parser__callback_call

#define __parser__callback_call   callback-call

define the function-pointer to call as callback

See also
MkKernel_Parser_Callback_C_API

Definition at line 1846 of file parser_mk.h.

◆ __parser__callback_copy

#define __parser__callback_copy   callback-copy

define the function-pointer to copy the callback-data

See also
MkKernel_Parser_Callback_C_API

Definition at line 1856 of file parser_mk.h.

◆ __parser__callback_data

#define __parser__callback_data   callback-data

define the data-attribute of the callback-call

See also
MkKernel_Parser_Callback_C_API

Definition at line 1841 of file parser_mk.h.

◆ __parser__callback_free

#define __parser__callback_free   callback-free

define the function-pointer to free the callback-data

See also
MkKernel_Parser_Callback_C_API

Definition at line 1851 of file parser_mk.h.

◆ __parser__callback_name

#define __parser__callback_name   callback-name=PREFIX

prefix of the callback-identifer

See also
MkKernel_Parser_Callback_C_API

Definition at line 1836 of file parser_mk.h.

◆ __parser__callback_null

#define __parser__callback_null   callback-null

is the MK_NULL value allowed for the callback ?

A NULL value is often require to disable or reset the callback.

See also
MkKernel_Parser_Callback_C_API
Example
code from file theConfig/c/LcConfigC_lc.h
__parser__(callback-name=ConfigInclude, callback-null)
LC_EXTERN enum MkErrorE MK_DECL LcConfigSetIncludeFunc_RT (
LC_CFG const cfg,
LcConfigIncludeCallF fConfigIncludeCall __parser__(callback-call) ,
LC_CBP fConfigIncludeData __parser__(callback-data) ,
LcConfigIncludeFreeF fConfigIncludeFree __parser__(callback-free)

Definition at line 1872 of file parser_mk.h.

◆ __parser__callback_once

#define __parser__callback_once   callback-once

is the callback only used once ?

See also
MkKernel_Parser_Callback_C_API

Definition at line 1861 of file parser_mk.h.