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.c | |
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.c')
-rw-r--r-- | lib.c | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -1136,11 +1136,6 @@ val string_lt(val astr, val bstr) return cmp == -1 ? t : nil; } -val chr(wchar_t ch) -{ - return (val) (((cnum) ch << TAG_SHIFT) | TAG_CHR); -} - val chrp(val chr) { return (is_chr(chr)) ? t : nil; @@ -1358,6 +1353,15 @@ val func_n4(val (*fun)(val, val, val, val)) return obj; } +val functionp(val obj) +{ + if (!obj) { + return nil; + } else { + type_t ty = type(obj); + return (ty == FUN) ? t : nil; + } +} val apply(val fun, val arglist) { |