sco_api.query_service
Any thread. SCO_OK: *out_vtable = the table of the service with this name, same major as min_version and at least as new. SCO_UNAVAILABLE: another major, or older. SCO_NOT_FOUND: none. *out_vtable is NULL unless SCO_OK. A plugin’s table goes away when it unloads: query when needed.
Signature
Section titled “Signature”sco_result (*)(const char *, uint32_t, const void **)Service and availability
Section titled “Service and availability”| Property | Value |
|---|---|
| Symbol | sco_api.query_service |
| Record ID | sco-api-query-service |
| Service | sco_api |
| Table | sco_api |
| Version macro | SCO_API_MAJOR/SCO_API_MINOR |
| Packed table version | 65537 |
| Since / availability | size >= 104; 1.1 |
| Complete member extent (x64 bytes) | 104 |
| Table size (x64 bytes) | 128 |
Parameters and buffers
Section titled “Parameters and buffers”sco_result (*query_service)(const char* name, uint32_t min_version, const void** out_vtable);
Any thread. SCO_OK: *out_vtable = the table of the service with this name, same major as min_version and at least as new. SCO_UNAVAILABLE: another major, or older. SCO_NOT_FOUND: none. *out_vtable is NULL unless SCO_OK. A plugin’s table goes away when it unloads: query when needed.
Results and failures
Section titled “Results and failures”BAD_ARG NULL name/out; NOT_FOUND absent; UNAVAILABLE incompatible major/older minor; TOO_MANY handout-tracking allocation. *out NULL unless OK.
Absent capability
Section titled “Absent capability”NOT_FOUND absent; UNAVAILABLE incompatible major/older minor
Ownership
Section titled “Ownership”Returns borrowed provider table; never free. Host/game tables live through plugin lifetime. Native provider code remains mapped after handout, not necessarily its state. Handout tracking may allocate.
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”No cancellation. Native provider hot reload/unload during session refused after handout; shutdown still tears down state. Do not assume held state stays usable after withdrawal/crash.
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(*query_service) |
| cpp | typed-wrapper | include/scosdk/service.hppconst sco_result r = api->query_service(name, minVersion, &out); |
| csharp | typed-wrapper | sdk/csharp/Sco.Sdk/Services.csfixed (byte* n = Utf8.Z(name)) r = a->query_service(n, minVersion, &table); |
| lua | restricted | plugins/lua/sco_lua.cs->api->query_service(SCO_STORAGE_NAME, SCO_STORAGE_VERSION_1_0, &t) |
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
Find by task
Section titled “Find by task”find service table This is a search phrase for the existing contract, not an additional API alias.
ABI pins prove layout, not semantic behavior or a live game session.