• Home
  • Raw
  • Download

Lines Matching refs:pat

41   URLPattern *pat = &glob->pattern[glob->size];  in glob_fixed()  local
42 pat->type = UPTSet; in glob_fixed()
43 pat->content.Set.size = 1; in glob_fixed()
44 pat->content.Set.ptr_s = 0; in glob_fixed()
45 pat->globindex = -1; in glob_fixed()
47 pat->content.Set.elements = malloc(sizeof(char *)); in glob_fixed()
49 if(!pat->content.Set.elements) in glob_fixed()
52 pat->content.Set.elements[0] = malloc(len+1); in glob_fixed()
53 if(!pat->content.Set.elements[0]) in glob_fixed()
56 memcpy(pat->content.Set.elements[0], fixed, len); in glob_fixed()
57 pat->content.Set.elements[0][len] = 0; in glob_fixed()
82 URLPattern *pat; in glob_set() local
89 pat = &glob->pattern[glob->size]; in glob_set()
91 pat->type = UPTSet; in glob_set()
92 pat->content.Set.size = 0; in glob_set()
93 pat->content.Set.ptr_s = 0; in glob_set()
94 pat->content.Set.elements = NULL; in glob_set()
95 pat->globindex = globindex; in glob_set()
112 if(multiply(amount, pat->content.Set.size+1)) in glob_set()
119 if(pat->content.Set.elements) { in glob_set()
120 char **new_arr = realloc(pat->content.Set.elements, in glob_set()
121 (pat->content.Set.size + 1) * sizeof(char *)); in glob_set()
125 pat->content.Set.elements = new_arr; in glob_set()
128 pat->content.Set.elements = malloc(sizeof(char *)); in glob_set()
130 if(!pat->content.Set.elements) in glob_set()
133 pat->content.Set.elements[pat->content.Set.size] = in glob_set()
135 if(!pat->content.Set.elements[pat->content.Set.size]) in glob_set()
137 ++pat->content.Set.size; in glob_set()
179 URLPattern *pat; in glob_range() local
184 pat = &glob->pattern[glob->size]; in glob_range()
185 pat->globindex = globindex; in glob_range()
194 pat->type = UPTCharRange; in glob_range()
229 pat->content.CharRange.step = step; in glob_range()
230 pat->content.CharRange.ptr_c = pat->content.CharRange.min_c = min_c; in glob_range()
231 pat->content.CharRange.max_c = max_c; in glob_range()
233 if(multiply(amount, (pat->content.CharRange.max_c - in glob_range()
234 pat->content.CharRange.min_c) / in glob_range()
235 pat->content.CharRange.step + 1) ) in glob_range()
245 pat->type = UPTNumRange; in glob_range()
246 pat->content.NumRange.padlength = 0; in glob_range()
253 ++pat->content.NumRange.padlength; /* padding length is set for all in glob_range()
302 pat->content.NumRange.ptr_n = pat->content.NumRange.min_n = min_n; in glob_range()
303 pat->content.NumRange.max_n = max_n; in glob_range()
304 pat->content.NumRange.step = step_n; in glob_range()
306 if(multiply(amount, (pat->content.NumRange.max_n - in glob_range()
307 pat->content.NumRange.min_n) / in glob_range()
308 pat->content.NumRange.step + 1) ) in glob_range()
501 URLPattern *pat; in glob_next_url() local
518 pat = &glob->pattern[glob->size - 1 - i]; in glob_next_url()
519 switch (pat->type) { in glob_next_url()
521 if((pat->content.Set.elements) && in glob_next_url()
522 (++pat->content.Set.ptr_s == pat->content.Set.size)) { in glob_next_url()
523 pat->content.Set.ptr_s = 0; in glob_next_url()
528 pat->content.CharRange.ptr_c = in glob_next_url()
529 (char)(pat->content.CharRange.step + in glob_next_url()
530 (int)((unsigned char)pat->content.CharRange.ptr_c)); in glob_next_url()
531 if(pat->content.CharRange.ptr_c > pat->content.CharRange.max_c) { in glob_next_url()
532 pat->content.CharRange.ptr_c = pat->content.CharRange.min_c; in glob_next_url()
537 pat->content.NumRange.ptr_n += pat->content.NumRange.step; in glob_next_url()
538 if(pat->content.NumRange.ptr_n > pat->content.NumRange.max_n) { in glob_next_url()
539 pat->content.NumRange.ptr_n = pat->content.NumRange.min_n; in glob_next_url()
544 printf("internal error: invalid pattern type (%d)\n", (int)pat->type); in glob_next_url()
555 pat = &glob->pattern[i]; in glob_next_url()
556 switch(pat->type) { in glob_next_url()
558 if(pat->content.Set.elements) { in glob_next_url()
560 pat->content.Set.elements[pat->content.Set.ptr_s]); in glob_next_url()
568 *buf++ = pat->content.CharRange.ptr_c; in glob_next_url()
575 pat->content.NumRange.padlength, in glob_next_url()
576 pat->content.NumRange.ptr_n); in glob_next_url()
582 printf("internal error: invalid pattern type (%d)\n", (int)pat->type); in glob_next_url()
620 URLPattern *pat =NULL; in glob_match_url() local
627 pat = &glob->pattern[i]; in glob_match_url()
633 if(pat) { in glob_match_url()
634 switch (pat->type) { in glob_match_url()
636 if(pat->content.Set.elements) { in glob_match_url()
637 appendthis = pat->content.Set.elements[pat->content.Set.ptr_s]; in glob_match_url()
639 strlen(pat->content.Set.elements[pat->content.Set.ptr_s]); in glob_match_url()
643 numbuf[0] = pat->content.CharRange.ptr_c; in glob_match_url()
650 pat->content.NumRange.padlength, in glob_match_url()
651 pat->content.NumRange.ptr_n); in glob_match_url()
657 (int)pat->type); in glob_match_url()