blob: 5b1677d6cac3275c1432a038e5be5302eb2051a4 [file] [log] [blame]
Elliott Hughes13da6002025-02-03 10:42:13 -08001// Copyright (C) 2017 The Android Open Source Project
2// SPDX-License-Identifier: BSD-2-Clause
Elliott Hughes21b56eb2017-10-20 17:57:17 -07003
4#include <stdio.h>
5
6#include "header_checks.h"
7
8static void stdio_h() {
9 TYPE(FILE*);
10 TYPE(fpos_t);
11 TYPE(off_t);
12 TYPE(size_t);
13 TYPE(ssize_t);
14 TYPE(va_list);
15
16 MACRO(BUFSIZ);
17 MACRO(L_ctermid);
18 MACRO(L_tmpnam);
19
20 MACRO(_IOFBF);
21 MACRO(_IOLBF);
22 MACRO(_IONBF);
23
24 MACRO(SEEK_CUR);
25 MACRO(SEEK_END);
26 MACRO(SEEK_SET);
27
28 MACRO(FILENAME_MAX);
29 MACRO(FOPEN_MAX);
30 MACRO(TMP_MAX);
31
32 MACRO(EOF);
33
34 MACRO(NULL);
35
36 const char* s;
37 s = P_tmpdir;
38
39#if !defined(stderr)
40#error stderr
41#endif
42#if !defined(stdin)
43#error stdin
44#endif
45#if !defined(stdout)
46#error stdout
47#endif
48 FILE* fp;
49 fp = stderr;
50 fp = stdin;
51 fp = stdout;
52
53 FUNCTION(clearerr, void (*f)(FILE*));
54 FUNCTION(ctermid, char* (*f)(char*));
55 FUNCTION(dprintf, int (*f)(int, const char*, ...));
56 FUNCTION(fclose, int (*f)(FILE*));
57 FUNCTION(fdopen, FILE* (*f)(int, const char*));
58 FUNCTION(feof, int (*f)(FILE*));
59 FUNCTION(ferror, int (*f)(FILE*));
60 FUNCTION(fflush, int (*f)(FILE*));
61 FUNCTION(fgetc, int (*f)(FILE*));
62 FUNCTION(fgetpos, int (*f)(FILE*, fpos_t*));
63 FUNCTION(fgets, char* (*f)(char*, int, FILE*));
64 FUNCTION(fileno, int (*f)(FILE*));
65 FUNCTION(flockfile, void (*f)(FILE*));
66 FUNCTION(fmemopen, FILE* (*f)(void*, size_t, const char*));
67 FUNCTION(fopen, FILE* (*f)(const char*, const char*));
68 FUNCTION(fprintf, int (*f)(FILE*, const char*, ...));
69 FUNCTION(fputc, int (*f)(int, FILE*));
70 FUNCTION(fputs, int (*f)(const char*, FILE*));
71 FUNCTION(fread, size_t (*f)(void*, size_t, size_t, FILE*));
72 FUNCTION(freopen, FILE* (*f)(const char*, const char*, FILE*));
73 FUNCTION(fscanf, int (*f)(FILE*, const char*, ...));
74 FUNCTION(fseek, int (*f)(FILE*, long, int));
75 FUNCTION(fseeko, int (*f)(FILE*, off_t, int));
76 FUNCTION(fsetpos, int (*f)(FILE*, const fpos_t*));
77 FUNCTION(ftell, long (*f)(FILE*));
78 FUNCTION(ftello, off_t (*f)(FILE*));
79 FUNCTION(ftrylockfile, int (*f)(FILE*));
80 FUNCTION(funlockfile, void (*f)(FILE*));
81 FUNCTION(fwrite, size_t (*f)(const void*, size_t, size_t, FILE*));
82 FUNCTION(getc, int (*f)(FILE*));
83 FUNCTION(getchar, int (*f)(void));
84 FUNCTION(getc_unlocked, int (*f)(FILE*));
85 FUNCTION(getchar_unlocked, int (*f)(void));
86 FUNCTION(getdelim, ssize_t (*f)(char**, size_t*, int, FILE*));
87 FUNCTION(getline, ssize_t (*f)(char**, size_t*, FILE*));
Elliott Hughes10630392022-03-30 17:25:10 -070088 // gets() was removed in C11.
89 // FUNCTION(gets, char* (*f)(char*));
Elliott Hughes21b56eb2017-10-20 17:57:17 -070090 FUNCTION(open_memstream, FILE* (*f)(char**, size_t*));
91 FUNCTION(pclose, int (*f)(FILE*));
92 FUNCTION(perror, void (*f)(const char*));
93 FUNCTION(popen, FILE* (*f)(const char*, const char*));
94 FUNCTION(printf, int (*f)(const char*, ...));
95 FUNCTION(putc, int (*f)(int, FILE*));
96 FUNCTION(putchar, int (*f)(int));
97 FUNCTION(putc_unlocked, int (*f)(int, FILE*));
98 FUNCTION(putchar_unlocked, int (*f)(int));
99 FUNCTION(puts, int (*f)(const char*));
100 FUNCTION(remove, int (*f)(const char*));
101 FUNCTION(rename, int (*f)(const char*, const char*));
102 FUNCTION(renameat, int (*f)(int, const char*, int, const char*));
103 FUNCTION(rewind, void (*f)(FILE*));
104 FUNCTION(scanf, int (*f)(const char*, ...));
105 FUNCTION(setbuf, void (*f)(FILE*, char*));
106 FUNCTION(setvbuf, int (*f)(FILE*, char*, int, size_t));
107 FUNCTION(snprintf, int (*f)(char*, size_t, const char*, ...));
108 FUNCTION(sprintf, int (*f)(char*, const char*, ...));
109 FUNCTION(sscanf, int (*f)(const char*, const char*, ...));
110 FUNCTION(tempnam, char* (*f)(const char*, const char*));
111 FUNCTION(tmpfile, FILE* (*f)(void));
112 FUNCTION(tmpnam, char* (*f)(char*));
113 FUNCTION(ungetc, int (*f)(int, FILE*));
114 FUNCTION(vdprintf, int (*f)(int, const char*, va_list));
115 FUNCTION(vfprintf, int (*f)(FILE*, const char*, va_list));
116 FUNCTION(vfscanf, int (*f)(FILE*, const char*, va_list));
117 FUNCTION(vprintf, int (*f)(const char*, va_list));
118 FUNCTION(vscanf, int (*f)(const char*, va_list));
119 FUNCTION(vsnprintf, int (*f)(char*, size_t, const char*, va_list));
120 FUNCTION(vsprintf, int (*f)(char*, const char*, va_list));
121 FUNCTION(vsscanf, int (*f)(const char*, const char*, va_list));
122}