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