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

MkObjectC - L)anguage A)bstraction L)ayer definition … More...

+ Collaboration diagram for MkObjectC_Sys_C_API:

Data Structures

struct  MkIdS
 data type for process/thread identification … More...
 
struct  MkLalS
 Interface between libmkkernel and the Operating-System … More...
 

Macros

#define MkSysFree(pointer)
 
#define MkSysFreeNonNull(pointer)
 
#define MkSysStringSetNULL_R(_str)
 
#define MkSysStringSet_R(_str, _val)
 
#define MkSysStringIsNULL_R(_str)
 
#define MkSysStringIsEQUAL(_str, _other)
 
#define MkSysStringIsLenEQUAL(_str, _other, _len)
 

Typedefs

typedef uintptr_t MK_IDNT
 process or thread identifier …
 
typedef MK_PTR(* MkSysCallocF) (size_t, size_t)
 calloc syscall …
 
typedef MK_PTR(* MkSysMallocF) (size_t)
 malloc syscall …
 
typedef MK_STR(* MkSysStrDupF) (MK_STRN)
 strdup syscall …
 
typedef MK_STR(* MkSysStrNCpyF) (char *, const char *, size_t)
 strdup strncpy …
 
typedef MK_STR(* MkSysStrNDupF) (MK_STRN, size_t)
 strndup syscall …
 
typedef MK_PTR(* MkSysReallocF) (MK_PTR, size_t)
 realloc syscall …
 
typedef void(* MkSysFreeF) (MK_PTR)
 free syscall …
 
typedef pid_t(* MkSysForkF) (void)
 fork syscall …
 
typedef enum MkErrorE(* MkSysWaitF) (MK_OBJN const fmtobj, MK_IDNT const id)
 wait for process to finish syscall with libmkkernel error plugin
 
typedef void(* MkSysExitF) (MK_RT mkrt, int isThread, int num) MK_NO_RETURN
 exit syscall with libmkkernel error plugin
 
typedef enum MkSysPipeHandlerE MkSysPipeHandlerE
 

Enumerations

enum  MkIdSE { MK_ID_UNUSED = 0 , MK_ID_PROCESS = 1 , MK_ID_THREAD = 2 }
 signal type of the MkIdS data valMore...
 
enum  MkSysPipeHandlerE { MK_PIPE_KEEP = 0 , MK_PIPE_IGNORE = 1 }
 

Functions

MK_PTR MkSysCalloc (MK_OBJN fmtobj, size_t const nmemb, size_t const size)
 calloc syscall with libmkkernel error plugin
 
MK_PTR MkSysMalloc (MK_OBJN fmtobj, size_t const size)
 malloc syscall with libmkkernel error plugin
 
MK_STR MkSysStrDup (MK_OBJN fmtobj, MK_STRN const str)
 strdup syscall with libmkkernel error plugin
 
MK_STR MkSysStrNDup (MK_OBJN fmtobj, MK_STRN const str, MK_SIZE const len)
 strndup syscall with libmkkernel error plugin
 
enum MkErrorE MkSysStrNCpy (MK_OBJN fmtobj, MK_STR const to, MK_STRN const from, MK_SIZE const len)
 strncpy syscall with libmkkernel error plugin
 
MK_PTR MkSysRealloc (MK_OBJN fmtobj, MK_PTR const buf, size_t const size)
 realloc syscall with libmkkernel error plugin
 
MK_PTR MkSysReCalloc (MK_OBJN fmtobj, MK_PTR const buf, MK_NUM const oldnum, MK_NUM const addnum, size_t const size)
 realloc syscall with libmkkernel error plugin
 
MK_PTR MkSysMemDup (MK_OBJN fmtobj, MK_PTRN const blck, size_t const size)
 memdup syscall with libmkkernel error plugin
 
MK_STRN_A MkSysStringArrayDup (MK_OBJN fmtobj, MK_STRN_A const strA)
 strdup syscall with libmkkernel error plugin
 
void MkSysFree (MK_PTR pointer)
 free syscall …
 
void MkSysFreeNonNull (MK_PTR pointer)
 
void MkSysFreeP (MK_PTR data)
 free syscall with libmkkernel error plugin
 
void MkSysPrintTrace_RT (MK_RT mkrt, MK_OBJN fmtobj, MK_I32 skip, MK_I32 const num, MK_I32 const debug, MK_STRN const callfunc, MK_I32 const lvl)
 backtrace syscall with libmkkernel error plugin
 
void MkSysPrintProcessMemoryMap_RT (MK_RT mkrt, MK_OBJN fmtobj, MK_I32 const debug, MK_STRN const callfunc, MK_I32 const lvl)
 write the memory-map to MkLogFileC used at MkDisasterSignal
 
MK_STRN MkSysGetTrace_RT (MK_RT mkrt, MK_OBJN fmtobj, MK_I32 skip, MK_I32 const num, MK_I32 const debug, MK_STRN const callfunc, MK_I32 const lvl)
 same as MkSysPrintTrace but return an string…
 
static enum MkErrorE MkSysWaitForProcess (MK_OBJN fmtobj, MK_IDNT const id)
 wait for process to finish syscall with libmkkernel error plugin
 
static enum MkErrorE MkSysWaitForThread (MK_OBJN fmtobj, MK_IDNT const id)
 wait for thread to finish syscall with libmkkernel error plugin
 
static enum MkErrorE MkSysUSleep (MK_OBJN fmtobj, useconds_t const usec)
 usleep syscall with libmkkernel error plugin
 
static enum MkErrorE MkSysSleep (MK_OBJN fmtobj, MK_I32 const sec)
 sleep syscall with libmkkernel error plugin
 
static MK_NO_RETURN void MkSysExit (MK_RT mkrt, int isThread, int num)
 exit syscall with libmkkernel error plugin
 
MK_STR MkSysBasename_RT (MK_RT mkrt, MK_STRN const pathName, bool const includeExtension)
 basename syscall with libmkkernel error plugin
 
MK_STR MkSysDirname_RT (MK_RT mkrt, MK_STRN const pathName)
 dirname syscall with libmkkernel error plugin
 
MK_STR MkSysPrintF_RT (MK_RT mkrt, MK_STRN const format,...)
 sprintf syscall with libmkkernel error plugin
 
enum MkErrorE MkSysGetTimeOfDay (MK_OBJN fmtobj, struct mk_timeval *tv_out, struct mk_timezone *tz_out)
 gettimeofday syscall with libmkkernel error plugin
 
bool MkSysStringSetNULL_R (MK_STRN const str)
 set string to EMPTY
 
bool MkSysStringSet_R (MK_STRN const str, MK_STRN const other)
 set string to value
 
bool MkSysStringIsNULL_R (MK_STRN const str)
 test if string EMPTY
 
static bool MkSysStringIsNULL (MK_STRN str)
 test if string is NULL or EMPTY
 
