|
CX Framework
Cross-platform C utility framework
|
Macros | |
| #define | stDeclare(name) extern const STypeInfo _sti_##name |
| #define | stDefine(name) const STypeInfo _sti_##name = |
Macros for defining user types that integrate fully with the stype system.
A custom type is defined with stDefine followed by a brace-enclosed STypeInfo initializer, paired with a standard block of harness #defines that hook the type name into stType, stArg, stCheckedArg, and the container APIs (saInit, saPush, htInsert, stCmp, etc.).
File-local type (no cross-TU sharing needed):
Shared type (visible across translation units):
stType(vec3) resolves to &_sti_vec3 — a static, canonical pointer with no STypeFlag_Temporary set, so no type registry lookup occurs at init or push time.
| #define stDeclare | ( | name | ) | extern const STypeInfo _sti_##name |
Declare a custom type descriptor defined in another translation unit.
Places extern const STypeInfo _sti_##name in the current scope. Typically used in a header file alongside a #define stType_name (&_sti_name) so that stType(name) resolves cleanly.
| name | Type name (token) |
| #define stDefine | ( | name | ) | const STypeInfo _sti_##name = |
Begin the definition of a custom type descriptor.
Must be followed immediately by a brace-enclosed STypeInfo struct initializer. Place at file scope in a .c file; use static storage class for file-local types.
| name | Type name (token) |
Example: