Lines Matching refs:ptr

150 buffer_and_nest (const char *from, const char *to, sb *ptr,  in buffer_and_nest()  argument
156 int line_start = ptr->len; in buffer_and_nest()
158 int more = get_line (ptr); in buffer_and_nest()
173 while (i < ptr->len && ISWHITE (ptr->ptr[i])) in buffer_and_nest()
177 while (i < ptr->len in buffer_and_nest()
178 && (ISALNUM (ptr->ptr[i]) in buffer_and_nest()
179 || ptr->ptr[i] == '_' in buffer_and_nest()
180 || ptr->ptr[i] == '$')) in buffer_and_nest()
184 if (i < ptr->len in buffer_and_nest()
185 && ptr->ptr[i] == ':') in buffer_and_nest()
190 while (i < ptr->len && ISWHITE (ptr->ptr[i])) in buffer_and_nest()
193 if (i < ptr->len && (ptr->ptr[i] == '.' in buffer_and_nest()
197 if (ptr->ptr[i] == '.') in buffer_and_nest()
199 if (strncasecmp (ptr->ptr + i, from, from_len) == 0 in buffer_and_nest()
200 && (ptr->len == (i + from_len) in buffer_and_nest()
201 || ! ISALNUM (ptr->ptr[i + from_len]))) in buffer_and_nest()
203 if (strncasecmp (ptr->ptr + i, to, to_len) == 0 in buffer_and_nest()
204 && (ptr->len == (i + to_len) in buffer_and_nest()
205 || ! ISALNUM (ptr->ptr[i + to_len]))) in buffer_and_nest()
211 ptr->len = line_start; in buffer_and_nest()
218 sb_add_char (ptr, more); in buffer_and_nest()
219 line_start = ptr->len; in buffer_and_nest()
220 more = get_line (ptr); in buffer_and_nest()
233 && (ISALPHA (in->ptr[idx]) in get_token()
234 || in->ptr[idx] == '_' in get_token()
235 || in->ptr[idx] == '$')) in get_token()
237 sb_add_char (name, in->ptr[idx++]); in get_token()
239 && (ISALNUM (in->ptr[idx]) in get_token()
240 || in->ptr[idx] == '_' in get_token()
241 || in->ptr[idx] == '$')) in get_token()
243 sb_add_char (name, in->ptr[idx++]); in get_token()
247 if (macro_alternate && idx < in->len && in->ptr[idx] == '&') in get_token()
260 && (in->ptr[idx] == '"' in getstring()
261 || (in->ptr[idx] == '<' && (macro_alternate || macro_mri)) in getstring()
262 || (in->ptr[idx] == '\'' && macro_alternate))) in getstring()
264 if (in->ptr[idx] == '<') in getstring()
268 while ((in->ptr[idx] != '>' || nest) in getstring()
271 if (in->ptr[idx] == '!') in getstring()
274 sb_add_char (acc, in->ptr[idx++]); in getstring()
278 if (in->ptr[idx] == '>') in getstring()
280 if (in->ptr[idx] == '<') in getstring()
282 sb_add_char (acc, in->ptr[idx++]); in getstring()
287 else if (in->ptr[idx] == '"' || in->ptr[idx] == '\'') in getstring()
289 char tchar = in->ptr[idx]; in getstring()
296 if (in->ptr[idx - 1] == '\\') in getstring()
301 if (macro_alternate && in->ptr[idx] == '!') in getstring()
305 sb_add_char (acc, in->ptr[idx]); in getstring()
309 else if (escaped && in->ptr[idx] == tchar) in getstring()
316 if (in->ptr[idx] == tchar) in getstring()
320 if (idx >= in->len || in->ptr[idx] != tchar) in getstring()
324 sb_add_char (acc, in->ptr[idx]); in getstring()
350 if (in->len > idx + 2 && in->ptr[idx + 1] == '\'' && ISBASE (in->ptr[idx])) in get_any_string()
352 while (!ISSEP (in->ptr[idx])) in get_any_string()
353 sb_add_char (out, in->ptr[idx++]); in get_any_string()
355 else if (in->ptr[idx] == '%' in get_any_string()
370 else if (in->ptr[idx] == '"' in get_any_string()
371 || (in->ptr[idx] == '<' && (macro_alternate || macro_mri)) in get_any_string()
372 || (macro_alternate && in->ptr[idx] == '\'')) in get_any_string()
392 && (in->ptr[idx] == '"' in get_any_string()
393 || in->ptr[idx] == '\'' in get_any_string()
395 || (in->ptr[idx] != ' ' in get_any_string()
396 && in->ptr[idx] != '\t' in get_any_string()
397 && in->ptr[idx] != ',' in get_any_string()
398 && (in->ptr[idx] != '<' in get_any_string()
401 if (in->ptr[idx] == '"' in get_any_string()
402 || in->ptr[idx] == '\'') in get_any_string()
404 char tchar = in->ptr[idx]; in get_any_string()
405 sb_add_char (out, in->ptr[idx++]); in get_any_string()
407 && in->ptr[idx] != tchar) in get_any_string()
408 sb_add_char (out, in->ptr[idx++]); in get_any_string()
412 sb_add_char (out, in->ptr[idx++]); in get_any_string()
447 if (idx < in->len && in->ptr[idx] == '=') in do_formals()
523 if (idx < in->len && in->ptr[idx] == '(') in define_macro()
527 if (in->ptr[idx] != ')') in define_macro()
545 name.ptr[idx] = TOLOWER (name.ptr[idx]); in define_macro()
564 && in->ptr[idx] == kind in get_apost_token()
578 formal_entry *ptr; in sub_actual() local
585 && (src == start || in->ptr[src - 1] != '@')) in sub_actual()
586 ptr = NULL; in sub_actual()
588 ptr = (formal_entry *) hash_find (formal_hash, sb_terminate (t)); in sub_actual()
589 if (ptr) in sub_actual()
591 if (ptr->actual.len) in sub_actual()
593 sb_add_sb (out, &ptr->actual); in sub_actual()
597 sb_add_sb (out, &ptr->def); in sub_actual()
633 if (in->ptr[src] == '&') in macro_expand_body()
638 if (src + 1 < in->len && in->ptr[src + 1] == '&') in macro_expand_body()
641 sb_add_char (out, in->ptr[src++]); in macro_expand_body()
649 else if (in->ptr[src] == '\\') in macro_expand_body()
652 if (in->ptr[src] == '(') in macro_expand_body()
656 while (src < in->len && in->ptr[src] != ')') in macro_expand_body()
658 sb_add_char (out, in->ptr[src++]); in macro_expand_body()
660 if (in->ptr[src] == ')') in macro_expand_body()
665 else if (in->ptr[src] == '@') in macro_expand_body()
674 else if (in->ptr[src] == '&') in macro_expand_body()
682 else if (macro_mri && ISALNUM (in->ptr[src])) in macro_expand_body()
687 if (ISDIGIT (in->ptr[src])) in macro_expand_body()
688 ind = in->ptr[src] - '0'; in macro_expand_body()
689 else if (ISUPPER (in->ptr[src])) in macro_expand_body()
690 ind = in->ptr[src] - 'A' + 10; in macro_expand_body()
692 ind = in->ptr[src] - 'a' + 10; in macro_expand_body()
713 && (ISALPHA (in->ptr[src]) in macro_expand_body()
714 || in->ptr[src] == '_' in macro_expand_body()
715 || in->ptr[src] == '$') in macro_expand_body()
718 || (src > 0 && in->ptr[src - 1] == '@'))) in macro_expand_body()
722 || strncasecmp (in->ptr + src, "LOCAL", 5) != 0 in macro_expand_body()
723 || ! ISWHITE (in->ptr[src + 5])) in macro_expand_body()
735 while (in->ptr[src] != '\n') in macro_expand_body()
762 else if (in->ptr[src] == '"' in macro_expand_body()
763 || (macro_mri && in->ptr[src] == '\'')) in macro_expand_body()
766 sb_add_char (out, in->ptr[src++]); in macro_expand_body()
768 else if (in->ptr[src] == '@' && macro_strip_at) in macro_expand_body()
772 && in->ptr[src] == '@') in macro_expand_body()
779 && in->ptr[src] == '=' in macro_expand_body()
781 && in->ptr[src + 1] == '=') in macro_expand_body()
783 formal_entry *ptr; in macro_expand_body() local
787 ptr = (formal_entry *) hash_find (formal_hash, sb_terminate (&t)); in macro_expand_body()
788 if (ptr == NULL) in macro_expand_body()
804 if (ptr->actual.len) in macro_expand_body()
816 sb_add_char (out, in->ptr[src++]); in macro_expand_body()
847 formal_entry *ptr; in macro_expand() local
867 if (idx < in->len && in->ptr[idx] == '.') in macro_expand()
873 && in->ptr[idx] != ' ' in macro_expand()
874 && in->ptr[idx] != '\t') in macro_expand()
901 && !ISSEP (in->ptr[scan]) in macro_expand()
902 && !(macro_mri && in->ptr[scan] == '\'') in macro_expand()
903 && (!macro_alternate && in->ptr[scan] != '=')) in macro_expand()
905 if (scan < in->len && !macro_alternate && in->ptr[scan] == '=') in macro_expand()
915 if (in->ptr[idx] != '=') in macro_expand()
919 ptr = (formal_entry *) hash_find (m->formal_hash, sb_terminate (&t)); in macro_expand()
920 if (!ptr) in macro_expand()
925 sb_reset (&ptr->actual); in macro_expand()
926 idx = get_any_string (idx + 1, in, &ptr->actual, 0, 0); in macro_expand()
927 if (ptr->actual.len > 0) in macro_expand()
977 if (in->ptr[idx] == ',') in macro_expand()
979 if (ISWHITE (in->ptr[idx])) in macro_expand()
990 ptr = (formal_entry *) hash_find (m->formal_hash, sb_terminate (&t)); in macro_expand()
991 sb_reset (&ptr->actual); in macro_expand()
993 sb_add_string (&ptr->actual, buffer); in macro_expand()
1140 if (irpc && in->ptr[idx] == '"') in expand_irp()
1148 if (in->ptr[idx] == '"') in expand_irp()
1160 sb_add_char (&f.actual, in->ptr[idx]); in expand_irp()