[libc-commits] [libc] [libc][docs] move docgen from json to yaml (PR #119744)

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Thu Dec 12 11:23:15 PST 2024


https://github.com/nickdesaulniers updated https://github.com/llvm/llvm-project/pull/119744

>From 4acbfbf5ef51220c045765c153e9966b776003ca Mon Sep 17 00:00:00 2001
From: Nick Desaulniers <ndesaulniers at google.com>
Date: Thu, 12 Dec 2024 10:33:33 -0800
Subject: [PATCH 1/4] [libc][docs] move docgen from json to yaml

That way it can more easily be integrated into hdrgen.
---
 libc/utils/docgen/docgen.py | 18 +++++++++---------
 libc/utils/docgen/header.py |  4 ++--
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/libc/utils/docgen/docgen.py b/libc/utils/docgen/docgen.py
index 5355dff3e2a6d9..09db284ef92824 100755
--- a/libc/utils/docgen/docgen.py
+++ b/libc/utils/docgen/docgen.py
@@ -10,9 +10,9 @@
 from argparse import ArgumentParser, Namespace
 from pathlib import Path
 from typing import Dict
-import json
 import os
 import sys
+import yaml
 
 from header import Header
 
@@ -23,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
 
@@ -49,7 +49,7 @@ 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 = []
     # We require entries to have at least one of these.
@@ -93,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):
@@ -192,12 +192,12 @@ 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 json
+# 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("*.json"):
+    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
diff --git a/libc/utils/docgen/header.py b/libc/utils/docgen/header.py
index 7728a0f1d5b44c..5bf524a64b69ba 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 @@ def __init__(self, header_name: str):
         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")
 

>From c511d32f4866182e06a9733300ea56a385b9e81e Mon Sep 17 00:00:00 2001
From: Nick Desaulniers <ndesaulniers at google.com>
Date: Thu, 12 Dec 2024 10:54:56 -0800
Subject: [PATCH 2/4] convert json to yaml

https://stackoverflow.com/a/60585911
---
 libc/utils/docgen/assert.json   |  11 --
 libc/utils/docgen/assert.yaml   |   7 +
 libc/utils/docgen/ctype.json    | 102 ------------
 libc/utils/docgen/ctype.yaml    |  72 +++++++++
 libc/utils/docgen/errno.json    |  20 ---
 libc/utils/docgen/errno.yaml    |  14 ++
 libc/utils/docgen/fenv.json     | 136 ----------------
 libc/utils/docgen/fenv.yaml     |  97 ++++++++++++
 libc/utils/docgen/float.json    | 201 ------------------------
 libc/utils/docgen/inttypes.json |  28 ----
 libc/utils/docgen/inttypes.yaml |  20 +++
 libc/utils/docgen/locale.json   |  53 -------
 libc/utils/docgen/locale.yaml   |  37 +++++
 libc/utils/docgen/setjmp.json   |  23 ---
 libc/utils/docgen/setjmp.yaml   |  15 ++
 libc/utils/docgen/signal.json   | 152 ------------------
 libc/utils/docgen/signal.yaml   | 102 ++++++++++++
 libc/utils/docgen/stdbit.json   | 270 --------------------------------
 libc/utils/docgen/stdbit.yaml   | 179 +++++++++++++++++++++
 libc/utils/docgen/stdlib.json   | 217 -------------------------
 libc/utils/docgen/stdlib.yaml   | 158 +++++++++++++++++++
 libc/utils/docgen/string.json   | 130 ---------------
 libc/utils/docgen/string.yaml   |  94 +++++++++++
 libc/utils/docgen/strings.json  |  40 -----
 libc/utils/docgen/threads.json  | 120 --------------
 libc/utils/docgen/threads.yaml  |  88 +++++++++++
 libc/utils/docgen/uchar.json    |  31 ----
 libc/utils/docgen/uchar.yaml    |  21 +++
 libc/utils/docgen/wchar.json    | 198 -----------------------
 libc/utils/docgen/wchar.yaml    | 131 ++++++++++++++++
 libc/utils/docgen/wctype.json   |  58 -------
 libc/utils/docgen/wctype.yaml   |  36 +++++
 32 files changed, 1071 insertions(+), 1790 deletions(-)
 delete mode 100644 libc/utils/docgen/assert.json
 create mode 100644 libc/utils/docgen/assert.yaml
 delete mode 100644 libc/utils/docgen/ctype.json
 create mode 100644 libc/utils/docgen/ctype.yaml
 delete mode 100644 libc/utils/docgen/errno.json
 create mode 100644 libc/utils/docgen/errno.yaml
 delete mode 100644 libc/utils/docgen/fenv.json
 create mode 100644 libc/utils/docgen/fenv.yaml
 delete mode 100644 libc/utils/docgen/float.json
 delete mode 100644 libc/utils/docgen/inttypes.json
 create mode 100644 libc/utils/docgen/inttypes.yaml
 delete mode 100644 libc/utils/docgen/locale.json
 create mode 100644 libc/utils/docgen/locale.yaml
 delete mode 100644 libc/utils/docgen/setjmp.json
 create mode 100644 libc/utils/docgen/setjmp.yaml
 delete mode 100644 libc/utils/docgen/signal.json
 create mode 100644 libc/utils/docgen/signal.yaml
 delete mode 100644 libc/utils/docgen/stdbit.json
 create mode 100644 libc/utils/docgen/stdbit.yaml
 delete mode 100644 libc/utils/docgen/stdlib.json
 create mode 100644 libc/utils/docgen/stdlib.yaml
 delete mode 100644 libc/utils/docgen/string.json
 create mode 100644 libc/utils/docgen/string.yaml
 delete mode 100644 libc/utils/docgen/strings.json
 delete mode 100644 libc/utils/docgen/threads.json
 create mode 100644 libc/utils/docgen/threads.yaml
 delete mode 100644 libc/utils/docgen/uchar.json
 create mode 100644 libc/utils/docgen/uchar.yaml
 delete mode 100644 libc/utils/docgen/wchar.json
 create mode 100644 libc/utils/docgen/wchar.yaml
 delete mode 100644 libc/utils/docgen/wctype.json
 create mode 100644 libc/utils/docgen/wctype.yaml

