chiark
/
gitweb
/
~mdw
/
disorder
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Almost compiles, will not work though
[disorder]
/
server
/
options.c
diff --git
a/server/options.c
b/server/options.c
index 88fc9bfd8d091b463bd867f160e74380a58e7cbd..e3cf7b89d57fe9c6660d651f365ae566fb2ffb0b 100644
(file)
--- a/
server/options.c
+++ b/
server/options.c
@@
-25,6
+25,9
@@
#include "types.h"
#include <stdio.h>
#include "types.h"
#include <stdio.h>
+#include <stddef.h>
+#include <errno.h>
+#include <string.h>
#include "mem.h"
#include "hash.h"
#include "mem.h"
#include "hash.h"
@@
-32,15
+35,25
@@
#include "options.h"
#include "split.h"
#include "table.h"
#include "options.h"
#include "split.h"
#include "table.h"
+#include "log.h"
+#include "inputline.h"
+#include "printf.h"
struct column {
int ncolumns;
char **columns;
};
struct column {
int ncolumns;
char **columns;
};
+struct read_options_state {
+ const char *name;
+ int line;
+};
+
static hash *labels;
static hash *columns;
static hash *labels;
static hash *columns;
+static void option__readfile(const char *name);
+
static void option__label(int attribute((unused)) nvec,
char **vec) {
option_set(vec[0], vec[1]);
static void option__label(int attribute((unused)) nvec,
char **vec) {
option_set(vec[0], vec[1]);
@@
-65,9
+78,9
@@
static struct option {
int minargs, maxargs;
void (*handler)(int nvec, char **vec);
} options[] = {
int minargs, maxargs;
void (*handler)(int nvec, char **vec);
} options[] = {
- { "columns", 1, INT_MAX, option_columns },
- { "include", 1, 1, option_include },
- { "label", 2, 2, option_label },
+ { "columns", 1, INT_MAX, option_
_
columns },
+ { "include", 1, 1, option_
_
include },
+ { "label", 2, 2, option_
_
label },
};
static void option__split_error(const char *msg,
};
static void option__split_error(const char *msg,
@@
-79,11
+92,9
@@
static void option__split_error(const char *msg,
static void option__readfile(const char *name) {
int n, i;
static void option__readfile(const char *name) {
int n, i;
- int fd;
FILE *fp;
char **vec, *buffer;
struct read_options_state cs;
FILE *fp;
char **vec, *buffer;
struct read_options_state cs;
- const char *path;
if(!(cs.name = mx_find(name)))
return;
if(!(cs.name = mx_find(name)))
return;