summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-12-11 22:52:06 -0800
committerKaz Kylheku <kaz@kylheku.com>2018-12-11 22:52:06 -0800
commitb07ecc142c6251517be5f4af9c76ba539b54eecc (patch)
treed0f6d56e775ef3ae766fc7adcad8b82499f0b3c5
parent2938a0d7e64e2adad3db0988689635e81ad91739 (diff)
downloadtxr-b07ecc142c6251517be5f4af9c76ba539b54eecc.tar.gz
txr-b07ecc142c6251517be5f4af9c76ba539b54eecc.tar.bz2
txr-b07ecc142c6251517be5f4af9c76ba539b54eecc.zip
Drastically reduce inclusion of <dirent.h>.
The <dirent.h> header is included all over the place because it is needed by a single declaration in stream.h. That declaration is for a function that is only called within stream.c, so we make it internal. Now only stream.c has to include <dirent.h>. * buf.c, debug.c, eval.c, ffi.c, filter.c, gc.c, gencadr.txr, hash.c, lib.c, lisplib.c, match.c, parser.c, regex.c, socket.c, struct.c, strudel.c, sysif.c, syslog.c, termios.c, txr.c, unwind.c, vm.c: Remove #include <dirent.h>. * cadr.c: Regenerated. * stream.c (make_dir_stream): Make external function static. * stream.h (make_dir_stream): Declaration updated.
-rw-r--r--buf.c1
-rw-r--r--cadr.c1
-rw-r--r--debug.c1
-rw-r--r--eval.c1
-rw-r--r--ffi.c1
-rw-r--r--filter.c1
-rw-r--r--gc.c1
-rw-r--r--gencadr.txr1
-rw-r--r--hash.c1
-rw-r--r--lib.c1
-rw-r--r--lisplib.c1
-rw-r--r--match.c1
-rw-r--r--parser.c1
-rw-r--r--regex.c1
-rw-r--r--socket.c1
-rw-r--r--stream.c2
-rw-r--r--stream.h1
-rw-r--r--struct.c1
-rw-r--r--strudel.c1
-rw-r--r--sysif.c1
-rw-r--r--syslog.c1
-rw-r--r--termios.c1
-rw-r--r--txr.c1
-rw-r--r--unwind.c1
-rw-r--r--vm.c1
25 files changed, 1 insertions, 25 deletions
diff --git a/buf.c b/buf.c
index 02afcff4..a1d76960 100644
--- a/buf.c
+++ b/buf.c
@@ -34,7 +34,6 @@
#include <stdarg.h>
#include <signal.h>
#include <stdio.h>
-#include <dirent.h>
#include "config.h"
#include "lib.h"
#include "gc.h"
diff --git a/cadr.c b/cadr.c
index 647b3637..2c726019 100644
--- a/cadr.c
+++ b/cadr.c
@@ -28,7 +28,6 @@
*/
#include <stdio.h>
-#include <dirent.h>
#include <stdarg.h>
#include <stdlib.h>
#include <limits.h>
diff --git a/debug.c b/debug.c
index 83e79bf8..d7dd8791 100644
--- a/debug.c
+++ b/debug.c
@@ -27,7 +27,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <dirent.h>
#include <stdarg.h>
#include <wchar.h>
#include <signal.h>
diff --git a/eval.c b/eval.c
index 8e9fb067..b26dc5b1 100644
--- a/eval.c
+++ b/eval.c
@@ -28,7 +28,6 @@
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
-#include <dirent.h>
#include <stdarg.h>
#include <wchar.h>
#include <signal.h>
diff --git a/ffi.c b/ffi.c
index 27db9a88..7bf5cad8 100644
--- a/ffi.c
+++ b/ffi.c
@@ -35,7 +35,6 @@
#include <string.h>
#include <signal.h>
#include <wchar.h>
-#include <dirent.h>
#include <time.h>
#include "config.h"
#if HAVE_LIBFFI
diff --git a/filter.c b/filter.c
index 32ea175b..69a3e567 100644
--- a/filter.c
+++ b/filter.c
@@ -29,7 +29,6 @@
#include <wctype.h>
#include <wchar.h>
#include <stdarg.h>
-#include <dirent.h>
#include <stdio.h>
#include <signal.h>
#include "config.h"
diff --git a/gc.c b/gc.c
index 1359ea0f..0832d446 100644
--- a/gc.c
+++ b/gc.c
@@ -29,7 +29,6 @@
#include <stdlib.h>
#include <stdarg.h>
#include <assert.h>
-#include <dirent.h>
#include <wchar.h>
#include <signal.h>
#include "config.h"
diff --git a/gencadr.txr b/gencadr.txr
index 97ee08f7..650a0100 100644
--- a/gencadr.txr
+++ b/gencadr.txr
@@ -22,7 +22,6 @@
@{c-copyright "\n"}
#include <stdio.h>
-#include <dirent.h>
#include <stdarg.h>
#include <stdlib.h>
#include <limits.h>
diff --git a/hash.c b/hash.c
index 061706a0..60b045c0 100644
--- a/hash.c
+++ b/hash.c
@@ -27,7 +27,6 @@
#include <stddef.h>
#include <stdio.h>
-#include <dirent.h>
#include <stdarg.h>
#include <stdlib.h>
#include <limits.h>
diff --git a/lib.c b/lib.c
index d06a71b1..0c20f912 100644
--- a/lib.c
+++ b/lib.c
@@ -32,7 +32,6 @@
#include <wctype.h>
#include <limits.h>
#include <stdarg.h>
-#include <dirent.h>
#include <errno.h>
#include <wchar.h>
#include <math.h>
diff --git a/lisplib.c b/lisplib.c
index 86f03ccb..51abee97 100644
--- a/lisplib.c
+++ b/lisplib.c
@@ -27,7 +27,6 @@
#include <stdio.h>
#include <wchar.h>
-#include <dirent.h>
#include <stdarg.h>
#include <signal.h>
#include "config.h"
diff --git a/match.c b/match.c
index 0d4e496b..c55daaef 100644
--- a/match.c
+++ b/match.c
@@ -28,7 +28,6 @@
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
-#include <dirent.h>
#include <stdarg.h>
#include <wchar.h>
#include <signal.h>
diff --git a/parser.c b/parser.c
index 1714d18b..9271f03a 100644
--- a/parser.c
+++ b/parser.c
@@ -28,7 +28,6 @@
#include <stdio.h>
#include <assert.h>
#include <limits.h>
-#include <dirent.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
diff --git a/regex.c b/regex.c
index cb8e391d..0ce9cf7a 100644
--- a/regex.c
+++ b/regex.c
@@ -30,7 +30,6 @@
#include <string.h>
#include <wchar.h>
#include <assert.h>
-#include <dirent.h>
#include <limits.h>
#include <signal.h>
#include <stdarg.h>
diff --git a/socket.c b/socket.c
index ace6944a..97c7b690 100644
--- a/socket.c
+++ b/socket.c
@@ -32,7 +32,6 @@
#include <string.h>
#include <wchar.h>
#include <signal.h>
-#include <dirent.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
diff --git a/stream.c b/stream.c
index 57245de1..fb0b9fc1 100644
--- a/stream.c
+++ b/stream.c
@@ -1702,7 +1702,7 @@ static struct strm_ops dir_ops =
dir_clear_error,
0);
-val make_dir_stream(DIR *dir)
+static val make_dir_stream(DIR *dir)
{
struct dir_handle *h = coerce(struct dir_handle *, chk_malloc(sizeof *h));
strm_base_init(&h->a);
diff --git a/stream.h b/stream.h
index 12750639..42a1464e 100644
--- a/stream.h
+++ b/stream.h
@@ -172,7 +172,6 @@ val make_string_output_stream(void);
val get_string_from_stream(val);
val make_strlist_output_stream(void);
val get_list_from_stream(val);
-val make_dir_stream(DIR *);
val record_adapter(val regex, val stream, val include_match);
val streamp(val obj);
val real_time_stream_p(val obj);
diff --git a/struct.c b/struct.c
index 41773692..dbff36a1 100644
--- a/struct.c
+++ b/struct.c
@@ -28,7 +28,6 @@
#include <stddef.h>
#include <stdio.h>
#include <string.h>
-#include <dirent.h>
#include <stdarg.h>
#include <stdlib.h>
#include <limits.h>
diff --git a/strudel.c b/strudel.c
index f30cd4e5..e2f49d69 100644
--- a/strudel.c
+++ b/strudel.c
@@ -31,7 +31,6 @@
#include <stdarg.h>
#include <wchar.h>
#include <signal.h>
-#include <dirent.h>
#include <syslog.h>
#include "config.h"
#include ALLOCA_H
diff --git a/sysif.c b/sysif.c
index b3b9c5b9..5ba65ebf 100644
--- a/sysif.c
+++ b/sysif.c
@@ -31,7 +31,6 @@
#include <string.h>
#include <wchar.h>
#include <signal.h>
-#include <dirent.h>
#include <errno.h>
#include <time.h>
#include "config.h"
diff --git a/syslog.c b/syslog.c
index af46bce3..cd2e8ca8 100644
--- a/syslog.c
+++ b/syslog.c
@@ -31,7 +31,6 @@
#include <stdarg.h>
#include <wchar.h>
#include <signal.h>
-#include <dirent.h>
#include <syslog.h>
#include "config.h"
#include ALLOCA_H
diff --git a/termios.c b/termios.c
index a8db3c38..ce2ed01a 100644
--- a/termios.c
+++ b/termios.c
@@ -32,7 +32,6 @@
#include <string.h>
#include <wchar.h>
#include <signal.h>
-#include <dirent.h>
#include <errno.h>
#include "config.h"
#include <termios.h>
diff --git a/txr.c b/txr.c
index 8c9283d1..81174891 100644
--- a/txr.c
+++ b/txr.c
@@ -28,7 +28,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
-#include <dirent.h>
#include <stdarg.h>
#include <wchar.h>
#include <signal.h>
diff --git a/unwind.c b/unwind.c
index 43be43fb..34ce8792 100644
--- a/unwind.c
+++ b/unwind.c
@@ -30,7 +30,6 @@
#include <stdlib.h>
#include <string.h>
#include <assert.h>
-#include <dirent.h>
#include <stdarg.h>
#include <signal.h>
#include "config.h"
diff --git a/vm.c b/vm.c
index 7aa463c9..331f0814 100644
--- a/vm.c
+++ b/vm.c
@@ -28,7 +28,6 @@
#include <stddef.h>
#include <stdio.h>
#include <string.h>
-#include <dirent.h>
#include <stdarg.h>
#include <stdlib.h>
#include <limits.h>