From cd28ea2ee01ac023b7b1dfac39ae5ddf4ded5c4e Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sat, 3 Sep 2011 12:51:05 -0400 Subject: An abstract type of IDs --- src/c/urweb.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/c') diff --git a/src/c/urweb.c b/src/c/urweb.c index 2a593767..0f1634e9 100644 --- a/src/c/urweb.c +++ b/src/c/urweb.c @@ -463,6 +463,8 @@ struct uw_context { uw_Basis_postBody postBody; uw_Basis_string queryString; + unsigned nextId; + char error_message[ERROR_BUF_LEN]; }; @@ -532,6 +534,8 @@ uw_context uw_init(int id, void *logger_data, uw_logger log_debug) { ctx->queryString = NULL; + ctx->nextId = 0; + return ctx; } @@ -608,6 +612,7 @@ void uw_reset_keep_error_message(uw_context ctx) { ctx->used_transactionals = 0; ctx->script_header = ""; ctx->queryString = NULL; + ctx->nextId = 0; } void uw_reset_keep_request(uw_context ctx) { @@ -3947,3 +3952,7 @@ void uw_cutErrorLocation(char *s) { memmove(s, s2+2, strlen(s2+2)+1); } + +uw_Basis_string uw_Basis_fresh(uw_context ctx) { + return uw_Basis_htmlifyInt(ctx, ctx->nextId++); +} -- cgit v1.2.3