Mercurial > urweb
comparison src/c/urweb.c @ 1703:6f2f74cc4ead
Change ID generation scheme to conform to HTML standards (thanks to Edward Yang for the catch)
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Fri, 16 Mar 2012 08:42:51 -0400 |
parents | ae22d1fd9b80 |
children | c05e2e4bdde7 |
comparison
equal
deleted
inserted
replaced
1702:06791667937e | 1703:6f2f74cc4ead |
---|---|
3960 | 3960 |
3961 memmove(s, s2+2, strlen(s2+2)+1); | 3961 memmove(s, s2+2, strlen(s2+2)+1); |
3962 } | 3962 } |
3963 | 3963 |
3964 uw_Basis_string uw_Basis_fresh(uw_context ctx) { | 3964 uw_Basis_string uw_Basis_fresh(uw_context ctx) { |
3965 return uw_Basis_htmlifyInt(ctx, ctx->nextId++); | 3965 int len; |
3966 char *r; | |
3967 | |
3968 uw_check_heap(ctx, 2+INTS_MAX); | |
3969 r = ctx->heap.front; | |
3970 sprintf(r, "uw%u%n", ctx->nextId++, &len); | |
3971 ctx->heap.front += len+1; | |
3972 return r; | |
3966 } | 3973 } |
3967 | 3974 |
3968 uw_Basis_float uw_Basis_floatFromInt(uw_context ctx, uw_Basis_int n) { | 3975 uw_Basis_float uw_Basis_floatFromInt(uw_context ctx, uw_Basis_int n) { |
3969 return n; | 3976 return n; |
3970 } | 3977 } |