]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: global: export many symbols.
authorThierry FOURNIER <tfournier@haproxy.com>
Mon, 8 Dec 2014 18:50:43 +0000 (19:50 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 28 Feb 2015 22:12:32 +0000 (23:12 +0100)
The functions "val_payload_lv" and "val_hdr" are useful with
lua. The lua automatic binding for sample fetchs needs to
compare check functions.

The "arg_type_names" permit to display error messages.

include/proto/arg.h
include/proto/payload.h
include/proto/proto_http.h
src/arg.c
src/payload.c
src/proto_http.c

index e051de54d0f535db15ae704947559831d63cdbae..91c1acde70e741cc58aed77004b26321e1a343d0 100644 (file)
@@ -48,6 +48,9 @@
 #define ARG5(m, t1, t2, t3, t4, t5) \
        (ARG4(m, t1, t2, t3, t4) + (ARGT_##t5 << (ARGM_BITS + ARGT_BITS * 4)))
 
+/* Mapping between argument number and literal description. */
+extern const char *arg_type_names[];
+
 /* This dummy arg list may be used by default when no arg is found, it helps
  * parsers by removing pointer checks.
  */
index 4b658d41b0fc02380bf7cfa774d616bd8e138b49..fd89c88cb0c7238757bd2eb57902d25b7c6f6f1e 100644 (file)
@@ -27,6 +27,7 @@
 #include <types/session.h>
 
 int fetch_rdp_cookie_name(struct session *s, struct sample *smp, const char *cname, int clen);
+int val_payload_lv(struct arg *arg, char **err_msg);
 
 #endif /* _PROTO_PROTO_PAYLOAD_H */
 
index 579a6cb4ece598cb2149a55af293a5f3a89d179b..9e99ba17e538dcf3d9e189b39b44c59be79dff12 100644 (file)
@@ -131,6 +131,7 @@ enum http_meth_t find_http_meth(const char *str, const int len);
 
 struct http_req_action_kw *action_http_req_custom(const char *kw);
 struct http_res_action_kw *action_http_res_custom(const char *kw);
+int val_hdr(struct arg *arg, char **err_msg);
 
 static inline void http_req_keywords_register(struct http_req_action_kw_list *kw_list)
 {
index e609ac5f57a9fafd81f968d3ba83a2dcbf386a5e..e212f6ba9ceb1023c0bf2a568bfbb6420c5b7be1 100644 (file)
--- a/src/arg.c
+++ b/src/arg.c
@@ -17,7 +17,7 @@
 #include <common/standard.h>
 #include <proto/arg.h>
 
-static const char *arg_type_names[ARGT_NBTYPES] = {
+const char *arg_type_names[ARGT_NBTYPES] = {
        [ARGT_STOP] = "end of arguments",
        [ARGT_UINT] = "unsigned integer",
        [ARGT_SINT] = "signed integer",
index 2654170835c9211bda47317acb3b4fc7bf6701a5..53c997285087a64f0d703519d8d64db47bb2ef22 100644 (file)
@@ -631,7 +631,7 @@ smp_fetch_payload(struct proxy *px, struct session *s, void *l7, unsigned int op
  * error, that the caller is responsible for freeing. The initial location must
  * either be freeable or NULL.
  */
-static int val_payload_lv(struct arg *arg, char **err_msg)
+int val_payload_lv(struct arg *arg, char **err_msg)
 {
        if (!arg[1].data.uint) {
                memprintf(err_msg, "payload length must be > 0");
index f87583f71905517c2da21de5eb62bfe30a47fae5..de219e3bb7416e327d8508da122e8914e5cba6b4 100644 (file)
@@ -11364,7 +11364,7 @@ smp_fetch_url32_src(struct proxy *px, struct session *l4, void *l7, unsigned int
  * error message in case of error, that the caller is responsible for freeing.
  * The initial location must either be freeable or NULL.
  */
-static int val_hdr(struct arg *arg, char **err_msg)
+int val_hdr(struct arg *arg, char **err_msg)
 {
        if (arg && arg[1].type == ARGT_SINT && arg[1].data.sint < -MAX_HDR_HISTORY) {
                memprintf(err_msg, "header occurrence must be >= %d", -MAX_HDR_HISTORY);