static bool MkSysStringIsNotNULL (MK_STRN str)
 test if string is NOT NULL or EMPTY
 
bool MkSysStringIsEQUAL (MK_STRN const str, MK_STRN const other)
 test if string(s) are equal …
 
bool MkSysStringIsLenEQUAL (MK_STRN const str, MK_STRN const other, MK_SIZE const len)
 test if string(s) are equal …
 
static MK_STRN MkSysStringGet (MK_STRN str)
 get string NULL or VALUE
 
static MK_STRN MkSysStringGetNoNULL (MK_STRN str)
 get string "" or VALUE
 
MK_STRN MkSysHashSTR (MK_STRN key, MK_NUM length)
 compute the HASH from a string …
 
MK_I32 MkSysHashI32 (MK_STRN key, MK_NUM length)
 same as MkSysHashSTR but return MK_I32
 
enum MkErrorE MkSysKill (MK_OBJN fmtobj, MK_I32 pid, MK_I32 signal)
 kill syscall with libmkkernel error plugin
 
enum MkErrorE MkSysGetPid (MK_OBJN fmtobj, MK_I32 *pid_out)
 getpid syscall with libmkkernel error plugin
 
void MkSysPipeHandler (MkSysPipeHandlerE keepPipe)
 internal support for pipe ignore
 

Variables

struct MkLalS MkLal
 Language Abstraction Layer in duty.
 

MkObjectC - MkObjectC_Sys_C_API - overload

#define MkSysCalloc_2(nmemb, size)
 
#define MkSysKill_2(pid, signal)
 
#define MkSysKill_E(...)
 
#define MkSysKill_C(...)
 
#define MkSysMalloc_1(size)
 
#define MkSysMemDup_2(blck, size)
 
#define MkSysReCalloc_4(buf, oldnum, addnum, size)
 
#define MkSysRealloc_2(buf, size)
 
#define MkSysSleep_1(sec)
 
#define MkSysSleep_E(...)
 
#define MkSysSleep_C(...)
 
#define MkSysStrDup_1(str)
 
#define MkSysStrNCpy_3(to, from, len)
 
#define MkSysStrNCpy_E(...)
 
#define MkSysStrNCpy_C(...)
 
#define MkSysStrNDup_2(str, len)
 
#define MkSysStringArrayDup_1(strA)
 
#define MkSysUSleep_1(usec)
 
#define MkSysUSleep_E(...)
 
#define MkSysUSleep_C(...)
 
#define MkSysWaitForProcess_1(id)
 
#define MkSysWaitForProcess_E(...)
 
#define MkSysWaitForProcess_C(...)
 
#define MkSysWaitForThread_1(id)
 
#define MkSysWaitForThread_E(...)
 
#define MkSysWaitForThread_C(...)
 
#define MkSysGetPid_1(pid_out)
 
#define MkSysGetPid_E(...)
 
#define MkSysGetPid_C(...)
 
#define MkSysGetPid_e(...)
 
#define MkSysGetTimeOfDay_2(tv_out, tz_out)
 
#define MkSysGetTimeOfDay_E(...)
 
#define MkSysGetTimeOfDay_C(...)
 
#define MkSysBasename_NULL(...)
 
#define MkSysBasename(...)
 
#define MkSysDirname_NULL(...)
 
#define MkSysDirname(...)
 
#define MkSysGetTrace_NULL(...)
 
#define MkSysGetTrace(...)
 
#define MkSysGetTrace_5(fmtobj, skip, num, debug, callfunc)
 
#define MkSysGetTrace_4(fmtobj, skip, num, debug)
 
#define MkSysGetTrace_3(fmtobj, skip, num)
 
#define MkSysGetTrace_2(fmtobj, skip)
 
#define MkSysGetTrace_1(fmtobj)
 
#define MkSysGetTrace_0()
 
#define MkSysHashI32_1(key)
 
#define MkSysHashSTR_1(key)
 
#define MkSysPrintF_NULL(...)
 
#define MkSysPrintF(...)
 
#define MkSysPrintProcessMemoryMap_NULL(...)
 
#define MkSysPrintProcessMemoryMap(...)
 
#define MkSysPrintProcessMemoryMap_3(fmtobj, debug, callfunc)
 
#define MkSysPrintProcessMemoryMap_2(fmtobj, debug)
 
#define MkSysPrintProcessMemoryMap_1(fmtobj)
 
#define MkSysPrintProcessMemoryMap_0()
 
#define MkSysPrintTrace_NULL(...)
 
#define MkSysPrintTrace(...)
 
#define MkSysPrintTrace_5(fmtobj, skip, num, debug, callfunc)
 
#define MkSysPrintTrace_4(fmtobj, skip, num, debug)
 
#define MkSysPrintTrace_3(fmtobj, skip, num)
 
#define MkSysPrintTrace_2(fmtobj, skip)
 
#define MkSysPrintTrace_1(fmtobj)
 
#define MkSysPrintTrace_0()
 

Detailed Description

MkObjectC - L)anguage A)bstraction L)ayer definition …

The LAL is required to give the target of embedding a change to modify the access to system functions. RUBY for example has it's own Thread-Creation function.

All wrappers to access the underlying OS,Languages and system functions are located in this section. Every external Function has additional code to map the OS/System specific error codes/messages into a libmkkernel specific error codes/messages

Macro Definition Documentation

◆ MkSysBasename

#define MkSysBasename ( ...)
Value:
MK_STR MkSysBasename_RT(MK_RT mkrt, MK_STRN const pathName, bool const includeExtension)
basename syscall with libmkkernel error plugin
#define MK_RT_CALL

Definition at line 1715 of file kernel_overload_mk.h.

◆ MkSysBasename_NULL

#define MkSysBasename_NULL ( ...)
Value:
#define MK_RT_CALL_NULL

Definition at line 1714 of file kernel_overload_mk.h.

◆ MkSysCalloc_2

#define MkSysCalloc_2 ( nmemb,
size )
Value:
MkSysCalloc(NULL,nmemb,size)
MK_PTR MkSysCalloc(MK_OBJN fmtobj, size_t const nmemb, size_t const size)
calloc syscall with libmkkernel error plugin

Definition at line 1677 of file kernel_overload_mk.h.

◆ MkSysDirname

#define MkSysDirname ( ...)
Value:
MK_STR MkSysDirname_RT(MK_RT mkrt, MK_STRN const pathName)
dirname syscall with libmkkernel error plugin

Definition at line 1717 of file kernel_overload_mk.h.

◆ MkSysDirname_NULL

#define MkSysDirname_NULL ( ...)
Value:

Definition at line 1716 of file kernel_overload_mk.h.

◆ MkSysFree

#define MkSysFree ( pointer)
Value:
do { \
if ( likely((pointer) != (NULL)) ) { \
(*MkLal.SysFree)((MK_PTR)pointer); \
(pointer) = (NULL); \
} \
} while (0)
#define likely(x)
MK_PTRB * MK_PTR
generic pointer data-type
struct MkLalS MkLal
Language Abstraction Layer in duty.
MkSysFreeF SysFree
free syscall …

