Bindings for libc.
We consider the following specs reasonably normative with respect to interoperating with the C standard library (libc/msvcrt):
Despite having several names each, these are reasonably coherent point-in-time, list-of-definition sorts of specs. You can get each under a variety of names but will wind up with the same definition in each case.
Our interface to these libraries is complicated by the non-universality of conformance to any of them. About the only thing universally supported is the first (C95), beyond that definitions quickly become absent on various platforms.
We therefore wind up dividing our module-space up (mostly for the sake of sanity while editing, filling-in-details and eliminating duplication) into definitions common-to-all (held in modules named c95, c99, posix88, posix01 and posix08) and definitions that appear only on some platforms (named 'extra'). This would be things like significant OSX foundation kit, or win32 library kernel32.dll, or various fancy glibc, linux or BSD extensions.
In addition to the per-platform 'extra' modules, we define a module of 'common BSD' libc routines that never quite made it into POSIX but show up in multiple derived systems. This is the 4.4BSD r2 / 1995 release, the final one from Berkeley after the lawsuits died down and the CSRG dissolved.
BUFSIZ
EOF
EXIT_FAILURE
EXIT_SUCCESS
FILENAME_MAX
FOPEN_MAX
F_OK
L_tmpnam
O_APPEND
O_CREAT
O_EXCL
O_RDONLY
O_RDWR
O_TRUNC
O_WRONLY
RAND_MAX
R_OK
SEEK_CUR
SEEK_END
SEEK_SET
STDERR_FILENO
STDIN_FILENO
STDOUT_FILENO
S_IEXEC
S_IFBLK
S_IFCHR
S_IFDIR
S_IFIFO
S_IFMT
S_IFREG
S_IREAD
S_IRUSR
S_IRWXU
S_IWRITE
S_IWUSR
S_IXUSR
TMP_MAX
W_OK
X_OK
_IOFBF
_IOLBF
_IONBF
c_char
c_double
c_float
c_int
c_long
c_longlong
c_schar
c_short
c_uchar
c_uint
c_ulong
c_ulonglong
c_ushort
clock_t
dev_t
ino_t
intptr_t
mode_t
off_t
pid_t
ptrdiff_t
size_t
ssize_t
time_t
uintptr_t
DIR
FILE
c_void
dirent
fpos_t
abort
abs
access
atof
atoi
calloc
chdir
chmod
close
creat
dup
dup2
execv
execve
execvp
exit
fclose
fdopen
feof
ferror
fflush
fgetc
fgetpos
fgets
fileno
fopen
fputc
fputs
fread
free
freopen
fseek
fsetpos
ftell
fwrite
getcwd
getenv
getpid
isalnum
isalpha
isatty
iscntrl
isdigit
islower
isprint
ispunct
isspace
isupper
isxdigit
labs
lseek
malloc
memchr
memcmp
memcpy
memmove
memset
mkdir
open
pclose
perror
pipe
popen
puts
rand
read
realloc
remove
rewind
rmdir
setbuf
setvbuf
srand
strcat
strchr
strcmp
strcoll
strcpy
strcspn
strerror
strlen
strncat
strncmp
strncpy
strpbrk
strrchr
strspn
strstr
strtod
strtok
strtol
strtoul
strxfrm
system
tmpfile
tolower
toupper
ungetc
unlink
write
libc::consts
libc::funcs
libc::types
BUFSIZ
uint
EOF
int
EXIT_FAILURE
int
EXIT_SUCCESS
int
FILENAME_MAX
uint
FOPEN_MAX
uint
F_OK
int
L_tmpnam
uint
O_APPEND
int
O_CREAT
int
O_EXCL
int
O_RDONLY
int
O_RDWR
int
O_TRUNC
int
O_WRONLY
int
RAND_MAX
int
R_OK
int
SEEK_CUR
int
SEEK_END
int
SEEK_SET
int
STDERR_FILENO
int
STDIN_FILENO
int
STDOUT_FILENO
int
S_IEXEC
int
S_IFBLK
int
S_IFCHR
int
S_IFDIR
int
S_IFIFO
int
S_IFMT
int
S_IFREG
int
S_IREAD
int
S_IRUSR
int
S_IRWXU
int
S_IWRITE
int
S_IWUSR
int
S_IXUSR
int
TMP_MAX
uint
W_OK
int
X_OK
int
_IOFBF
int
_IOLBF
int
_IONBF
int
c_char
type c_char = i8
c_double
type c_double = f64
c_float
type c_float = f32
c_int
type c_int = i32
c_long
type c_long = i64
c_longlong
type c_longlong = i64
c_schar
type c_schar = i8
c_short
type c_short = i16
c_uchar
type c_uchar = u8
c_uint
type c_uint = u32
c_ulong
type c_ulong = u64
c_ulonglong
type c_ulonglong = u64
c_ushort
type c_ushort = u16
clock_t
type clock_t = i64
dev_t
type dev_t = u64
ino_t
type ino_t = u64
intptr_t
type intptr_t = int
mode_t
type mode_t = u32
off_t
type off_t = i64
pid_t
type pid_t = i32
ptrdiff_t
type ptrdiff_t = i64
size_t
type size_t = u64
ssize_t
type ssize_t = i64
time_t
type time_t = i64
uintptr_t
type uintptr_t = uint
DIR
FILE
c_void
dirent
fpos_t
abort
fn abort() -> !
abs
fn abs(i: c_int) -> c_int
access
fn access(path: *c_char, amode: c_int) -> c_int
atof
fn atof(s: *c_char) -> c_double
atoi
fn atoi(s: *c_char) -> c_int
calloc
fn calloc(nobj: size_t, size: size_t) -> *c_void
chdir
fn chdir(dir: *c_char) -> c_int
chmod
fn chmod(path: *c_char, mode: mode_t) -> c_int
close
fn close(fd: c_int) -> c_int
creat
fn creat(path: *c_char, mode: mode_t) -> c_int
dup
fn dup(fd: c_int) -> c_int
dup2
fn dup2(src: c_int, dst: c_int) -> c_int
execv
fn execv(prog: *c_char, argv: **c_char) -> c_int
execve
fn execve(prog: *c_char, argv: **c_char, envp: **c_char) -> c_int
execvp
fn execvp(c: *c_char, argv: **c_char) -> c_int
exit
fn exit(status: c_int) -> !
fclose
fn fclose(file: *FILE) -> c_int
fdopen
fn fdopen(fd: c_int, mode: *c_char) -> *FILE
feof
fn feof(stream: *FILE) -> c_int
ferror
fn ferror(stream: *FILE) -> c_int
fflush
fn fflush(file: *FILE) -> c_int
fgetc
fn fgetc(stream: *FILE) -> c_int
fgetpos
fn fgetpos(stream: *FILE, ptr: *fpos_t) -> c_int
fgets
fn fgets(buf: *mut c_char, n: c_int, stream: *FILE) -> *c_char
fileno
fn fileno(stream: *FILE) -> c_int
fopen
fn fopen(filename: *c_char, mode: *c_char) -> *FILE
fputc
fn fputc(c: c_int, stream: *FILE) -> c_int
fputs
fn fputs(s: *c_char, stream: *FILE) -> *c_char
fread
fn fread(ptr: *mut c_void, size: size_t, nobj: size_t, stream: *FILE) ->
size_t
free
fn free(p: *c_void)
freopen
fn freopen(filename: *c_char, mode: *c_char, file: *FILE) -> *FILE
fseek
fn fseek(stream: *FILE, offset: c_long, whence: c_int) -> c_int
fsetpos
fn fsetpos(stream: *FILE, ptr: *fpos_t) -> c_int
ftell
fn ftell(stream: *FILE) -> c_long
fwrite
fn fwrite(ptr: *c_void, size: size_t, nobj: size_t, stream: *FILE) -> size_t
getcwd
fn getcwd(buf: *c_char, size: size_t) -> *c_char
getenv
fn getenv(s: *c_char) -> *c_char
getpid
fn getpid() -> pid_t
isalnum
fn isalnum(c: c_int) -> c_int
isalpha
fn isalpha(c: c_int) -> c_int
isatty
fn isatty(fd: c_int) -> c_int
iscntrl
fn iscntrl(c: c_int) -> c_int
isdigit
fn isdigit(c: c_int) -> c_int
islower
fn islower(c: c_int) -> c_int
isprint
fn isprint(c: c_int) -> c_int
ispunct
fn ispunct(c: c_int) -> c_int
isspace
fn isspace(c: c_int) -> c_int
isupper
fn isupper(c: c_int) -> c_int
isxdigit
fn isxdigit(c: c_int) -> c_int
labs
fn labs(i: c_long) -> c_long
lseek
fn lseek(fd: c_int, offset: off_t, whence: c_int) -> off_t
malloc
fn malloc(size: size_t) -> *c_void
memchr
fn memchr(cx: *c_void, c: c_int, n: size_t) -> *c_void
memcmp
fn memcmp(cx: *c_void, ct: *c_void, n: size_t) -> c_int
memcpy
fn memcpy(s: *c_void, ct: *c_void, n: size_t) -> *c_void
memmove
fn memmove(s: *c_void, ct: *c_void, n: size_t) -> *c_void
memset
fn memset(s: *c_void, c: c_int, n: size_t) -> *c_void
mkdir
fn mkdir(path: *c_char, mode: mode_t) -> c_int
open
fn open(path: *c_char, oflag: c_int, mode: c_int) -> c_int
pclose
fn pclose(stream: *FILE) -> c_int
perror
fn perror(s: *c_char)
pipe
fn pipe(fds: *mut c_int) -> c_int
popen
fn popen(command: *c_char, mode: *c_char) -> *FILE
puts
fn puts(s: *c_char) -> c_int
rand
fn rand() -> c_int
read
fn read(fd: c_int, buf: *mut c_void, count: size_t) -> ssize_t
realloc
fn realloc(p: *c_void, size: size_t) -> *c_void
remove
fn remove(filename: *c_char) -> c_int
rewind
fn rewind(stream: *FILE)
rmdir
fn rmdir(path: *c_char) -> c_int
setbuf
fn setbuf(stream: *FILE, buf: *c_char)
setvbuf
fn setvbuf(stream: *FILE, buffer: *c_char, mode: c_int, size: size_t) -> c_int
srand
fn srand(seed: c_uint)
strcat
fn strcat(s: *c_char, ct: *c_char) -> *c_char
strchr
fn strchr(cs: *c_char, c: c_int) -> *c_char
strcmp
fn strcmp(cs: *c_char, ct: *c_char) -> c_int
strcoll
fn strcoll(cs: *c_char, ct: *c_char) -> c_int
strcpy
fn strcpy(dst: *c_char, src: *c_char) -> *c_char
strcspn
fn strcspn(cs: *c_char, ct: *c_char) -> size_t
strerror
fn strerror(n: c_int) -> *c_char
strlen
fn strlen(cs: *c_char) -> size_t
strncat
fn strncat(s: *c_char, ct: *c_char, n: size_t) -> *c_char
strncmp
fn strncmp(cs: *c_char, ct: *c_char, n: size_t) -> c_int
strncpy
fn strncpy(dst: *c_char, src: *c_char, n: size_t) -> *c_char
strpbrk
fn strpbrk(cs: *c_char, ct: *c_char) -> *c_char
strrchr
fn strrchr(cs: *c_char, c: c_int) -> *c_char
strspn
fn strspn(cs: *c_char, ct: *c_char) -> size_t
strstr
fn strstr(cs: *c_char, ct: *c_char) -> *c_char
strtod
fn strtod(s: *c_char, endp: **c_char) -> c_double
strtok
fn strtok(s: *c_char, t: *c_char) -> *c_char
strtol
fn strtol(s: *c_char, endp: **c_char, base: c_int) -> c_long
strtoul
fn strtoul(s: *c_char, endp: **c_char, base: c_int) -> c_ulong
strxfrm
fn strxfrm(s: *c_char, ct: *c_char, n: size_t) -> size_t
system
fn system(s: *c_char) -> c_int
tmpfile
fn tmpfile() -> *FILE
tolower
fn tolower(c: c_char) -> c_char
toupper
fn toupper(c: c_char) -> c_char
ungetc
fn ungetc(c: c_int, stream: *FILE) -> c_int
unlink
fn unlink(c: *c_char) -> c_int
write
fn write(fd: c_int, buf: *c_void, count: size_t) -> ssize_t