REORG: tools: split common/standard.h into haproxy/tools{,-t}.h

And also rename standard.c to tools.c. The original split between
tools.h and standard.h dates from version 1.3-dev and was mostly an
accident. This patch moves the files back to what they were expected
to be, and takes care of not changing anything else. However this
time tools.h was split between functions and types, because it contains
a small number of commonly used macros and structures (e.g. name_desc)
which in turn cause the massive list of includes of tools.h to conflict
with the callers.

They remain the ugliest files of the whole project and definitely need
to be cleaned and split apart. A few types are defined there only for
functions provided there, and some parts are even OS-specific and should
move somewhere else, such as the symbol resolution code.
diff --git a/src/acl.c b/src/acl.c
index 14a0e0b..16e7753 100644
--- a/src/acl.c
+++ b/src/acl.c
@@ -16,7 +16,7 @@
 
 #include <haproxy/api.h>
 #include <haproxy/list.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <common/uri_auth.h>
 
 #include <types/global.h>
diff --git a/src/action.c b/src/action.c
index 1125eca..17716b5 100644
--- a/src/action.c
+++ b/src/action.c
@@ -13,7 +13,7 @@
 #include <haproxy/api.h>
 #include <haproxy/pool.h>
 #include <haproxy/list.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 
 #include <proto/action.h>
 #include <proto/log.h>
diff --git a/src/activity.c b/src/activity.c
index c0da3e8..59ae4fa 100644
--- a/src/activity.c
+++ b/src/activity.c
@@ -12,7 +12,7 @@
 
 #include <haproxy/api.h>
 #include <common/cfgparse.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <haproxy/thread-t.h>
 #include <haproxy/activity-t.h>
 #include <proto/channel.h>
diff --git a/src/arg.c b/src/arg.c
index 5adffe3..9c4fa44 100644
--- a/src/arg.c
+++ b/src/arg.c
@@ -14,7 +14,7 @@
 #include <sys/socket.h>
 #include <arpa/inet.h>
 
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <haproxy/chunk.h>
 #include <types/global.h>
 #include <proto/arg.h>
diff --git a/src/cfgparse.c b/src/cfgparse.c
index b3a66b8..2f9ed1b 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -38,7 +38,7 @@
 #include <haproxy/chunk.h>
 #include <haproxy/errors.h>
 #include <haproxy/pool.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <haproxy/time.h>
 #include <common/uri_auth.h>
 #include <haproxy/namespace.h>
diff --git a/src/checks.c b/src/checks.c
index 4a1b87f..cd1649b 100644
--- a/src/checks.c
+++ b/src/checks.c
@@ -36,7 +36,7 @@
 #include <haproxy/istbuf.h>
 #include <haproxy/list.h>
 #include <haproxy/regex.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <haproxy/time.h>
 #include <haproxy/thread.h>
 #include <haproxy/http.h>
diff --git a/src/chunk.c b/src/chunk.c
index 917a4f9..f9e6fe5 100644
--- a/src/chunk.c
+++ b/src/chunk.c
@@ -17,7 +17,7 @@
 
 #include <haproxy/api.h>
 #include <haproxy/chunk.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 
 #include <types/global.h>
 
diff --git a/src/cli.c b/src/cli.c
index 932af30..df0e0f2 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -29,7 +29,7 @@
 #include <haproxy/api.h>
 #include <common/cfgparse.h>
 #include <haproxy/list.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <haproxy/ticks.h>
 #include <haproxy/time.h>
 #include <common/uri_auth.h>
diff --git a/src/debug.c b/src/debug.c
index 5b25ab7..9aef05b 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -25,7 +25,7 @@
 #include <haproxy/thread.h>
 #include <import/ist.h>
 #include <haproxy/net_helper.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 
 #include <types/global.h>
 #include <types/signal.h>
diff --git a/src/ev_epoll.c b/src/ev_epoll.c
index 65ff1b5..40f5e9c 100644
--- a/src/ev_epoll.c
+++ b/src/ev_epoll.c
@@ -16,7 +16,7 @@
 
 #include <haproxy/api.h>
 #include <haproxy/thread-t.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <haproxy/ticks.h>
 #include <haproxy/time.h>
 