Definition at line 2688 of file LibMkKernel_mk.h.

2688#define MkSysFree(pointer) \
2689 do { \
2690 if ( likely((pointer) != (NULL)) ) { \
2691 (*MkLal.SysFree)((MK_PTR)pointer); \
2692 (pointer) = (NULL); \
2693 } \
2694 } while (0)

◆ MkSysFreeNonNull

#define MkSysFreeNonNull ( pointer)
Value:
(*MkLal.SysFree)((MK_PTR)pointer)

Definition at line 2697 of file LibMkKernel_mk.h.

◆ MkSysGetPid_1

#define MkSysGetPid_1 ( pid_out)
Value:
MkSysGetPid(NULL,pid_out)
enum MkErrorE MkSysGetPid(MK_OBJN fmtobj, MK_I32 *pid_out)
getpid syscall with libmkkernel error plugin

Definition at line 1705 of file kernel_overload_mk.h.

◆ MkSysGetPid_C

#define MkSysGetPid_C ( ...)
Value:
if (MkErrorCheckI(MkSysGetPid(__VA_ARGS__)))
#define MkErrorCheckI(err)

Definition at line 1707 of file kernel_overload_mk.h.

◆ MkSysGetPid_E

#define MkSysGetPid_E ( ...)
Value:
#define MkErrorCheck(err)
check return-code and goto error on error …

Definition at line 1706 of file kernel_overload_mk.h.

◆ MkSysGetPid_e

#define MkSysGetPid_e ( ...)
Value:
MK_EMBEDDED(MK_I32,MkSysGetPid,__VA_ARGS__)
signed int MK_I32
4 byte integer data-type

Definition at line 1708 of file kernel_overload_mk.h.

◆ MkSysGetTimeOfDay_2

#define MkSysGetTimeOfDay_2 ( tv_out,
tz_out )
Value:
MkSysGetTimeOfDay(NULL,tv_out,tz_out)
enum MkErrorE MkSysGetTimeOfDay(MK_OBJN fmtobj, struct mk_timeval *tv_out, struct mk_timezone *tz_out)
gettimeofday syscall with libmkkernel error plugin

Definition at line 1709 of file kernel_overload_mk.h.

◆ MkSysGetTimeOfDay_C

#define MkSysGetTimeOfDay_C ( ...)
Value:
if (MkErrorCheckI(MkSysGetTimeOfDay(__VA_ARGS__)))

Definition at line 1711 of file kernel_overload_mk.h.

◆ MkSysGetTimeOfDay_E

#define MkSysGetTimeOfDay_E ( ...)
Value:

Definition at line 1710 of file kernel_overload_mk.h.

◆ MkSysGetTrace

#define MkSysGetTrace ( ...)
Value:
MK_STRN MkSysGetTrace_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_I32 skip, MK_I32 const num, MK_I32 const debug, MK_STRN const callfunc, MK_I32 const lvl)
same as MkSysPrintTrace but return an string…

Definition at line 1719 of file kernel_overload_mk.h.

◆ MkSysGetTrace_0

#define MkSysGetTrace_0 ( )
Value:
MkSysGetTrace(NULL,0,-1,0,__func__,0)
#define MkSysGetTrace(...)

Definition at line 1725 of file kernel_overload_mk.h.

◆ MkSysGetTrace_1

#define MkSysGetTrace_1 ( fmtobj)
Value:
MkSysGetTrace(fmtobj,0,-1,0,__func__,0)

Definition at line 1724 of file kernel_overload_mk.h.

◆ MkSysGetTrace_2

#define MkSysGetTrace_2 ( fmtobj,
skip )
Value:
MkSysGetTrace(fmtobj,skip,-1,0,__func__,0)

Definition at line 1723 of file kernel_overload_mk.h.

◆ MkSysGetTrace_3

#define MkSysGetTrace_3 ( fmtobj,
skip,
num )
Value:
MkSysGetTrace(fmtobj,skip,num,0,__func__,0)

Definition at line 1722 of file kernel_overload_mk.h.

◆ MkSysGetTrace_4

#define MkSysGetTrace_4 ( fmtobj,
skip,
num,
debug )
Value:
MkSysGetTrace(fmtobj,skip,num,debug,__func__,0)

Definition at line 1721 of file kernel_overload_mk.h.

◆ MkSysGetTrace_5

#define MkSysGetTrace_5 ( fmtobj,
skip,
num,
debug,
callfunc )
Value:
MkSysGetTrace(fmtobj,skip,num,debug,callfunc,0)

Definition at line 1720 of file kernel_overload_mk.h.

◆ MkSysGetTrace_NULL

#define MkSysGetTrace_NULL ( ...)
Value:

Definition at line 1718 of file kernel_overload_mk.h.

◆ MkSysHashI32_1

#define MkSysHashI32_1 ( key)
Value:
MkSysHashI32(key,-1)
MK_I32 MkSysHashI32(MK_STRN key, MK_NUM length)
same as MkSysHashSTR but return MK_I32 …

Definition at line 1726 of file kernel_overload_mk.h.

◆ MkSysHashSTR_1

#define MkSysHashSTR_1 ( key)
Value:
MkSysHashSTR(key,-1)
MK_STRN MkSysHashSTR(MK_STRN key, MK_NUM length)
compute the HASH from a string …

Definition at line 1727 of file kernel_overload_mk.h.

◆ MkSysKill_2

#define MkSysKill_2 ( pid,
signal )
Value:
MkSysKill(NULL,pid,signal)
enum MkErrorE MkSysKill(MK_OBJN fmtobj, MK_I32 pid, MK_I32 signal)
kill syscall with libmkkernel error plugin

Definition at line 1678 of file kernel_overload_mk.h.

◆ MkSysKill_C

#define MkSysKill_C ( ...)
Value:
if (MkErrorCheckI(MkSysKill(__VA_ARGS__)))

Definition at line 1680 of file kernel_overload_mk.h.

◆ MkSysKill_E

#define MkSysKill_E ( ...)
Value:
MkErrorCheck(MkSysKill(__VA_ARGS__))

Definition at line 1679 of file kernel_overload_mk.h.

◆ MkSysMalloc_1

#define MkSysMalloc_1 ( size)
Value:
MkSysMalloc(NULL,size)
MK_PTR MkSysMalloc(MK_OBJN fmtobj, size_t const size)
malloc syscall with libmkkernel error plugin

Definition at line 1681 of file kernel_overload_mk.h.

◆ MkSysMemDup_2

#define MkSysMemDup_2 ( blck,
size )
Value:
MkSysMemDup(NULL,blck,size)
MK_PTR MkSysMemDup(MK_OBJN fmtobj, MK_PTRN const blck, size_t const size)
memdup syscall with libmkkernel error plugin

Definition at line 1682 of file kernel_overload_mk.h.

