sco_api.subscribe
Any thread. Applies from the next dispatch.
Signature
Section titled “Signature”sco_result (*)(sco_plugin *, const char *, sco_event_fn, void *)Service and availability
Section titled “Service and availability”| 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 |
Parameters and buffers
Section titled “Parameters and buffers”sco_result (*subscribe)(sco_plugin* self, const char* event, sco_event_fn fn, void* ctx);
Any thread. Applies from the next dispatch.
Results and failures
Section titled “Results and failures”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.
Absent capability
Section titled “Absent capability”Missing event producer is not a registration error; no event may arrive.
Ownership
Section titled “Ownership”Event name copied; fn/ctx borrowed until unsubscribe/unload. Host allocates copy-on-write subscription list; caller owns ctx.
Thread affinity
Section titled “Thread affinity”Any thread; reentrancy unspecified.
Callback context
Section titled “Callback context”unspecified
Reentrancy
Section titled “Reentrancy”unspecified
Cleanup and cancellation
Section titled “Cleanup and cancellation”unsubscribe or owner unload/crash ends delivery; in-flight callback may finish.
Language mappings
Section titled “Language mappings”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.hppconst sco_result r = api_->subscribe(self_, event, detail::EventTrampoline, detail::ToCtx(id)); |
| csharp | typed-wrapper | sdk/csharp/Sco.Sdk/Plugin.csfixed (byte* n = Utf8.Z(ev)) r = _api->subscribe(_self, n, EventFn, (void*)slot.Id); |
| lua | restricted | plugins/lua/sco_lua.cconst 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); |
Examples
Section titled “Examples”- tests/abi_v1.c
- tests/test_app.cpp
- tests/test_datacore_service.cpp
- tests/test_host.cpp
- tests/test_ipc.cpp
- tests/test_lua.cpp
- tests/test_net_service.cpp
- tests/test_plugins.cpp
- tests/test_sdk.cpp
- tests/test_settings.cpp
- tests/test_storage.cpp
- tests/test_ui.cpp
- sdk/csharp/Sco.Sdk.Tests/FakeHost.cs
- tools/test.sh
- sdk/csharp/Sco.Sdk.Tests/Layout.cs
ABI pins prove layout, not semantic behavior or a live game session.