mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-02 05:53:11 +00:00
31 lines
836 B
Nim
31 lines
836 B
Nim
################################################################################
|
|
### Exported types
|
|
|
|
type WakuCallBack* = proc(
|
|
callerRet: cint, msg: ptr cchar, len: csize_t, userData: pointer
|
|
) {.cdecl, gcsafe, raises: [].}
|
|
|
|
const RET_OK*: cint = 0
|
|
const RET_ERR*: cint = 1
|
|
const RET_MISSING_CALLBACK*: cint = 2
|
|
|
|
### End of exported types
|
|
################################################################################
|
|
|
|
################################################################################
|
|
### FFI utils
|
|
|
|
template foreignThreadGc*(body: untyped) =
|
|
when declared(setupForeignThreadGc):
|
|
setupForeignThreadGc()
|
|
|
|
body
|
|
|
|
when declared(tearDownForeignThreadGc):
|
|
tearDownForeignThreadGc()
|
|
|
|
type onDone* = proc()
|
|
|
|
### End of FFI utils
|
|
################################################################################
|