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/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