Lines Matching refs:pat
39 URLPattern *pat = &glob->pattern[glob->size]; in glob_fixed() local
40 pat->type = UPTSet; in glob_fixed()
41 pat->content.Set.size = 1; in glob_fixed()
42 pat->content.Set.ptr_s = 0; in glob_fixed()
43 pat->globindex = -1; in glob_fixed()
45 pat->content.Set.elements = malloc(sizeof(char *)); in glob_fixed()
47 if(!pat->content.Set.elements) in glob_fixed()
50 pat->content.Set.elements[0] = malloc(len + 1); in glob_fixed()
51 if(!pat->content.Set.elements[0]) in glob_fixed()
54 memcpy(pat->content.Set.elements[0], fixed, len); in glob_fixed()
55 pat->content.Set.elements[0][len] = 0; in glob_fixed()
84 URLPattern *pat; in glob_set() local
91 pat = &glob->pattern[glob->size]; in glob_set()
93 pat->type = UPTSet; in glob_set()
94 pat->content.Set.size = 0; in glob_set()
95 pat->content.Set.ptr_s = 0; in glob_set()
96 pat->content.Set.elements = NULL; in glob_set()
97 pat->globindex = globindex; in glob_set()
114 if(multiply(amount, pat->content.Set.size + 1)) in glob_set()
121 if(pat->content.Set.elements) { in glob_set()
122 char **new_arr = realloc(pat->content.Set.elements, in glob_set()
123 (pat->content.Set.size + 1) * sizeof(char *)); in glob_set()
127 pat->content.Set.elements = new_arr; in glob_set()
130 pat->content.Set.elements = malloc(sizeof(char *)); in glob_set()
132 if(!pat->content.Set.elements) in glob_set()
135 pat->content.Set.elements[pat->content.Set.size] = in glob_set()
137 if(!pat->content.Set.elements[pat->content.Set.size]) in glob_set()
139 ++pat->content.Set.size; in glob_set()
181 URLPattern *pat; in glob_range() local
186 pat = &glob->pattern[glob->size]; in glob_range()
187 pat->globindex = globindex; in glob_range()
196 pat->type = UPTCharRange; in glob_range()
228 pat->content.CharRange.step = (int)step; in glob_range()
229 pat->content.CharRange.ptr_c = pat->content.CharRange.min_c = min_c; in glob_range()
230 pat->content.CharRange.max_c = max_c; in glob_range()
232 if(multiply(amount, ((pat->content.CharRange.max_c - in glob_range()
233 pat->content.CharRange.min_c) / in glob_range()
234 pat->content.CharRange.step + 1))) in glob_range()
244 pat->type = UPTNumRange; in glob_range()
245 pat->content.NumRange.padlength = 0; in glob_range()
252 ++pat->content.NumRange.padlength; /* padding length is set for all in glob_range()
306 pat->content.NumRange.ptr_n = pat->content.NumRange.min_n = min_n; in glob_range()
307 pat->content.NumRange.max_n = max_n; in glob_range()
308 pat->content.NumRange.step = step_n; in glob_range()
310 if(multiply(amount, ((pat->content.NumRange.max_n - in glob_range()
311 pat->content.NumRange.min_n) / in glob_range()
312 pat->content.NumRange.step + 1))) in glob_range()
508 URLPattern *pat; in glob_next_url() local
525 pat = &glob->pattern[glob->size - 1 - i]; in glob_next_url()
526 switch(pat->type) { in glob_next_url()
528 if((pat->content.Set.elements) && in glob_next_url()
529 (++pat->content.Set.ptr_s == pat->content.Set.size)) { in glob_next_url()
530 pat->content.Set.ptr_s = 0; in glob_next_url()
535 pat->content.CharRange.ptr_c = in glob_next_url()
536 (char)(pat->content.CharRange.step + in glob_next_url()
537 (int)((unsigned char)pat->content.CharRange.ptr_c)); in glob_next_url()
538 if(pat->content.CharRange.ptr_c > pat->content.CharRange.max_c) { in glob_next_url()
539 pat->content.CharRange.ptr_c = pat->content.CharRange.min_c; in glob_next_url()
544 pat->content.NumRange.ptr_n += pat->content.NumRange.step; in glob_next_url()
545 if(pat->content.NumRange.ptr_n > pat->content.NumRange.max_n) { in glob_next_url()
546 pat->content.NumRange.ptr_n = pat->content.NumRange.min_n; in glob_next_url()
551 printf("internal error: invalid pattern type (%d)\n", (int)pat->type); in glob_next_url()
562 pat = &glob->pattern[i]; in glob_next_url()
563 switch(pat->type) { in glob_next_url()
565 if(pat->content.Set.elements) { in glob_next_url()
567 pat->content.Set.elements[pat->content.Set.ptr_s]); in glob_next_url()
575 *buf++ = pat->content.CharRange.ptr_c; in glob_next_url()
582 pat->content.NumRange.padlength, in glob_next_url()
583 pat->content.NumRange.ptr_n); in glob_next_url()
589 printf("internal error: invalid pattern type (%d)\n", (int)pat->type); in glob_next_url()
626 URLPattern *pat = NULL; in glob_match_url() local
634 pat = &glob->pattern[i]; in glob_match_url()
640 if(pat) { in glob_match_url()
641 switch(pat->type) { in glob_match_url()
643 if(pat->content.Set.elements) { in glob_match_url()
644 appendthis = pat->content.Set.elements[pat->content.Set.ptr_s]; in glob_match_url()
646 strlen(pat->content.Set.elements[pat->content.Set.ptr_s]); in glob_match_url()
650 numbuf[0] = pat->content.CharRange.ptr_c; in glob_match_url()
657 pat->content.NumRange.padlength, in glob_match_url()
658 pat->content.NumRange.ptr_n); in glob_match_url()
664 (int)pat->type); in glob_match_url()