diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2011-09-26 23:21:58 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2011-09-26 23:21:58 -0700 |
commit | 29b5d37a8577d83ae0c88b2e894287b990e6849e (patch) | |
tree | 71de03c6df0949cf41bde27e2ce5f42afaa40eb1 /lib.h | |
parent | d5fdbd469b38c5444d7d9995a87546a12a6638bf (diff) | |
download | txr-29b5d37a8577d83ae0c88b2e894287b990e6849e.tar.gz txr-29b5d37a8577d83ae0c88b2e894287b990e6849e.tar.bz2 txr-29b5d37a8577d83ae0c88b2e894287b990e6849e.zip |
Support &#xNNNN; hex escapes in html. Bugfix in field formatting.
chr function inlined.
* filter.c (trie_value_at, trie_lookup_feed_char): Handle function
case.
(build_filter): New parameter, compress_p.
(html_hex_continue, html_hex_handler): New functions.
(filter_init): Add a function-based node to the from_html trie.
* lib.c (chr): Function removed.
(functionp) New function.
* lib.h (chr): Declaration replaced with inline function.
(functionp): Declared.
* match.c (format_field): Bugfix: failed to apply filter
that came in as an argument.
Diffstat (limited to 'lib.h')
-rw-r--r-- | lib.h | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -208,6 +208,11 @@ INLINE val num_fast(cnum n) return (val) ((n << TAG_SHIFT) | TAG_NUM); } +INLINE val chr(wchar_t ch) +{ + return (val) (((cnum) ch << TAG_SHIFT) | TAG_CHR); +} + #define lit_noex(strlit) ((obj_t *) ((cnum) (L ## strlit) | TAG_LIT)) #define lit(strlit) lit_noex(strlit) @@ -319,7 +324,6 @@ val split_str(val str, val sep); val split_str_set(val str, val set); val trim_str(val str); val string_lt(val astr, val bstr); -val chr(wchar_t ch); val chrp(val chr); wchar_t c_chr(val chr); val chr_str(val str, val index); @@ -343,6 +347,7 @@ val func_n1(val (*fun)(val)); val func_n2(val (*fun)(val, val)); val func_n3(val (*fun)(val, val, val)); val func_n4(val (*fun)(val, val, val, val)); +val functionp(val); val apply(val fun, val arglist); val funcall(val fun); val funcall1(val fun, val arg); |