diff --git a/src/fcgi-app.c b/src/fcgi-app.c
index eb78807..d846c25 100644
--- a/src/fcgi-app.c
+++ b/src/fcgi-app.c
@@ -15,7 +15,7 @@
 #include <common/cfgparse.h>
 #include <haproxy/errors.h>
 #include <haproxy/regex.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 
 #include <types/global.h>
 
diff --git a/src/filters.c b/src/filters.c
index 5cfac40..31f9f10 100644
--- a/src/filters.c
+++ b/src/filters.c
@@ -16,7 +16,7 @@
 #include <haproxy/errors.h>
 #include <haproxy/htx.h>
 #include <haproxy/namespace.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 
 #include <types/filters.h>
 #include <types/http_ana.h>
diff --git a/src/flt_http_comp.c b/src/flt_http_comp.c
index ac4a3bf..462ee25 100644
--- a/src/flt_http_comp.c
+++ b/src/flt_http_comp.c
@@ -16,7 +16,7 @@
 #include <common/cfgparse.h>
 #include <haproxy/htx.h>
 #include <haproxy/list.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 
 #include <types/compression.h>
 #include <types/filters.h>
diff --git a/src/flt_trace.c b/src/flt_trace.c
index 94aef8c..64dc564 100644
--- a/src/flt_trace.c
+++ b/src/flt_trace.c
@@ -14,7 +14,7 @@
 
 #include <haproxy/api.h>
 #include <haproxy/htx.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <haproxy/time.h>
 
 #include <types/channel.h>
diff --git a/src/freq_ctr.c b/src/freq_ctr.c
index 8249a3a..17d2772 100644
--- a/src/freq_ctr.c
+++ b/src/freq_ctr.c
@@ -11,7 +11,7 @@
  */
 
 #include <haproxy/api.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <haproxy/time.h>
 #include <haproxy/freq_ctr.h>
 
diff --git a/src/frontend.c b/src/frontend.c
index 4a66c49..22e2acc 100644
--- a/src/frontend.c
+++ b/src/frontend.c
@@ -24,7 +24,7 @@
 
 #include <haproxy/api.h>
 #include <haproxy/chunk.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <haproxy/time.h>
 
 #include <types/global.h>
diff --git a/src/haproxy.c b/src/haproxy.c
index 4bf229c..57fedf8 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -92,7 +92,7 @@
 #include <haproxy/net_helper.h>
 #include <haproxy/openssl-compat.h>
 #include <haproxy/regex.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <haproxy/time.h>
 #include <common/uri_auth.h>
 #include <haproxy/version.h>
diff --git a/src/hlua.c b/src/hlua.c
index d73abec..3de0bea 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -29,7 +29,7 @@
 #include <haproxy/regex.h>
 #include <haproxy/xref.h>
 #include <haproxy/h1.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 
 #include <types/cli.h>
 #include <types/hlua.h>
diff --git a/src/hpack-dec.c b/src/hpack-dec.c
index e318ac3..c9808d3 100644
--- a/src/hpack-dec.c
+++ b/src/hpack-dec.c
@@ -30,7 +30,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <haproxy/hpack-dec.h>
 #include <haproxy/hpack-huff.h>
 #include <haproxy/hpack-tbl.h>
