diff options
author | Adam Chlipala <adam@chlipala.net> | 2010-12-21 18:01:23 -0500 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2010-12-21 18:01:23 -0500 |
commit | 17ecbd235ad9b7692dfc029329fb13103eb55d9c (patch) | |
tree | 90ec74ac4d55bd062eab0b9ebb1c161b31dd6167 /src/c | |
parent | 22d11510a829052ea5be8d93c9805572aa13d66e (diff) |
Basis.cdataChar
Diffstat (limited to 'src/c')
-rw-r--r-- | src/c/urweb.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/c/urweb.c b/src/c/urweb.c index aea2c6ba..d3b8c770 100644 --- a/src/c/urweb.c +++ b/src/c/urweb.c @@ -1963,6 +1963,28 @@ uw_unit uw_Basis_htmlifyInt_w(uw_context ctx, uw_Basis_int n) { return uw_unit_v; } +char *uw_Basis_htmlifySpecialChar(uw_context ctx, unsigned char ch) { + unsigned int n = ch; + int len; + char *r; + + uw_check_heap(ctx, INTS_MAX+3); + r = ctx->heap.front; + sprintf(r, "&#%u;%n", n, &len); + ctx->heap.front += len+1; + return r; +} + +uw_unit uw_Basis_htmlifySpecialChar_w(uw_context ctx, unsigned char ch) { + unsigned int n = ch; + int len; + + uw_check(ctx, INTS_MAX+3); + sprintf(ctx->page.front, "&#%u;%n", n, &len); + ctx->page.front += len; + return uw_unit_v; +} + char *uw_Basis_htmlifyFloat(uw_context ctx, uw_Basis_float n) { int len; char *r; |