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/contrib/mod_defender/defender.c b/contrib/mod_defender/defender.c
index 03f12a2..b552a7c 100644
--- a/contrib/mod_defender/defender.c
+++ b/contrib/mod_defender/defender.c
@@ -15,11 +15,10 @@
  * 3 of the License, or (at your option) any later version.
  *
  */
-#include <limits.h>
 #include <stdio.h>
 #include <stdarg.h>
 
-#include <common/defaults.h>
+#include <haproxy/api.h>
 #include <common/standard.h>
 #include <common/chunk.h>
 #include <common/time.h>
diff --git a/contrib/prometheus-exporter/service-prometheus.c b/contrib/prometheus-exporter/service-prometheus.c
index dfd5e1a..a31aa15 100644
--- a/contrib/prometheus-exporter/service-prometheus.c
+++ b/contrib/prometheus-exporter/service-prometheus.c
@@ -13,11 +13,10 @@
  *
  */
 
+#include <haproxy/api.h>
 #include <common/cfgparse.h>
-#include <common/config.h>
 #include <common/buffer.h>
 #include <common/htx.h>
-#include <common/initcall.h>
 #include <common/memory.h>
 #include <common/mini-clist.h>
 
diff --git a/include/common/base64.h b/include/common/base64.h
index 2f52ac7..e53a352 100644
--- a/include/common/base64.h
+++ b/include/common/base64.h
@@ -14,7 +14,7 @@
 #ifndef _COMMON_BASE64_H
 #define _COMMON_BASE64_H
 
-#include <common/config.h>
+#include <haproxy/api.h>
 
 int a2base64(char *in, int ilen, char *out, int olen);
 int base64dec(const char *in, size_t ilen, char *out, size_t olen);
diff --git a/include/common/buffer.h b/include/common/buffer.h
index 779186f..f7aa254 100644
--- a/include/common/buffer.h
+++ b/include/common/buffer.h
@@ -26,9 +26,9 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include <haproxy/api.h>
 #include <common/buf.h>
 #include <common/chunk.h>
-#include <common/config.h>
 #include <common/ist.h>
 #include <common/istbuf.h>
 #include <common/memory.h>
diff --git a/include/common/cfgparse.h b/include/common/cfgparse.h
index 1a28816..8ecb771 100644
--- a/include/common/cfgparse.h
+++ b/include/common/cfgparse.h
@@ -22,9 +22,7 @@
 #ifndef _COMMON_CFGPARSE_H
 #define _COMMON_CFGPARSE_H
 
-#include <common/compat.h>
-#include <common/config.h>
-#include <common/initcall.h>
+#include <haproxy/api.h>
 #include <common/mini-clist.h>
 
 #include <proto/log.h>
diff --git a/include/common/chunk.h b/include/common/chunk.h
index a061a34..ae7ae85 100644
--- a/include/common/chunk.h
+++ b/include/common/chunk.h
@@ -25,8 +25,8 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include <haproxy/api.h>
 #include <common/buf.h>
-#include <common/config.h>
 #include <common/ist.h>
 #include <common/memory.h>
 
diff --git a/include/common/config.h b/include/common/config.h
index 30da555..49d219c 100644
--- a/include/common/config.h
+++ b/include/common/config.h
@@ -22,8 +22,6 @@
 #ifndef _COMMON_CONFIG_H
 #define _COMMON_CONFIG_H
 
-#include <common/compiler.h>
-#include <common/compat.h>
-#include <common/defaults.h>
+#include <haproxy/api.h>
 
 #endif /* _COMMON_CONFIG_H */
diff --git a/include/common/debug.h b/include/common/debug.h
index c6c154c..c234bdc 100644
--- a/include/common/debug.h
+++ b/include/common/debug.h
@@ -22,7 +22,7 @@
 #ifndef _COMMON_DEBUG_H
 #define _COMMON_DEBUG_H
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <common/memory.h>
 
 #ifdef DEBUG_FULL
diff --git a/include/common/fcgi.h b/include/common/fcgi.h
index d85e118..b9a752b 100644
--- a/include/common/fcgi.h
+++ b/include/common/fcgi.h
@@ -22,9 +22,8 @@
 #ifndef _COMMON_FCGI_H
 #define _COMMON_FCGI_H
 
-#include <inttypes.h>
 #include <stdio.h>
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <common/standard.h>
 #include <common/buf.h>
 #include <common/ist.h>
diff --git a/include/common/h1.h b/include/common/h1.h
index fc28b48..0bc0f48 100644
--- a/include/common/h1.h
+++ b/include/common/h1.h
@@ -22,9 +22,8 @@
 #ifndef _COMMON_H1_H
 #define _COMMON_H1_H
 
+#include <haproxy/api.h>
 #include <common/buffer.h>
-#include <common/compiler.h>
-#include <common/config.h>
 #include <common/http.h>
 #include <common/http-hdr.h>
 #include <common/ist.h>
diff --git a/include/common/h2.h b/include/common/h2.h
index 0358299..5654a76 100644
--- a/include/common/h2.h
+++ b/include/common/h2.h
@@ -29,7 +29,7 @@
 #ifndef _COMMON_H2_H
 #define _COMMON_H2_H
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <common/http-hdr.h>
 #include <common/htx.h>
 #include <common/ist.h>
diff --git a/include/common/hathreads.h b/include/common/hathreads.h
index 45ec1d2..e25dfc8 100644
--- a/include/common/hathreads.h
+++ b/include/common/hathreads.h
@@ -27,9 +27,8 @@
 #ifdef _POSIX_PRIORITY_SCHEDULING
 #include <sched.h>
 #endif
+#include <haproxy/api.h>
 
