Rev 41539 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
/* Decomposed printf argument list.Copyright (C) 1999, 2002-2003, 2006 Free Software Foundation, Inc.This program is free software; you can redistribute it and/or modify itunder the terms of the GNU Library General Public License as publishedby the Free Software Foundation; either version 2, or (at your option)any later version.This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNULibrary General Public License for more details.You should have received a copy of the GNU Library General PublicLicense along with this program; if not, write to the Free SoftwareFoundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,USA. */#ifndef _PRINTF_ARGS_H#define _PRINTF_ARGS_H/* Get size_t. */#include <stddef.h>/* Get wchar_t. */#ifdef HAVE_WCHAR_T# include <stddef.h>#endif/* Get wint_t. */#ifdef HAVE_WINT_T# include <wchar.h>#endif/* Get va_list. */#include <stdarg.h>/* Argument types */typedef enum{TYPE_NONE,TYPE_SCHAR,TYPE_UCHAR,TYPE_SHORT,TYPE_USHORT,TYPE_INT,TYPE_UINT,TYPE_LONGINT,TYPE_ULONGINT,#ifdef HAVE_LONG_LONG_INTTYPE_LONGLONGINT,TYPE_ULONGLONGINT,#endifTYPE_DOUBLE,#ifdef HAVE_LONG_DOUBLETYPE_LONGDOUBLE,#endifTYPE_CHAR,#ifdef HAVE_WINT_TTYPE_WIDE_CHAR,#endifTYPE_STRING,#ifdef HAVE_WCHAR_TTYPE_WIDE_STRING,#endifTYPE_POINTER,TYPE_COUNT_SCHAR_POINTER,TYPE_COUNT_SHORT_POINTER,TYPE_COUNT_INT_POINTER,TYPE_COUNT_LONGINT_POINTER#ifdef HAVE_LONG_LONG_INT, TYPE_COUNT_LONGLONGINT_POINTER#endif} arg_type;/* Polymorphic argument */typedef struct{arg_type type;union{signed char a_schar;unsigned char a_uchar;short a_short;unsigned short a_ushort;int a_int;unsigned int a_uint;long int a_longint;unsigned long int a_ulongint;#ifdef HAVE_LONG_LONG_INTlong long int a_longlongint;unsigned long long int a_ulonglongint;#endiffloat a_float;double a_double;#ifdef HAVE_LONG_DOUBLElong double a_longdouble;#endifint a_char;#ifdef HAVE_WINT_Twint_t a_wide_char;#endifconst char* a_string;#ifdef HAVE_WCHAR_Tconst wchar_t* a_wide_string;#endifvoid* a_pointer;signed char * a_count_schar_pointer;short * a_count_short_pointer;int * a_count_int_pointer;long int * a_count_longint_pointer;#ifdef HAVE_LONG_LONG_INTlong long int * a_count_longlongint_pointer;#endif}a;}argument;typedef struct{size_t count;argument *arg;}arguments;/* Fetch the arguments, putting them into a. */#ifdef STATICSTATIC#elseextern#endifint printf_fetchargs (va_list args, arguments *a);#endif /* _PRINTF_ARGS_H */