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 null value allowed for the callback ? | |
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) .
__parser__ technologie is defined at: alc parserThe callback is generally defined as a C function with :
FUNCTION ( ... , callback-call, callback-data, ?callback-free?, ?callback-copy?, ... )
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 null value allowed for the callback ? |
| __parser__(callback-once) | no | is the callback only used once ? |
| scope | global 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 … |
| scope | global or function |
| usage | __parser__global__(FUNCTION:ARGUMENT:callback-WHAT |
| usage | FUNCTION ( type ARGUMENT __parser__(callback-WHAT) ...) |
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 :
MyPackage/MyLanguage/compiler.tclmap_M2S_localNS ia a macro used to give the Python api a unique binary-namespace #define NS(n) pysq3lite_ ## nThe 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 :
| #define __parser__callback_call callback-call |
define the function-pointer to call as callback …
Definition at line 1936 of file parser_mk.h.
| #define __parser__callback_copy callback-copy |
define the function-pointer to copy the callback-data …
Definition at line 1946 of file parser_mk.h.
| #define __parser__callback_data callback-data |
define the data-attribute of the callback-call …
Definition at line 1931 of file parser_mk.h.
| #define __parser__callback_free callback-free |
define the function-pointer to free the callback-data …
Definition at line 1941 of file parser_mk.h.
| #define __parser__callback_name callback-name=PREFIX |
prefix of the callback-identifer …
Definition at line 1926 of file parser_mk.h.
| #define __parser__callback_null callback-null |
is the null value allowed for the callback ?
A NULL value is often require to disable or reset the callback.
theConfig/c/LcConfigC_lc.h Definition at line 1962 of file parser_mk.h.
| #define __parser__callback_once callback-once |
is the callback only used once ?
Definition at line 1951 of file parser_mk.h.