diff --git a/libc/utils/docgen/assert.json b/libc/utils/docgen/assert.json
deleted file mode 100644
index ed9249cf426a54..00000000000000
--- a/libc/utils/docgen/assert.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
-  "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/assert.yaml b/libc/utils/docgen/assert.yaml
new file mode 100644
index 00000000000000..0afd4e2d3c063f
--- /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 7c6137570760fe..00000000000000
--- a/libc/utils/docgen/ctype.json
+++ /dev/null
@@ -1,102 +0,0 @@
-{
-  "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/ctype.yaml b/libc/utils/docgen/ctype.yaml
new file mode 100644
index 00000000000000..027d8f38c71f97
--- /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/errno.json b/libc/utils/docgen/errno.json
deleted file mode 100644
index 7f13e06ac3285e..00000000000000
--- a/libc/utils/docgen/errno.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
-  "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/errno.yaml b/libc/utils/docgen/errno.yaml
new file mode 100644
index 00000000000000..da41552bc3a180
--- /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 cf58d70ebcf1eb..00000000000000
--- a/libc/utils/docgen/fenv.json
+++ /dev/null
@@ -1,136 +0,0 @@
-{
-  "macros": {
-    "__STDC_VERSION_FENV_H__": {
-      "c-definition": "7.6.5"
-    },
-    "FE_DIVBYZERO": {
-      "c-definition": "7.6.9",
-      "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_UNDERFLOW": {
-      "c-definition": "7.6.9",
-      "in-latest-posix": ""
-    },
-    "FE_ALL_EXCEPT": {
-      "c-definition": "7.6.12",
-      "in-latest-posix": ""
-    },
-    "FE_DFL_MODE": {
-      "c-definition": "7.6.11"
-    },
-    "FE_DOWNWARD": {
-      "c-definition": "7.6.13",
-      "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_UPWARD": {
-      "c-definition": "7.6.13",
-      "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": ""
-    }
-  },
-  "functions": {
-    "feclearexcept": {
-      "c-definition": "7.6.4.1",
-      "in-latest-posix": ""
-    },
-    "fegetexceptflag": {
-      "c-definition": "7.6.4.2",
-      "in-latest-posix": ""
-    },
-    "feraiseexcept": {
-      "c-definition": "7.6.4.3",
-      "in-latest-posix": ""
-    },
-    "fesetexcept": {
-      "c-definition": "7.6.4.4"
-    },
-    "fesetexceptflag": {
-      "c-definition": "7.6.4.5",
-      "in-latest-posix": ""
-    },
-    "fetestexceptflag": {
-      "c-definition": "7.6.4.6"
-    },
-    "fetestexcept": {
-      "c-definition": "7.6.4.7",
-      "in-latest-posix": ""
-    },
-    "fegetmode": {
-      "c-definition": "7.6.5.1"
-    },
-    "fegetround": {
-      "c-definition": "7.6.5.2",
-      "in-latest-posix": ""
-    },
-    "fe_dec_getround": {
-      "c-definition": "7.6.5.3"
-    },
-    "fesetmode": {
-      "c-definition": "7.6.5.4"
-    },
-    "fesetround": {
-      "c-definition": "7.6.5.5",
-      "in-latest-posix": ""
-    },
-    "fe_dec_setround": {
-      "c-definition": "7.6.5.6"
-    },
-    "fegetenv": {
-      "c-definition": "7.6.6.1",
-      "in-latest-posix": ""
-    },
-    "feholdexcept": {
-      "c-definition": "7.6.6.2",
-      "in-latest-posix": ""
-    },
-    "fesetenv": {
-      "c-definition": "7.6.6.3",
-      "in-latest-posix": ""
-    },
-    "feupdateenv": {
-      "c-definition": "7.6.6.4",
-      "in-latest-posix": ""
-    }
-  }
-}
diff --git a/libc/utils/docgen/fenv.yaml b/libc/utils/docgen/fenv.yaml
new file mode 100644
index 00000000000000..1d73697f36becf
--- /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.json b/libc/utils/docgen/float.json
deleted file mode 100644
index 87746193b29d46..00000000000000
--- a/libc/utils/docgen/float.json
+++ /dev/null
@@ -1,201 +0,0 @@
-{
-  "macros": {
-    "__STDC_VERSION_FLOAT_H__": {
-      "c-definition": "7.7"
-    },
-    "FLT_EVAL_METHOD" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "FLT_ROUNDS" : {
-      "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": ""
-    },
-    "DBL_HAS_SUBNORM" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "LDBL_HAS_SUBNORM" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "FLT_RADIX" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "FLT_MANT_DIG" : {
-      "c-definition": "5.3.5.3.3"
-    },
-    "DBL_MANT_DIG" : {
-      "c-definition": "5.3.5.3.3"
-    },
-    "LDBL_MANT_DIG" : {
-      "c-definition": "5.3.5.3.3"
-    },
-    "FLT_DECIMAL_DIG" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "DBL_DECIMAL_DIG" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "LDBL_DECIMAL_DIG" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "DECIMAL_DIG" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "FLT_IS_IEC_60559" : {
-      "c-definition": "5.3.5.3.3"
-    },
-    "DBL_IS_IEC_60559" : {
-      "c-definition": "5.3.5.3.3"
-    },
-    "LDBL_IS_IEC_60559" : {
-      "c-definition": "5.3.5.3.3"
-    },
-    "FLT_DIG" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "DBL_DIG" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "LDBL_DIG" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "FLT_MIN_EXP" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "DBL_MIN_EXP" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "LDBL_MIN_EXP" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "FLT_MIN_10_EXP" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "DBL_MIN_10_EXP" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "LDBL_MIN_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": ""
-    },
-    "DBL_MAX_EXP" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "LDBL_MAX_EXP" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "FLT_MAX_10_EXP" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "DBL_MAX_10_EXP" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "LDBL_MAX_10_EXP" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "FLT_MAX" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "DBL_MAX" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "LDBL_MAX" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "FLT_NORM_MAX" : {
-      "c-definition": "5.3.5.3.3"
-    },
-    "DBL_NORM_MAX" : {
-      "c-definition": "5.3.5.3.3"
-    },
-    "LDBL_NORM_MAX" : {
-      "c-definition": "5.3.5.3.3"
-    },
-    "FLT_EPSILON" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "DBL_EPSILON" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "LDBL_EPSILON" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "FLT_MIN" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "DBL_MIN" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "LDBL_MIN" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "FLT_SNAN" : {
-      "c-definition": "5.3.5.3.3"
-    },
-    "DBL_SNAN" : {
-      "c-definition": "5.3.5.3.3"
-    },
-    "LDBL_SNAN" : {
-      "c-definition": "5.3.5.3.3"
-    },
-    "FLT_TRUE_MIN" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "DBL_TRUE_MIN" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "LDBL_TRUE_MIN" : {
-      "c-definition": "5.3.5.3.3",
-      "in-latest-posix": ""
-    },
-    "INFINITY" : {
-      "c-definition": "5.3.5.3.3"
-    },
-    "NAN" : {
-      "c-definition": "5.3.5.3.3"
-    }
-  }
-}
diff --git a/libc/utils/docgen/inttypes.json b/libc/utils/docgen/inttypes.json
deleted file mode 100644
index 4c20d3d5cf3c01..00000000000000
--- a/libc/utils/docgen/inttypes.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
-  "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/inttypes.yaml b/libc/utils/docgen/inttypes.yaml
new file mode 100644
index 00000000000000..cbf50592ef072d
--- /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.json b/libc/utils/docgen/locale.json
deleted file mode 100644
index 9af8156f5467d2..00000000000000
--- a/libc/utils/docgen/locale.json
+++ /dev/null
@@ -1,53 +0,0 @@
-{
-  "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": ""
-    }
-  },
-  "functions": {
-    "setlocale": {
-      "c-definition": "7.11.1.1",
-      "in-latest-posix": ""
-    },
-    "localeconv": {
-      "c-definition": "7.11.2.1",
-      "in-latest-posix": ""
-    },
-    "duplocale": {
-      "in-latest-posix": ""
-    },
-    "freelocale": {
-      "in-latest-posix": ""
-    },
-    "getlocalename_l": {
-      "in-latest-posix": ""
-    },
-    "newlocale": {
-      "in-latest-posix": ""
-    },
-    "uselocale": {
-      "in-latest-posix": ""
-    }
-  }
-}
diff --git a/libc/utils/docgen/locale.yaml b/libc/utils/docgen/locale.yaml
new file mode 100644
index 00000000000000..eea91a885ff49e
--- /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 22bc81b223fa4a..00000000000000
--- a/libc/utils/docgen/setjmp.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
-  "macros": {
-    "__STDC_VERSION_SETJMP_H__": {
-      "c-definition": "7.13.2"
-    }
-  },
-  "functions": {
-    "setjmp": {
-      "c-definition": "7.13.1.1",
-      "in-latest-posix": ""
-    },
-    "longjmp": {
-      "c-definition": "7.13.2.1",
-      "in-latest-posix": ""
-    },
-    "sigsetjmp": {
-      "in-latest-posix": ""
-    },
-    "siglongjmp": {
-      "in-latest-posix": ""
-    }
-  }
-}
diff --git a/libc/utils/docgen/setjmp.yaml b/libc/utils/docgen/setjmp.yaml
new file mode 100644
index 00000000000000..123739d1a6ceb0
--- /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 1a8bd94268db10..00000000000000
--- a/libc/utils/docgen/signal.json
+++ /dev/null
@@ -1,152 +0,0 @@
-{
-  "macros": {
-    "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": ""
-    },
-    "SIGRTMIN": {
-      "in-latest-posix": ""
-    },
-    "SIGRTMAX": {
-      "in-latest-posix": ""
-    },
-    "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": ""
-    },
-    "SIGPIPE": {
-      "in-latest-posix": ""
-    },
-    "SIGQUIT": {
-      "in-latest-posix": ""
-    },
-    "SIGSEGV": {
-      "c-definition": "7.14.3",
-      "in-latest-posix": ""
-    },
-    "SIGSTOP": {
-      "in-latest-posix": ""
-    },
-    "SIGTERM": {
-      "c-definition": "7.14.3",
-      "in-latest-posix": ""
-    },
-    "SIGTSTP": {
-      "in-latest-posix": ""
-    },
-    "SIGTTIN": {
-      "in-latest-posix": ""
-    },
-    "SIGTTOU": {
-      "in-latest-posix": ""
-    },
-    "SIGUSR1": {
-      "in-latest-posix": ""
-    },
-    "SIGUSR2": {
-      "in-latest-posix": ""
-    },
-    "SIGPOLL": {
-      "in-latest-posix": ""
-    },
-    "SIGPROF": {
-      "in-latest-posix": ""
-    },
-    "SIGSYS": {
-      "in-latest-posix": ""
-    },
-    "SIGTRAP": {
-      "in-latest-posix": ""
-    },
-    "SIGURG": {
-      "in-latest-posix": ""
-    },
-    "SIGVTALRM": {
-      "in-latest-posix": ""
-    },
-    "SIGXCPU": {
-      "in-latest-posix": ""
-    },
-    "SIGXFSZ": {
-      "in-latest-posix": ""
-    }
-  },
-  "functions": {
-    "signal": {
-      "c-definition": "7.14.1.1",
-      "in-latest-posix": ""
-    },
-    "raise": {
-      "c-definition": "7.14.2.1",
-      "in-latest-posix": ""
-    },
-    "kill": {
-      "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": ""
-    },
-    "sigprocmask": {
-      "in-latest-posix": ""
-    }
-  }
-}
diff --git a/libc/utils/docgen/signal.yaml b/libc/utils/docgen/signal.yaml
new file mode 100644
index 00000000000000..da31a86b00eb06
--- /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 25060c1ff9fd8b..00000000000000
--- 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 00000000000000..976221601e9cb0
--- /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/stdlib.json b/libc/utils/docgen/stdlib.json
deleted file mode 100644
index cd8706471d76db..00000000000000
--- a/libc/utils/docgen/stdlib.json
+++ /dev/null
@@ -1,217 +0,0 @@
-{
-  "macros": {
-    "__STDC_VERSION_STDLIB_H__": {
-      "c-definition": "7.24"
-    },
-    "EXIT_FAILURE": {
-      "c-definition": "7.24",
-      "in-latest-posix": ""
-    },
-    "EXIT_SUCCESS": {
-      "c-definition": "7.24",
-      "in-latest-posix": ""
-    },
-    "RAND_MAX": {
-      "c-definition": "7.24",
-      "in-latest-posix": ""
-    },
-    "MB_CUR_MAX": {
-      "c-definition": "7.24",
-      "in-latest-posix": ""
-    }
-  },
-  "functions": {
-    "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": ""
-    },
-    "strfromd": {
-      "c-definition": "7.24.1.3"
-    },
-    "strfromf": {
-      "c-definition": "7.24.1.3"
-    },
-    "strfroml": {
-      "c-definition": "7.24.1.3"
-    },
-    "strfromd32": {
-      "c-definition": "7.24.1.4"
-    },
-    "strfromd64": {
-      "c-definition": "7.24.1.4"
-    },
-    "strfromd128": {
-      "c-definition": "7.24.1.4"
-    },
-    "strtod": {
-      "c-definition": "7.24.1.5",
-      "in-latest-posix": ""
-    },
-    "strtof": {
-      "c-definition": "7.24.1.5",
-      "in-latest-posix": ""
-    },
-    "strtold": {
-      "c-definition": "7.24.1.5",
-      "in-latest-posix": ""
-    },
-    "strtod32": {
-      "c-definition": "7.24.1.6"
-    },
-    "strtod64": {
-      "c-definition": "7.24.1.6"
-    },
-    "strtod128": {
-      "c-definition": "7.24.1.6"
-    },
-    "strtol": {
-      "c-definition": "7.24.1.7",
-      "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": ""
-    },
-    "rand": {
-      "c-definition": "7.24.2.1",
-      "in-latest-posix": ""
-    },
-    "srand": {
-      "c-definition": "7.24.2.2",
-      "in-latest-posix": ""
-    },
-    "aligned_alloc": {
-      "c-definition": "7.24.3.1",
-      "in-latest-posix": ""
-    },
-    "calloc": {
-      "c-definition": "7.24.3.2",
-      "in-latest-posix": ""
-    },
-    "free": {
-      "c-definition": "7.24.3.3",
-      "in-latest-posix": ""
-    },
-    "free_sized": {
-      "c-definition": "7.24.3.4"
-    },
-    "free_aligned_sized": {
-      "c-definition": "7.24.3.5"
-    },
-    "malloc": {
-      "c-definition": "7.24.3.6",
-      "in-latest-posix": ""
-    },
-    "realloc": {
-      "c-definition": "7.24.3.7",
-      "in-latest-posix": ""
-    },
-    "abort": {
-      "c-definition": "7.24.4.1",
-      "in-latest-posix": ""
-    },
-    "atexit": {
-      "c-definition": "7.24.4.2",
-      "in-latest-posix": ""
-    },
-    "at_quick_exit": {
-      "c-definition": "7.24.4.3",
-      "in-latest-posix": ""
-    },
-    "exit": {
-      "c-definition": "7.24.4.4",
-      "in-latest-posix": ""
-    },
-    "_Exit": {
-      "c-definition": "7.24.4.5",
-      "in-latest-posix": ""
-    },
-    "getenv": {
-      "c-definition": "7.24.4.6",
-      "in-latest-posix": ""
-    },
-    "quick_exit": {
-      "c-definition": "7.24.4.7",
-      "in-latest-posix": ""
-    },
-    "system": {
-      "c-definition": "7.24.4.8",
-      "in-latest-posix": ""
-    },
-    "bsearch": {
-      "c-definition": "7.24.5.1",
-      "in-latest-posix": ""
-    },
-    "qsort": {
-      "c-definition": "7.24.5.2",
-      "in-latest-posix": ""
-    },
-    "abs": {
-      "c-definition": "7.24.6.1",
-      "in-latest-posix": ""
-    },
-    "labs": {
-      "c-definition": "7.24.6.1",
-      "in-latest-posix": ""
-    },
-    "llabs": {
-      "c-definition": "7.24.6.1",
-      "in-latest-posix": ""
-    },
-    "div": {
-      "c-definition": "7.24.6.2",
-      "in-latest-posix": ""
-    },
-    "ldiv": {
-      "c-definition": "7.24.6.2",
-      "in-latest-posix": ""
-    },
-    "lldiv": {
-      "c-definition": "7.24.6.2",
-      "in-latest-posix": ""
-    },
-    "mblen": {
-      "c-definition": "7.24.7.1",
-      "in-latest-posix": ""
-    },
-    "mbtowc": {
-      "c-definition": "7.24.7.2",
-      "in-latest-posix": ""
-    },
-    "wctomb": {
-      "c-definition": "7.24.7.3",
-      "in-latest-posix": ""
-    },
-    "mbstowcs": {
-      "c-definition": "7.24.8.1",
-      "in-latest-posix": ""
-    },
-    "wcstombs": {
-      "c-definition": "7.24.8.2",
-      "in-latest-posix": ""
-    },
-    "memalignment": {
-      "c-definition": "7.24.9.1"
-    }
-  }
-}
diff --git a/libc/utils/docgen/stdlib.yaml b/libc/utils/docgen/stdlib.yaml
new file mode 100644
index 00000000000000..526ddefbe1ce3e
--- /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.json b/libc/utils/docgen/string.json
deleted file mode 100644
index f31c8e8b812623..00000000000000
--- a/libc/utils/docgen/string.json
+++ /dev/null
@@ -1,130 +0,0 @@
-{
-  "macros": {
-    "__STDC_VERSION_STRING_H__": {
-      "c-definition": "7.26.1"
-    }
-  },
-  "functions": {
-    "memcpy": {
-      "c-definition": "7.26.2.1",
-      "in-latest-posix": ""
-    },
-    "memccpy": {
-      "c-definition": "7.26.2.2",
-      "in-latest-posix": ""
-    },
-    "mempcpy": {
-      "c-definition": "TODO: glibc extension"
-    },
-    "memmove": {
-      "c-definition": "7.26.2.3",
-      "in-latest-posix": ""
-    },
-    "strcpy": {
-      "c-definition": "7.26.2.4",
-      "in-latest-posix": ""
-    },
-    "strncpy": {
-      "c-definition": "7.26.2.5",
-      "in-latest-posix": ""
-    },
-    "stpcpy": {
-      "in-latest-posix": ""
-    },
-    "stpncpy": {
-      "in-latest-posix": ""
-    },
-    "strdup": {
-      "c-definition": "7.26.2.6",
-      "in-latest-posix": ""
-    },
-    "strndup": {
-      "c-definition": "7.26.2.7",
-      "in-latest-posix": ""
-    },
-    "strcat": {
-      "c-definition": "7.26.3.1",
-      "in-latest-posix": ""
-    },
-    "strncat": {
-      "c-definition": "7.26.3.2",
-      "in-latest-posix": ""
-    },
-    "memcmp": {
-      "c-definition": "7.26.4.1",
-      "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": ""
-    },
-    "strncmp": {
-      "c-definition": "7.26.4.4",
-      "in-latest-posix": ""
-    },
-    "strxfrm": {
-      "c-definition": "7.26.4.5",
-      "in-latest-posix": ""
-    },
-    "strxfrm_l": {
-      "in-latest-posix": ""
-    },
-    "memchr": {
-      "c-definition": "7.26.5.2",
-      "in-latest-posix": ""
-    },
-    "strchr": {
-      "c-definition": "7.26.5.3",
-      "in-latest-posix": ""
-    },
-    "strcspn": {
-      "c-definition": "7.26.5.4",
-      "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": ""
-    },
-    "memset": {
-      "c-definition": "7.26.6.1",
-      "in-latest-posix": ""
-    },
-    "memset_explicit": {
-      "c-definition": "7.26.6.2"
-    },
-    "strerror": {
-      "c-definition": "7.26.6.3",
-      "in-latest-posix": ""
-    },
-    "strlen": {
-      "c-definition": "7.26.6.4",
-      "in-latest-posix": ""
-    }
-  }
-}
diff --git a/libc/utils/docgen/string.yaml b/libc/utils/docgen/string.yaml
new file mode 100644
index 00000000000000..d703a8e3593e1c
--- /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/strings.json b/libc/utils/docgen/strings.json
deleted file mode 100644
index c1c579a13dbdfa..00000000000000
--- a/libc/utils/docgen/strings.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
-  "functions": {
-    "bzero": {
-      "removed-in-posix-2008": ""
-    },
-    "bcmp": {
-      "removed-in-posix-2008": ""
-    },
-    "bcopy": {
-      "removed-in-posix-2008": ""
-    },
-    "ffs": {
-      "in-latest-posix": ""
-    },
-    "ffsl": {
-      "in-latest-posix": ""
-    },
-    "ffsll": {
-      "in-latest-posix": ""
-    },
-    "index": {
-      "removed-in-posix-2008": ""
-    },
-    "rindex": {
-      "removed-in-posix-2008": ""
-    },
-    "strcasecmp": {
-      "in-latest-posix": ""
-    },
-    "strcasecmp_l": {
-      "in-latest-posix": ""
-    },
-    "strncasecmp": {
-      "in-latest-posix": ""
-    },
-    "strncasecmp_l": {
-      "in-latest-posix": ""
-    }
-  }
-}
diff --git a/libc/utils/docgen/threads.json b/libc/utils/docgen/threads.json
deleted file mode 100644
index 3043d148a011f1..00000000000000
--- a/libc/utils/docgen/threads.json
+++ /dev/null
@@ -1,120 +0,0 @@
-{
-  "macros": {
-    "__STDC_NO_THREADS__": {
-      "c-definition": "7.28.1"
-    },
-    "ONCE_FLAG_INIT": {
-      "c-definition": "7.28.1",
-      "in-latest-posix": ""
-    },
-    "TSS_DTOR_ITERATIONS": {
-      "c-definition": "7.28.1",
-      "in-latest-posix": ""
-    },
-    "thread_local": {
-      "in-latest-posix": ""
-    }
-  },
-  "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": ""
-    }
-  }
-}
diff --git a/libc/utils/docgen/threads.yaml b/libc/utils/docgen/threads.yaml
new file mode 100644
index 00000000000000..83db0992dc45da
--- /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.json b/libc/utils/docgen/uchar.json
deleted file mode 100644
index e4537873d36a5a..00000000000000
--- a/libc/utils/docgen/uchar.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
-  "macros": {
-    "__STDC_VERSION_UCHAR_H__": {
-      "c-definition": "7.30.1"
-    }
-  },
-  "functions": {
-    "mbrtoc8": {
-      "c-definition": "7.30.2.2"
-    },
-    "c8rtomb": {
-      "c-definition": "7.30.2.3"
-    },
-    "mbrtoc16": {
-      "c-definition": "7.30.2.4",
-      "in-latest-posix": ""
-    },
-    "c16rtomb": {
-      "c-definition": "7.30.2.5",
-      "in-latest-posix": ""
-    },
-    "mbrtoc32": {
-      "c-definition": "7.30.2.6",
-      "in-latest-posix": ""
-    },
-    "c32rtomb": {
-      "c-definition": "7.30.2.7",
-      "in-latest-posix": ""
-    }
-  }
-}
diff --git a/libc/utils/docgen/uchar.yaml b/libc/utils/docgen/uchar.yaml
new file mode 100644
index 00000000000000..580af0f5483363
--- /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.json b/libc/utils/docgen/wchar.json
deleted file mode 100644
index a44f2ef82b7cd6..00000000000000
--- a/libc/utils/docgen/wchar.json
+++ /dev/null
@@ -1,198 +0,0 @@
-{
-  "macros": {
-    "__STDC_VERSION_WCHAR_H__": {
-      "c-definition": "7.31.1"
-    },
-    "WEOF": {
-      "c-definition": "7.31.1"
-    }
-  },
-  "functions": {
-    "fwprintf": {
-      "c-definition": "7.31.2.2"
-    },
-    "fwscanf": {
-      "c-definition": "7.31.2.3"
-    },
-    "swprintf": {
-      "c-definition": "7.31.2.4"
-    },
-    "swscanf": {
-      "c-definition": "7.31.2.5"
-    },
-    "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"
-    },
-    "wprintf": {
-      "c-definition": "7.31.2.12"
-    },
-    "wscanf": {
-      "c-definition": "7.31.2.13"
-    },
-    "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"
-    },
-    "getwc": {
-      "c-definition": "7.31.3.6"
-    },
-    "getwchar": {
-      "c-definition": "7.31.3.7"
-    },
-    "putwc": {
-      "c-definition": "7.31.3.8"
-    },
-    "putwchar": {
-      "c-definition": "7.31.3.9"
-    },
-    "ungetwc": {
-      "c-definition": "7.31.3.10"
-    },
-    "wcstod": {
-      "c-definition": "7.31.4.2.2"
-    },
-    "wcstof": {
-      "c-definition": "7.31.4.2.2"
-    },
-    "wcstold": {
-      "c-definition": "7.31.4.2.2"
-    },
-    "wcstod32": {
-      "c-definition": "7.31.4.2.3"
-    },
-    "wcstod64": {
-      "c-definition": "7.31.4.2.3"
-    },
-    "wcstod128": {
-      "c-definition": "7.31.4.2.3"
-    },
-    "wcstol": {
-      "c-definition": "7.31.4.2.4"
-    },
-    "wcstoll": {
-      "c-definition": "7.31.4.2.4"
-    },
-    "wcstoul": {
-      "c-definition": "7.31.4.2.4"
-    },
-    "wcstoull": {
-      "c-definition": "7.31.4.2.4"
-    },
-    "wcscpy": {
-      "c-definition": "7.31.4.3.1"
-    },
-    "wcsncpy": {
-      "c-definition": "7.31.4.3.2"
-    },
-    "wmemcpy": {
-      "c-definition": "7.31.4.3.3"
-    },
-    "wmemmove": {
-      "c-definition": "7.31.4.3.4"
-    },
-    "wcscat": {
-      "c-definition": "7.31.4.4.1"
-    },
-    "wcsncat": {
-      "c-definition": "7.31.4.4.2"
-    },
-    "wcscmp": {
-      "c-definition": "7.31.4.5.2"
-    },
-    "wcscoll": {
-      "c-definition": "7.31.4.5.3"
-    },
-    "wcsncmp": {
-      "c-definition": "7.31.4.5.4"
-    },
-    "wcsxfrm": {
-      "c-definition": "7.31.4.5.5"
-    },
-    "wmemcmp": {
-      "c-definition": "7.31.4.5.6"
-    },
-    "wcschr": {
-      "c-definition": "7.31.4.6.2"
-    },
-    "wcscspn": {
-      "c-definition": "7.31.4.6.3"
-    },
-    "wcspbrk": {
-      "c-definition": "7.31.4.6.4"
-    },
-    "wcsrchr": {
-      "c-definition": "7.31.4.6.5"
-    },
-    "wcsspn": {
-      "c-definition": "7.31.4.6.6"
-    },
-    "wcsstr": {
-      "c-definition": "7.31.4.6.7"
-    },
-    "wcstok": {
-      "c-definition": "7.31.4.6.8"
-    },
-    "wmemchr": {
-      "c-definition": "7.31.4.6.9"
-    },
-    "wcslen": {
-      "c-definition": "7.31.4.7.1"
-    },
-    "wmemset": {
-      "c-definition": "7.31.4.7.2"
-    },
-    "wcsftime": {
-      "c-definition": "7.31.5.1"
-    },
-    "btowc": {
-      "c-definition": "7.31.6.2.1"
-    },
-    "wctob": {
-      "c-definition": "7.31.6.2.2"
-    },
-    "mbsinit": {
-      "c-definition": "7.31.6.3.1"
-    },
-    "mbrlen": {
-      "c-definition": "7.31.6.4.2"
-    },
-    "mbrtowc": {
-      "c-definition": "7.31.6.4.3"
-    },
-    "wcrtomb": {
-      "c-definition": "7.31.6.4.4"
-    },
-    "mbsrtowcs": {
-      "c-definition": "7.31.6.5.2"
-    },
-    "wcsrtombs": {
-      "c-definition": "7.31.6.5.3"
-    }
-  }
-}
diff --git a/libc/utils/docgen/wchar.yaml b/libc/utils/docgen/wchar.yaml
new file mode 100644
index 00000000000000..dcc8963efdd359
--- /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.json b/libc/utils/docgen/wctype.json
deleted file mode 100644
index 29bac1d5d03aa4..00000000000000
--- a/libc/utils/docgen/wctype.json
+++ /dev/null
@@ -1,58 +0,0 @@
-{
-  "functions": {
-    "iswalnum": {
-      "c-definition": "7.32.2.1.1"
-    },
-    "iswalpha": {
-      "c-definition": "7.32.2.1.2"
-    },
-    "iswblank": {
-      "c-definition": "7.32.2.1.3"
-    },
-    "iswblank": {
-      "c-definition": "7.32.2.1.4"
-    },
-    "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"
-    },
-    "iswctype": {
-      "c-definition": "7.32.2.2.1"
-    },
-    "wctype": {
-      "c-definition": "7.32.2.2.2"
-    },
-    "towlower": {
-      "c-definition": "7.32.3.1.1"
-    },
-    "towupper": {
-      "c-definition": "7.32.3.1.2"
-    },
-    "towctrans": {
-      "c-definition": "7.32.3.2.1"
-    },
-    "wctrans": {
-      "c-definition": "7.32.3.2.2"
-    }
-  }
-}
diff --git a/libc/utils/docgen/wctype.yaml b/libc/utils/docgen/wctype.yaml
new file mode 100644
index 00000000000000..8675cbe500da3b
--- /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
+

