]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: vars: export var_set and var_unset functions
authorNenad Merdanovic <nmerdan@haproxy.com>
Tue, 5 Mar 2024 11:54:34 +0000 (12:54 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 8 Mar 2024 16:20:43 +0000 (17:20 +0100)
Co-authored-by: Dragan Dosen <ddosen@haproxy.com>
include/haproxy/vars.h
src/vars.c

index 33ee946656c20446c641913ca1a965cad6611544..9fa351c297990ecdbf553d5374e2c39202f434b4 100644 (file)
@@ -37,6 +37,8 @@ void var_accounting_diff(struct vars *vars, struct session *sess, struct stream
 unsigned int var_clear(struct var *var, int force);
 void vars_prune(struct vars *vars, struct session *sess, struct stream *strm);
 void vars_prune_per_sess(struct vars *vars);
+int var_set(uint64_t name_hash, enum vars_scope scope, struct sample *smp, uint flags);
+int var_unset(uint64_t name_hash, enum vars_scope scope, struct sample *smp);
 int vars_get_by_name(const char *name, size_t len, struct sample *smp, const struct buffer *def);
 int vars_set_by_name_ifexist(const char *name, size_t len, struct sample *smp);
 int vars_set_by_name(const char *name, size_t len, struct sample *smp);
index 2cddb7749e9a46a90389745f6b7bcf8ef681c990..a3433b5b492e7d3ec5e1e7fe79637c0c7b9e4164 100644 (file)
@@ -363,7 +363,7 @@ static inline void var_clear_buffer(struct sample *smp, struct vars *vars, struc
  *
  * It returns 0 on failure, non-zero on success.
  */
-static int var_set(uint64_t name_hash, enum vars_scope scope, struct sample *smp, uint flags)
+int var_set(uint64_t name_hash, enum vars_scope scope, struct sample *smp, uint flags)
 {
        struct vars *vars;
        struct var *var;
@@ -515,7 +515,7 @@ static int var_set(uint64_t name_hash, enum vars_scope scope, struct sample *smp
  * session and stream found in <smp>. Note that stream may be null for
  * SCOPE_SESS. Returns 0 if the scope was not found otherwise 1.
  */
-static int var_unset(uint64_t name_hash, enum vars_scope scope, struct sample *smp)
+int var_unset(uint64_t name_hash, enum vars_scope scope, struct sample *smp)
 {
        struct vars *vars;
        struct var  *var;