Add glob and some finer tuning of documentation

This commit is contained in:
Justine Tunney 2020-06-21 00:10:11 -07:00
parent 799e24a87b
commit d51409ccd9
77 changed files with 1321 additions and 736 deletions

View file

@ -44,7 +44,7 @@ size_t fread(void *buf, size_t stride, size_t count, FILE *f) {
if (i % stride != 0) abort(); /* todo(jart) */
return i / stride;
}
p[i] = (unsigned char)c;
p[i] = c & 0xff;
}
return count;
}

View file

@ -12,13 +12,13 @@ extern unsigned char g_stderrbuf[BUFSIZ];
int fflushregister(FILE *) hidden;
void fflushunregister(FILE *) hidden;
int freadbuf(FILE *f) hidden;
int fwritebuf(FILE *f) hidden;
int fsreadbuf(FILE *f) hidden;
int fswritebuf(FILE *f) hidden;
long fseteof(FILE *f) hidden;
long fseterrno(FILE *f) hidden;
long fseterr(FILE *f, int err) hidden;
int freadbuf(FILE *) hidden;
int fwritebuf(FILE *) hidden;
int fsreadbuf(FILE *) hidden;
int fswritebuf(FILE *) hidden;
long fseteof(FILE *) hidden;
long fseterrno(FILE *) hidden;
long fseterr(FILE *, int) hidden;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */

View file

@ -59,6 +59,7 @@
* it implies the quoting modifier, wraps the value with {,u,L}['"]
* quotes, displays NULL as "NULL" rather than "(null)", etc.
*
* @see palandprintf() for intuitive reference documentation
* @see {,v}{,s{,n},{,{,x}as},f,d}printf
*/
int(printf)(const char* fmt, ...) {

View file

@ -4,29 +4,29 @@
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
int getc_unlocked(FILE *f) paramsnonnull();
int getc_unlocked(FILE *) paramsnonnull();
int getchar_unlocked(void);
int putc_unlocked(int c, FILE *f) paramsnonnull();
int putchar_unlocked(int c);
void clearerr_unlocked(FILE *f);
int feof_unlocked(FILE *f);
int ferror_unlocked(FILE *f);
int fileno_unlocked(FILE *f);
int fflush_unlocked(FILE *f);
int fgetc_unlocked(FILE *f);
int fputc_unlocked(int c, FILE *f);
size_t fread_unlocked(void *ptr, size_t size, size_t n, FILE *f);
size_t fwrite_unlocked(const void *ptr, size_t size, size_t n, FILE *f);
char *fgets_unlocked(char *s, int n, FILE *f);
int fputs_unlocked(const char *s, FILE *f);
wint_t getwc_unlocked(FILE *f);
int putc_unlocked(int, FILE *) paramsnonnull();
int putchar_unlocked(int);
void clearerr_unlocked(FILE *);
int feof_unlocked(FILE *);
int ferror_unlocked(FILE *);
int fileno_unlocked(FILE *);
int fflush_unlocked(FILE *);
int fgetc_unlocked(FILE *);
int fputc_unlocked(int, FILE *);
size_t fread_unlocked(void *, size_t, size_t, FILE *);
size_t fwrite_unlocked(const void *, size_t, size_t, FILE *);
char *fgets_unlocked(char *, int, FILE *);
int fputs_unlocked(const char *, FILE *);
wint_t getwc_unlocked(FILE *);
wint_t getwchar_unlocked(void);
wint_t fgetwc_unlocked(FILE *f);
wint_t fputwc_unlocked(wchar_t wc, FILE *f);
wint_t putwc_unlocked(wchar_t wc, FILE *f);
wint_t putwchar_unlocked(wchar_t wc);
wchar_t *fgetws_unlocked(wchar_t *ws, int n, FILE *f);
int fputws_unlocked(const wchar_t *ws, FILE *f);
wint_t fgetwc_unlocked(FILE *);
wint_t fputwc_unlocked(wchar_t, FILE *);
wint_t putwc_unlocked(wchar_t, FILE *);
wint_t putwchar_unlocked(wchar_t);
wchar_t *fgetws_unlocked(wchar_t *, int, FILE *);
int fputws_unlocked(const wchar_t *, FILE *);
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */

View file

@ -21,8 +21,10 @@
.source __FILE__
clearerr_unlocked:
.leafprologue
.profilable # so we can fix code supporting this abomination
push %rbp
mov %rsp,%rbp
.profilable # note: no consensus for threads exists in abis
call clearerr
.leafepilogue
pop %rbp
ret
.endfn clearerr_unlocked,globl

View file

@ -21,8 +21,10 @@
.source __FILE__
feof_unlocked:
.leafprologue
.profilable # so we can fix code supporting this abomination
push %rbp
mov %rsp,%rbp
.profilable # note: no consensus for threads exists in abis
call feof
.leafepilogue
pop %rbp
ret
.endfn feof_unlocked,globl

View file

@ -21,8 +21,10 @@
.source __FILE__
ferror_unlocked:
.leafprologue
.profilable # so we can fix code supporting this abomination
push %rbp
mov %rsp,%rbp
.profilable # note: no consensus for threads exists in abis
call ferror
.leafepilogue
pop %rbp
ret
.endfn ferror_unlocked,globl

View file

@ -21,8 +21,10 @@
.source __FILE__
fflush_unlocked:
.leafprologue
.profilable # so we can fix code supporting this abomination
push %rbp
mov %rsp,%rbp
.profilable # note: no consensus for threads exists in abis
call fflush
.leafepilogue
pop %rbp
ret
.endfn fflush_unlocked,globl

View file

@ -21,8 +21,10 @@
.source __FILE__
fgetc_unlocked:
.leafprologue
.profilable # so we can fix code supporting this abomination
push %rbp
mov %rsp,%rbp
.profilable # note: no consensus for threads exists in abis
call fgetc
.leafepilogue
pop %rbp
ret
.endfn fgetc_unlocked,globl

View file

@ -21,8 +21,10 @@
.source __FILE__
fgets_unlocked:
.leafprologue
.profilable # so we can fix code supporting this abomination
push %rbp
mov %rsp,%rbp
.profilable # note: no consensus for threads exists in abis
call fgets
.leafepilogue
pop %rbp
ret
.endfn fgets_unlocked,globl

View file

@ -21,8 +21,10 @@
.source __FILE__
fgetwc_unlocked:
.leafprologue
.profilable # so we can fix code supporting this abomination
push %rbp
mov %rsp,%rbp
.profilable # note: no consensus for threads exists in abis
call fgetwc
.leafepilogue
pop %rbp
ret
.endfn fgetwc_unlocked,globl

View file

@ -21,8 +21,10 @@
.source __FILE__
fgetws_unlocked:
.leafprologue
.profilable # so we can fix code supporting this abomination
push %rbp
mov %rsp,%rbp
.profilable # note: no consensus for threads exists in abis
call fgetws
.leafepilogue
pop %rbp
ret
.endfn fgetws_unlocked,globl

View file

@ -21,8 +21,10 @@
.source __FILE__
fileno_unlocked:
.leafprologue
.profilable # so we can fix code supporting this abomination
push %rbp
mov %rsp,%rbp
.profilable # note: no consensus for threads exists in abis
call fileno
.leafepilogue
pop %rbp
ret
.endfn fileno_unlocked,globl

View file

@ -21,8 +21,10 @@
.source __FILE__
fputc_unlocked:
.leafprologue
.profilable # so we can fix code supporting this abomination
push %rbp
mov %rsp,%rbp
.profilable # note: no consensus for threads exists in abis
call fputc
.leafepilogue
pop %rbp
ret
.endfn fputc_unlocked,globl

View file

@ -21,8 +21,10 @@
.source __FILE__
fputs_unlocked:
.leafprologue
.profilable # so we can fix code supporting this abomination
push %rbp
mov %rsp,%rbp
.profilable # note: no consensus for threads exists in abis
call fputs
.leafepilogue
pop %rbp
ret
.endfn fputs_unlocked,globl

View file

@ -21,8 +21,10 @@
.source __FILE__
fputwc_unlocked:
.leafprologue
.profilable # so we can fix code supporting this abomination
push %rbp
mov %rsp,%rbp
.profilable # note: no consensus for threads exists in abis
call fputwc
.leafepilogue
pop %rbp
ret
.endfn fputwc_unlocked,globl

View file

@ -21,8 +21,10 @@
.source __FILE__
fputws_unlocked:
.leafprologue
.profilable # so we can fix code supporting this abomination
push %rbp
mov %rsp,%rbp
.profilable # note: no consensus for threads exists in abis
call fputws
.leafepilogue
pop %rbp
ret
.endfn fputws_unlocked,globl

View file

@ -21,8 +21,10 @@
.source __FILE__
fread_unlocked:
.leafprologue
.profilable # so we can fix code supporting this abomination
push %rbp
mov %rsp,%rbp
.profilable # note: no consensus for threads exists in abis
call fread
.leafepilogue
pop %rbp
ret
.endfn fread_unlocked,globl

View file

@ -21,8 +21,10 @@
.source __FILE__
fwrite_unlocked:
.leafprologue
.profilable # so we can fix code supporting this abomination
push %rbp
mov %rsp,%rbp
.profilable # note: no consensus for threads exists in abis
call fwrite
.leafepilogue
pop %rbp
ret
.endfn fwrite_unlocked,globl

View file

@ -21,8 +21,10 @@
.source __FILE__
getc_unlocked:
.leafprologue
.profilable # so we can fix code supporting this abomination
push %rbp
mov %rsp,%rbp
.profilable # note: no consensus for threads exists in abis
call getc
.leafepilogue
pop %rbp
ret
.endfn getc_unlocked,globl

View file

@ -21,8 +21,10 @@
.source __FILE__
getchar_unlocked:
.leafprologue
.profilable # so we can fix code supporting this abomination
push %rbp
mov %rsp,%rbp
.profilable # note: no consensus for threads exists in abis
call getchar
.leafepilogue
pop %rbp
ret
.endfn getchar_unlocked,globl

View file

@ -21,8 +21,10 @@
.source __FILE__
getwc_unlocked:
.leafprologue
.profilable # so we can fix code supporting this abomination
push %rbp
mov %rsp,%rbp
.profilable # note: no consensus for threads exists in abis
call fgetwc_unlocked
.leafepilogue
pop %rbp
ret
.endfn getwc_unlocked,globl

View file

@ -21,8 +21,10 @@
.source __FILE__
getwchar_unlocked:
.leafprologue
.profilable # so we can fix code supporting this abomination
push %rbp
mov %rsp,%rbp
.profilable # note: no consensus for threads exists in abis
call getwchar
.leafepilogue
pop %rbp
ret
.endfn getwchar_unlocked,globl

View file

@ -21,8 +21,10 @@
.source __FILE__
putc_unlocked:
.leafprologue
.profilable # so we can fix code supporting this abomination
push %rbp
mov %rsp,%rbp
.profilable # note: no consensus for threads exists in abis
call putc
.leafepilogue
pop %rbp
ret
.endfn putc_unlocked,globl

View file

@ -21,8 +21,10 @@
.source __FILE__
putchar_unlocked:
.leafprologue
.profilable # so we can fix code supporting this abomination
push %rbp
mov %rsp,%rbp
.profilable # note: no consensus for threads exists in abis
call putchar
.leafepilogue
pop %rbp
ret
.endfn putchar_unlocked,globl

View file

@ -21,8 +21,10 @@
.source __FILE__
putwc_unlocked:
.leafprologue
.profilable # so we can fix code supporting this abomination
push %rbp
mov %rsp,%rbp
.profilable # note: no consensus for threads exists in abis
call fputwc_unlocked
.leafepilogue
pop %rbp
ret
.endfn putwc_unlocked,globl

View file

@ -22,8 +22,10 @@
.source __FILE__
putwchar_unlocked:
.leafprologue
.profilable # so we can fix code supporting this abomination
push %rbp
mov %rsp,%rbp
.profilable # note: no consensus for threads exists in abis
call putwchar
.leafepilogue
pop %rbp
ret
.endfn putwchar_unlocked,globl