C's stdlib 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/60 shipped • 52 next 8%

Namespace-level inventory for C23: what we already ship, what we may still want, and what we intentionally skip or keep.

stdlib.h

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

9% shipped
5/57 shipped 52 next 3 explicit non-goals
Shipped (5)

Next

Scalar conversion and numeric helpers are good portability targets.

  • abort
  • abort_handler_s
  • aligned_alloc
  • at_quick_exit
  • atexit
  • atol
  • atoll
  • bsearch
  • bsearch_s
  • call_once
  • calloc
  • defined
  • div
  • exit
  • free
  • free_aligned_sized
  • free_sized
  • getenv_s
  • ignore_handler_s
  • labs
  • ldiv
  • llabs
  • lldiv
  • malloc
  • mblen
  • mbstowcs
  • mbstowcs_s
  • mbtowc
  • memalignment
  • qsort_s
  • quick_exit
  • rand
  • realloc
  • strfromd
  • strfromd128
  • strfromd32
  • strfromd64
  • strfromf
  • strfroml
  • strtod128
  • strtod32
  • strtod64
  • strtof
  • strtold
  • strtoll
  • strtoul
  • strtoull
  • system
  • wcstombs
  • wcstombs_s
  • wctomb
  • wctomb_s
Explicit non-goals (3)
  • getenv Skip Process environment lookup depends on host state outside Locutus' model.
  • qsort Skip In-place comparator-driven sorting does not map cleanly to plain JS values.
  • srand Skip Global RNG seeding mutates ambient runtime state.

« More C functions