From 4f8d9c24c2074896ad391cb0595bc59f00d8fa06 Mon Sep 17 00:00:00 2001 From: Serge Bazanski Date: Sun, 31 Jan 2021 19:26:14 +0000 Subject: [PATCH] core, proto: replace uwsgi.h system includes This replaces all `#include ` in core/ and proto/ with `#include "uwsgi.h"`. This is to make it easier to build uWSGI with build systems that are more opinonated about local-vs-system include directories (eg. Bazel), and is without detriment to uWSGI itself (at least as far as I can tell). --- core/async.c | 2 +- core/cache.c | 2 +- core/chunked.c | 2 +- core/config.c | 2 +- core/cookie.c | 2 +- core/cron.c | 2 +- core/daemons.c | 2 +- core/emperor.c | 2 +- core/errors.c | 2 +- core/exceptions.c | 2 +- core/fifo.c | 2 +- core/fork_server.c | 2 +- core/fsmon.c | 2 +- core/hash.c | 2 +- core/hooks.c | 2 +- core/ini.c | 2 +- core/logging.c | 4 ++-- core/master_checks.c | 2 +- core/master_events.c | 2 +- core/metrics.c | 2 +- core/mount.c | 2 +- core/notify.c | 2 +- core/plugins_builder.c | 2 +- core/progress.c | 2 +- core/querystring.c | 2 +- core/rb_timers.c | 2 +- core/reader.c | 2 +- core/routing.c | 2 +- core/rpc.c | 2 +- core/sharedarea.c | 2 +- core/snmp.c | 2 +- core/ssl.c | 2 +- core/strings.c | 2 +- core/timebomb.c | 2 +- core/transformations.c | 2 +- core/utils.c | 2 +- core/uwsgi.c | 2 +- core/webdav.c | 2 +- core/websockets.c | 2 +- core/zeus.c | 2 +- core/zlib.c | 2 +- proto/BUILD | 1 + proto/base.c | 2 +- proto/fastcgi.c | 2 +- proto/http.c | 2 +- proto/puwsgi.c | 2 +- proto/scgi.c | 2 +- proto/uwsgi.c | 2 +- 48 files changed, 49 insertions(+), 48 deletions(-) create mode 100644 proto/BUILD diff --git a/core/async.c b/core/async.c index f03aaf5978..db8949429f 100644 --- a/core/async.c +++ b/core/async.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" extern struct uwsgi_server uwsgi; diff --git a/core/cache.c b/core/cache.c index 13a23dbee6..c3bf7d6e3c 100644 --- a/core/cache.c +++ b/core/cache.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" extern struct uwsgi_server uwsgi; #define cache_item(x) (struct uwsgi_cache_item *) (((char *)uc->items) + ((sizeof(struct uwsgi_cache_item)+uc->keysize) * x)) diff --git a/core/chunked.c b/core/chunked.c index 3979c20039..fe693aad47 100644 --- a/core/chunked.c +++ b/core/chunked.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" extern struct uwsgi_server uwsgi; diff --git a/core/config.c b/core/config.c index 7b05abc6f0..7153dfa164 100644 --- a/core/config.c +++ b/core/config.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" /* diff --git a/core/cookie.c b/core/cookie.c index 37350bf020..1664798545 100644 --- a/core/cookie.c +++ b/core/cookie.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" /* diff --git a/core/cron.c b/core/cron.c index 013ade6919..eac693a564 100644 --- a/core/cron.c +++ b/core/cron.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" extern struct uwsgi_server uwsgi; diff --git a/core/daemons.c b/core/daemons.c index 0e7889f81f..70ff3d904f 100644 --- a/core/daemons.c +++ b/core/daemons.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" extern struct uwsgi_server uwsgi; diff --git a/core/emperor.c b/core/emperor.c index eae7f901cd..cd99e75500 100644 --- a/core/emperor.c +++ b/core/emperor.c @@ -3,7 +3,7 @@ The uWSGI Emperor */ -#include +#include "uwsgi.h" extern struct uwsgi_server uwsgi; extern char **environ; diff --git a/core/errors.c b/core/errors.c index e4879854e3..deabd1f4ba 100644 --- a/core/errors.c +++ b/core/errors.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" extern struct uwsgi_server uwsgi; diff --git a/core/exceptions.c b/core/exceptions.c index a939839de3..1d7196a88b 100644 --- a/core/exceptions.c +++ b/core/exceptions.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" extern struct uwsgi_server uwsgi; diff --git a/core/fifo.c b/core/fifo.c index dae74194d1..45b051138c 100644 --- a/core/fifo.c +++ b/core/fifo.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" extern struct uwsgi_server uwsgi; diff --git a/core/fork_server.c b/core/fork_server.c index fb75163c1d..fa2f27f3b6 100644 --- a/core/fork_server.c +++ b/core/fork_server.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" extern struct uwsgi_server uwsgi; diff --git a/core/fsmon.c b/core/fsmon.c index cca53d9f70..3d5ee0957d 100644 --- a/core/fsmon.c +++ b/core/fsmon.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" extern struct uwsgi_server uwsgi; diff --git a/core/hash.c b/core/hash.c index 86ddf83141..5940f661ee 100644 --- a/core/hash.c +++ b/core/hash.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" extern struct uwsgi_server uwsgi; diff --git a/core/hooks.c b/core/hooks.c index 832d6d3193..9329d9ce26 100644 --- a/core/hooks.c +++ b/core/hooks.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" extern struct uwsgi_server uwsgi; diff --git a/core/ini.c b/core/ini.c index 61a3c26ac1..97080bcd9b 100644 --- a/core/ini.c +++ b/core/ini.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" extern struct uwsgi_server uwsgi; diff --git a/core/logging.c b/core/logging.c index 65b00c08a0..ac2f37a493 100644 --- a/core/logging.c +++ b/core/logging.c @@ -1,5 +1,5 @@ #ifndef __DragonFly__ -#include +#include "uwsgi.h" #endif #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__OpenBSD__) #include @@ -15,7 +15,7 @@ #endif #ifdef __DragonFly__ -#include +#include "uwsgi.h" #endif extern struct uwsgi_server uwsgi; diff --git a/core/master_checks.c b/core/master_checks.c index f3d05764d0..3e6b76a061 100644 --- a/core/master_checks.c +++ b/core/master_checks.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" extern struct uwsgi_server uwsgi; diff --git a/core/master_events.c b/core/master_events.c index 3466415f3a..a92117413f 100644 --- a/core/master_events.c +++ b/core/master_events.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" extern struct uwsgi_server uwsgi; diff --git a/core/metrics.c b/core/metrics.c index c31b6d501d..9714fa658a 100644 --- a/core/metrics.c +++ b/core/metrics.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" extern struct uwsgi_server uwsgi; diff --git a/core/mount.c b/core/mount.c index 23f5ea4158..ada7682a70 100644 --- a/core/mount.c +++ b/core/mount.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" /* diff --git a/core/notify.c b/core/notify.c index 7c08d68181..2e267dbe6c 100644 --- a/core/notify.c +++ b/core/notify.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" extern struct uwsgi_server uwsgi; diff --git a/core/plugins_builder.c b/core/plugins_builder.c index f0fd38c909..967f4d2988 100644 --- a/core/plugins_builder.c +++ b/core/plugins_builder.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" #define UWSGI_BUILD_DIR ".uwsgi_plugins_builder" diff --git a/core/progress.c b/core/progress.c index 25bd8c5627..f46f45b620 100644 --- a/core/progress.c +++ b/core/progress.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" /* diff --git a/core/querystring.c b/core/querystring.c index e77120f068..6f299174fc 100644 --- a/core/querystring.c +++ b/core/querystring.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" /* diff --git a/core/rb_timers.c b/core/rb_timers.c index 1f2c1f7aa2..9c299ba58f 100644 --- a/core/rb_timers.c +++ b/core/rb_timers.c @@ -10,7 +10,7 @@ the "Introduction to Algorithms" by Cormen, Leiserson and Rivest. */ -#include +#include "uwsgi.h" #define uwsgi_rbt_red(node) ((node)->color = 1) #define uwsgi_rbt_black(node) ((node)->color = 0) diff --git a/core/reader.c b/core/reader.c index fcc1af5cec..7a6c4728ce 100644 --- a/core/reader.c +++ b/core/reader.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" extern struct uwsgi_server uwsgi; diff --git a/core/routing.c b/core/routing.c index fd45e087cb..f3024fa02f 100644 --- a/core/routing.c +++ b/core/routing.c @@ -1,5 +1,5 @@ #ifdef UWSGI_ROUTING -#include +#include "uwsgi.h" extern struct uwsgi_server uwsgi; diff --git a/core/rpc.c b/core/rpc.c index efb8c5badc..b6f0baf8b1 100644 --- a/core/rpc.c +++ b/core/rpc.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" extern struct uwsgi_server uwsgi; diff --git a/core/sharedarea.c b/core/sharedarea.c index 1628572ff3..a4ca4b47b8 100644 --- a/core/sharedarea.c +++ b/core/sharedarea.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" extern struct uwsgi_server uwsgi; diff --git a/core/snmp.c b/core/snmp.c index f0b42c46a9..028cf4a418 100644 --- a/core/snmp.c +++ b/core/snmp.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" extern struct uwsgi_server uwsgi; diff --git a/core/ssl.c b/core/ssl.c index c6cea47bea..1fafd659e9 100644 --- a/core/ssl.c +++ b/core/ssl.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" #include #include #include diff --git a/core/strings.c b/core/strings.c index 7565879dbe..6ba04a73a3 100644 --- a/core/strings.c +++ b/core/strings.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" char *uwsgi_str_split_nget(char *str, size_t len, char what, size_t pos, size_t *rlen) { size_t i; diff --git a/core/timebomb.c b/core/timebomb.c index 0e60507660..d5e63304d5 100644 --- a/core/timebomb.c +++ b/core/timebomb.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" /* diff --git a/core/transformations.c b/core/transformations.c index c946c79244..2d3a97c32f 100644 --- a/core/transformations.c +++ b/core/transformations.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" /* diff --git a/core/utils.c b/core/utils.c index 1fecbfd675..d4eb98d814 100644 --- a/core/utils.c +++ b/core/utils.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" extern struct uwsgi_server uwsgi; diff --git a/core/uwsgi.c b/core/uwsgi.c index 286f30d719..9396784f7d 100755 --- a/core/uwsgi.c +++ b/core/uwsgi.c @@ -21,7 +21,7 @@ */ -#include +#include "uwsgi.h" struct uwsgi_server uwsgi; pid_t masterpid; diff --git a/core/webdav.c b/core/webdav.c index 811c592654..a0bb1d07ed 100644 --- a/core/webdav.c +++ b/core/webdav.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" extern struct uwsgi_server uwsgi; diff --git a/core/websockets.c b/core/websockets.c index d24f610df5..65ebd580d7 100644 --- a/core/websockets.c +++ b/core/websockets.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" /* diff --git a/core/zeus.c b/core/zeus.c index aa20f81581..6e83f3cb51 100644 --- a/core/zeus.c +++ b/core/zeus.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" /* diff --git a/core/zlib.c b/core/zlib.c index 5857980ecd..2ea5d9db52 100644 --- a/core/zlib.c +++ b/core/zlib.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" char gzheader[10] = { 0x1f, 0x8b, Z_DEFLATED, 0, 0, 0, 0, 0, 0, 3 }; diff --git a/proto/BUILD b/proto/BUILD new file mode 100644 index 0000000000..10a5c3ed32 --- /dev/null +++ b/proto/BUILD @@ -0,0 +1 @@ +exports_files(glob(["*.c"])) diff --git a/proto/base.c b/proto/base.c index 2325e7db3a..5bef156a7f 100644 --- a/proto/base.c +++ b/proto/base.c @@ -1,4 +1,4 @@ -#include +#include "uwsgi.h" extern struct uwsgi_server uwsgi; diff --git a/proto/fastcgi.c b/proto/fastcgi.c index d55971d8fc..6e8718015a 100644 --- a/proto/fastcgi.c +++ b/proto/fastcgi.c @@ -1,6 +1,6 @@ /* async fastcgi protocol parser */ -#include +#include "uwsgi.h" extern struct uwsgi_server uwsgi; diff --git a/proto/http.c b/proto/http.c index e70b77344e..53ce424378 100644 --- a/proto/http.c +++ b/proto/http.c @@ -1,6 +1,6 @@ /* async http protocol parser */ -#include +#include "uwsgi.h" extern struct uwsgi_server uwsgi; diff --git a/proto/puwsgi.c b/proto/puwsgi.c index ba08e93bb7..f7bde2c28c 100644 --- a/proto/puwsgi.c +++ b/proto/puwsgi.c @@ -1,6 +1,6 @@ /* async uwsgi protocol parser */ -#include +#include "uwsgi.h" extern struct uwsgi_server uwsgi; diff --git a/proto/scgi.c b/proto/scgi.c index 707fe3e5d0..09921528a6 100644 --- a/proto/scgi.c +++ b/proto/scgi.c @@ -1,6 +1,6 @@ /* async SCGI protocol parser */ -#include +#include "uwsgi.h" extern struct uwsgi_server uwsgi; diff --git a/proto/uwsgi.c b/proto/uwsgi.c index feaa47c85b..451a1b8c82 100644 --- a/proto/uwsgi.c +++ b/proto/uwsgi.c @@ -1,6 +1,6 @@ /* async uwsgi protocol parser */ -#include +#include "uwsgi.h" extern struct uwsgi_server uwsgi;