summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2020-11-12 23:03:10 -0500
committerTavian Barnes <tavianator@tavianator.com>2020-11-12 23:03:10 -0500
commit0a2852c4cd8a8fb95b4a3ba84d768c774186adc1 (patch)
treef7b107086812336e959806c7829cd31d04685d77
parent3fc709530adbede1744a6d785598f8456d5f2626 (diff)
downloadbfs-0a2852c4cd8a8fb95b4a3ba84d768c774186adc1.tar.xz
Include what I use
Thanks to https://github.com/include-what-you-use/include-what-you-use
-rw-r--r--bar.c1
-rw-r--r--bftw.c4
-rw-r--r--bftw.h1
-rw-r--r--color.c3
-rw-r--r--color.h1
-rw-r--r--ctx.c4
-rw-r--r--ctx.h1
-rw-r--r--diag.c2
-rw-r--r--eval.c2
-rw-r--r--exec.c3
-rw-r--r--fsade.c3
-rw-r--r--fsade.h3
-rw-r--r--main.c2
-rw-r--r--mtab.c2
-rw-r--r--mtab.h3
-rw-r--r--opt.c2
-rw-r--r--opt.h2
-rw-r--r--parse.c7
-rw-r--r--parse.h2
-rw-r--r--printf.c6
-rw-r--r--printf.h1
-rw-r--r--pwcache.c1
-rw-r--r--spawn.c1
-rw-r--r--spawn.h2
-rw-r--r--stat.c1
-rw-r--r--tests/mksock.c3
-rw-r--r--tests/trie.c1
-rw-r--r--trie.h1
-rw-r--r--util.c2
29 files changed, 31 insertions, 36 deletions
diff --git a/bar.c b/bar.c
index 9cb08d3..e1e2857 100644
--- a/bar.c
+++ b/bar.c
@@ -21,6 +21,7 @@
#include <fcntl.h>
#include <limits.h>
#include <signal.h>
+#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <sys/ioctl.h>
diff --git a/bftw.c b/bftw.c
index 8d561ff..5a38066 100644
--- a/bftw.c
+++ b/bftw.c
@@ -37,6 +37,7 @@
#include "bftw.h"
#include "dstring.h"
+#include "mtab.h"
#include "stat.h"
#include "trie.h"
#include "util.h"
@@ -44,11 +45,10 @@
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
-#include <limits.h>
#include <stdbool.h>
-#include <stdint.h>
#include <stdlib.h>
#include <string.h>
+#include <sys/stat.h>
#include <unistd.h>
/**
diff --git a/bftw.h b/bftw.h
index 687a4c5..098d12c 100644
--- a/bftw.h
+++ b/bftw.h
@@ -21,7 +21,6 @@
#ifndef BFS_BFTW_H
#define BFS_BFTW_H
-#include "mtab.h"
#include "stat.h"
#include <stddef.h>
#include <sys/types.h>
diff --git a/color.c b/color.c
index 24c7f4b..206dc95 100644
--- a/color.c
+++ b/color.c
@@ -24,12 +24,13 @@
#include "util.h"
#include <assert.h>
#include <errno.h>
+#include <fcntl.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/stat.h>
+#include <time.h>
#include <unistd.h>
/**
diff --git a/color.h b/color.h
index e6ee49d..fabac13 100644
--- a/color.h
+++ b/color.h
@@ -21,7 +21,6 @@
#ifndef BFS_COLOR_H
#define BFS_COLOR_H
-#include "bftw.h"
#include "util.h"
#include <stdarg.h>
#include <stdbool.h>
diff --git a/ctx.c b/ctx.c
index 2fc7cb1..26619d7 100644
--- a/ctx.c
+++ b/ctx.c
@@ -15,15 +15,17 @@
****************************************************************************/
#include "ctx.h"
+#include "color.h"
#include "darray.h"
#include "diag.h"
#include "expr.h"
#include "mtab.h"
#include "pwcache.h"
+#include "stat.h"
#include "trie.h"
-#include <assert.h>
#include <errno.h>
#include <limits.h>
+#include <stdio.h>
#include <stdlib.h>
struct bfs_ctx *bfs_ctx_new(void) {
diff --git a/ctx.h b/ctx.h
index 2046ce6..39b3330 100644
--- a/ctx.h
+++ b/ctx.h
@@ -23,6 +23,7 @@
#include "bftw.h"
#include "trie.h"
+#include <stdbool.h>
/**
* Various debugging flags.
diff --git a/diag.c b/diag.c
index 66609e1..bbf07e3 100644
--- a/diag.c
+++ b/diag.c
@@ -21,8 +21,6 @@
#include <assert.h>
#include <errno.h>
#include <stdarg.h>
-#include <stdlib.h>
-#include <string.h>
void bfs_perror(const struct bfs_ctx *ctx, const char *str) {
bfs_error(ctx, "%s: %m.\n", str);
diff --git a/eval.c b/eval.c
index 6c15503..0503b14 100644
--- a/eval.c
+++ b/eval.c
@@ -22,6 +22,7 @@
#include "bar.h"
#include "bftw.h"
#include "color.h"
+#include "ctx.h"
#include "darray.h"
#include "diag.h"
#include "dstring.h"
@@ -42,6 +43,7 @@
#include <fnmatch.h>
#include <grp.h>
#include <pwd.h>
+#include <regex.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
diff --git a/exec.c b/exec.c
index 625cdd5..71605e0 100644
--- a/exec.c
+++ b/exec.c
@@ -25,12 +25,11 @@
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
-#include <limits.h>
#include <stdarg.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
diff --git a/fsade.c b/fsade.c
index efe5092..b56a11d 100644
--- a/fsade.c
+++ b/fsade.c
@@ -18,8 +18,9 @@
#include "bftw.h"
#include "dstring.h"
#include "util.h"
-#include <assert.h>
#include <errno.h>
+#include <fcntl.h>
+#include <stddef.h>
#include <unistd.h>
#if BFS_CAN_CHECK_ACL
diff --git a/fsade.h b/fsade.h
index 3136608..e964112 100644
--- a/fsade.h
+++ b/fsade.h
@@ -22,7 +22,6 @@
#ifndef BFS_FSADE_H
#define BFS_FSADE_H
-#include "bftw.h"
#include "util.h"
#include <stdbool.h>
@@ -37,6 +36,8 @@
#define BFS_CAN_CHECK_XATTRS (BFS_HAS_SYS_EXTATTR || BFS_HAS_SYS_XATTR)
+struct BFTW;
+
/**
* Check if a file has a non-trivial Access Control List.
*
diff --git a/main.c b/main.c
index 2d6649e..56974e6 100644
--- a/main.c
+++ b/main.c
@@ -52,10 +52,10 @@
#include "ctx.h"
#include "eval.h"
#include "parse.h"
-#include "util.h"
#include <errno.h>
#include <fcntl.h>
#include <locale.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/mtab.c b/mtab.c
index 4f1b9be..91a40aa 100644
--- a/mtab.c
+++ b/mtab.c
@@ -16,6 +16,7 @@
#include "mtab.h"
#include "darray.h"
+#include "stat.h"
#include "trie.h"
#include "util.h"
#include <errno.h>
@@ -23,7 +24,6 @@
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/stat.h>
#include <sys/types.h>
#if BFS_HAS_SYS_PARAM
diff --git a/mtab.h b/mtab.h
index 1f2f70f..807539d 100644
--- a/mtab.h
+++ b/mtab.h
@@ -21,9 +21,10 @@
#ifndef BFS_MTAB_H
#define BFS_MTAB_H
-#include "stat.h"
#include <stdbool.h>
+struct bfs_stat;
+
/**
* A file system mount table.
*/
diff --git a/opt.c b/opt.c
index f94e723..96b99da 100644
--- a/opt.c
+++ b/opt.c
@@ -46,9 +46,11 @@
#include "eval.h"
#include "expr.h"
#include "pwcache.h"
+#include "util.h"
#include <assert.h>
#include <limits.h>
#include <stdarg.h>
+#include <stdbool.h>
#include <stdio.h>
#include <unistd.h>
diff --git a/opt.h b/opt.h
index a30cd17..5f8180d 100644
--- a/opt.h
+++ b/opt.h
@@ -21,7 +21,7 @@
#ifndef BFS_OPT_H
#define BFS_OPT_H
-#include "ctx.h"
+struct bfs_ctx;
/**
* Apply optimizations to the command line.
diff --git a/parse.c b/parse.c
index 458d736..85bd232 100644
--- a/parse.c
+++ b/parse.c
@@ -23,15 +23,15 @@
#include "parse.h"
#include "bfs.h"
+#include "bftw.h"
+#include "color.h"
#include "ctx.h"
#include "darray.h"
#include "diag.h"
-#include "dstring.h"
#include "eval.h"
#include "exec.h"
#include "expr.h"
#include "fsade.h"
-#include "mtab.h"
#include "opt.h"
#include "printf.h"
#include "pwcache.h"
@@ -41,7 +41,6 @@
#include "typo.h"
#include "util.h"
#include <assert.h>
-#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <fnmatch.h>
@@ -50,11 +49,11 @@
#include <pwd.h>
#include <regex.h>
#include <stdarg.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
-#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <time.h>
diff --git a/parse.h b/parse.h
index 337b5b9..7e29a03 100644
--- a/parse.h
+++ b/parse.h
@@ -21,8 +21,6 @@
#ifndef BFS_PARSE_H
#define BFS_PARSE_H
-#include "ctx.h"
-
/**
* Parse the command line.
*
diff --git a/printf.c b/printf.c
index e07feb4..5f04ad3 100644
--- a/printf.c
+++ b/printf.c
@@ -15,11 +15,10 @@
****************************************************************************/
#include "printf.h"
-#include "color.h"
+#include "bftw.h"
#include "ctx.h"
#include "diag.h"
#include "dstring.h"
-#include "expr.h"
#include "mtab.h"
#include "pwcache.h"
#include "stat.h"
@@ -29,9 +28,10 @@
#include <errno.h>
#include <grp.h>
#include <pwd.h>
-#include <stdlib.h>
+#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <time.h>
diff --git a/printf.h b/printf.h
index a02c73b..91cf187 100644
--- a/printf.h
+++ b/printf.h
@@ -21,7 +21,6 @@
#ifndef BFS_PRINTF_H
#define BFS_PRINTF_H
-#include <stdbool.h>
#include <stdio.h>
struct BFTW;
diff --git a/pwcache.c b/pwcache.c
index c6e4b5d..7812b50 100644
--- a/pwcache.c
+++ b/pwcache.c
@@ -20,6 +20,7 @@
#include <errno.h>
#include <grp.h>
#include <pwd.h>
+#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
diff --git a/spawn.c b/spawn.c
index 8c360d3..1aeabc1 100644
--- a/spawn.c
+++ b/spawn.c
@@ -17,7 +17,6 @@
#include "spawn.h"
#include "util.h"
#include <errno.h>
-#include <fcntl.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
diff --git a/spawn.h b/spawn.h
index 974a069..0225ed8 100644
--- a/spawn.h
+++ b/spawn.h
@@ -21,8 +21,6 @@
#ifndef BFS_SPAWN_H
#define BFS_SPAWN_H
-#include <stdbool.h>
-#include <signal.h>
#include <sys/types.h>
/**
diff --git a/stat.c b/stat.c
index 55aece0..91cf765 100644
--- a/stat.c
+++ b/stat.c
@@ -23,7 +23,6 @@
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <unistd.h>
#ifdef STATX_BASIC_STATS
# define HAVE_STATX true
diff --git a/tests/mksock.c b/tests/mksock.c
index a996d58..d1776b3 100644
--- a/tests/mksock.c
+++ b/tests/mksock.c
@@ -20,14 +20,11 @@
*/
#include <errno.h>
-#include <fcntl.h>
#include <libgen.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/types.h>
#include <sys/un.h>
#include <unistd.h>
diff --git a/tests/trie.c b/tests/trie.c
index 7182a03..70e2414 100644
--- a/tests/trie.c
+++ b/tests/trie.c
@@ -2,7 +2,6 @@
#include "../trie.h"
#include <assert.h>
-#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/trie.h b/trie.h
index 7b073f1..2d29ac7 100644
--- a/trie.h
+++ b/trie.h
@@ -17,7 +17,6 @@
#ifndef BFS_TRIE_H
#define BFS_TRIE_H
-#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
diff --git a/util.c b/util.c
index e3bea4c..51336ff 100644
--- a/util.c
+++ b/util.c
@@ -19,8 +19,8 @@
#include <errno.h>
#include <fcntl.h>
#include <langinfo.h>
+#include <nl_types.h>
#include <regex.h>
-#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>