Mercurial > urweb
diff src/c/urweb.c @ 1358:32c8a3509369
Basis.cdataChar
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Tue, 21 Dec 2010 18:01:23 -0500 |
parents | e9cf053108ed |
children | e525ad571e15 |
line wrap: on
line diff
--- a/src/c/urweb.c Tue Dec 21 17:01:51 2010 -0500 +++ b/src/c/urweb.c Tue Dec 21 18:01:23 2010 -0500 @@ -1963,6 +1963,28 @@ 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;