theKernel 10.0 NHI1 - theKernel - theLink - theConfig - theSq3Lite - theCompiler - theBrain - theGuard
c - tcl - py - 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 * libmkkernel::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 (libmkkernel::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 libmkkernel::MK_NULL_STR
  3. the NULL-string-length called libmkkernel::MK_NULL_STR_LEN
  4. the NULL-check called libmkkernel::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


MK_UNUSED static const char libmkkernel::MK_NULL_STR [] = "MK_NULL"
 the string "MK_NULL" value as MK_NULL_STR
 
MK_UNUSED static const long int libmkkernel::MK_NULL_STR_LEN = strlen(MK_NULL_STR)
 the integer strlen("MK_NULL") value as MK_NULL_STR_LEN
 
bool libmkkernel::MK_NULL_STR_CHECK (char const *const __str, const long int __len)
 check if __str is MK_NULL_STR return true or false
 
bool libmkkernel::MK_NULL_STR_CHECK_1 (char const *const __str)
 same as libmkkernel::MK_NULL_STR_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
 

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_STDCALL
 
#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   __attribute__((noreturn))
 

Detailed Description

MkKernel PACKAGE - Interface to the operating-system compiler …

Macro Definition Documentation

◆ likely

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

Definition at line 476 of file LibMkKernel_mk.h.

◆ META_DIR_SEPARATOR

#define META_DIR_SEPARATOR   '/'

Definition at line 954 of file LibMkKernel_mk.h.

◆ META_EOL

#define META_EOL   "\n"

Definition at line 955 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 1023 of file LibMkKernel_mk.h.

◆ mk_attr_cold

#define mk_attr_cold   __attribute__((cold))

Definition at line 449 of file LibMkKernel_mk.h.

◆ mk_attr_hot

#define mk_attr_hot   __attribute__((hot))

Definition at line 448 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 1027 of file LibMkKernel_mk.h.

◆ MK_CDECL

#define MK_CDECL

Definition at line 439 of file LibMkKernel_mk.h.

◆ MK_CLRCALL

#define MK_CLRCALL

Definition at line 437 of file LibMkKernel_mk.h.

◆ MK_CONCAT

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

concat of expressions, step 2 …

Definition at line 1015 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 1016 of file LibMkKernel_mk.h.

◆ MK_CONCAT3

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

Definition at line 1017 of file LibMkKernel_mk.h.

◆ MK_CPPSTR

#define MK_CPPSTR ( s)
Value:
#s

connecting of expressions, step 2 …

Definition at line 1013 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 1011 of file LibMkKernel_mk.h.

◆ MK_DECL

#define MK_DECL   MK_STDCALL

Definition at line 456 of file LibMkKernel_mk.h.

◆ MK_EXTERN

#define MK_EXTERN

static library

Definition at line 982 of file LibMkKernel_mk.h.

◆ MK_EXTERN_DATA

#define MK_EXTERN_DATA   extern

Definition at line 1005 of file LibMkKernel_mk.h.

◆ mk_inline

#define mk_inline   static inline

Definition at line 443 of file LibMkKernel_mk.h.

◆ MK_NO_RETURN

#define MK_NO_RETURN   __attribute__((noreturn))

Definition at line 521 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 (libmkkernel::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 libmkkernel::MK_NULL_STR
  3. the NULL-string-length called libmkkernel::MK_NULL_STR_LEN
  4. the NULL-check called libmkkernel::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 582 of file LibMkKernel_mk.h.

◆ MK_NULL_NO

#define MK_NULL_NO   false

flag, not allow NULL

Definition at line 588 of file LibMkKernel_mk.h.

◆ MK_NULL_YES

#define MK_NULL_YES   true

flag, allow NULL

Definition at line 585 of file LibMkKernel_mk.h.

◆ mk_snprintf

#define mk_snprintf   snprintf

Definition at line 446 of file LibMkKernel_mk.h.

◆ MK_STDCALL

#define MK_STDCALL

Definition at line 438 of file LibMkKernel_mk.h.

◆ mk_timeval

#define mk_timeval   timeval

Definition at line 513 of file LibMkKernel_mk.h.

◆ mk_timezone

#define mk_timezone   timezone

Definition at line 514 of file LibMkKernel_mk.h.

◆ mk_unlink

#define mk_unlink   unlink

Definition at line 445 of file LibMkKernel_mk.h.

◆ MK_UNUSED

#define MK_UNUSED   __attribute__((unused))

mark unnused variables and functions

Definition at line 520 of file LibMkKernel_mk.h.

◆ unlikely

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

Definition at line 477 of file LibMkKernel_mk.h.

Typedef Documentation

◆ MK_MACRO_TYP

helper-type used to declare a prototype for a macro

Definition at line 541 of file LibMkKernel_mk.h.

Function Documentation

◆ MK_NULL_STR_CHECK()

bool libmkkernel::MK_NULL_STR_CHECK ( char const *const __str,
const long int __len )
inline

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 610 of file LibMkKernel_mk.h.

610 {
611 return ((__str) && (__len) == MK_NULL_STR_LEN && strcmp((__str),MK_NULL_STR)==0);
612}

◆ MK_NULL_STR_CHECK_1()

bool libmkkernel::MK_NULL_STR_CHECK_1 ( char const *const __str)
inline

same as libmkkernel::MK_NULL_STR_CHECK but without len parameter

Definition at line 616 of file LibMkKernel_mk.h.

616 {
617 return ((__str) && strcmp((__str),MK_NULL_STR)==0);
618}

Variable Documentation

◆ MK_NULL_STR

MK_UNUSED static const char libmkkernel::MK_NULL_STR[] = "MK_NULL"
static

the string "MK_NULL" value as MK_NULL_STR

See also
MK_NULL

Definition at line 594 of file LibMkKernel_mk.h.

◆ MK_NULL_STR_LEN

MK_UNUSED static const long int libmkkernel::MK_NULL_STR_LEN = strlen(MK_NULL_STR)
static

the integer strlen("MK_NULL") value as MK_NULL_STR_LEN

See also
MK_NULL

Definition at line 600 of file LibMkKernel_mk.h.