◆ MkSysPrintF

#define MkSysPrintF ( ...)
Value:
MK_STR MkSysPrintF_RT(MK_RT mkrt, MK_STRN const format,...)
sprintf syscall with libmkkernel error plugin

Definition at line 1729 of file kernel_overload_mk.h.

◆ MkSysPrintF_NULL

#define MkSysPrintF_NULL ( ...)
Value:

Definition at line 1728 of file kernel_overload_mk.h.

◆ MkSysPrintProcessMemoryMap

#define MkSysPrintProcessMemoryMap ( ...)
Value:
void MkSysPrintProcessMemoryMap_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_I32 const debug, MK_STRN const callfunc, MK_I32 const lvl)
write the memory-map to MkLogFileC used at MkDisasterSignal …

Definition at line 1731 of file kernel_overload_mk.h.

◆ MkSysPrintProcessMemoryMap_0

#define MkSysPrintProcessMemoryMap_0 ( )
Value:
MkSysPrintProcessMemoryMap(NULL,0,__func__,0)
#define MkSysPrintProcessMemoryMap(...)

Definition at line 1735 of file kernel_overload_mk.h.

◆ MkSysPrintProcessMemoryMap_1

#define MkSysPrintProcessMemoryMap_1 ( fmtobj)
Value:
MkSysPrintProcessMemoryMap(fmtobj,0,__func__,0)

Definition at line 1734 of file kernel_overload_mk.h.

◆ MkSysPrintProcessMemoryMap_2

#define MkSysPrintProcessMemoryMap_2 ( fmtobj,
debug )
Value:
MkSysPrintProcessMemoryMap(fmtobj,debug,__func__,0)

Definition at line 1733 of file kernel_overload_mk.h.

◆ MkSysPrintProcessMemoryMap_3

#define MkSysPrintProcessMemoryMap_3 ( fmtobj,
debug,
callfunc )
Value:
MkSysPrintProcessMemoryMap(fmtobj,debug,callfunc,0)

Definition at line 1732 of file kernel_overload_mk.h.

◆ MkSysPrintProcessMemoryMap_NULL

#define MkSysPrintProcessMemoryMap_NULL ( ...)
Value:

Definition at line 1730 of file kernel_overload_mk.h.

◆ MkSysPrintTrace

#define MkSysPrintTrace ( ...)
Value:
void MkSysPrintTrace_RT(MK_RT mkrt, MK_OBJN fmtobj, MK_I32 skip, MK_I32 const num, MK_I32 const debug, MK_STRN const callfunc, MK_I32 const lvl)
backtrace syscall with libmkkernel error plugin

Definition at line 1737 of file kernel_overload_mk.h.

◆ MkSysPrintTrace_0

#define MkSysPrintTrace_0 ( )
Value:
MkSysPrintTrace(NULL,0,-1,0,__func__,0)
#define MkSysPrintTrace(...)

Definition at line 1743 of file kernel_overload_mk.h.

◆ MkSysPrintTrace_1

#define MkSysPrintTrace_1 ( fmtobj)
Value:
MkSysPrintTrace(fmtobj,0,-1,0,__func__,0)

Definition at line 1742 of file kernel_overload_mk.h.

◆ MkSysPrintTrace_2

#define MkSysPrintTrace_2 ( fmtobj,
skip )
Value:
MkSysPrintTrace(fmtobj,skip,-1,0,__func__,0)

Definition at line 1741 of file kernel_overload_mk.h.

◆ MkSysPrintTrace_3

#define MkSysPrintTrace_3 ( fmtobj,
skip,
num )
Value:
MkSysPrintTrace(fmtobj,skip,num,0,__func__,0)

Definition at line 1740 of file kernel_overload_mk.h.

◆ MkSysPrintTrace_4

#define MkSysPrintTrace_4 ( fmtobj,
skip,
num,
debug )
Value:
MkSysPrintTrace(fmtobj,skip,num,debug,__func__,0)

Definition at line 1739 of file kernel_overload_mk.h.

◆ MkSysPrintTrace_5

#define MkSysPrintTrace_5 ( fmtobj,
skip,
num,
debug,
callfunc )
Value:
MkSysPrintTrace(fmtobj,skip,num,debug,callfunc,0)

Definition at line 1738 of file kernel_overload_mk.h.

◆ MkSysPrintTrace_NULL

#define MkSysPrintTrace_NULL ( ...)
Value:

Definition at line 1736 of file kernel_overload_mk.h.

◆ MkSysRealloc_2

#define MkSysRealloc_2 ( buf,
size )
Value:
MkSysRealloc(NULL,buf,size)
MK_PTR MkSysRealloc(MK_OBJN fmtobj, MK_PTR const buf, size_t const size)
realloc syscall with libmkkernel error plugin

Definition at line 1684 of file kernel_overload_mk.h.

◆ MkSysReCalloc_4

#define MkSysReCalloc_4 ( buf,
oldnum,
addnum,
size )
Value:
MkSysReCalloc(NULL,buf,oldnum,addnum,size)
MK_PTR MkSysReCalloc(MK_OBJN fmtobj, MK_PTR const buf, MK_NUM const oldnum, MK_NUM const addnum, size_t const size)
realloc syscall with libmkkernel error plugin

Definition at line 1683 of file kernel_overload_mk.h.

◆ MkSysSleep_1

#define MkSysSleep_1 ( sec)
Value:
MkSysSleep(NULL,sec)
static enum MkErrorE MkSysSleep(MK_OBJN fmtobj, MK_I32 const sec)
sleep syscall with libmkkernel error plugin

Definition at line 1685 of file kernel_overload_mk.h.

◆ MkSysSleep_C

#define MkSysSleep_C ( ...)
Value:
if (MkErrorCheckI(MkSysSleep(__VA_ARGS__)))

Definition at line 1687 of file kernel_overload_mk.h.

◆ MkSysSleep_E

#define MkSysSleep_E ( ...)
Value:
MkErrorCheck(MkSysSleep(__VA_ARGS__))

Definition at line 1686 of file kernel_overload_mk.h.

◆ MkSysStrDup_1

#define MkSysStrDup_1 ( str)
Value:
MkSysStrDup(NULL,str)
MK_STR MkSysStrDup(MK_OBJN fmtobj, MK_STRN const str)
strdup syscall with libmkkernel error plugin

Definition at line 1688 of file kernel_overload_mk.h.

◆ MkSysStringArrayDup_1

#define MkSysStringArrayDup_1 ( strA)
Value:
MK_STRN_A MkSysStringArrayDup(MK_OBJN fmtobj, MK_STRN_A const strA)
strdup syscall with libmkkernel error plugin

Definition at line 1693 of file kernel_overload_mk.h.

◆ MkSysStringIsEQUAL

#define MkSysStringIsEQUAL ( _str,
_other )
Value:
(strcmp(_str,_other) == 0)

Definition at line 2917 of file LibMkKernel_mk.h.

