+ User_data destroy callback added to match_create_callback() in utils_match
[collectd.git] / src / daemon / utils_match.h
index a1d1002..31dc66d 100644 (file)
@@ -46,6 +46,7 @@
 #define UTILS_MATCH_CF_GAUGE_LAST    0x08
 #define UTILS_MATCH_CF_GAUGE_INC     0x10
 #define UTILS_MATCH_CF_GAUGE_ADD     0x20
+#define UTILS_MATCH_CF_GAUGE_PERSIST 0x40
 
 #define UTILS_MATCH_CF_COUNTER_SET   0x01
 #define UTILS_MATCH_CF_COUNTER_ADD   0x02
@@ -93,11 +94,13 @@ typedef struct cu_match_value_s cu_match_value_t;
  *  callback.
  *  The optional `excluderegex' allows to exclude the line from the match, if
  *  the excluderegex matches.
+ *  When `match_destroy' is called the `user_data' pointer is freed using
+ *  the `free_user_data' callback - if it is not NULL.
  */
 cu_match_t *match_create_callback (const char *regex, const char *excluderegex,
                int (*callback) (const char *str,
                  char * const *matches, size_t matches_num, void *user_data),
-               void *user_data);
+               void *user_data, void (*free_user_data) (void *user_data));
 
 /*
  * NAME