mirror of
https://github.com/logos-messaging/nim-sds.git
synced 2026-01-02 14:13:07 +00:00
adding SetEventCallback
This commit is contained in:
parent
59c965997e
commit
de702d223a
@ -23,13 +23,10 @@ typedef void (*SdsCallBack) (int callerRet, const char* msg, size_t len, void* u
|
||||
|
||||
// --- Core API Functions ---
|
||||
|
||||
/**
|
||||
* @brief Creates a new ReliabilityManager instance.
|
||||
* @param channelId A unique identifier for the communication channel.
|
||||
* @return An opaque handle (void*) representing the instance, or NULL on failure.
|
||||
*/
|
||||
|
||||
void* NewReliabilityManager(const char* channelId, SdsCallBack callback, void* userData);
|
||||
|
||||
void SetEventCallback(void* ctx, SdsCallBack callback, void* userData);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@ -140,5 +140,12 @@ proc NewReliabilityManager(
|
||||
|
||||
return ctx
|
||||
|
||||
proc SetEventCallback(
|
||||
ctx: ptr SdsContext, callback: SdsCallBack, userData: pointer
|
||||
) {.dynlib, exportc.} =
|
||||
initializeLibrary()
|
||||
ctx[].eventCallback = cast[pointer](callback)
|
||||
ctx[].eventUserData = userData
|
||||
|
||||
### End of exported procs
|
||||
################################################################################
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user