From: Thierry FOURNIER Date: Fri, 11 Sep 2015 06:50:34 +0000 (+0200) Subject: MINOR: applet: add init function X-Git-Tag: v1.6-dev6~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c069cfdfea5d11d84cfc190c5f488e78f0bd145d;p=thirdparty%2Fhaproxy.git MINOR: applet: add init function this patch adds init function for the applet. the HAProxy standard applet (peers, stats, lua) have no standard way for the applet initialisation. This new function pointer have for goal to try to standardize the applet initialization. --- diff --git a/include/types/applet.h b/include/types/applet.h index 6b46f49451..13817b22aa 100644 --- a/include/types/applet.h +++ b/include/types/applet.h @@ -24,6 +24,8 @@ #include #include +#include +#include #include #include @@ -34,6 +36,8 @@ struct applet { enum obj_type obj_type; /* object type = OBJ_TYPE_APPLET */ /* 3 unused bytes here */ char *name; /* applet's name to report in logs */ + int (*init)(struct appctx *, struct proxy *px, struct stream *strm); /* callback to init ressources, may be NULL. + expect 1 if ok, 0 if an error occurs, -1 if miss data. */ void (*fct)(struct appctx *); /* internal I/O handler, may never be NULL */ void (*release)(struct appctx *); /* callback to release resources, may be NULL */ };