-#include <common/config.h>
-#include <common/initcall.h>
 
 /* Note about all_threads_mask :
  *    - this variable is comprised between 1 and LONGBITS.
diff --git a/include/common/hpack-dec.h b/include/common/hpack-dec.h
index 39d1bf0..f538332 100644
--- a/include/common/hpack-dec.h
+++ b/include/common/hpack-dec.h
@@ -28,9 +28,8 @@
 #ifndef _COMMON_HPACK_DEC_H
 #define _COMMON_HPACK_DEC_H
 
-#include <inttypes.h>
+#include <haproxy/api.h>
 #include <common/chunk.h>
-#include <common/config.h>
 #include <common/hpack-tbl.h>
 
 int hpack_decode_frame(struct hpack_dht *dht, const uint8_t *raw, uint32_t len,
diff --git a/include/common/hpack-enc.h b/include/common/hpack-enc.h
index 555dba8..f204853 100644
--- a/include/common/hpack-enc.h
+++ b/include/common/hpack-enc.h
@@ -28,10 +28,9 @@
 #ifndef _COMMON_HPACK_ENC_H
 #define _COMMON_HPACK_ENC_H
 
-#include <inttypes.h>
 #include <string.h>
+#include <haproxy/api.h>
 #include <common/buf.h>
-#include <common/config.h>
 #include <common/http.h>
 #include <common/ist.h>
 
diff --git a/include/common/hpack-tbl.h b/include/common/hpack-tbl.h
index 6d529f2..cde7114 100644
--- a/include/common/hpack-tbl.h
+++ b/include/common/hpack-tbl.h
@@ -27,9 +27,8 @@
 #ifndef _COMMON_HPACK_TBL_H
 #define _COMMON_HPACK_TBL_H
 
-#include <inttypes.h>
 #include <stdlib.h>
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <common/http-hdr.h>
 #include <common/ist.h>
 #include <common/memory.h>
diff --git a/include/common/htx.h b/include/common/htx.h
index 3d54c4a..5a13614 100644
--- a/include/common/htx.h
+++ b/include/common/htx.h
@@ -23,8 +23,8 @@
 #define _COMMON_HTX_H
 
 #include <stdio.h>
+#include <haproxy/api.h>
 #include <common/buf.h>
-#include <common/config.h>
 #include <common/ist.h>
 #include <common/http.h>
 #include <common/http-hdr.h>
diff --git a/include/common/ist.h b/include/common/ist.h
index 8dd6615..d62924e 100644
--- a/include/common/ist.h
+++ b/include/common/ist.h
@@ -36,7 +36,7 @@
 #include <stdlib.h>
 #endif
 
-#include <common/config.h>
+#include <haproxy/api.h>
 
 /* ASCII to lower case conversion table */
 #define _IST_LC ((const unsigned char[256]){            \
diff --git a/include/common/memory.h b/include/common/memory.h
index d3950ca..8b03daf 100644
--- a/include/common/memory.h
+++ b/include/common/memory.h
@@ -26,13 +26,11 @@
 
 #include <stdlib.h>
 #include <string.h>
-#include <inttypes.h>
 #include <unistd.h>
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <common/mini-clist.h>
 #include <common/hathreads.h>
-#include <common/initcall.h>
 
 /* On architectures supporting threads and double-word CAS, we can implement
  * lock-less memory pools. This isn't supported for debugging modes however.
diff --git a/include/common/mini-clist.h b/include/common/mini-clist.h
index 5d3954c..188d118 100644
--- a/include/common/mini-clist.h
+++ b/include/common/mini-clist.h
@@ -22,7 +22,6 @@
 #ifndef _COMMON_MINI_CLIST_H
 #define _COMMON_MINI_CLIST_H
 
-#include <common/config.h>
 
 /* these are circular or bidirectionnal lists only. Each list pointer points to
  * another list pointer in a structure, and not the structure itself. The
@@ -258,6 +257,7 @@
 	     &item->member != (list_head);                               \
 	     item = back, back = LIST_ELEM(back->member.p, typeof(back), member))
 
+#include <haproxy/api.h>
 #include <common/hathreads.h>
 #define MT_LIST_BUSY ((struct mt_list *)1)
 
diff --git a/include/common/net_helper.h b/include/common/net_helper.h
index 0443fe1..8fdf120 100644
--- a/include/common/net_helper.h
+++ b/include/common/net_helper.h
@@ -27,7 +27,7 @@
 #ifndef _COMMON_NET_HELPER_H
 #define _COMMON_NET_HELPER_H
 
-#include <common/compiler.h>
+#include <haproxy/api.h>
 #include <common/standard.h>
 #include <arpa/inet.h>
 
diff --git a/include/common/regex.h b/include/common/regex.h
index cecfbd9..d106b86 100644
--- a/include/common/regex.h
+++ b/include/common/regex.h
@@ -25,7 +25,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <common/hathreads.h>
 
 #ifdef USE_PCRE
diff --git a/include/common/standard.h b/include/common/standard.h
index 3f6f954..fdbfc48 100644
--- a/include/common/standard.h
+++ b/include/common/standard.h
@@ -27,7 +27,6 @@
 #include <execinfo.h>
 #endif
 
-#include <limits.h>
 #include <string.h>
 #include <stdio.h>
 #include <time.h>
@@ -38,8 +37,8 @@
 #include <sys/un.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
+#include <haproxy/api.h>
 #include <common/chunk.h>
-#include <common/config.h>
 #include <common/namespace.h>
 #include <import/eb32tree.h>
 #include <import/eb32sctree.h>
diff --git a/include/common/template.h b/include/common/template.h
index c9e48bf..beb714d 100644
--- a/include/common/template.h
+++ b/include/common/template.h
@@ -22,7 +22,7 @@
 #ifndef _COMMON_TEMPLATE_H
 #define _COMMON_TEMPLATE_H
 
-#include <common/config.h>
+#include <haproxy/api.h>
 
 #endif /* _COMMON_TEMPLATE_H */
 
