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?
- 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/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
9%
shipped
5/57 shipped
52 next
3 explicit non-goals
Next
Scalar conversion and numeric helpers are good portability targets.
abortabort_handler_saligned_allocat_quick_exitatexitatolatollbsearchbsearch_scall_oncecallocdefineddivexitfreefree_aligned_sizedfree_sizedgetenv_signore_handler_slabsldivllabslldivmallocmblenmbstowcsmbstowcs_smbtowcmemalignmentqsort_squick_exitrandreallocstrfromdstrfromd128strfromd32strfromd64strfromfstrfromlstrtod128strtod32strtod64strtofstrtoldstrtollstrtoulstrtoullsystemwcstombswcstombs_swctombwctomb_s
Explicit non-goals (3)
-
getenvProcess environment lookup depends on host state outside Locutus' model. -
qsortIn-place comparator-driven sorting does not map cleanly to plain JS values. -
srandGlobal RNG seeding mutates ambient runtime state.