changeset 1485:4300592e6803

Basis.currentUrlHasQueryString
author Adam Chlipala <adam@chlipala.net>
date Sun, 03 Jul 2011 16:21:04 -0400 (2011-07-03)
parents ae7547789c73
children 7f8ddcf12b20
files include/urweb.h lib/ur/basis.urs src/c/urweb.c
diffstat 3 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/include/urweb.h	Sat Jul 02 20:49:58 2011 -0430
+++ b/include/urweb.h	Sun Jul 03 16:21:04 2011 -0400
@@ -339,6 +339,7 @@
 
 void uw_isPost(uw_context);
 uw_Basis_bool uw_Basis_currentUrlHasPost(uw_context);
+uw_Basis_bool uw_Basis_currentUrlHasQueryString(uw_context);
 
 void uw_cutErrorLocation(char *);
 
--- a/lib/ur/basis.urs	Sat Jul 02 20:49:58 2011 -0430
+++ b/lib/ur/basis.urs	Sun Jul 03 16:21:04 2011 -0400
@@ -655,6 +655,7 @@
 val checkUrl : string -> option url
 val currentUrl : transaction url
 val currentUrlHasPost : transaction bool
+val currentUrlHasQueryString : transaction bool
 val url : transaction page -> url
 val effectfulUrl : (option queryString -> transaction page) -> url
 val redirect : t ::: Type -> url -> transaction t
--- a/src/c/urweb.c	Sat Jul 02 20:49:58 2011 -0430
+++ b/src/c/urweb.c	Sun Jul 03 16:21:04 2011 -0400
@@ -3802,6 +3802,10 @@
   return ctx->isPost;
 }
 
+uw_Basis_bool uw_Basis_currentUrlHasQueryString(uw_context ctx) {
+  return ctx->queryString != NULL && ctx->queryString[0] != 0;
+}
+
 void uw_setQueryString(uw_context ctx, uw_Basis_string s) {
   ctx->queryString = s;
 }