1,884 changes: 1,884 additions & 0 deletions libc/newhdrgen/yaml_combined/math.yaml

Large diffs are not rendered by default.

368 changes: 368 additions & 0 deletions libc/newhdrgen/yaml_combined/pthread.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,368 @@
header: pthread.h
macros: []
types:
- type_name: pthread_t
- type_name: pthread_once_t
- type_name: pthread_mutex_t
- type_name: pthread_mutexattr_t
- type_name: pthread_key_t
- type_name: pthread_condattr_t
- type_name: __pthread_tss_dtor_t
- type_name: pthread_rwlockattr_t
- type_name: pthread_attr_t
- type_name: __pthread_start_t
- type_name: __pthread_once_func_t
- type_name: __atfork_callback_t
enums:
- name: PTHREAD_CREATE_JOINABLE
value: 0x0
- name: PTHREAD_CREATE_DETACHED
value: 0x1
- name: PTHREAD_MUTEX_NORMAL
value: 0x0
- name: PTHREAD_MUTEX_ERRORCHECK
value: 0x1
- name: PTHREAD_MUTEX_RECURSIVE
value: 0x2
- name: PTHREAD_MUTEX_DEFAULT
value: 0x0
- name: PTHREAD_PROCESS_PRIVATE
value: 0x0
- name: PTHREAD_PROCESS_SHARED
value: 0x1
- name: PTHREAD_MUTEX_STALLED
value: 0x0
- name: PTHREAD_MUTEX_ROBUST
value: 0x1
- name: PTHREAD_RWLOCK_PREFER_READER_NP
value: 0
- name: PTHREAD_RWLOCK_PREFER_WRITER_NP
value: 1
- name: PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP
value: 2
functions:
- name: pthread_atfork
standards:
- POSIX
return_type: int
arguments:
- type: __atfork_callback_t
- type: __atfork_callback_t
- type: __atfork_callback_t
- name: pthread_attr_destroy
standards:
- POSIX
return_type: int
arguments:
- type: pthread_attr_t *
- name: pthread_attr_init
standards:
- POSIX
return_type: int
arguments:
- type: pthread_attr_t *
- name: pthread_attr_getdetachstate
standards:
- POSIX
return_type: int
arguments:
- type: const pthread_attr_t *
- type: int *
- name: pthread_attr_getguardsize
standards:
- POSIX
return_type: int
arguments:
- type: const pthread_attr_t * __restrict
- type: size_t * __restrict
- name: pthread_attr_getstack
standards:
- POSIX
return_type: int
arguments:
- type: const pthread_attr_t * __restrict
- type: void * * __restrict
- type: size_t * __restrict
- name: pthread_attr_getstacksize
standards:
- POSIX
return_type: int
arguments:
- type: const pthread_attr_t * __restrict
- type: size_t * __restrict
- name: pthread_attr_setdetachstate
standards:
- POSIX
return_type: int
arguments:
- type: pthread_attr_t *
- type: int
- name: pthread_attr_setguardsize
standards:
- POSIX
return_type: int
arguments:
- type: pthread_attr_t *
- type: size_t
- name: pthread_attr_setstack
standards:
- POSIX
return_type: int
arguments:
- type: pthread_attr_t *
- type: void *
- type: size_t
- name: pthread_attr_setstacksize
standards:
- POSIX
return_type: int
arguments:
- type: pthread_attr_t *
- type: size_t
- name: pthread_condattr_destroy
standards:
- POSIX
return_type: int
arguments:
- type: pthread_condattr_t *
- name: pthread_condattr_getclock
standards:
- POSIX
return_type: int
arguments:
- type: const pthread_condattr_t * __restrict
- type: clockid_t * __restrict
- name: pthread_condattr_getpshared
standards:
- POSIX
return_type: int
arguments:
- type: const pthread_condattr_t * __restrict
- type: int * __restrict
- name: pthread_condattr_init
standards:
- POSIX
return_type: int
arguments:
- type: pthread_condattr_t *
- name: pthread_condattr_setclock
standards:
- POSIX
return_type: int
arguments:
- type: pthread_condattr_t *
- type: clockid_t
- name: pthread_condattr_setpshared
standards:
- POSIX
return_type: int
arguments:
- type: pthread_condattr_t *
- type: int
- name: pthread_create
standards:
- POSIX
return_type: int
arguments:
- type: pthread_t * __restrict
- type: const pthread_attr_t * __restrict
- type: __pthread_start_t
- type: void *
- name: pthread_detach
standards:
- POSIX
return_type: int
arguments:
- type: pthread_t
- name: pthread_equal
standards:
- POSIX
return_type: int
arguments:
- type: pthread_t
- type: pthread_t
- name: pthread_exit
standards:
- POSIX
return_type: __Noreturn void
arguments:
- type: void *
- name: pthread_getname_np
standards:
- GNUExtensions
return_type: int
arguments:
- type: pthread_t
- type: char *
- type: size_t
- name: pthread_getspecific
standards:
- POSIX
return_type: void *
arguments:
- type: pthread_key_t
- name: pthread_join
standards:
- POSIX
return_type: int
arguments:
- type: pthread_t
- type: void * *
- name: pthread_key_create
standards:
- POSIX
return_type: int
arguments:
- type: pthread_key_t *
- type: __pthread_tss_dtor_t
- name: pthread_key_delete
standards:
- POSIX
return_type: int
arguments:
- type: pthread_key_t
- name: pthread_self
standards:
- POSIX
return_type: pthread_t
arguments: []
- name: pthread_setname_np
standards:
- GNUExtensions
return_type: int
arguments:
- type: pthread_t
- type: const char *
- name: pthread_mutex_destroy
standards:
- POSIX
return_type: int
arguments:
- type: pthread_mutex_t *
- name: pthread_mutex_init
standards:
- POSIX
return_type: int
arguments:
- type: pthread_mutex_t * __restrict
- type: const pthread_mutexattr_t * __restrict
- name: pthread_mutex_lock
standards:
- POSIX
return_type: int
arguments:
- type: pthread_mutex_t *
- name: pthread_mutex_unlock
standards:
- POSIX
return_type: int
arguments:
- type: pthread_mutex_t *
- name: pthread_mutexattr_destroy
standards:
- POSIX
return_type: int
arguments:
- type: pthread_mutexattr_t *
- name: pthread_mutexattr_init
standards:
- POSIX
return_type: int
arguments:
- type: pthread_mutexattr_t *
- name: pthread_mutexattr_getpshared
standards:
- POSIX
return_type: int
arguments:
- type: const pthread_mutexattr_t * __restrict
- type: int * __restrict
- name: pthread_mutexattr_getrobust
standards:
- POSIX
return_type: int
arguments:
- type: const pthread_mutexattr_t * __restrict
- type: int * __restrict
- name: pthread_mutexattr_gettype
standards:
- POSIX
return_type: int
arguments:
- type: const pthread_mutexattr_t * __restrict
- type: int * __restrict
- name: pthread_mutexattr_setpshared
standards:
- POSIX
return_type: int
arguments:
- type: pthread_mutexattr_t * __restrict
- type: int
- name: pthread_mutexattr_setrobust
standards:
- POSIX
return_type: int
arguments:
- type: pthread_mutexattr_t * __restrict
- type: int
- name: pthread_mutexattr_settype
standards:
- POSIX
return_type: int
arguments:
- type: pthread_mutexattr_t * __restrict
- type: int
- name: pthread_once
standards:
- POSIX
return_type: int
arguments:
- type: pthread_once_t *
- type: __pthread_once_func_t
- name: pthread_rwlockattr_destroy
standards:
- POSIX
return_type: int
arguments:
- type: pthread_rwlockattr_t *
- name: pthread_rwlockattr_getkind_np
standards:
- POSIX
return_type: int
arguments:
- type: pthread_rwlockattr_t *
- type: int *
- name: pthread_rwlockattr_getpshared
standards:
- POSIX
return_type: int
arguments:
- type: const pthread_rwlockattr_t *
- type: int *
- name: pthread_rwlockattr_init
standards:
- POSIX
return_type: int
arguments:
- type: pthread_rwlockattr_t *
- name: pthread_rwlockattr_setkind_np
standards:
- POSIX
return_type: int
arguments:
- type: pthread_rwlockattr_t *
- type: int
- name: pthread_rwlockattr_setpshared
standards:
- POSIX
return_type: int
arguments:
- type: pthread_rwlockattr_t *
- type: int
- name: pthread_setspecific
standards:
- POSIX
return_type: void *
arguments:
- type: pthread_key_t
- type: const void *
87 changes: 87 additions & 0 deletions libc/newhdrgen/yaml_combined/sched.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
header: sched.h
macros: []
types:
- type_name: struct_timespec
- type_name: time_t
- type_name: struct_sched_param
- type_name: size_t
- type_name: cpu_set_t
- type_name: pid_t
enums: []
objects: []
functions:
- name: sched_get_priority_max
standards:
- POSIX
return_type: int
arguments:
- type: int
- name: sched_get_priority_min
standards:
- POSIX
return_type: int
arguments:
- type: int
- name: sched_getaffinity
standards:
- GNUExtensions
return_type: int
arguments:
- type: pid_t
- type: size_t
- type: cpu_set_t *
- name: sched_getparam
standards:
- POSIX
return_type: int
arguments:
- type: pid_t
- type: struct sched_param *
- name: sched_getscheduler
standards:
- POSIX
return_type: int
arguments:
- type: pid_t
- type: int
- type: const struct sched_param *
- name: sched_rr_get_interval
standards:
- POSIX
return_type: int
arguments:
- type: pid_t
- type: struct timespec *
- name: sched_setaffinity
standards:
- GNUExtensions
return_type: int
arguments:
- type: pid_t
- type: size_t
- type: const cpu_set_t *
- name: sched_setparam
standards:
- POSIX
return_type: int
arguments:
- type: pid_t
- type: const struct sched_param *
- name: sched_setscheduler
standards:
- POSIX
return_type: int
arguments:
- type: pid_t
- name: sched_yield
standards:
- POSIX
return_type: int
arguments: []
- name: __sched_getcpucount
standards:
- llvm_libc_ext
return_type: int
arguments:
- type: size_t
- type: const cpu_set_t *
84 changes: 84 additions & 0 deletions libc/newhdrgen/yaml_combined/signal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
header: signal.h
macros:
- macro_name: __need_size_t
macro_value: null
types:
- type_name: pid_t
- type_name: stack_t
- type_name: siginfo_t
- type_name: struct_sigaction
- type_name: sigset_t
- type_name: union_sigval
- type_name: sig_atomic_t
enums: []
objects: []
functions:
- name: raise
standards:
- stdc
return_type: int
arguments:
- type: int
- name: kill
standards:
- POSIX
return_type: int
arguments:
- type: pid_t
- type: int
- name: sigaction
standards:
- POSIX
return_type: int
arguments:
- type: int
- type: const struct sigaction * __restrict
- type: struct sigaction * __restrict
- name: sigaltstack
standards:
- POSIX
return_type: int
arguments:
- type: const stack_t * __restrict
- type: stack_t * __restrict
- name: sigdelset
standards:
- POSIX
return_type: int
arguments:
- type: sigset_t *
- type: int
- name: sigaddset
standards:
- POSIX
return_type: int
arguments:
- type: sigset_t *
- type: int
- name: sigemptyset
standards:
- POSIX
return_type: int
arguments:
- type: sigset_t *
- name: sigprocmask
standards:
- POSIX
return_type: int
arguments:
- type: int
- type: const sigset_t * __restrict
- type: sigset_t * __restrict
- name: sigfillset
standards:
- POSIX
return_type: int
arguments:
- type: sigset_t *
- name: signal
standards:
- stdc
return_type: __sighandler_t
arguments:
- type: int
- type: __sighandler_t
222 changes: 222 additions & 0 deletions libc/newhdrgen/yaml_combined/stdfix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
header: stdfix.h
macros: []
types: []
enums: []
objects: []
functions:
- name: abshk
standards:
- stdc_ext
return_type: short accum
arguments:
- type: short accum
guard: LIBC_COMPILER_HAS_FIXED_POINT
- name: abshr
standards:
- stdc_ext
return_type: short fract
arguments:
- type: short fract
guard: LIBC_COMPILER_HAS_FIXED_POINT
- name: absk
standards:
- stdc_ext
return_type: accum
arguments:
- type: accum
guard: LIBC_COMPILER_HAS_FIXED_POINT
- name: absr
standards:
- stdc_ext
return_type: fract
arguments:
- type: fract
guard: LIBC_COMPILER_HAS_FIXED_POINT
- name: abslk
standards:
- stdc_ext
return_type: long accum
arguments:
- type: long accum
guard: LIBC_COMPILER_HAS_FIXED_POINT
- name: abslr
standards:
- stdc_ext
return_type: long fract
arguments:
- type: long fract
guard: LIBC_COMPILER_HAS_FIXED_POINT
- name: exphk
standards:
- stdc_ext
- llvm_libc_stdfix_ext
return_type: short accum
arguments:
- type: short accum
guard: LIBC_COMPILER_HAS_FIXED_POINT
- name: expk
standards:
- stdc_ext
- llvm_libc_stdfix_ext
return_type: accum
arguments:
- type: accum
guard: LIBC_COMPILER_HAS_FIXED_POINT
- name: roundhk
standards:
- stdc_ext
return_type: short accum
arguments:
- type: short accum
- type: int
guard: LIBC_COMPILER_HAS_FIXED_POINT
- name: roundhr
standards:
- stdc_ext
return_type: short fract
arguments:
- type: short fract
- type: int
guard: LIBC_COMPILER_HAS_FIXED_POINT
- name: roundk
standards:
- stdc_ext
return_type: accum
arguments:
- type: accum
- type: int
guard: LIBC_COMPILER_HAS_FIXED_POINT
- name: roundr
standards:
- stdc_ext
return_type: fract
arguments:
- type: fract
- type: int
guard: LIBC_COMPILER_HAS_FIXED_POINT
- name: roundlk
standards:
- stdc_ext
return_type: long accum
arguments:
- type: long accum
- type: int
guard: LIBC_COMPILER_HAS_FIXED_POINT
- name: roundlr
standards:
- stdc_ext
return_type: long fract
arguments:
- type: long fract
- type: int
guard: LIBC_COMPILER_HAS_FIXED_POINT
- name: rounduhk
standards:
- stdc_ext
return_type: unsigned short accum
arguments:
- type: unsigned short accum
- type: int
guard: LIBC_COMPILER_HAS_FIXED_POINT
- name: rounduhr
standards:
- stdc_ext
return_type: unsigned short fract
arguments:
- type: unsigned short fract
- type: int
guard: LIBC_COMPILER_HAS_FIXED_POINT
- name: rounduk
standards:
- stdc_ext
return_type: unsigned accum
arguments:
- type: unsigned accum
- type: int
guard: LIBC_COMPILER_HAS_FIXED_POINT
- name: roundur
standards:
- stdc_ext
return_type: unsigned fract
arguments:
- type: unsigned fract
- type: int
guard: LIBC_COMPILER_HAS_FIXED_POINT
- name: roundulk
standards:
- stdc_ext
return_type: unsigned long accum
arguments:
- type: unsigned long accum
- type: int
guard: LIBC_COMPILER_HAS_FIXED_POINT
- name: roundulr
standards:
- stdc_ext
return_type: unsigned long fract
arguments:
- type: unsigned long fract
- type: int
guard: LIBC_COMPILER_HAS_FIXED_POINT
- name: sqrtuhk
standards:
- stdc_ext
- llvm_libc_stdfix_ext
return_type: unsigned short accum
arguments:
- type: unsigned short accum
guard: LIBC_COMPILER_HAS_FIXED_POINT
- name: sqrtuhr
standards:
- stdc_ext
- llvm_libc_stdfix_ext
return_type: unsigned short fract
arguments:
- type: unsigned short fract
guard: LIBC_COMPILER_HAS_FIXED_POINT
- name: sqrtuk
standards:
- stdc_ext
- llvm_libc_stdfix_ext
return_type: unsigned accum
arguments:
- type: unsigned accum
guard: LIBC_COMPILER_HAS_FIXED_POINT
- name: sqrtur
standards:
- stdc_ext
- llvm_libc_stdfix_ext
return_type: unsigned fract
arguments:
- type: unsigned fract
guard: LIBC_COMPILER_HAS_FIXED_POINT
- name: sqrtulr
standards:
- stdc_ext
- llvm_libc_stdfix_ext
return_type: unsigned long fract
arguments:
- type: unsigned long fract
guard: LIBC_COMPILER_HAS_FIXED_POINT
- name: sqrtulk
standards: llvm_libc_stdfix_ext
return_type: unsigned long accum
arguments:
- type: unsigned long accum
guard: LIBC_COMPILER_HAS_FIXED_POINT
- name: uhksqrtus
standards:
- stdc_ext
- llvm_libc_stdfix_ext
return_type: unsigned short accum
arguments:
- type: unsigned short
guard: LIBC_COMPILER_HAS_FIXED_POINT
- name: uksqrtui
standards:
- stdc_ext
- llvm_libc_stdfix_ext
return_type: unsigned accum
arguments:
- type: unsigned int
guard: LIBC_COMPILER_HAS_FIXED_POINT
370 changes: 370 additions & 0 deletions libc/newhdrgen/yaml_combined/stdio.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,370 @@
header: stdio.h
macros:
- macro_name: _IONBF
macro_value: 2
- macro_name: _IOLBF
macro_value: 1
- macro_name: _IOFBF
macro_value: 0
- macro_name: stdout
macro_value: stdout
- macro_name: stdin
macro_value: stdin
types:
- type_name: size_t
- type_name: off_t
- type_name: cookie_io_functions_t
- type_name: FILE
enums: []
objects:
- object_name: stdin
object_type: FILE *
- object_name: stdout
object_type: FILE *
- object_name: stderr
object_type: FILE *
functions:
- name: remove
standards:
- stdc
return_type: int
arguments:
- type: const char *
- name: rename
standards:
- stdc
return_type: int
arguments:
- type: const char *
- type: const char *
- name: sprintf
standards:
- stdc
return_type: int
arguments:
- type: char * __restrict
- type: const char * __restrict
- type: ...
- name: snprintf
standards:
- stdc
return_type: int
arguments:
- type: char * __restrict
- type: size_t
- type: const char * __restrict
- type: ...
- name: fprintf
standards:
- stdc
return_type: int
arguments:
- type: FILE * __restrict
- type: const char * __restrict
- type: ...
- name: printf
standards:
- stdc
return_type: int
arguments:
- type: const char * __restrict
- type: ...
- name: vsprintf
standards:
- stdc
return_type: int
arguments:
- type: char * __restrict
- type: const char * __restrict
- type: va_list
- name: vsnprintf
standards:
- stdc
return_type: int
arguments:
- type: char * __restrict
- type: size_t
- type: const char * __restrict
- type: va_list
- name: vfprintf
standards:
- stdc
return_type: int
arguments:
- type: FILE * __restrict
- type: const char * __restrict
- type: va_list
- name: vprintf
standards:
- stdc
return_type: int
arguments:
- type: const char * __restrict
- type: va_list
- name: sscanf
standards:
- stdc
return_type: int
arguments:
- type: const char * __restrict
- type: const char * __restrict
- type: ...
- name: scanf
standards:
- stdc
return_type: int
arguments:
- type: const char * __restrict
- type: ...
- name: fscanf
standards:
- stdc
return_type: int
arguments:
- type: FILE * __restrict
- type: const char * __restrict
- type: ...
- name: fileno
standards:
- POSIX
return_type: int
arguments:
- type: FILE *
- name: clearerr
standards:
- stdc
return_type: void
arguments:
- type: FILE *
- name: clearerr_unlocked
standards:
- GNUExtensions
return_type: void
arguments:
- type: FILE *
- name: fclose
standards:
- stdc
return_type: int
arguments:
- type: FILE *
- name: flockfile
standards:
- POSIX
return_type: void
arguments:
- type: FILE *
- name: feof
standards:
- stdc
return_type: int
arguments:
- type: FILE *
- name: feof_unlocked
standards:
- GNUExtensions
return_type: int
arguments:
- type: FILE *
- name: ferror
standards:
- stdc
return_type: int
arguments:
- type: FILE *
- name: ferror_unlocked
standards:
- GNUExtensions
return_type: int
arguments:
- type: FILE *
- name: fgetc
standards:
- stdc
return_type: int
arguments:
- type: FILE *
- name: fgetc_unlocked
standards:
- GNUExtensions
return_type: int
arguments:
- type: FILE *
- name: fgets
standards:
- stdc
return_type: char *
arguments:
- type: char * __restrict
- type: int
- type: FILE * __restrict
- name: fflush
standards:
- stdc
return_type: int
arguments:
- type: FILE *
- name: fopen
standards:
- stdc
return_type: FILE *
arguments:
- type: const char *
- type: const char *
- name: fputc
standards:
- stdc
return_type: int
arguments:
- type: int
- type: FILE *
- name: fputs
standards:
- stdc
return_type: int
arguments:
- type: const char * __restrict
- type: FILE * __restrict
- name: fopencookie
standards:
- GNUExtensions
return_type: FILE *
arguments:
- type: void *
- type: const char *
- type: cookie_io_functions_t
- name: fread
standards:
- stdc
return_type: size_t
arguments:
- type: void * __restrict
- type: size_t
- type: size_t
- type: FILE * __restrict
- name: fread_unlocked
standards:
- GNUExtensions
return_type: size_t
arguments:
- type: void * __restrict
- type: size_t
- type: size_t
- type: FILE * __restrict
- name: fseek
standards:
- stdc
return_type: int
arguments:
- type: FILE *
- type: long
- type: int
- name: ftell
standards:
- stdc
return_type: long
arguments:
- type: FILE *
- name: funlockfile
standards:
- POSIX
return_type: void
arguments:
- type: FILE *
- name: fwrite
standards:
- stdc
return_type: size_t
arguments:
- type: const void * __restrict
- type: size_t
- type: size_t
- type: FILE * __restrict
- name: fwrite_unlocked
standards:
- GNUExtensions
return_type: size_t
arguments:
- type: const void * __restrict
- type: size_t
- type: size_t
- type: FILE * __restrict
- name: getc
standards:
- stdc
return_type: int
arguments:
- type: FILE *
- name: getc_unlocked
standards:
- POSIX
return_type: int
arguments:
- type: FILE *
- name: getchar
standards:
- stdc
return_type: int
arguments: []
- name: getchar_unlocked
standards:
- POSIX
return_type: int
arguments: []
- name: putc
standards:
- stdc
return_type: int
arguments:
- type: int
- type: FILE *
- name: putchar
standards:
- stdc
return_type: int
arguments:
- type: int
- name: puts
standards:
- stdc
return_type: int
arguments:
- type: const char *
- name: setbuf
standards:
- stdc
return_type: void
arguments:
- type: FILE * __restrict
- type: char * __restrict
- name: setvbuf
standards:
- stdc
return_type: int
arguments:
- type: FILE * __restrict
- type: char * __restrict
- type: int
- type: size_t
- name: ungetc
standards:
- stdc
return_type: int
arguments:
- type: int
- type: FILE *
- name: stderr
standards:
- stdc
return_type: extern FILE *
arguments: []
- name: stdin
standards:
- stdc
return_type: extern FILE *
arguments: []
- name: stdout
standards:
- stdc
return_type: extern FILE *
arguments: []
273 changes: 273 additions & 0 deletions libc/newhdrgen/yaml_combined/stdlib.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,273 @@
header: stdlib.h
standards:
- stdc
macros: []
types:
- type_name: __atexithandler_t
- type_name: __qsortrcompare_t
- type_name: __qsortcompare_t
- type_name: __bsearchcompare_t
- type_name: size_t
- type_name: lldiv_t
- type_name: ldiv_t
- type_name: div_t
enums: []
objects: []
functions:
- name: abs
standards:
- stdc
return_type: int
arguments:
- type: int
- name: atoi
standards:
- stdc
return_type: int
arguments:
- type: const char *
- name: atof
standards:
- stdc
return_type: double
arguments:
- type: const char * __restrict
- name: atol
standards:
- stdc
return_type: long
arguments:
- type: const char *
- name: atoll
standards:
- stdc
return_type: long long
arguments:
- type: const char *
- name: bsearch
standards:
- stdc
return_type: void *
arguments:
- type: const void *
- type: const void *
- type: size_t
- type: size_t
- type: __bsearchcompare_t
- name: div
standards:
- stdc
return_type: div_t
arguments:
- type: int
- type: int
- name: labs
standards:
- stdc
return_type: long
arguments:
- type: long
- name: ldiv
standards:
- stdc
return_type: ldiv_t
arguments:
- type: long
- type: long
- name: llabs
standards:
- stdc
return_type: long long
arguments:
- type: long long
- name: lldiv
standards:
- stdc
return_type: lldiv_t
arguments:
- type: long long
- type: long long
- name: qsort
standards:
- stdc
return_type: void
arguments:
- type: void *
- type: size_t
- type: size_t
- type: __qsortcompare_t
- name: qsort_r
standards:
- GNUExtensions
return_type: void
arguments:
- type: void *
- type: size_t
- type: size_t
- type: __qsortrcompare_t
- type: void *
- name: rand
standards:
- stdc
return_type: int
arguments: []
- name: srand
standards:
- stdc
return_type: void
arguments:
- type: unsigned int
- name: strfromd
standards:
- stdc
return_type: int
arguments:
- type: char * __restrict
- type: size_t
- type: const char * __restrict
- type: double
- name: strfromf
standards:
- stdc
return_type: int
arguments:
- type: char * __restrict
- type: size_t
- type: const char * __restrict
- type: float
- name: strfroml
standards:
- stdc
return_type: int
arguments:
- type: char * __restrict
- type: size_t
- type: const char * __restrict
- type: long double
- name: strtod
standards:
- stdc
return_type: double
arguments:
- type: const char * __restrict
- type: char * * __restrict
- name: strtof
standards:
- stdc
return_type: float
arguments:
- type: const char * __restrict
- type: char * * __restrict
- name: strtol
standards:
- stdc
return_type: long
arguments:
- type: const char * __restrict
- type: char * * __restrict
- type: int
- name: strtold
standards:
- stdc
return_type: long double
arguments:
- type: const char * __restrict
- type: char * * __restrict
- name: strtoll
standards:
- stdc
return_type: long long
arguments:
- type: const char * __restrict
- type: char * * __restrict
- type: int
- name: strtoul
standards:
- stdc
return_type: unsigned long
arguments:
- type: const char * __restrict
- type: char * * __restrict
- type: int
- name: strtoull
standards:
- stdc
return_type: unsigned long long
arguments:
- type: const char * __restrict
- type: char * * __restrict
- type: int
- name: malloc
standards:
- stdc
return_type: void *
arguments:
- type: size_t
- name: calloc
standards:
- stdc
return_type: void *
arguments:
- type: size_t
- type: size_t
- name: realloc
standards:
- stdc
return_type: void *
arguments:
- type: void *
- type: size_t
- name: aligned_alloc
standards:
- stdc
return_type: void *
arguments:
- type: size_t
- type: size_t
- name: free
standards:
- stdc
return_type: void
arguments:
- type: void *
- name: _Exit
standards:
- stdc
return_type: _Noreturn void
arguments:
- type: int
- name: abort
standards:
- stdc
return_type: _Noreturn void
arguments: []
- name: at_quick_exit
standards:
- stdc
return_type: int
arguments:
- type: __atexithandler_t
- name: atexit
standards:
- stdc
return_type: int
arguments:
- type: __atexithandler_t
- name: exit
standards:
- stdc
return_type: _Noreturn void
arguments:
- type: int
- name: getenv
standards:
- stdc
return_type: char *
arguments:
- type: const char *
- name: quick_exit
standards:
- stdc
return_type: _Noreturn void
arguments:
- type: int
302 changes: 302 additions & 0 deletions libc/newhdrgen/yaml_combined/string.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,302 @@
header: string.h
macros: []
types:
- type_name: size_t
enums: []
objects: []
functions:
- name: memcpy
standards:
- stdc
return_type: void *
arguments:
- type: void *__restrict
- type: const void *__restrict
- type: size_t
- name: memmove
standards:
- stdc
return_type: void *
arguments:
- type: void *
- type: const void *
- type: size_t
- name: memcmp
standards:
- stdc
return_type: int
arguments:
- type: const void *
- type: const void *
- type: size_t
- name: memchr
standards:
- stdc
return_type: void *
arguments:
- type: const void *
- type: int
- type: size_t
- name: memset
standards:
- stdc
return_type: void *
arguments:
- type: void *
- type: int
- type: size_t
- name: memset_explicit
standards:
- stdc
return_type: void *
arguments:
- type: void *
- type: int
- type: size_t
- name: strcpy
standards:
- stdc
return_type: char
arguments:
- type: char *__restrict
- type: const char *__restrict
- name: strncpy
standards:
- stdc
return_type: char *
arguments:
- type: char *__restrict
- type: const char *__restrict
- type: size_t
- name: strcat
standards:
- stdc
return_type: char *
arguments:
- type: char *__restrict
- type: const char *__restrict
- name: strncat
standards:
- stdc
return_type: char *
arguments:
- type: char *
- type: const char *
- type: size_t
- name: strcmp
standards:
- stdc
return_type: int
arguments:
- type: const char *
- type: const char *
- name: strcoll
standards:
- stdc
return_type: int
arguments:
- type: const char *
- type: const char *
- name: strncmp
standards:
- stdc
return_type: int
arguments:
- type: const char *
- type: const char *
- type: size_t
- name: strxfrm
standards:
- stdc
return_type: size_t
arguments:
- type: char *__restrict
- type: const char *__restrict
- type: size_t
- name: strchr
standards:
- stdc
return_type: char *
arguments:
- type: const char *
- type: int
- name: strcspn
standards:
- stdc
return_type: size_t
arguments:
- type: const char *
- type: const char *
- name: strdup
return_type: char *
arguments:
- type: const char *
- name: strndup
standards:
- stdc
return_type: char *
arguments:
- type: const char *
- type: size_t
- name: strpbrk
standards:
- stdc
return_type: char *
arguments:
- type: const char *
- type: const char *
- name: strrchr
standards:
- stdc
return_type: char *
arguments:
- type: const char *
- type: int
- name: strspn
standards:
- stdc
return_type: size_t
arguments:
- type: const char *
- type: const char *
- name: strstr
standards:
- stdc
return_type: char *
arguments:
- type: const char *
- type: const char *
- name: strtok
standards:
- stdc
return_type: char *
arguments:
- type: char *__restrict
- type: const char *__restrict
- name: strerror
standards:
- stdc
return_type: char *
arguments:
- type: int
- name: strlen
standards:
- stdc
return_type: size_t
arguments:
- type: const char *
- name: memccpy
standards:
- POSIX
return_type: void *
arguments:
- type: void *__restrict
- type: const void *__restrict
- type: int
- type: size_t
- name: mempcpy
standards:
- POSIX
return_type: void *
arguments:
- type: void *__restrict
- type: const void *__restrict
- type: size_t
- name: stpcpy
standards:
- POSIX
return_type: char *
arguments:
- type: char *__restrict
- type: const char *__restrict
- name: stpncpy
standards:
- POSIX
return_type: char *
arguments:
- type: char *__restrict
- type: const char *__restrict
- type: size_t
- name: strnlen
standards:
- POSIX
return_type: size_t
arguments:
- type: const char *
- type: size_t
- name: strtok_r
standards:
- POSIX
return_type: char *
arguments:
- type: char *__restrict
- type: const char *__restrict
- type: char ** __restrict
- name: strsignal
standards:
- POSIX
return_type: char *
arguments:
- type: int
- name: memmem
standards:
- GNUExtensions
return_type: void *
arguments:
- type: const void *
- type: size_t
- type: const void *
- type: size_t
- name: memrchr
standards:
- GNUExtensions
return_type: void *
arguments:
- type: const void *
- type: int
- type: size_t
- name: strerror_r
standards:
- GNUExtensions
return_type: char *
arguments:
- type: int
- type: char *
- type: size_t
- name: strcasestr
standards:
- GNUExtensions
return_type: char *
arguments:
- type: const char *
- type: const char *
- name: strchrnul
standards:
- GNUExtensions
return_type: char *
arguments:
- type: const char *
- type: int
- name: strlcat
standards:
- BSDExtensions
return_type: size_t
arguments:
- type: char *__restrict
- type: char *__restrict
- type: size_t
- name: strlcpy
standards:
- BSDExtensions
return_type: size_t
arguments:
- type: char *__restrict
- type: char *__restrict
- type: size_t
- name: strsep
standards:
- BSDExtensions
return_type: char *
arguments:
- type: char **__restrict
- type: char *__restrict
58 changes: 58 additions & 0 deletions libc/newhdrgen/yaml_combined/strings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
header: strings.h
macros: []
types: []
enums: []
objects: []
functions:
- name: bcopy
standards:
- llvm_libc_ext
return_type: void
arguments:
- type: const void *
- type: void *
- type: size_t
- name: bzero
standards:
- llvm_libc_ext
return_type: void
arguments:
- type: void *
- type: size_t
- name: bcmp
standards:
- llvm_libc_ext
return_type: int
arguments:
- type: const void *
- type: const void *
- type: size_t
- name: strcasecmp
standards:
- BSDExtensions
return_type: int
arguments:
- type: const char *
- type: const char *
- name: strncasecmp
standards:
- BSDExtensions
return_type: int
arguments:
- type: const char *
- type: const char *
- type: size_t
- name: index
standards:
- BSDExtensions
return_type: char *
arguments:
- type: const char *
- type: int
- name: rindex
standards:
- BSDExtensions
return_type: char *
arguments:
- type: const char *
- type: int
118 changes: 118 additions & 0 deletions libc/newhdrgen/yaml_combined/sys_mman.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
#known as sys/mman in POSIX
header: sys-mman.h
standards: POSIX
macros: []
macros: []
types:
- type_name: mode_t
- type_name: size_t
- type_name: off_t
enums: []
objects: []
functions:
- name: madvise
standards:
- POSIX
return_type: int
arguments:
- type: void *
- type: size_t
- type: int
- name: mmap
standards:
- POSIX
return_type: void *
arguments:
- type: void *
- type: size_t
- type: int
- type: int
- type: int
- type: off_t
- name: mprotect
standards:
- POSIX
return_type: int
arguments:
- type: void *
- type: size_t
- type: int
- name: munmap
standards:
- POSIX
return_type: int
arguments:
- type: void *
- type: size_t
- name: POSIX_madvise
standards:
- POSIX
return_type: int
arguments:
- type: void *
- type: size_t
- type: int
# this is a linux function
- name: mincore
standards:
- Linux
return_type: int
arguments:
- type: void *
- type: size_t
- type: unsigned char *
- name: mlock
standards:
- POSIX
return_type: int
arguments:
- type: void *
- type: size_t
- name: mlock2
standards:
- Linux
return_type: int
arguments:
- type: void *
- type: size_t
- type: unsigned int
- name: munlock
standards: POSIX
return_type: int
arguments:
- type: void *
- type: size_t
- name: mlockall
standards:
-POSIX
return_type: int
arguments:
- type: int
- name: munlockall
standards:
- POSIX
return_type: int
arguments: []
- name: msync
standards:
- POSIX
return_type: int
arguments:
- type: void *
- type: size_t
- type: int
- name: shm_open
standards:
- POSIX
return_type: int
arguments:
- type: const char *
- type: int
- type: mode_t
- name: shm_unlink
standards:
- POSIX
return_type: int
arguments:
- type: const char *

