diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-03 08:44:01 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-03 08:44:01 +0000 |
commit | 5f237d79033b2109afb768bc889611fa9630e00b (patch) | |
tree | 7d16be954971d3a9e8d5421da6055a76cc911db0 /include/ruby/ruby.h | |
parent | 155fda385e6657f270b8e30c1bc0ad99b2733236 (diff) | |
download | ruby-5f237d79033b2109afb768bc889611fa9630e00b.tar.gz |
* encoding.c (rb_isalnum): defined.
(rb_isalpha): ditto.
(rb_isblank): ditto.
(rb_iscntrl): ditto.
(rb_isdigit): ditto.
(rb_isgraph): ditto.
(rb_islower): ditto.
(rb_isprint): ditto.
(rb_ispunct): ditto.
(rb_isspace): ditto.
(rb_isupper): ditto.
(rb_isxdigit): ditto.
(rb_tolower): ditto.
(rb_toupper): ditto.
* include/ruby/ruby.h: don't include include/ruby/encoding.h.
(rb_isascii): defined.
(rb_isalnum): declared.
(rb_isalpha): ditto.
(rb_isblank): ditto.
(rb_iscntrl): ditto.
(rb_isdigit): ditto.
(rb_isgraph): ditto.
(rb_islower): ditto.
(rb_isprint): ditto.
(rb_ispunct): ditto.
(rb_isspace): ditto.
(rb_isupper): ditto.
(rb_isxdigit): ditto.
(rb_tolower): ditto.
(rb_toupper): ditto.
(ISASCII): simplified.
(ISPRINT): ditto.
(ISSPACE): ditto.
(ISUPPER): ditto.
(ISLOWER): ditto.
(ISALNUM): ditto.
(ISALPHA): ditto.
(ISDIGIT): ditto.
(ISXDIGIT): ditto.
(TOUPPER): ditto.
(TOLOWER): ditto.
* include/ruby/encoding.h (rb_isascii): removed.
(rb_isalnum): ditto.
(rb_isalpha): ditto.
(rb_isblank): ditto.
(rb_iscntrl): ditto.
(rb_isdigit): ditto.
(rb_isgraph): ditto.
(rb_islower): ditto.
(rb_isprint): ditto.
(rb_ispunct): ditto.
(rb_isspace): ditto.
(rb_isupper): ditto.
(rb_isxdigit): ditto.
(rb_tolower): ditto.
(rb_toupper): ditto.
* common.mk: dependency updated.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include/ruby/ruby.h')
-rw-r--r-- | include/ruby/ruby.h | 42 |
1 files changed, 29 insertions, 13 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 199098f609..35b97fe3d7 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -969,21 +969,37 @@ int rb_remove_event_hook(rb_event_hook_func_t func); #endif /* locale insensitive functions */ -#include "encoding.h" + +#define rb_isascii(c) ((unsigned long)(c) < 128) +int rb_isalnum(int c); +int rb_isalpha(int c); +int rb_isblank(int c); +int rb_iscntrl(int c); +int rb_isdigit(int c); +int rb_isgraph(int c); +int rb_islower(int c); +int rb_isprint(int c); +int rb_ispunct(int c); +int rb_isspace(int c); +int rb_isupper(int c); +int rb_isxdigit(int c); +int rb_tolower(int c); +int rb_toupper(int c); + #ifndef ISPRINT -#define ISASCII(c) rb_isascii((int)(unsigned char)(c)) +#define ISASCII(c) rb_isascii((unsigned char)(c)) #undef ISPRINT -#define ISPRINT(c) (ISASCII(c) && rb_isprint((int)(unsigned char)(c))) -#define ISSPACE(c) (ISASCII(c) && rb_isspace((int)(unsigned char)(c))) -#define ISUPPER(c) (ISASCII(c) && rb_isupper((int)(unsigned char)(c))) -#define ISLOWER(c) (ISASCII(c) && rb_islower((int)(unsigned char)(c))) -#define ISALNUM(c) (ISASCII(c) && rb_isalnum((int)(unsigned char)(c))) -#define ISALPHA(c) (ISASCII(c) && rb_isalpha((int)(unsigned char)(c))) -#define ISDIGIT(c) (ISASCII(c) && rb_isdigit((int)(unsigned char)(c))) -#define ISXDIGIT(c) (ISASCII(c) && rb_isxdigit((int)(unsigned char)(c))) -#endif -#define TOUPPER(c) (rb_toupper((int)(unsigned char)(c))) -#define TOLOWER(c) (rb_tolower((int)(unsigned char)(c))) +#define ISPRINT(c) rb_isprint((unsigned char)c) +#define ISSPACE(c) rb_isspace((unsigned char)c) +#define ISUPPER(c) rb_isupper((unsigned char)c) +#define ISLOWER(c) rb_islower((unsigned char)c) +#define ISALNUM(c) rb_isalnum((unsigned char)c) +#define ISALPHA(c) rb_isalpha((unsigned char)c) +#define ISDIGIT(c) rb_isdigit((unsigned char)c) +#define ISXDIGIT(c) rb_isxdigit((unsigned char)c) +#endif +#define TOUPPER(c) rb_toupper((unsigned char)c) +#define TOLOWER(c) rb_tolower((unsigned char)c) #define STRCASECMP(s1, s2) (st_strcasecmp(s1, s2)) #define STRNCASECMP(s1, s2, n) (st_strncasecmp(s1, s2, n)) |