Lines Matching refs:pat

40   struct URLPattern *pat = &glob->pattern[glob->size];  in glob_fixed()  local
41 pat->type = UPTSet; in glob_fixed()
42 pat->content.Set.size = 1; in glob_fixed()
43 pat->content.Set.ptr_s = 0; in glob_fixed()
44 pat->globindex = -1; in glob_fixed()
46 pat->content.Set.elements = malloc(sizeof(char *)); in glob_fixed()
48 if(!pat->content.Set.elements) in glob_fixed()
51 pat->content.Set.elements[0] = malloc(len + 1); in glob_fixed()
52 if(!pat->content.Set.elements[0]) in glob_fixed()
55 memcpy(pat->content.Set.elements[0], fixed, len); in glob_fixed()
56 pat->content.Set.elements[0][len] = 0; in glob_fixed()
95 struct URLPattern *pat; in glob_set() local
102 pat = &glob->pattern[glob->size]; in glob_set()
104 pat->type = UPTSet; in glob_set()
105 pat->content.Set.size = 0; in glob_set()
106 pat->content.Set.ptr_s = 0; in glob_set()
107 pat->content.Set.elements = NULL; in glob_set()
108 pat->globindex = globindex; in glob_set()
125 if(multiply(amount, pat->content.Set.size + 1)) in glob_set()
132 if(pat->content.Set.elements) { in glob_set()
133 char **new_arr = realloc(pat->content.Set.elements, in glob_set()
134 (size_t)(pat->content.Set.size + 1) * in glob_set()
139 pat->content.Set.elements = new_arr; in glob_set()
142 pat->content.Set.elements = malloc(sizeof(char *)); in glob_set()
144 if(!pat->content.Set.elements) in glob_set()
147 pat->content.Set.elements[pat->content.Set.size] = in glob_set()
149 if(!pat->content.Set.elements[pat->content.Set.size]) in glob_set()
151 ++pat->content.Set.size; in glob_set()
193 struct URLPattern *pat; in glob_range() local
198 pat = &glob->pattern[glob->size]; in glob_range()
199 pat->globindex = globindex; in glob_range()
208 pat->type = UPTCharRange; in glob_range()
240 pat->content.CharRange.step = (int)step; in glob_range()
241 pat->content.CharRange.ptr_c = pat->content.CharRange.min_c = min_c; in glob_range()
242 pat->content.CharRange.max_c = max_c; in glob_range()
244 if(multiply(amount, ((pat->content.CharRange.max_c - in glob_range()
245 pat->content.CharRange.min_c) / in glob_range()
246 pat->content.CharRange.step + 1))) in glob_range()
256 pat->type = UPTNumRange; in glob_range()
257 pat->content.NumRange.padlength = 0; in glob_range()
264 ++pat->content.NumRange.padlength; /* padding length is set for all in glob_range()
318 pat->content.NumRange.ptr_n = pat->content.NumRange.min_n = min_n; in glob_range()
319 pat->content.NumRange.max_n = max_n; in glob_range()
320 pat->content.NumRange.step = step_n; in glob_range()
322 if(multiply(amount, ((pat->content.NumRange.max_n - in glob_range()
323 pat->content.NumRange.min_n) / in glob_range()
324 pat->content.NumRange.step + 1))) in glob_range()
532 struct URLPattern *pat; in glob_next_url() local
549 pat = &glob->pattern[glob->size - 1 - i]; in glob_next_url()
550 switch(pat->type) { in glob_next_url()
552 if((pat->content.Set.elements) && in glob_next_url()
553 (++pat->content.Set.ptr_s == pat->content.Set.size)) { in glob_next_url()
554 pat->content.Set.ptr_s = 0; in glob_next_url()
559 pat->content.CharRange.ptr_c = in glob_next_url()
560 (char)(pat->content.CharRange.step + in glob_next_url()
561 (int)((unsigned char)pat->content.CharRange.ptr_c)); in glob_next_url()
562 if(pat->content.CharRange.ptr_c > pat->content.CharRange.max_c) { in glob_next_url()
563 pat->content.CharRange.ptr_c = pat->content.CharRange.min_c; in glob_next_url()
568 pat->content.NumRange.ptr_n += pat->content.NumRange.step; in glob_next_url()
569 if(pat->content.NumRange.ptr_n > pat->content.NumRange.max_n) { in glob_next_url()
570 pat->content.NumRange.ptr_n = pat->content.NumRange.min_n; in glob_next_url()
575 printf("internal error: invalid pattern type (%d)\n", (int)pat->type); in glob_next_url()
585 pat = &glob->pattern[i]; in glob_next_url()
586 switch(pat->type) { in glob_next_url()
588 if(pat->content.Set.elements) { in glob_next_url()
590 pat->content.Set.elements[pat->content.Set.ptr_s]); in glob_next_url()
598 *buf++ = pat->content.CharRange.ptr_c; in glob_next_url()
605 pat->content.NumRange.padlength, in glob_next_url()
606 pat->content.NumRange.ptr_n); in glob_next_url()
612 printf("internal error: invalid pattern type (%d)\n", (int)pat->type); in glob_next_url()
644 struct URLPattern *pat = NULL; in glob_match_url() local
652 pat = &glob->pattern[i]; in glob_match_url()
658 if(pat) { in glob_match_url()
659 switch(pat->type) { in glob_match_url()
661 if(pat->content.Set.elements) { in glob_match_url()
662 appendthis = pat->content.Set.elements[pat->content.Set.ptr_s]; in glob_match_url()
664 strlen(pat->content.Set.elements[pat->content.Set.ptr_s]); in glob_match_url()
668 numbuf[0] = pat->content.CharRange.ptr_c; in glob_match_url()
675 pat->content.NumRange.padlength, in glob_match_url()
676 pat->content.NumRange.ptr_n); in glob_match_url()
682 (int)pat->type); in glob_match_url()