REORG: include: update all files to use haproxy/api.h or api-t.h if needed
All files that were including one of the following include files have
been updated to only include haproxy/api.h or haproxy/api-t.h once instead:
- common/config.h
- common/compat.h
- common/compiler.h
- common/defaults.h
- common/initcall.h
- common/tools.h
The choice is simple: if the file only requires type definitions, it includes
api-t.h, otherwise it includes the full api.h.
In addition, in these files, explicit includes for inttypes.h and limits.h
were dropped since these are now covered by api.h and api-t.h.
No other change was performed, given that this patch is large and
affects 201 files. At least one (tools.h) was already freestanding and
didn't get the new one added.
diff --git a/src/51d.c b/src/51d.c
index 78ee748..13997e3 100644
--- a/src/51d.c
+++ b/src/51d.c
@@ -1,11 +1,11 @@
#include <stdio.h>
+#include <haproxy/api.h>
#include <common/cfgparse.h>
#include <common/chunk.h>
#include <common/buffer.h>
#include <common/errors.h>
#include <common/hathreads.h>
-#include <common/initcall.h>
#include <types/global.h>
#include <proto/arg.h>
#include <proto/http_fetch.h>
diff --git a/src/acl.c b/src/acl.c
index 7df433d..5b25fce 100644
--- a/src/acl.c
+++ b/src/acl.c
@@ -14,8 +14,7 @@
#include <stdio.h>
#include <string.h>
-#include <common/config.h>
-#include <common/initcall.h>
+#include <haproxy/api.h>
#include <common/mini-clist.h>
#include <common/standard.h>
#include <common/uri_auth.h>
diff --git a/src/action.c b/src/action.c
index dad7472..0854208 100644
--- a/src/action.c
+++ b/src/action.c
@@ -10,7 +10,7 @@
*
*/
-#include <common/config.h>
+#include <haproxy/api.h>
#include <common/memory.h>
#include <common/mini-clist.h>
#include <common/standard.h>
diff --git a/src/activity.c b/src/activity.c
index 8844e0c..6da8f40 100644
--- a/src/activity.c
+++ b/src/activity.c
@@ -10,11 +10,10 @@
*
*/
+#include <haproxy/api.h>
#include <common/cfgparse.h>
-#include <common/config.h>
#include <common/standard.h>
#include <common/hathreads.h>
-#include <common/initcall.h>
#include <types/activity.h>
#include <proto/channel.h>
#include <proto/cli.h>
diff --git a/src/applet.c b/src/applet.c
index 60c9e24..5f06d6a 100644
--- a/src/applet.c
+++ b/src/applet.c
@@ -13,7 +13,7 @@
#include <stdio.h>
#include <stdlib.h>
-#include <common/config.h>
+#include <haproxy/api.h>
#include <common/mini-clist.h>
#include <proto/applet.h>
#include <proto/channel.h>
diff --git a/src/auth.c b/src/auth.c
index 1b0f376..2d98044 100644
--- a/src/auth.c
+++ b/src/auth.c
@@ -25,11 +25,10 @@
#include <string.h>
#include <unistd.h>
+#include <haproxy/api.h>
#include <types/global.h>
-#include <common/config.h>
#include <common/errors.h>
#include <common/hathreads.h>
-#include <common/initcall.h>
#include <proto/acl.h>
#include <proto/log.h>
diff --git a/src/backend.c b/src/backend.c
index ba96819..f259b39 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -19,13 +19,11 @@
#include <ctype.h>
#include <sys/types.h>
+#include <haproxy/api.h>
#include <common/buffer.h>
-#include <common/compat.h>
-#include <common/config.h>
#include <common/debug.h>
#include <common/hash.h>
#include <common/htx.h>
-#include <common/initcall.h>
#include <common/ticks.h>
#include <common/time.h>
#include <common/namespace.h>
diff --git a/src/base64.c b/src/base64.c
index e7c9519..90e4fb8 100644
--- a/src/base64.c
+++ b/src/base64.c
@@ -14,8 +14,8 @@
#include <stdlib.h>
#include <string.h>
+#include <haproxy/api.h>
#include <common/base64.h>
-#include <common/config.h>
#define B64BASE '#' /* arbitrary chosen base value */
#define B64CMIN '+'
diff --git a/src/buffer.c b/src/buffer.c
index a7f405b..c8d7a69 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -14,7 +14,7 @@
#include <stdio.h>
#include <string.h>
-#include <common/config.h>
+#include <haproxy/api.h>
#include <common/buffer.h>
#include <common/memory.h>
diff --git a/src/cache.c b/src/cache.c
index f68cb14..fac9b7d 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -10,6 +10,7 @@
* 2 of the License, or (at your option) any later version.
*/
+#include <haproxy/api.h>
#include <import/eb32tree.h>
#include <import/sha1.h>
@@ -35,7 +36,6 @@
#include <common/cfgparse.h>
#include <common/hash.h>
#include <common/htx.h>
-#include <common/initcall.h>
#include <common/net_helper.h>
#define CACHE_FLT_F_IMPLICIT_DECL 0x00000001 /* The cache filtre was implicitly declared (ie without
diff --git a/src/calltrace.c b/src/calltrace.c
index 1a03709..a4f3bbe 100644
--- a/src/calltrace.c
+++ b/src/calltrace.c
@@ -47,7 +47,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <common/compiler.h>
+#include <haproxy/api.h>
#include <common/time.h>
static FILE *log;
diff --git a/src/cfgparse-ssl.c b/src/cfgparse-ssl.c
index 5c36881..e6372fb 100644
--- a/src/cfgparse-ssl.c
+++ b/src/cfgparse-ssl.c
@@ -31,9 +31,9 @@
#include <sys/stat.h>
#include <sys/types.h>
+#include <haproxy/api.h>
#include <common/base64.h>
#include <common/cfgparse.h>
-#include <common/initcall.h>
#include <common/openssl-compat.h>
#include <types/ssl_sock.h>
diff --git a/src/cfgparse.c b/src/cfgparse.c
index 56f9558..5fd2880 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -33,9 +33,9 @@
#include <fcntl.h>
#include <unistd.h>
+#include <haproxy/api.h>
#include <common/cfgparse.h>
#include <common/chunk.h>
-#include <common/config.h>
#include <common/errors.h>
#include <common/memory.h>
#include <common/standard.h>
diff --git a/src/channel.c b/src/channel.c
index 8b0854e..cd7da30 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -15,7 +15,7 @@
#include <stdio.h>
#include <string.h>
-#include <common/config.h>
+#include <haproxy/api.h>
#include <common/buffer.h>
#include <proto/channel.h>
diff --git a/src/checks.c b/src/checks.c
index d42edf4..de182db 100644
--- a/src/checks.c
+++ b/src/checks.c
@@ -30,10 +30,9 @@
#include <netinet/tcp.h>
#include <arpa/inet.h>
+#include <haproxy/api.h>
#include <common/cfgparse.h>
#include <common/chunk.h>
-#include <common/compat.h>
-#include <common/config.h>
#include <common/mini-clist.h>
#include <common/standard.h>
#include <common/time.h>
diff --git a/src/chunk.c b/src/chunk.c
index f2abcba..2ec6a7d 100644
--- a/src/chunk.c
+++ b/src/chunk.c
@@ -15,7 +15,7 @@
#include <stdio.h>
#include <string.h>
-#include <common/config.h>
+#include <haproxy/api.h>
#include <common/chunk.h>
#include <common/standard.h>
diff --git a/src/cli.c b/src/cli.c
index a083ae7..381a9e6 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -26,11 +26,9 @@
#include <net/if.h>
+#include <haproxy/api.h>
#include <common/cfgparse.h>
-#include <common/compat.h>
-#include <common/config.h>
#include <common/debug.h>
-#include <common/initcall.h>
#include <common/memory.h>
#include <common/mini-clist.h>
#include <common/standard.h>
diff --git a/src/compression.c b/src/compression.c
index 413a9d8..5797a06 100644
--- a/src/compression.c
+++ b/src/compression.c
@@ -26,10 +26,9 @@
#undef free_func
#endif /* USE_ZLIB */
+#include <haproxy/api.h>
#include <common/cfgparse.h>
-#include <common/compat.h>
#include <common/hathreads.h>
-#include <common/initcall.h>
#include <common/memory.h>
#include <types/global.h>
diff --git a/src/connection.c b/src/connection.c
index 6886768..fd6a274 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -12,10 +12,8 @@
#include <errno.h>
+#include <haproxy/api.h>
#include <common/cfgparse.h>
-#include <common/compat.h>
-#include <common/config.h>
-#include <common/initcall.h>
#include <common/namespace.h>
#include <common/hash.h>
#include <common/net_helper.h>
diff --git a/src/da.c b/src/da.c
index 0e4d5a7..73e59db 100644
--- a/src/da.c
+++ b/src/da.c
@@ -1,9 +1,9 @@
#include <stdio.h>
+#include <haproxy/api.h>
#include <common/cfgparse.h>
#include <common/errors.h>
#include <common/http.h>
-#include <common/initcall.h>
#include <types/global.h>
#include <proto/arg.h>
#include <proto/http_fetch.h>
diff --git a/src/debug.c b/src/debug.c
index efbf19f..7f281f0 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -19,11 +19,10 @@
#include <sys/types.h>
#include <sys/wait.h>
+#include <haproxy/api.h>
#include <common/buf.h>
-#include <common/config.h>
#include <common/debug.h>
#include <common/hathreads.h>
-#include <common/initcall.h>
#include <common/ist.h>
#include <common/net_helper.h>
#include <common/standard.h>
diff --git a/src/dns.c b/src/dns.c
index 38f73c1..92c6dda 100644
--- a/src/dns.c
+++ b/src/dns.c
@@ -19,9 +19,9 @@
#include <sys/types.h>
+#include <haproxy/api.h>
#include <common/cfgparse.h>
#include <common/errors.h>
-#include <common/initcall.h>
#include <common/time.h>
#include <common/ticks.h>
#include <common/net_helper.h>
diff --git a/src/ev_epoll.c b/src/ev_epoll.c
index 9129402..97a0b28 100644
--- a/src/ev_epoll.c
+++ b/src/ev_epoll.c
@@ -14,14 +14,12 @@
#include <sys/time.h>
#include <sys/types.h>
-#include <common/compat.h>
-#include <common/config.h>
+#include <haproxy/api.h>
#include <common/debug.h>
#include <common/hathreads.h>
#include <common/standard.h>
#include <common/ticks.h>
#include <common/time.h>
-#include <common/tools.h>
#include <types/global.h>
diff --git a/src/ev_evports.c b/src/ev_evports.c
index 3d0dd43..c0005e1 100644
--- a/src/ev_evports.c
+++ b/src/ev_evports.c
@@ -18,12 +18,10 @@
#include <errno.h>
#include <syslog.h>
-#include <common/compat.h>
-#include <common/config.h>
+#include <haproxy/api.h>
#include <common/hathreads.h>
#include <common/ticks.h>
#include <common/time.h>
-#include <common/tools.h>
#include <types/global.h>
diff --git a/src/ev_kqueue.c b/src/ev_kqueue.c
index 852fa6e..e9821bd 100644
--- a/src/ev_kqueue.c
+++ b/src/ev_kqueue.c
@@ -17,12 +17,10 @@
#include <sys/event.h>
#include <sys/time.h>
-#include <common/compat.h>
-#include <common/config.h>
+#include <haproxy/api.h>
#include <common/hathreads.h>
#include <common/ticks.h>
#include <common/time.h>
-#include <common/tools.h>
#include <types/global.h>
diff --git a/src/ev_poll.c b/src/ev_poll.c
index 8df2445..0e6dc94 100644
--- a/src/ev_poll.c
+++ b/src/ev_poll.c
@@ -17,8 +17,7 @@
#include <sys/time.h>
#include <sys/types.h>
-#include <common/compat.h>
-#include <common/config.h>
+#include <haproxy/api.h>
#include <common/hathreads.h>
#include <common/ticks.h>
#include <common/time.h>
diff --git a/src/ev_select.c b/src/ev_select.c
index c4ab023..9dd93b8 100644
--- a/src/ev_select.c
+++ b/src/ev_select.c
@@ -14,8 +14,7 @@
#include <sys/time.h>
#include <sys/types.h>
-#include <common/compat.h>
-#include <common/config.h>
+#include <haproxy/api.h>
#include <common/hathreads.h>
#include <common/ticks.h>
#include <common/time.h>
diff --git a/src/fcgi-app.c b/src/fcgi-app.c
index 8472cf5..d099228 100644
--- a/src/fcgi-app.c
+++ b/src/fcgi-app.c
@@ -10,11 +10,10 @@
*
*/
-#include <common/config.h>
+#include <haproxy/api.h>
#include <common/chunk.h>
#include <common/cfgparse.h>
#include <common/errors.h>
-#include <common/initcall.h>
#include <common/standard.h>
#include <types/global.h>
diff --git a/src/fd.c b/src/fd.c
index 1934bd0..f4aa83b 100644
--- a/src/fd.c
+++ b/src/fd.c
@@ -87,9 +87,8 @@
#include <errno.h>
#endif
-#include <common/compat.h>
-#include <common/config.h>
+#include <haproxy/api.h>
#include <types/global.h>
#include <proto/fd.h>
diff --git a/src/filters.c b/src/filters.c
index 07b9043..9b6bd5b 100644
--- a/src/filters.c
+++ b/src/filters.c
@@ -10,14 +10,12 @@
*
*/
+#include <haproxy/api.h>
#include <common/buffer.h>
#include <common/debug.h>
#include <common/cfgparse.h>
-#include <common/compat.h>
-#include <common/config.h>
#include <common/errors.h>
#include <common/htx.h>
-#include <common/initcall.h>
#include <common/namespace.h>
#include <common/standard.h>
#include <common/hathreads.h>
diff --git a/src/flt_http_comp.c b/src/flt_http_comp.c
index dc78984..abec6b3 100644
--- a/src/flt_http_comp.c
+++ b/src/flt_http_comp.c
@@ -10,10 +10,10 @@
*
*/
+#include <haproxy/api.h>
#include <common/buffer.h>
#include <common/cfgparse.h>
#include <common/htx.h>
-#include <common/initcall.h>
#include <common/mini-clist.h>
#include <common/standard.h>
diff --git a/src/flt_spoe.c b/src/flt_spoe.c
index 9db2baa..5b8daa1 100644
--- a/src/flt_spoe.c
+++ b/src/flt_spoe.c
@@ -12,12 +12,10 @@
#include <ctype.h>
#include <errno.h>
+#include <haproxy/api.h>
#include <common/cfgparse.h>
-#include <common/compat.h>
-#include <common/config.h>
#include <common/debug.h>
#include <common/hathreads.h>
-#include <common/initcall.h>
#include <common/memory.h>
#include <common/time.h>
diff --git a/src/flt_trace.c b/src/flt_trace.c
index b06ba15..a336296 100644
--- a/src/flt_trace.c
+++ b/src/flt_trace.c
@@ -12,12 +12,11 @@
#include <ctype.h>
+#include <haproxy/api.h>
#include <common/hathreads.h>
#include <common/htx.h>
-#include <common/initcall.h>
#include <common/standard.h>
#include <common/time.h>
-#include <common/tools.h>
#include <types/channel.h>
#include <types/filters.h>
diff --git a/src/freq_ctr.c b/src/freq_ctr.c
index e6e0168..f4ee5ce 100644
--- a/src/freq_ctr.c
+++ b/src/freq_ctr.c
@@ -10,10 +10,9 @@
*
*/
-#include <common/config.h>
+#include <haproxy/api.h>
#include <common/standard.h>
#include <common/time.h>
-#include <common/tools.h>
#include <proto/freq_ctr.h>
/* Read a frequency counter taking history into account for missing time in
diff --git a/src/frontend.c b/src/frontend.c
index 099d839..6274e8a 100644
--- a/src/frontend.c
+++ b/src/frontend.c
@@ -22,11 +22,9 @@
#include <netinet/tcp.h>
+#include <haproxy/api.h>
#include <common/chunk.h>
-#include <common/compat.h>
-#include <common/config.h>
#include <common/debug.h>
-#include <common/initcall.h>
#include <common/standard.h>
#include <common/time.h>
diff --git a/src/h1.c b/src/h1.c
index 53da12a..f30e489 100644
--- a/src/h1.c
+++ b/src/h1.c
@@ -11,7 +11,7 @@
*/
#include <ctype.h>
-#include <common/config.h>
+#include <haproxy/api.h>
#include <common/h1.h>
#include <common/http-hdr.h>
diff --git a/src/h1_htx.c b/src/h1_htx.c
index af18a98..e9d79f6 100644
--- a/src/h1_htx.c
+++ b/src/h1_htx.c
@@ -10,7 +10,7 @@
*
*/
-#include <common/config.h>
+#include <haproxy/api.h>
#include <common/debug.h>
#include <common/cfgparse.h>
#include <common/h1.h>
diff --git a/src/h2.c b/src/h2.c
index 53cb0d3..891c3e0 100644
--- a/src/h2.c
+++ b/src/h2.c
@@ -26,7 +26,7 @@
*/
#include <inttypes.h>
-#include <common/config.h>
+#include <haproxy/api.h>
#include <common/h2.h>
#include <common/http-hdr.h>
#include <common/ist.h>
diff --git a/src/haproxy.c b/src/haproxy.c
index 5d7b0fe..0e71ba7 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -78,16 +78,13 @@
#include <systemd/sd-daemon.h>
#endif
+#include <haproxy/api.h>
#include <import/sha1.h>
#include <common/base64.h>
#include <common/cfgparse.h>
#include <common/chunk.h>
-#include <common/compat.h>
-#include <common/config.h>
-#include <common/defaults.h>
#include <common/errors.h>
-#include <common/initcall.h>
#include <common/memory.h>
#include <common/mini-clist.h>
#include <common/namespace.h>
diff --git a/src/hlua.c b/src/hlua.c
index 83cc3cd..15c34cd 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -11,7 +11,6 @@
*/
#include <ctype.h>
-#include <limits.h>
#include <setjmp.h>
#include <lauxlib.h>
@@ -22,12 +21,11 @@
#error "Requires Lua 5.3 or later."
#endif
+#include <haproxy/api.h>
#include <import/ebpttree.h>
#include <common/cfgparse.h>
-#include <common/compiler.h>
#include <common/hathreads.h>
-#include <common/initcall.h>
#include <common/xref.h>
#include <common/h1.h>
diff --git a/src/hpack-huff.c b/src/hpack-huff.c
index bdcff7f..19ea163 100644
--- a/src/hpack-huff.c
+++ b/src/hpack-huff.c
@@ -29,7 +29,7 @@
#include <inttypes.h>
#include <string.h>
-#include <common/config.h>
+#include <haproxy/api.h>
#include <common/hpack-huff.h>
struct huff {
diff --git a/src/http.c b/src/http.c
index aaa6ddb..0bd8f87 100644
--- a/src/http.c
+++ b/src/http.c
@@ -11,7 +11,7 @@
*/
#include <ctype.h>
-#include <common/config.h>
+#include <haproxy/api.h>
#include <common/http.h>
#include <common/standard.h>
diff --git a/src/http_acl.c b/src/http_acl.c
index edd3be5..5a8c634 100644
--- a/src/http_acl.c
+++ b/src/http_acl.c
@@ -16,12 +16,10 @@
#include <string.h>
#include <time.h>
+#include <haproxy/api.h>
#include <common/chunk.h>
-#include <common/compat.h>
-#include <common/config.h>
#include <common/debug.h>
#include <common/http.h>
-#include <common/initcall.h>
#include <common/memory.h>
#include <common/standard.h>
#include <common/version.h>
diff --git a/src/http_act.c b/src/http_act.c
index b18da61..d116f1d 100644
--- a/src/http_act.c
+++ b/src/http_act.c
@@ -16,13 +16,11 @@
#include <string.h>
#include <time.h>
+#include <haproxy/api.h>
#include <common/cfgparse.h>
#include <common/chunk.h>
-#include <common/compat.h>
-#include <common/config.h>
#include <common/debug.h>
#include <common/http.h>
-#include <common/initcall.h>
#include <common/memory.h>
#include <common/standard.h>
#include <common/uri_auth.h>
diff --git a/src/http_ana.c b/src/http_ana.c
index cf9570c..bd2db1f 100644
--- a/src/http_ana.c
+++ b/src/http_ana.c
@@ -10,8 +10,8 @@
*
*/
+#include <haproxy/api.h>
#include <common/base64.h>
-#include <common/config.h>
#include <common/debug.h>
#include <common/htx.h>
#include <common/net_helper.h>
diff --git a/src/http_conv.c b/src/http_conv.c
index fdf3c42..d83541d 100644
--- a/src/http_conv.c
+++ b/src/http_conv.c
@@ -16,12 +16,10 @@
#include <string.h>
#include <time.h>
+#include <haproxy/api.h>
#include <common/chunk.h>
-#include <common/compat.h>
-#include <common/config.h>
#include <common/debug.h>
#include <common/http.h>
-#include <common/initcall.h>
#include <common/memory.h>
#include <common/standard.h>
#include <common/version.h>
diff --git a/src/http_fetch.c b/src/http_fetch.c
index 5fc68a9..96c774b 100644
--- a/src/http_fetch.c
+++ b/src/http_fetch.c
@@ -16,15 +16,13 @@
#include <string.h>
#include <time.h>
+#include <haproxy/api.h>
#include <common/base64.h>
#include <common/chunk.h>
-#include <common/compat.h>
-#include <common/config.h>
#include <common/debug.h>
#include <common/h1.h>
#include <common/http.h>
#include <common/htx.h>
-#include <common/initcall.h>
#include <common/memory.h>
#include <common/standard.h>
#include <common/version.h>
diff --git a/src/http_htx.c b/src/http_htx.c
index 7211a4d..f4a6004 100644
--- a/src/http_htx.c
+++ b/src/http_htx.c
@@ -14,9 +14,9 @@
#include <fcntl.h>
#include <unistd.h>
+#include <haproxy/api.h>
#include <types/global.h>
-#include <common/config.h>
#include <common/debug.h>
#include <common/cfgparse.h>
#include <common/h1.h>
diff --git a/src/http_rules.c b/src/http_rules.c
index 2e58ec2..a2a4e05 100644
--- a/src/http_rules.c
+++ b/src/http_rules.c
@@ -16,10 +16,9 @@
#include <string.h>
#include <time.h>
+#include <haproxy/api.h>
#include <common/cfgparse.h>
#include <common/chunk.h>
-#include <common/compat.h>
-#include <common/config.h>
#include <common/debug.h>
#include <common/http.h>
#include <common/memory.h>
diff --git a/src/lb_chash.c b/src/lb_chash.c
index 91724fd..b216541 100644
--- a/src/lb_chash.c
+++ b/src/lb_chash.c
@@ -16,8 +16,7 @@
*
*/
-#include <common/compat.h>
-#include <common/config.h>
+#include <haproxy/api.h>
#include <common/debug.h>
#include <common/standard.h>
#include <import/eb32tree.h>
diff --git a/src/lb_fas.c b/src/lb_fas.c
index 1042e4b..ef507b7 100644
--- a/src/lb_fas.c
+++ b/src/lb_fas.c
@@ -16,8 +16,7 @@
*
*/
-#include <common/compat.h>
-#include <common/config.h>
+#include <haproxy/api.h>
#include <common/debug.h>
#include <import/eb32tree.h>
diff --git a/src/lb_fwlc.c b/src/lb_fwlc.c
index 409e5f8..89634bf 100644
--- a/src/lb_fwlc.c
+++ b/src/lb_fwlc.c
@@ -10,8 +10,7 @@
*
*/
-#include <common/compat.h>
-#include <common/config.h>
+#include <haproxy/api.h>
#include <common/debug.h>
#include <import/eb32tree.h>
diff --git a/src/lb_fwrr.c b/src/lb_fwrr.c
index fe3d86b..31e8bb2 100644
--- a/src/lb_fwrr.c
+++ b/src/lb_fwrr.c
@@ -10,8 +10,7 @@
*
*/
-#include <common/compat.h>
-#include <common/config.h>
+#include <haproxy/api.h>
#include <common/debug.h>
#include <import/eb32tree.h>
diff --git a/src/lb_map.c b/src/lb_map.c
index a5d1ec3..660475b 100644
--- a/src/lb_map.c
+++ b/src/lb_map.c
@@ -10,8 +10,7 @@
*
*/
-#include <common/compat.h>
-#include <common/config.h>
+#include <haproxy/api.h>
#include <common/debug.h>
#include <import/eb32tree.h>
diff --git a/src/listener.c b/src/listener.c
index 01feee5..ab9f84b 100644
--- a/src/listener.c
+++ b/src/listener.c
@@ -18,10 +18,9 @@
#include <unistd.h>
#include <fcntl.h>
+#include <haproxy/api.h>
#include <common/cfgparse.h>
-#include <common/config.h>
#include <common/errors.h>
-#include <common/initcall.h>
#include <common/mini-clist.h>
#include <common/standard.h>
#include <common/time.h>
diff --git a/src/log.c b/src/log.c
index b4b00cf..87b12fc 100644
--- a/src/log.c
+++ b/src/log.c
@@ -24,9 +24,7 @@
#include <sys/time.h>
#include <sys/uio.h>
-#include <common/config.h>
-#include <common/compat.h>
-#include <common/initcall.h>
+#include <haproxy/api.h>
#include <common/standard.h>
#include <common/time.h>
#include <common/version.h>
diff --git a/src/map.c b/src/map.c
index 39a72c9..5f98dd0 100644
--- a/src/map.c
+++ b/src/map.c
@@ -10,10 +10,9 @@
*
*/
-#include <limits.h>
#include <stdio.h>
-#include <common/initcall.h>
+#include <haproxy/api.h>
#include <common/standard.h>
#include <types/applet.h>
diff --git a/src/memory.c b/src/memory.c
index b442f0a..437ce10 100644
--- a/src/memory.c
+++ b/src/memory.c
@@ -11,16 +11,15 @@
*/
#include <errno.h>
+#include <haproxy/api.h>
#include <types/applet.h>
#include <types/cli.h>
#include <types/global.h>
#include <types/stats.h>
#include <common/cfgparse.h>
-#include <common/config.h>
#include <common/debug.h>
#include <common/hathreads.h>
-#include <common/initcall.h>
#include <common/memory.h>
#include <common/mini-clist.h>
#include <common/standard.h>
diff --git a/src/mux_fcgi.c b/src/mux_fcgi.c
index d1db2a0..5ce6f61 100644
--- a/src/mux_fcgi.c
+++ b/src/mux_fcgi.c
@@ -10,12 +10,11 @@
*
*/
+#include <haproxy/api.h>
#include <common/cfgparse.h>
-#include <common/config.h>
#include <common/fcgi.h>
#include <common/h1.h>
#include <common/htx.h>
-#include <common/initcall.h>
#include <common/ist.h>
#include <common/mini-clist.h>
#include <common/net_helper.h>
diff --git a/src/mux_h1.c b/src/mux_h1.c
index ac383f5..1c75e93 100644
--- a/src/mux_h1.c
+++ b/src/mux_h1.c
@@ -9,12 +9,11 @@
* 2 of the License, or (at your option) any later version.
*
*/
+#include <haproxy/api.h>
#include <common/cfgparse.h>
-#include <common/config.h>
#include <common/h1.h>
#include <common/h2.h>
#include <common/htx.h>
-#include <common/initcall.h>
#include <import/ebistree.h>
diff --git a/src/mux_h2.c b/src/mux_h2.c
index a77cf84..3c0ef5f 100644
--- a/src/mux_h2.c
+++ b/src/mux_h2.c
@@ -10,15 +10,14 @@
*
*/
+#include <haproxy/api.h>
#include <common/cfgparse.h>
-#include <common/config.h>
#include <common/h1.h>
#include <common/h2.h>
#include <common/hpack-dec.h>
#include <common/hpack-enc.h>
#include <common/hpack-tbl.h>
#include <common/htx.h>
-#include <common/initcall.h>
#include <common/net_helper.h>
#include <proto/connection.h>
#include <proto/http_htx.h>
diff --git a/src/mux_pt.c b/src/mux_pt.c
index 6b154e3..1543f46 100644
--- a/src/mux_pt.c
+++ b/src/mux_pt.c
@@ -10,8 +10,7 @@
*
*/
-#include <common/config.h>
-#include <common/initcall.h>
+#include <haproxy/api.h>
#include <proto/connection.h>
#include <proto/stream.h>
#include <proto/task.h>
diff --git a/src/mworker-prog.c b/src/mworker-prog.c
index 1d401a3..f445c7f 100644
--- a/src/mworker-prog.c
+++ b/src/mworker-prog.c
@@ -20,9 +20,9 @@
#include <string.h>
#include <unistd.h>
+#include <haproxy/api.h>
#include <common/cfgparse.h>
#include <common/errors.h>
-#include <common/initcall.h>
#include <proto/log.h>
#include <proto/mworker.h>
diff --git a/src/mworker.c b/src/mworker.c
index 9c46fff..f41ee9f 100644
--- a/src/mworker.c
+++ b/src/mworker.c
@@ -17,8 +17,8 @@
#include <string.h>
#include <sys/wait.h>
+#include <haproxy/api.h>
#include <common/cfgparse.h>
-#include <common/initcall.h>
#include <common/mini-clist.h>
#include <common/version.h>
diff --git a/src/namespace.c b/src/namespace.c
index 89a968e..a6d2080 100644
--- a/src/namespace.c
+++ b/src/namespace.c
@@ -10,8 +10,8 @@
#include <string.h>
+#include <haproxy/api.h>
#include <common/namespace.h>
-#include <common/compiler.h>
#include <common/hash.h>
#include <common/errors.h>
#include <proto/log.h>
diff --git a/src/pattern.c b/src/pattern.c
index a90820f..25c3d10 100644
--- a/src/pattern.c
+++ b/src/pattern.c
@@ -14,7 +14,7 @@
#include <stdio.h>
#include <errno.h>
-#include <common/config.h>
+#include <haproxy/api.h>
#include <common/net_helper.h>
#include <common/standard.h>
diff --git a/src/payload.c b/src/payload.c
index 05201ff..3b8eaeb 100644
--- a/src/payload.c
+++ b/src/payload.c
@@ -13,7 +13,7 @@
#include <stdlib.h>
#include <string.h>
-#include <common/initcall.h>
+#include <haproxy/api.h>
#include <common/net_helper.h>
#include <common/htx.h>
#include <proto/acl.h>
diff --git a/src/peers.c b/src/peers.c
index 9782ff3..e530760 100644
--- a/src/peers.c
+++ b/src/peers.c
@@ -20,8 +20,7 @@
#include <sys/stat.h>
#include <sys/types.h>
-#include <common/compat.h>
-#include <common/config.h>
+#include <haproxy/api.h>
#include <common/net_helper.h>
#include <common/time.h>
#include <common/standard.h>
diff --git a/src/pipe.c b/src/pipe.c
index bc45de3..b088820 100644
--- a/src/pipe.c
+++ b/src/pipe.c
@@ -13,7 +13,7 @@
#include <unistd.h>
#include <fcntl.h>
-#include <common/config.h>
+#include <haproxy/api.h>
#include <common/hathreads.h>
#include <common/memory.h>
diff --git a/src/proto_sockpair.c b/src/proto_sockpair.c
index fdbc81d..a8b78ca 100644
--- a/src/proto_sockpair.c
+++ b/src/proto_sockpair.c
@@ -26,11 +26,9 @@
#include <sys/types.h>
#include <sys/un.h>
-#include <common/compat.h>
-#include <common/config.h>
+#include <haproxy/api.h>
#include <common/debug.h>
#include <common/errors.h>
-#include <common/initcall.h>
#include <common/mini-clist.h>
#include <common/standard.h>
#include <common/time.h>
diff --git a/src/proto_tcp.c b/src/proto_tcp.c
index afcb1bc..f1e65c5 100644
--- a/src/proto_tcp.c
+++ b/src/proto_tcp.c
@@ -30,11 +30,9 @@
#include <netinet/tcp.h>
#include <netinet/in.h>
-#include <common/compat.h>
-#include <common/config.h>
+#include <haproxy/api.h>
#include <common/debug.h>
#include <common/errors.h>
-#include <common/initcall.h>
#include <common/mini-clist.h>
#include <common/standard.h>
#include <common/namespace.h>
diff --git a/src/proto_uxst.c b/src/proto_uxst.c
index 256a58e..d41e1c0 100644
--- a/src/proto_uxst.c
+++ b/src/proto_uxst.c
@@ -26,11 +26,9 @@
#include <sys/types.h>
#include <sys/un.h>
-#include <common/compat.h>
-#include <common/config.h>
+#include <haproxy/api.h>
#include <common/debug.h>
#include <common/errors.h>
-#include <common/initcall.h>
#include <common/mini-clist.h>
#include <common/standard.h>
#include <common/time.h>
diff --git a/src/protocol.c b/src/protocol.c
index ac45cf2..6c4341e 100644
--- a/src/protocol.c
+++ b/src/protocol.c
@@ -13,7 +13,7 @@
#include <sys/types.h>
#include <sys/socket.h>
-#include <common/config.h>
+#include <haproxy/api.h>
#include <common/errors.h>
#include <common/mini-clist.h>
#include <common/standard.h>
diff --git a/src/proxy.c b/src/proxy.c
index 0845bce..a62df4d 100644
--- a/src/proxy.c
+++ b/src/proxy.c
@@ -17,12 +17,9 @@
#include <sys/socket.h>
#include <sys/stat.h>
-#include <common/defaults.h>
+#include <haproxy/api.h>
#include <common/cfgparse.h>
-#include <common/compat.h>
-#include <common/config.h>
#include <common/errors.h>
-#include <common/initcall.h>
#include <common/memory.h>
#include <common/time.h>
diff --git a/src/queue.c b/src/queue.c
index 890574d..3c50076 100644
--- a/src/queue.c
+++ b/src/queue.c
@@ -69,8 +69,7 @@
* - a pendconn doesn't switch between queues, it stays where it is.
*/
-#include <common/config.h>
-#include <common/initcall.h>
+#include <haproxy/api.h>
#include <common/memory.h>
#include <common/time.h>
#include <common/hathreads.h>
diff --git a/src/raw_sock.c b/src/raw_sock.c
index 340f929..af8cc65 100644
--- a/src/raw_sock.c
+++ b/src/raw_sock.c
@@ -22,9 +22,8 @@
#include <netinet/tcp.h>
+#include <haproxy/api.h>
#include <common/buffer.h>
-#include <common/compat.h>
-#include <common/config.h>
#include <common/debug.h>
#include <common/standard.h>
#include <common/ticks.h>
diff --git a/src/regex.c b/src/regex.c
index 195f9a7..fa1c91b 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -14,9 +14,8 @@
#include <stdlib.h>
#include <string.h>
+#include <haproxy/api.h>
#include <types/global.h>
-#include <common/config.h>
-#include <common/defaults.h>
#include <common/regex.h>
#include <common/standard.h>
#include <proto/log.h>
diff --git a/src/ring.c b/src/ring.c
index 2a6bb02..b011f53 100644
--- a/src/ring.c
+++ b/src/ring.c
@@ -19,9 +19,8 @@
*/
#include <stdlib.h>
+#include <haproxy/api.h>
#include <common/buf.h>
-#include <common/compat.h>
-#include <common/config.h>
#include <common/hathreads.h>
#include <types/applet.h>
#include <proto/cli.h>
diff --git a/src/sample.c b/src/sample.c
index f10f439..e4841fd 100644
--- a/src/sample.c
+++ b/src/sample.c
@@ -16,12 +16,12 @@
#include <arpa/inet.h>
#include <stdio.h>
+#include <haproxy/api.h>
#include <types/global.h>
#include <common/chunk.h>
#include <common/hash.h>
#include <common/http.h>
-#include <common/initcall.h>
#include <common/net_helper.h>
#include <common/standard.h>
#include <common/uri_auth.h>
diff --git a/src/server.c b/src/server.c
index 15e2f8f..9d6e7a6 100644
--- a/src/server.c
+++ b/src/server.c
@@ -14,12 +14,11 @@
#include <ctype.h>
#include <errno.h>
+#include <haproxy/api.h>
#include <import/xxhash.h>
#include <common/cfgparse.h>
-#include <common/config.h>
#include <common/errors.h>
-#include <common/initcall.h>
#include <common/namespace.h>
#include <common/time.h>
diff --git a/src/session.c b/src/session.c
index 74b029e..fd842a4 100644
--- a/src/session.c
+++ b/src/session.c
@@ -10,7 +10,7 @@
*
*/
-#include <common/config.h>
+#include <haproxy/api.h>
#include <common/buffer.h>
#include <common/debug.h>
#include <common/http.h>
diff --git a/src/sink.c b/src/sink.c
index ff498b2..20d3d79 100644
--- a/src/sink.c
+++ b/src/sink.c
@@ -18,9 +18,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <haproxy/api.h>
#include <common/cfgparse.h>
-#include <common/compat.h>
-#include <common/config.h>
#include <common/ist.h>
#include <common/mini-clist.h>
#include <common/time.h>
diff --git a/src/ssl_sample.c b/src/ssl_sample.c
index f3fd0b4..85703d5 100644
--- a/src/ssl_sample.c
+++ b/src/ssl_sample.c
@@ -20,8 +20,8 @@
#include <string.h>
#include <unistd.h>
+#include <haproxy/api.h>
#include <common/buffer.h>
-#include <common/initcall.h>
#include <common/openssl-compat.h>
#include <common/standard.h>
diff --git a/src/ssl_sock.c b/src/ssl_sock.c
index 58ff583..79e81d7 100644
--- a/src/ssl_sock.c
+++ b/src/ssl_sock.c
@@ -40,16 +40,14 @@
#include <netdb.h>
#include <netinet/tcp.h>
+#include <haproxy/api.h>
#include <import/lru.h>
#include <import/xxhash.h>
#include <common/buffer.h>
#include <common/chunk.h>
-#include <common/compat.h>
-#include <common/config.h>
#include <common/debug.h>
#include <common/errors.h>
-#include <common/initcall.h>
#include <common/openssl-compat.h>
#include <common/standard.h>
#include <common/ticks.h>
diff --git a/src/standard.c b/src/standard.c
index 33067bb..fe174af 100644
--- a/src/standard.c
+++ b/src/standard.c
@@ -36,10 +36,9 @@
#include <netinet/in.h>
#include <arpa/inet.h>
+#include <haproxy/api.h>
#include <common/chunk.h>
-#include <common/config.h>
#include <common/standard.h>
-#include <common/tools.h>
#include <types/global.h>
#include <proto/applet.h>
#include <proto/dns.h>
diff --git a/src/stats.c b/src/stats.c
index 1413d3d..bfe7acc 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -24,13 +24,11 @@
#include <sys/stat.h>
#include <sys/types.h>
+#include <haproxy/api.h>
#include <common/cfgparse.h>
-#include <common/compat.h>
-#include <common/config.h>
#include <common/debug.h>
#include <common/http.h>
#include <common/htx.h>
-#include <common/initcall.h>
#include <common/memory.h>
#include <common/mini-clist.h>
#include <common/standard.h>
diff --git a/src/stick_table.c b/src/stick_table.c
index 862aafc..37131f6 100644
--- a/src/stick_table.c
+++ b/src/stick_table.c
@@ -14,9 +14,8 @@
#include <string.h>
#include <errno.h>
-#include <common/config.h>
+#include <haproxy/api.h>
#include <common/cfgparse.h>
-#include <common/initcall.h>
#include <common/memory.h>
#include <common/mini-clist.h>
#include <common/net_helper.h>
diff --git a/src/stream.c b/src/stream.c
index 1b8a868..9030603 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -14,13 +14,12 @@
#include <unistd.h>
#include <fcntl.h>
+#include <haproxy/api.h>
#include <common/cfgparse.h>
-#include <common/config.h>
#include <common/buffer.h>
#include <common/debug.h>
#include <common/hathreads.h>
#include <common/htx.h>
-#include <common/initcall.h>
#include <common/memory.h>
#include <types/applet.h>
diff --git a/src/stream_interface.c b/src/stream_interface.c
index ca05197..fc75c39 100644
--- a/src/stream_interface.c
+++ b/src/stream_interface.c
@@ -19,9 +19,8 @@
#include <sys/stat.h>
#include <sys/types.h>
+#include <haproxy/api.h>
#include <common/buffer.h>
-#include <common/compat.h>
-#include <common/config.h>
#include <common/debug.h>
#include <common/standard.h>
#include <common/ticks.h>
diff --git a/src/task.c b/src/task.c
index 2d965f2..a116b2e 100644
--- a/src/task.c
+++ b/src/task.c
@@ -12,7 +12,7 @@
#include <string.h>
-#include <common/config.h>
+#include <haproxy/api.h>
#include <common/memory.h>
#include <common/mini-clist.h>
#include <common/standard.h>
diff --git a/src/tcp_rules.c b/src/tcp_rules.c
index fc8b4ae..58e67ca 100644
--- a/src/tcp_rules.c
+++ b/src/tcp_rules.c
@@ -9,11 +9,9 @@
* 2 of the License, or (at your option) any later version.
*
*/
+#include <haproxy/api.h>
#include <common/cfgparse.h>
-#include <common/compat.h>
-#include <common/config.h>
#include <common/debug.h>
-#include <common/initcall.h>
#include <common/mini-clist.h>
#include <common/standard.h>
#include <common/ticks.h>
diff --git a/src/time.c b/src/time.c
index 8e3afda..5c8ed4b 100644
--- a/src/time.c
+++ b/src/time.c
@@ -10,11 +10,10 @@
*
*/
-#include <inttypes.h>
#include <unistd.h>
#include <sys/time.h>
-#include <common/config.h>
+#include <haproxy/api.h>
#include <common/standard.h>
#include <common/time.h>
#include <common/hathreads.h>
diff --git a/src/trace.c b/src/trace.c
index d3c27d8..667cd81 100644
--- a/src/trace.c
+++ b/src/trace.c
@@ -18,9 +18,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <haproxy/api.h>
#include <common/buffer.h>
-#include <common/compat.h>
-#include <common/config.h>
#include <common/ist.h>
#include <common/mini-clist.h>
#include <proto/cli.h>
diff --git a/src/uri_auth.c b/src/uri_auth.c
index 352737a..06266f3 100644
--- a/src/uri_auth.c
+++ b/src/uri_auth.c
@@ -13,8 +13,8 @@
#include <stdlib.h>
#include <string.h>
+#include <haproxy/api.h>
#include <common/base64.h>
-#include <common/config.h>
#include <common/uri_auth.h>
#include <types/stats.h>
diff --git a/src/vars.c b/src/vars.c
index ec95aaa..a213657 100644
--- a/src/vars.c
+++ b/src/vars.c
@@ -1,8 +1,8 @@
#include <ctype.h>
+#include <haproxy/api.h>
#include <common/cfgparse.h>
#include <common/http.h>
-#include <common/initcall.h>
#include <common/mini-clist.h>
#include <types/vars.h>
diff --git a/src/wdt.c b/src/wdt.c
index f8bd657..53382ef 100644
--- a/src/wdt.c
+++ b/src/wdt.c
@@ -12,10 +12,9 @@
#include <signal.h>
#include <time.h>
-#include <common/config.h>
+#include <haproxy/api.h>
#include <common/debug.h>
#include <common/hathreads.h>
-#include <common/initcall.h>
#include <common/standard.h>
#include <types/global.h>
#include <types/signal.h>
diff --git a/src/wurfl.c b/src/wurfl.c
index d53e378..f5de52a 100644
--- a/src/wurfl.c
+++ b/src/wurfl.c
@@ -1,11 +1,11 @@
#include <stdio.h>
#include <stdarg.h>
+#include <haproxy/api.h>
#include <common/cfgparse.h>
#include <common/chunk.h>
#include <common/buffer.h>
#include <common/errors.h>
-#include <common/initcall.h>
#include <types/global.h>
#include <proto/arg.h>
#include <proto/log.h>