vere: cleanup and reorder #includes

Most C files have multiple #includes that are duplicated in include/c/portable.h.
Removing them helps keep include-related #ifdefs in include/c/portable.h.
#including library files after all.h avoids clashes on MingW and allows portable.h
to add compatibility #defines where necessary.
This commit is contained in:
~locpyl-tidnyd 2021-03-27 20:03:09 +00:00
parent d554c18dc3
commit 577a267ed3
29 changed files with 24 additions and 262 deletions

View File

@ -1,16 +1,12 @@
/* vere/main.c
**
*/
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <limits.h>
#include <uv.h>
#define U3_GLOBAL
#define C3_GLOBAL
#include "all.h"
#include "vere/vere.h"
#include <sigsegv.h>
#include <stdlib.h>
#include <termios.h>
#include <dirent.h>
#include <openssl/conf.h>
#include <openssl/engine.h>
#include <openssl/err.h>
@ -20,11 +16,6 @@
#include <argon2.h>
#include <lmdb.h>
#define U3_GLOBAL
#define C3_GLOBAL
#include "all.h"
#include "vere/vere.h"
#include "ca-bundle.h"
/* Require unsigned char

View File

@ -1,12 +1,11 @@
/* g/e.c
**
*/
#include "all.h"
#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>
#include "all.h"
#ifdef U3_SNAPSHOT_VALIDATION
/* Image check.
*/

View File

@ -1,6 +1,8 @@
/* n/m.c
**
*/
#include "all.h"
#include "vere/vere.h"
#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>
@ -9,9 +11,6 @@
#include <curl/curl.h>
#include <openssl/crypto.h>
#include "all.h"
#include "vere/vere.h"
// XX stack-overflow recovery should be gated by -a
//
#undef NO_OVERFLOW

View File

@ -2,11 +2,10 @@
**
*/
#include <errno.h>
#include <fcntl.h>
#include "all.h"
#include "ur/ur.h"
#include <errno.h>
#include <fcntl.h>
/* _cs_jam_buf: struct for tracking the fibonacci-allocated jam of a noun
*/

View File

@ -1,14 +1,13 @@
/* noun/urth.c
**
*/
#include "all.h"
#include "ur/ur.h"
#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <ctype.h>
#include "all.h"
#include "ur/ur.h"
/* _cu_atom_to_ref(): allocate indirect atom off-loom.
*/
static inline ur_nref

View File

@ -1,8 +1,8 @@
/* g/v.c
**
*/
#include <stdio.h>
#include "all.h"
#include <stdio.h>
#define _CVX_LOAD 4
#define _CVX_PEEK 22

View File

@ -1,21 +1,5 @@
/* vere/auto.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <setjmp.h>
#include <gmp.h>
#include <sigsegv.h>
#include <stdint.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <uv.h>
#include <errno.h>
#include "all.h"
#include "vere/vere.h"

View File

@ -2,11 +2,10 @@
**
** ethereum-integrated pre-boot validation
*/
#include <curl/curl.h>
#include <uv.h>
#include "all.h"
#include "vere/vere.h"
#include <curl/curl.h>
#include <uv.h>
/* _dawn_oct_to_buf(): +octs to uv_buf_t
*/

View File

@ -1,11 +1,9 @@
/* vere/db/lmdb.c
*/
#include <lmdb.h>
#include "c/portable.h"
#include "c/types.h"
#include "c/defs.h"
#include <lmdb.h>
#include <vere/db/lmdb.h>

View File

@ -1,21 +1,5 @@
/* vere/disk.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <setjmp.h>
#include <gmp.h>
#include <sigsegv.h>
#include <stdint.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <uv.h>
#include <errno.h>
#include "all.h"
#include "vere/vere.h"
#include <vere/db/lmdb.h>

View File

@ -4,22 +4,6 @@
*/
#include "all.h"
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <unistd.h>
#include <setjmp.h>
#include <gmp.h>
#include <dirent.h>
#include <stdint.h>
#include <uv.h>
#include <errno.h>
#include <libgen.h>
#include <ftw.h>
#include "vere/vere.h"
/* assumptions:

View File

@ -1,15 +1,6 @@
/* vere/ames.c
**
*/
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <uv.h>
#include <errno.h>
#include "all.h"
#include "vere/vere.h"
#include "ur/serial.h"

View File

@ -1,13 +1,6 @@
/* vere/behn.c
**
*/
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <dirent.h>
#include <uv.h>
#include <errno.h>
#include "all.h"
#include "vere/vere.h"

View File

