summaryrefslogtreecommitdiff
path: root/libc/utils/docgen
diff options
context:
space:
mode:
Diffstat (limited to 'libc/utils/docgen')
-rw-r--r--libc/utils/docgen/arpa/inet.yaml18
-rw-r--r--libc/utils/docgen/assert.yaml7
-rw-r--r--libc/utils/docgen/ctype.json47
-rw-r--r--libc/utils/docgen/ctype.yaml72
-rwxr-xr-xlibc/utils/docgen/docgen.py70
-rw-r--r--libc/utils/docgen/errno.yaml14
-rw-r--r--libc/utils/docgen/fenv.json114
-rw-r--r--libc/utils/docgen/fenv.yaml97
-rw-r--r--libc/utils/docgen/float.yaml143
-rw-r--r--libc/utils/docgen/header.py11
-rw-r--r--libc/utils/docgen/inttypes.yaml20
-rw-r--r--libc/utils/docgen/locale.yaml37
-rw-r--r--libc/utils/docgen/setjmp.json15
-rw-r--r--libc/utils/docgen/setjmp.yaml15
-rw-r--r--libc/utils/docgen/signal.json152
-rw-r--r--libc/utils/docgen/signal.yaml102
-rw-r--r--libc/utils/docgen/stdbit.json270
-rw-r--r--libc/utils/docgen/stdbit.yaml179
-rw-r--r--libc/utils/docgen/stdio.yaml226
-rw-r--r--libc/utils/docgen/stdlib.yaml158
-rw-r--r--libc/utils/docgen/string.yaml94
-rw-r--r--libc/utils/docgen/sys/mman.yaml77
-rw-r--r--libc/utils/docgen/threads.json87
-rw-r--r--libc/utils/docgen/threads.yaml88
-rw-r--r--libc/utils/docgen/uchar.yaml21
-rw-r--r--libc/utils/docgen/wchar.yaml131
-rw-r--r--libc/utils/docgen/wctype.yaml36
27 files changed, 1592 insertions, 709 deletions
diff --git a/libc/utils/docgen/arpa/inet.yaml b/libc/utils/docgen/arpa/inet.yaml
new file mode 100644
index 000000000000..7f388cbbd020
--- /dev/null
+++ b/libc/utils/docgen/arpa/inet.yaml
@@ -0,0 +1,18 @@
+functions:
+ htonl:
+ posix-definition: ''
+ htons:
+ posix-definition: ''
+ inet_addr:
+ posix-definition: ''
+ inet_ntoa:
+ posix-definition: ''
+ inet_ntop:
+ posix-definition: ''
+ inet_pton:
+ posix-definition: ''
+ ntohl:
+ posix-definition: ''
+ ntohs:
+ posix-definition: ''
+
diff --git a/libc/utils/docgen/assert.yaml b/libc/utils/docgen/assert.yaml
new file mode 100644
index 000000000000..0afd4e2d3c06
--- /dev/null
+++ b/libc/utils/docgen/assert.yaml
@@ -0,0 +1,7 @@
+macros:
+ __STDC_VERSION_ASSERT_H__:
+ c-definition: 7.2.1
+ assert:
+ c-definition: 7.2.1
+ in-latest-posix: ''
+
diff --git a/libc/utils/docgen/ctype.json b/libc/utils/docgen/ctype.json
deleted file mode 100644
index af97e4bbbc0a..000000000000
--- a/libc/utils/docgen/ctype.json
+++ /dev/null
@@ -1,47 +0,0 @@
-{
- "functions": {
- "isalnum": {
- "c-definition": "7.4.1.1"
- },
- "isalpha": {
- "c-definition": "7.4.1.2"
- },
- "isblank": {
- "c-definition": "7.4.1.3"
- },
- "iscntrl": {
- "c-definition": "7.4.1.4"
- },
- "isdigit": {
- "c-definition": "7.4.1.5"
- },
- "isgraph": {
- "c-definition": "7.4.1.6"
- },
- "islower": {
- "c-definition": "7.4.1.7"
- },
- "isprint": {
- "c-definition": "7.4.1.8"
- },
- "ispunct": {
- "c-definition": "7.4.1.9"
- },
- "isspace": {
- "c-definition": "7.4.1.10"
- },
- "isupper": {
- "c-definition": "7.4.1.11"
- },
- "isxdigit": {
- "c-definition": "7.4.1.12"
- },
- "tolower" : {
- "c-definition": "7.4.2.1"
- },
- "toupper": {
- "c-definition": "7.4.2.2"
- }
- }
-}
-
diff --git a/libc/utils/docgen/ctype.yaml b/libc/utils/docgen/ctype.yaml
new file mode 100644
index 000000000000..027d8f38c71f
--- /dev/null
+++ b/libc/utils/docgen/ctype.yaml
@@ -0,0 +1,72 @@
+functions:
+ isalnum:
+ c-definition: 7.4.1.1
+ in-latest-posix: ''
+ isalnum_l:
+ in-latest-posix: ''
+ isalpha:
+ c-definition: 7.4.1.2
+ in-latest-posix: ''
+ isalpha_l:
+ in-latest-posix: ''
+ isblank:
+ c-definition: 7.4.1.3
+ in-latest-posix: ''
+ isblank_l:
+ in-latest-posix: ''
+ iscntrl:
+ c-definition: 7.4.1.4
+ in-latest-posix: ''
+ iscntrl_l:
+ in-latest-posix: ''
+ isdigit:
+ c-definition: 7.4.1.5
+ in-latest-posix: ''
+ isdigit_l:
+ in-latest-posix: ''
+ isgraph:
+ c-definition: 7.4.1.6
+ in-latest-posix: ''
+ isgraph_l:
+ in-latest-posix: ''
+ islower:
+ c-definition: 7.4.1.7
+ in-latest-posix: ''
+ islower_l:
+ in-latest-posix: ''
+ isprint:
+ c-definition: 7.4.1.8
+ in-latest-posix: ''
+ isprint_l:
+ in-latest-posix: ''
+ ispunct:
+ c-definition: 7.4.1.9
+ in-latest-posix: ''
+ ispunct_l:
+ in-latest-posix: ''
+ isspace:
+ c-definition: 7.4.1.10
+ in-latest-posix: ''
+ isspace_l:
+ in-latest-posix: ''
+ isupper:
+ c-definition: 7.4.1.11
+ in-latest-posix: ''
+ isupper_l:
+ in-latest-posix: ''
+ isxdigit:
+ c-definition: 7.4.1.12
+ in-latest-posix: ''
+ isxdigit_l:
+ in-latest-posix: ''
+ tolower:
+ c-definition: 7.4.2.1
+ in-latest-posix: ''
+ tolower_l:
+ in-latest-posix: ''
+ toupper:
+ c-definition: 7.4.2.2
+ in-latest-posix: ''
+ toupper_l:
+ in-latest-posix: ''
+
diff --git a/libc/utils/docgen/docgen.py b/libc/utils/docgen/docgen.py
index af5d00a5cbf8..09db284ef928 100755
--- a/libc/utils/docgen/docgen.py
+++ b/libc/utils/docgen/docgen.py
@@ -10,8 +10,9 @@
from argparse import ArgumentParser, Namespace
from pathlib import Path
from typing import Dict
+import os
import sys
-import json
+import yaml
from header import Header
@@ -22,14 +23,14 @@ class DocgenAPIFormatError(Exception):
def check_api(header: Header, api: Dict):
"""
- Checks that docgen json files are properly formatted. If there are any
+ Checks that docgen yaml files are properly formatted. If there are any
fatal formatting errors, raises exceptions with error messages useful for
fixing formatting. Warnings are printed to stderr on non-fatal formatting
errors. The code that runs after ``check_api(api)`` is called expects that
- ``check_api`` executed without raising formatting exceptions so the json
+ ``check_api`` executed without raising formatting exceptions so the yaml
matches the formatting specified here.
- The json file may contain:
+ The yaml file may contain:
* an optional macros object
* an optional functions object
@@ -48,11 +49,15 @@ def check_api(header: Header, api: Dict):
this should be a C standard section number. For the ``"posix-definition"`` property,
this should be a link to the definition.
- :param api: docgen json file contents parsed into a dict
+ :param api: docgen yaml file contents parsed into a dict
"""
errors = []
- cdef = "c-definition"
- pdef = "posix-definition"
+ # We require entries to have at least one of these.
+ possible_keys = [
+ "c-definition",
+ "in-latest-posix",
+ "removed-in-posix-2008",
+ ]
# Validate macros
if "macros" in api:
@@ -65,8 +70,8 @@ def check_api(header: Header, api: Dict):
macros = api["macros"]
for name, obj in macros.items():
- if not (cdef in obj or pdef in obj):
- err = f'error: Macro {name} does not contain at least one required property: "{cdef}" or "{pdef}"'
+ if not any(k in obj for k in possible_keys):
+ err = f"error: Macro {name} does not contain at least one required property: {possible_keys}"
errors.append(err)
# Validate functions
@@ -79,8 +84,8 @@ def check_api(header: Header, api: Dict):
fns = api["functions"]
for name, obj in fns.items():
- if not (cdef in obj or pdef in obj):
- err = f'error: function {name} does not contain at least one required property: "{cdef}" or "{pdef}"'
+ if not any(k in obj for k in possible_keys):
+ err = f"error: function {name} does not contain at least one required property: {possible_keys}"
errors.append(err)
if errors:
@@ -88,8 +93,8 @@ def check_api(header: Header, api: Dict):
def load_api(header: Header) -> Dict:
- api = header.docgen_json.read_text(encoding="utf-8")
- return json.loads(api)
+ api = header.docgen_yaml.read_text(encoding="utf-8")
+ return yaml.safe_load(api)
def print_tbl_dir(name):
@@ -103,7 +108,7 @@ def print_tbl_dir(name):
* - {name}
- Implemented
- C23 Standard Section
- - POSIX.1-2017 Standard Section"""
+ - POSIX Docs"""
)
@@ -127,8 +132,14 @@ def print_functions_rst(header: Header, functions: Dict):
else:
print(" -")
- if "posix-definition" in functions[name]:
- print(f' - {functions[name]["posix-definition"]}')
+ if "in-latest-posix" in functions[name]:
+ print(
+ f" - `POSIX.1-2024 <https://pubs.opengroup.org/onlinepubs/9799919799/functions/{name}.html>`__"
+ )
+ elif "removed-in-posix-2008" in functions[name]:
+ print(
+ f" - `removed in POSIX.1-2008 <https://pubs.opengroup.org/onlinepubs/007904875/functions/{name}.html>`__"
+ )
else:
print(" -")
@@ -153,15 +164,20 @@ def print_macros_rst(header: Header, macros: Dict):
else:
print(" -")
- if "posix-definition" in macros[name]:
- print(f' - {macros[name]["posix-definition"]}')
+ if "in-latest-posix" in macros[name]:
+ print(
+ f" - `POSIX.1-2024 <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/{header.name}.html>`__"
+ )
else:
print(" -")
print()
def print_impl_status_rst(header: Header, api: Dict):
- print(".. include:: check.rst\n")
+ if os.sep in header.name:
+ print(".. include:: ../../check.rst\n")
+ else:
+ print(".. include:: ../check.rst\n")
print("=" * len(header.name))
print(header.name)
@@ -176,10 +192,22 @@ def print_impl_status_rst(header: Header, api: Dict):
print_functions_rst(header, api["functions"])
+# This code implicitly relies on docgen.py being in the same dir as the yaml
+# files and is likely to need to be fixed when re-integrating docgen into
+# hdrgen.
+def get_choices() -> list:
+ choices = []
+ for path in Path(__file__).parent.rglob("*.yaml"):
+ fname = path.with_suffix(".h").name
+ if path.parent != Path(__file__).parent:
+ fname = path.parent.name + os.sep + fname
+ choices.append(fname)
+ return choices
+
+
def parse_args() -> Namespace:
parser = ArgumentParser()
- choices = [p.with_suffix(".h").name for p in Path(__file__).parent.glob("*.json")]
- parser.add_argument("header_name", choices=choices)
+ parser.add_argument("header_name", choices=get_choices())
return parser.parse_args()
diff --git a/libc/utils/docgen/errno.yaml b/libc/utils/docgen/errno.yaml
new file mode 100644
index 000000000000..da41552bc3a1
--- /dev/null
+++ b/libc/utils/docgen/errno.yaml
@@ -0,0 +1,14 @@
+macros:
+ EDOM:
+ c-definition: '7.5'
+ in-latest-posix: ''
+ EILSEQ:
+ c-definition: '7.5'
+ in-latest-posix: ''
+ ERANGE:
+ c-definition: '7.5'
+ in-latest-posix: ''
+ errno:
+ c-definition: '7.5'
+ in-latest-posix: ''
+
diff --git a/libc/utils/docgen/fenv.json b/libc/utils/docgen/fenv.json
deleted file mode 100644
index 788b196c053b..000000000000
--- a/libc/utils/docgen/fenv.json
+++ /dev/null
@@ -1,114 +0,0 @@
-{
- "macros": {
- "__STDC_VERSION_FENV_H__": {
- "c-definition": "7.6.5"
- },
- "FE_DIVBYZERO": {
- "c-definition": "7.6.9"
- },
- "FE_INEXACT": {
- "c-definition": "7.6.9"
- },
- "FE_INVALID": {
- "c-definition": "7.6.9"
- },
- "FE_OVERFLOW": {
- "c-definition": "7.6.9"
- },
- "FE_UNDERFLOW": {
- "c-definition": "7.6.9"
- },
- "FE_ALL_EXCEPT": {
- "c-definition": "7.6.12"
- },
- "FE_DFL_MODE": {
- "c-definition": "7.6.11"
- },
- "FE_DOWNARD": {
- "c-definition": "7.6.13"
- },
- "FE_TONEAREST": {
- "c-definition": "7.6.13"
- },
- "FE_TONEARESTFROMZERO": {
- "c-definition": "7.6.13"
- },
- "FE_TOWARDZERO": {
- "c-definition": "7.6.13"
- },
- "FE_UPWARD": {
- "c-definition": "7.6.13"
- },
- "FE_DEC_DOWNWARD": {
- "c-definition": "7.6.14"
- },
- "FE_DEC_TONEAREST": {
- "c-definition": "7.6.14"
- },
- "FE_DEC_TONEARESTFROMZERO": {
- "c-definition": "7.6.14"
- },
- "FE_DEC_TOWARDZERO": {
- "c-definition": "7.6.14"
- },
- "FE_DEC_UPWARD": {
- "c-definition": "7.6.14"
- },
- "FE_DFL_ENV": {
- "c-definition": "7.6.17"
- }
- },
- "functions": {
- "feclearexcept": {
- "c-definition": "7.6.4.1"
- },
- "fegetexceptflag": {
- "c-definition": "7.6.4.2"
- },
- "feraiseexcept": {
- "c-definition": "7.6.4.3"
- },
- "fesetexcept": {
- "c-definition": "7.6.4.4"
- },
- "fesetexceptflag": {
- "c-definition": "7.6.4.5"
- },
- "fetestexceptflag": {
- "c-definition": "7.6.4.6"
- },
- "fetestexcept": {
- "c-definition": "7.6.4.7"
- },
- "fegetmode": {
- "c-definition": "7.6.5.1"
- },
- "fegetround": {
- "c-definition": "7.6.5.2"
- },
- "fe_dec_getround": {
- "c-definition": "7.6.5.3"
- },
- "fesetmode": {
- "c-definition": "7.6.5.4"
- },
- "fesetround": {
- "c-definition": "7.6.5.5"
- },
- "fe_dec_setround": {
- "c-definition": "7.6.5.6"
- },
- "fegetenv": {
- "c-definition": "7.6.6.1"
- },
- "feholdexcept": {
- "c-definition": "7.6.6.2"
- },
- "fesetenv": {
- "c-definition": "7.6.6.3"
- },
- "feupdateenv": {
- "c-definition": "7.6.6.4"
- }
- }
-}
diff --git a/libc/utils/docgen/fenv.yaml b/libc/utils/docgen/fenv.yaml
new file mode 100644
index 000000000000..1d73697f36be
--- /dev/null
+++ b/libc/utils/docgen/fenv.yaml
@@ -0,0 +1,97 @@
+functions:
+ fe_dec_getround:
+ c-definition: 7.6.5.3
+ fe_dec_setround:
+ c-definition: 7.6.5.6
+ feclearexcept:
+ c-definition: 7.6.4.1
+ in-latest-posix: ''
+ fegetenv:
+ c-definition: 7.6.6.1
+ in-latest-posix: ''
+ fegetexceptflag:
+ c-definition: 7.6.4.2
+ in-latest-posix: ''
+ fegetmode:
+ c-definition: 7.6.5.1
+ fegetround:
+ c-definition: 7.6.5.2
+ in-latest-posix: ''
+ feholdexcept:
+ c-definition: 7.6.6.2
+ in-latest-posix: ''
+ feraiseexcept:
+ c-definition: 7.6.4.3
+ in-latest-posix: ''
+ fesetenv:
+ c-definition: 7.6.6.3
+ in-latest-posix: ''
+ fesetexcept:
+ c-definition: 7.6.4.4
+ fesetexceptflag:
+ c-definition: 7.6.4.5
+ in-latest-posix: ''
+ fesetmode:
+ c-definition: 7.6.5.4
+ fesetround:
+ c-definition: 7.6.5.5
+ in-latest-posix: ''
+ fetestexcept:
+ c-definition: 7.6.4.7
+ in-latest-posix: ''
+ fetestexceptflag:
+ c-definition: 7.6.4.6
+ feupdateenv:
+ c-definition: 7.6.6.4
+ in-latest-posix: ''
+macros:
+ FE_ALL_EXCEPT:
+ c-definition: 7.6.12
+ in-latest-posix: ''
+ FE_DEC_DOWNWARD:
+ c-definition: 7.6.14
+ FE_DEC_TONEAREST:
+ c-definition: 7.6.14
+ FE_DEC_TONEARESTFROMZERO:
+ c-definition: 7.6.14
+ FE_DEC_TOWARDZERO:
+ c-definition: 7.6.14
+ FE_DEC_UPWARD:
+ c-definition: 7.6.14
+ FE_DFL_ENV:
+ c-definition: 7.6.17
+ in-latest-posix: ''
+ FE_DFL_MODE:
+ c-definition: 7.6.11
+ FE_DIVBYZERO:
+ c-definition: 7.6.9
+ in-latest-posix: ''
+ FE_DOWNWARD:
+ c-definition: 7.6.13
+ in-latest-posix: ''
+ FE_INEXACT:
+ c-definition: 7.6.9
+ in-latest-posix: ''
+ FE_INVALID:
+ c-definition: 7.6.9
+ in-latest-posix: ''
+ FE_OVERFLOW:
+ c-definition: 7.6.9
+ in-latest-posix: ''
+ FE_TONEAREST:
+ c-definition: 7.6.13
+ in-latest-posix: ''
+ FE_TONEARESTFROMZERO:
+ c-definition: 7.6.13
+ FE_TOWARDZERO:
+ c-definition: 7.6.13
+ in-latest-posix: ''
+ FE_UNDERFLOW:
+ c-definition: 7.6.9
+ in-latest-posix: ''
+ FE_UPWARD:
+ c-definition: 7.6.13
+ in-latest-posix: ''
+ __STDC_VERSION_FENV_H__:
+ c-definition: 7.6.5
+
diff --git a/libc/utils/docgen/float.yaml b/libc/utils/docgen/float.yaml
new file mode 100644
index 000000000000..a8840b91be55
--- /dev/null
+++ b/libc/utils/docgen/float.yaml
@@ -0,0 +1,143 @@
+macros:
+ DBL_DECIMAL_DIG:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ DBL_DIG:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ DBL_EPSILON:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ DBL_HAS_SUBNORM:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ DBL_IS_IEC_60559:
+ c-definition: 5.3.5.3.3
+ DBL_MANT_DIG:
+ c-definition: 5.3.5.3.3
+ DBL_MAX:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ DBL_MAX_10_EXP:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ DBL_MAX_EXP:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ DBL_MIN:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ DBL_MIN_10_EXP:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ DBL_MIN_EXP:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ DBL_NORM_MAX:
+ c-definition: 5.3.5.3.3
+ DBL_SNAN:
+ c-definition: 5.3.5.3.3
+ DBL_TRUE_MIN:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ DECIMAL_DIG:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ FLT_DECIMAL_DIG:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ FLT_DIG:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ FLT_EPSILON:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ FLT_EVAL_METHOD:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ FLT_HAS_SUBNORM:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ FLT_IS_IEC_60559:
+ c-definition: 5.3.5.3.3
+ FLT_MANT_DIG:
+ c-definition: 5.3.5.3.3
+ FLT_MAX:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ FLT_MAX_10_EXP:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ FLT_MAX_EXP:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ FLT_MIN:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ FLT_MIN_10_EXP:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ FLT_MIN_EXP:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ FLT_NORM_MAX:
+ c-definition: 5.3.5.3.3
+ FLT_RADIX:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ FLT_ROUNDS:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ FLT_SNAN:
+ c-definition: 5.3.5.3.3
+ FLT_TRUE_MIN:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ INFINITY:
+ c-definition: 5.3.5.3.3
+ LDBL_DECIMAL_DIG:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ LDBL_DIG:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ LDBL_EPSILON:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ LDBL_HAS_SUBNORM:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ LDBL_IS_IEC_60559:
+ c-definition: 5.3.5.3.3
+ LDBL_MANT_DIG:
+ c-definition: 5.3.5.3.3
+ LDBL_MAX:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ LDBL_MAX_10_EXP:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ LDBL_MAX_EXP:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ LDBL_MIN:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ LDBL_MIN_10_EXP:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ LDBL_MIN_EXP:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ LDBL_NORM_MAX:
+ c-definition: 5.3.5.3.3
+ LDBL_SNAN:
+ c-definition: 5.3.5.3.3
+ LDBL_TRUE_MIN:
+ c-definition: 5.3.5.3.3
+ in-latest-posix: ''
+ NAN:
+ c-definition: 5.3.5.3.3
+ __STDC_VERSION_FLOAT_H__:
+ c-definition: '7.7'
+
diff --git a/libc/utils/docgen/header.py b/libc/utils/docgen/header.py
index dde210078db2..5bf524a64b69 100644
--- a/libc/utils/docgen/header.py
+++ b/libc/utils/docgen/header.py
@@ -14,7 +14,7 @@ class Header:
Maintains implementation information about a standard header file:
* where does its implementation dir live
* where is its macros file
- * where is its docgen json file
+ * where is its docgen yaml file
By convention, the macro-only part of a header file is in a header-specific
file somewhere in the directory tree with root at
@@ -42,7 +42,7 @@ class Header:
self.stem = header_name.rstrip(".h")
self.docgen_root = Path(__file__).parent
self.libc_root = self.docgen_root.parent.parent
- self.docgen_json = self.docgen_root / Path(header_name).with_suffix(".json")
+ self.docgen_yaml = self.docgen_root / Path(header_name).with_suffix(".yaml")
self.fns_dir = Path(self.libc_root, "src", self.stem)
self.macros_dir = Path(self.libc_root, "include", "llvm-libc-macros")
@@ -83,5 +83,10 @@ class Header:
macro file might be located in a subdirectory:
libc/include/llvm-libc-macros/fcntl-macros.h
libc/include/llvm-libc-macros/linux/fcntl-macros.h
+
+ When a header would be nested in a dir (such as arpa/, sys/, etc) we
+ instead use a hyphen in the name.
+ libc/include/llvm-libc-macros/sys-mman-macros.h
"""
- return self.macros_dir.glob(f"**/{self.stem}-macros.h")
+ stem = self.stem.replace("/", "-")
+ return self.macros_dir.glob(f"**/{stem}-macros.h")
diff --git a/libc/utils/docgen/inttypes.yaml b/libc/utils/docgen/inttypes.yaml
new file mode 100644
index 000000000000..cbf50592ef07
--- /dev/null
+++ b/libc/utils/docgen/inttypes.yaml
@@ -0,0 +1,20 @@
+functions:
+ imaxabs:
+ c-definition: 7.8.2.1
+ in-latest-posix: ''
+ imaxdiv:
+ c-definition: 7.8.2.2
+ in-latest-posix: ''
+ strtoimax:
+ c-definition: 7.8.2.3
+ in-latest-posix: ''
+ strtoumax:
+ c-definition: 7.8.2.3
+ in-latest-posix: ''
+ wcstoimax:
+ c-definition: 7.8.2.4
+ in-latest-posix: ''
+ wcstoumax:
+ c-definition: 7.8.2.4
+ in-latest-posix: ''
+
diff --git a/libc/utils/docgen/locale.yaml b/libc/utils/docgen/locale.yaml
new file mode 100644
index 000000000000..eea91a885ff4
--- /dev/null
+++ b/libc/utils/docgen/locale.yaml
@@ -0,0 +1,37 @@
+functions:
+ duplocale:
+ in-latest-posix: ''
+ freelocale:
+ in-latest-posix: ''
+ getlocalename_l:
+ in-latest-posix: ''
+ localeconv:
+ c-definition: 7.11.2.1
+ in-latest-posix: ''
+ newlocale:
+ in-latest-posix: ''
+ setlocale:
+ c-definition: 7.11.1.1
+ in-latest-posix: ''
+ uselocale:
+ in-latest-posix: ''
+macros:
+ LC_ALL:
+ c-definition: '7.11'
+ in-latest-posix: ''
+ LC_COLLATE:
+ c-definition: '7.11'
+ in-latest-posix: ''
+ LC_CTYPE:
+ c-definition: '7.11'
+ in-latest-posix: ''
+ LC_MONETARY:
+ c-definition: '7.11'
+ in-latest-posix: ''
+ LC_NUMERIC:
+ c-definition: '7.11'
+ in-latest-posix: ''
+ LC_TIME:
+ c-definition: '7.11'
+ in-latest-posix: ''
+
diff --git a/libc/utils/docgen/setjmp.json b/libc/utils/docgen/setjmp.json
deleted file mode 100644
index 0b9a4e65da4f..000000000000
--- a/libc/utils/docgen/setjmp.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "macros": {
- "__STDC_VERSION_SETJMP_H__": {
- "c-definition": "7.13.2"
- }
- },
- "functions": {
- "setjmp": {
- "c-definition": "7.13.1.1"
- },
- "longjmp": {
- "c-definition": "7.13.2.1"
- }
- }
-}
diff --git a/libc/utils/docgen/setjmp.yaml b/libc/utils/docgen/setjmp.yaml
new file mode 100644
index 000000000000..123739d1a6ce
--- /dev/null
+++ b/libc/utils/docgen/setjmp.yaml
@@ -0,0 +1,15 @@
+functions:
+ longjmp:
+ c-definition: 7.13.2.1
+ in-latest-posix: ''
+ setjmp:
+ c-definition: 7.13.1.1
+ in-latest-posix: ''
+ siglongjmp:
+ in-latest-posix: ''
+ sigsetjmp:
+ in-latest-posix: ''
+macros:
+ __STDC_VERSION_SETJMP_H__:
+ c-definition: 7.13.2
+
diff --git a/libc/utils/docgen/signal.json b/libc/utils/docgen/signal.json
deleted file mode 100644
index 337b0c19717b..000000000000
--- a/libc/utils/docgen/signal.json
+++ /dev/null
@@ -1,152 +0,0 @@
-{
- "macros": {
- "SIG_DFL": {
- "c-definition": "7.14.3",
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- },
- "SIG_ERR": {
- "c-definition": "7.14.3",
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- },
- "SIG_HOLD": {
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- },
- "SIG_IGN": {
- "c-definition": "7.14.3",
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- },
- "SIGRTMIN": {
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- },
- "SIGRTMAX": {
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- },
- "SIGABRT": {
- "c-definition": "7.14.3",
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- },
- "SIGALRM": {
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- },
- "SIGBUS": {
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- },
- "SIGCHLD": {
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- },
- "SIGCONT": {
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- },
- "SIGFPE": {
- "c-definition": "7.14.3",
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- },
- "SIGHUP": {
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- },
- "SIGILL": {
- "c-definition": "7.14.3",
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- },
- "SIGINT": {
- "c-definition": "7.14.3",
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- },
- "SIGKILL": {
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- },
- "SIGPIPE": {
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- },
- "SIGPIPE": {
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- },
- "SIGQUIT": {
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- },
- "SIGSEGV": {
- "c-definition": "7.14.3",
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- },
- "SIGSTOP": {
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- },
- "SIGTERM": {
- "c-definition": "7.14.3",
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- },
- "SIGTSTP": {
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- },
- "SIGTTIN": {
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- },
- "SIGTTOU": {
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- },
- "SIGUSR1": {
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- },
- "SIGUSR2": {
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- },
- "SIGPOLL": {
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- },
- "SIGPROF": {
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- },
- "SIGSYS": {
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- },
- "SIGTRAP": {
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- },
- "SIGURG": {
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- },
- "SIGVTALRM": {
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- },
- "SIGXCPU": {
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- },
- "SIGXFSZ": {
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html"
- }
- },
- "functions": {
- "signal": {
- "c-definition": "7.14.1.1",
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/functions/signal.html"
- },
- "raise": {
- "c-definition": "7.14.2.1",
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/functions/raise.html"
- },
- "kill": {
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/functions/kill.html"
- },
- "sigaction": {
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigaction.html"
- },
- "sigaddset": {
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigaddset.html"
- },
- "sigaltstack": {
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigaltstack.html"
- },
- "sigdelset": {
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigdelset.html"
- },
- "sigemptyset": {
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigemptyset.html"
- },
- "sigfillset": {
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigfillset.html"
- },
- "sigprocmask": {
- "posix-definition": "https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigprocmask.html"
- }
- }
-}
diff --git a/libc/utils/docgen/signal.yaml b/libc/utils/docgen/signal.yaml
new file mode 100644
index 000000000000..da31a86b00eb
--- /dev/null
+++ b/libc/utils/docgen/signal.yaml
@@ -0,0 +1,102 @@
+functions:
+ kill:
+ in-latest-posix: ''
+ raise:
+ c-definition: 7.14.2.1
+ in-latest-posix: ''
+ sigaction:
+ in-latest-posix: ''
+ sigaddset:
+ in-latest-posix: ''
+ sigaltstack:
+ in-latest-posix: ''
+ sigdelset:
+ in-latest-posix: ''
+ sigemptyset:
+ in-latest-posix: ''
+ sigfillset:
+ in-latest-posix: ''
+ signal:
+ c-definition: 7.14.1.1
+ in-latest-posix: ''
+ sigprocmask:
+ in-latest-posix: ''
+macros:
+ SIGABRT:
+ c-definition: 7.14.3
+ in-latest-posix: ''
+ SIGALRM:
+ in-latest-posix: ''
+ SIGBUS:
+ in-latest-posix: ''
+ SIGCHLD:
+ in-latest-posix: ''
+ SIGCONT:
+ in-latest-posix: ''
+ SIGFPE:
+ c-definition: 7.14.3
+ in-latest-posix: ''
+ SIGHUP:
+ in-latest-posix: ''
+ SIGILL:
+ c-definition: 7.14.3
+ in-latest-posix: ''
+ SIGINT:
+ c-definition: 7.14.3
+ in-latest-posix: ''
+ SIGKILL:
+ in-latest-posix: ''
+ SIGPIPE:
+ in-latest-posix: ''
+ SIGPOLL:
+ in-latest-posix: ''
+ SIGPROF:
+ in-latest-posix: ''
+ SIGQUIT:
+ in-latest-posix: ''
+ SIGRTMAX:
+ in-latest-posix: ''
+ SIGRTMIN:
+ in-latest-posix: ''
+ SIGSEGV:
+ c-definition: 7.14.3
+ in-latest-posix: ''
+ SIGSTOP:
+ in-latest-posix: ''
+ SIGSYS:
+ in-latest-posix: ''
+ SIGTERM:
+ c-definition: 7.14.3
+ in-latest-posix: ''
+ SIGTRAP:
+ in-latest-posix: ''
+ SIGTSTP:
+ in-latest-posix: ''
+ SIGTTIN:
+ in-latest-posix: ''
+ SIGTTOU:
+ in-latest-posix: ''
+ SIGURG:
+ in-latest-posix: ''
+ SIGUSR1:
+ in-latest-posix: ''
+ SIGUSR2:
+ in-latest-posix: ''
+ SIGVTALRM:
+ in-latest-posix: ''
+ SIGXCPU:
+ in-latest-posix: ''
+ SIGXFSZ:
+ in-latest-posix: ''
+ SIG_DFL:
+ c-definition: 7.14.3
+ in-latest-posix: ''
+ SIG_ERR:
+ c-definition: 7.14.3
+ in-latest-posix: ''
+ SIG_HOLD:
+ in-latest-posix: ''
+ SIG_IGN:
+ c-definition: 7.14.3
+ in-latest-posix: ''
+
diff --git a/libc/utils/docgen/stdbit.json b/libc/utils/docgen/stdbit.json
deleted file mode 100644
index 25060c1ff9fd..000000000000
--- a/libc/utils/docgen/stdbit.json
+++ /dev/null
@@ -1,270 +0,0 @@
-{
- "macros": {
- "__STDC_VERSION_STDBIT_H__": {
- "c-definition": "7.18.1.2"
- },
- "__STDC_ENDIAN_LITTLE__": {
- "c-definition": "7.18.2.2"
- },
- "__STDC_ENDIAN_BIG__": {
- "c-definition": "7.18.2.2"
- },
- "__STDC_ENDIAN_NATIVE__": {
- "c-definition": "7.18.2.2"
- },
- "stdc_leading_zeros": {
- "c-definition": "7.18.3.1"
- },
- "stdc_leading_ones": {
- "c-definition": "7.18.4.1"
- },
- "stdc_trailing_zeros": {
- "c-definition": "7.18.5.1"
- },
- "stdc_trailing_ones": {
- "c-definition": "7.18.6.1"
- },
- "stdc_first_leading_zero": {
- "c-definition": "7.18.7.1"
- },
- "stdc_first_leading_one": {
- "c-definition": "7.18.8.1"
- },
- "stdc_first_trailing_zero": {
- "c-definition": "7.18.9.1"
- },
- "stdc_first_trailing_one": {
- "c-definition": "7.18.10.1"
- },
- "stdc_count_zeros": {
- "c-definition": "7.18.11.1"
- },
- "stdc_count_ones": {
- "c-definition": "7.18.12.1"
- },
- "stdc_has_single_bit": {
- "c-definition": "7.18.13.1"
- },
- "stdc_bit_width": {
- "c-definition": "7.18.14.1"
- },
- "stdc_bit_floor": {
- "c-definition": "7.18.15.1"
- },
- "stdc_bit_ceil": {
- "c-definition": "7.18.16.1"
- }
- },
- "functions": {
- "stdc_leading_zeros_uc": {
- "c-definition": "7.18.3"
- },
- "stdc_leading_zeros_us": {
- "c-definition": "7.18.3"
- },
- "stdc_leading_zeros_ui": {
- "c-definition": "7.18.3"
- },
- "stdc_leading_zeros_ul": {
- "c-definition": "7.18.3"
- },
- "stdc_leading_zeros_ull": {
- "c-definition": "7.18.3"
- },
- "stdc_leading_ones_uc": {
- "c-definition": "7.18.4"
- },
- "stdc_leading_ones_us": {
- "c-definition": "7.18.4"
- },
- "stdc_leading_ones_ui": {
- "c-definition": "7.18.4"
- },
- "stdc_leading_ones_ul": {
- "c-definition": "7.18.4"
- },
- "stdc_leading_ones_ull": {
- "c-definition": "7.18.4"
- },
- "stdc_trailing_zeros_uc": {
- "c-definition": "7.18.5"
- },
- "stdc_trailing_zeros_us": {
- "c-definition": "7.18.5"
- },
- "stdc_trailing_zeros_ui": {
- "c-definition": "7.18.5"
- },
- "stdc_trailing_zeros_ul": {
- "c-definition": "7.18.5"
- },
- "stdc_trailing_zeros_ull": {
- "c-definition": "7.18.5"
- },
- "stdc_trailing_ones_uc": {
- "c-definition": "7.18.6"
- },
- "stdc_trailing_ones_us": {
- "c-definition": "7.18.6"
- },
- "stdc_trailing_ones_ui": {
- "c-definition": "7.18.6"
- },
- "stdc_trailing_ones_ul": {
- "c-definition": "7.18.6"
- },
- "stdc_trailing_ones_ull": {
- "c-definition": "7.18.6"
- },
- "stdc_first_leading_zero_uc": {
- "c-definition": "7.18.7"
- },
- "stdc_first_leading_zero_us": {
- "c-definition": "7.18.7"
- },
- "stdc_first_leading_zero_ui": {
- "c-definition": "7.18.7"
- },
- "stdc_first_leading_zero_ul": {
- "c-definition": "7.18.7"
- },
- "stdc_first_leading_zero_ull": {
- "c-definition": "7.18.7"
- },
- "stdc_first_leading_one_uc": {
- "c-definition": "7.18.8"
- },
- "stdc_first_leading_one_us": {
- "c-definition": "7.18.8"
- },
- "stdc_first_leading_one_ui": {
- "c-definition": "7.18.8"
- },
- "stdc_first_leading_one_ul": {
- "c-definition": "7.18.8"
- },
- "stdc_first_leading_one_ull": {
- "c-definition": "7.18.8"
- },
- "stdc_first_trailing_zero_uc": {
- "c-definition": "7.18.9"
- },
- "stdc_first_trailing_zero_us": {
- "c-definition": "7.18.9"
- },
- "stdc_first_trailing_zero_ui": {
- "c-definition": "7.18.9"
- },
- "stdc_first_trailing_zero_ul": {
- "c-definition": "7.18.9"
- },
- "stdc_first_trailing_zero_ull": {
- "c-definition": "7.18.9"
- },
- "stdc_first_trailing_one_uc": {
- "c-definition": "7.18.10"
- },
- "stdc_first_trailing_one_us": {
- "c-definition": "7.18.10"
- },
- "stdc_first_trailing_one_ui": {
- "c-definition": "7.18.10"
- },
- "stdc_first_trailing_one_ul": {
- "c-definition": "7.18.10"
- },
- "stdc_first_trailing_one_ull": {
- "c-definition": "7.18.10"
- },
- "stdc_count_zeros_uc": {
- "c-definition": "7.18.11"
- },
- "stdc_count_zeros_us": {
- "c-definition": "7.18.11"
- },
- "stdc_count_zeros_ui": {
- "c-definition": "7.18.11"
- },
- "stdc_count_zeros_ul": {
- "c-definition": "7.18.11"
- },
- "stdc_count_zeros_ull": {
- "c-definition": "7.18.11"
- },
- "stdc_count_ones_uc": {
- "c-definition": "7.18.12"
- },
- "stdc_count_ones_us": {
- "c-definition": "7.18.12"
- },
- "stdc_count_ones_ui": {
- "c-definition": "7.18.12"
- },
- "stdc_count_ones_ul": {
- "c-definition": "7.18.12"
- },
- "stdc_count_ones_ull": {
- "c-definition": "7.18.12"
- },
- "stdc_has_single_bit_uc": {
- "c-definition": "7.18.13"
- },
- "stdc_has_single_bit_us": {
- "c-definition": "7.18.13"
- },
- "stdc_has_single_bit_ui": {
- "c-definition": "7.18.13"
- },
- "stdc_has_single_bit_ul": {
- "c-definition": "7.18.13"
- },
- "stdc_has_single_bit_ull": {
- "c-definition": "7.18.13"
- },
- "stdc_bit_width_uc": {
- "c-definition": "7.18.14"
- },
- "stdc_bit_width_us": {
- "c-definition": "7.18.14"
- },
- "stdc_bit_width_ui": {
- "c-definition": "7.18.14"
- },
- "stdc_bit_width_ul": {
- "c-definition": "7.18.14"
- },
- "stdc_bit_width_ull": {
- "c-definition": "7.18.14"
- },
- "stdc_bit_floor_uc": {
- "c-definition": "7.18.15"
- },
- "stdc_bit_floor_us": {
- "c-definition": "7.18.15"
- },
- "stdc_bit_floor_ui": {
- "c-definition": "7.18.15"
- },
- "stdc_bit_floor_ul": {
- "c-definition": "7.18.15"
- },
- "stdc_bit_floor_ull": {
- "c-definition": "7.18.15"
- },
- "stdc_bit_ceil_uc": {
- "c-definition": "7.18.16"
- },
- "stdc_bit_ceil_us": {
- "c-definition": "7.18.16"
- },
- "stdc_bit_ceil_ui": {
- "c-definition": "7.18.16"
- },
- "stdc_bit_ceil_ul": {
- "c-definition": "7.18.16"
- },
- "stdc_bit_ceil_ull": {
- "c-definition": "7.18.16"
- }
- }
-}
diff --git a/libc/utils/docgen/stdbit.yaml b/libc/utils/docgen/stdbit.yaml
new file mode 100644
index 000000000000..976221601e9c
--- /dev/null
+++ b/libc/utils/docgen/stdbit.yaml
@@ -0,0 +1,179 @@
+functions:
+ stdc_bit_ceil_uc:
+ c-definition: 7.18.16
+ stdc_bit_ceil_ui:
+ c-definition: 7.18.16
+ stdc_bit_ceil_ul:
+ c-definition: 7.18.16
+ stdc_bit_ceil_ull:
+ c-definition: 7.18.16
+ stdc_bit_ceil_us:
+ c-definition: 7.18.16
+ stdc_bit_floor_uc:
+ c-definition: 7.18.15
+ stdc_bit_floor_ui:
+ c-definition: 7.18.15
+ stdc_bit_floor_ul:
+ c-definition: 7.18.15
+ stdc_bit_floor_ull:
+ c-definition: 7.18.15
+ stdc_bit_floor_us:
+ c-definition: 7.18.15
+ stdc_bit_width_uc:
+ c-definition: 7.18.14
+ stdc_bit_width_ui:
+ c-definition: 7.18.14
+ stdc_bit_width_ul:
+ c-definition: 7.18.14
+ stdc_bit_width_ull:
+ c-definition: 7.18.14
+ stdc_bit_width_us:
+ c-definition: 7.18.14
+ stdc_count_ones_uc:
+ c-definition: 7.18.12
+ stdc_count_ones_ui:
+ c-definition: 7.18.12
+ stdc_count_ones_ul:
+ c-definition: 7.18.12
+ stdc_count_ones_ull:
+ c-definition: 7.18.12
+ stdc_count_ones_us:
+ c-definition: 7.18.12
+ stdc_count_zeros_uc:
+ c-definition: 7.18.11
+ stdc_count_zeros_ui:
+ c-definition: 7.18.11
+ stdc_count_zeros_ul:
+ c-definition: 7.18.11
+ stdc_count_zeros_ull:
+ c-definition: 7.18.11
+ stdc_count_zeros_us:
+ c-definition: 7.18.11
+ stdc_first_leading_one_uc:
+ c-definition: 7.18.8
+ stdc_first_leading_one_ui:
+ c-definition: 7.18.8
+ stdc_first_leading_one_ul:
+ c-definition: 7.18.8
+ stdc_first_leading_one_ull:
+ c-definition: 7.18.8
+ stdc_first_leading_one_us:
+ c-definition: 7.18.8
+ stdc_first_leading_zero_uc:
+ c-definition: 7.18.7
+ stdc_first_leading_zero_ui:
+ c-definition: 7.18.7
+ stdc_first_leading_zero_ul:
+ c-definition: 7.18.7
+ stdc_first_leading_zero_ull:
+ c-definition: 7.18.7
+ stdc_first_leading_zero_us:
+ c-definition: 7.18.7
+ stdc_first_trailing_one_uc:
+ c-definition: 7.18.10
+ stdc_first_trailing_one_ui:
+ c-definition: 7.18.10
+ stdc_first_trailing_one_ul:
+ c-definition: 7.18.10
+ stdc_first_trailing_one_ull:
+ c-definition: 7.18.10
+ stdc_first_trailing_one_us:
+ c-definition: 7.18.10
+ stdc_first_trailing_zero_uc:
+ c-definition: 7.18.9
+ stdc_first_trailing_zero_ui:
+ c-definition: 7.18.9
+ stdc_first_trailing_zero_ul:
+ c-definition: 7.18.9
+ stdc_first_trailing_zero_ull:
+ c-definition: 7.18.9
+ stdc_first_trailing_zero_us:
+ c-definition: 7.18.9
+ stdc_has_single_bit_uc:
+ c-definition: 7.18.13
+ stdc_has_single_bit_ui:
+ c-definition: 7.18.13
+ stdc_has_single_bit_ul:
+ c-definition: 7.18.13
+ stdc_has_single_bit_ull:
+ c-definition: 7.18.13
+ stdc_has_single_bit_us:
+ c-definition: 7.18.13
+ stdc_leading_ones_uc:
+ c-definition: 7.18.4
+ stdc_leading_ones_ui:
+ c-definition: 7.18.4
+ stdc_leading_ones_ul:
+ c-definition: 7.18.4
+ stdc_leading_ones_ull:
+ c-definition: 7.18.4
+ stdc_leading_ones_us:
+ c-definition: 7.18.4
+ stdc_leading_zeros_uc:
+ c-definition: 7.18.3
+ stdc_leading_zeros_ui:
+ c-definition: 7.18.3
+ stdc_leading_zeros_ul:
+ c-definition: 7.18.3
+ stdc_leading_zeros_ull:
+ c-definition: 7.18.3
+ stdc_leading_zeros_us:
+ c-definition: 7.18.3
+ stdc_trailing_ones_uc:
+ c-definition: 7.18.6
+ stdc_trailing_ones_ui:
+ c-definition: 7.18.6
+ stdc_trailing_ones_ul:
+ c-definition: 7.18.6
+ stdc_trailing_ones_ull:
+ c-definition: 7.18.6
+ stdc_trailing_ones_us:
+ c-definition: 7.18.6
+ stdc_trailing_zeros_uc:
+ c-definition: 7.18.5
+ stdc_trailing_zeros_ui:
+ c-definition: 7.18.5
+ stdc_trailing_zeros_ul:
+ c-definition: 7.18.5
+ stdc_trailing_zeros_ull:
+ c-definition: 7.18.5
+ stdc_trailing_zeros_us:
+ c-definition: 7.18.5
+macros:
+ __STDC_ENDIAN_BIG__:
+ c-definition: 7.18.2.2
+ __STDC_ENDIAN_LITTLE__:
+ c-definition: 7.18.2.2
+ __STDC_ENDIAN_NATIVE__:
+ c-definition: 7.18.2.2
+ __STDC_VERSION_STDBIT_H__:
+ c-definition: 7.18.1.2
+ stdc_bit_ceil:
+ c-definition: 7.18.16.1
+ stdc_bit_floor:
+ c-definition: 7.18.15.1
+ stdc_bit_width:
+ c-definition: 7.18.14.1
+ stdc_count_ones:
+ c-definition: 7.18.12.1
+ stdc_count_zeros:
+ c-definition: 7.18.11.1
+ stdc_first_leading_one:
+ c-definition: 7.18.8.1
+ stdc_first_leading_zero:
+ c-definition: 7.18.7.1
+ stdc_first_trailing_one:
+ c-definition: 7.18.10.1
+ stdc_first_trailing_zero:
+ c-definition: 7.18.9.1
+ stdc_has_single_bit:
+ c-definition: 7.18.13.1
+ stdc_leading_ones:
+ c-definition: 7.18.4.1
+ stdc_leading_zeros:
+ c-definition: 7.18.3.1
+ stdc_trailing_ones:
+ c-definition: 7.18.6.1
+ stdc_trailing_zeros:
+ c-definition: 7.18.5.1
+
diff --git a/libc/utils/docgen/stdio.yaml b/libc/utils/docgen/stdio.yaml
new file mode 100644
index 000000000000..9dabee44a51c
--- /dev/null
+++ b/libc/utils/docgen/stdio.yaml
@@ -0,0 +1,226 @@
+macros:
+ __STDC_VERSION_STDIO_H__:
+ c-definition: '7.23.1'
+ _IOFBF:
+ c-definition: '7.23.1'
+ in-latest-posix: ''
+ _IOLBF:
+ c-definition: '7.23.1'
+ in-latest-posix: ''
+ _IONBF:
+ c-definition: '7.23.1'
+ in-latest-posix: ''
+ BUFSIZ:
+ c-definition: '7.23.1'
+ in-latest-posix: ''
+ EOF:
+ c-definition: '7.23.1'
+ in-latest-posix: ''
+ FOPEN_MAX:
+ c-definition: '7.23.1'
+ in-latest-posix: ''
+ FILENAME_MAX:
+ c-definition: '7.23.1'
+ in-latest-posix: ''
+ _PRINTF_NAN_LEN_MAX:
+ c-definition: '7.23.1'
+ L_tmpnam:
+ c-definition: '7.23.1'
+ in-latest-posix: ''
+ L_ctermid:
+ in-latest-posix: ''
+ SEEK_CUR:
+ c-definition: '7.23.1'
+ in-latest-posix: ''
+ SEEK_END:
+ c-definition: '7.23.1'
+ in-latest-posix: ''
+ SEEK_SET:
+ c-definition: '7.23.1'
+ in-latest-posix: ''
+ TMP_MAX:
+ c-definition: '7.23.1'
+ in-latest-posix: ''
+ stderr:
+ c-definition: '7.23.1'
+ in-latest-posix: ''
+ stdin:
+ c-definition: '7.23.1'
+ in-latest-posix: ''
+ stdout:
+ c-definition: '7.23.1'
+ in-latest-posix: ''
+functions:
+ remove:
+ c-definition: '7.23.4.1'
+ in-latest-posix: ''
+ rename:
+ c-definition: '7.23.4.2'
+ in-latest-posix: ''
+ tmpfile:
+ c-definition: '7.23.4.3'
+ in-latest-posix: ''
+ tmpnam:
+ c-definition: '7.23.4.4'
+ in-latest-posix: ''
+ fclose:
+ c-definition: '7.23.5.1'
+ in-latest-posix: ''
+ fflush:
+ c-definition: '7.23.5.2'
+ in-latest-posix: ''
+ fopen:
+ c-definition: '7.23.5.3'
+ in-latest-posix: ''
+ freopen:
+ c-definition: '7.23.5.4'
+ in-latest-posix: ''
+ setbuf:
+ c-definition: '7.23.5.5'
+ in-latest-posix: ''
+ setvbuf:
+ c-definition: '7.23.5.6'
+ in-latest-posix: ''
+ fprintf:
+ c-definition: '7.23.6.1'
+ in-latest-posix: ''
+ fscanf:
+ c-definition: '7.23.6.2'
+ in-latest-posix: ''
+ printf:
+ c-definition: '7.23.6.3'
+ in-latest-posix: ''
+ scanf:
+ c-definition: '7.23.6.4'
+ in-latest-posix: ''
+ snprintf:
+ c-definition: '7.23.6.5'
+ in-latest-posix: ''
+ sprintf:
+ c-definition: '7.23.6.6'
+ in-latest-posix: ''
+ sscanf:
+ c-definition: '7.23.6.7'
+ in-latest-posix: ''
+ vfprintf:
+ c-definition: '7.23.6.8'
+ in-latest-posix: ''
+ vfscanf:
+ c-definition: '7.23.6.9'
+ in-latest-posix: ''
+ vprintf:
+ c-definition: '7.23.6.10'
+ in-latest-posix: ''
+ vscanf:
+ c-definition: '7.23.6.11'
+ in-latest-posix: ''
+ vsnprintf:
+ c-definition: '7.23.6.12'
+ in-latest-posix: ''
+ vsprintf:
+ c-definition: '7.23.6.13'
+ in-latest-posix: ''
+ vsscanf:
+ c-definition: '7.23.6.14'
+ in-latest-posix: ''
+ fgetc:
+ c-definition: '7.23.7.1'
+ in-latest-posix: ''
+ fgets:
+ c-definition: '7.23.7.2'
+ in-latest-posix: ''
+ fputc:
+ c-definition: '7.23.7.3'
+ in-latest-posix: ''
+ fputs:
+ c-definition: '7.23.7.4'
+ in-latest-posix: ''
+ getc:
+ c-definition: '7.23.7.5'
+ in-latest-posix: ''
+ getchar:
+ c-definition: '7.23.7.6'
+ in-latest-posix: ''
+ putc:
+ c-definition: '7.23.7.7'
+ in-latest-posix: ''
+ putchar:
+ c-definition: '7.23.7.8'
+ in-latest-posix: ''
+ puts:
+ c-definition: '7.23.7.9'
+ in-latest-posix: ''
+ ungetc:
+ c-definition: '7.23.7.10'
+ in-latest-posix: ''
+ fread:
+ c-definition: '7.23.8.1'
+ in-latest-posix: ''
+ fwrite:
+ c-definition: '7.23.8.2'
+ in-latest-posix: ''
+ fgetpos:
+ c-definition: '7.23.9.1'
+ in-latest-posix: ''
+ fseek:
+ c-definition: '7.23.9.2'
+ in-latest-posix: ''
+ fsetpos:
+ c-definition: '7.23.9.3'
+ in-latest-posix: ''
+ ftell:
+ c-definition: '7.23.9.4'
+ in-latest-posix: ''
+ rewind:
+ c-definition: '7.23.9.5'
+ in-latest-posix: ''
+ clearerr:
+ c-definition: '7.23.10.1'
+ in-latest-posix: ''
+ feof:
+ c-definition: '7.23.10.2'
+ in-latest-posix: ''
+ ferror:
+ c-definition: '7.23.10.3'
+ in-latest-posix: ''
+ perror:
+ c-definition: '7.23.10.4'
+ in-latest-posix: ''
+ ctermid:
+ in-latest-posix: ''
+ dprintf:
+ in-latest-posix: ''
+ fdopen:
+ in-latest-posix: ''
+ fileno:
+ in-latest-posix: ''
+ flockfile:
+ in-latest-posix: ''
+ fmemopen:
+ in-latest-posix: ''
+ fseeko:
+ in-latest-posix: ''
+ ftello:
+ in-latest-posix: ''
+ ftrylockfile:
+ in-latest-posix: ''
+ funlockfile:
+ in-latest-posix: ''
+ getdelim:
+ in-latest-posix: ''
+ getline:
+ in-latest-posix: ''
+ open_memstream:
+ in-latest-posix: ''
+ pclose:
+ in-latest-posix: ''
+ popen:
+ in-latest-posix: ''
+ putc_unlocked:
+ in-latest-posix: ''
+ putchar_unlocked:
+ in-latest-posix: ''
+ renameat:
+ in-latest-posix: ''
+ vdprintf:
+ in-latest-posix: ''
diff --git a/libc/utils/docgen/stdlib.yaml b/libc/utils/docgen/stdlib.yaml
new file mode 100644
index 000000000000..526ddefbe1ce
--- /dev/null
+++ b/libc/utils/docgen/stdlib.yaml
@@ -0,0 +1,158 @@
+functions:
+ _Exit:
+ c-definition: 7.24.4.5
+ in-latest-posix: ''
+ abort:
+ c-definition: 7.24.4.1
+ in-latest-posix: ''
+ abs:
+ c-definition: 7.24.6.1
+ in-latest-posix: ''
+ aligned_alloc:
+ c-definition: 7.24.3.1
+ in-latest-posix: ''
+ at_quick_exit:
+ c-definition: 7.24.4.3
+ in-latest-posix: ''
+ atexit:
+ c-definition: 7.24.4.2
+ in-latest-posix: ''
+ atof:
+ c-definition: 7.24.1.1
+ in-latest-posix: ''
+ atoi:
+ c-definition: 7.24.1.2
+ in-latest-posix: ''
+ atol:
+ c-definition: 7.24.1.2
+ in-latest-posix: ''
+ atoll:
+ c-definition: 7.24.1.2
+ in-latest-posix: ''
+ bsearch:
+ c-definition: 7.24.5.1
+ in-latest-posix: ''
+ calloc:
+ c-definition: 7.24.3.2
+ in-latest-posix: ''
+ div:
+ c-definition: 7.24.6.2
+ in-latest-posix: ''
+ exit:
+ c-definition: 7.24.4.4
+ in-latest-posix: ''
+ free:
+ c-definition: 7.24.3.3
+ in-latest-posix: ''
+ free_aligned_sized:
+ c-definition: 7.24.3.5
+ free_sized:
+ c-definition: 7.24.3.4
+ getenv:
+ c-definition: 7.24.4.6
+ in-latest-posix: ''
+ labs:
+ c-definition: 7.24.6.1
+ in-latest-posix: ''
+ ldiv:
+ c-definition: 7.24.6.2
+ in-latest-posix: ''
+ llabs:
+ c-definition: 7.24.6.1
+ in-latest-posix: ''
+ lldiv:
+ c-definition: 7.24.6.2
+ in-latest-posix: ''
+ malloc:
+ c-definition: 7.24.3.6
+ in-latest-posix: ''
+ mblen:
+ c-definition: 7.24.7.1
+ in-latest-posix: ''
+ mbstowcs:
+ c-definition: 7.24.8.1
+ in-latest-posix: ''
+ mbtowc:
+ c-definition: 7.24.7.2
+ in-latest-posix: ''
+ memalignment:
+ c-definition: 7.24.9.1
+ qsort:
+ c-definition: 7.24.5.2
+ in-latest-posix: ''
+ quick_exit:
+ c-definition: 7.24.4.7
+ in-latest-posix: ''
+ rand:
+ c-definition: 7.24.2.1
+ in-latest-posix: ''
+ realloc:
+ c-definition: 7.24.3.7
+ in-latest-posix: ''
+ srand:
+ c-definition: 7.24.2.2
+ in-latest-posix: ''
+ strfromd:
+ c-definition: 7.24.1.3
+ strfromd128:
+ c-definition: 7.24.1.4
+ strfromd32:
+ c-definition: 7.24.1.4
+ strfromd64:
+ c-definition: 7.24.1.4
+ strfromf:
+ c-definition: 7.24.1.3
+ strfroml:
+ c-definition: 7.24.1.3
+ strtod:
+ c-definition: 7.24.1.5
+ in-latest-posix: ''
+ strtod128:
+ c-definition: 7.24.1.6
+ strtod32:
+ c-definition: 7.24.1.6
+ strtod64:
+ c-definition: 7.24.1.6
+ strtof:
+ c-definition: 7.24.1.5
+ in-latest-posix: ''
+ strtol:
+ c-definition: 7.24.1.7
+ in-latest-posix: ''
+ strtold:
+ c-definition: 7.24.1.5
+ in-latest-posix: ''
+ strtoll:
+ c-definition: 7.24.1.7
+ in-latest-posix: ''
+ strtoul:
+ c-definition: 7.24.1.7
+ in-latest-posix: ''
+ strtoull:
+ c-definition: 7.24.1.7
+ in-latest-posix: ''
+ system:
+ c-definition: 7.24.4.8
+ in-latest-posix: ''
+ wcstombs:
+ c-definition: 7.24.8.2
+ in-latest-posix: ''
+ wctomb:
+ c-definition: 7.24.7.3
+ in-latest-posix: ''
+macros:
+ EXIT_FAILURE:
+ c-definition: '7.24'
+ in-latest-posix: ''
+ EXIT_SUCCESS:
+ c-definition: '7.24'
+ in-latest-posix: ''
+ MB_CUR_MAX:
+ c-definition: '7.24'
+ in-latest-posix: ''
+ RAND_MAX:
+ c-definition: '7.24'
+ in-latest-posix: ''
+ __STDC_VERSION_STDLIB_H__:
+ c-definition: '7.24'
+
diff --git a/libc/utils/docgen/string.yaml b/libc/utils/docgen/string.yaml
new file mode 100644
index 000000000000..d703a8e3593e
--- /dev/null
+++ b/libc/utils/docgen/string.yaml
@@ -0,0 +1,94 @@
+functions:
+ memccpy:
+ c-definition: 7.26.2.2
+ in-latest-posix: ''
+ memchr:
+ c-definition: 7.26.5.2
+ in-latest-posix: ''
+ memcmp:
+ c-definition: 7.26.4.1
+ in-latest-posix: ''
+ memcpy:
+ c-definition: 7.26.2.1
+ in-latest-posix: ''
+ memmove:
+ c-definition: 7.26.2.3
+ in-latest-posix: ''
+ mempcpy:
+ c-definition: 'TODO: glibc extension'
+ memset:
+ c-definition: 7.26.6.1
+ in-latest-posix: ''
+ memset_explicit:
+ c-definition: 7.26.6.2
+ stpcpy:
+ in-latest-posix: ''
+ stpncpy:
+ in-latest-posix: ''
+ strcat:
+ c-definition: 7.26.3.1
+ in-latest-posix: ''
+ strchr:
+ c-definition: 7.26.5.3
+ in-latest-posix: ''
+ strcmp:
+ c-definition: 7.26.4.2
+ in-latest-posix: ''
+ strcoll:
+ c-definition: 7.26.4.3
+ in-latest-posix: ''
+ strcoll_l:
+ in-latest-posix: ''
+ strcpy:
+ c-definition: 7.26.2.4
+ in-latest-posix: ''
+ strcspn:
+ c-definition: 7.26.5.4
+ in-latest-posix: ''
+ strdup:
+ c-definition: 7.26.2.6
+ in-latest-posix: ''
+ strerror:
+ c-definition: 7.26.6.3
+ in-latest-posix: ''
+ strlen:
+ c-definition: 7.26.6.4
+ in-latest-posix: ''
+ strncat:
+ c-definition: 7.26.3.2
+ in-latest-posix: ''
+ strncmp:
+ c-definition: 7.26.4.4
+ in-latest-posix: ''
+ strncpy:
+ c-definition: 7.26.2.5
+ in-latest-posix: ''
+ strndup:
+ c-definition: 7.26.2.7
+ in-latest-posix: ''
+ strpbrk:
+ c-definition: 7.26.5.5
+ in-latest-posix: ''
+ strrchr:
+ c-definition: 7.26.5.6
+ in-latest-posix: ''
+ strspn:
+ c-definition: 7.26.5.7
+ in-latest-posix: ''
+ strstr:
+ c-definition: 7.26.5.8
+ in-latest-posix: ''
+ strtok:
+ c-definition: 7.26.5.9
+ in-latest-posix: ''
+ strtok_r:
+ in-latest-posix: ''
+ strxfrm:
+ c-definition: 7.26.4.5
+ in-latest-posix: ''
+ strxfrm_l:
+ in-latest-posix: ''
+macros:
+ __STDC_VERSION_STRING_H__:
+ c-definition: 7.26.1
+
diff --git a/libc/utils/docgen/sys/mman.yaml b/libc/utils/docgen/sys/mman.yaml
new file mode 100644
index 000000000000..dba26cabc662
--- /dev/null
+++ b/libc/utils/docgen/sys/mman.yaml
@@ -0,0 +1,77 @@
+functions:
+ mlock:
+ posix-definition: ''
+ mlockall:
+ posix-definition: ''
+ mmap:
+ posix-definition: ''
+ mprotect:
+ posix-definition: ''
+ msync:
+ posix-definition: ''
+ munlock:
+ posix-definition: ''
+ munlockall:
+ posix-definition: ''
+ munmap:
+ posix-definition: ''
+ posix_madvise:
+ posix-definition: ''
+ posix_mem_offset:
+ posix-definition: ''
+ posix_typed_mem_get_info:
+ posix-definition: ''
+ posix_typed_mem_open:
+ posix-definition: ''
+ shm_open:
+ posix-definition: ''
+ shm_unlink:
+ posix-definition: ''
+macros:
+ MAP_ANON:
+ posix-definition: ''
+ MAP_ANONYMOUS:
+ posix-definition: ''
+ MAP_FAILED:
+ posix-definition: ''
+ MAP_FIXED:
+ posix-definition: ''
+ MAP_PRIVATE:
+ posix-definition: ''
+ MAP_SHARED:
+ posix-definition: ''
+ MCL_CURRENT:
+ posix-definition: ''
+ MCL_FUTURE:
+ posix-definition: ''
+ MS_ASYNC:
+ posix-definition: ''
+ MS_INVALIDATE:
+ posix-definition: ''
+ MS_SYNC:
+ posix-definition: ''
+ POSIX_MADV_DONTNEED:
+ posix-definition: ''
+ POSIX_MADV_NORMAL:
+ posix-definition: ''
+ POSIX_MADV_RANDOM:
+ posix-definition: ''
+ POSIX_MADV_SEQUENTIAL:
+ posix-definition: ''
+ POSIX_MADV_WILLNEED:
+ posix-definition: ''
+ POSIX_TYPED_MEM_ALLOCATE:
+ posix-definition: ''
+ POSIX_TYPED_MEM_ALLOCATE_CONTIG:
+ posix-definition: ''
+ POSIX_TYPED_MEM_MAP_ALLOCATABLE:
+ posix-definition: ''
+ PROT_EXEC:
+ posix-definition: ''
+ PROT_NONE:
+ posix-definition: ''
+ PROT_READ:
+ posix-definition: ''
+ PROT_WRITE:
+ posix-definition: ''
+
diff --git a/libc/utils/docgen/threads.json b/libc/utils/docgen/threads.json
deleted file mode 100644
index 8591cbde55a4..000000000000
--- a/libc/utils/docgen/threads.json
+++ /dev/null
@@ -1,87 +0,0 @@
-{
- "macros": {
- "ONCE_FLAG_INIT": {
- "c-definition": "7.28.1.3"
- },
- "TSS_DTOR_ITERATIONS": {
- "c-definition": "7.28.1.3"
- }
- },
- "functions": {
- "call_once": {
- "c-definition": "7.28.2.1"
- },
- "cnd_broadcast": {
- "c-definition": "7.28.3.1"
- },
- "cnd_destroy": {
- "c-definition": "7.28.3.2"
- },
- "cnd_init": {
- "c-definition": "7.28.3.3"
- },
- "cnd_signal": {
- "c-definition": "7.28.3.4"
- },
- "cnd_timedwait": {
- "c-definition": "7.28.3.5"
- },
- "cnd_wait": {
- "c-definition": "7.28.3.6"
- },
- "mtx_destroy": {
- "c-definition": "7.28.4.1"
- },
- "mtx_init": {
- "c-definition": "7.28.4.2"
- },
- "mtx_lock": {
- "c-definition": "7.28.4.3"
- },
- "mtx_timedlock": {
- "c-definition": "7.28.4.4"
- },
- "mtx_trylock": {
- "c-definition": "7.28.4.5"
- },
- "mtx_unlock": {
- "c-definition": "7.28.4.6"
- },
- "thrd_create": {
- "c-definition": "7.28.5.1"
- },
- "thrd_current": {
- "c-definition": "7.28.5.2"
- },
- "thrd_detach": {
- "c-definition": "7.28.5.3"
- },
- "thrd_equal": {
- "c-definition": "7.28.5.4"
- },
- "thrd_exit": {
- "c-definition": "7.28.5.5"
- },
- "thrd_join": {
- "c-definition": "7.28.5.6"
- },
- "thrd_sleep": {
- "c-definition": "7.28.5.7"
- },
- "thrd_yield": {
- "c-definition": "7.28.5.8"
- },
- "tss_create": {
- "c-definition": "7.28.6.1"
- },
- "tss_delete": {
- "c-definition": "7.28.6.2"
- },
- "tss_get": {
- "c-definition": "7.28.6.3"
- },
- "tss_set": {
- "c-definition": "7.28.6.4"
- }
- }
-}
diff --git a/libc/utils/docgen/threads.yaml b/libc/utils/docgen/threads.yaml
new file mode 100644
index 000000000000..83db0992dc45
--- /dev/null
+++ b/libc/utils/docgen/threads.yaml
@@ -0,0 +1,88 @@
+functions:
+ call_once:
+ c-definition: 7.28.2.1
+ in-latest-posix: ''
+ cnd_broadcast:
+ c-definition: 7.28.3.1
+ in-latest-posix: ''
+ cnd_destroy:
+ c-definition: 7.28.3.2
+ in-latest-posix: ''
+ cnd_init:
+ c-definition: 7.28.3.3
+ in-latest-posix: ''
+ cnd_signal:
+ c-definition: 7.28.3.4
+ in-latest-posix: ''
+ cnd_timedwait:
+ c-definition: 7.28.3.5
+ in-latest-posix: ''
+ cnd_wait:
+ c-definition: 7.28.3.6
+ in-latest-posix: ''
+ mtx_destroy:
+ c-definition: 7.28.4.2
+ in-latest-posix: ''
+ mtx_init:
+ c-definition: 7.28.4.3
+ in-latest-posix: ''
+ mtx_lock:
+ c-definition: 7.28.4.4
+ in-latest-posix: ''
+ mtx_timedlock:
+ c-definition: 7.28.4.5
+ in-latest-posix: ''
+ mtx_trylock:
+ c-definition: 7.28.4.6
+ in-latest-posix: ''
+ mtx_unlock:
+ c-definition: 7.28.4.7
+ in-latest-posix: ''
+ thrd_create:
+ c-definition: 7.28.5.1
+ in-latest-posix: ''
+ thrd_current:
+ c-definition: 7.28.5.2
+ in-latest-posix: ''
+ thrd_detach:
+ c-definition: 7.28.5.3
+ in-latest-posix: ''
+ thrd_equal:
+ c-definition: 7.28.5.4
+ in-latest-posix: ''
+ thrd_exit:
+ c-definition: 7.28.5.5
+ in-latest-posix: ''
+ thrd_join:
+ c-definition: 7.28.5.6
+ in-latest-posix: ''
+ thrd_sleep:
+ c-definition: 7.28.5.7
+ in-latest-posix: ''
+ thrd_yield:
+ c-definition: 7.28.5.8
+ in-latest-posix: ''
+ tss_create:
+ c-definition: 7.28.6.1
+ in-latest-posix: ''
+ tss_delete:
+ c-definition: 7.28.6.2
+ in-latest-posix: ''
+ tss_get:
+ c-definition: 7.28.6.3
+ in-latest-posix: ''
+ tss_set:
+ c-definition: 7.28.6.4
+ in-latest-posix: ''
+macros:
+ ONCE_FLAG_INIT:
+ c-definition: 7.28.1
+ in-latest-posix: ''
+ TSS_DTOR_ITERATIONS:
+ c-definition: 7.28.1
+ in-latest-posix: ''
+ __STDC_NO_THREADS__:
+ c-definition: 7.28.1
+ thread_local:
+ in-latest-posix: ''
+
diff --git a/libc/utils/docgen/uchar.yaml b/libc/utils/docgen/uchar.yaml
new file mode 100644
index 000000000000..580af0f54833
--- /dev/null
+++ b/libc/utils/docgen/uchar.yaml
@@ -0,0 +1,21 @@
+functions:
+ c16rtomb:
+ c-definition: 7.30.2.5
+ in-latest-posix: ''
+ c32rtomb:
+ c-definition: 7.30.2.7
+ in-latest-posix: ''
+ c8rtomb:
+ c-definition: 7.30.2.3
+ mbrtoc16:
+ c-definition: 7.30.2.4
+ in-latest-posix: ''
+ mbrtoc32:
+ c-definition: 7.30.2.6
+ in-latest-posix: ''
+ mbrtoc8:
+ c-definition: 7.30.2.2
+macros:
+ __STDC_VERSION_UCHAR_H__:
+ c-definition: 7.30.1
+
diff --git a/libc/utils/docgen/wchar.yaml b/libc/utils/docgen/wchar.yaml
new file mode 100644
index 000000000000..dcc8963efdd3
--- /dev/null
+++ b/libc/utils/docgen/wchar.yaml
@@ -0,0 +1,131 @@
+functions:
+ btowc:
+ c-definition: 7.31.6.2.1
+ fgetwc:
+ c-definition: 7.31.3.1
+ fgetws:
+ c-definition: 7.31.3.2
+ fputwc:
+ c-definition: 7.31.3.3
+ fputws:
+ c-definition: 7.31.3.4
+ fwide:
+ c-definition: 7.31.3.5
+ fwprintf:
+ c-definition: 7.31.2.2
+ fwscanf:
+ c-definition: 7.31.2.3
+ getwc:
+ c-definition: 7.31.3.6
+ getwchar:
+ c-definition: 7.31.3.7
+ mbrlen:
+ c-definition: 7.31.6.4.2
+ mbrtowc:
+ c-definition: 7.31.6.4.3
+ mbsinit:
+ c-definition: 7.31.6.3.1
+ mbsrtowcs:
+ c-definition: 7.31.6.5.2
+ putwc:
+ c-definition: 7.31.3.8
+ putwchar:
+ c-definition: 7.31.3.9
+ swprintf:
+ c-definition: 7.31.2.4
+ swscanf:
+ c-definition: 7.31.2.5
+ ungetwc:
+ c-definition: 7.31.3.10
+ vfwprintf:
+ c-definition: 7.31.2.6
+ vfwscanf:
+ c-definition: 7.31.2.7
+ vswprintf:
+ c-definition: 7.31.2.8
+ vswscanf:
+ c-definition: 7.31.2.9
+ vwprintf:
+ c-definition: 7.31.2.10
+ vwscanf:
+ c-definition: 7.31.2.11
+ wcrtomb:
+ c-definition: 7.31.6.4.4
+ wcscat:
+ c-definition: 7.31.4.4.1
+ wcschr:
+ c-definition: 7.31.4.6.2
+ wcscmp:
+ c-definition: 7.31.4.5.2
+ wcscoll:
+ c-definition: 7.31.4.5.3
+ wcscpy:
+ c-definition: 7.31.4.3.1
+ wcscspn:
+ c-definition: 7.31.4.6.3
+ wcsftime:
+ c-definition: 7.31.5.1
+ wcslen:
+ c-definition: 7.31.4.7.1
+ wcsncat:
+ c-definition: 7.31.4.4.2
+ wcsncmp:
+ c-definition: 7.31.4.5.4
+ wcsncpy:
+ c-definition: 7.31.4.3.2
+ wcspbrk:
+ c-definition: 7.31.4.6.4
+ wcsrchr:
+ c-definition: 7.31.4.6.5
+ wcsrtombs:
+ c-definition: 7.31.6.5.3
+ wcsspn:
+ c-definition: 7.31.4.6.6
+ wcsstr:
+ c-definition: 7.31.4.6.7
+ wcstod:
+ c-definition: 7.31.4.2.2
+ wcstod128:
+ c-definition: 7.31.4.2.3
+ wcstod32:
+ c-definition: 7.31.4.2.3
+ wcstod64:
+ c-definition: 7.31.4.2.3
+ wcstof:
+ c-definition: 7.31.4.2.2
+ wcstok:
+ c-definition: 7.31.4.6.8
+ wcstol:
+ c-definition: 7.31.4.2.4
+ wcstold:
+ c-definition: 7.31.4.2.2
+ wcstoll:
+ c-definition: 7.31.4.2.4
+ wcstoul:
+ c-definition: 7.31.4.2.4
+ wcstoull:
+ c-definition: 7.31.4.2.4
+ wcsxfrm:
+ c-definition: 7.31.4.5.5
+ wctob:
+ c-definition: 7.31.6.2.2
+ wmemchr:
+ c-definition: 7.31.4.6.9
+ wmemcmp:
+ c-definition: 7.31.4.5.6
+ wmemcpy:
+ c-definition: 7.31.4.3.3
+ wmemmove:
+ c-definition: 7.31.4.3.4
+ wmemset:
+ c-definition: 7.31.4.7.2
+ wprintf:
+ c-definition: 7.31.2.12
+ wscanf:
+ c-definition: 7.31.2.13
+macros:
+ WEOF:
+ c-definition: 7.31.1
+ __STDC_VERSION_WCHAR_H__:
+ c-definition: 7.31.1
+
diff --git a/libc/utils/docgen/wctype.yaml b/libc/utils/docgen/wctype.yaml
new file mode 100644
index 000000000000..8675cbe500da
--- /dev/null
+++ b/libc/utils/docgen/wctype.yaml
@@ -0,0 +1,36 @@
+functions:
+ iswalnum:
+ c-definition: 7.32.2.1.1
+ iswalpha:
+ c-definition: 7.32.2.1.2
+ iswblank:
+ c-definition: 7.32.2.1.4
+ iswctype:
+ c-definition: 7.32.2.2.1
+ iswdigit:
+ c-definition: 7.32.2.1.5
+ iswgraph:
+ c-definition: 7.32.2.1.6
+ iswlower:
+ c-definition: 7.32.2.1.7
+ iswprint:
+ c-definition: 7.32.2.1.8
+ iswpunct:
+ c-definition: 7.32.2.1.9
+ iswspace:
+ c-definition: 7.32.2.1.10
+ iswupper:
+ c-definition: 7.32.2.1.11
+ iswxdigit:
+ c-definition: 7.32.2.1.12
+ towctrans:
+ c-definition: 7.32.3.2.1
+ towlower:
+ c-definition: 7.32.3.1.1
+ towupper:
+ c-definition: 7.32.3.1.2
+ wctrans:
+ c-definition: 7.32.3.2.2
+ wctype:
+ c-definition: 7.32.2.2.2
+