Skip to content

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.

sco_result (*)(sco_plugin *, const sco_command *)

Service index

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

Header source

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.

BAD_ARG invalid descriptor/size/stride, args/type/name/prefix or duplicate; TOO_MANY capacity/allocation. Missing command capability gates invocation, not registration.

Missing command capability gates invocation, not registration.

Host copies descriptor strings and argument definitions; only fn/ctx borrowed until unload. Registry slots host-owned; no allocation transfer.

Any thread; reentrancy unspecified.

unspecified

unspecified

Owner unload/crash removes registration; no individual unregister API.

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.hpp
const sco_result r = plugin_.Api()->register_command(plugin_.Self(), &cmd);
csharp typed-wrapper sdk/csharp/Sco.Sdk/Commands.cs
ScoResult r = api->register_command(_plugin.SelfPtr, &cmd);
lua restricted plugins/lua/sco_lua.c
const 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);

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