Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _PRINTF_ARGS_H
00022 #define _PRINTF_ARGS_H
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef PRINTF_FETCHARGS
00031 # define PRINTF_FETCHARGS printf_fetchargs
00032 #endif
00033
00034
00035 #include <stddef.h>
00036
00037
00038 #if HAVE_WCHAR_T
00039 # include <stddef.h>
00040 #endif
00041
00042
00043 #if HAVE_WINT_T
00044 # include <wchar.h>
00045 #endif
00046
00047
00048 #include <stdarg.h>
00049
00050
00051
00052 typedef enum
00053 {
00054 TYPE_NONE,
00055 TYPE_SCHAR,
00056 TYPE_UCHAR,
00057 TYPE_SHORT,
00058 TYPE_USHORT,
00059 TYPE_INT,
00060 TYPE_UINT,
00061 TYPE_LONGINT,
00062 TYPE_ULONGINT,
00063 #if HAVE_LONG_LONG_INT
00064 TYPE_LONGLONGINT,
00065 TYPE_ULONGLONGINT,
00066 #endif
00067 TYPE_DOUBLE,
00068 TYPE_LONGDOUBLE,
00069 TYPE_CHAR,
00070 #if HAVE_WINT_T
00071 TYPE_WIDE_CHAR,
00072 #endif
00073 TYPE_STRING,
00074 #if HAVE_WCHAR_T
00075 TYPE_WIDE_STRING,
00076 #endif
00077 TYPE_POINTER,
00078 TYPE_COUNT_SCHAR_POINTER,
00079 TYPE_COUNT_SHORT_POINTER,
00080 TYPE_COUNT_INT_POINTER,
00081 TYPE_COUNT_LONGINT_POINTER
00082 #if HAVE_LONG_LONG_INT
00083 , TYPE_COUNT_LONGLONGINT_POINTER
00084 #endif
00085 #if ENABLE_UNISTDIO
00086
00087 , TYPE_U8_STRING
00088 , TYPE_U16_STRING
00089 , TYPE_U32_STRING
00090 #endif
00091 } arg_type;
00092
00093
00094 typedef struct
00095 {
00096 arg_type type;
00097 union
00098 {
00099 signed char a_schar;
00100 unsigned char a_uchar;
00101 short a_short;
00102 unsigned short a_ushort;
00103 int a_int;
00104 unsigned int a_uint;
00105 long int a_longint;
00106 unsigned long int a_ulongint;
00107 #if HAVE_LONG_LONG_INT
00108 long long int a_longlongint;
00109 unsigned long long int a_ulonglongint;
00110 #endif
00111 float a_float;
00112 double a_double;
00113 long double a_longdouble;
00114 int a_char;
00115 #if HAVE_WINT_T
00116 wint_t a_wide_char;
00117 #endif
00118 const char* a_string;
00119 #if HAVE_WCHAR_T
00120 const wchar_t* a_wide_string;
00121 #endif
00122 void* a_pointer;
00123 signed char * a_count_schar_pointer;
00124 short * a_count_short_pointer;
00125 int * a_count_int_pointer;
00126 long int * a_count_longint_pointer;
00127 #if HAVE_LONG_LONG_INT
00128 long long int * a_count_longlongint_pointer;
00129 #endif
00130 #if ENABLE_UNISTDIO
00131
00132 const uint8_t * a_u8_string;
00133 const uint16_t * a_u16_string;
00134 const uint32_t * a_u32_string;
00135 #endif
00136 }
00137 a;
00138 }
00139 argument;
00140
00141
00142 #define N_DIRECT_ALLOC_ARGUMENTS 7
00143
00144 typedef struct
00145 {
00146 size_t count;
00147 argument *arg;
00148 argument direct_alloc_arg[N_DIRECT_ALLOC_ARGUMENTS];
00149 }
00150 arguments;
00151
00152
00153
00154 #ifdef STATIC
00155 STATIC
00156 #else
00157 extern
00158 #endif
00159 int PRINTF_FETCHARGS (va_list args, arguments *a);
00160
00161 #endif