Probably about time I had a central header file containing misc stuff.
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sun, 2 Nov 2008 10:35:18 +0000 (10:35 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sun, 2 Nov 2008 10:35:18 +0000 (10:35 +0000)
git-svn-id: svn://svn.tartarus.org/sgt/agedu@8251 cda61777-01e9-0310-a592-d414129be87e

agedu.c
agedu.h [new file with mode: 0644]
html.c
malloc.c
trie.c

diff --git a/agedu.c b/agedu.c
index d015824..83f8ead 100644 (file)
--- a/agedu.c
+++ b/agedu.c
@@ -20,6 +20,7 @@
 #include <sys/ioctl.h>
 #include <fnmatch.h>
 
+#include "agedu.h"
 #include "du.h"
 #include "trie.h"
 #include "index.h"
 #include "httpd.h"
 #include "fgetline.h"
 
-#define PNAME "agedu"
-
-#define lenof(x) (sizeof((x))/sizeof(*(x)))
-
 /*
  * Path separator. This global variable affects the behaviour of
  * various parts of the code when they need to deal with path
diff --git a/agedu.h b/agedu.h
new file mode 100644 (file)
index 0000000..21c015a
--- /dev/null
+++ b/agedu.h
@@ -0,0 +1,9 @@
+/*
+ * Central header file for agedu, defining various useful things.
+ */
+
+#define PNAME "agedu"
+
+#define lenof(x) (sizeof((x))/sizeof(*(x)))
+
+extern char pathsep;
diff --git a/html.c b/html.c
index 0d80eae..f7f8c3e 100644 (file)
--- a/html.c
+++ b/html.c
 #include <limits.h>
 #include <time.h>
 
+#include "agedu.h"
 #include "html.h"
 #include "malloc.h"
 #include "trie.h"
 #include "index.h"
 
-#define lenof(x) ( sizeof((x)) / sizeof(*(x)) )
-
 #define MAXCOLOUR 511
 
-extern char pathsep;
-
 struct html {
     char *buf;
     size_t buflen, bufsize;
index f326e6d..7de2e13 100644 (file)
--- a/malloc.c
+++ b/malloc.c
@@ -9,10 +9,9 @@
 #include <assert.h>
 #include <stdio.h>
 
+#include "agedu.h"
 #include "malloc.h"
 
-#define lenof(x) (sizeof((x))/sizeof(*(x)))
-
 extern void fatal(const char *, ...);
 
 void *smalloc(size_t size) {
diff --git a/trie.c b/trie.c
index 0466a34..b044df4 100644 (file)
--- a/trie.c
+++ b/trie.c
 #include <sys/types.h>
 #include <unistd.h>
 
+#include "agedu.h"
 #include "malloc.h"
 #include "trie.h"
 
 #define alignof(typ) ( offsetof(struct { char c; typ t; }, t) )
 
-extern char pathsep;
-
 /*
  * Compare functions for pathnames. Returns the relative order of
  * the names, like strcmp; also passes back the offset of the