1/* Format checking tests: common header.  */
2/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
3
4#include <stdarg.h>
5#include <stddef.h>
6
7#ifndef _WINT_T
8#ifndef __WINT_TYPE__
9#define __WINT_TYPE__ unsigned int
10#endif
11typedef __WINT_TYPE__ wint_t;
12#endif
13
14/* Kludges to get types corresponding to size_t and ptrdiff_t.  */
15#define unsigned signed
16typedef __SIZE_TYPE__ signed_size_t;
17/* We also use this type to approximate ssize_t.  */
18typedef __SIZE_TYPE__ ssize_t;
19#undef unsigned
20#define signed /* Type might or might not have explicit 'signed'.  */
21typedef unsigned __PTRDIFF_TYPE__ unsigned_ptrdiff_t;
22#undef signed
23
24__extension__ typedef long long int llong;
25__extension__ typedef unsigned long long int ullong;
26
27/* %q formats want a "quad"; GCC considers this to be a long long.  */
28typedef llong quad_t;
29typedef ullong u_quad_t;
30
31__extension__ typedef __INTMAX_TYPE__ intmax_t;
32__extension__ typedef __UINTMAX_TYPE__ uintmax_t;
33
34#if __STDC_VERSION__ < 199901L && !defined(restrict)
35#define restrict /* "restrict" not in old C standard.  */
36#endif
37
38/* This may not be correct in the particular case, but allows the
39   prototypes to be declared, and we don't try to link.
40*/
41typedef struct _FILE FILE;
42extern FILE *stdin;
43extern FILE *stdout;
44
45extern int fprintf (FILE *restrict, const char *restrict, ...);
46extern int printf (const char *restrict, ...);
47extern int fprintf_unlocked (FILE *restrict, const char *restrict, ...);
48extern int printf_unlocked (const char *restrict, ...);
49extern int sprintf (char *restrict, const char *restrict, ...);
50extern int vfprintf (FILE *restrict, const char *restrict, va_list);
51extern int vprintf (const char *restrict, va_list);
52extern int vsprintf (char *restrict, const char *restrict, va_list);
53extern int snprintf (char *restrict, size_t, const char *restrict, ...);
54extern int vsnprintf (char *restrict, size_t, const char *restrict, va_list);
55
56extern int fscanf (FILE *restrict, const char *restrict, ...);
57extern int scanf (const char *restrict, ...);
58extern int sscanf (const char *restrict, const char *restrict, ...);
59extern int vfscanf (FILE *restrict, const char *restrict, va_list);
60extern int vscanf (const char *restrict, va_list);
61extern int vsscanf (const char *restrict, const char *restrict, va_list);
62
63extern char *gettext (const char *);
64extern char *dgettext (const char *, const char *);
65extern char *dcgettext (const char *, const char *, int);
66
67struct tm;
68
69extern size_t strftime (char *restrict, size_t, const char *restrict,
70			const struct tm *restrict);
71
72extern ssize_t strfmon (char *restrict, size_t, const char *restrict, ...);
73