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

MkKernel PACKAGE - Interface to the operating-system compiler … More...

+ Collaboration diagram for MkKernel_Compiler_C_API:

Macros

#define META_DIR_SEPARATOR   '/'
 
#define META_EOL   "\n"
 
#define MK_EXTERN
 static library
 
#define MK_EXTERN_DATA   extern
 
#define MK_CPPXSTR(s)
 connecting of expressions, step 1 …
 
#define MK_CPPSTR(s)
 connecting of expressions, step 2 …
 
#define MK_CONCAT(a, b)
 concat of expressions, step 2 …
 
#define MK_CONCAT2(a, b)
 
#define MK_CONCAT3(a, b, c)
 
#define mk_append_fix_str(t, s)
 append fix string to storage and increment pointer …
 
#define mk_bit_compare(t, f)
 bitwise compare flag values …
 

Typedefs

typedef void * MK_MACRO_TYP
 helper-type used to declare a prototype for a macro
 

MK_NULL

work with the NULL value

define the NULL

This problem looks simpler than it is because NULL is not defined in every language.

TCL e.g. does not understand the NULL as a data type and an approximation with "" is only correct to the extent that the target API also understands the "" as a NULL-Value.

Unfortunately, this is not always the case and therefore:

  • wherever a NULL is explicitly required the MK_NULL is used in C .
  • wherever a NULL as string (MK_STRN) is required then the string "MK_NULL" is used in C.

To support the NULL the following items are defined:

  1. the NULL-value called MK_NULL
  2. the NULL-string called MK_NULL_STR
  3. the NULL-string-length called MK_NULL_STR_LEN
  4. the NULL-check called MK_NULL_STR_CHECK
Note
The Programming-Language-Micro-Kernel (PLMK) translate the string "MK_NULL" into the MK_NULL pointer wherever a pointer is expected as a return value.

class-instance as NULL

MOT-Null


static bool MK_NULL_STR_CHECK (char const *const __str, const long int __len)
 check if __str is MK_NULL_STR return true or false
 
static bool MK_NULL_STR_CHECK_1 (char const *const __str)
 same as MK_NULL_STR_CHECK but without len parameter
 
static bool MK_NULL_STR_OR_EMPTY_CHECK_1 (char const *const __str)
 same as MK_NULL_STR_CHECK together with "" check but without len parameter
 
#define MK_NULL   NULL
 The Programming-Language-Micro-Kernel (PLMK) NULL value as MK_NULL in C …
 
#define MK_NULL_YES   true
 flag, allow NULL
 
#define MK_NULL_NO   false
 flag, not allow NULL
 
#define MK_NULL_STR   "MK_NULL"
 the string "MK_NULL" value as MK_NULL_STR
 
#define MK_NULL_STR_LEN   strlen(MK_NULL_STR)
 the integer strlen("MK_NULL") value as MK_NULL_STR_LEN
 

global <strong>parser</strong> definition

#define MK_PARSER_fmtobj   MK_OBJN fmtobj __parser__(default=NULL)
 use param_fmtobj for documentation
 

native compiler definition

#define MK_CLRCALL
 
#define MK_STDCALL
 
#define MK_CDECL
 
#define mk_inline   static inline
 
#define mk_unlink   unlink
 
#define mk_snprintf   snprintf
 
#define MK_ATTR_HOT   __attribute__((hot))
 
#define MK_ATTR_COLD   __attribute__((cold))
 
#define MK_DECL   MK_CDECL
 
#define BEGIN_MK_C_DECLS   /* empty */
 
#define END_MK_C_DECLS   /* empty */
 
#define likely(x)
 
#define unlikely(x)
 
#define mk_timeval   timeval
 
#define mk_timezone   timezone
 
#define MK_UNUSED   __attribute__((unused))
 mark unnused variables and functions
 
#define MK_NO_RETURN
 dosable "MK_NO_RETURN" because C# require "return" from "MqExit" for thread-pool support
 
#define MK_UNREACHABLE   __builtin_unreachable()
 
#define MK_ARTIFICIAL   __attribute__((__artificial__))
 

Detailed Description

MkKernel PACKAGE - Interface to the operating-system compiler …

Macro Definition Documentation

◆ BEGIN_MK_C_DECLS

#define BEGIN_MK_C_DECLS   /* empty */

Definition at line 487 of file LibMkKernel_mk.h.