33 changes: 33 additions & 0 deletions libc/newhdrgen/yaml_combined/sys_wait.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
header: sys-wait.h #sys/wait.h
macros: []
types:
- type_name: siginfo_t
- type_name: struct_rusage
- type_name: pid_t
enums: []
objects: []
functions:
- name: wait
standards:
- POSIX
return_type: pid_t
arguments:
- type: int *
- name: wait4
standards:
- BSDExtensions
- POSIX
return_type: pid_t
arguments:
- type: pid_t
- type: int *
- type: int
- type: struct rusage *
- name: waitpid
standards:
- POSIX
return_type: pid_t
arguments:
- type: pid_t
- type: int *
- type: int
83 changes: 83 additions & 0 deletions libc/newhdrgen/yaml_combined/time.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
header: time.h
macros: []
types:
- type_name: struct_timeval
- type_name: clockid_t
- type_name: struct_timespec
- type_name: struct_tm
- type_name: time_t
- type_name: clock_t
enums: []
objects: []
functions:
- name: asctime
standard:
- stdc
return_type: char *
arguments:
- type: struct tm *
- name: asctime_r
standard:
- stdc
return_type: char *
arguments:
- type: struct tm *
- type: char *
- name: clock_gettime
standard:
- POSIX
return_type: int
arguments:
- type: clockid_t
- type: struct timespec *
- name: clock
standard:
- stdc
return_type: clock_t
arguments: []
- name: difftime
standard:
- stdc
return_type: double
arguments:
- type: time_t
- type: time_t
- name: gettimeofday
standard:
- POSIX
return_type: int
arguments:
- type: struct timeval *
- type: void *
- name: gmtime
standard:
- stdc
return_type: struct tm *
arguments:
- type: time_t *
- name: gmtime_r
standard:
- stdc
return_type: struct tm *
arguments:
- type: time_t *
- type: struct tm *
- name: mktime
standard:
- stdc
return_type: time_t
arguments:
- type: struct tm *
- name: nanosleep
standard:
- POSIX
return_type: int
arguments:
- type: const struct timespec *
- type: struct timespec *
- name: time
standard:
- stdc
return_type: time_t
arguments:
- type: time_t *
18 changes: 11 additions & 7 deletions libc/newhdrgen/yaml_to_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,27 @@ def yaml_to_classes(yaml_data):
Enumeration(enum_data["name"], enum_data.get("value", None))
)

for object_data in yaml_data.get("objects", []):
header.add_object(
Object(object_data["object_name"], object_data["object_type"])
)

for function_data in yaml_data.get("functions", []):
arguments = [arg["type"] for arg in function_data["arguments"]]
guard = function_data.get("guard", None)
attributes = function_data.get("attributes", None)
standards = (function_data.get("standards", None),)
header.add_function(
Function(
standards,
function_data["return_type"],
function_data["name"],
arguments,
function_data.get("guard"),
function_data.get("attributes", []),
guard,
attributes,
)
)

for object_data in yaml_data.get("objects", []):
header.add_object(
Object(object_data["object_name"], object_data["object_type"])
)

for include_data in yaml_data.get("includes", []):
header.add_include(Include(include_data))

Expand Down