diff --git a/include/common/ticks.h b/include/common/ticks.h
index de29b31..807b323 100644
--- a/include/common/ticks.h
+++ b/include/common/ticks.h
@@ -52,7 +52,7 @@
 #ifndef _COMMON_TICKS_H
 #define _COMMON_TICKS_H
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <common/standard.h>
 
 #define TICK_ETERNITY   0
diff --git a/include/common/time.h b/include/common/time.h
index e59ed5e..2a4ec0a 100644
--- a/include/common/time.h
+++ b/include/common/time.h
@@ -22,11 +22,10 @@
 #ifndef _COMMON_TIME_H
 #define _COMMON_TIME_H
 
-#include <inttypes.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <sys/time.h>
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <common/hathreads.h>
 #include <common/standard.h>
 
diff --git a/include/common/tools.h b/include/common/tools.h
index 9610601..c7c0c88 100644
--- a/include/common/tools.h
+++ b/include/common/tools.h
@@ -23,7 +23,6 @@
 #define _COMMON_TOOLS_H
 
 #include <sys/param.h>
-#include <common/config.h>
 
 #ifndef MIN
 #define MIN(a, b) (((a) < (b)) ? (a) : (b))
diff --git a/include/common/uri_auth.h b/include/common/uri_auth.h
index 8223dc1..3359653 100644
--- a/include/common/uri_auth.h
+++ b/include/common/uri_auth.h
@@ -13,8 +13,8 @@
 #ifndef _COMMON_URI_AUTH_H
 #define _COMMON_URI_AUTH_H
 
-#include <common/config.h>
 