◆ END_MK_C_DECLS

#define END_MK_C_DECLS   /* empty */

Definition at line 488 of file LibMkKernel_mk.h.

◆ likely

#define likely ( x)
Value:
__builtin_expect((x),1)

Definition at line 500 of file LibMkKernel_mk.h.

◆ META_DIR_SEPARATOR

#define META_DIR_SEPARATOR   '/'

Definition at line 984 of file LibMkKernel_mk.h.

◆ META_EOL

#define META_EOL   "\n"

Definition at line 985 of file LibMkKernel_mk.h.

◆ mk_append_fix_str

#define mk_append_fix_str ( t,
s )
Value:
t=strcpy(t,s)+sizeof(s)-1

append fix string to storage and increment pointer …

Definition at line 1053 of file LibMkKernel_mk.h.

◆ MK_ARTIFICIAL

#define MK_ARTIFICIAL   __attribute__((__artificial__))

Definition at line 550 of file LibMkKernel_mk.h.

◆ MK_ATTR_COLD

#define MK_ATTR_COLD   __attribute__((cold))

Definition at line 462 of file LibMkKernel_mk.h.

◆ MK_ATTR_HOT

#define MK_ATTR_HOT   __attribute__((hot))

Definition at line 461 of file LibMkKernel_mk.h.

◆ mk_bit_compare

#define mk_bit_compare ( t,
f )
Value:
(t&f)==f

bitwise compare flag values …

Definition at line 1057 of file LibMkKernel_mk.h.

◆ MK_CDECL

#define MK_CDECL

Definition at line 452 of file LibMkKernel_mk.h.

◆ MK_CLRCALL

#define MK_CLRCALL

Definition at line 450 of file LibMkKernel_mk.h.

◆ MK_CONCAT

#define MK_CONCAT ( a,
b )
Value:
a ## b

concat of expressions, step 2 …

Definition at line 1045 of file LibMkKernel_mk.h.

◆ MK_CONCAT2

#define MK_CONCAT2 ( a,
b )
Value:
#define MK_CONCAT(a, b)
concat of expressions, step 2 …

Definition at line 1046 of file LibMkKernel_mk.h.

◆ MK_CONCAT3

#define MK_CONCAT3 ( a,
b,
c )
Value:
a ## b ## c

Definition at line 1047 of file LibMkKernel_mk.h.

◆ MK_CPPSTR

#define MK_CPPSTR ( s)
Value:
#s

connecting of expressions, step 2 …

Definition at line 1043 of file LibMkKernel_mk.h.

◆ MK_CPPXSTR

#define MK_CPPXSTR ( s)
Value:
#define MK_CPPSTR(s)
connecting of expressions, step 2 …

connecting of expressions, step 1 …

Definition at line 1041 of file LibMkKernel_mk.h.

◆ MK_DECL

#define MK_DECL   MK_CDECL

Definition at line 471 of file LibMkKernel_mk.h.

◆ MK_EXTERN

#define MK_EXTERN

static library

Definition at line 1012 of file LibMkKernel_mk.h.

◆ MK_EXTERN_DATA

#define MK_EXTERN_DATA   extern

Definition at line 1035 of file LibMkKernel_mk.h.

◆ mk_inline

#define mk_inline   static inline

Definition at line 456 of file LibMkKernel_mk.h.

◆ MK_NO_RETURN

#define MK_NO_RETURN

dosable "MK_NO_RETURN" because C# require "return" from "MqExit" for thread-pool support

Definition at line 546 of file LibMkKernel_mk.h.

◆ MK_NULL

#define MK_NULL   NULL

The Programming-Language-Micro-Kernel (PLMK) NULL value as MK_NULL in C …

define the NULL

This problem looks simpler than it is because NULL is not defined in every language.

TCL e.g. does not understand the NULL as a data type and an approximation with "" is only correct to the extent that the target API also understands the "" as a NULL-Value.

Unfortunately, this is not always the case and therefore:

  • wherever a NULL is explicitly required the MK_NULL is used in C .
  • wherever a NULL as string (MK_STRN) is required then the string "MK_NULL" is used in C.

To support the NULL the following items are defined:

  1. the NULL-value called MK_NULL
  2. the NULL-string called MK_NULL_STR
  3. the NULL-string-length called MK_NULL_STR_LEN
  4. the NULL-check called MK_NULL_STR_CHECK
