87 changes: 37 additions & 50 deletions libc/newhdrgen/yaml/stdio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ macros:
macro_value: stdout
- macro_name: stdin
macro_value: stdin
- macro_name: stderr
macro_value: stderr
types:
- type_name: size_t
- type_name: off_t
Expand Down Expand Up @@ -42,87 +44,87 @@ functions:
- stdc
return_type: int
arguments:
- type: char * __restrict
- type: const char * __restrict
- type: char *__restrict
- type: const char *__restrict
- type: ...
- name: snprintf
standards:
- stdc
return_type: int
arguments:
- type: char * __restrict
- type: char *__restrict
- type: size_t
- type: const char * __restrict
- type: const char *__restrict
- type: ...
- name: fprintf
standards:
- stdc
return_type: int
arguments:
- type: FILE * __restrict
- type: const char * __restrict
- type: FILE *__restrict
- type: const char *__restrict
- type: ...
- name: printf
standards:
- stdc
return_type: int
arguments:
- type: const char * __restrict
- type: const char *__restrict
- type: ...
- name: vsprintf
standards:
- stdc
return_type: int
arguments:
- type: char * __restrict
- type: const char * __restrict
- type: char *__restrict
- type: const char *__restrict
- type: va_list
- name: vsnprintf
standards:
- stdc
return_type: int
arguments:
- type: char * __restrict
- type: char *__restrict
- type: size_t
- type: const char * __restrict
- type: const char *__restrict
- type: va_list
- name: vfprintf
standards:
- stdc
return_type: int
arguments:
- type: FILE * __restrict
- type: const char * __restrict
- type: FILE *__restrict
- type: const char *__restrict
- type: va_list
- name: vprintf
standards:
- stdc
return_type: int
arguments:
- type: const char * __restrict
- type: const char *__restrict
- type: va_list
- name: sscanf
standards:
- stdc
return_type: int
arguments:
- type: const char * __restrict
- type: const char * __restrict
- type: const char *__restrict
- type: const char *__restrict
- type: ...
- name: scanf
standards:
- stdc
return_type: int
arguments:
- type: const char * __restrict
- type: const char *__restrict
- type: ...
- name: fscanf
standards:
- stdc
return_type: int
arguments:
- type: FILE * __restrict
- type: const char * __restrict
- type: FILE *__restrict
- type: const char *__restrict
- type: ...
- name: fileno
standards:
Expand Down Expand Up @@ -202,9 +204,9 @@ functions:
- stdc
return_type: char *
arguments:
- type: char * __restrict
- type: char *__restrict
- type: int
- type: FILE * __restrict
- type: FILE *__restrict
- name: fflush
standards:
- stdc
Expand All @@ -230,8 +232,8 @@ functions:
- stdc
return_type: int
arguments:
- type: const char * __restrict
- type: FILE * __restrict
- type: const char *__restrict
- type: FILE *__restrict
- name: fopencookie
standards:
- GNUExtensions
Expand All @@ -245,19 +247,19 @@ functions:
- stdc
return_type: size_t
arguments:
- type: void * __restrict
- type: void *__restrict
- type: size_t
- type: size_t
- type: FILE * __restrict
- type: FILE *__restrict
- name: fread_unlocked
standards:
- GNUExtensions
return_type: size_t
arguments:
- type: void * __restrict
- type: void *__restrict
- type: size_t
- type: size_t
- type: FILE * __restrict
- type: FILE *__restrict
- name: fseek
standards:
- stdc
Expand All @@ -283,19 +285,19 @@ functions:
- stdc
return_type: size_t
arguments:
- type: const void * __restrict
- type: const void *__restrict
- type: size_t
- type: size_t
- type: FILE * __restrict
- type: FILE *__restrict
- name: fwrite_unlocked
standards:
- GNUExtensions
return_type: size_t
arguments:
- type: const void * __restrict
- type: const void *__restrict
- type: size_t
- type: size_t
- type: FILE * __restrict
- type: FILE *__restrict
- name: getc
standards:
- stdc
Expand Down Expand Up @@ -342,15 +344,15 @@ functions:
- stdc
return_type: void
arguments:
- type: FILE * __restrict
- type: char * __restrict
- type: FILE *__restrict
- type: char *__restrict
- name: setvbuf
standards:
- stdc
return_type: int
arguments:
- type: FILE * __restrict
- type: char * __restrict
- type: FILE *__restrict
- type: char *__restrict
- type: int
- type: size_t
- name: ungetc
Expand All @@ -360,18 +362,3 @@ functions:
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: []
50 changes: 26 additions & 24 deletions libc/newhdrgen/yaml/stdlib.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
header: stdlib.h
standards:
- stdc
- stdc
macros: []
types:
- type_name: __atexithandler_t
Expand Down Expand Up @@ -31,7 +31,7 @@ functions:
- stdc
return_type: double
arguments:
- type: const char * __restrict
- type: const char *__restrict
- name: atol
standards:
- stdc
Expand Down Expand Up @@ -110,7 +110,8 @@ functions:
standards:
- stdc
return_type: int
arguments: []
arguments:
- type: void
- name: srand
standards:
- stdc
Expand All @@ -122,80 +123,80 @@ functions:
- stdc
return_type: int
arguments:
- type: char * __restrict
- type: char *__restrict
- type: size_t
- type: const char * __restrict
- type: const char *__restrict
- type: double
- name: strfromf
standards:
- stdc
return_type: int
arguments:
- type: char * __restrict
- type: char *__restrict
- type: size_t
- type: const char * __restrict
- type: const char *__restrict
- type: float
- name: strfroml
standards:
- stdc
return_type: int
arguments:
- type: char * __restrict
- type: char *__restrict
- type: size_t
- type: const char * __restrict
- type: const char *__restrict
- type: long double
- name: strtod
standards:
- stdc
return_type: double
arguments:
- type: const char * __restrict
- type: char * * __restrict
- type: const char *__restrict
- type: char **__restrict
- name: strtof
standards:
- stdc
return_type: float
arguments:
- type: const char * __restrict
- type: char * * __restrict
- type: const char *__restrict
- type: char **__restrict
- name: strtol
standards:
- stdc
return_type: long
arguments:
- type: const char * __restrict
- type: char * * __restrict
- 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
- type: const char *__restrict
- type: char **__restrict
- name: strtoll
standards:
- stdc
return_type: long long
arguments:
- type: const char * __restrict
- type: char * * __restrict
- 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: 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: const char *__restrict
- type: char **__restrict
- type: int
- name: malloc
standards:
Expand Down Expand Up @@ -240,7 +241,8 @@ functions:
standards:
- stdc
return_type: _Noreturn void
arguments: []
arguments:
- type: void
- name: at_quick_exit
standards:
- stdc
Expand Down
12 changes: 6 additions & 6 deletions libc/newhdrgen/yaml/string.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ functions:
- name: strcpy
standards:
- stdc
return_type: char
return_type: char *
arguments:
- type: char *__restrict
- type: const char *__restrict
Expand Down Expand Up @@ -282,21 +282,21 @@ functions:
- BSDExtensions
return_type: size_t
arguments:
- type: char *__restrict
- type: char *__restrict
- type: const char *__restrict
- type: const char *__restrict
- type: size_t
- name: strlcpy
standards:
- BSDExtensions
return_type: size_t
arguments:
- type: char *__restrict
- type: char *__restrict
- type: const char *__restrict
- type: const char *__restrict
- type: size_t
- name: strsep
standards:
- BSDExtensions
return_type: char *
arguments:
- type: char **__restrict
- type: char *__restrict
- type: const char *__restrict
7 changes: 3 additions & 4 deletions libc/newhdrgen/yaml/sys_mman.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
header: sys-mman.h
standards: POSIX
macros: []
types:
- type_name: mode_t
Expand Down Expand Up @@ -42,15 +41,14 @@ functions:
arguments:
- type: void *
- type: size_t
- name: POSIX_madvise
- 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
Expand Down Expand Up @@ -90,7 +88,8 @@ functions:
standards:
- POSIX
return_type: int
arguments: []
arguments:
- type: void
- name: msync
standards:
- POSIX
Expand Down
7 changes: 7 additions & 0 deletions libc/newhdrgen/yaml/sys_syscall.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
header: sys-syscall.h
standards: Linux
macros: []
types: []
enums: []
functions: []
objects: []
1 change: 1 addition & 0 deletions libc/newhdrgen/yaml/sys_types.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ types:
- type_name: uid_t
- type_name: time_t
- type_name: pthread_t
- type_name: pthread_rwlock_t
- type_name: pthread_rwlockattr_t
- type_name: pthread_mutex_t
- type_name: blkcnt_t
Expand Down
4 changes: 2 additions & 2 deletions libc/newhdrgen/yaml/termios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ functions:
- name: cfsetispeed
standards:
- POSIX
return_type: int
return_type: speed_t
arguments:
- type: struct termios *
- type: speed_t
- name: cfsetospeed
standards:
- POSIX
return_type: int
return_type: speed_t
arguments:
- type: struct termios *
- type: speed_t
Expand Down
13 changes: 13 additions & 0 deletions libc/newhdrgen/yaml/threads.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,16 @@ functions:
return_type: int
arguments:
- type: tss_t
- name: tss_get
standards:
- stdc
return_type: void *
arguments:
- type: tss_t
- name: tss_set
standards:
- stdc
return_type: int
arguments:
- type: tss_t
- type: void *
3 changes: 2 additions & 1 deletion libc/newhdrgen/yaml/time.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ functions:
standard:
- stdc
return_type: clock_t
arguments: []
arguments:
- type: void
- name: difftime
standard:
- stdc
Expand Down
51 changes: 16 additions & 35 deletions libc/newhdrgen/yaml/unistd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,22 +100,26 @@ functions:
standards:
- POSIX
return_type: uid_t
arguments: []
arguments:
- type: void
- name: getpid
standards:
- POSIX
return_type: int
arguments: []
arguments:
- type: void
- name: getppid
standards:
- POSIX
return_type: int
arguments: []
arguments:
- type: void
- name: getuid
standards:
- POSIX
return_type: uid_t
arguments: []
arguments:
- type: void
- name: isatty
standards:
- POSIX
Expand Down Expand Up @@ -186,16 +190,16 @@ functions:
- POSIX
return_type: ssize_t
arguments:
- type: const char * __restrict
- type: char * __restrict
- type: const char *__restrict
- type: char *__restrict
- type: size_t
- name: readlinkat
standards:
- POSIX
return_type: ssize_t
arguments:
- type: const char * __restrict
- type: char * __restrict
- type: const char *__restrict
- type: char *__restrict
- type: size_t
- name: rmdir
standards:
Expand Down Expand Up @@ -273,7 +277,8 @@ functions:
standards:
- POSIX
return_type: pid_t
arguments: []
arguments:
- type: void
- name: __llvm_libc_syscall
standards:
- POSIX
Expand All @@ -299,31 +304,7 @@ functions:
- POSIX
return_type: void
arguments:
- type: const void * __restrict
- type: const void *__restrict
- type: void *
- type: ssize_t
- name: enivron
standards:
- POSIX
return_type: extern char **
arguments: []
- name: optarg
standards:
- POSIX
return_type: extern char *
arguments: []
- name: optind
standards:
- POSIX
return_type: extern int
arguments: []
- name: optopt
standards:
- POSIX
return_type: extern int
arguments: []
- name: opterr
standards:
- POSIX
return_type: extern int
arguments: []