commit 1a0255c5665c3e755fdc237f6c9e09745500396a Author: Oswald Buddenhagen <o...@users.sf.net> Date: Wed Apr 27 16:42:12 2022 +0200
centralize some #includes these are used (almost) everywhere, so put them in common.h. src/common.h | 6 ++++++ src/config.c | 7 ------- src/driver.c | 3 --- src/drv_imap.c | 8 -------- src/drv_maildir.c | 7 ------- src/drv_proxy.c | 4 ---- src/main.c | 5 ----- src/socket.c | 5 ----- src/sync.c | 8 -------- src/tst_timers.c | 4 ---- src/util.c | 5 ----- 11 files changed, 6 insertions(+), 56 deletions(-) diff --git a/src/common.h b/src/common.h index 55a20a20..bb6bd396 100644 --- a/src/common.h +++ b/src/common.h @@ -11,8 +11,14 @@ #include <autodefs.h> #include <sys/types.h> +#include <assert.h> +#include <limits.h> #include <stdarg.h> +#include <stddef.h> #include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <string.h> #include <time.h> typedef unsigned char uchar; diff --git a/src/config.c b/src/config.c index 10a12062..0de5eb4a 100644 --- a/src/config.c +++ b/src/config.c @@ -9,15 +9,8 @@ #include "sync.h" -#include <assert.h> -#include <unistd.h> -#include <limits.h> #include <pwd.h> -#include <sys/types.h> #include <ctype.h> -#include <string.h> -#include <stdlib.h> -#include <stdio.h> #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || defined(__CYGWIN__) char FieldDelimiter = ';'; diff --git a/src/driver.c b/src/driver.c index 31066bb3..142b463d 100644 --- a/src/driver.c +++ b/src/driver.c @@ -7,9 +7,6 @@ #include "driver.h" -#include <stdlib.h> -#include <string.h> - driver_t *drivers[N_DRIVERS] = { &maildir_driver, &imap_driver }; uint diff --git a/src/drv_imap.c b/src/drv_imap.c index f8b1301a..9ef51e0e 100644 --- a/src/drv_imap.c +++ b/src/drv_imap.c @@ -10,15 +10,7 @@ #include "socket.h" -#include <assert.h> -#include <unistd.h> -#include <stdlib.h> -#include <stdio.h> -#include <stddef.h> -#include <limits.h> -#include <string.h> #include <ctype.h> -#include <time.h> #include <sys/wait.h> #ifdef HAVE_LIBSASL diff --git a/src/drv_maildir.c b/src/drv_maildir.c index 87535552..6a2b93b3 100644 --- a/src/drv_maildir.c +++ b/src/drv_maildir.c @@ -8,18 +8,11 @@ #include "driver.h" -#include <assert.h> -#include <limits.h> -#include <stdlib.h> -#include <string.h> #include <ctype.h> #include <dirent.h> #include <fcntl.h> -#include <stdio.h> -#include <unistd.h> #include <sys/stat.h> #include <errno.h> -#include <time.h> #include <utime.h> #if !defined(_POSIX_SYNCHRONIZED_IO) || _POSIX_SYNCHRONIZED_IO <= 0 diff --git a/src/drv_proxy.c b/src/drv_proxy.c index e4af9e5f..34b2db39 100644 --- a/src/drv_proxy.c +++ b/src/drv_proxy.c @@ -6,10 +6,6 @@ #include "driver.h" -#include <assert.h> -#include <limits.h> -#include <stdlib.h> - typedef struct gen_cmd gen_cmd_t; typedef union proxy_store { diff --git a/src/main.c b/src/main.c index 1ebed1e6..d04752b6 100644 --- a/src/main.c +++ b/src/main.c @@ -7,13 +7,8 @@ #include "sync.h" -#include <stdlib.h> -#include <stddef.h> -#include <unistd.h> -#include <string.h> #include <fcntl.h> #include <signal.h> -#include <time.h> #include <sys/wait.h> #ifdef __linux__ # include <sys/prctl.h> diff --git a/src/socket.c b/src/socket.c index 77423627..3b3288cf 100644 --- a/src/socket.c +++ b/src/socket.c @@ -8,12 +8,7 @@ #include "socket.h" -#include <assert.h> -#include <unistd.h> -#include <stdlib.h> -#include <stddef.h> #include <errno.h> -#include <string.h> #include <fcntl.h> #include <sys/socket.h> #include <sys/ioctl.h> diff --git a/src/sync.c b/src/sync.c index bf41d8a3..968d563a 100644 --- a/src/sync.c +++ b/src/sync.c @@ -7,16 +7,8 @@ #include "sync.h" -#include <assert.h> -#include <stdio.h> -#include <limits.h> -#include <stdlib.h> -#include <stddef.h> -#include <unistd.h> -#include <time.h> #include <fcntl.h> #include <ctype.h> -#include <string.h> #include <errno.h> #include <sys/stat.h> diff --git a/src/tst_timers.c b/src/tst_timers.c index ec9561e3..51563149 100644 --- a/src/tst_timers.c +++ b/src/tst_timers.c @@ -6,10 +6,6 @@ #include "common.h" -#include <stdio.h> -#include <stdlib.h> -#include <time.h> - typedef struct { int id; int first, other, morph_at, morph_to; diff --git a/src/util.c b/src/util.c index 94969807..b5251282 100644 --- a/src/util.c +++ b/src/util.c @@ -7,13 +7,8 @@ #include "common.h" -#include <assert.h> -#include <stddef.h> -#include <stdlib.h> -#include <unistd.h> #include <fcntl.h> #include <errno.h> -#include <string.h> #include <ctype.h> #include <pwd.h> _______________________________________________ isync-devel mailing list isync-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/isync-devel