Note
The Programming-Language-Micro-Kernel (PLMK) translate the string "MK_NULL" into the MK_NULL pointer wherever a pointer is expected as a return value.

class-instance as NULL

MOT-Null


Definition at line 611 of file LibMkKernel_mk.h.

◆ MK_NULL_NO

#define MK_NULL_NO   false

flag, not allow NULL

Definition at line 617 of file LibMkKernel_mk.h.

◆ MK_NULL_STR

#define MK_NULL_STR   "MK_NULL"

the string "MK_NULL" value as MK_NULL_STR

See also
MK_NULL

Definition at line 623 of file LibMkKernel_mk.h.

◆ MK_NULL_STR_LEN

#define MK_NULL_STR_LEN   strlen(MK_NULL_STR)

the integer strlen("MK_NULL") value as MK_NULL_STR_LEN

See also
MK_NULL

Definition at line 629 of file LibMkKernel_mk.h.

◆ MK_NULL_YES

#define MK_NULL_YES   true

flag, allow NULL

Definition at line 614 of file LibMkKernel_mk.h.

◆ MK_PARSER_fmtobj

#define MK_PARSER_fmtobj   MK_OBJN fmtobj __parser__(default=NULL)

use param_fmtobj for documentation

Definition at line 415 of file LibMkKernel_mk.h.

◆ mk_snprintf

#define mk_snprintf   snprintf

Definition at line 459 of file LibMkKernel_mk.h.

◆ MK_STDCALL

#define MK_STDCALL

Definition at line 451 of file LibMkKernel_mk.h.

◆ mk_timeval

#define mk_timeval   timeval

Definition at line 537 of file LibMkKernel_mk.h.

◆ mk_timezone

#define mk_timezone   timezone

Definition at line 538 of file LibMkKernel_mk.h.

◆ mk_unlink

#define mk_unlink   unlink

Definition at line 458 of file LibMkKernel_mk.h.

◆ MK_UNREACHABLE

#define MK_UNREACHABLE   __builtin_unreachable()

Definition at line 548 of file LibMkKernel_mk.h.

◆ MK_UNUSED

#define MK_UNUSED   __attribute__((unused))

mark unnused variables and functions

Definition at line 544 of file LibMkKernel_mk.h.

◆ unlikely

#define unlikely ( x)
Value:
__builtin_expect((x),0)

Definition at line 501 of file LibMkKernel_mk.h.

Typedef Documentation

◆ MK_MACRO_TYP

typedef void* MK_MACRO_TYP

helper-type used to declare a prototype for a macro

Definition at line 570 of file LibMkKernel_mk.h.

Function Documentation

◆ MK_NULL_STR_CHECK()

static bool MK_NULL_STR_CHECK ( char const *const __str,
const long int __len )
inlinestatic

check if __str is MK_NULL_STR return true or false

See also
MK_NULL
Parameters
[in]__strthe string pointer to test, if MK_NULL than false is returned.
[in]__lenthe length pointer is tested against MK_NULL_STR_LEN, have to be the strlen of __str.
Returns
the a boolean value → true if __str is a MK_NULL_STR.

Definition at line 639 of file LibMkKernel_mk.h.

639 {
640 return ((__str) ? ( (__len) == MK_NULL_STR_LEN && strcmp((__str),MK_NULL_STR)==0 ) : true);
641}
#define MK_NULL_STR
the string "MK_NULL" value as MK_NULL_STR …
#define MK_NULL_STR_LEN
the integer strlen("MK_NULL") value as MK_NULL_STR_LEN …

◆ MK_NULL_STR_CHECK_1()

static bool MK_NULL_STR_CHECK_1 ( char const *const __str)
inlinestatic

same as MK_NULL_STR_CHECK but without len parameter

Definition at line 645 of file LibMkKernel_mk.h.

645 {
646 return ((__str) ? strcmp((__str),MK_NULL_STR)==0 : true);
647}

◆ MK_NULL_STR_OR_EMPTY_CHECK_1()

static bool MK_NULL_STR_OR_EMPTY_CHECK_1 ( char const *const __str)
inlinestatic

same as MK_NULL_STR_CHECK together with "" check but without len parameter

Definition at line 651 of file LibMkKernel_mk.h.

651 {
652 return ((__str) ? (__str)[0] == '\0' || strcmp((__str),MK_NULL_STR)==0 : true);
653}