Commit a8016863 by Nathanael Nerode

cppcharset.c, cpphash.h: Rename 'struct strbuf' to 'struct _cpp_strbuf'.

	* cppcharset.c, cpphash.h: Rename 'struct strbuf' to
	'struct _cpp_strbuf'.

From-SVN: r71814
parent a805d35f
2003-09-25 Nathanael Nerode <neroden@gcc.gnu.org> 2003-09-25 Nathanael Nerode <neroden@gcc.gnu.org>
* cppcharset.c, cpphash.h: Rename 'struct strbuf' to
'struct _cpp_strbuf'.
* config/i386/netbsd-elf.h, config/i386/netbsd64.h, * config/i386/netbsd-elf.h, config/i386/netbsd64.h,
config/i386/netware.h, config/i386/nto.h, config/i386/openbsd.h, config/i386/netware.h, config/i386/nto.h, config/i386/openbsd.h,
config/i386/pentium.md, config/i386/pmmintrin.h, config/i386/ppro.md, config/i386/pentium.md, config/i386/pmmintrin.h, config/i386/ppro.md,
......
...@@ -92,7 +92,9 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ...@@ -92,7 +92,9 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#endif #endif
/* This structure is used for a resizable string buffer throughout. */ /* This structure is used for a resizable string buffer throughout. */
struct strbuf /* Don't call it strbuf, as that conflicts with unistd.h on systems
such as DYNIX/ptx where unistd.h includes stropts.h. */
struct _cpp_strbuf
{ {
uchar *text; uchar *text;
size_t asize; size_t asize;
...@@ -451,7 +453,7 @@ one_utf16_to_utf8 (iconv_t bigend, const uchar **inbufp, size_t *inbytesleftp, ...@@ -451,7 +453,7 @@ one_utf16_to_utf8 (iconv_t bigend, const uchar **inbufp, size_t *inbytesleftp,
static inline bool static inline bool
conversion_loop (int (*const one_conversion)(iconv_t, const uchar **, size_t *, conversion_loop (int (*const one_conversion)(iconv_t, const uchar **, size_t *,
uchar **, size_t *), uchar **, size_t *),
iconv_t cd, const uchar *from, size_t flen, struct strbuf *to) iconv_t cd, const uchar *from, size_t flen, struct _cpp_strbuf *to)
{ {
const uchar *inbuf; const uchar *inbuf;
uchar *outbuf; uchar *outbuf;
...@@ -492,7 +494,7 @@ conversion_loop (int (*const one_conversion)(iconv_t, const uchar **, size_t *, ...@@ -492,7 +494,7 @@ conversion_loop (int (*const one_conversion)(iconv_t, const uchar **, size_t *,
/* These functions convert entire strings between character sets. /* These functions convert entire strings between character sets.
They all have the signature They all have the signature
bool (*)(iconv_t cd, const uchar *from, size_t flen, struct strbuf *to); bool (*)(iconv_t cd, const uchar *from, size_t flen, struct _cpp_strbuf *to);
The input string FROM is converted as specified by the function The input string FROM is converted as specified by the function
name plus the iconv descriptor CD (which may be fake), and the name plus the iconv descriptor CD (which may be fake), and the
...@@ -501,28 +503,28 @@ conversion_loop (int (*const one_conversion)(iconv_t, const uchar **, size_t *, ...@@ -501,28 +503,28 @@ conversion_loop (int (*const one_conversion)(iconv_t, const uchar **, size_t *,
/* These four use the custom conversion code above. */ /* These four use the custom conversion code above. */
static bool static bool
convert_utf8_utf16 (iconv_t cd, const uchar *from, size_t flen, convert_utf8_utf16 (iconv_t cd, const uchar *from, size_t flen,
struct strbuf *to) struct _cpp_strbuf *to)
{ {
return conversion_loop (one_utf8_to_utf16, cd, from, flen, to); return conversion_loop (one_utf8_to_utf16, cd, from, flen, to);
} }
static bool static bool
convert_utf8_utf32 (iconv_t cd, const uchar *from, size_t flen, convert_utf8_utf32 (iconv_t cd, const uchar *from, size_t flen,
struct strbuf *to) struct _cpp_strbuf *to)
{ {
return conversion_loop (one_utf8_to_utf32, cd, from, flen, to); return conversion_loop (one_utf8_to_utf32, cd, from, flen, to);
} }
static bool static bool
convert_utf16_utf8 (iconv_t cd, const uchar *from, size_t flen, convert_utf16_utf8 (iconv_t cd, const uchar *from, size_t flen,
struct strbuf *to) struct _cpp_strbuf *to)
{ {
return conversion_loop (one_utf16_to_utf8, cd, from, flen, to); return conversion_loop (one_utf16_to_utf8, cd, from, flen, to);
} }
static bool static bool
convert_utf32_utf8 (iconv_t cd, const uchar *from, size_t flen, convert_utf32_utf8 (iconv_t cd, const uchar *from, size_t flen,
struct strbuf *to) struct _cpp_strbuf *to)
{ {
return conversion_loop (one_utf32_to_utf8, cd, from, flen, to); return conversion_loop (one_utf32_to_utf8, cd, from, flen, to);
} }
...@@ -530,7 +532,7 @@ convert_utf32_utf8 (iconv_t cd, const uchar *from, size_t flen, ...@@ -530,7 +532,7 @@ convert_utf32_utf8 (iconv_t cd, const uchar *from, size_t flen,
/* Identity conversion, used when we have no alternative. */ /* Identity conversion, used when we have no alternative. */
static bool static bool
convert_no_conversion (iconv_t cd ATTRIBUTE_UNUSED, convert_no_conversion (iconv_t cd ATTRIBUTE_UNUSED,
const uchar *from, size_t flen, struct strbuf *to) const uchar *from, size_t flen, struct _cpp_strbuf *to)
{ {
if (to->len + flen > to->asize) if (to->len + flen > to->asize)
{ {
...@@ -547,7 +549,7 @@ convert_no_conversion (iconv_t cd ATTRIBUTE_UNUSED, ...@@ -547,7 +549,7 @@ convert_no_conversion (iconv_t cd ATTRIBUTE_UNUSED,
#if HAVE_ICONV #if HAVE_ICONV
static bool static bool
convert_using_iconv (iconv_t cd, const uchar *from, size_t flen, convert_using_iconv (iconv_t cd, const uchar *from, size_t flen,
struct strbuf *to) struct _cpp_strbuf *to)
{ {
ICONV_CONST char *inbuf; ICONV_CONST char *inbuf;
char *outbuf; char *outbuf;
...@@ -873,7 +875,7 @@ _cpp_valid_ucn (cpp_reader *pfile, const uchar **pstr, ...@@ -873,7 +875,7 @@ _cpp_valid_ucn (cpp_reader *pfile, const uchar **pstr,
static const uchar * static const uchar *
convert_ucn (cpp_reader *pfile, const uchar *from, const uchar *limit, convert_ucn (cpp_reader *pfile, const uchar *from, const uchar *limit,
struct strbuf *tbuf, bool wide) struct _cpp_strbuf *tbuf, bool wide)
{ {
cppchar_t ucn; cppchar_t ucn;
uchar buf[6]; uchar buf[6];
...@@ -900,7 +902,7 @@ convert_ucn (cpp_reader *pfile, const uchar *from, const uchar *limit, ...@@ -900,7 +902,7 @@ convert_ucn (cpp_reader *pfile, const uchar *from, const uchar *limit,
static void static void
emit_numeric_escape (cpp_reader *pfile, cppchar_t n, emit_numeric_escape (cpp_reader *pfile, cppchar_t n,
struct strbuf *tbuf, bool wide) struct _cpp_strbuf *tbuf, bool wide)
{ {
if (wide) if (wide)
{ {
...@@ -948,7 +950,7 @@ emit_numeric_escape (cpp_reader *pfile, cppchar_t n, ...@@ -948,7 +950,7 @@ emit_numeric_escape (cpp_reader *pfile, cppchar_t n,
number. You can, e.g. generate surrogate pairs this way. */ number. You can, e.g. generate surrogate pairs this way. */
static const uchar * static const uchar *
convert_hex (cpp_reader *pfile, const uchar *from, const uchar *limit, convert_hex (cpp_reader *pfile, const uchar *from, const uchar *limit,
struct strbuf *tbuf, bool wide) struct _cpp_strbuf *tbuf, bool wide)
{ {
cppchar_t c, n = 0, overflow = 0; cppchar_t c, n = 0, overflow = 0;
int digits_found = 0; int digits_found = 0;
...@@ -999,7 +1001,7 @@ convert_hex (cpp_reader *pfile, const uchar *from, const uchar *limit, ...@@ -999,7 +1001,7 @@ convert_hex (cpp_reader *pfile, const uchar *from, const uchar *limit,
number. */ number. */
static const uchar * static const uchar *
convert_oct (cpp_reader *pfile, const uchar *from, const uchar *limit, convert_oct (cpp_reader *pfile, const uchar *from, const uchar *limit,
struct strbuf *tbuf, bool wide) struct _cpp_strbuf *tbuf, bool wide)
{ {
size_t count = 0; size_t count = 0;
cppchar_t c, n = 0; cppchar_t c, n = 0;
...@@ -1036,7 +1038,7 @@ convert_oct (cpp_reader *pfile, const uchar *from, const uchar *limit, ...@@ -1036,7 +1038,7 @@ convert_oct (cpp_reader *pfile, const uchar *from, const uchar *limit,
pointer. Handles all relevant diagnostics. */ pointer. Handles all relevant diagnostics. */
static const uchar * static const uchar *
convert_escape (cpp_reader *pfile, const uchar *from, const uchar *limit, convert_escape (cpp_reader *pfile, const uchar *from, const uchar *limit,
struct strbuf *tbuf, bool wide) struct _cpp_strbuf *tbuf, bool wide)
{ {
/* Values of \a \b \e \f \n \r \t \v respectively. */ /* Values of \a \b \e \f \n \r \t \v respectively. */
#if HOST_CHARSET == HOST_CHARSET_ASCII #if HOST_CHARSET == HOST_CHARSET_ASCII
...@@ -1128,7 +1130,7 @@ bool ...@@ -1128,7 +1130,7 @@ bool
cpp_interpret_string (cpp_reader *pfile, const cpp_string *from, size_t count, cpp_interpret_string (cpp_reader *pfile, const cpp_string *from, size_t count,
cpp_string *to, bool wide) cpp_string *to, bool wide)
{ {
struct strbuf tbuf; struct _cpp_strbuf tbuf;
const uchar *p, *base, *limit; const uchar *p, *base, *limit;
size_t i; size_t i;
struct cset_converter cvt struct cset_converter cvt
......
...@@ -35,10 +35,10 @@ typedef int iconv_t; /* dummy */ ...@@ -35,10 +35,10 @@ typedef int iconv_t; /* dummy */
struct directive; /* Deliberately incomplete. */ struct directive; /* Deliberately incomplete. */
struct pending_option; struct pending_option;
struct op; struct op;
struct strbuf; struct _cpp_strbuf;
typedef bool (*convert_f) (iconv_t, const unsigned char *, size_t, typedef bool (*convert_f) (iconv_t, const unsigned char *, size_t,
struct strbuf *); struct _cpp_strbuf *);
struct cset_converter struct cset_converter
{ {
convert_f func; convert_f func;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment