1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-30 22:43:12 +03:00

* stdio-common/printf-parse.h: Include string.h and wchar.h.

(__find_specwc): Change into __extern_always_inline function.
	(__find_specmb): Likewise.  Remove ps argument.  Use __strchrnul.
	(__parse_one_specmb): Remove ps argument.
	* stdio-common/vfprintf.c (vfprintf): Remove mbstate variable.
	Adjust __find_specmb and __parse_one_specmb callers.
	* stdio-common/printf-prs.c (parse_printf_format): Likewise.
	* stdio-common/printf-parsemb.c (__find_specwc, __find_specmb):
	Removed.
	(__parse_one_specmb): Remove ps argument, adjust __find_specmb
	caller.
This commit is contained in:
Ulrich Drepper
2007-10-10 20:14:12 +00:00
parent 59d430c680
commit c06b7169e4
5 changed files with 38 additions and 56 deletions

View File

@ -1,5 +1,6 @@
/* Internal header for parsing printf format strings.
Copyright (C) 1995-1999, 2000, 2002, 2003 Free Software Foundation, Inc.
Copyright (C) 1995-1999, 2000, 2002, 2003, 2007
Free Software Foundation, Inc.
This file is part of th GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@ -20,6 +21,8 @@
#include <printf.h>
#include <stdint.h>
#include <stddef.h>
#include <string.h>
#include <wchar.h>
struct printf_spec
@ -86,11 +89,17 @@ extern printf_function **__printf_function_table attribute_hidden;
/* Find the next spec in FORMAT, or the end of the string. Returns
a pointer into FORMAT, to a '%' or a '\0'. */
extern const unsigned char *__find_specmb (const UCHAR_T *format,
mbstate_t *ps) attribute_hidden;
__extern_always_inline const unsigned char *
__find_specmb (const unsigned char *format)
{
return (const unsigned char *) __strchrnul ((const char *) format, '%');
}
extern const unsigned int *__find_specwc (const UCHAR_T *format)
attribute_hidden;
__extern_always_inline const unsigned int *
__find_specwc (const unsigned int *format)
{
return (const unsigned int *) __wcschrnul ((const wchar_t *) format, L'%');
}
/* FORMAT must point to a '%' at the beginning of a spec. Fills in *SPEC
@ -100,8 +109,7 @@ extern const unsigned int *__find_specwc (const UCHAR_T *format)
remains the highest argument index used. */
extern size_t __parse_one_specmb (const unsigned char *format, size_t posn,
struct printf_spec *spec,
size_t *max_ref_arg, mbstate_t *ps)
attribute_hidden;
size_t *max_ref_arg) attribute_hidden;
extern size_t __parse_one_specwc (const unsigned int *format, size_t posn,
struct printf_spec *spec,