+#include <haproxy/api.h>
 #include <types/auth.h>
 
 /* This is a list of proxies we are allowed to see. Later, it should go in the
diff --git a/include/common/version.h b/include/common/version.h
index 7eba4a3..b38104f 100644
--- a/include/common/version.h
+++ b/include/common/version.h
@@ -22,7 +22,7 @@
 #ifndef _COMMON_VERSION_H
 #define _COMMON_VERSION_H
 
-#include <common/config.h>
+#include <haproxy/api.h>
 
 #ifdef  CONFIG_PRODUCT_NAME
 #define PRODUCT_NAME    CONFIG_PRODUCT_NAME
diff --git a/include/import/ebtree.h b/include/import/ebtree.h
index 9e5daca..73ca6d5 100644
--- a/include/import/ebtree.h
+++ b/include/import/ebtree.h
@@ -247,7 +247,7 @@
 #define _EBTREE_H
 
 #include <stdlib.h>
-#include <common/compiler.h>
+#include <haproxy/api.h>
 
 static inline int flsnz8_generic(unsigned int x)
 {
diff --git a/include/proto/acl.h b/include/proto/acl.h
index dd6dae5..28b49c4 100644
--- a/include/proto/acl.h
+++ b/include/proto/acl.h
@@ -22,7 +22,7 @@
 #ifndef _PROTO_ACL_H
 #define _PROTO_ACL_H
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <types/acl.h>
 #include <proto/sample.h>
 
diff --git a/include/proto/activity.h b/include/proto/activity.h
index 673d274..26365ca 100644
--- a/include/proto/activity.h
+++ b/include/proto/activity.h
@@ -22,7 +22,7 @@
 #ifndef _PROTO_ACTIVITY_H
 #define _PROTO_ACTIVITY_H
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <common/hathreads.h>
 #include <common/time.h>
 #include <types/activity.h>
diff --git a/include/proto/applet.h b/include/proto/applet.h
index 14fbca2..ea8bc0b 100644
--- a/include/proto/applet.h
+++ b/include/proto/applet.h
@@ -24,7 +24,7 @@
 
 #include <stdlib.h>
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <common/memory.h>
 #include <common/mini-clist.h>
 #include <types/applet.h>
diff --git a/include/proto/auth.h b/include/proto/auth.h
index eea5df5..853e38c 100644
--- a/include/proto/auth.h
+++ b/include/proto/auth.h
@@ -13,7 +13,7 @@
 #ifndef _PROTO_AUTH_H
 #define _PROTO_AUTH_H
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <types/auth.h>
 
 extern struct userlist *userlist;
diff --git a/include/proto/backend.h b/include/proto/backend.h
index 5764c13..5160492 100644
--- a/include/proto/backend.h
+++ b/include/proto/backend.h
@@ -22,7 +22,7 @@
 #ifndef _PROTO_BACKEND_H
 #define _PROTO_BACKEND_H
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <common/time.h>
 
 #include <types/backend.h>
diff --git a/include/proto/channel.h b/include/proto/channel.h
index 175d311..16954ba 100644
--- a/include/proto/channel.h
+++ b/include/proto/channel.h
@@ -27,7 +27,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <common/chunk.h>
 #include <common/htx.h>
 #include <common/ticks.h>
diff --git a/include/proto/connection.h b/include/proto/connection.h
index 8629438..9b1e3d8 100644
--- a/include/proto/connection.h
+++ b/include/proto/connection.h
@@ -22,7 +22,7 @@
 #ifndef _PROTO_CONNECTION_H
 #define _PROTO_CONNECTION_H
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <common/ist.h>
 #include <common/memory.h>
 #include <types/connection.h>
diff --git a/include/proto/fd.h b/include/proto/fd.h
index 8848437..a3c476d 100644
--- a/include/proto/fd.h
+++ b/include/proto/fd.h
@@ -27,7 +27,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <common/ticks.h>
 #include <common/time.h>
 #include <types/fd.h>
diff --git a/include/proto/freq_ctr.h b/include/proto/freq_ctr.h
index 63febb2..7413803 100644
--- a/include/proto/freq_ctr.h
+++ b/include/proto/freq_ctr.h
@@ -22,7 +22,7 @@
 #ifndef _PROTO_FREQ_CTR_H
 #define _PROTO_FREQ_CTR_H
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <common/standard.h>
 #include <common/time.h>
 #include <common/hathreads.h>
diff --git a/include/proto/frontend.h b/include/proto/frontend.h
index 61d0409..37d484c 100644
--- a/include/proto/frontend.h
+++ b/include/proto/frontend.h
@@ -22,7 +22,7 @@
 #ifndef _PROTO_FRONTEND_H
 #define _PROTO_FRONTEND_H
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <types/stream.h>
 
 int frontend_accept(struct stream *s);
diff --git a/include/proto/http_ana.h b/include/proto/http_ana.h
index 8943576..cdfa87e 100644
--- a/include/proto/http_ana.h
+++ b/include/proto/http_ana.h
@@ -22,7 +22,7 @@
 #ifndef _PROTO_PROTO_HTTP_H
 #define _PROTO_PROTO_HTTP_H
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <common/htx.h>
 #include <types/channel.h>
 #include <types/http_ana.h>
diff --git a/include/proto/http_fetch.h b/include/proto/http_fetch.h
index 562e703..22c793f 100644
--- a/include/proto/http_fetch.h
+++ b/include/proto/http_fetch.h
@@ -22,7 +22,7 @@
 #ifndef _PROTO_HTTP_FETCH_H
 #define _PROTO_HTTP_FETCH_H
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <common/htx.h>
 #include <types/arg.h>
 #include <types/channel.h>
diff --git a/include/proto/http_rules.h b/include/proto/http_rules.h
index 3e57b9d..27c4b6a 100644
--- a/include/proto/http_rules.h
+++ b/include/proto/http_rules.h
@@ -22,7 +22,7 @@
 #ifndef _PROTO_HTTP_RULES_H
 #define _PROTO_HTTP_RULES_H
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <common/mini-clist.h>
 #include <types/action.h>
 #include <types/proxy.h>
diff --git a/include/proto/lb_chash.h b/include/proto/lb_chash.h
index 679dff3..0a44967 100644
--- a/include/proto/lb_chash.h
+++ b/include/proto/lb_chash.h
@@ -22,7 +22,7 @@
 #ifndef _PROTO_LB_CHASH_H
 #define _PROTO_LB_CHASH_H
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <types/proxy.h>
 #include <types/server.h>
 
diff --git a/include/proto/lb_fas.h b/include/proto/lb_fas.h
index 602c4f6..4e1f02d 100644
--- a/include/proto/lb_fas.h
+++ b/include/proto/lb_fas.h
@@ -22,7 +22,7 @@
 #ifndef _PROTO_LB_FAS_H
 #define _PROTO_LB_FAS_H
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <types/proxy.h>
 #include <types/server.h>
 
diff --git a/include/proto/lb_fwlc.h b/include/proto/lb_fwlc.h
index 8c56746..a7a46ff 100644
--- a/include/proto/lb_fwlc.h
+++ b/include/proto/lb_fwlc.h
@@ -22,7 +22,7 @@
 #ifndef _PROTO_LB_FWLC_H
 #define _PROTO_LB_FWLC_H
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <types/proxy.h>
 #include <types/server.h>
 
diff --git a/include/proto/lb_fwrr.h b/include/proto/lb_fwrr.h
index 1189c38..c23a471 100644
--- a/include/proto/lb_fwrr.h
+++ b/include/proto/lb_fwrr.h
@@ -22,7 +22,7 @@
 #ifndef _PROTO_LB_FWRR_H
 #define _PROTO_LB_FWRR_H
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <types/proxy.h>
 #include <types/server.h>
 
diff --git a/include/proto/lb_map.h b/include/proto/lb_map.h
index cf7349e..0dc089b 100644
--- a/include/proto/lb_map.h
+++ b/include/proto/lb_map.h
@@ -22,7 +22,7 @@
 #ifndef _PROTO_LB_MAP_H
 #define _PROTO_LB_MAP_H
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <types/proxy.h>
 #include <types/server.h>
 
diff --git a/include/proto/log.h b/include/proto/log.h
index 6e342e3..a84d612 100644
--- a/include/proto/log.h
+++ b/include/proto/log.h
@@ -26,7 +26,7 @@
 #include <stdio.h>
 #include <syslog.h>
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <common/memory.h>
 #include <common/hathreads.h>
 
diff --git a/include/proto/mux_pt.h b/include/proto/mux_pt.h
index 33c4e32..d61305a 100644
--- a/include/proto/mux_pt.h
+++ b/include/proto/mux_pt.h
@@ -22,7 +22,7 @@
 #ifndef _PROTO_MUX_PT_H
 #define _PROTO_MUX_PT_H
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <types/connection.h>
 
 extern const struct mux_ops mux_pt_ops;
diff --git a/include/proto/obj_type.h b/include/proto/obj_type.h
index 799732b..f4816b1 100644
--- a/include/proto/obj_type.h
+++ b/include/proto/obj_type.h
@@ -22,7 +22,7 @@
 #ifndef _PROTO_OBJ_TYPE_H
 #define _PROTO_OBJ_TYPE_H
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <common/memory.h>
 #include <types/applet.h>
 #include <types/connection.h>
diff --git a/include/proto/pattern.h b/include/proto/pattern.h
index 39514b1..2d51d95 100644
--- a/include/proto/pattern.h
+++ b/include/proto/pattern.h
@@ -24,7 +24,7 @@
 
 #include <string.h>
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <common/standard.h>
 #include <types/pattern.h>
 
diff --git a/include/proto/payload.h b/include/proto/payload.h
index 9674832..481b613 100644
--- a/include/proto/payload.h
+++ b/include/proto/payload.h
@@ -22,7 +22,7 @@
 #ifndef _PROTO_PROTO_PAYLOAD_H
 #define _PROTO_PROTO_PAYLOAD_H
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <types/sample.h>
 #include <types/stream.h>
 
diff --git a/include/proto/peers.h b/include/proto/peers.h
index 74e20da..fbe6cf6 100644
--- a/include/proto/peers.h
+++ b/include/proto/peers.h
@@ -22,7 +22,7 @@
 #ifndef _PROTO_PEERS_H
 #define _PROTO_PEERS_H
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <common/ticks.h>
 #include <common/time.h>
 #include <proto/connection.h>
diff --git a/include/proto/pipe.h b/include/proto/pipe.h
index 0c02165..4dd3dd6 100644
--- a/include/proto/pipe.h
+++ b/include/proto/pipe.h
@@ -22,7 +22,7 @@
 #ifndef _PROTO_PIPE_H
 #define _PROTO_PIPE_H
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <types/pipe.h>
 
 extern int pipes_used;	/* # of pipes in use (2 fds each) */
diff --git a/include/proto/proto_tcp.h b/include/proto/proto_tcp.h
index daac1d8..347305b 100644
--- a/include/proto/proto_tcp.h
+++ b/include/proto/proto_tcp.h
@@ -22,7 +22,7 @@
 #ifndef _PROTO_PROTO_TCP_H
 #define _PROTO_PROTO_TCP_H
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <types/action.h>
 #include <types/task.h>
 #include <proto/stick_table.h>
diff --git a/include/proto/proxy.h b/include/proto/proxy.h
index db4cb89..630a011 100644
--- a/include/proto/proxy.h
+++ b/include/proto/proxy.h
@@ -22,7 +22,7 @@
 #ifndef _PROTO_PROXY_H
 #define _PROTO_PROXY_H
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <common/ticks.h>
 #include <common/time.h>
 #include <types/applet.h>
diff --git a/include/proto/queue.h b/include/proto/queue.h
index a7ab63b..8ef9179 100644
--- a/include/proto/queue.h
+++ b/include/proto/queue.h
@@ -22,7 +22,7 @@
 #ifndef _PROTO_QUEUE_H
 #define _PROTO_QUEUE_H
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <common/memory.h>
 #include <common/mini-clist.h>
 
diff --git a/include/proto/server.h b/include/proto/server.h
index f8fed31..4c4b4bf 100644
--- a/include/proto/server.h
+++ b/include/proto/server.h
@@ -24,7 +24,7 @@
 
 #include <unistd.h>
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <common/time.h>
 #include <types/applet.h>
 #include <types/dns.h>
diff --git a/include/proto/session.h b/include/proto/session.h
index a5b95a8..61a7b00 100644
--- a/include/proto/session.h
+++ b/include/proto/session.h
@@ -22,7 +22,7 @@
 #ifndef _PROTO_SESSION_H
 #define _PROTO_SESSION_H
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <common/buffer.h>
 #include <common/debug.h>
 #include <common/memory.h>
diff --git a/include/proto/stats.h b/include/proto/stats.h
index d20beea..5342e12 100644
--- a/include/proto/stats.h
+++ b/include/proto/stats.h
@@ -23,7 +23,7 @@
 #ifndef _PROTO_STATS_H
 #define _PROTO_STATS_H
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <types/applet.h>
 #include <types/stream_interface.h>
 #include <types/stats.h>
diff --git a/include/proto/stream.h b/include/proto/stream.h
index 69153df..752c183 100644
--- a/include/proto/stream.h
+++ b/include/proto/stream.h
@@ -22,7 +22,7 @@
 #ifndef _PROTO_STREAM_H
 #define _PROTO_STREAM_H
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <common/memory.h>
 #include <types/action.h>
 #include <types/stream.h>
diff --git a/include/proto/stream_interface.h b/include/proto/stream_interface.h
index 490ee5e..98ccb28 100644
--- a/include/proto/stream_interface.h
+++ b/include/proto/stream_interface.h
@@ -24,7 +24,7 @@
 
 #include <stdlib.h>
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <types/stream.h>
 #include <types/stream_interface.h>
 #include <proto/applet.h>
diff --git a/include/proto/task.h b/include/proto/task.h
index 52b284d..a42431a 100644
--- a/include/proto/task.h
+++ b/include/proto/task.h
@@ -25,7 +25,7 @@
 
 #include <sys/time.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/include/proto/tcp_rules.h b/include/proto/tcp_rules.h
index bf920a1..b9a4c93 100644
--- a/include/proto/tcp_rules.h
+++ b/include/proto/tcp_rules.h
@@ -22,7 +22,7 @@
 #ifndef _PROTO_TCP_RULES_H
 #define _PROTO_TCP_RULES_H
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <types/action.h>
 #include <types/task.h>
 #include <proto/stick_table.h>
diff --git a/include/proto/template.h b/include/proto/template.h
index f7f9e55..c6a11c2 100644
--- a/include/proto/template.h
+++ b/include/proto/template.h
@@ -22,7 +22,7 @@
 #ifndef _PROTO_TEMPLATE_H
 #define _PROTO_TEMPLATE_H
 
-#include <common/config.h>
+#include <haproxy/api.h>
 #include <types/template.h>
 
 
diff --git a/include/proto/trace.h b/include/proto/trace.h
index ece2329..ef88079 100644
--- a/include/proto/trace.h
+++ b/include/proto/trace.h
@@ -22,9 +22,8 @@
 #ifndef _PROTO_TRACE_H
 #define _PROTO_TRACE_H
 
+#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 <types/log.h>
diff --git a/include/types/acl.h b/include/types/acl.h
index f5d3858..748f361 100644
--- a/include/types/acl.h
+++ b/include/types/acl.h
@@ -22,8 +22,7 @@
 #ifndef _TYPES_ACL_H
 #define _TYPES_ACL_H
 
-#include <common/compat.h>
-#include <common/config.h>
+#include <haproxy/api-t.h>
 #include <common/mini-clist.h>
 
 #include <types/arg.h>
diff --git a/include/types/activity.h b/include/types/activity.h
index 01e484f..312380f 100644
--- a/include/types/activity.h
+++ b/include/types/activity.h
@@ -22,7 +22,7 @@
 #ifndef _TYPES_ACTIVITY_H
 #define _TYPES_ACTIVITY_H
 
-#include <common/config.h>
+#include <haproxy/api-t.h>
 #include <types/freq_ctr.h>
 
 /* per-thread activity reports. It's important that it's aligned on cache lines
diff --git a/include/types/applet.h b/include/types/applet.h
index a4e22e3..aa1bc31 100644
--- a/include/types/applet.h
+++ b/include/types/applet.h
@@ -22,6 +22,7 @@
 #ifndef _TYPES_APPLET_H
 #define _TYPES_APPLET_H
 
+#include <haproxy/api-t.h>
 #include <types/freq_ctr.h>
 #include <types/hlua.h>
 #include <types/obj_type.h>
@@ -29,7 +30,6 @@
 #include <types/stream.h>
 #include <common/buffer.h>
 #include <common/chunk.h>
-#include <common/config.h>
 #include <common/xref.h>
 
 struct appctx;
diff --git a/include/types/auth.h b/include/types/auth.h
index 964f29b..c10aced 100644
--- a/include/types/auth.h
+++ b/include/types/auth.h
@@ -13,7 +13,7 @@
 #ifndef _TYPES_AUTH_H
 #define _TYPES_AUTH_H
 
-#include <common/config.h>
+#include <haproxy/api-t.h>
 #include <common/mini-clist.h>
 
 #include <types/auth.h>
diff --git a/include/types/backend.h b/include/types/backend.h
index 22e5f21..3150ecf 100644
--- a/include/types/backend.h
+++ b/include/types/backend.h
@@ -22,7 +22,7 @@
 #ifndef _TYPES_BACKEND_H
 #define _TYPES_BACKEND_H
 
-#include <common/config.h>
+#include <haproxy/api-t.h>
 #include <common/hathreads.h>
 
 #include <types/lb_chash.h>
diff --git a/include/types/capture.h b/include/types/capture.h
index a9ced25..493d0be 100644
--- a/include/types/capture.h
+++ b/include/types/capture.h
@@ -22,7 +22,7 @@
 #ifndef _TYPES_CAPTURE_H
 #define _TYPES_CAPTURE_H
 
-#include <common/config.h>
+#include <haproxy/api-t.h>
 #include <common/memory.h>
 
 struct cap_hdr {
diff --git a/include/types/channel.h b/include/types/channel.h
index 4bcc3b9..863c3fb 100644
--- a/include/types/channel.h
+++ b/include/types/channel.h
@@ -22,7 +22,7 @@
 #ifndef _TYPES_CHANNEL_H
 #define _TYPES_CHANNEL_H
 
-#include <common/config.h>
+#include <haproxy/api-t.h>
 #include <common/buffer.h>
 
 /* The CF_* macros designate Channel Flags, which may be ORed in the bit field
diff --git a/include/types/checks.h b/include/types/checks.h
index a23091c..b2be640 100644
--- a/include/types/checks.h
+++ b/include/types/checks.h
@@ -13,10 +13,10 @@
 #ifndef _TYPES_CHECKS_H
 #define _TYPES_CHECKS_H
 
+#include <haproxy/api-t.h>
 #include <import/ebpttree.h>
 
 #include <common/standard.h>
-#include <common/config.h>
 #include <common/ist.h>
 #include <common/mini-clist.h>
 #include <common/regex.h>
diff --git a/include/types/connection.h b/include/types/connection.h
index 8780590..7357174 100644
--- a/include/types/connection.h
+++ b/include/types/connection.h
@@ -25,7 +25,7 @@
 #include <stdlib.h>
 #include <sys/socket.h>
 
-#include <common/config.h>
+#include <haproxy/api-t.h>
 #include <common/ist.h>
 
 #include <types/listener.h>
diff --git a/include/types/fcgi-app.h b/include/types/fcgi-app.h
index d7beb26..f0fcdc7 100644
--- a/include/types/fcgi-app.h
+++ b/include/types/fcgi-app.h
@@ -22,7 +22,7 @@
 #ifndef _TYPES_HTTP_FCGI_H
 #define _TYPES_HTTP_FCGI_H
 
-#include <common/config.h>
+#include <haproxy/api-t.h>
 #include <common/ist.h>
 #include <common/fcgi.h>
 #include <common/mini-clist.h>
diff --git a/include/types/fd.h b/include/types/fd.h
index 178dea1..0041d4d 100644
--- a/include/types/fd.h
+++ b/include/types/fd.h
@@ -22,7 +22,7 @@
 #ifndef _TYPES_FD_H
 #define _TYPES_FD_H
 
-#include <common/config.h>
+#include <haproxy/api-t.h>
 #include <common/hathreads.h>
 #include <common/ist.h>
 #include <types/port_range.h>
diff --git a/include/types/filters.h b/include/types/filters.h
index 1930e2a..5de4eee 100644
--- a/include/types/filters.h
+++ b/include/types/filters.h
@@ -21,7 +21,7 @@
 #ifndef _TYPES_FILTERS_H
 #define _TYPES_FILTERS_H
 
-#include <common/config.h>
+#include <haproxy/api-t.h>
 #include <common/mini-clist.h>
 
 struct http_msg;
diff --git a/include/types/freq_ctr.h b/include/types/freq_ctr.h
index 425ddf3..3b02cf9 100644
--- a/include/types/freq_ctr.h
+++ b/include/types/freq_ctr.h
@@ -22,7 +22,7 @@
 #ifndef _TYPES_FREQ_CTR_H
 #define _TYPES_FREQ_CTR_H
 
-#include <common/config.h>
+#include <haproxy/api-t.h>
 
 /* The implicit freq_ctr counter counts a rate of events per second. It is the
  * preferred form to count rates over a one-second period, because it does not
diff --git a/include/types/global.h b/include/types/global.h
index 592d288..cb9ff4b 100644
--- a/include/types/global.h
+++ b/include/types/global.h
@@ -24,8 +24,7 @@
 
 #include <netinet/in.h>
 
-#include <common/config.h>
-#include <common/initcall.h>
+#include <haproxy/api-t.h>
 #include <common/hathreads.h>
 
 #include <types/freq_ctr.h>
diff --git a/include/types/http_ana.h b/include/types/http_ana.h
index c17dc18..7bade13 100644
--- a/include/types/http_ana.h
+++ b/include/types/http_ana.h
@@ -22,7 +22,7 @@
 #ifndef _TYPES_PROTO_HTTP_H
 #define _TYPES_PROTO_HTTP_H
 
-#include <common/config.h>
+#include <haproxy/api-t.h>
 #include <common/http.h>
 
 #include <types/channel.h>
diff --git a/include/types/lb_chash.h b/include/types/lb_chash.h
index 9486064..a57a229 100644
--- a/include/types/lb_chash.h
+++ b/include/types/lb_chash.h
@@ -22,7 +22,7 @@
 #ifndef _TYPES_LB_CHASH_H
 #define _TYPES_LB_CHASH_H
 
-#include <common/config.h>
+#include <haproxy/api-t.h>
 #include <import/ebtree.h>
 #include <import/eb32tree.h>
 
diff --git a/include/types/lb_fas.h b/include/types/lb_fas.h
index e20d70a..040563e 100644
--- a/include/types/lb_fas.h
+++ b/include/types/lb_fas.h
@@ -22,7 +22,7 @@
 #ifndef _TYPES_LB_FAS_H
 #define _TYPES_LB_FAS_H
 
-#include <common/config.h>
+#include <haproxy/api-t.h>
 #include <import/ebtree.h>
 
 struct lb_fas {
diff --git a/include/types/lb_fwlc.h b/include/types/lb_fwlc.h
index f20659a..c87d61e 100644
--- a/include/types/lb_fwlc.h
+++ b/include/types/lb_fwlc.h
@@ -22,7 +22,7 @@
 #ifndef _TYPES_LB_FWLC_H
 #define _TYPES_LB_FWLC_H
 
-#include <common/config.h>
+#include <haproxy/api-t.h>
 #include <import/ebtree.h>
 
 struct lb_fwlc {
diff --git a/include/types/lb_fwrr.h b/include/types/lb_fwrr.h
index 754d0c6..6a2a04c 100644
--- a/include/types/lb_fwrr.h
+++ b/include/types/lb_fwrr.h
@@ -22,7 +22,7 @@
 #ifndef _TYPES_LB_FWRR_H
 #define _TYPES_LB_FWRR_H
 
-#include <common/config.h>
+#include <haproxy/api-t.h>
 #include <import/ebtree.h>
 
 /* This structure is used to apply fast weighted round robin on a server group */
