nim-sds built on nim-ffi 0.2.0 exports a new C ABI (snake_case symbols,
CBOR-marshalled requests/responses, named event-listener registry),
which the old PascalCase callback-based bindings could not link against
(undefined reference to SdsWrapOutgoingMessage / SdsUnwrapReceivedMessage).
Rewrite the cgo layer to the new ABI while keeping the Go-facing API
identical so consumers (status-go reliability layer) need no changes:
- sds_schema.go: CBOR structs matching nim-sds library/libsds.nim. The
.ffi. macro wraps each proc's non-ctx params in a generated request
object keyed by the param name, so requests are nested ({req:{...}});
no-extra-param procs take {_placeholder: uint8}.
- sds.go: snake_case wrappers; callback copies the callback-scoped CBOR
buffer before returning to avoid a use-after-free.
- sds_common.go: event path decodes the CBOR {eventType, payload}
envelope instead of JSON.
- NewReliabilityManager passes an empty participantId (plain SDS, SDS-R
repair disabled) to preserve pre-nim-ffi behavior.
Validated: full binding test suite (incl. event callbacks) passes
against a libsds built from nim-ffi 0.2.0.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>