>From 8d5ce0004b7cfa7a252ec8bca1bc9fdce059f374 Mon Sep 17 00:00:00 2001
From: Nick Desaulniers <ndesaulniers at google.com>
Date: Thu, 12 Dec 2024 11:19:23 -0800
Subject: [PATCH 3/4] don't leave float.h behind

---
 libc/utils/docgen/float.yaml | 143 +++++++++++++++++++++++++++++++++++
 1 file changed, 143 insertions(+)
 create mode 100644 libc/utils/docgen/float.yaml

diff --git a/libc/utils/docgen/float.yaml b/libc/utils/docgen/float.yaml
new file mode 100644
index 00000000000000..a8840b91be55b4
--- /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'
+

>From f44277c7e106f502d1be095e8c647128d3ab833e Mon Sep 17 00:00:00 2001
From: Nick Desaulniers <ndesaulniers at google.com>
Date: Thu, 12 Dec 2024 11:23:00 -0800
Subject: [PATCH 4/4] dont forget sys/mman.h or arpa/inet.h

---
 libc/utils/docgen/arpa/inet.json | 28 ------------
 libc/utils/docgen/arpa/inet.yaml | 18 ++++++++
 libc/utils/docgen/sys/mman.json  | 43 ------------------
 libc/utils/docgen/sys/mman.yaml  | 77 ++++++++++++++++++++++++++++++++
 4 files changed, 95 insertions(+), 71 deletions(-)
 delete mode 100644 libc/utils/docgen/arpa/inet.json
 create mode 100644 libc/utils/docgen/arpa/inet.yaml
 delete mode 100644 libc/utils/docgen/sys/mman.json
 create mode 100644 libc/utils/docgen/sys/mman.yaml

