From 8641605ff6ce72b69bbed8885b6e304d9d664603 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 4 Jun 2020 09:20:54 +0200 Subject: [PATCH] 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. --- contrib/modsecurity/modsec_wrapper.c | 2 +- include/{types/hlua.h => haproxy/hlua-t.h} | 31 +++++++++++++++++-- include/{proto => haproxy}/hlua.h | 35 +++++++++++++++++----- include/types/applet.h | 2 +- include/types/stream.h | 2 +- src/debug.c | 2 +- src/haproxy.c | 2 +- src/hlua.c | 3 +- src/hlua_fcn.c | 2 +- src/stream.c | 2 +- src/tools.c | 2 +- 11 files changed, 65 insertions(+), 20 deletions(-) rename include/{types/hlua.h => haproxy/hlua-t.h} (82%) rename include/{proto => haproxy}/hlua.h (62%) diff --git a/contrib/modsecurity/modsec_wrapper.c b/contrib/modsecurity/modsec_wrapper.c index 056da542a..6306b0b94 100644 --- a/contrib/modsecurity/modsec_wrapper.c +++ b/contrib/modsecurity/modsec_wrapper.c @@ -16,13 +16,13 @@ #include #include +#include #include #include #include #include -#include #include #include diff --git a/include/types/hlua.h b/include/haproxy/hlua-t.h similarity index 82% rename from include/types/hlua.h rename to include/haproxy/hlua-t.h index 990f9bc71..a49de5119 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 + * + * 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 #include +#include + +#include #include #include @@ -168,6 +192,7 @@ struct hlua_addr { }; #else /* USE_LUA */ +/************************ For use when Lua is disabled ********************/ /* Empty struct for compilation compatibility */ struct hlua { }; @@ -176,4 +201,4 @@ struct hlua_rule { }; #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 32468b77b..5d1153bb4 100644 --- a/include/proto/hlua.h +++ b/include/haproxy/hlua.h @@ -1,12 +1,31 @@ -#ifndef _PROTO_HLUA_H -#define _PROTO_HLUA_H +/* + * include/haproxy/hlua.h + * Lua core management functions + * + * Copyright (C) 2015-2016 Thierry Fournier + * + * 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_H +#define _HAPROXY_HLUA_H + +#include #ifdef USE_LUA -#include - -#include - /* The following macros are used to set flags. */ #define HLUA_SET_RUN(__hlua) do {(__hlua)->flags |= HLUA_RUN;} while(0) #define HLUA_CLR_RUN(__hlua) do {(__hlua)->flags &= ~HLUA_RUN;} while(0) @@ -33,6 +52,8 @@ struct task *hlua_process_task(struct task *task, void *context, unsigned short #else /* USE_LUA */ +/************************ For use when Lua is disabled ********************/ + #define HLUA_IS_RUNNING(__hlua) 0 #define HLUA_INIT(__hlua) @@ -44,4 +65,4 @@ static inline void hlua_ctx_destroy(struct hlua *lua) { } #endif /* USE_LUA */ -#endif /* _PROTO_HLUA_H */ +#endif /* _HAPROXY_HLUA_H */ diff --git a/include/types/applet.h b/include/types/applet.h index d6b34a373..a67827bd2 100644 --- a/include/types/applet.h +++ b/include/types/applet.h @@ -26,8 +26,8 @@ #include #include #include +#include #include -#include #include #include #include diff --git a/include/types/stream.h b/include/types/stream.h index 08e0f1255..c7db75e25 100644 --- a/include/types/stream.h +++ b/include/types/stream.h @@ -30,11 +30,11 @@ #include #include +#include #include #include #include -#include #include #include #include diff --git a/src/debug.c b/src/debug.c index bf2bc1a14..18fed0162 100644 --- a/src/debug.c +++ b/src/debug.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -32,7 +33,6 @@ #include #include -#include #include #include diff --git a/src/haproxy.c b/src/haproxy.c index 3f2dd1308..1ec9d8313 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -86,6 +86,7 @@ #include #include #include +#include #include #include #include @@ -115,7 +116,6 @@ #include #include #include -#include #include #include #include diff --git a/src/hlua.c b/src/hlua.c index daf2a8f06..22d293825 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -30,10 +30,10 @@ #include #include #include +#include #include #include -#include #include #include @@ -43,7 +43,6 @@ #include #include #include -#include #include #include #include diff --git a/src/hlua_fcn.c b/src/hlua_fcn.c index b759f11de..36a54e4d3 100644 --- a/src/hlua_fcn.c +++ b/src/hlua_fcn.c @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -25,7 +26,6 @@ #include #include -#include #include #include diff --git a/src/stream.c b/src/stream.c index c87316be8..e2e78802b 100644 --- a/src/stream.c +++ b/src/stream.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -45,7 +46,6 @@ #include #include #include -#include #include #include #include diff --git a/src/tools.c b/src/tools.c index 2b947933e..ecdbe1f16 100644 --- a/src/tools.c +++ b/src/tools.c @@ -41,12 +41,12 @@ #include #include +#include #include #include #include #include #include -#include #include #include #include