◆ MkSysStringIsLenEQUAL

#define MkSysStringIsLenEQUAL ( _str,
_other,
_len )
Value:
(strncmp(_str,_other,(size_t)_len) == 0)

Definition at line 2921 of file LibMkKernel_mk.h.

◆ MkSysStringIsNULL_R

#define MkSysStringIsNULL_R ( _str)
Value:
(_str[0] == '\0')

Definition at line 2903 of file LibMkKernel_mk.h.

◆ MkSysStringSet_R

#define MkSysStringSet_R ( _str,
_val )
Value:
strcpy(_str,_val)

Definition at line 2899 of file LibMkKernel_mk.h.

◆ MkSysStringSetNULL_R

#define MkSysStringSetNULL_R ( _str)
Value:
_str[0] = '\0'

Definition at line 2895 of file LibMkKernel_mk.h.

◆ MkSysStrNCpy_3

#define MkSysStrNCpy_3 ( to,
from,
len )
Value:
MkSysStrNCpy(NULL,to,from,len)
enum MkErrorE MkSysStrNCpy(MK_OBJN fmtobj, MK_STR const to, MK_STRN const from, MK_SIZE const len)
strncpy syscall with libmkkernel error plugin

Definition at line 1689 of file kernel_overload_mk.h.

◆ MkSysStrNCpy_C

#define MkSysStrNCpy_C ( ...)
Value:
if (MkErrorCheckI(MkSysStrNCpy(__VA_ARGS__)))

Definition at line 1691 of file kernel_overload_mk.h.

◆ MkSysStrNCpy_E

#define MkSysStrNCpy_E ( ...)
Value:

Definition at line 1690 of file kernel_overload_mk.h.

◆ MkSysStrNDup_2

#define MkSysStrNDup_2 ( str,
len )
Value:
MkSysStrNDup(NULL,str,len)
MK_STR MkSysStrNDup(MK_OBJN fmtobj, MK_STRN const str, MK_SIZE const len)
strndup syscall with libmkkernel error plugin

Definition at line 1692 of file kernel_overload_mk.h.

◆ MkSysUSleep_1

#define MkSysUSleep_1 ( usec)
Value:
MkSysUSleep(NULL,usec)
static enum MkErrorE MkSysUSleep(MK_OBJN fmtobj, useconds_t const usec)
usleep syscall with libmkkernel error plugin

Definition at line 1694 of file kernel_overload_mk.h.

◆ MkSysUSleep_C

#define MkSysUSleep_C ( ...)
Value:
if (MkErrorCheckI(MkSysUSleep(__VA_ARGS__)))

Definition at line 1696 of file kernel_overload_mk.h.

◆ MkSysUSleep_E

#define MkSysUSleep_E ( ...)
Value:

Definition at line 1695 of file kernel_overload_mk.h.

◆ MkSysWaitForProcess_1

#define MkSysWaitForProcess_1 ( id)
Value:
static enum MkErrorE MkSysWaitForProcess(MK_OBJN fmtobj, MK_IDNT const id)
wait for process to finish syscall with libmkkernel error plugin

Definition at line 1697 of file kernel_overload_mk.h.

◆ MkSysWaitForProcess_C

#define MkSysWaitForProcess_C ( ...)
Value:

Definition at line 1699 of file kernel_overload_mk.h.

◆ MkSysWaitForProcess_E

#define MkSysWaitForProcess_E ( ...)
Value:

Definition at line 1698 of file kernel_overload_mk.h.

◆ MkSysWaitForThread_1

#define MkSysWaitForThread_1 ( id)
Value:
static enum MkErrorE MkSysWaitForThread(MK_OBJN fmtobj, MK_IDNT const id)
wait for thread to finish syscall with libmkkernel error plugin

Definition at line 1700 of file kernel_overload_mk.h.

◆ MkSysWaitForThread_C

#define MkSysWaitForThread_C ( ...)
Value:

Definition at line 1702 of file kernel_overload_mk.h.

◆ MkSysWaitForThread_E

#define MkSysWaitForThread_E ( ...)
Value:

Definition at line 1701 of file kernel_overload_mk.h.

Typedef Documentation

◆ MK_IDNT

typedef uintptr_t MK_IDNT

process or thread identifier …

Definition at line 2159 of file LibMkKernel_mk.h.

◆ MkSysCallocF

typedef MK_PTR(* MkSysCallocF) (size_t, size_t)

calloc syscall …

additional info: man calloc

Definition at line 2405 of file LibMkKernel_mk.h.

◆ MkSysExitF

typedef void(* MkSysExitF) (MK_RT mkrt, int isThread, int num) MK_NO_RETURN

exit syscall with libmkkernel error plugin

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]isThreadexit a thread?
[in]numexit code
Attention
No MK_NO_RETURN besause the MkSysExit can be an overload with MkLalS::MkSysExitCB

Example:

