REORG: include: move hlua.h to haproxy/hlua{,-t}.h

This one required a few more includes as it uses list and ebpt_node.
It still references lots of types/ files for now.
diff --git a/contrib/modsecurity/modsec_wrapper.c b/contrib/modsecurity/modsec_wrapper.c
index 056da54..6306b0b 100644
--- a/contrib/modsecurity/modsec_wrapper.c
+++ b/contrib/modsecurity/modsec_wrapper.c
@@ -16,13 +16,13 @@
 #include <stdio.h>
 #include <stdarg.h>
 
+#include <haproxy/hlua.h>
 #include <haproxy/time.h>
 
 #include <types/global.h>
 #include <types/stream.h>
 
 #include <proto/arg.h>
-#include <proto/hlua.h>
 #include <proto/log.h>
 #include <proto/spoe.h>
 
diff --git a/include/types/hlua.h b/include/haproxy/hlua-t.h
similarity index 81%
rename from include/types/hlua.h
rename to include/haproxy/hlua-t.h
index 990f9bc..a49de51 100644
--- a/include/types/hlua.h
+++ b/include/haproxy/hlua-t.h
@@ -1,11 +1,35 @@
-#ifndef _TYPES_HLUA_H
-#define _TYPES_HLUA_H
+/*
+ * include/haproxy/hlua-t.h
+ * Lua core types definitions
+ *
+ * Copyright (C) 2015-2016 Thierry Fournier <tfournier@arpalert.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation, version 2.1
+ * exclusively.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef _HAPROXY_HLUA_T_H
+#define _HAPROXY_HLUA_T_H
 
 #ifdef USE_LUA
 
 #include <lua.h>
 #include <lauxlib.h>
 
+#include <import/ebpttree.h>
+
+#include <haproxy/list-t.h>
 #include <haproxy/regex-t.h>
 #include <haproxy/xref-t.h>
 
@@ -168,6 +192,7 @@
 };
 
 #else /* USE_LUA */
+/************************ For use when Lua is disabled ********************/
 
 /* Empty struct for compilation compatibility */
 struct hlua { };
@@ -176,4 +201,4 @@
 
 #endif /* USE_LUA */
 
-#endif /* _TYPES_HLUA_H */
+#endif /* _HAPROXY_HLUA_T_H */
diff --git a/include/proto/hlua.h b/include/haproxy/hlua.h
similarity index 62%
rename from include/proto/hlua.h
rename to include/haproxy/hlua.h
index 32468b7..5d1153b 100644
--- a/include/proto/hlua.h
+++ b/include/haproxy/hlua.h
@@ -1,11 +1,30 @@
-#ifndef _PROTO_HLUA_H
-#define _PROTO_HLUA_H
+/*
+ * include/haproxy/hlua.h
+ * Lua core management functions
+ *
+ * Copyright (C) 2015-2016 Thierry Fournier <tfournier@arpalert.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation, version 2.1
+ * exclusively.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
 
-#ifdef USE_LUA
+#ifndef _HAPROXY_HLUA_H
+#define _HAPROXY_HLUA_H
 
-#include <lua.h>
+#include <haproxy/hlua-t.h>
 
-#include <types/hlua.h>
+#ifdef USE_LUA
 
 /* The following macros are used to set flags. */
 #define HLUA_SET_RUN(__hlua)         do {(__hlua)->flags |= HLUA_RUN;} while(0)
@@ -33,6 +52,8 @@
 
 #else /* USE_LUA */
 
+/************************ For use when Lua is disabled ********************/
+
 #define HLUA_IS_RUNNING(__hlua) 0
 
 #define HLUA_INIT(__hlua)
@@ -44,4 +65,4 @@
 
 #endif /* USE_LUA */
 
-#endif /* _PROTO_HLUA_H */
+#endif /* _HAPROXY_HLUA_H */
diff --git a/include/types/applet.h b/include/types/applet.h
index d6b34a3..a67827b 100644
--- a/include/types/applet.h
+++ b/include/types/applet.h
@@ -26,8 +26,8 @@
 #include <haproxy/buf.h>
 #include <haproxy/dynbuf-t.h>
 #include <haproxy/freq_ctr-t.h>
+#include <haproxy/hlua-t.h>
 #include <haproxy/xref-t.h>
-#include <types/hlua.h>
 #include <types/obj_type.h>
 #include <types/proxy.h>
 #include <types/stream.h>
