comparison 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
comparison
equal deleted inserted replaced
1357:a0f0823a54a0 1358:32c8a3509369
1961 ctx->page.front += len; 1961 ctx->page.front += len;
1962 1962
1963 return uw_unit_v; 1963 return uw_unit_v;
1964 } 1964 }
1965 1965
1966 char *uw_Basis_htmlifySpecialChar(uw_context ctx, unsigned char ch) {
1967 unsigned int n = ch;
1968 int len;
1969 char *r;
1970
1971 uw_check_heap(ctx, INTS_MAX+3);
1972 r = ctx->heap.front;
1973 sprintf(r, "&#%u;%n", n, &len);
1974 ctx->heap.front += len+1;
1975 return r;
1976 }
1977
1978 uw_unit uw_Basis_htmlifySpecialChar_w(uw_context ctx, unsigned char ch) {
1979 unsigned int n = ch;
1980 int len;
1981
1982 uw_check(ctx, INTS_MAX+3);
1983 sprintf(ctx->page.front, "&#%u;%n", n, &len);
1984 ctx->page.front += len;
1985 return uw_unit_v;
1986 }
1987
1966 char *uw_Basis_htmlifyFloat(uw_context ctx, uw_Basis_float n) { 1988 char *uw_Basis_htmlifyFloat(uw_context ctx, uw_Basis_float n) {
1967 int len; 1989 int len;
1968 char *r; 1990 char *r;
1969 1991
1970 uw_check_heap(ctx, FLOATS_MAX); 1992 uw_check_heap(ctx, FLOATS_MAX);