native : define the __parser__ attribute related to native-library integration …
More...
Collaboration diagram for MkKernel_Parser_Native_C_API:Macros | |
| #define | __parser__global__native2class native2class:EXTERNAL-STRUCT=INTERNAL-CLASS@HANDEL-NAME |
| Use native2class to link an external-struct with an internal-class … | |
| #define | __parser__global__native_alias_from_prefix native-alias-from-prefix:NATIVE-PREFIX=WRAPPER-PREFIX |
| Use the native-alias-from-prefix feature to map a native-function to a wrapper-function with PLMK (Programming-Language-Micro-Kernel)-Support … | |
| #define | __parser__global__native_alias_from_hdl native-alias-from-hdl:OLD-PREFIX=OLD-TYPE@NEW-PREFIX@NEW-HDL |
| Use the native-alias-from-hdl feature to map a native-function to a wrapper-function with PLMK (Programming-Language-Micro-Kernel)-Support … | |
| #define | __parser__native_alias native-alias |
| Overwrite the default meta-function-name for a native-function … | |
| #define | __parser__global__native_hide native-hide=NEW-NAME |
create a hidden wrapper with name NEW-NAME with a public api … | |
| #define | __parser__global__native_ignore_regexp native-ignore-regexp@LIST=REGEXP |
Ignore all functions found by REGEXP … | |
| #define | __parser__global__native_ignore_name native-ignore-name@LIST=NAME |
Ignore all functions found by NAME … | |
| #define | __parser__global__native_ignore_type native-ignore-type@LIST=TYPE |
Ignore all functions found by TYPE … | |
| #define | __parser__global__native_prefer_postfix native-prefer-postfix@LIST=POSTFIX |
Select a specific native-function identified by POSTFIX … | |
native : define the __parser__ attribute related to native-library integration …
| #define __parser__global__native2class native2class:EXTERNAL-STRUCT=INTERNAL-CLASS@HANDEL-NAME |
Use native2class to link an external-struct with an internal-class …
This attribute is only used if a native library without PLMK (Programming-Language-Micro-Kernel)-Support is used as input and an external-struct have to be mapped to an internal-class.
| usage | __parser__global__(native2class:EXTERNAL-STRUCT=INTERNAL-CLASS@HANDEL-NAME); |
| see also | __parser__(class); __parser__global__(native-alias-from-prefix) |
config_setting_t to internal-class LbSettingS using handle nat Definition at line 2250 of file parser_mk.h.
| #define __parser__global__native_alias_from_hdl native-alias-from-hdl:OLD-PREFIX=OLD-TYPE@NEW-PREFIX@NEW-HDL |
Use the native-alias-from-hdl feature to map a native-function to a wrapper-function with PLMK (Programming-Language-Micro-Kernel)-Support …
This attribute is only used if a native library without PLMK (Programming-Language-Micro-Kernel)-Support is used as input and a native-function have to be mapped to a wrapper-function.
In the meta-code the WRAPPER-PREFIX together with the NATIVE-POSTFIX is the new wrapper-function and the native-function is added to the native-alias attribute of the new wrapper-function.
In difference to __parser__global__(native-alias-from-prefix) this attribute is used if ther is NO unique prefix to identify a function class and the type of FIRST argument is required also.
| usage | __parser__global__(native-alias-from-hdl:OLD-PREFIX:OLD-TYPE=NEW-PREFIX@NEW-HDL); |
| see also | __parser__(alias); __parser__global__(native2class); __parser__global__(native-alias-from-prefix) |
sqlite3_aggregate_context function to the wrapper Sq3ContextAggregateContext function. Definition at line 2331 of file parser_mk.h.
| #define __parser__global__native_alias_from_prefix native-alias-from-prefix:NATIVE-PREFIX=WRAPPER-PREFIX |
Use the native-alias-from-prefix feature to map a native-function to a wrapper-function with PLMK (Programming-Language-Micro-Kernel)-Support …
This attribute is only used if a native library without PLMK (Programming-Language-Micro-Kernel)-Support is used as input and a native-function have to be mapped to a wrapper-function.
In the meta-code the WRAPPER-PREFIX together with the NATIVE-POSTFIX is the new wrapper-function and the native-function is added to the native-alias-from-prefix attribute of the new wrapper-function.
| usage | __parser__global__(native-alias-from-prefix=NATIVE-PREFIX@WRAPPER-PREFIX); |
| see also | __parser__(alias); __parser__global__(native2class); __parser__global__(native-alias-from-hdl) |
config_lookup function to the wrapper LcConfigLookup function. Definition at line 2289 of file parser_mk.h.
| #define __parser__global__native_hide native-hide=NEW-NAME |
create a hidden wrapper with name NEW-NAME with a public api …
Sometimes a native-function is too complicated to be fully defined by the All-Language-Compiler (ALC).
A two-step approach is required where the native-function is renamed to
NEW-NAMEand become the private-function and the programmer write the public-function as wrapper for the private-function.
The NEW-NAME is in native-syntax like sqlite3_prepare_v2_hide for the libsqlite3 function sqlite3_prepare_v2. The metacode-sytax of the both functions are Sq3StmtPrepareV2Hide and Sq3StmtPrepareV2 because the both functions belonging to the class Sq3StmtC.
The ALC create:
The programmer uses the private-function to create the public-function following the public-function-declaration.
The public-function can now be used to add an additional feature like extra code to work with ??__parser__native_internal arguments.
sqlite3_prepare_v2_hide The native-function is a constructor for the ppStmt handle defined with:
The problem is that the meta-code-contructor is only allowed to return one argument but the function sqlite3_prepare_v2 return two arguments ppStmt and pzTail.
The solution is to use the two-step approach and add the pzTail value to a stor for later usage.
With the global attributes defined in sqlite3_sq3.h :
the c_native.tcl tool of the All-Language-Compiler (ALC) create the hidden defintion Sq3StmtPrepareV2Hide :
and the public declaration Sq3StmtPrepareV2 :
Finally the programmer create the public definition Sq3StmtPrepareV2 using the hidden definition Sq3StmtPrepareV2Hide :
| usage | __parser__global__(native-hide=NEW-NAME); |
| example | __parser__global__(native-hide=sqlite3_prepare_v2_hide); |
Definition at line 2454 of file parser_mk.h.
| #define __parser__global__native_ignore_name native-ignore-name@LIST=NAME |
Ignore all functions found by NAME …
The native-function name is compared with \\m\arg{ignore-name}\\M and if true the function is ignored.
For detail description refer to __parser__global__(native-ignore-regexp)
| usage | __parser__global__(native-ignore-name=NAME); |
| example | __parser__global__(native-ignore-name=sqlite3_preupdate_old); |
| see also | __parser__(ignore) |
Definition at line 2483 of file parser_mk.h.
| #define __parser__global__native_ignore_regexp native-ignore-regexp@LIST=REGEXP |
Ignore all functions found by REGEXP …
The ignore-XXX style of attributes are used to __parser__(ignore) a native-function.
| usage | __parser__global__(native-ignore-regexp=REGEXP); |
| example | __parser__global__(native-ignore-regexp=^MyPrefix); |
| see also | __parser__(ignore) |
Definition at line 2469 of file parser_mk.h.
| #define __parser__global__native_ignore_type native-ignore-type@LIST=TYPE |
Ignore all functions found by TYPE …
If the native-function argument-type or return-type is the ignore-type than the function is ignored. The ignore-type have to be a type defined by struct TYPE { ... } or by typedef struct { ... } TYPE
For detail description refer to __parser__global__(native-ignore-regexp)
| usage | __parser__global__(ignore-type=TYPE); |
| example | __parser__global__(ignore-type=sqlite3_module); |
| see also | __parser__(ignore) |
Definition at line 2498 of file parser_mk.h.
| #define __parser__global__native_prefer_postfix native-prefer-postfix@LIST=POSTFIX |
Select a specific native-function identified by POSTFIX …
If the native-api provide multiple function to provide an feature select the function with POSTFIX to be the leading function.
POSTFIX refer to the meta-function-name with Title notation.| usage | __parser__global__(native-prefer-postfix=POSTFIX); |
| example | __parser__global__(native-prefer-postfix=V2); |
Definition at line 2532 of file parser_mk.h.
| #define __parser__native_alias native-alias |
Overwrite the default meta-function-name for a native-function …
By default a meta-function-name is created from native-function using the following rules:
NsClassAttribute Ns is the current library Ns like Sq3 for LibSq3Lite.Class is the rootname of the current class or package like Stmt for Sq3StmtC.Attribute is the root of the native-function-name. The root is the name without library-prefix like errmsg for sqlite3_errmsg."_" than the Attribute is split into a list-of-attributes sqlite3_errmsg to Sq3LiteErrmsg native-alias=Sq3LiteErrMsg| scope | global or function |
| usage | __parser__global__(FUNCTION:native-alias=NEW-NAME); |
| usage | __parser__(native-alias=NEW-NAME) FUNCTION … |
| see also | __parser__(alias); __parser__global__(native2class); __parser__global__(native-alias-from-prefix) |
Definition at line 2354 of file parser_mk.h.