chiark / gitweb /
Return from login page to what you were trying to do
[disorder] / server / cgi.c
index ff45ae7c596a97a922b944f5427eea5b048d984b..5f9e17fcd1e278983212cccbf759b14533034623 100644 (file)
 #include "unicode.h"
 #include "hash.h"
 
-struct kvp *cgi_args;
-
-/* options */
-struct column {
-  struct column *next;
-  char *name;
-  int ncolumns;
-  char **columns;
-};
-
-/* macros */
-struct cgi_macro {
-  int nargs;
-  char **args;
-  const char *value;
-};
-
-#define RELIST(x) struct re *x, **x##_tail = &x
-
-static int have_read_options;
-static struct kvp *labels;
-static struct column *columns;
-
-static void include_options(const char *name);
-static void cgi_expand_parsed(const char *name,
-                             struct cgi_element *head,
-                             const struct cgi_expansion *expansions,
-                             size_t nexpansions,
-                             cgi_1sink *output,
-                             void *u);
-
 void cgi_header(struct sink *output, const char *name, const char *value) {
   sink_printf(output, "%s: %s\r\n", name, value);
 }
@@ -94,51 +63,6 @@ void cgi_body(struct sink *output) {
   sink_printf(output, "\r\n");
 }
 
-const char *cgi_label(const char *key) {
-  const char *label;
-
-  read_options();
-  if(!(label = kvp_get(labels, key))) {
-    /* No label found */
-    if(!strncmp(key, "images.", 7)) {
-      static const char *url_static;
-      /* images.X defaults to <url.static>X.png */
-
-      if(!url_static)
-       url_static = cgi_label("url.static");
-      byte_xasprintf((char **)&label, "%s%s.png", url_static, key + 7);
-    } else if((label = strchr(key, '.')))
-      /* X.Y defaults to Y */
-      ++label;
-    else
-      /* otherwise default to label name */
-      label = key;
-  }
-  return label;
-}
-
-int cgi_label_exists(const char *key) {
-  read_options();
-  return kvp_get(labels, key) ? 1 : 0;
-}
-
-char **cgi_columns(const char *name, int *ncolumns) {
-  struct column *c;
-
-  read_options();
-  for(c = columns; c && strcmp(name, c->name); c = c->next)
-    ;
-  if(c) {
-    if(ncolumns)
-      *ncolumns = c->ncolumns;
-    return c->columns;
-  } else {
-    if(ncolumns)
-      *ncolumns = 0;
-    return 0;
-  }
-}
-
 /*
 Local Variables:
 c-basic-offset:2