scanf: support reading hex numbers with %x
[neatlibc.git] / stdio.h
blobc069c24dec8f599a65f37ef530ce9d3005be9b3b
1 #include <stdarg.h>
3 #define EOF (-1)
4 #define putc(c, fp) (fputc(c, fp))
5 #define getc(fp) (fgetc(fp))
7 typedef struct {
8 int fd;
9 int back; /* pushback buffer */
10 char *ibuf, *obuf; /* input/output buffer */
11 int isize, osize; /* ibuf size */
12 int ilen, olen; /* length of data in buf */
13 int iown, oown; /* free the buffer when finished */
14 int icur; /* current position in ibuf */
15 int ostat;
16 } FILE;
18 extern FILE *stdin;
19 extern FILE *stdout;
20 extern FILE *stderr;
22 FILE *fopen(char *path, char *mode);
23 int fclose(FILE *fp);
24 int fflush(FILE *fp);
25 void setbuf(FILE *fp, char *buf);
27 int fputc(int c, FILE *fp);
28 int putchar(int c);
29 int printf(char *fmt, ...);
30 int vprintf(char *fmt, va_list ap);
31 int fprintf(FILE *fp, char *fmt, ...);
32 int sprintf(char *dst, char *fmt, ...);
33 int vsprintf(char *dst, char *fmt, va_list ap);
34 int vfprintf(FILE *fp, char *fmt, va_list ap);
35 int snprintf(char *dst, int sz, char *fmt, ...);
36 int vsnprintf(char *dst, int sz, char *fmt, va_list ap);
37 int fputs(char *s, FILE *fp);
38 int puts(char *s);
40 int fgetc(FILE *fp);
41 char *fgets(char *s, int sz, FILE *fp);
42 int scanf(char *fmt, ...);
43 int fscanf(FILE *fp, char *fmt, ...);
44 int sscanf(char *s, char *fmt, ...);
45 int vsscanf(char *s, char *fmt, va_list ap);
46 int vfscanf(FILE *fp, char *fmt, va_list ap);
47 int getchar(void);
48 int ungetc(int c, FILE *fp);
49 long fwrite(void *s, long sz, long n, FILE *fp);
50 long fread(void *s, long sz, long n, FILE *fp);
52 void perror(char *s);