diff src/c/urweb.c @ 1115:150465f2895c

Database quotas
author Adam Chlipala <adamc@hcoop.net>
date Sun, 03 Jan 2010 17:13:45 -0500
parents 01b6c7144a44
children 31ef567fa772
line wrap: on
line diff
--- a/src/c/urweb.c	Sun Jan 03 15:58:34 2010 -0500
+++ b/src/c/urweb.c	Sun Jan 03 17:13:45 2010 -0500
@@ -470,8 +470,6 @@
   ctx->needs_push = 0;
   ctx->needs_sig = 0;
 
-  ctx->error_message[0] = 0;
-
   ctx->source_count = 0;
 
   ctx->n_deltas = ctx->used_deltas = 0;
@@ -702,6 +700,11 @@
   return ctx->error_message;
 }
 
+void uw_set_error_message(uw_context ctx, const char *msg) {
+  strncpy(ctx->error_message, msg, sizeof(ctx->error_message));
+  ctx->error_message[sizeof(ctx->error_message)-1] = 0;
+}
+
 static input *INP(uw_context ctx) {
   if (ctx->cur_container == NULL)
     return ctx->inputs;
@@ -3359,3 +3362,5 @@
   if (uw_time > ctx->deadline)
     uw_error(ctx, FATAL, "Maximum running time exceeded");
 }
+
+size_t uw_database_max = SIZE_MAX;