Zen API
 All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kApiLib.h
Go to the documentation of this file.
1 
10 #include <kApi/kApiDef.h> //--inclusion order controlled by kApiDef
11 
12 #ifndef K_API_LIB_H
13 #define K_API_LIB_H
14 
19 typedef kStatus (kCall* kApiMemAllocFx)(kPointer provider, kSize size, void* mem, kMemoryAlignment alignment);
20 
25 typedef kStatus (kCall* kApiMemFreeFx)(kPointer provider, void* mem);
26 
31 typedef kStatus(kCall* kApiAssertFx)(const kChar* file, k32u line);
32 
37 typedef kStatus(kCall* kApiLogfFx)(const kChar* format, va_list args);
38 
43 typedef k32u(kCall* kApiLockFx)(kPointer provider);
44 
49 typedef k32u(kCall* kApiUnlockFx)(kPointer provider);
50 
51 typedef struct kLogArgs
52 {
53  kLogOption options;
54  k64u upTime;
55  kDateTime dateTime;
56  const kChar* source;
57  const kChar* message;
58 } kLogArgs;
59 
64 typedef kStatus (kCall* kApiLogFx)(kPointer receiver, const kLogArgs* args);
65 
89 kFx(kStatus) kApiLib_Construct(kAssembly* assembly);
90 
113 kFx(kStatus) kApiLib_AddLogHandler(kApiLogFx function, kPointer receiver);
114 
123 kFx(kStatus) kApiLib_RemoveLogHandler(kApiLogFx function, kPointer receiver);
124 
141 
157 
173 
187 
202 
218 kFx(kStatus) kApiLib_SetSymbolLockHandlers(kApiLockFx lockFx, kApiUnlockFx unlockFx, kPointer provider);
219 
220 #include <kApi/kApiLib.x.h>
221 
222 #endif
kStatus kApiLib_AddLogHandler(kApiLogFx function, kPointer receiver)
Adds a handler function for logging operations.
Represents a 32-bit unsigned integer.
kStatus(kCall * kApiMemFreeFx)(kPointer provider, void *mem)
Function signature for memory free handler.
Definition: kApiLib.h:25
Represents a 64-bit unsigned integer.
Represents a library of types.
Represents a void pointer.
kStatus kApiLib_SetMemAllocHandlers(kApiMemAllocFx allocFx, kApiMemFreeFx freeFx, kPointer provider)
Sets handler functions for memory alloc/free operations.
kStatus kApiLib_SetAssertHandler(kApiAssertFx function)
Sets a handler function for debug assertions.
Represents an unsigned integer that can store a pointer address.
kStatus kApiLib_RemoveLogHandler(kApiLogFx function, kPointer receiver)
Removes a handler function for logging operations.
kStatus(kCall * kApiAssertFx)(const kChar *file, k32u line)
Function signature for debug assertion handler.
Definition: kApiLib.h:31
#define kInlineFx(TYPE)
Inline method declaration helper.
Definition: kApiDef.h:26
Represents a single unit (byte) in a UTF-8 character.
typedef kStatus(kCall *kMsgQueueDropFx)(kPointer receiver
Defines the signature of a callback function to handle dropped items.
kSize kApiLib_LeaksDetected()
Reports memory leaks that occurred during use of this library.
kStatus kApiLib_EnableSymbolInitialization(kBool enable)
Enables or disables initialization of symbol table resources by this library.
kStatus(kCall * kApiMemAllocFx)(kPointer provider, kSize size, void *mem, kMemoryAlignment alignment)
Function signature for memory allocation handler.
Definition: kApiLib.h:19
k32u(kCall * kApiUnlockFx)(kPointer provider)
Function signature for an unlock (exclusive access) operation.
Definition: kApiLib.h:49
Core Zen type declarations.
kStatus(kCall * kApiLogFx)(kPointer receiver, const kLogArgs *args)
Function signature for log handler.
Definition: kApiLib.h:64
kStatus kApiLib_EnableNetworkInitialization(kBool enable)
Enables or disables initialization of network services by this library.
Represents options associated with a log entry.
kStatus kApiLib_Construct(kAssembly *assembly)
Constructs the Zen API type assembly (kApiLib).
kStatus(kCall * kApiLogfFx)(const kChar *format, va_list args)
Function signature for debug log handler.
Definition: kApiLib.h:37
Represents an error code.
kStatus kApiLib_SetSymbolLockHandlers(kApiLockFx lockFx, kApiUnlockFx unlockFx, kPointer provider)
Sets handler functions for symbol table lock/unlock operations.
#define kCall
kApi standard function calling convention.
Definition: kApiDef.h:15
Represents UTC calendar date/time.
Represents a boolean value.
Represents alignment options for allocations.
k32u(kCall * kApiLockFx)(kPointer provider)
Function signature for a lock (exclusive access) operation.
Definition: kApiLib.h:43