diff --git a/include/types/stream.h b/include/types/stream.h
index 08e0f12..c7db75e 100644
--- a/include/types/stream.h
+++ b/include/types/stream.h
@@ -30,11 +30,11 @@
 
 #include <haproxy/api-t.h>
 #include <haproxy/dynbuf-t.h>
+#include <haproxy/hlua-t.h>
 #include <haproxy/list-t.h>
 
 #include <types/channel.h>
 #include <types/filters.h>
-#include <types/hlua.h>
 #include <types/obj_type.h>
 #include <types/http_ana.h>
 #include <types/proxy.h>
diff --git a/src/debug.c b/src/debug.c
index bf2bc1a..18fed01 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -22,6 +22,7 @@
 #include <haproxy/api.h>
 #include <haproxy/buf.h>
 #include <haproxy/debug.h>
+#include <haproxy/hlua.h>
 #include <haproxy/thread.h>
 #include <import/ist.h>
 #include <haproxy/net_helper.h>
@@ -32,7 +33,6 @@
 
 #include <proto/cli.h>
 #include <haproxy/fd.h>
-#include <proto/hlua.h>
 #include <proto/stream_interface.h>
 #include <proto/task.h>
 
diff --git a/src/haproxy.c b/src/haproxy.c
index 3f2dd13..1ec9d83 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -86,6 +86,7 @@
 #include <haproxy/chunk.h>
 #include <haproxy/dynbuf.h>
 #include <haproxy/errors.h>
+#include <haproxy/hlua.h>
 #include <haproxy/pool.h>
 #include <haproxy/list.h>
 #include <haproxy/namespace.h>
@@ -115,7 +116,6 @@
 #include <proto/connection.h>
 #include <haproxy/fd.h>
 #include <proto/filters.h>
-#include <proto/hlua.h>
 #include <proto/http_rules.h>
 #include <proto/listener.h>
 #include <proto/log.h>
diff --git a/src/hlua.c b/src/hlua.c
index daf2a8f..22d2938 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -30,10 +30,10 @@
 #include <haproxy/regex.h>
 #include <haproxy/xref.h>
 #include <haproxy/h1.h>
+#include <haproxy/hlua.h>
 #include <haproxy/tools.h>
 
 #include <types/cli.h>
-#include <types/hlua.h>
 #include <types/proxy.h>
 #include <types/stats.h>
 
@@ -43,7 +43,6 @@
 #include <proto/cli.h>
 #include <proto/connection.h>
 #include <proto/stats.h>
-#include <proto/hlua.h>
 #include <proto/hlua_fcn.h>
 #include <proto/http_fetch.h>
 #include <proto/http_rules.h>
diff --git a/src/hlua_fcn.c b/src/hlua_fcn.c
index b759f11..36a54e4 100644
--- a/src/hlua_fcn.c
+++ b/src/hlua_fcn.c
@@ -18,6 +18,7 @@
 #include <lua.h>
 #include <lualib.h>
 
+#include <haproxy/hlua-t.h>
 #include <haproxy/http.h>
 #include <haproxy/net_helper.h>
 #include <haproxy/regex.h>
@@ -25,7 +26,6 @@
 #include <common/uri_auth.h>
 
 #include <types/cli.h>
-#include <types/hlua.h>
 #include <types/proxy.h>
 #include <types/stats.h>
 
diff --git a/src/stream.c b/src/stream.c
index c87316b..e2e7880 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -18,6 +18,7 @@
 #include <common/cfgparse.h>
 #include <haproxy/dict.h>
 #include <haproxy/dynbuf.h>
+#include <haproxy/hlua.h>
 #include <haproxy/istbuf.h>
 #include <haproxy/thread.h>
 #include <haproxy/htx.h>
@@ -45,7 +46,6 @@
 #include <proto/filters.h>
 #include <haproxy/freq_ctr.h>
 #include <proto/frontend.h>
-#include <proto/hlua.h>
 #include <proto/http_rules.h>
 #include <proto/listener.h>
 #include <proto/log.h>
diff --git a/src/tools.c b/src/tools.c
index 2b94793..ecdbe1f 100644
--- a/src/tools.c
+++ b/src/tools.c
@@ -41,12 +41,12 @@
 
 #include <haproxy/api.h>
 #include <haproxy/chunk.h>
+#include <haproxy/hlua.h>
 #include <haproxy/namespace.h>
 #include <haproxy/tools.h>
 #include <types/global.h>
 #include <proto/applet.h>
 #include <proto/dns.h>
-#include <proto/hlua.h>
 #include <proto/listener.h>
 #include <haproxy/proto_udp.h>
 #include <proto/ssl_sock.h>