diff --git a/src/http.c b/src/http.c
index ae315a8..f8d7876 100644
--- a/src/http.c
+++ b/src/http.c
@@ -13,7 +13,7 @@
 #include <ctype.h>
 #include <haproxy/api.h>
 #include <haproxy/http.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 
 /* It is about twice as fast on recent architectures to lookup a byte in a
  * table than to perform a boolean AND or OR between two tests. Refer to
diff --git a/src/http_acl.c b/src/http_acl.c
index 780962a..8ff4ab3 100644
--- a/src/http_acl.c
+++ b/src/http_acl.c
@@ -20,7 +20,7 @@
 #include <haproxy/chunk.h>
 #include <haproxy/http.h>
 #include <haproxy/pool.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <haproxy/version.h>
 
 #include <types/global.h>
diff --git a/src/http_act.c b/src/http_act.c
index a5ce9d7..165cae2 100644
--- a/src/http_act.c
+++ b/src/http_act.c
@@ -22,7 +22,7 @@
 #include <haproxy/http.h>
 #include <haproxy/pool.h>
 #include <haproxy/regex.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <common/uri_auth.h>
 #include <haproxy/version.h>
 
diff --git a/src/http_conv.c b/src/http_conv.c
index 72cb4af..e321dbb 100644
--- a/src/http_conv.c
+++ b/src/http_conv.c
@@ -20,7 +20,7 @@
 #include <haproxy/chunk.h>
 #include <haproxy/http.h>
 #include <haproxy/pool.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <haproxy/version.h>
 
 #include <types/capture.h>
diff --git a/src/http_fetch.c b/src/http_fetch.c
index 221ac94..5d03dc7 100644
--- a/src/http_fetch.c
+++ b/src/http_fetch.c
@@ -23,7 +23,7 @@
 #include <haproxy/http.h>
 #include <haproxy/htx.h>
 #include <haproxy/pool.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <haproxy/version.h>
 
 #include <types/global.h>
diff --git a/src/http_rules.c b/src/http_rules.c
index 94aff63..77ac2cb 100644
--- a/src/http_rules.c
+++ b/src/http_rules.c
@@ -21,7 +21,7 @@
 #include <haproxy/chunk.h>
 #include <haproxy/http.h>
 #include <haproxy/pool.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <haproxy/version.h>
 
 #include <types/capture.h>
diff --git a/src/lb_chash.c b/src/lb_chash.c
index 0899ee7..0fc18d9 100644
--- a/src/lb_chash.c
+++ b/src/lb_chash.c
@@ -17,7 +17,7 @@
  */
 
 #include <haproxy/api.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <import/eb32tree.h>
 
 #include <types/global.h>
diff --git a/src/listener.c b/src/listener.c
index 2f9c800..ac7b328 100644
--- a/src/listener.c
+++ b/src/listener.c
@@ -22,7 +22,7 @@
 #include <common/cfgparse.h>
 #include <haproxy/errors.h>
 #include <haproxy/list.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <haproxy/time.h>
 
 #include <types/global.h>
diff --git a/src/log.c b/src/log.c
index 5778994..353b428 100644
--- a/src/log.c
+++ b/src/log.c
@@ -26,7 +26,7 @@
 
 #include <haproxy/api.h>
 #include <haproxy/http.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <haproxy/time.h>
 #include <haproxy/version.h>
 
diff --git a/src/map.c b/src/map.c
index 771fcc8..8dc1b51 100644
--- a/src/map.c
+++ b/src/map.c
@@ -14,7 +14,7 @@
 
 #include <haproxy/api.h>
 #include <haproxy/regex.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 
 #include <types/applet.h>
 #include <types/cli.h>
diff --git a/src/pattern.c b/src/pattern.c
index f2692f0..d4988b1 100644
--- a/src/pattern.c
+++ b/src/pattern.c
@@ -17,7 +17,7 @@
 #include <haproxy/api.h>
 #include <haproxy/net_helper.h>
 #include <haproxy/regex.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 
 #include <types/global.h>
 #include <types/pattern.h>
diff --git a/src/peers.c b/src/peers.c
index 882f34a..ef09468 100644
--- a/src/peers.c
+++ b/src/peers.c
@@ -23,7 +23,7 @@
 #include <haproxy/api.h>
 #include <haproxy/net_helper.h>
 #include <haproxy/time.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <haproxy/thread.h>
 
 #include <types/global.h>
diff --git a/src/pool.c b/src/pool.c
index 2ad2be6..4ff97b6 100644
--- a/src/pool.c
+++ b/src/pool.c
@@ -21,7 +21,7 @@
 #include <haproxy/thread.h>
 #include <haproxy/pool.h>
 #include <haproxy/list.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 
 #include <haproxy/activity-t.h>
 
