about summary refs log tree commit diff
path: root/stdio-common/printf-parse.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-10-10 20:14:12 +0000
committerUlrich Drepper <drepper@redhat.com>2007-10-10 20:14:12 +0000
commitc06b7169e41740e4be335ca3f6221bc7d60464c7 (patch)
treefa5b4f6e4629b6b8b36be74118acbdd0f9e73e6d /stdio-common/printf-parse.h
parent59d430c6809871b357f2e9e677ef7fdfc03fbf62 (diff)
downloadglibc-c06b7169e41740e4be335ca3f6221bc7d60464c7.tar.gz
glibc-c06b7169e41740e4be335ca3f6221bc7d60464c7.tar.xz
glibc-c06b7169e41740e4be335ca3f6221bc7d60464c7.zip
* 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.
Diffstat (limited to 'stdio-common/printf-parse.h')
-rw-r--r--stdio-common/printf-parse.h22
1 files changed, 15 insertions, 7 deletions
diff --git a/stdio-common/printf-parse.h b/stdio-common/printf-parse.h
index aa49c7a642..f6ad71cd3b 100644
--- a/stdio-common/printf-parse.h
+++ b/stdio-common/printf-parse.h
@@ -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,