summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/alloc.h1
-rw-r--r--src/bfstd.c6
-rw-r--r--src/bftw.c1
-rw-r--r--src/color.h1
-rw-r--r--src/ctx.c1
-rw-r--r--src/ctx.h2
-rw-r--r--src/diag.c2
-rw-r--r--src/dir.h4
-rw-r--r--src/dstring.c2
-rw-r--r--src/eval.c4
-rw-r--r--src/expr.c4
-rw-r--r--src/expr.h1
-rw-r--r--src/ioq.c5
-rw-r--r--src/main.c1
-rw-r--r--src/opt.c3
-rw-r--r--src/parse.c3
-rw-r--r--src/printf.c3
-rw-r--r--src/trie.c2
-rw-r--r--src/trie.h1
-rw-r--r--src/xspawn.c1
-rw-r--r--src/xtime.c1
21 files changed, 26 insertions, 23 deletions
diff --git a/src/alloc.h b/src/alloc.h
index 60dd738..ae055bc 100644
--- a/src/alloc.h
+++ b/src/alloc.h
@@ -10,6 +10,7 @@
#include "config.h"
#include <errno.h>
+#include <stddef.h>
#include <stdlib.h>
/** Check if a size is properly aligned. */
diff --git a/src/bfstd.c b/src/bfstd.c
index ce4aa49..c6c2e7f 100644
--- a/src/bfstd.c
+++ b/src/bfstd.c
@@ -2,18 +2,19 @@
// SPDX-License-Identifier: 0BSD
#include "bfstd.h"
-#include "bit.h"
#include "config.h"
#include "diag.h"
#include "sanity.h"
#include "thread.h"
#include "xregex.h"
-#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <langinfo.h>
+#include <limits.h>
#include <locale.h>
#include <nl_types.h>
+#include <pthread.h>
+#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
@@ -24,7 +25,6 @@
#include <sys/wait.h>
#include <unistd.h>
#include <wchar.h>
-#include <wctype.h>
#if BFS_USE_SYS_SYSMACROS_H
# include <sys/sysmacros.h>
diff --git a/src/bftw.c b/src/bftw.c
index 6f52299..50b8b02 100644
--- a/src/bftw.c
+++ b/src/bftw.c
@@ -35,6 +35,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
+#include <sys/types.h>
/** Initialize a bftw_stat cache. */
static void bftw_stat_init(struct bftw_stat *bufs, struct bfs_stat *stat_buf, struct bfs_stat *lstat_buf) {
diff --git a/src/color.h b/src/color.h
index 85633a4..e3e7973 100644
--- a/src/color.h
+++ b/src/color.h
@@ -10,7 +10,6 @@
#include "config.h"
#include "dstring.h"
-#include <stdarg.h>
#include <stdio.h>
/**
diff --git a/src/ctx.c b/src/ctx.c
index 6c84f75..f5b28c7 100644
--- a/src/ctx.c
+++ b/src/ctx.c
@@ -6,6 +6,7 @@
#include "color.h"
#include "diag.h"
#include "expr.h"
+#include "list.h"
#include "mtab.h"
#include "pwcache.h"
#include "stat.h"
diff --git a/src/ctx.h b/src/ctx.h
index aa91f2c..e14db21 100644
--- a/src/ctx.h
+++ b/src/ctx.h
@@ -18,6 +18,8 @@
#include <sys/resource.h>
#include <time.h>
+struct CFILE;
+
/**
* The execution context for bfs.
*/
diff --git a/src/diag.c b/src/diag.c
index 656fa89..cb27b92 100644
--- a/src/diag.c
+++ b/src/diag.c
@@ -11,8 +11,8 @@
#include "expr.h"
#include <errno.h>
#include <stdarg.h>
+#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
/** bfs_diagf() implementation. */
attr(printf(2, 0))
diff --git a/src/dir.h b/src/dir.h
index b11d454..18d907e 100644
--- a/src/dir.h
+++ b/src/dir.h
@@ -8,8 +8,6 @@
#ifndef BFS_DIR_H
#define BFS_DIR_H
-#include "alloc.h"
-#include "config.h"
#include <sys/types.h>
/**
@@ -78,6 +76,8 @@ struct bfs_dirent {
*/
struct bfs_dir *bfs_allocdir(void);
+struct arena;
+
/**
* Initialize an arena for directories.
*
diff --git a/src/dstring.c b/src/dstring.c
index bc18308..10b0fad 100644
--- a/src/dstring.c
+++ b/src/dstring.c
@@ -7,6 +7,8 @@
#include "config.h"
#include "diag.h"
#include <stdarg.h>
+#include <stddef.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/src/eval.c b/src/eval.c
index 1711001..9e55964 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -25,7 +25,6 @@
#include "stat.h"
#include "trie.h"
#include "xregex.h"
-#include "xtime.h"
#include <errno.h>
#include <fcntl.h>
#include <fnmatch.h>
@@ -36,8 +35,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <strings.h>
#include <sys/resource.h>
-#include <sys/stat.h>
+#include <sys/types.h>
#include <time.h>
#include <unistd.h>
#include <wchar.h>
diff --git a/src/expr.c b/src/expr.c
index 3e0033f..5784220 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -4,12 +4,12 @@
#include "expr.h"
#include "alloc.h"
#include "ctx.h"
+#include "diag.h"
#include "eval.h"
#include "exec.h"
+#include "list.h"
#include "printf.h"
#include "xregex.h"
-#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
struct bfs_expr *bfs_expr_new(struct bfs_ctx *ctx, bfs_eval_fn *eval_fn, size_t argc, char **argv) {
diff --git a/src/expr.h b/src/expr.h
index 957b04a..75cb5fd 100644
--- a/src/expr.h
+++ b/src/expr.h
@@ -12,7 +12,6 @@
#include "config.h"
#include "eval.h"
#include "stat.h"
-#include <stddef.h>
#include <sys/types.h>
#include <time.h>
diff --git a/src/ioq.c b/src/ioq.c
index 00c3b86..37eed7d 100644
--- a/src/ioq.c
+++ b/src/ioq.c
@@ -126,13 +126,14 @@
#include "config.h"
#include "diag.h"
#include "dir.h"
-#include "sanity.h"
#include "stat.h"
#include "thread.h"
-#include <assert.h>
#include <errno.h>
+#include <fcntl.h>
#include <pthread.h>
+#include <stdint.h>
#include <stdlib.h>
+#include <sys/stat.h>
#if BFS_USE_LIBURING
# include <liburing.h>
diff --git a/src/main.c b/src/main.c
index 16a2576..e120f03 100644
--- a/src/main.c
+++ b/src/main.c
@@ -48,6 +48,7 @@
#include "bfstd.h"
#include "config.h"
#include "ctx.h"
+#include "diag.h"
#include "eval.h"
#include "parse.h"
#include <errno.h>
diff --git a/src/opt.c b/src/opt.c
index 74145ac..76965de 100644
--- a/src/opt.c
+++ b/src/opt.c
@@ -26,11 +26,13 @@
*/
#include "opt.h"
+#include "bftw.h"
#include "bit.h"
#include "color.h"
#include "config.h"
#include "ctx.h"
#include "diag.h"
+#include "dir.h"
#include "eval.h"
#include "exec.h"
#include "expr.h"
@@ -40,7 +42,6 @@
#include <limits.h>
#include <stdarg.h>
#include <stdio.h>
-#include <string.h>
#include <unistd.h>
static char *fake_and_arg = "-and";
diff --git a/src/parse.c b/src/parse.c
index b26a50f..3b7386d 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -42,8 +42,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
-#include <sys/time.h>
-#include <sys/wait.h>
+#include <sys/types.h>
#include <time.h>
#include <unistd.h>
diff --git a/src/printf.c b/src/printf.c
index 34ed606..487f039 100644
--- a/src/printf.c
+++ b/src/printf.c
@@ -2,6 +2,7 @@
// SPDX-License-Identifier: 0BSD
#include "printf.h"
+#include "alloc.h"
#include "bfstd.h"
#include "bftw.h"
#include "color.h"
@@ -14,10 +15,10 @@
#include "mtab.h"
#include "pwcache.h"
#include "stat.h"
-#include "xtime.h"
#include <errno.h>
#include <grp.h>
#include <pwd.h>
+#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/src/trie.c b/src/trie.c
index bd5300d..1ffb23a 100644
--- a/src/trie.c
+++ b/src/trie.c
@@ -87,9 +87,7 @@
#include "config.h"
#include "diag.h"
#include "list.h"
-#include <limits.h>
#include <stdint.h>
-#include <stdlib.h>
#include <string.h>
bfs_static_assert(CHAR_WIDTH == 8);
diff --git a/src/trie.h b/src/trie.h
index 02088f1..4288d76 100644
--- a/src/trie.h
+++ b/src/trie.h
@@ -5,7 +5,6 @@
#define BFS_TRIE_H
#include "alloc.h"
-#include "config.h"
#include "list.h"
#include <stddef.h>
#include <stdint.h>
diff --git a/src/xspawn.c b/src/xspawn.c
index 8d6108b..6a94d3d 100644
--- a/src/xspawn.c
+++ b/src/xspawn.c
@@ -12,7 +12,6 @@
#include <string.h>
#include <sys/resource.h>
#include <sys/types.h>
-#include <sys/wait.h>
#include <unistd.h>
#if BFS_USE_PATHS_H
diff --git a/src/xtime.c b/src/xtime.c
index 05f0e1a..5b259ab 100644
--- a/src/xtime.c
+++ b/src/xtime.c
@@ -7,7 +7,6 @@
#include "diag.h"
#include <errno.h>
#include <limits.h>
-#include <stdlib.h>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>