#include <printf.h>
#include <stdint.h>
#include <stddef.h>
#include <string.h>
#include <wchar.h>
struct printf_spec
{
struct printf_info info;
const UCHAR_T *end_of_fmt, *next_fmt;
int prec_arg, width_arg;
int data_arg;
int data_arg_type;
size_t ndata_args;
int size;
};
union printf_arg
{
wchar_t pa_wchar;
int pa_int;
long int pa_long_int;
long long int pa_long_long_int;
unsigned int pa_u_int;
unsigned long int pa_u_long_int;
unsigned long long int pa_u_long_long_int;
double pa_double;
long double pa_long_double;
const char *pa_string;
const wchar_t *pa_wstring;
void *pa_pointer;
void *pa_user;
};
#ifndef DONT_NEED_READ_INT
static int
read_int (const UCHAR_T * *pstr)
{
int retval = **pstr - L_('0');
while (ISDIGIT (*++(*pstr)))
if (retval >= 0)
{
if (INT_MAX / 10 < retval)
retval = -1;
else
{
int digit = **pstr - L_('0');
retval *= 10;
if (INT_MAX - digit < retval)
retval = -1;
else
retval += digit;
}
}
return retval;
}
#endif
extern printf_arginfo_size_function **__printf_arginfo_table attribute_hidden;
extern printf_function **__printf_function_table attribute_hidden;
extern printf_va_arg_function **__printf_va_arg_table attribute_hidden;
static __inline const unsigned char *
__find_specmb (const unsigned char *format)
{
return (const unsigned char *) __strchrnul ((const char *) format, '%');
}
static __inline const unsigned int *
__find_specwc (const unsigned int *format)
{
return (const unsigned int *) __wcschrnul ((const wchar_t *) format, L'%');
}
extern size_t __parse_one_specmb (const unsigned char *format, size_t posn,
struct printf_spec *spec,
size_t *max_ref_arg) attribute_hidden;
extern size_t __parse_one_specwc (const unsigned int *format, size_t posn,
struct printf_spec *spec,
size_t *max_ref_arg) attribute_hidden;
struct printf_modifier_record;
extern struct printf_modifier_record **__printf_modifier_table
attribute_hidden;
extern int __handle_registered_modifier_mb (const unsigned char **format,
struct printf_info *info)
attribute_hidden;
extern int __handle_registered_modifier_wc (const unsigned int **format,
struct printf_info *info)
attribute_hidden;