REORG: include: split mailers.h into haproxy/mailers{,-t}.h
The file mostly contained struct definitions but there was also a
variable export. Most of the stuff currently lies in checks.h and
should definitely move here!
diff --git a/include/types/mailers.h b/include/haproxy/mailers-t.h
similarity index 91%
rename from include/types/mailers.h
rename to include/haproxy/mailers-t.h
index 2b88442..b2a3ac3 100644
--- a/include/types/mailers.h
+++ b/include/haproxy/mailers-t.h
@@ -1,10 +1,10 @@
/*
- * include/types/mailer.h
+ * include/haproxy/mailer-t.h
* This file defines everything related to mailer.
*
* Copyright 2015 Horms Solutions Ltd., Simon Horman <horms@verge.net.au>
*
- * Based on include/types/peers.h
+ * Based on include/haproxy/peers-t.h
*
* Copyright 2010 EXCELIANCE, Emeric Brun <ebrun@exceliance.fr>
*
@@ -23,8 +23,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef _TYPES_MAILERS_H
-#define _TYPES_MAILERS_H
+#ifndef _HAPROXY_MAILERS_T_H
+#define _HAPROXY_MAILERS_T_H
#include <sys/types.h>
#include <sys/socket.h>
@@ -61,8 +61,5 @@
} timeout;
};
-
-extern struct mailers *mailers;
-
-#endif /* _TYPES_MAILERS_H */
+#endif /* _HAPROXY_MAILERS_T_H */
diff --git a/include/haproxy/mailers.h b/include/haproxy/mailers.h
new file mode 100644
index 0000000..5daad86
--- /dev/null
+++ b/include/haproxy/mailers.h
@@ -0,0 +1,34 @@
+/*
+ * include/haproxy/mailer.h
+ * This file lists exported variables and functions for mailers.
+ *
+ * Copyright 2015 Horms Solutions Ltd., Simon Horman <horms@verge.net.au>
+ * Copyright 2020 Willy Tarreau <w@1wt.eu>
+ *
+ * Based on include/haproxy/peers-t.h
+ *
+ * Copyright 2010 EXCELIANCE, Emeric Brun <ebrun@exceliance.fr>
+ *
+ * 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_MAILERS_H
+#define _HAPROXY_MAILERS_H
+
+#include <haproxy/mailers-t.h>
+
+extern struct mailers *mailers;
+
+#endif /* _HAPROXY_MAILERS_H */
diff --git a/include/proto/checks.h b/include/proto/checks.h
index 04c9eeb..d24943e 100644
--- a/include/proto/checks.h
+++ b/include/proto/checks.h
@@ -23,7 +23,7 @@
#define _PROTO_CHECKS_H
#include <haproxy/action-t.h>
-#include <types/mailers.h>
+#include <haproxy/mailers.h>
#include <types/checks.h>
const char *get_check_status_description(short check_status);
diff --git a/src/cfgparse.c b/src/cfgparse.c
index 5302a18..011977a 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -40,6 +40,7 @@
#include <haproxy/chunk.h>
#include <haproxy/dns.h>
#include <haproxy/errors.h>
+#include <haproxy/mailers-t.h>
#include <haproxy/pool.h>
#include <haproxy/tools.h>
#include <haproxy/time.h>
@@ -52,7 +53,6 @@
#include <types/global.h>
#include <types/obj_type.h>
#include <types/peers.h>
-#include <types/mailers.h>
#include <types/stats.h>
#include <proto/acl.h>
diff --git a/src/mailers.c b/src/mailers.c
index 4335453..6014894 100644
--- a/src/mailers.c
+++ b/src/mailers.c
@@ -12,6 +12,6 @@
#include <stdlib.h>
-#include <types/mailers.h>
+#include <haproxy/mailers-t.h>
struct mailers *mailers = NULL;