]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: sample: export sample_casts
authorThierry FOURNIER <tfournier@exceliance.fr>
Thu, 21 Nov 2013 09:53:12 +0000 (10:53 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 2 Dec 2013 22:31:32 +0000 (23:31 +0100)
just export the sample cast matrix "sample_casts" to prepare the
generic sample conversion parser.

include/types/sample.h
src/sample.c

index 3dfaec960fce3e0b65d07a95911af0cb2fa8cc16..956e7946b349ac70c5e5fd55f70a35c90b164439 100644 (file)
@@ -293,4 +293,7 @@ struct sample_conv_kw_list {
        struct sample_conv kw[VAR_ARRAY];         /* array of sample conversion descriptors */
 };
 
+typedef int (*sample_cast_fct)(struct sample *smp);
+extern sample_cast_fct sample_casts[SMP_TYPES][SMP_TYPES];
+
 #endif /* _TYPES_SAMPLE_H */
index dc2304a7de19b359c4e6f64afaf01e5d2be8d073..72412c941e3e0a98723eee5783551f3388cdab04 100644 (file)
@@ -512,8 +512,7 @@ static int c_str2int(struct sample *smp)
 /*           NULL pointer used for impossible sample casts       */
 /*****************************************************************/
 
-typedef int (*sample_cast_fct)(struct sample *smp);
-static sample_cast_fct sample_casts[SMP_TYPES][SMP_TYPES] = {
+sample_cast_fct sample_casts[SMP_TYPES][SMP_TYPES] = {
 /*            to:  BOOL       UINT       SINT       IPV4      IPV6        STR         BIN        CSTR        CBIN   */
 /* from: BOOL */ { c_none,    c_none,    c_none,    NULL,     NULL,       c_int2str,  NULL,      c_int2str,  NULL   },
 /*       UINT */ { c_none,    c_none,    c_none,    c_int2ip, NULL,       c_int2str,  NULL,      c_int2str,  NULL   },