chiark / gitweb /
Shift many cgi_ functions into lib/, and add a test for them. The
[disorder] / server / cgi.h
index 6c387d798b121466dff7d6ac6fe00f43c03acc0d..9fe27be30175a7c61ff686c97bb1c1c389acdd33 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * This file is part of DisOrder.
- * Copyright (C) 2004, 2005 Richard Kettlewell
+ * Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -18,8 +18,8 @@
  * USA
  */
 
-#ifndef CGI_H
-#define CGI_H
+#ifndef SERVER_CGI_H
+#define SERVER_CGI_H
 
 extern struct kvp *cgi_args;
 
@@ -65,6 +65,11 @@ struct cgi_expansion {
   void (*handler)(int nargs, char **args, cgi_sink *output, void *u);
 };
 
+void cgi_define(const char *name,
+               int nargs,
+               char **args,
+               const char *value);
+
 void cgi_expand(const char *name,
                const struct cgi_expansion *expansions,
                size_t nexpansions,
@@ -86,6 +91,8 @@ char *cgi_makeurl(const char *url, ...);
 const char *cgi_label(const char *key);
 /* look up the translated label @key@ */
 
+int cgi_label_exists(const char *key);
+
 char **cgi_columns(const char *name, int *nheadings);
 /* return the list of columns for @name@ */
 
@@ -97,7 +104,7 @@ const char *cgi_transform(const char *type,
 void cgi_set_option(const char *name, const char *value);
 /* set an option */
 
-#endif /* CGI_H */
+#endif /* SERVER_CGI_H */
 
 /*
 Local Variables: