comparison src/c/urweb.c @ 1386:64724ef86149

Basis.currentUrlHasPost
author Adam Chlipala <adam@chlipala.net>
date Thu, 06 Jan 2011 14:45:52 -0500
parents 86d23010ea74
children 3913cbfd72e9
comparison
equal deleted inserted replaced
1385:449a12b82db7 1386:64724ef86149
440 void *client_data; 440 void *client_data;
441 441
442 void *logger_data; 442 void *logger_data;
443 uw_logger log_debug; 443 uw_logger log_debug;
444 444
445 int hasPostBody; 445 int isPost, hasPostBody;
446 uw_Basis_postBody postBody; 446 uw_Basis_postBody postBody;
447 uw_Basis_string queryString; 447 uw_Basis_string queryString;
448 448
449 char error_message[ERROR_BUF_LEN]; 449 char error_message[ERROR_BUF_LEN];
450 }; 450 };
506 ctx->client_data = uw_init_client_data(); 506 ctx->client_data = uw_init_client_data();
507 507
508 ctx->logger_data = logger_data; 508 ctx->logger_data = logger_data;
509 ctx->log_debug = log_debug; 509 ctx->log_debug = log_debug;
510 510
511 ctx->hasPostBody = 0; 511 ctx->isPost = ctx->hasPostBody = 0;
512 512
513 ctx->queryString = NULL; 513 ctx->queryString = NULL;
514 514
515 return ctx; 515 return ctx;
516 } 516 }
586 ctx->used_deltas = 0; 586 ctx->used_deltas = 0;
587 ctx->client = NULL; 587 ctx->client = NULL;
588 ctx->cur_container = NULL; 588 ctx->cur_container = NULL;
589 ctx->used_transactionals = 0; 589 ctx->used_transactionals = 0;
590 ctx->script_header = ""; 590 ctx->script_header = "";
591 ctx->hasPostBody = 0; 591 ctx->isPost = ctx->hasPostBody = 0;
592 ctx->queryString = NULL; 592 ctx->queryString = NULL;
593 } 593 }
594 594
595 void uw_reset_keep_request(uw_context ctx) { 595 void uw_reset_keep_request(uw_context ctx) {
596 uw_reset_keep_error_message(ctx); 596 uw_reset_keep_error_message(ctx);
3601 3601
3602 int uw_hasPostBody(uw_context ctx) { 3602 int uw_hasPostBody(uw_context ctx) {
3603 return ctx->hasPostBody; 3603 return ctx->hasPostBody;
3604 } 3604 }
3605 3605
3606 void uw_isPost(uw_context ctx) {
3607 ctx->isPost = 1;
3608 }
3609
3610 uw_Basis_bool uw_Basis_currentUrlHasPost(uw_context ctx) {
3611 return ctx->isPost;
3612 }
3613
3606 void uw_setQueryString(uw_context ctx, uw_Basis_string s) { 3614 void uw_setQueryString(uw_context ctx, uw_Basis_string s) {
3607 ctx->queryString = s; 3615 ctx->queryString = s;
3608 } 3616 }
3609 3617
3610 uw_Basis_string uw_queryString(uw_context ctx) { 3618 uw_Basis_string uw_queryString(uw_context ctx) {