diff --git a/src/proto_sockpair.c b/src/proto_sockpair.c
index dfba155..e133a84 100644
--- a/src/proto_sockpair.c
+++ b/src/proto_sockpair.c
@@ -29,7 +29,7 @@
 #include <haproxy/api.h>
 #include <haproxy/errors.h>
 #include <haproxy/list.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <haproxy/time.h>
 #include <haproxy/version.h>
 
diff --git a/src/proto_tcp.c b/src/proto_tcp.c
index 42c034e..b9aa824 100644
--- a/src/proto_tcp.c
+++ b/src/proto_tcp.c
@@ -33,7 +33,7 @@
 #include <haproxy/api.h>
 #include <haproxy/errors.h>
 #include <haproxy/list.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <haproxy/namespace.h>
 
 #include <types/action.h>
diff --git a/src/proto_uxst.c b/src/proto_uxst.c
index 1dce1a9..429ca1c 100644
--- a/src/proto_uxst.c
+++ b/src/proto_uxst.c
@@ -29,7 +29,7 @@
 #include <haproxy/api.h>
 #include <haproxy/errors.h>
 #include <haproxy/list.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <haproxy/time.h>
 #include <haproxy/version.h>
 
diff --git a/src/protocol.c b/src/protocol.c
index defb197..f739444 100644
--- a/src/protocol.c
+++ b/src/protocol.c
@@ -16,7 +16,7 @@
 #include <haproxy/api.h>
 #include <haproxy/errors.h>
 #include <haproxy/list.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 
 #include <haproxy/protocol.h>
 
diff --git a/src/raw_sock.c b/src/raw_sock.c
index 744544b..6503b3b 100644
--- a/src/raw_sock.c
+++ b/src/raw_sock.c
@@ -24,7 +24,7 @@
 
 #include <haproxy/api.h>
 #include <haproxy/buf.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <haproxy/ticks.h>
 #include <haproxy/time.h>
 
diff --git a/src/regex.c b/src/regex.c
index 764704d..bebbaa7 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -17,7 +17,7 @@
 #include <haproxy/api.h>
 #include <types/global.h>
 #include <haproxy/regex.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <proto/log.h>
 
 /* regex trash buffer used by various regex tests */
diff --git a/src/sample.c b/src/sample.c
index e1e4d9c..149ede8 100644
--- a/src/sample.c
+++ b/src/sample.c
@@ -25,7 +25,7 @@
 #include <haproxy/http.h>
 #include <haproxy/net_helper.h>
 #include <haproxy/regex.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <common/uri_auth.h>
 #include <haproxy/base64.h>
 
diff --git a/src/ssl_ckch.c b/src/ssl_ckch.c
index 9011df9..61dd353 100644
--- a/src/ssl_ckch.c
+++ b/src/ssl_ckch.c
@@ -23,7 +23,7 @@
 
 #include <haproxy/base64.h>
 #include <haproxy/errors.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 
 #include <import/ebsttree.h>
 
diff --git a/src/ssl_crtlist.c b/src/ssl_crtlist.c
index 1d77362..e7c394c 100644
--- a/src/ssl_crtlist.c
+++ b/src/ssl_crtlist.c
@@ -16,7 +16,7 @@
 #include <sys/types.h>
 
 #include <haproxy/errors.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 
 #include <dirent.h>
 #include <import/ebpttree.h>
diff --git a/src/ssl_sample.c b/src/ssl_sample.c
index de3abee..5f8cbd7 100644
--- a/src/ssl_sample.c
+++ b/src/ssl_sample.c
@@ -23,7 +23,7 @@
 #include <haproxy/api.h>
 #include <haproxy/buf-t.h>
 #include <haproxy/openssl-compat.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 
 #include <types/sample.h>
 #include <types/ssl_sock.h>
diff --git a/src/ssl_sock.c b/src/ssl_sock.c
index 476469f..6156012 100644
--- a/src/ssl_sock.c
+++ b/src/ssl_sock.c
@@ -48,7 +48,7 @@
 #include <haproxy/chunk.h>
 #include <haproxy/errors.h>
 #include <haproxy/openssl-compat.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <haproxy/ticks.h>
 #include <haproxy/time.h>
 #include <haproxy/base64.h>
