diff options
author | Ulrich Drepper <drepper@redhat.com> | 2009-04-11 05:34:20 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2009-04-11 05:34:20 +0000 |
commit | 9d26efa90c6dcbcd6b3e586c9927b6058ef4d529 (patch) | |
tree | fc306e24bf4b956abba8782e78d4118639c46361 /stdio-common/printf-parse.h | |
parent | f140a0d53d639c86408ac532091fb4644faa95c0 (diff) | |
download | glibc-9d26efa90c6dcbcd6b3e586c9927b6058ef4d529.zip glibc-9d26efa90c6dcbcd6b3e586c9927b6058ef4d529.tar.gz glibc-9d26efa90c6dcbcd6b3e586c9927b6058ef4d529.tar.bz2 |
* stdio-common/printf.h (struct printf_info): Add user element.
New types printf_arginfo_size_function, printf_va_arg_function.
Declare register_printf_specifier, register_printf_modifier,
register_printf_type.
* stdio-common/printf-parse.h (struct printf_spec): Add size element.
(union printf_arg): Add pa_user element.
Adjust __printf_arginfo_table type.
Add __printf_va_arg_table, __printf_modifier_table,
__handle_registered_modifier_mb, and __handle_registered_modifier_wc
declarations.
* stdio-common/printf-parsemb.c: Recognize registered modifiers.
If registered arginfo call failed try normal specifier.
* stdio-common/printf-prs.c: Pass additional parameter to arginfo
function.
* stdio-common/Makefile (routines): Add reg-modifier and reg-type.
* stdio-common/Versions: Export register_printf_modifier,
register_printf_type, and register_printf_specifier for GLIBC_2.10.
* stdio-common/reg-modifier.c: New file.
* stdio-common/reg-type.c: New file.
* stdio-common/reg-printf.c (__register_printf_specifier): New
function. Mostly the old __register_printf_function function but
uses locking and type of third parameter changed.
(__register_printf_function): Implement using
__register_printf_specifier.
* stdio-common/vfprintf.c (vfprintf): Collect argument sizes in
calls to arginfo functions. Allocate enough memory for user-defined
types. Call new va_arg functions to get user-defined types.
Try installed handlers even for existing format specifiers first.
Diffstat (limited to 'stdio-common/printf-parse.h')
-rw-r--r-- | stdio-common/printf-parse.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/stdio-common/printf-parse.h b/stdio-common/printf-parse.h index f6ad71c..555ad78 100644 --- a/stdio-common/printf-parse.h +++ b/stdio-common/printf-parse.h @@ -1,5 +1,5 @@ /* Internal header for parsing printf format strings. - Copyright (C) 1995-1999, 2000, 2002, 2003, 2007 + Copyright (C) 1995-1999, 2000, 2002, 2003, 2007, 2009 Free Software Foundation, Inc. This file is part of th GNU C Library. @@ -42,6 +42,8 @@ struct printf_spec int data_arg_type; /* Type of first argument. */ /* Number of arguments consumed by this format specifier. */ size_t ndata_args; + /* Size of the parameter for PA_USER type. */ + int size; }; @@ -60,6 +62,7 @@ union printf_arg const char *pa_string; const wchar_t *pa_wstring; void *pa_pointer; + void *pa_user; }; @@ -83,8 +86,9 @@ read_int (const UCHAR_T * *pstr) /* These are defined in reg-printf.c. */ -extern printf_arginfo_function **__printf_arginfo_table attribute_hidden; +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; /* Find the next spec in FORMAT, or the end of the string. Returns @@ -114,3 +118,18 @@ extern size_t __parse_one_specmb (const unsigned char *format, size_t posn, extern size_t __parse_one_specwc (const unsigned int *format, size_t posn, struct printf_spec *spec, size_t *max_ref_arg) attribute_hidden; + + + +/* This variable is defined in reg-modifier.c. */ +struct printf_modifier_record; +extern struct printf_modifier_record **__printf_modifier_table + attribute_hidden; + +/* Handle registered modifiers. */ +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; |