sco_api.register_command
Commands: the one way to use a feature. The host copies cmd, its strings and its arg defs; only fn and ctx must stay valid until the plugin unloads.
Signature
Section titled “Signature”sco_result (*)(sco_plugin *, const sco_command *)Service and availability
Section titled “Service and availability”| Property | Value |
|---|---|
| Symbol | sco_api.register_command |
| Record ID | sco-api-register-command |
| Service | sco_api |
| Table | sco_api |
| Version macro | SCO_API_MAJOR/SCO_API_MINOR |
| Packed table version | 65537 |
| Since / availability | size >= 72; 1.0 |
| Complete member extent (x64 bytes) | 72 |
| Table size (x64 bytes) | 128 |
Parameters and buffers
Section titled “Parameters and buffers”sco_result (*register_command)(sco_plugin* self, const sco_command* cmd);
Commands: the one way to use a feature. The host copies cmd, its strings and its arg defs; only fn and ctx must stay valid until the plugin unloads.
Results and failures
Section titled “Results and failures”BAD_ARG invalid descriptor/size/stride, args/type/name/prefix or duplicate; TOO_MANY capacity/allocation. Missing command capability gates invocation, not registration.
Absent capability
Section titled “Absent capability”Missing command capability gates invocation, not registration.
Ownership
Section titled “Ownership”Host copies descriptor strings and argument definitions; only fn/ctx borrowed until unload. Registry slots host-owned; no allocation transfer.
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”Owner unload/crash removes registration; no individual unregister API.
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(*register_command) |
| cpp | typed-wrapper | include/scosdk/command.hppconst sco_result r = plugin_.Api()->register_command(plugin_.Self(), &cmd); |
| csharp | typed-wrapper | sdk/csharp/Sco.Sdk/Commands.csScoResult r = api->register_command(_plugin.SelfPtr, &cmd); |
| lua | restricted | plugins/lua/sco_lua.cconst sco_result r = s->api->register_command(s->self, &cmd);plugins/lua/sco_lua.c if (s->ncmds == SCO_LUA_MAX_COMMANDS) 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.