]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REORG: move applet.h to haproxy/applet{,-t}.h
authorWilly Tarreau <w@1wt.eu>
Thu, 4 Jun 2020 17:42:41 +0000 (19:42 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 11 Jun 2020 08:18:58 +0000 (10:18 +0200)
The type file was slightly tidied. The cli-specific APPCTX_CLI_ST1_* flag
definitions were moved to cli.h. The type file was adjusted to include
buf-t.h and not the huge buf.h. A few call places were fixed because they
did not need this include.

27 files changed:
contrib/prometheus-exporter/service-prometheus.c
include/haproxy/action-t.h
include/haproxy/applet-t.h [moved from include/types/applet.h with 96% similarity]
include/haproxy/applet.h [moved from include/proto/applet.h with 96% similarity]
include/haproxy/obj_type.h
include/proto/cli.h
include/proto/proxy.h
include/proto/server.h
include/proto/stats.h
include/proto/stream_interface.h
include/types/cli.h
src/applet.c
src/cli.c
src/dns.c
src/hlua.c
src/log.c
src/map.c
src/peers.c
src/pool.c
src/proxy.c
src/ring.c
src/server.c
src/ssl_sock.c
src/stats.c
src/stream.c
src/stream_interface.c
src/tools.c

index 50dc14f817e9be7d9d7967eeac09ee04023d5608..f0b1adf6315f0142bbea4291c6a357dbb05c8364 100644 (file)
@@ -14,6 +14,7 @@
  */
 
 #include <haproxy/action-t.h>
+#include <haproxy/applet.h>
 #include <haproxy/api.h>
 #include <common/cfgparse.h>
 #include <haproxy/frontend.h>
@@ -25,7 +26,6 @@
 #include <haproxy/pool.h>
 #include <haproxy/list.h>
 
-#include <proto/applet.h>
 #include <proto/backend.h>
 #include <haproxy/compression.h>
 #include <haproxy/pipe.h>
index 9a7636674a38a1591227f17e13bba3315890d710..59012fc7625f4f429b4881ceb8bd088ddc81ea87 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <haproxy/regex-t.h>
 
-#include <types/applet.h>
+#include <haproxy/applet-t.h>
 #include <haproxy/stick_table-t.h>
 
 enum act_from {
similarity index 96%
rename from include/types/applet.h
rename to include/haproxy/applet-t.h
index c32dd8eda4fb6b18004d216f7c70f1f82cd141fb..4323905db3009f8a51370d1905a621664c0d87ff 100644 (file)
@@ -1,8 +1,8 @@
 /*
- * include/types/applet.h
+ * include/haproxy/applet-t.h
  * This file describes the applet struct and associated constants.
  *
- * Copyright (C) 2000-2015 Willy Tarreau - w@1wt.eu
+ * Copyright (C) 2000-2020 Willy Tarreau - w@1wt.eu
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef _TYPES_APPLET_H
-#define _TYPES_APPLET_H
+#ifndef _HAPROXY_APPLET_T_H
+#define _HAPROXY_APPLET_T_H
 
-#include <haproxy/api-t.h>
-#include <haproxy/buf.h>
+#include <haproxy/buf-t.h>
 #include <haproxy/dynbuf-t.h>
 #include <haproxy/freq_ctr-t.h>
 #include <haproxy/hlua-t.h>
 #include <haproxy/obj_type-t.h>
+#include <haproxy/api-t.h>
 #include <haproxy/xref-t.h>
+
 #include <types/proxy.h>
 #include <types/stream.h>
 
+/* flags for appctx->state */
+#define APPLET_WANT_DIE     0x01  /* applet was running and requested to die */
+
 struct appctx;
 
 /* Applet descriptor */
@@ -46,12 +50,6 @@ struct applet {
        unsigned int timeout;              /* execution timeout. */
 };
 
-#define APPLET_WANT_DIE     0x01  /* applet was running and requested to die */
-
-#define APPCTX_CLI_ST1_PROMPT  (1 << 0)
-#define APPCTX_CLI_ST1_PAYLOAD (1 << 1)
-#define APPCTX_CLI_ST1_NOLF    (1 << 2)
-
 /* Context of a running applet. */
 struct appctx {
        enum obj_type obj_type;    /* OBJ_TYPE_APPCTX */
@@ -188,7 +186,7 @@ struct appctx {
        } ctx;                                  /* context-specific variables used by any applet */
 };
 
-#endif /* _TYPES_APPLET_H */
+#endif /* _HAPROXY_APPLET_T_H */
 
 /*
  * Local variables:
similarity index 96%
rename from include/proto/applet.h
rename to include/haproxy/applet.h
index 48437f5f5e559fd4db9ddd559d42745bb0ad1005..00ef4f6beab3de89e6f9063f18a8f69a873fbc6a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * include/proto/applet.h
+ * include/haproxy/applet.h
  * This file contains applet function prototypes
  *
  * Copyright (C) 2000-2015 Willy Tarreau - w@1wt.eu
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef _PROTO_APPLET_H
-#define _PROTO_APPLET_H
+#ifndef _HAPROXY_APPLET_H
+#define _HAPROXY_APPLET_H
 
 #include <stdlib.h>
 
+#include <haproxy/applet-t.h>
 #include <haproxy/api.h>
-#include <haproxy/pool.h>
 #include <haproxy/list.h>
-#include <types/applet.h>
+#include <haproxy/pool.h>
 #include <haproxy/task.h>
 
 extern unsigned int nb_applets;
 extern struct pool_head *pool_head_appctx;
 
 struct task *task_run_applet(struct task *t, void *context, unsigned short state);
-
 int appctx_buf_available(void *arg);
 
 
@@ -117,7 +116,7 @@ static inline void appctx_wakeup(struct appctx *appctx)
        task_wakeup(appctx->t, TASK_WOKEN_OTHER);
 }
 
-#endif /* _PROTO_APPLET_H */
+#endif /* _HAPROXY_APPLET_H */
 
 /*
  * Local variables:
index 6f741e4de1448e000f426d08975975bd45ba5afa..d77717a938d1f8ed649986dfc81bb7e6c271614c 100644 (file)
 #ifndef _HAPROXY_OBJ_TYPE_H
 #define _HAPROXY_OBJ_TYPE_H
 
+#include <haproxy/applet-t.h>
 #include <haproxy/api.h>
 #include <haproxy/check-t.h>
 #include <haproxy/connection-t.h>
 #include <haproxy/listener-t.h>
 #include <haproxy/obj_type-t.h>
 #include <haproxy/pool.h>
-#include <types/applet.h>
 #include <types/proxy.h>
 #include <types/server.h>
 #include <types/stream.h>
index 13490afb2c2e92d551fd67c444965ed6252d852c..cbd3cd9d319e584096df69e5bd9db6b65b34d0e1 100644 (file)
@@ -23,8 +23,8 @@
 #ifndef _PROTO_CLI_H
 #define _PROTO_CLI_H
 
+#include <haproxy/applet-t.h>
 #include <haproxy/global.h>
-#include <types/applet.h>
 #include <types/channel.h>
 #include <types/cli.h>
 #include <types/stream.h>
index 6a9aa555cdb5fb36d08b7ce0752917d64971581f..f5f0bf362291625fa776c8c41984e86599b27b24 100644 (file)
 #ifndef _PROTO_PROXY_H
 #define _PROTO_PROXY_H
 
+#include <haproxy/applet-t.h>
 #include <haproxy/api.h>
 #include <haproxy/listener-t.h>
 #include <haproxy/ticks.h>
 #include <haproxy/time.h>
-#include <types/applet.h>
 #include <haproxy/global-t.h>
 #include <types/proxy.h>
 #include <haproxy/freq_ctr.h>
index b84be433f6fed264417a77a72eef3a7ec3724ed1..4d78c1d279ca20bc847c23f8c18388d72d840ebf 100644 (file)
 
 #include <unistd.h>
 
+#include <haproxy/applet-t.h>
 #include <haproxy/api.h>
 #include <haproxy/dns-t.h>
 #include <haproxy/time.h>
-#include <types/applet.h>
 #include <types/proxy.h>
 #include <types/queue.h>
 #include <types/server.h>
index f98a5ececb8cb15decb1948cb8332388e81800c3..84c64d03e60db55b18f180e95ed4c8e963676d5d 100644 (file)
@@ -23,9 +23,9 @@
 #ifndef _PROTO_STATS_H
 #define _PROTO_STATS_H
 
+#include <haproxy/applet-t.h>
 #include <haproxy/tools.h>
 #include <haproxy/api.h>
-#include <types/applet.h>
 #include <types/stream_interface.h>
 #include <types/stats.h>
 
index e381d846e539b2a8ba4d19e4c2c4fbac00085997..f17e6aec07c80ce9ce4b7063c3e8951dd169f36a 100644 (file)
 
 #include <stdlib.h>
 
+#include <haproxy/applet.h>
 #include <haproxy/api.h>
 #include <haproxy/connection.h>
 #include <types/stream.h>
 #include <types/stream_interface.h>
-#include <proto/applet.h>
 #include <proto/channel.h>
 
 
index 41753c52267452def1289b26094689c473626b3d..710e01433c72c8702874f307f7bd7723c85fc7fc 100644 (file)
@@ -20,8 +20,8 @@
 #ifndef _TYPES_CLI_H
 #define _TYPES_CLI_H
 
+#include <haproxy/applet-t.h>
 #include <haproxy/list-t.h>
-#include <types/applet.h>
 
 /* Access level for a stats socket */
 #define ACCESS_LVL_NONE     0
 
 #define ACCESS_EXPERT       0x20 /* access to dangerous commands reserved to experts */
 
+/* flags for appctx->st1 */
+#define APPCTX_CLI_ST1_PROMPT  (1 << 0)
+#define APPCTX_CLI_ST1_PAYLOAD (1 << 1)
+#define APPCTX_CLI_ST1_NOLF    (1 << 2)
+
 struct cli_kw {
        const char *str_kw[5];   /* keywords ended by NULL, limited to 5
                                 separated keywords combination */
index 510faad77591825635272350e533681e58d845c7..760ddc302424d6f14e7d537a94141c2feff75127 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 
+#include <haproxy/applet.h>
 #include <haproxy/api.h>
 #include <haproxy/list.h>
 #include <haproxy/task.h>
-#include <proto/applet.h>
 #include <proto/channel.h>
 #include <proto/stream.h>
 #include <proto/stream_interface.h>
index 186aad424cb96f4136b6d7d494eba9c969197192..e3b914ddee5b42a5818cfde1cae2834116a7005f 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -26,6 +26,7 @@
 
 #include <net/if.h>
 
+#include <haproxy/applet-t.h>
 #include <haproxy/api.h>
 #include <common/cfgparse.h>
 #include <haproxy/check.h>
@@ -45,7 +46,6 @@
 #include <haproxy/version.h>
 #include <haproxy/base64.h>
 
-#include <types/applet.h>
 #include <haproxy/global.h>
 #include <types/stats.h>
 
index b49f62d84be459e9f24e2c3a689aad748cc79ecd..9fc767d06218ad2cdc13ca4d4d5621b3f0a97048 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
@@ -34,7 +34,6 @@
 #include <haproxy/net_helper.h>
 #include <haproxy/vars.h>
 
-#include <types/applet.h>
 #include <types/cli.h>
 #include <haproxy/global.h>
 #include <types/stats.h>
index bed059ca8be8cad630b7205879daefac70680581..0d3a3e9ce4fe0f94d08bd97ed6cb81016bfbb350 100644 (file)
@@ -21,6 +21,7 @@
 #error "Requires Lua 5.3 or later."
 #endif
 
+#include <haproxy/applet.h>
 #include <haproxy/api.h>
 #include <import/ebpttree.h>
 
@@ -51,7 +52,6 @@
 #include <types/stats.h>
 
 #include <haproxy/arg.h>
-#include <proto/applet.h>
 #include <proto/channel.h>
 #include <proto/cli.h>
 #include <proto/stats.h>
index d9bbecd73b804a6f797788d78b4f46615e647793..7b5a3574bffdfa3f437d9918f4eeedbd3b86f379 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -24,6 +24,7 @@
 #include <sys/time.h>
 #include <sys/uio.h>
 
+#include <haproxy/applet-t.h>
 #include <haproxy/api.h>
 #include <haproxy/frontend.h>
 #include <haproxy/http.h>
@@ -35,7 +36,6 @@
 #include <haproxy/global.h>
 #include <types/log.h>
 
-#include <proto/applet.h>
 #include <proto/cli.h>
 #include <haproxy/fd.h>
 #include <proto/log.h>
index 7435fb1bc0e9d7939eabd0c67a6fd3e24b8c2518..77d687bb83902a65b6d655d4166ae225703321f7 100644 (file)
--- a/src/map.c
+++ b/src/map.c
 
 #include <stdio.h>
 
+#include <haproxy/applet-t.h>
 #include <haproxy/api.h>
 #include <haproxy/map.h>
 #include <haproxy/pattern.h>
 #include <haproxy/regex.h>
 #include <haproxy/tools.h>
 
-#include <types/applet.h>
 #include <types/cli.h>
 #include <types/stats.h>
 
-#include <proto/applet.h>
 #include <haproxy/arg.h>
 #include <proto/cli.h>
 #include <proto/log.h>
index cba840d55d0e103badca2e5bfc34fb2a6b1bcfa3..1d60e3f53307a76724468dbd3afa35fbff823974 100644 (file)
@@ -20,6 +20,7 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 
+#include <haproxy/applet.h>
 #include <haproxy/api.h>
 #include <haproxy/dict.h>
 #include <haproxy/frontend.h>
@@ -35,7 +36,6 @@
 
 #include <types/stats.h>
 
-#include <proto/applet.h>
 #include <proto/channel.h>
 #include <proto/cli.h>
 #include <haproxy/fd.h>
index 2f32b587253da7cb87a5bdb9578a6768a09b23e4..1e8e2f8637afb0777235a5a409bfdb1b2a767576 100644 (file)
@@ -11,8 +11,8 @@
  */
 #include <errno.h>
 
+#include <haproxy/applet-t.h>
 #include <haproxy/api.h>
-#include <types/applet.h>
 #include <types/cli.h>
 #include <haproxy/global.h>
 #include <types/stats.h>
@@ -25,7 +25,6 @@
 
 #include <haproxy/activity-t.h>
 
-#include <proto/applet.h>
 #include <proto/cli.h>
 #include <proto/channel.h>
 #include <proto/log.h>
index c66927d0749bc6a98fd6cf7fe3fa6ebe50ca032b..b00ea01b0f95b3cc054d21457ac7f0be9a62d210 100644 (file)
@@ -17,6 +17,7 @@
 #include <sys/socket.h>
 #include <sys/stat.h>
 
+#include <haproxy/applet-t.h>
 #include <haproxy/api.h>
 #include <common/cfgparse.h>
 #include <haproxy/errors.h>
@@ -35,7 +36,6 @@
 #include <types/cli.h>
 #include <types/stats.h>
 
-#include <proto/applet.h>
 #include <proto/cli.h>
 #include <proto/backend.h>
 #include <haproxy/fd.h>
index 097225158de77799d5aed7af1a79d505374e048b..323249dc3583274663ec85d77a7d4db47d25291c 100644 (file)
  */
 
 #include <stdlib.h>
+#include <haproxy/applet.h>
 #include <haproxy/api.h>
 #include <haproxy/buf.h>
 #include <haproxy/thread.h>
-#include <types/applet.h>
 #include <proto/cli.h>
 #include <haproxy/ring.h>
 #include <proto/stream_interface.h>
index 904cadb8944e7601fa0816240be1742764041fb4..2e2ada887a8409cfb657518dcbd76c53320b7723 100644 (file)
@@ -14,6 +14,7 @@
 #include <ctype.h>
 #include <errno.h>
 
+#include <haproxy/applet-t.h>
 #include <haproxy/api.h>
 #include <import/xxhash.h>
 
 #include <haproxy/task.h>
 #include <haproxy/time.h>
 
-#include <types/applet.h>
 #include <types/cli.h>
 #include <types/cli.h>
 #include <types/stats.h>
 
-#include <proto/applet.h>
 #include <proto/cli.h>
 #include <haproxy/port_range.h>
 #include <haproxy/protocol.h>
index 5cad3d656237ab04c27db559cdcc4a0d4a7af2dc..308dbfacdb58158c363f6711e47005b11471ec02 100644 (file)
@@ -67,7 +67,6 @@
 #include <import/ebpttree.h>
 #include <import/ebsttree.h>
 
-#include <types/applet.h>
 #include <types/cli.h>
 #include <types/ssl_sock.h>
 #include <types/stats.h>
index 0bb7481828abc77f4f8065a2b4fccec647e57000..b527eafda682fca444d88026e88775d5073bb6fd 100644 (file)
@@ -24,6 +24,7 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 
+#include <haproxy/applet-t.h>
 #include <haproxy/api.h>
 #include <common/cfgparse.h>
 #include <haproxy/check.h>
@@ -49,7 +50,6 @@
 #include <haproxy/version.h>
 #include <haproxy/base64.h>
 
-#include <types/applet.h>
 #include <types/cli.h>
 #include <types/stats.h>
 
index ce41a2962c54fc639bb018d431f2aaeaec562094..0dd4745b9de5246e66b0de62696173cd5e140c34 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <haproxy/acl.h>
 #include <haproxy/action.h>
+#include <haproxy/applet.h>
 #include <haproxy/api.h>
 #include <haproxy/capture.h>
 #include <common/cfgparse.h>
@@ -37,7 +38,6 @@
 #include <haproxy/tcp_rules.h>
 #include <haproxy/vars.h>
 
-#include <types/applet.h>
 #include <types/cli.h>
 #include <types/filters.h>
 #include <types/stats.h>
index a51fa14dd7fc451494f06f68b02c65527e145240..5237954e60009fc6a94afed7d74b1a67a281f602 100644 (file)
@@ -19,6 +19,7 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 
+#include <haproxy/applet.h>
 #include <haproxy/api.h>
 #include <haproxy/connection.h>
 #include <haproxy/dynbuf.h>
@@ -28,7 +29,6 @@
 #include <haproxy/time.h>
 #include <haproxy/task.h>
 
-#include <proto/applet.h>
 #include <proto/channel.h>
 #include <haproxy/pipe.h>
 #include <proto/proxy.h>
index fd777955594c3cbc6c9f4b421f6a52511f799164..a9ad82b6e99a6554206a4e04db4c40d9769ff664 100644 (file)
@@ -48,7 +48,6 @@
 #include <haproxy/namespace.h>
 #include <haproxy/task.h>
 #include <haproxy/tools.h>
-#include <proto/applet.h>
 #include <haproxy/proto_udp.h>
 #include <proto/ssl_sock.h>
 #include <proto/stream_interface.h>