25 #ifndef LOGMATCHER_H_INCLUDED
26 #define LOGMATCHER_H_INCLUDED
31 #define LOG_MATCHER_ERROR log_template_error_quark()
56 typedef struct _LogMatcherOptions
69 gboolean (*
compile)(LogMatcher *s,
const gchar *re, GError **error);
71 gboolean (*
match)(LogMatcher *s, LogMessage *
msg, gint value_handle,
const gchar *
value, gssize value_len);
73 gchar *(*replace)(LogMatcher *s, LogMessage *
msg, gint value_handle,
const gchar *
value, gssize value_len,
74 LogTemplate *replacement, gssize *new_length);
78 static inline gboolean
79 log_matcher_compile(LogMatcher *s,
const gchar *re, GError **error)
81 return s->compile(s, re, error);
84 static inline gboolean
85 log_matcher_match(LogMatcher *s, LogMessage *
msg, gint value_handle,
const gchar *
value, gssize value_len)
87 return s->match(s,
msg, value_handle,
value, value_len);
96 log_matcher_replace(LogMatcher *s, LogMessage *
msg, gint value_handle,
const gchar *
value, gssize value_len,
97 LogTemplate *replacement, gssize *new_length)
100 return s->replace(s,
msg, value_handle,
value, value_len, replacement, new_length);
105 log_matcher_set_flags(LogMatcher *s, gint flags)
110 static inline gboolean
111 log_matcher_is_replace_supported(LogMatcher *s)
113 return s->replace != NULL;
void log_matcher_options_defaults(LogMatcherOptions *options)
Definition: logmatcher.c:887
void log_matcher_options_init(LogMatcherOptions *options)
Definition: logmatcher.c:894
void log_matcher_pcre_set_nv_prefix(LogMatcher *s, const gchar *prefix)
Definition: logmatcher.c:715
LogMatcher * log_matcher_pcre_re_new(const LogMatcherOptions *options)
Definition: logmatcher.c:699
LogMatcher * log_matcher_ref(LogMatcher *s)
Definition: logmatcher.c:820
LogMatcher * log_matcher_glob_new(const LogMatcherOptions *options)
Definition: logmatcher.c:266
GQuark log_matcher_error_quark(void)
Definition: logmatcher.c:913
LogMatcher * log_matcher_string_new(const LogMatcherOptions *options)
Definition: logmatcher.c:197
void log_matcher_options_destroy(LogMatcherOptions *options)
Definition: logmatcher.c:906
gboolean log_matcher_options_process_flag(LogMatcherOptions *self, const gchar *flag)
Definition: logmatcher.c:881
gboolean log_matcher_options_set_type(LogMatcherOptions *options, const gchar *type)
Definition: logmatcher.c:838
gboolean log_matcher_match_buffer(LogMatcher *s, LogMessage *msg, const gchar *value, gssize value_len)
Definition: logmatcher.c:749
LogMatcher * log_matcher_new(const LogMatcherOptions *options)
Definition: logmatcher.c:811
gboolean log_matcher_match_template(LogMatcher *s, LogMessage *msg, LogTemplate *template, LogTemplateEvalOptions *options)
Definition: logmatcher.c:755
gboolean log_matcher_match_value(LogMatcher *s, LogMessage *msg, gint value_handle)
Definition: logmatcher.c:735
void log_matcher_unref(LogMatcher *s)
Definition: logmatcher.c:827
@ LMF_GLOBAL
Definition: logmatcher.h:38
@ LMF_UTF8
Definition: logmatcher.h:44
@ LMF_STORE_MATCHES
Definition: logmatcher.h:45
@ LMF_SUBSTRING
Definition: logmatcher.h:49
@ LMF_DUPNAMES
Definition: logmatcher.h:53
@ LMF_MATCH_ONLY
Definition: logmatcher.h:40
@ LMF_PREFIX
Definition: logmatcher.h:50
@ LMF_DISABLE_JIT
Definition: logmatcher.h:46
@ LMF_ICASE
Definition: logmatcher.h:39
@ LMF_NEWLINE
Definition: logmatcher.h:43
Definition: logmatcher.h:57
gint flags
Definition: logmatcher.h:58
gchar * type
Definition: logmatcher.h:59
Definition: logmatcher.h:65
gchar * pattern
Definition: logmatcher.h:68
gint flags
Definition: logmatcher.h:67
gint ref_cnt
Definition: logmatcher.h:66
gboolean(* match)(LogMatcher *s, LogMessage *msg, gint value_handle, const gchar *value, gssize value_len)
Definition: logmatcher.h:71
void(* free_fn)(LogMatcher *s)
Definition: logmatcher.h:75
gboolean(* compile)(LogMatcher *s, const gchar *re, GError **error)
Definition: logmatcher.h:69
GString * value
Definition: test_decode.c:28
LogMessage * msg
Definition: test_rename.c:35