diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2011-12-07 09:01:26 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2011-12-07 09:01:26 -0800 |
commit | b3540d10efec1c3d27d0206d67635eaeb39141ec (patch) | |
tree | 19d302ab079edb0f744b5ca9feb11239038722c3 /lib.h | |
parent | b4d0fe33246175c0ac8e094ca46036444136a3be (diff) | |
download | txr-b3540d10efec1c3d27d0206d67635eaeb39141ec.tar.gz txr-b3540d10efec1c3d27d0206d67635eaeb39141ec.tar.bz2 txr-b3540d10efec1c3d27d0206d67635eaeb39141ec.zip |
* eval.c (eval_init): New character functions registered.
* lib.c (c_num): Generalized to convert characters to numbers also.
This allows functions like gt and lt to work with characters.
(chr_isalnum, chr_isalpha, chr_isascii, chr_iscntrl, chr_isdigit,
chr_isgraph, chr_islower, chr_isprint, chr_ispunct, chr_isspace,
chr_isupper, chr_isxdigit): New functions added.
* lib.h: (chr_isalnum, chr_isalpha, chr_isascii, chr_iscntrl,
* chr_isdigit, chr_isgraph, chr_islower, chr_isprint, chr_ispunct,
* chr_isspace, chr_isupper, chr_isxdigit): New functions declared.
(c_true): New macro.
Diffstat (limited to 'lib.h')
-rw-r--r-- | lib.h | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -395,6 +395,18 @@ val string_lt(val astr, val bstr); val int_str(val str, val base); val chrp(val chr); wchar_t c_chr(val chr); +val chr_isalnum(val ch); +val chr_isalpha(val ch); +val chr_isascii(val ch); +val chr_iscntrl(val ch); +val chr_isdigit(val ch); +val chr_isgraph(val ch); +val chr_islower(val ch); +val chr_isprint(val ch); +val chr_ispunct(val ch); +val chr_isspace(val ch); +val chr_isupper(val ch); +val chr_isxdigit(val ch); val chr_str(val str, val index); val chr_str_set(val str, val index, val chr); val span_str(val str, val set); @@ -522,6 +534,8 @@ INLINE val eq(val a, val b) { return ((a) == (b) ? t : nil); } #define or4(a, b, c, d) or2(a, or3(b, c, d)) +#define c_true(c_cond) ((c_cond) ? t : nil) + #define list_collect_decl(OUT, PTAIL) \ obj_t *OUT = nil, **PTAIL = &OUT |