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?

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

C23 · Catalog source: version-pinned source manifest https://en.cppreference.com/w/c/header/string

50% shipped
5/10 shipped 5 next 27 explicit non-goals
Shipped (5)

Next

Character-class span helpers are useful for string scanning.

  • strcspn
  • strspn

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)
  • memccpy Skip C buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values.
  • memchr Skip C buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values.
  • memcmp Skip C buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values.
  • memcpy Skip C buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values.
  • memcpy_s Skip C buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values.
  • memmove Skip C buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values.
  • memmove_s Skip C buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values.
  • memset Skip C buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values.
  • memset_explicit Skip C buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values.
  • memset_s Skip C buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values.
  • strcat_s Skip C buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values.
  • strcoll Skip C buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values.
  • strcpy Skip C buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values.
  • strcpy_s Skip C buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values.
  • strdup Skip C buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values.
  • strerror Skip C buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values.
  • strerrorlen_s Skip C buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values.
  • strncat Skip C buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values.
  • strncat_s Skip C buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values.
  • strncpy Skip C buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values.
  • strncpy_s Skip C buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values.
  • strndup Skip C buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values.
  • strnlen Skip C buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values.
  • strnlen_s Skip C buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values.
  • strtok Skip Stateful tokenizer semantics do not fit Locutus' plain-value model.
  • strtok_s Skip C buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values.
  • strxfrm Skip C buffer and pointer-oriented string APIs do not generally map cleanly to JS plain values.

« More C functions