C's string header file in TypeScript
We have 20 C functions so far - help us add more
Got a rainy Sunday afternoon and a taste for a porting puzzle?
- Get inspiration from the C math.h documentation, the C math.h source.
- Click "New file" in the appropriate folder on GitHub. This will fork the project to your account, directly add the file to it, and send a Pull Request to us.
We will then review it. If it's useful to the project and in line with our contributing guidelines your work will become part of Locutus and you'll be automatically credited in the authors section accordingly.
Upstream Surface Inventory 5/37 shipped • 5 next 14%
Namespace-level inventory for C23: what we already ship, what we may still want,
and what we intentionally skip or keep.
string.h
50%
shipped
5/10 shipped
5 next
27 explicit non-goals
Next
Character-class span helpers are useful for string scanning.
strcspnstrspn
Prefix-bounded string comparison still has a clean plain-value contract.
strncmp
Character-class search maps naturally to string scanning.
strpbrk
Last-occurrence search maps naturally to string lookup.
strrchr
Explicit non-goals (27)
-
memccpyC buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values. -
memchrC buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values. -
memcmpC buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values. -
memcpyC buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values. -
memcpy_sC buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values. -
memmoveC buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values. -
memmove_sC buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values. -
memsetC buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values. -
memset_explicitC buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values. -
memset_sC buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values. -
strcat_sC buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values. -
strcollC buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values. -
strcpyC buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values. -
strcpy_sC buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values. -
strdupC buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values. -
strerrorC buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values. -
strerrorlen_sC buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values. -
strncatC buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values. -
strncat_sC buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values. -
strncpyC buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values. -
strncpy_sC buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values. -
strndupC buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values. -
strnlenC buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values. -
strnlen_sC buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values. -
strtokStateful tokenizer semantics do not fit Locutus' plain-value model. -
strtok_sC buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values. -
strxfrmC buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values.