]> git.cworth.org Git - tar/blob - gnu/printf-args.h
upstream: Fix extraction of device nodes.
[tar] / gnu / printf-args.h
1 /* -*- buffer-read-only: t -*- vi: set ro: */
2 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3 /* Decomposed printf argument list.
4    Copyright (C) 1999, 2002-2003, 2006-2007, 2009-2010 Free Software
5    Foundation, Inc.
6
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 3, or (at your option)
10    any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License along
18    with this program; if not, write to the Free Software Foundation,
19    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
20
21 #ifndef _PRINTF_ARGS_H
22 #define _PRINTF_ARGS_H
23
24 /* This file can be parametrized with the following macros:
25      ENABLE_UNISTDIO    Set to 1 to enable the unistdio extensions.
26      PRINTF_FETCHARGS   Name of the function to be declared.
27      STATIC             Set to 'static' to declare the function static.  */
28
29 /* Default parameters.  */
30 #ifndef PRINTF_FETCHARGS
31 # define PRINTF_FETCHARGS printf_fetchargs
32 #endif
33
34 /* Get size_t.  */
35 #include <stddef.h>
36
37 /* Get wchar_t.  */
38 #if HAVE_WCHAR_T
39 # include <stddef.h>
40 #endif
41
42 /* Get wint_t.  */
43 #if HAVE_WINT_T
44 # include <wchar.h>
45 #endif
46
47 /* Get va_list.  */
48 #include <stdarg.h>
49
50
51 /* Argument types */
52 typedef enum
53 {
54   TYPE_NONE,
55   TYPE_SCHAR,
56   TYPE_UCHAR,
57   TYPE_SHORT,
58   TYPE_USHORT,
59   TYPE_INT,
60   TYPE_UINT,
61   TYPE_LONGINT,
62   TYPE_ULONGINT,
63 #if HAVE_LONG_LONG_INT
64   TYPE_LONGLONGINT,
65   TYPE_ULONGLONGINT,
66 #endif
67   TYPE_DOUBLE,
68   TYPE_LONGDOUBLE,
69   TYPE_CHAR,
70 #if HAVE_WINT_T
71   TYPE_WIDE_CHAR,
72 #endif
73   TYPE_STRING,
74 #if HAVE_WCHAR_T
75   TYPE_WIDE_STRING,
76 #endif
77   TYPE_POINTER,
78   TYPE_COUNT_SCHAR_POINTER,
79   TYPE_COUNT_SHORT_POINTER,
80   TYPE_COUNT_INT_POINTER,
81   TYPE_COUNT_LONGINT_POINTER
82 #if HAVE_LONG_LONG_INT
83 , TYPE_COUNT_LONGLONGINT_POINTER
84 #endif
85 #if ENABLE_UNISTDIO
86   /* The unistdio extensions.  */
87 , TYPE_U8_STRING
88 , TYPE_U16_STRING
89 , TYPE_U32_STRING
90 #endif
91 } arg_type;
92
93 /* Polymorphic argument */
94 typedef struct
95 {
96   arg_type type;
97   union
98   {
99     signed char                 a_schar;
100     unsigned char               a_uchar;
101     short                       a_short;
102     unsigned short              a_ushort;
103     int                         a_int;
104     unsigned int                a_uint;
105     long int                    a_longint;
106     unsigned long int           a_ulongint;
107 #if HAVE_LONG_LONG_INT
108     long long int               a_longlongint;
109     unsigned long long int      a_ulonglongint;
110 #endif
111     float                       a_float;
112     double                      a_double;
113     long double                 a_longdouble;
114     int                         a_char;
115 #if HAVE_WINT_T
116     wint_t                      a_wide_char;
117 #endif
118     const char*                 a_string;
119 #if HAVE_WCHAR_T
120     const wchar_t*              a_wide_string;
121 #endif
122     void*                       a_pointer;
123     signed char *               a_count_schar_pointer;
124     short *                     a_count_short_pointer;
125     int *                       a_count_int_pointer;
126     long int *                  a_count_longint_pointer;
127 #if HAVE_LONG_LONG_INT
128     long long int *             a_count_longlongint_pointer;
129 #endif
130 #if ENABLE_UNISTDIO
131     /* The unistdio extensions.  */
132     const uint8_t *             a_u8_string;
133     const uint16_t *            a_u16_string;
134     const uint32_t *            a_u32_string;
135 #endif
136   }
137   a;
138 }
139 argument;
140
141 typedef struct
142 {
143   size_t count;
144   argument *arg;
145 }
146 arguments;
147
148
149 /* Fetch the arguments, putting them into a. */
150 #ifdef STATIC
151 STATIC
152 #else
153 extern
154 #endif
155 int PRINTF_FETCHARGS (va_list args, arguments *a);
156
157 #endif /* _PRINTF_ARGS_H */