40 while (i_pat < pat_len) {
43 if ((pat[i_pat] ==
'?') && (str[i_str] !=
'\0')
44 && (str[i_str] !=
'/')) {
45 size_t i_str_start = i_str;
50 }
while ((i_pat < pat_len) && (pat[i_pat] ==
'?')
51 && (str[i_str] !=
'\0') && (str[i_str] !=
'/'));
59 if (i_pat == pat_len) {
60 return (ptrdiff_t)i_str;
65 if (pat[i_pat] ==
'$') {
66 return (str[i_str] ==
'\0') ? (ptrdiff_t)i_str : -1;
70 if (pat[i_pat] ==
'*') {
75 if ((i_pat < pat_len) && (pat[i_pat] ==
'*')) {
78 len = strlen(str + i_str);
81 len = strcspn(str + i_str,
"/");
84 if (i_pat == pat_len) {
89 return ((ptrdiff_t)(i_str +
len));
95 (pat_len - (
size_t)i_pat),
98 }
while ((
ret == -1) && (
len-- > 0));
105 return ((ptrdiff_t)i_str +
ret + (ptrdiff_t)
len);
113 if (case_sensitive) {
114 if (pat[i_pat] != str[i_str]) {
126 return (ptrdiff_t)i_str;
136 const char *match_alternative = (
const char *)memchr(pat,
'|', pat_len);
142 while (match_alternative != NULL) {
144 size_t left_size = (size_t)(match_alternative - pat);
159 pat += left_size + 1;
160 pat_len -= left_size + 1;
161 match_alternative = (
const char *)memchr(pat,
'|', pat_len);
188#if defined(MG_EXPERIMENTAL_INTERFACES)
196 size_t pat_len = strlen(pat);
209 (size_t)(&mcx->
match[1]) - (size_t)(&mcx->
match[0]);
216 while (i < mcx->num_matches) {
246 if (pattern == NULL) {
256 if (pattern == NULL) {
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
static int lowercase(const char *s)
#define MG_MATCH_CONTEXT_MAX_MATCHES
static ptrdiff_t mg_match_impl(const char *pat, size_t pat_len, const char *str, struct mg_match_context *mcx)
static void match_context_push(const char *str, size_t len, struct mg_match_context *mcx)
static ptrdiff_t match_prefix_strlen(const char *pattern, const char *str)
static void match_context_reset(struct mg_match_context *mcx)
static ptrdiff_t mg_match(const char *pat, const char *str, struct mg_match_context *mcx)
static ptrdiff_t mg_match_alternatives(const char *pat, size_t pat_len, const char *str, struct mg_match_context *mcx)
static ptrdiff_t match_prefix(const char *pattern, size_t pattern_len, const char *str)
static int match_compare(const void *p1, const void *p2, void *user)
static void mg_sort(void *data, size_t elemcount, size_t elemsize, int(*compfunc)(const void *data1, const void *data2, void *userarg), void *userarg)
struct mg_match_element match[(32)]