MK_NO_RETURN static void SysExit (
int isThread,
int num
) {
if (isThread) {
#if META_HAS_THREAD
# if defined(HAVE_PTHREAD)
/*
int state;
pthread_attr_t attr;
pthread_getattr_np(pthread_self(), &attr);
pthread_attr_getdetachstate(&attr, &state);
if (state == PTHREAD_CREATE_DETACHED)
pthread_detach(pthread_self());
*/
// BUG-FIX-pthread_detach
// "pthread_detach" disable "pthread_join" an create a "random-crash" in "MkSysWait" called by "pIoDelete"
pthread_exit(NULL);
# elif defined(META_IS_WINDOWS)
_endthreadex(num);
# endif
#endif /* META_HAS_THREAD */
#if 1
}
exit(num);
#define MK_NO_RETURN
dosable "MK_NO_RETURN" because C# require "return" from "MqExit" for thread-pool support
#define MK_RT_ARGS
#else
} else {
Attention
no MK_NO_RETURN besause the MkSysExitF can be an overload with MkLalS::MkSysExitCB

Definition at line 2461 of file LibMkKernel_mk.h.

◆ MkSysForkF

typedef pid_t(* MkSysForkF) (void)

fork syscall …

additional info: man fork

Returns
the process identifier of the new child (in the parent process) or 0 (in the child process)

Definition at line 2441 of file LibMkKernel_mk.h.

◆ MkSysFreeF

typedef void(* MkSysFreeF) (MK_PTR)

free syscall …

additional info: man free

Definition at line 2435 of file LibMkKernel_mk.h.

◆ MkSysMallocF

typedef MK_PTR(* MkSysMallocF) (size_t)

malloc syscall …

additional info: man malloc

Definition at line 2410 of file LibMkKernel_mk.h.

◆ MkSysPipeHandlerE

◆ MkSysReallocF

typedef MK_PTR(* MkSysReallocF) (MK_PTR, size_t)

realloc syscall …

additional info: man realloc

Definition at line 2430 of file LibMkKernel_mk.h.

◆ MkSysStrDupF

typedef MK_STR(* MkSysStrDupF) (MK_STRN)

strdup syscall …

additional info: man strdup

Definition at line 2415 of file LibMkKernel_mk.h.

◆ MkSysStrNCpyF

typedef MK_STR(* MkSysStrNCpyF) (char *, const char *, size_t)

strdup strncpy …

additional info: man strncpy

Definition at line 2420 of file LibMkKernel_mk.h.

◆ MkSysStrNDupF

typedef MK_STR(* MkSysStrNDupF) (MK_STRN, size_t)

strndup syscall …

additional info: man strndup

Definition at line 2425 of file LibMkKernel_mk.h.

◆ MkSysWaitF

typedef enum MkErrorE(* MkSysWaitF) (MK_OBJN const fmtobj, MK_IDNT const id)

wait for process to finish syscall with libmkkernel error plugin

Parameters
[in]fmtobjmanaged object used to format the log-message (default=MK_NULL → use default-format)
[in]idprocess handle
Returns
The MkErrorE status from the DEFAULT MkErrorC in MkRuntimeS::error_mk
See also
MkSysWaitForProcess, MkSysWaitForThread

Definition at line 2441 of file LibMkKernel_mk.h.

Enumeration Type Documentation

◆ MkIdSE

enum MkIdSE

signal type of the MkIdS data val

Enumerator
MK_ID_UNUSED 

empty struct

MK_ID_PROCESS 

val has a process handle

MK_ID_THREAD 

val has a thread handle

Definition at line 2164 of file LibMkKernel_mk.h.

2164 {
2165 MK_ID_UNUSED = 0,
2166 MK_ID_PROCESS = 1,
2167 MK_ID_THREAD = 2
2168};
@ MK_ID_THREAD
val has a thread handle
@ MK_ID_PROCESS
val has a process handle
@ MK_ID_UNUSED
empty struct

◆ MkSysPipeHandlerE

Enumerator
MK_PIPE_KEEP 
MK_PIPE_IGNORE 

Definition at line 3012 of file LibMkKernel_mk.h.

3012 {
3013 MK_PIPE_KEEP = 0,
3014 MK_PIPE_IGNORE = 1
MkSysPipeHandlerE
@ MK_PIPE_KEEP
@ MK_PIPE_IGNORE

Function Documentation

◆ MkSysBasename_RT()

MK_STR MkSysBasename_RT ( MK_RT mkrt,
MK_STRN const pathName,
bool const includeExtension )

basename syscall with libmkkernel error plugin

additional info: man basename

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]pathNameThe path to extract the basename from. The value of pathName will not be changed and for MK_NULL return unknown
[in]includeExtensionadd extension like '.exe' to the filename (true or false)
Returns
the basename of in (it is save to modify the basename for additional needs) or NULL if pathName is NULL.
Attention
  • The memory returned is owned by MkSysBasename and must not be freed.
  • This function is not reentrant.
  • the maximum size of the string returned is 128 bytes (MkRuntimeS_mk.h->MkSysBasename_size)
  • the maximum size of the pathName is 256

◆ MkSysCalloc()

MK_PTR MkSysCalloc ( MK_OBJN fmtobj,
size_t const nmemb,
size_t const size )

calloc syscall with libmkkernel error plugin

additional info: man calloc

Parameters
[in]fmtobjmanaged object used to format the log-message (default=MK_NULL → use default-format)
[in]nmembthe number of members in the memory block
[in]sizethe size of a single memory block
Returns
a pointer to the new memory block initialized with '0'

◆ MkSysDirname_RT()

MK_STR MkSysDirname_RT ( MK_RT mkrt,
MK_STRN const pathName )

dirname syscall with libmkkernel error plugin

additional info: man dirname

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]pathNamepath to extract the dirname from (value of in will not be changed)
Returns
the dirname of in (it is save to modify the dirname for additional needs) or NULL if pathName is NULL.
Attention
  • The memory returned is owned by MkSysDirname and must not be freed.
  • This function is not reentrant.
  • the maximum size of the string returned is 128 bytes (MkRuntimeS_mk.h->MkSysDirname_size)
  • the maximum size of the pathName is 256

◆ MkSysExit()

static MK_NO_RETURN void MkSysExit ( MK_RT mkrt,
int isThread,
int num )
inlinestatic

exit syscall with libmkkernel error plugin

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]isThreadexit a thread?
[in]numexit code
Attention
No MK_NO_RETURN besause the MkSysExit can be an overload with MkLalS::MkSysExitCB

Definition at line 2816 of file LibMkKernel_mk.h.

2820 {
2821 (*MkLal.MkSysExitCB)(MK_RT_CALL isThread,num);
2822};
MkSysExitF MkSysExitCB
exit syscall with libmkkernel error plugin

◆ MkSysFree()

void MkSysFree ( MK_PTR pointer)

free syscall …

additional info: man free

Parameters
[in,out]pointerof the memory-block to delete, the pointer will be set to MK_NULL

◆ MkSysFreeNonNull()

void MkSysFreeNonNull ( MK_PTR pointer)

◆ MkSysFreeP()

void MkSysFreeP ( MK_PTR data)

free syscall with libmkkernel error plugin

additional info: man free Free memory of data if data is not MK_NULL.

Parameters
[in]datablock to be freed

◆ MkSysGetPid()

enum MkErrorE MkSysGetPid ( MK_OBJN fmtobj,
MK_I32 * pid_out )

getpid syscall with libmkkernel error plugin

additional info: man 3 getpid

Parameters
[in]fmtobjmanaged object used to format the log-message (default=MK_NULL → use default-format)
[out]pid_outthe own pid
Returns
The MkErrorE status from the DEFAULT MkErrorC in MkRuntimeS::error_mk

◆ MkSysGetTimeOfDay()

enum MkErrorE MkSysGetTimeOfDay ( MK_OBJN fmtobj,
struct mk_timeval * tv_out,
struct mk_timezone * tz_out )

gettimeofday syscall with libmkkernel error plugin

additional info: man gettimeofday

Parameters
[in]fmtobjmanaged object used to format the log-message (default=MK_NULL → use default-format)
[out]tv_outthe timeval object
[out]tz_outthe timezone object
Returns
The MkErrorE status from the DEFAULT MkErrorC in MkRuntimeS::error_mk

◆ MkSysGetTrace_RT()

MK_STRN MkSysGetTrace_RT ( MK_RT mkrt,
MK_OBJN fmtobj,
MK_I32 skip,
MK_I32 const num,
MK_I32 const debug,
MK_STRN const callfunc,
MK_I32 const lvl )

same as MkSysPrintTrace but return an string…

◆ MkSysHashI32()

MK_I32 MkSysHashI32 ( MK_STRN key,
MK_NUM length )

same as MkSysHashSTR but return MK_I32

Parameters
keykey from which to compute hash value.
lengthlength from key, if "<0" the size will be computed

◆ MkSysHashSTR()