diff --git a/libc/utils/docgen/arpa/inet.json b/libc/utils/docgen/arpa/inet.json
deleted file mode 100644
index 0e788c57d5f7ae..00000000000000
--- a/libc/utils/docgen/arpa/inet.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
-  "functions": {
-    "htonl" : {
-      "posix-definition": ""
-    },
-    "htons": {
-      "posix-definition": ""
-    },
-    "ntohl": {
-      "posix-definition": ""
-    },
-    "ntohs": {
-      "posix-definition": ""
-    },
-    "inet_addr": {
-      "posix-definition": ""
-    },
-    "inet_ntoa": {
-      "posix-definition": ""
-    },
-    "inet_ntop": {
-      "posix-definition": ""
-    },
-    "inet_pton": {
-      "posix-definition": ""
-    }
-  }
-}
diff --git a/libc/utils/docgen/arpa/inet.yaml b/libc/utils/docgen/arpa/inet.yaml
new file mode 100644
index 00000000000000..7f388cbbd0204b
--- /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/sys/mman.json b/libc/utils/docgen/sys/mman.json
deleted file mode 100644
index 59f904fcfea975..00000000000000
--- a/libc/utils/docgen/sys/mman.json
+++ /dev/null
@@ -1,43 +0,0 @@
-{
-  "macros": {
-    "PROT_EXEC": { "posix-definition": "" },
-    "PROT_NONE": { "posix-definition": "" },
-    "PROT_READ": { "posix-definition": "" },
-    "PROT_WRITE": { "posix-definition": "" },
-    "MAP_ANON": { "posix-definition": "" },
-    "MAP_ANONYMOUS": { "posix-definition": "" },
-    "MAP_FIXED": { "posix-definition": "" },
-    "MAP_PRIVATE": { "posix-definition": "" },
-    "MAP_SHARED": { "posix-definition": "" },
-    "MS_ASYNC": { "posix-definition": "" },
-    "MS_INVALIDATE": { "posix-definition": "" },
-    "MS_SYNC": { "posix-definition": "" },
-    "MCL_CURRENT": { "posix-definition": "" },
-    "MCL_FUTURE": { "posix-definition": "" },
-    "MAP_FAILED": { "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": "" }
-  },
-  "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": "" }
-  }
-}
diff --git a/libc/utils/docgen/sys/mman.yaml b/libc/utils/docgen/sys/mman.yaml
new file mode 100644
index 00000000000000..dba26cabc66214
--- /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: ''
+



More information about the libc-commits mailing list