summaryrefslogtreecommitdiff
path: root/src/c
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2011-09-03 12:51:05 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2011-09-03 12:51:05 -0400
commitcd28ea2ee01ac023b7b1dfac39ae5ddf4ded5c4e (patch)
treed792d445b5fbc6b0a16eadef95d70510f9037dd6 /src/c
parent3c860c3c95d4d085499fd01e3140f32aafbc1bd7 (diff)
An abstract type of IDs
Diffstat (limited to 'src/c')
-rw-r--r--src/c/urweb.c9
1 files changed, 9 insertions, 0 deletions
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++);
+}