MK_STRN MkSysHashSTR ( MK_STRN key,
MK_NUM length )

compute the HASH from a string …

The hash-value is computed with the fast TCL hash-function

doc from tcl

I tried a zillion different hash functions and asked many other people for advice. Many people had their own favorite functions, all different, but no-one had much idea why they were good ones. I chose the one below (multiply by 9 and add new character) because of the following reasons:

  1. Multiplying by 10 is perfect for keys that are decimal strings, and multiplying by 9 is just about as good.
  2. Times-9 is (shift-left-3) plus (old). This means that each character's bits hang around in the low-order bits of the hash value for ever, plus they spread fairly rapidly up to the high-order bits to fill out the hash value. This seems works well both for decimal and non-decimal strings.

Note that this function is very weak against malicious strings; it's very easy to generate multiple keys that have the same hashcode. On the other hand, that hardly ever actually occurs and this function is very cheap, even by comparison with industry-standard hashes like FNV. If real strength of hash is required though, use a custom hash based on Bob Jenkins's lookup3(), but be aware that it's significantly slower. Tcl does not use that level of strength because it typically does not need it (and some of the aspects of that strength are genuinely unnecessary given the rest of Tcl's hash machinery, and the fact that we do not either transfer hashes to another machine, use them as a true substitute for equality, or attempt to minimize work in rebuilding the hash table).

  • See also HashStringKey in tclHash.c
  • See also HashString in tclLiteral.c

See [tcl-Feature Request #2958832]

Returns
the hash value as unsigned 32bit integer, and optional the hash-value as string (sprint("%08X")) in hex
Parameters
keykey from which to compute hash value.
lengthlength from key, if "<0" the size will be computed

◆ MkSysKill()

enum MkErrorE MkSysKill ( MK_OBJN fmtobj,
MK_I32 pid,
MK_I32 signal )

kill syscall with libmkkernel error plugin

additional info: man 3 kill

Parameters
[in]fmtobjmanaged object used to format the log-message (default=MK_NULL → use default-format)
[in]pidthe process to kill
[in]signalthe signal to send
Returns
The MkErrorE status from the DEFAULT MkErrorC in MkRuntimeS::error_mk

◆ MkSysMalloc()

MK_PTR MkSysMalloc ( MK_OBJN fmtobj,
size_t const size )

malloc syscall with libmkkernel error plugin

additional info: man malloc

Parameters
[in]fmtobjmanaged object used to format the log-message (default=MK_NULL → use default-format)
[in]sizethe size of the new memory block
Returns
a pointer to the new memory block

◆ MkSysMemDup()

MK_PTR MkSysMemDup ( MK_OBJN fmtobj,
MK_PTRN const blck,
size_t const size )

memdup syscall with libmkkernel error plugin

additional info: like strdup but for ordinary memory

Parameters
[in]fmtobjmanaged object used to format the log-message (default=MK_NULL → use default-format)
[in]blckthe old memory block to duplicate
[in]sizethe size of the memory in buf
Returns
a pointer to the new memory block
+ Here is the caller graph for this function:

◆ MkSysPipeHandler()

void MkSysPipeHandler ( MkSysPipeHandlerE keepPipe)

internal support for pipe ignore

◆ MkSysPrintF_RT()

MK_STR MkSysPrintF_RT ( MK_RT mkrt,
MK_STRN const format,
... )

sprintf syscall with libmkkernel error plugin

additional info: man sprintf

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]formatthe format string
Returns
the new string required or NULL if format was NULL.
Attention
  • The memory returned is owned by MkSysPrintF and must not be freed.
  • The memory returned is valid until the next call to MkSysPrintF in the same thread.
  • Use MkSysStrDup to create a permanent copy.

◆ MkSysPrintProcessMemoryMap_RT()

void MkSysPrintProcessMemoryMap_RT ( MK_RT mkrt,
MK_OBJN fmtobj,
MK_I32 const debug,
MK_STRN const callfunc,
MK_I32 const lvl )

write the memory-map to MkLogFileC used at MkDisasterSignal

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]fmtobjmanaged object used to format the log-message (default=MK_NULL → use default-format)
[in]debugthe debug level from MkRuntimeS::debug, use 0 <= debug <= 9 (default=0)
[in]callfunca user-defined postfix to identify the calling function or the environment (default=name-of-function)
[in]lvla user-defined prefix starting with "" for lvl=0 and increase with " " for lvl+1 (default=0)

◆ MkSysPrintTrace_RT()

void MkSysPrintTrace_RT ( MK_RT mkrt,
MK_OBJN fmtobj,
MK_I32 skip,
MK_I32 const num,
MK_I32 const debug,
MK_STRN const callfunc,
MK_I32 const lvl )

backtrace syscall with libmkkernel error plugin

docu from libbacktrace

Get a full stack backtrace. SKIP is the number of frames to skip; passing 0 will start the trace with the function calling backtrace_full. DATA is passed to the callback routine. If any call to CALLBACK returns a non-zero value, the stack backtrace stops, and backtrace returns that value; this may be used to limit the number of stack frames desired. If all calls to CALLBACK return 0, backtrace returns 0. The backtrace_full function will make at least one call to either CALLBACK or ERROR_CALLBACK. This function requires debug info for the executable.

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]fmtobjmanaged object used to format the log-message (default=MK_NULL → use default-format)
[in]skipthe number of of frames to skip
[in]numthe number of traces to print
[in]debugthe debug level from MkRuntimeS::debug, use 0 <= debug <= 9 (default=0)
[in]callfunca user-defined postfix to identify the calling function or the environment (default=name-of-function)
[in]lvla user-defined prefix starting with "" for lvl=0 and increase with " " for lvl+1 (default=0)

◆ MkSysRealloc()

MK_PTR MkSysRealloc ( MK_OBJN fmtobj,
MK_PTR const buf,
size_t const size )

realloc syscall with libmkkernel error plugin

additional info: man realloc

Parameters
[in]fmtobjmanaged object used to format the log-message (default=MK_NULL → use default-format)
[in]bufthe old memory block to extend
[in]sizethe size of the new memory block
Returns
a pointer to the new memory block

◆ MkSysReCalloc()

MK_PTR MkSysReCalloc ( MK_OBJN fmtobj,
MK_PTR const buf,
MK_NUM const oldnum,
MK_NUM const addnum,
size_t const size )

realloc syscall with libmkkernel error plugin

additional info: man realloc but set the NEW bytes to '\0'

Parameters
[in]fmtobjmanaged object used to format the log-message (default=MK_NULL → use default-format)
[in]bufthe old memory block to extend
[in]oldnumthe old number of the memory block items
[in]addnumadd addnum to oldnum of the memory block items, final number of items is newnum = oldnum + addnum
[in]sizethe size of the memory block item
Returns
a pointer to the new memory block

◆ MkSysSleep()

static enum MkErrorE MkSysSleep ( MK_OBJN fmtobj,
MK_I32 const sec )
inlinestatic

