From 0e5b483974674c53d99bd8b811b2c807f011c107 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Wed, 12 Dec 2012 10:47:47 +0400 Subject: [PATCH] Portability: rename some str_class members ...to avoid conflict with global names. On HP-UX, inttypes.h includes ctype.h through other dependencies, ctype.h defines macros for various functions and these macros clash with entries of "struct str_class". Signed-off-by: Andrew Borodin --- lib/strutil.h | 16 ++++++++-------- lib/strutil/strutil.c | 16 ++++++++-------- lib/strutil/strutil8bit.c | 16 ++++++++-------- lib/strutil/strutilascii.c | 16 ++++++++-------- lib/strutil/strutilutf8.c | 16 ++++++++-------- 5 files changed, 40 insertions(+), 40 deletions(-) diff --git a/lib/strutil.h b/lib/strutil.h index 31bde24b9..833e7eda7 100644 --- a/lib/strutil.h +++ b/lib/strutil.h @@ -102,17 +102,17 @@ struct str_class /*I*/ void (*cprev_char_safe) (const char **); /*I*/ int (*cnext_noncomb_char) (const char **text); /*I*/ int (*cprev_noncomb_char) (const char **text, const char *begin); - /*I*/ int (*isspace) (const char *); - /*I*/ int (*ispunct) (const char *); - /*I*/ int (*isalnum) (const char *); - /*I*/ int (*isdigit) (const char *); - /*I*/ int (*isprint) (const char *); - /*I*/ gboolean (*iscombiningmark) (const char *); + /*I*/ int (*char_isspace) (const char *); + /*I*/ int (*char_ispunct) (const char *); + /*I*/ int (*char_isalnum) (const char *); + /*I*/ int (*char_isdigit) (const char *); + /*I*/ int (*char_isprint) (const char *); + /*I*/ gboolean (*char_iscombiningmark) (const char *); /*I*/ int (*length) (const char *); /*I*/ int (*length2) (const char *, int); /*I*/ int (*length_noncomb) (const char *); - /*I*/ int (*toupper) (const char *, char **, size_t *); - int (*tolower) (const char *, char **, size_t *); + /*I*/ int (*char_toupper) (const char *, char **, size_t *); + int (*char_tolower) (const char *, char **, size_t *); void (*fix_string) (char *); /*I*/ const char *(*term_form) (const char *); /*I*/ const char *(*fit_to_term) (const char *, int, align_crt_t); diff --git a/lib/strutil/strutil.c b/lib/strutil/strutil.c index 985c7b87c..6ffef8c69 100644 --- a/lib/strutil/strutil.c +++ b/lib/strutil/strutil.c @@ -629,49 +629,49 @@ str_column_to_pos (const char *text, size_t pos) int str_isspace (const char *ch) { - return used_class.isspace (ch); + return used_class.char_isspace (ch); } int str_ispunct (const char *ch) { - return used_class.ispunct (ch); + return used_class.char_ispunct (ch); } int str_isalnum (const char *ch) { - return used_class.isalnum (ch); + return used_class.char_isalnum (ch); } int str_isdigit (const char *ch) { - return used_class.isdigit (ch); + return used_class.char_isdigit (ch); } int str_toupper (const char *ch, char **out, size_t * remain) { - return used_class.toupper (ch, out, remain); + return used_class.char_toupper (ch, out, remain); } int str_tolower (const char *ch, char **out, size_t * remain) { - return used_class.tolower (ch, out, remain); + return used_class.char_tolower (ch, out, remain); } int str_isprint (const char *ch) { - return used_class.isprint (ch); + return used_class.char_isprint (ch); } gboolean str_iscombiningmark (const char *ch) { - return used_class.iscombiningmark (ch); + return used_class.char_iscombiningmark (ch); } const char * diff --git a/lib/strutil/strutil8bit.c b/lib/strutil/strutil8bit.c index 966c0df21..31d9e4bfd 100644 --- a/lib/strutil/strutil8bit.c +++ b/lib/strutil/strutil8bit.c @@ -758,14 +758,14 @@ str_8bit_init (void) result.cprev_char_safe = str_8bit_cprev_char; result.cnext_noncomb_char = str_8bit_cnext_noncomb_char; result.cprev_noncomb_char = str_8bit_cprev_noncomb_char; - result.isspace = str_8bit_isspace; - result.ispunct = str_8bit_ispunct; - result.isalnum = str_8bit_isalnum; - result.isdigit = str_8bit_isdigit; - result.isprint = str_8bit_isprint; - result.iscombiningmark = str_8bit_iscombiningmark; - result.toupper = str_8bit_toupper; - result.tolower = str_8bit_tolower; + result.char_isspace = str_8bit_isspace; + result.char_ispunct = str_8bit_ispunct; + result.char_isalnum = str_8bit_isalnum; + result.char_isdigit = str_8bit_isdigit; + result.char_isprint = str_8bit_isprint; + result.char_iscombiningmark = str_8bit_iscombiningmark; + result.char_toupper = str_8bit_toupper; + result.char_tolower = str_8bit_tolower; result.length = str_8bit_length; result.length2 = str_8bit_length2; result.length_noncomb = str_8bit_length; diff --git a/lib/strutil/strutilascii.c b/lib/strutil/strutilascii.c index 6c96c4aef..2d8768cb4 100644 --- a/lib/strutil/strutilascii.c +++ b/lib/strutil/strutilascii.c @@ -648,14 +648,14 @@ str_ascii_init (void) result.cprev_char_safe = str_ascii_cprev_char; result.cnext_noncomb_char = str_ascii_cnext_noncomb_char; result.cprev_noncomb_char = str_ascii_cprev_noncomb_char; - result.isspace = str_ascii_isspace; - result.ispunct = str_ascii_ispunct; - result.isalnum = str_ascii_isalnum; - result.isdigit = str_ascii_isdigit; - result.isprint = str_ascii_isprint; - result.iscombiningmark = str_ascii_iscombiningmark; - result.toupper = str_ascii_toupper; - result.tolower = str_ascii_tolower; + result.char_isspace = str_ascii_isspace; + result.char_ispunct = str_ascii_ispunct; + result.char_isalnum = str_ascii_isalnum; + result.char_isdigit = str_ascii_isdigit; + result.char_isprint = str_ascii_isprint; + result.char_iscombiningmark = str_ascii_iscombiningmark; + result.char_toupper = str_ascii_toupper; + result.char_tolower = str_ascii_tolower; result.length = str_ascii_length; result.length2 = str_ascii_length2; result.length_noncomb = str_ascii_length; diff --git a/lib/strutil/strutilutf8.c b/lib/strutil/strutilutf8.c index 77452f75b..e6e7688b0 100644 --- a/lib/strutil/strutilutf8.c +++ b/lib/strutil/strutilutf8.c @@ -1323,14 +1323,14 @@ str_utf8_init (void) result.cprev_char_safe = str_utf8_cprev_char_safe; result.cnext_noncomb_char = str_utf8_cnext_noncomb_char; result.cprev_noncomb_char = str_utf8_cprev_noncomb_char; - result.isspace = str_utf8_isspace; - result.ispunct = str_utf8_ispunct; - result.isalnum = str_utf8_isalnum; - result.isdigit = str_utf8_isdigit; - result.isprint = str_utf8_isprint; - result.iscombiningmark = str_utf8_iscombiningmark; - result.toupper = str_utf8_toupper; - result.tolower = str_utf8_tolower; + result.char_isspace = str_utf8_isspace; + result.char_ispunct = str_utf8_ispunct; + result.char_isalnum = str_utf8_isalnum; + result.char_isdigit = str_utf8_isdigit; + result.char_isprint = str_utf8_isprint; + result.char_iscombiningmark = str_utf8_iscombiningmark; + result.char_toupper = str_utf8_toupper; + result.char_tolower = str_utf8_tolower; result.length = str_utf8_length; result.length2 = str_utf8_length2; result.length_noncomb = str_utf8_length_noncomb;