1 /* Decomposed printf argument list.
2 Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or modify it
5 under the terms of the GNU Library General Public License as published
6 by the Free Software Foundation; either version 2, or (at your option)
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
24 #include "printf-args.h"
30 printf_fetchargs (va_list args, arguments *a)
35 for (i = 0, ap = &a->arg[0]; i < a->count; i++, ap++)
39 ap->a.a_schar = va_arg (args, /*signed char*/ int);
42 ap->a.a_uchar = va_arg (args, /*unsigned char*/ int);
45 ap->a.a_short = va_arg (args, /*short*/ int);
48 ap->a.a_ushort = va_arg (args, /*unsigned short*/ int);
51 ap->a.a_int = va_arg (args, int);
54 ap->a.a_uint = va_arg (args, unsigned int);
57 ap->a.a_longint = va_arg (args, long int);
60 ap->a.a_ulongint = va_arg (args, unsigned long int);
63 case TYPE_LONGLONGINT:
64 ap->a.a_longlongint = va_arg (args, long long int);
66 case TYPE_ULONGLONGINT:
67 ap->a.a_ulonglongint = va_arg (args, unsigned long long int);
71 ap->a.a_double = va_arg (args, double);
73 #ifdef HAVE_LONG_DOUBLE
75 ap->a.a_longdouble = va_arg (args, long double);
79 ap->a.a_char = va_arg (args, int);
83 ap->a.a_wide_char = va_arg (args, wint_t);
87 ap->a.a_string = va_arg (args, const char *);
90 case TYPE_WIDE_STRING:
91 ap->a.a_wide_string = va_arg (args, const wchar_t *);
95 ap->a.a_pointer = va_arg (args, void *);
97 case TYPE_COUNT_SCHAR_POINTER:
98 ap->a.a_count_schar_pointer = va_arg (args, signed char *);
100 case TYPE_COUNT_SHORT_POINTER:
101 ap->a.a_count_short_pointer = va_arg (args, short *);
103 case TYPE_COUNT_INT_POINTER:
104 ap->a.a_count_int_pointer = va_arg (args, int *);
106 case TYPE_COUNT_LONGINT_POINTER:
107 ap->a.a_count_longint_pointer = va_arg (args, long int *);
109 #ifdef HAVE_LONG_LONG
110 case TYPE_COUNT_LONGLONGINT_POINTER:
111 ap->a.a_count_longlongint_pointer = va_arg (args, long long int *);