comparison src/c/urweb.c @ 1556:e1f5d9c4cc20

An abstract type of IDs
author Adam Chlipala <adam@chlipala.net>
date Sat, 03 Sep 2011 12:51:05 -0400
parents c3b5cf5c2f98
children f403e129c276
comparison
equal deleted inserted replaced
1555:d5c961c709f9 1556:e1f5d9c4cc20
461 461
462 int isPost, hasPostBody; 462 int isPost, hasPostBody;
463 uw_Basis_postBody postBody; 463 uw_Basis_postBody postBody;
464 uw_Basis_string queryString; 464 uw_Basis_string queryString;
465 465
466 unsigned nextId;
467
466 char error_message[ERROR_BUF_LEN]; 468 char error_message[ERROR_BUF_LEN];
467 }; 469 };
468 470
469 size_t uw_headers_max = SIZE_MAX; 471 size_t uw_headers_max = SIZE_MAX;
470 size_t uw_page_max = SIZE_MAX; 472 size_t uw_page_max = SIZE_MAX;
529 ctx->log_debug = log_debug; 531 ctx->log_debug = log_debug;
530 532
531 ctx->isPost = ctx->hasPostBody = 0; 533 ctx->isPost = ctx->hasPostBody = 0;
532 534
533 ctx->queryString = NULL; 535 ctx->queryString = NULL;
536
537 ctx->nextId = 0;
534 538
535 return ctx; 539 return ctx;
536 } 540 }
537 541
538 size_t uw_inputs_max = SIZE_MAX; 542 size_t uw_inputs_max = SIZE_MAX;
606 ctx->client = NULL; 610 ctx->client = NULL;
607 ctx->cur_container = NULL; 611 ctx->cur_container = NULL;
608 ctx->used_transactionals = 0; 612 ctx->used_transactionals = 0;
609 ctx->script_header = ""; 613 ctx->script_header = "";
610 ctx->queryString = NULL; 614 ctx->queryString = NULL;
615 ctx->nextId = 0;
611 } 616 }
612 617
613 void uw_reset_keep_request(uw_context ctx) { 618 void uw_reset_keep_request(uw_context ctx) {
614 uw_reset_keep_error_message(ctx); 619 uw_reset_keep_error_message(ctx);
615 ctx->error_message[0] = 0; 620 ctx->error_message[0] = 0;
3945 if (s2 == NULL || strcspn(s, "<&") < s2 - s) 3950 if (s2 == NULL || strcspn(s, "<&") < s2 - s)
3946 return; 3951 return;
3947 3952
3948 memmove(s, s2+2, strlen(s2+2)+1); 3953 memmove(s, s2+2, strlen(s2+2)+1);
3949 } 3954 }
3955
3956 uw_Basis_string uw_Basis_fresh(uw_context ctx) {
3957 return uw_Basis_htmlifyInt(ctx, ctx->nextId++);
3958 }