diff --git a/include/types/lb_map.h b/include/types/lb_map.h
index 38e26af..5409a81 100644
--- a/include/types/lb_map.h
+++ b/include/types/lb_map.h
@@ -22,7 +22,7 @@
 #ifndef _TYPES_LB_MAP_H
 #define _TYPES_LB_MAP_H
 
-#include <common/config.h>
+#include <haproxy/api-t.h>
 #include <types/server.h>
 
 struct lb_map {
diff --git a/include/types/listener.h b/include/types/listener.h
index d035a90..cbd4bab 100644
--- a/include/types/listener.h
+++ b/include/types/listener.h
@@ -26,10 +26,10 @@
 #include <sys/socket.h>
 
 #ifdef USE_OPENSSL
+#include <haproxy/api-t.h>
 #include <common/openssl-compat.h>
 #endif
 
-#include <common/config.h>
 #include <common/mini-clist.h>
 #include <common/hathreads.h>
 
diff --git a/include/types/log.h b/include/types/log.h
index fb9aa58..2c2ac02 100644
--- a/include/types/log.h
+++ b/include/types/log.h
@@ -25,7 +25,7 @@
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <netinet/in.h>
-#include <common/config.h>
+#include <haproxy/api-t.h>
 #include <common/hathreads.h>
 #include <common/mini-clist.h>
 #include <types/ring.h>
diff --git a/include/types/pattern.h b/include/types/pattern.h
index f4c0a13..f1468b3 100644
--- a/include/types/pattern.h
+++ b/include/types/pattern.h
@@ -22,8 +22,7 @@
 #ifndef _TYPES_PATTERN_H
 #define _TYPES_PATTERN_H
 
-#include <common/compat.h>
-#include <common/config.h>
+#include <haproxy/api-t.h>
 #include <common/mini-clist.h>
 #include <common/regex.h>
 
diff --git a/include/types/peers.h b/include/types/peers.h
index 78270bf..7461347 100644
--- a/include/types/peers.h
+++ b/include/types/peers.h
@@ -27,10 +27,9 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
-#include <common/config.h>
+#include <haproxy/api-t.h>
 #include <common/mini-clist.h>
 #include <common/regex.h>
-#include <common/tools.h>
 #include <import/eb32tree.h>
 
 #include <types/dict.h>
diff --git a/include/types/pipe.h b/include/types/pipe.h
index 12a1eee..c646029 100644
--- a/include/types/pipe.h
+++ b/include/types/pipe.h
@@ -22,7 +22,7 @@
 #ifndef _TYPES_PIPE_H
 #define _TYPES_PIPE_H
 
-#include <common/config.h>
+#include <haproxy/api-t.h>
 
 /* A pipe is described by its read and write FDs, and the data remaining in it.
  * The FDs are valid if there are data pending. The user is not allowed to
diff --git a/include/types/protocol.h b/include/types/protocol.h
index 10437a7..edda61c 100644
--- a/include/types/protocol.h
+++ b/include/types/protocol.h
@@ -25,7 +25,7 @@
 #include <sys/types.h>
 #include <sys/socket.h>
 
-#include <common/config.h>
+#include <haproxy/api-t.h>
 #include <common/mini-clist.h>
 #include <import/eb32tree.h>
 
diff --git a/include/types/proxy.h b/include/types/proxy.h
index a9adce0..c75f0b6 100644
--- a/include/types/proxy.h
+++ b/include/types/proxy.h
@@ -27,12 +27,11 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
+#include <haproxy/api-t.h>
 #include <common/chunk.h>
-#include <common/config.h>
 #include <common/http.h>
 #include <common/mini-clist.h>
 #include <common/regex.h>
-#include <common/tools.h>
 #include <common/hathreads.h>
 
 #include <import/eb32tree.h>
diff --git a/include/types/queue.h b/include/types/queue.h
index 361c704..b0800f3 100644
--- a/include/types/queue.h
+++ b/include/types/queue.h
@@ -22,7 +22,7 @@
 #ifndef _TYPES_QUEUE_H
 #define _TYPES_QUEUE_H
 
-#include <common/config.h>
+#include <haproxy/api-t.h>
 #include <common/mini-clist.h>
 #include <common/hathreads.h>
 
diff --git a/include/types/ring.h b/include/types/ring.h
index 5f08271..ac93c12 100644
--- a/include/types/ring.h
+++ b/include/types/ring.h
@@ -22,9 +22,8 @@
 #ifndef _TYPES_RING_H
 #define _TYPES_RING_H
 
+#include <haproxy/api-t.h>
 #include <common/buf.h>
-#include <common/compat.h>
-#include <common/config.h>
 #include <common/ist.h>
 
 /* The code below handles circular buffers with single-producer and multiple
diff --git a/include/types/server.h b/include/types/server.h
index 376fc03..70a6e82 100644
--- a/include/types/server.h
+++ b/include/types/server.h
@@ -25,7 +25,7 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
-#include <common/config.h>
+#include <haproxy/api-t.h>
 #include <common/mini-clist.h>
 #include <common/hathreads.h>
 #include <common/openssl-compat.h>
diff --git a/include/types/session.h b/include/types/session.h
index 824799a..fb6b621 100644
--- a/include/types/session.h
+++ b/include/types/session.h
@@ -28,7 +28,7 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
-#include <common/config.h>
+#include <haproxy/api-t.h>
 #include <common/mini-clist.h>
 
 #include <types/obj_type.h>
diff --git a/include/types/signal.h b/include/types/signal.h
index ec3dcf2..661347a 100644
--- a/include/types/signal.h
+++ b/include/types/signal.h
@@ -16,7 +16,7 @@
 
 
 #include <signal.h>
-#include <common/config.h>
+#include <haproxy/api-t.h>
 #include <common/mini-clist.h>
 #include <common/standard.h>
 
diff --git a/include/types/sink.h b/include/types/sink.h
index 029c20d..64b0bca 100644
--- a/include/types/sink.h
+++ b/include/types/sink.h
@@ -22,9 +22,8 @@
 #ifndef _TYPES_SINK_H
 #define _TYPES_SINK_H
 
+#include <haproxy/api-t.h>
 #include <common/buffer.h>
-#include <common/compat.h>
-#include <common/config.h>
 #include <common/ist.h>
 
 /* A sink may be of 4 distinct types :
diff --git a/include/types/stream.h b/include/types/stream.h
index 0dcc541..e450c63 100644
--- a/include/types/stream.h
+++ b/include/types/stream.h
@@ -28,7 +28,7 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
-#include <common/config.h>
+#include <haproxy/api-t.h>
 #include <common/mini-clist.h>
 
 #include <types/channel.h>
diff --git a/include/types/stream_interface.h b/include/types/stream_interface.h
index e45eb6f..4c69d2d 100644
--- a/include/types/stream_interface.h
+++ b/include/types/stream_interface.h
@@ -22,8 +22,8 @@
 #ifndef _TYPES_STREAM_INTERFACE_H
 #define _TYPES_STREAM_INTERFACE_H
 
+#include <haproxy/api-t.h>
 #include <types/obj_type.h>
-#include <common/config.h>
 
 /* A stream interface must have its own errors independently of the buffer's,
  * so that applications can rely on what the buffer reports while the stream
diff --git a/include/types/task.h b/include/types/task.h
index 0fba898..01756ea 100644
--- a/include/types/task.h
+++ b/include/types/task.h
@@ -24,7 +24,7 @@
 
 #include <sys/time.h>
 
-#include <common/config.h>
+#include <haproxy/api-t.h>
 #include <common/mini-clist.h>
 #include <import/eb32sctree.h>
 #include <import/eb32tree.h>
diff --git a/include/types/template.h b/include/types/template.h
index e4292e7..5ef691c 100644
--- a/include/types/template.h
+++ b/include/types/template.h
@@ -22,7 +22,7 @@
 #ifndef _TYPES_TEMPLATE_H
 #define _TYPES_TEMPLATE_H
 
-#include <common/config.h>
+#include <haproxy/api-t.h>
 
 #endif /* _TYPES_TEMPLATE_H */
 
diff --git a/include/types/trace.h b/include/types/trace.h
index db7b185..cd5e8be 100644
--- a/include/types/trace.h
+++ b/include/types/trace.h
@@ -22,9 +22,8 @@
 #ifndef _TYPES_TRACE_H
 #define _TYPES_TRACE_H
 
+#include <haproxy/api-t.h>
 #include <common/buffer.h>
-#include <common/compat.h>
-#include <common/config.h>
 #include <common/ist.h>
 #include <common/mini-clist.h>
 #include <types/sink.h>
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>