From: Thierry FOURNIER Date: Thu, 21 Nov 2013 09:53:12 +0000 (+0100) Subject: MINOR: sample: export sample_casts X-Git-Tag: v1.5-dev20~198 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8af6ff12b53b618d6549e268c0ccf85c85e7558e;p=thirdparty%2Fhaproxy.git MINOR: sample: export sample_casts just export the sample cast matrix "sample_casts" to prepare the generic sample conversion parser. --- diff --git a/include/types/sample.h b/include/types/sample.h index 3dfaec960f..956e7946b3 100644 --- a/include/types/sample.h +++ b/include/types/sample.h @@ -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 */ diff --git a/src/sample.c b/src/sample.c index dc2304a7de..72412c941e 100644 --- a/src/sample.c +++ b/src/sample.c @@ -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 },