isync

mailbox synchronization program
git clone https://git.code.sf.net/p/isync/isync
Log | Files | Refs | README | LICENSE

commit 1a0255c5665c3e755fdc237f6c9e09745500396a
parent 98f4fd45864c4ffac5b1c310f7efa53187d54a84
Author: Oswald Buddenhagen <ossi@users.sf.net>
Date:   Wed, 27 Apr 2022 16:42:12 +0200

centralize some #includes

these are used (almost) everywhere, so put them in common.h.

Diffstat:
Msrc/common.h | 6++++++
Msrc/config.c | 7-------
Msrc/driver.c | 3---
Msrc/drv_imap.c | 8--------
Msrc/drv_maildir.c | 7-------
Msrc/drv_proxy.c | 4----
Msrc/main.c | 5-----
Msrc/socket.c | 5-----
Msrc/sync.c | 8--------
Msrc/tst_timers.c | 4----
Msrc/util.c | 5-----
11 files changed, 6 insertions(+), 56 deletions(-)

diff --git 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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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>