REORG: stats: export some functions
Un-mark stats_dump_one_line and stats_putchk as static and export them
in the header file. These functions will be reusable by other components to
print their statistics.
This patch is needed to extend stat support to components other than
proxies objects.
diff --git a/include/haproxy/stats.h b/include/haproxy/stats.h
index 4e1b535..3c53486 100644
--- a/include/haproxy/stats.h
+++ b/include/haproxy/stats.h
@@ -39,6 +39,11 @@
extern struct applet http_stats_applet;
+struct htx;
+int stats_putchk(struct channel *chn, struct htx *htx, struct buffer *chk);
+
+int stats_dump_one_line(const struct field *stats, struct proxy *px, struct appctx *appctx);
+
int stats_fill_info(struct field *info, int len);
int stats_fill_fe_stats(struct proxy *px, struct field *stats, int len);
int stats_fill_li_stats(struct proxy *px, struct listener *l, int flags,
diff --git a/src/stats.c b/src/stats.c
index c306bfc..9b2e911 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -259,7 +259,7 @@
static void stats_dump_json_schema(struct buffer *out);
-static int stats_putchk(struct channel *chn, struct htx *htx, struct buffer *chk)
+int stats_putchk(struct channel *chn, struct htx *htx, struct buffer *chk)
{
if (htx) {
if (chk->data >= channel_htx_recv_max(chn, htx))
@@ -1381,7 +1381,7 @@
return 1;
}
-static int stats_dump_one_line(const struct field *stats, struct proxy *px, struct appctx *appctx)
+int stats_dump_one_line(const struct field *stats, struct proxy *px, struct appctx *appctx)
{
int ret;