Lines Matching refs:ptr
111 buffer_and_nest (const char *from, const char *to, sb *ptr, in buffer_and_nest() argument
117 size_t line_start = ptr->len; in buffer_and_nest()
118 size_t more = get_line (ptr); in buffer_and_nest()
142 while (i < ptr->len && ISWHITE (ptr->ptr[i])) in buffer_and_nest()
149 if (i >= ptr->len || ! is_name_beginner (ptr->ptr[i])) in buffer_and_nest()
152 while (i < ptr->len && is_part_of_name (ptr->ptr[i])) in buffer_and_nest()
154 if (i < ptr->len && is_name_ender (ptr->ptr[i])) in buffer_and_nest()
157 while (i < ptr->len && ISWHITE (ptr->ptr[i])) in buffer_and_nest()
160 if (i >= ptr->len || ptr->ptr[i] != ':') in buffer_and_nest()
177 while (i < ptr->len && ISWHITE (ptr->ptr[i])) in buffer_and_nest()
180 if (i < ptr->len && (ptr->ptr[i] == '.' in buffer_and_nest()
184 if (! flag_m68k_mri && ptr->ptr[i] == '.') in buffer_and_nest()
187 && strncasecmp (ptr->ptr + i, "IRPC", from_len = 4) != 0 in buffer_and_nest()
188 && strncasecmp (ptr->ptr + i, "IRP", from_len = 3) != 0 in buffer_and_nest()
189 && strncasecmp (ptr->ptr + i, "IREPC", from_len = 5) != 0 in buffer_and_nest()
190 && strncasecmp (ptr->ptr + i, "IREP", from_len = 4) != 0 in buffer_and_nest()
191 && strncasecmp (ptr->ptr + i, "REPT", from_len = 4) != 0 in buffer_and_nest()
192 && strncasecmp (ptr->ptr + i, "REP", from_len = 3) != 0) in buffer_and_nest()
195 ? strncasecmp (ptr->ptr + i, from, from_len) == 0 in buffer_and_nest()
197 && (ptr->len == (i + from_len) in buffer_and_nest()
198 || ! (is_part_of_name (ptr->ptr[i + from_len]) in buffer_and_nest()
199 || is_name_ender (ptr->ptr[i + from_len])))) in buffer_and_nest()
201 if (strncasecmp (ptr->ptr + i, to, to_len) == 0 in buffer_and_nest()
202 && (ptr->len == (i + to_len) in buffer_and_nest()
203 || ! (is_part_of_name (ptr->ptr[i + to_len]) in buffer_and_nest()
204 || is_name_ender (ptr->ptr[i + to_len])))) in buffer_and_nest()
210 ptr->len = line_start; in buffer_and_nest()
224 if (strncasecmp (ptr->ptr + i, "linefile", 8) == 0) in buffer_and_nest()
227 char saved_eol_char = ptr->ptr[ptr->len]; in buffer_and_nest()
229 ptr->ptr[ptr->len] = '\0'; in buffer_and_nest()
230 input_line_pointer = ptr->ptr + i + 8; in buffer_and_nest()
232 ptr->ptr[ptr->len] = saved_eol_char; in buffer_and_nest()
234 ptr->len = line_start; in buffer_and_nest()
239 sb_add_char (ptr, more); in buffer_and_nest()
240 line_start = ptr->len; in buffer_and_nest()
241 more = get_line (ptr); in buffer_and_nest()
254 && is_name_beginner (in->ptr[idx])) in get_token()
256 sb_add_char (name, in->ptr[idx++]); in get_token()
258 && is_part_of_name (in->ptr[idx])) in get_token()
260 sb_add_char (name, in->ptr[idx++]); in get_token()
263 && is_name_ender (in->ptr[idx])) in get_token()
265 sb_add_char (name, in->ptr[idx++]); in get_token()
269 if (macro_alternate && idx < in->len && in->ptr[idx] == '&') in get_token()
280 && (in->ptr[idx] == '"' in getstring()
281 || (in->ptr[idx] == '<' && (macro_alternate || macro_mri)) in getstring()
282 || (in->ptr[idx] == '\'' && macro_alternate))) in getstring()
284 if (in->ptr[idx] == '<') in getstring()
288 while ((in->ptr[idx] != '>' || nest) in getstring()
291 if (in->ptr[idx] == '!') in getstring()
294 sb_add_char (acc, in->ptr[idx++]); in getstring()
298 if (in->ptr[idx] == '>') in getstring()
300 if (in->ptr[idx] == '<') in getstring()
302 sb_add_char (acc, in->ptr[idx++]); in getstring()
307 else if (in->ptr[idx] == '"' || in->ptr[idx] == '\'') in getstring()
309 char tchar = in->ptr[idx]; in getstring()
316 if (in->ptr[idx - 1] == '\\') in getstring()
321 if (macro_alternate && in->ptr[idx] == '!') in getstring()
325 sb_add_char (acc, in->ptr[idx]); in getstring()
329 else if (escaped && in->ptr[idx] == tchar) in getstring()
336 if (in->ptr[idx] == tchar) in getstring()
340 if (idx >= in->len || in->ptr[idx] != tchar) in getstring()
344 sb_add_char (acc, in->ptr[idx]); in getstring()
370 if (in->len > idx + 2 && in->ptr[idx + 1] == '\'' && ISBASE (in->ptr[idx])) in get_any_string()
372 while (!ISSEP (in->ptr[idx])) in get_any_string()
373 sb_add_char (out, in->ptr[idx++]); in get_any_string()
375 else if (in->ptr[idx] == '%' && macro_alternate) in get_any_string()
389 else if (in->ptr[idx] == '"' in get_any_string()
390 || (in->ptr[idx] == '<' && (macro_alternate || macro_mri)) in get_any_string()
391 || (macro_alternate && in->ptr[idx] == '\'')) in get_any_string()
393 if (macro_alternate && ! macro_strip_at && in->ptr[idx] != '<') in get_any_string()
413 || (in->ptr[idx] != ' ' in get_any_string()
414 && in->ptr[idx] != '\t')) in get_any_string()
415 && in->ptr[idx] != ',' in get_any_string()
416 && (in->ptr[idx] != '<' in get_any_string()
419 char tchar = in->ptr[idx]; in get_any_string()
425 sb_add_char (out, in->ptr[idx++]); in get_any_string()
427 && in->ptr[idx] != tchar) in get_any_string()
428 sb_add_char (out, in->ptr[idx++]); in get_any_string()
522 && in->ptr[idx] == ':' in do_formals()
525 || ! is_part_of_name (in->ptr[idx + 1]))) in do_formals()
539 else if (strcmp (qual.ptr, "req") == 0) in do_formals()
541 else if (strcmp (qual.ptr, "vararg") == 0) in do_formals()
547 qual.ptr, in do_formals()
553 if (idx < in->len && in->ptr[idx] == '=') in do_formals()
675 if (idx < in->len && in->ptr[idx] == '(') in define_macro()
679 if (idx < in->len && in->ptr[idx] == ')') in define_macro()
710 name.ptr[idx] = TOLOWER (name.ptr[idx]); in define_macro()
734 && in->ptr[idx] == kind in get_apost_token()
748 formal_entry *ptr; in sub_actual() local
755 && (src == start || in->ptr[src - 1] != '@')) in sub_actual()
756 ptr = NULL; in sub_actual()
758 ptr = (formal_entry *) hash_find (formal_hash, sb_terminate (t)); in sub_actual()
759 if (ptr) in sub_actual()
761 if (ptr->actual.len) in sub_actual()
763 sb_add_sb (out, &ptr->actual); in sub_actual()
767 sb_add_sb (out, &ptr->def); in sub_actual()
775 if (src != start && in->ptr[src - 1] == '&') in sub_actual()
806 if (in->ptr[src] == '&') in macro_expand_body()
811 if (src + 1 < in->len && in->ptr[src + 1] == '&') in macro_expand_body()
814 sb_add_char (out, in->ptr[src++]); in macro_expand_body()
823 else if (in->ptr[src] == '\\') in macro_expand_body()
826 if (src < in->len && in->ptr[src] == '(') in macro_expand_body()
830 while (src < in->len && in->ptr[src] != ')') in macro_expand_body()
832 sb_add_char (out, in->ptr[src++]); in macro_expand_body()
841 else if (src < in->len && in->ptr[src] == '@') in macro_expand_body()
850 else if (src < in->len && in->ptr[src] == '&') in macro_expand_body()
858 else if (macro_mri && src < in->len && ISALNUM (in->ptr[src])) in macro_expand_body()
863 if (ISDIGIT (in->ptr[src])) in macro_expand_body()
864 ind = in->ptr[src] - '0'; in macro_expand_body()
865 else if (ISUPPER (in->ptr[src])) in macro_expand_body()
866 ind = in->ptr[src] - 'A' + 10; in macro_expand_body()
868 ind = in->ptr[src] - 'a' + 10; in macro_expand_body()
889 && is_name_beginner (in->ptr[src]) in macro_expand_body()
892 || (src > 0 && in->ptr[src - 1] == '@'))) in macro_expand_body()
896 || strncasecmp (in->ptr + src, "LOCAL", 5) != 0 in macro_expand_body()
897 || ! ISWHITE (in->ptr[src + 5]) in macro_expand_body()
909 while (in->ptr[src] != '\n') in macro_expand_body()
945 else if (in->ptr[src] == '"' in macro_expand_body()
946 || (macro_mri && in->ptr[src] == '\'')) in macro_expand_body()
949 sb_add_char (out, in->ptr[src++]); in macro_expand_body()
951 else if (in->ptr[src] == '@' && macro_strip_at) in macro_expand_body()
955 && in->ptr[src] == '@') in macro_expand_body()
962 && in->ptr[src] == '=' in macro_expand_body()
964 && in->ptr[src + 1] == '=') in macro_expand_body()
966 formal_entry *ptr; in macro_expand_body() local
970 ptr = (formal_entry *) hash_find (formal_hash, sb_terminate (&t)); in macro_expand_body()
971 if (ptr == NULL) in macro_expand_body()
987 if (ptr->actual.len) in macro_expand_body()
999 if (in->ptr[src] == '\n') in macro_expand_body()
1001 sb_add_char (out, in->ptr[src++]); in macro_expand_body()
1029 formal_entry *ptr; in macro_expand() local
1048 if (idx < in->len && in->ptr[idx] == '.') in macro_expand()
1054 && in->ptr[idx] != ' ' in macro_expand()
1055 && in->ptr[idx] != '\t') in macro_expand()
1078 && !ISSEP (in->ptr[scan]) in macro_expand()
1079 && !(macro_mri && in->ptr[scan] == '\'') in macro_expand()
1080 && (!macro_alternate && in->ptr[scan] != '=')) in macro_expand()
1082 if (scan < in->len && !macro_alternate && in->ptr[scan] == '=') in macro_expand()
1092 if (in->ptr[idx] != '=') in macro_expand()
1099 ptr = (formal_entry *) hash_find (m->formal_hash, sb_terminate (&t)); in macro_expand()
1100 if (!ptr) in macro_expand()
1103 t.ptr, in macro_expand()
1111 if (ptr->actual.len) in macro_expand()
1114 ptr->name.ptr, in macro_expand()
1116 sb_reset (&ptr->actual); in macro_expand()
1118 idx = get_any_string (idx + 1, in, &ptr->actual); in macro_expand()
1119 if (ptr->actual.len > 0) in macro_expand()
1158 sb_add_buffer (&f->actual, in->ptr + idx, in->len - idx); in macro_expand()
1174 if (in->ptr[idx] == ',') in macro_expand()
1176 if (ISWHITE (in->ptr[idx])) in macro_expand()
1183 for (ptr = m->formals; ptr; ptr = ptr->next) in macro_expand()
1185 if (ptr->type == FORMAL_REQUIRED && ptr->actual.len == 0) in macro_expand()
1187 ptr->name.ptr, in macro_expand()
1197 ptr = (formal_entry *) hash_find (m->formal_hash, sb_terminate (&t)); in macro_expand()
1199 sb_add_string (&ptr->actual, buffer); in macro_expand()
1355 if (irpc && in->ptr[idx] == '"') in expand_irp()
1367 if (in->ptr[idx] == '"') in expand_irp()
1382 sb_add_char (&f.actual, in->ptr[idx]); in expand_irp()