diff --git a/src/stats.c b/src/stats.c
index d7d581d..b43665c 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -31,7 +31,7 @@
 #include <haproxy/htx.h>
 #include <haproxy/pool.h>
 #include <haproxy/list.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <haproxy/ticks.h>
 #include <haproxy/time.h>
 #include <common/uri_auth.h>
diff --git a/src/stick_table.c b/src/stick_table.c
index fcbd587..8ceafa3 100644
--- a/src/stick_table.c
+++ b/src/stick_table.c
@@ -19,7 +19,7 @@
 #include <haproxy/pool.h>
 #include <haproxy/list.h>
 #include <haproxy/net_helper.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <haproxy/time.h>
 
 #include <import/ebmbtree.h>
diff --git a/src/stream_interface.c b/src/stream_interface.c
index dbd9cdf..921b191 100644
--- a/src/stream_interface.c
+++ b/src/stream_interface.c
@@ -21,7 +21,7 @@
 
 #include <haproxy/api.h>
 #include <haproxy/dynbuf.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <haproxy/ticks.h>
 #include <haproxy/time.h>
 
diff --git a/src/task.c b/src/task.c
index 5663aba..eacc3fd 100644
--- a/src/task.c
+++ b/src/task.c
@@ -15,7 +15,7 @@
 #include <haproxy/api.h>
 #include <haproxy/pool.h>
 #include <haproxy/list.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <haproxy/time.h>
 #include <import/eb32sctree.h>
 #include <import/eb32tree.h>
diff --git a/src/tcp_rules.c b/src/tcp_rules.c
index c08d716..012bfd3 100644
--- a/src/tcp_rules.c
+++ b/src/tcp_rules.c
@@ -12,7 +12,7 @@
 #include <haproxy/api.h>
 #include <common/cfgparse.h>
 #include <haproxy/list.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <haproxy/ticks.h>
 #include <haproxy/time.h>
 
diff --git a/src/thread.c b/src/thread.c
index 47c5ab9..2a7ec9a 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -25,7 +25,7 @@
 
 #include <common/cfgparse.h>
 #include <haproxy/thread.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <types/global.h>
 #include <proto/fd.h>
 
diff --git a/src/time.c b/src/time.c
index a6aaf40..f81ffff 100644
--- a/src/time.c
+++ b/src/time.c
@@ -14,7 +14,7 @@
 #include <sys/time.h>
 
 #include <haproxy/api.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <haproxy/time.h>
 #include <haproxy/thread-t.h>
 
diff --git a/src/standard.c b/src/tools.c
similarity index 99%
rename from src/standard.c
rename to src/tools.c
index 8e9722e..fbec3f5 100644
--- a/src/standard.c
+++ b/src/tools.c
@@ -36,10 +36,13 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
+#include <import/eb32tree.h>
+#include <import/eb32sctree.h>
+
 #include <haproxy/api.h>
 #include <haproxy/chunk.h>
 #include <haproxy/namespace.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <types/global.h>
 #include <proto/applet.h>
 #include <proto/dns.h>
@@ -50,9 +53,6 @@
 #include <proto/stream_interface.h>
 #include <proto/task.h>
 
-#include <import/eb32tree.h>
-#include <import/eb32sctree.h>
-
 /* This macro returns false if the test __x is false. Many
  * of the following parsing function must be abort the processing
  * if it returns 0, so this macro is useful for writing light code.
diff --git a/src/wdt.c b/src/wdt.c
index 86de286..1248beb 100644
--- a/src/wdt.c
+++ b/src/wdt.c
@@ -15,7 +15,7 @@
 #include <haproxy/api.h>
 #include <haproxy/debug.h>
 #include <haproxy/thread.h>
-#include <common/standard.h>
+#include <haproxy/tools.h>
 #include <types/global.h>
 #include <types/signal.h>
 #include <proto/log.h>