• Home
  • Raw
  • Download

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()
80 URLPattern *pat; in glob_set() local
87 pat = &glob->pattern[glob->size]; in glob_set()
89 pat->type = UPTSet; in glob_set()
90 pat->content.Set.size = 0; in glob_set()
91 pat->content.Set.ptr_s = 0; in glob_set()
92 pat->content.Set.elements = NULL; in glob_set()
93 pat->globindex = globindex; in glob_set()
110 if(multiply(amount, pat->content.Set.size+1)) in glob_set()
117 if(pat->content.Set.elements) { in glob_set()
118 char **new_arr = realloc(pat->content.Set.elements, in glob_set()
119 (pat->content.Set.size + 1) * sizeof(char*)); in glob_set()
123 pat->content.Set.elements = new_arr; in glob_set()
126 pat->content.Set.elements = malloc(sizeof(char*)); in glob_set()
128 if(!pat->content.Set.elements) in glob_set()
131 pat->content.Set.elements[pat->content.Set.size] = in glob_set()
133 if(!pat->content.Set.elements[pat->content.Set.size]) in glob_set()
135 ++pat->content.Set.size; in glob_set()
177 URLPattern *pat; in glob_range() local
182 pat = &glob->pattern[glob->size]; in glob_range()
183 pat->globindex = globindex; in glob_range()
191 pat->type = UPTCharRange; in glob_range()
220 pat->content.CharRange.step = step; in glob_range()
221 pat->content.CharRange.ptr_c = pat->content.CharRange.min_c = min_c; in glob_range()
222 pat->content.CharRange.max_c = max_c; in glob_range()
224 if(multiply(amount, (pat->content.CharRange.max_c - in glob_range()
225 pat->content.CharRange.min_c) / in glob_range()
226 pat->content.CharRange.step + 1) ) in glob_range()
236 pat->type = UPTNumRange; in glob_range()
237 pat->content.NumRange.padlength = 0; in glob_range()
244 ++pat->content.NumRange.padlength; /* padding length is set for all in glob_range()
287 pat->content.NumRange.ptr_n = pat->content.NumRange.min_n = min_n; in glob_range()
288 pat->content.NumRange.max_n = max_n; in glob_range()
289 pat->content.NumRange.step = step_n; in glob_range()
291 if(multiply(amount, (pat->content.NumRange.max_n - in glob_range()
292 pat->content.NumRange.min_n) / in glob_range()
293 pat->content.NumRange.step + 1) ) in glob_range()
485 URLPattern *pat; in glob_next_url() local
502 pat = &glob->pattern[glob->size - 1 - i]; in glob_next_url()
503 switch (pat->type) { in glob_next_url()
505 if((pat->content.Set.elements) && in glob_next_url()
506 (++pat->content.Set.ptr_s == pat->content.Set.size)) { in glob_next_url()
507 pat->content.Set.ptr_s = 0; in glob_next_url()
512 pat->content.CharRange.ptr_c = in glob_next_url()
513 (char)(pat->content.CharRange.step + in glob_next_url()
514 (int)((unsigned char)pat->content.CharRange.ptr_c)); in glob_next_url()
515 if(pat->content.CharRange.ptr_c > pat->content.CharRange.max_c) { in glob_next_url()
516 pat->content.CharRange.ptr_c = pat->content.CharRange.min_c; in glob_next_url()
521 pat->content.NumRange.ptr_n += pat->content.NumRange.step; in glob_next_url()
522 if(pat->content.NumRange.ptr_n > pat->content.NumRange.max_n) { in glob_next_url()
523 pat->content.NumRange.ptr_n = pat->content.NumRange.min_n; in glob_next_url()
528 printf("internal error: invalid pattern type (%d)\n", (int)pat->type); in glob_next_url()
539 pat = &glob->pattern[i]; in glob_next_url()
540 switch(pat->type) { in glob_next_url()
542 if(pat->content.Set.elements) { in glob_next_url()
543 len = strlen(pat->content.Set.elements[pat->content.Set.ptr_s]); in glob_next_url()
545 pat->content.Set.elements[pat->content.Set.ptr_s]); in glob_next_url()
551 *buf++ = pat->content.CharRange.ptr_c; in glob_next_url()
555 pat->content.NumRange.padlength, in glob_next_url()
556 pat->content.NumRange.ptr_n); in glob_next_url()
561 printf("internal error: invalid pattern type (%d)\n", (int)pat->type); in glob_next_url()
600 URLPattern *pat =NULL; in glob_match_url() local
607 pat = &glob->pattern[i]; in glob_match_url()
613 if(pat) { in glob_match_url()
614 switch (pat->type) { in glob_match_url()
616 if(pat->content.Set.elements) { in glob_match_url()
617 appendthis = pat->content.Set.elements[pat->content.Set.ptr_s]; in glob_match_url()
619 strlen(pat->content.Set.elements[pat->content.Set.ptr_s]); in glob_match_url()
623 numbuf[0] = pat->content.CharRange.ptr_c; in glob_match_url()
630 pat->content.NumRange.padlength, in glob_match_url()
631 pat->content.NumRange.ptr_n); in glob_match_url()
637 (int)pat->type); in glob_match_url()