spclib
Installation
SKILL.md
spclib - sp.h Programming Guide
sp.h is a single-header C standard library replacement providing modern, type-safe APIs for memory management, strings, containers, IO, and cross-platform system operations.
Core Principles
Always follow these rules when using sp.h:
| Never Use | Use Instead |
|---|---|
malloc/calloc/realloc |
sp_alloc() |
const char* |
sp_str_t (ptr+len string) |
strcmp/strlen |
sp_str_equal() / sp_str_len() |
printf |
SP_LOG() |
memset(&obj, 0, sizeof(obj)) |
SP_ZERO_INITIALIZE() |
for(i=0; i<n; i++) on arrays |
sp_dyn_array_for() / sp_carr_for() |