chiark / gitweb /
cgi: remove obsolete 'columns' option.
authorRichard Kettlewell <rjk@terraraq.org.uk>
Sun, 7 Aug 2011 13:55:08 +0000 (14:55 +0100)
committerRichard Kettlewell <rjk@terraraq.org.uk>
Sun, 7 Aug 2011 13:55:08 +0000 (14:55 +0100)
Its functionality was replaced by the more sophisticated template
system ages ago.

cgi/disorder-cgi.h
cgi/options.c
doc/disorder_options.5.in
templates/Makefile.am
templates/options
templates/options.columns [deleted file]

index 4587e78795b7b17d2079563875b27e4bdba3cad3..77885781dcf8e31061d720fb92debb7b8c8c12a5 100644 (file)
@@ -77,7 +77,6 @@ struct queue_entry *dcgi_findtrack(const char *id);
 void option_set(const char *name, const char *value);
 const char *option_label(const char *key);
 int option_label_exists(const char *key);
-char **option_columns(const char *name, int *ncolumns);
 
 #define DCGI_QUEUE 0x0001
 #define DCGI_PLAYING 0x0002
index 5517c76b05077d5914e4110f1080fd3f3738f3a2..24038331d2bd29cbc5739611286c172e051029d7 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * This file is part of DisOrder.
- * Copyright (C) 2004-2008 Richard Kettlewell
+ * Copyright (C) 2004-2008, 2011 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
 
 #include "disorder-cgi.h"
 
-struct column {
-  int ncolumns;
-  char **columns;
-};
-
 struct read_options_state {
   const char *name;
   int line;
 };
 
 static hash *labels;
-static hash *columns;
 
 static void option__readfile(const char *name);
 
@@ -49,15 +43,6 @@ static void option__include(int attribute((unused)) nvec,
   option__readfile(vec[0]);
 }
 
-static void option__columns(int nvec,
-                          char **vec) {
-  struct column c;
-
-  c.ncolumns = nvec - 1;
-  c.columns = &vec[1];
-  hash_add(columns, vec[0], &c, HASH_INSERT_OR_REPLACE);
-}
-
 /** @brief Definition of an option command */
 static struct option {
   /** @brief Command name */
@@ -69,7 +54,6 @@ static struct option {
   /** @brief Command handler */
   void (*handler)(int nvec, char **vec);
 } options[] = {
-  { "columns", 1, INT_MAX, option__columns },
   { "include", 1, 1, option__include },
   { "label", 2, 2, option__label },
 };
@@ -124,7 +108,6 @@ static void option__init(void) {
   if(!have_read_options) {
     have_read_options = 1;
     labels = hash_new(sizeof (char *));
-    columns = hash_new(sizeof (struct column));
     option__readfile("options");
   }
 }
@@ -192,27 +175,6 @@ int option_label_exists(const char *key) {
   return !!hash_find(labels, key);
 }
 
-/** @brief Return a column list
- * @param name Context (playing/recent/etc)
- * @param ncolumns Where to store column count or NULL
- * @return Pointer to column list
- */
-char **option_columns(const char *name, int *ncolumns) {
-  struct column *c;
-
-  option__init();
-  c = hash_find(columns, name);
-  if(c) {
-    if(ncolumns)
-      *ncolumns = c->ncolumns;
-    return c->columns;
-  } else {
-    if(ncolumns)
-      *ncolumns = 0;
-    return 0;
-  }
-}
-
 /*
 Local Variables:
 c-basic-offset:2
index b8492b63bbe72e0789d0341c550c4be0f9c0a15f..242c0b080b3950aff5ec5a694ff3bf1ff3e86683 100644 (file)
@@ -1,5 +1,5 @@
 .\"
-.\" Copyright (C) 2008 Richard Kettlewell
+.\" Copyright (C) 2008, 2011 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
@@ -25,15 +25,6 @@ The general syntax is the same as the main configuration file (see
 .SH DIRECTIVES
 Valid directives are:
 .TP
-.B columns \fINAME\fR \fIHEADING\fR...
-Defines the columns used in \fB@playing@\fR and \fB@recent@\fB.
-\fINAME\fR must be either \fBplaying\fR, \fBrecent\fR or \fBsearch\fR.
-\fIHEADING\fR...  is a list of heading names.
-If a column is defined more than once then the last definitions is used.
-.IP
-The heading names \fBbutton\fR, \fBlength\fR, \fBwhen\fR and \fBwho\fR
-are built in.
-.TP
 .B include \fIPATH\fR
 Includes another file.
 If \fIPATH\fR starts with a \fB/\fR then it is taken as is, otherwise
@@ -54,7 +45,7 @@ Otherwise the whole name is used as the value.
 Labels are not individually documented here, see the shipped
 \fIoptions.labels\fR file instead.
 .SH "OPTION FILES"
-The shipped \fIoptions\fR file includes four standard options files.
+The shipped \fIoptions\fR file includes two standard options files.
 In order, they are:
 .TP
 .I options.labels
index 1f939476f9931df592aa61abfb19512c5f21253e..0ce7a540ad059bca5ee30f14aed3e3bdee310b64 100644 (file)
@@ -19,8 +19,7 @@
 pkgdata_DATA=about.tmpl choose.tmpl playing.tmpl recent.tmpl           \
             prefs.tmpl help.tmpl error.tmpl                    \
             new.tmpl login.tmpl macros.tmpl                            \
-            options options.labels                                     \
-            options.columns
+            options options.labels
 pkghttp_DATA=disorder.css
 
 EXTRA_DIST=${pkgdata_DATA} $(pkghttp_DATA)
index e7313b07492d1b1613041523d774d6948cfeb995..ff61a5461592ff7938aa2099dd7e1b831e78a5fc 100644 (file)
@@ -1,8 +1,5 @@
 # default label values
 include options.labels
 
-# default columns
-include options.columns
-
 # user overrides - you supply this
 include options.user
diff --git a/templates/options.columns b/templates/options.columns
deleted file mode 100644 (file)
index 53badbd..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-columns playing when who artist album title length button
-columns recent when who artist album title length
-columns search artist album title