You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lighttpd2/include/lighttpd/pattern.h

24 lines
1.2 KiB

#ifndef _LIGHTTPD_PATTERN_H_
#define _LIGHTTPD_PATTERN_H_
/* liPattern are a parsed representation of a string that can contain various placeholders like $n, %n, %{var} or {enc:var} */
/* liPattern is a GArray in disguise */
typedef GArray liPattern;
/* a pattern callback receives an integer index and a data pointer (usually an array) and must return a GString* which gets inserted into the pattern result */
typedef void (*liPatternCB) (GString *pattern_result, guint8 nth_ndx, gpointer data);
/* constructs a new liPattern* by parsing the given string, returns NULL on error */
LI_API liPattern *li_pattern_new(liServer *srv, const gchar* str);
LI_API void li_pattern_free(liPattern *pattern);
LI_API void li_pattern_eval(liVRequest *vr, GString *dest, liPattern *pattern, liPatternCB nth_callback, gpointer nth_data, liPatternCB nth_prev_callback, gpointer nth_prev_data);
/* default array callback, expects a GArray* containing GString* elements */
LI_API void li_pattern_array_cb(GString *pattern_result, guint8 nth_ndx, gpointer data);
/* default regex callback, expects a GMatchInfo* */
LI_API void li_pattern_regex_cb(GString *pattern_result, guint8 nth_ndx, gpointer data);
#endif