sleep syscall with libmkkernel error plugin

Parameters
[in]fmtobjmanaged object used to format the log-message (default=MK_NULL → use default-format)
[in]secthe seconds to sleep
Returns
The MkErrorE status from the DEFAULT MkErrorC in MkRuntimeS::error_mk

Definition at line 2803 of file LibMkKernel_mk.h.

2806 {
2807 return (*MkLal.SysSleep)(fmtobj, (unsigned int)sec);
2808};
enum MkErrorE(* SysSleep)(MK_OBJN const obj, unsigned int const sec)
sleep syscall with libmkkernel error plugin

◆ MkSysStrDup()

MK_STR MkSysStrDup ( MK_OBJN fmtobj,
MK_STRN const str )

strdup syscall with libmkkernel error plugin

additional info: man strdup

Parameters
[in]fmtobjmanaged object used to format the log-message (default=MK_NULL → use default-format)
[in]strthe string to duplicate
Returns
a pointer to the new memory block or MK_NULL on error

◆ MkSysStringArrayDup()

MK_STRN_A MkSysStringArrayDup ( MK_OBJN fmtobj,
MK_STRN_A const strA )

strdup syscall with libmkkernel error plugin

additional info: like strdup but for an array of string

Parameters
[in]fmtobjmanaged object used to format the log-message (default=MK_NULL → use default-format)
[in]strAthe original array of strings
Returns
a pointer to a new array of string

◆ MkSysStringGet()

static MK_STRN MkSysStringGet ( MK_STRN str)
inlinestatic

get string NULL or VALUE

Definition at line 2924 of file LibMkKernel_mk.h.

2924 {
2925 return MkSysStringIsNULL(str) ? NULL : str;
2926};
static bool MkSysStringIsNULL(MK_STRN str)
test if string is NULL or EMPTY …

◆ MkSysStringGetNoNULL()

static MK_STRN MkSysStringGetNoNULL ( MK_STRN str)
inlinestatic

get string "" or VALUE

Definition at line 2929 of file LibMkKernel_mk.h.

2929 {
2930 return str == NULL ? "" : str;
2931};
+ Here is the caller graph for this function:

◆ MkSysStringIsEQUAL()

bool MkSysStringIsEQUAL ( MK_STRN const str,
MK_STRN const other )

test if string(s) are equal …

◆ MkSysStringIsLenEQUAL()

bool MkSysStringIsLenEQUAL ( MK_STRN const str,
MK_STRN const other,
MK_SIZE const len )

test if string(s) are equal …

◆ MkSysStringIsNotNULL()

static bool MkSysStringIsNotNULL ( MK_STRN str)
inlinestatic

test if string is NOT NULL or EMPTY

Definition at line 2911 of file LibMkKernel_mk.h.

2911 {
2912 return (str != NULL && *str != '\0');
2913};

◆ MkSysStringIsNULL()

static bool MkSysStringIsNULL ( MK_STRN str)
inlinestatic

test if string is NULL or EMPTY

Definition at line 2906 of file LibMkKernel_mk.h.

2906 {
2907 return (str == NULL || MkSysStringIsNULL_R(str));
2908};
#define MkSysStringIsNULL_R(_str)
+ Here is the caller graph for this function:

◆ MkSysStringIsNULL_R()

bool MkSysStringIsNULL_R ( MK_STRN const str)

test if string EMPTY

◆ MkSysStringSet_R()

bool MkSysStringSet_R ( MK_STRN const str,
MK_STRN const other )

set string to value

◆ MkSysStringSetNULL_R()

bool MkSysStringSetNULL_R ( MK_STRN const str)

set string to EMPTY

◆ MkSysStrNCpy()

enum MkErrorE MkSysStrNCpy ( MK_OBJN fmtobj,
MK_STR const to,
MK_STRN const from,
MK_SIZE const len )

strncpy syscall with libmkkernel error plugin

additional info: man strncpy

Parameters
[in]fmtobjmanaged object used to format the log-message (default=MK_NULL → use default-format)
[in]tothe string to copy "to"
[in]fromthe string to copy "from"
[in]lenthe length of the string
Returns
a pointer to the new memory block

◆ MkSysStrNDup()

MK_STR MkSysStrNDup ( MK_OBJN fmtobj,
MK_STRN const str,
MK_SIZE const len )

strndup syscall with libmkkernel error plugin

additional info: man strdup

Parameters
[in]fmtobjmanaged object used to format the log-message (default=MK_NULL → use default-format)
[in]strthe string to duplicate
[in]lenthe length of the string
Returns
a pointer to the new memory block

◆ MkSysUSleep()

static enum MkErrorE MkSysUSleep ( MK_OBJN fmtobj,
useconds_t const usec )
inlinestatic

usleep syscall with libmkkernel error plugin

Parameters
[in]fmtobjmanaged object used to format the log-message (default=MK_NULL → use default-format)
[in]usecthe micro (10^-6) seconds to sleep
Returns
The MkErrorE status from the DEFAULT MkErrorC in MkRuntimeS::error_mk

Definition at line 2792 of file LibMkKernel_mk.h.

2795 {
2796 return (*MkLal.SysUSleep)(fmtobj, usec);
2797};
enum MkErrorE(* SysUSleep)(MK_OBJN const obj, unsigned int const usec)
usleep syscall with libmkkernel error plugin

◆ MkSysWaitForProcess()

static enum MkErrorE MkSysWaitForProcess ( MK_OBJN fmtobj,
MK_IDNT const id )
inlinestatic

wait for process to finish syscall with libmkkernel error plugin

Parameters
[in]fmtobjmanaged object used to format the log-message (default=MK_NULL → use default-format)
[in]idprocess handle
Returns
The MkErrorE status from the DEFAULT MkErrorC in MkRuntimeS::error_mk

Definition at line 2768 of file LibMkKernel_mk.h.

2771 {
2772 return (*MkLal.MkSysWaitForProcessCB)(fmtobj, id);
2773};
MkSysWaitF MkSysWaitForProcessCB
wait for process to finish syscall with libmkkernel error plugin

◆ MkSysWaitForThread()

static enum MkErrorE MkSysWaitForThread ( MK_OBJN fmtobj,
MK_IDNT const id )
inlinestatic

wait for thread to finish syscall with libmkkernel error plugin

Parameters
[in]fmtobjmanaged object used to format the log-message (default=MK_NULL → use default-format)
[in]idthread handle
Returns
The MkErrorE status from the DEFAULT MkErrorC in MkRuntimeS::error_mk

Definition at line 2780 of file LibMkKernel_mk.h.

2783 {
2784 return (*MkLal.MkSysWaitForThreadCB)(fmtobj, id);
2785};
MkSysWaitF MkSysWaitForThreadCB
wait for process to finish syscall with libmkkernel error plugin

Variable Documentation

◆ MkLal

struct MkLalS MkLal
extern

Language Abstraction Layer in duty.