@ -1,18 +1,10 @@
/* vere/cttp.c
**
*/
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <uv.h>
#include <errno.h>
#include <openssl/ssl.h>
#include <h2o.h>
#include "all.h"
#include "vere/vere.h"
#include <openssl/ssl.h>
#include <h2o.h>
/* u3_csat: client connection state.
*/

View File

@ -1,13 +1,6 @@
/* vere/root.c
**
*/
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <dirent.h>
#include <uv.h>
#include <errno.h>
#include "all.h"
#include "vere/vere.h"

View File

@ -1,13 +1,6 @@
/* vere/root.c
**
*/
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <dirent.h>
#include <uv.h>
#include <errno.h>
#include "all.h"
#include "vere/vere.h"

View File

@ -1,21 +1,12 @@
/* vere/http.c
**
*/
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <ifaddrs.h>
#include <netinet/in.h>
#include <uv.h>
#include <errno.h>
#include "all.h"
#include "vere/vere.h"
#include <openssl/ssl.h>
#include <openssl/err.h>
#include <h2o.h>
#include "all.h"
#include "vere/vere.h"
typedef struct _u3_h2o_serv {
h2o_globalconf_t fig_u; // h2o global config
h2o_context_t ctx_u; // h2o ctx

View File

@ -1,6 +1,8 @@
/* vere/term.c
**
*/
#include "all.h"
#include "vere/vere.h"
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
@ -10,9 +12,6 @@
#include <errno.h>
#include <termios.h>
#include "all.h"
#include "vere/vere.h"
// macros for string literal args/buffers
//
// since (sizeof(s) - 1) is used for vector length, parameters

View File

@ -2,15 +2,7 @@
**
*/
#include "all.h"
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <dirent.h>
#include <uv.h>
#include <errno.h>
#include <libgen.h>
#include <ftw.h>
#include "vere/vere.h"
struct _u3_umon;

View File

@ -2,13 +2,11 @@
**
** the main loop of the daemon process
*/
#include <curl/curl.h>
#include <unistd.h>
#include <uv.h>
#include "all.h"
#include "vere/vere.h"
#include "ur/ur.h"
#include <curl/curl.h>
#include <uv.h>
#include "ivory.h"

View File

@ -1,21 +1,5 @@
/* vere/lord.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <setjmp.h>
#include <gmp.h>
#include <sigsegv.h>
#include <stdint.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <uv.h>
#include <errno.h>
#include "all.h"
#include "vere/vere.h"
#include "ur/hashcons.h"

View File

@ -9,22 +9,6 @@
** the implementation is relatively inefficient and could
** lose a few copies, mallocs, etc.
*/
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <setjmp.h>
#include <gmp.h>
#include <sigsegv.h>
#include <stdint.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <uv.h>
#include <errno.h>
#include "all.h"
#include "vere/vere.h"

View File

@ -1,24 +1,8 @@
/* vere/pier.c
*/
#include <ent.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <setjmp.h>
#include <gmp.h>
#include <sigsegv.h>
#include <stdint.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <uv.h>
#include <errno.h>
#include "all.h"
#include "vere/vere.h"
#include <ent.h>
#define PIER_READ_BATCH 1000ULL
#define PIER_PLAY_BATCH 500ULL

View File

@ -1,13 +1,6 @@
/* vere/save.c
**
*/
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <termios.h>
#include <uv.h>
#include "all.h"
#include "vere/vere.h"

View File

@ -1,12 +1,6 @@
/* vere/time.c
**
*/
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <dirent.h>
#include <uv.h>
#include "all.h"
#include "vere/vere.h"

View File

@ -1,13 +1,6 @@
/* vere/walk.c
**
*/
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <dirent.h>
#include <uv.h>
#include <errno.h>
#include "all.h"
#include "vere/vere.h"

View File

@ -1,21 +1,5 @@
/* vere/ward.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <setjmp.h>
#include <gmp.h>
#include <sigsegv.h>
#include <stdint.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <uv.h>
#include <errno.h>
#include "all.h"
#include "vere/vere.h"

View File

@ -2,22 +2,6 @@
**
** the main loop of a serf process.
*/
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <setjmp.h>
#include <gmp.h>
#include <sigsegv.h>
#include <stdint.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <uv.h>
#include <errno.h>
#include "all.h"
#include <vere/vere.h>
#include <vere/serf.h>

View File

@ -1,21 +1,5 @@
/* worker/serf.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <setjmp.h>
#include <gmp.h>
#include <sigsegv.h>
#include <stdint.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <uv.h>
#include <errno.h>
#include "all.h"
#include <vere/vere.h>
#include <vere/serf.h>