Skip to content

sco_api.subscribe

Any thread. Applies from the next dispatch.

sco_result (*)(sco_plugin *, const char *, sco_event_fn, void *)

Service index

Property Value
Symbol sco_api.subscribe
Record ID sco-api-subscribe
Service sco_api
Table sco_api
Version macro SCO_API_MAJOR/SCO_API_MINOR
Packed table version 65537
Since / availability size >= 40; 1.0
Complete member extent (x64 bytes) 40
Table size (x64 bytes) 128

Header source

sco_result (*subscribe)(sco_plugin* self, const char* event, sco_event_fn fn, void* ctx);
Any thread. Applies from the next dispatch.

BAD_ARG invalid/released self, NULL/empty event, NULL fn or duplicate (self,event,fn); TOO_MANY capacity/allocation failure. Missing event producer is not a registration error; no event may arrive.

Missing event producer is not a registration error; no event may arrive.

Event name copied; fn/ctx borrowed until unsubscribe/unload. Host allocates copy-on-write subscription list; caller owns ctx.

Any thread; reentrancy unspecified.

unspecified

unspecified

unsubscribe or owner unload/crash ends delivery; in-flight callback may finish.

Status labels are copied verbatim from the catalogue: direct is native access; typed-wrapper is wrapper-backed; restricted is a subset/adaptation; unsupported means no supported route is established. No status implies universal safety.

Language Catalogue status Source evidence / wrapper tokens
c direct include/sco_api.h
(*subscribe)
cpp typed-wrapper include/scosdk/plugin.hpp
const sco_result r = api_->subscribe(self_, event, detail::EventTrampoline, detail::ToCtx(id));
csharp typed-wrapper sdk/csharp/Sco.Sdk/Plugin.cs
fixed (byte* n = Utf8.Z(ev)) r = _api->subscribe(_self, n, EventFn, (void*)slot.Id);
lua restricted plugins/lua/sco_lua.c
const sco_result r = s->api->subscribe(s->self, event, sco_lua_event_, e);
plugins/lua/sco_lua.c
if (lua_rawlen(L, list) >= SCO_LUA_MAX_SUBSCRIBERS) return PushResult(L, SCO_TOO_MANY);

ABI pins prove layout, not semantic behavior or a live game session.