Lines Matching refs:mac

260 	register struct ppmacro*	mac;
655 mac = sym->macro;
656 if ((pp.option & ALLPOSSIBLE) && !pp.in->prev->prev && mac->value)
660 old = *mac;
667 mac->arity = 0;
668 mac->formals = 0;
669 mac->value = 0;
681 p = mac->formals = oldof(0, char, 0, n);
684 if (mac->arity < MAXFORMALS)
686 if (mac->arity) p++;
687 formargs[mac->arity] = p;
689 formvals[mac->arity++] = p1 = p;
690 if (mac->arity == 1) *p++ = ' ';
719 if (p > formvals[mac->arity - 1] && *(p - 1) == ' ') *--p = 0;
726 if (p > formvals[mac->arity - 1] && *(p - 1) == ' ') *--p = 0;
731 if (p > formvals[mac->arity - 1] && *(p - 1) == ' ') continue;
735 if (p > &mac->formals[n - MAXTOKEN] && (s = newof(mac->formals, char, n += MAXTOKEN, 0)) != mac->formals)
737 n1 = s - mac->formals;
738 for (n = 0; n < mac->arity; n++)
743 c = p - mac->formals;
744 mac->formals = s;
745 p = mac->formals + c;
762 p = mac->formals = oldof(0, char, 0, MAXFORMALS * (MAXID + 1));
791 if (mac->arity < MAXFORMALS)
793 for (n = 0; n < mac->arity; n++)
796 formargs[mac->arity++] = p;
824 if (mac->arity && (s = newof(mac->formals, char, p - mac->formals, 0)) != mac->formals)
826 n1 = s - mac->formals;
827 for (n = 0; n < mac->arity; n++)
829 mac->formals = s;
832 if (!mac->arity)
834 free(mac->formals);
835 mac->formals = 0;
849 if (mac->formals)
851 free(mac->formals);
852 mac->formals = 0;
853 mac->arity = 0;
855 free(mac);
870 p = mac->value = oldof(0, char, 0, n);
897 for (c = 0; c < mac->arity; c++)
903 if (var.type != TOK_TOKCAT && p > mac->value && *(p - 1) != ' ' && !(pp.option & PRESERVE)) *p++ = ' ';
965 if (c != T_ID) c = mac->arity;
966 else for (c = 0; c < mac->arity; c++)
969 if (c >= mac->arity)
1002 if (p > mac->value && ppisidig(*(p - 1)) && !(pp.option & PRESERVE)) *p++ = ' ';
1010 if (p <= mac->value) error(2, "%s lhs operand omitted", pp.token);
1060 for (c = 0; c < mac->arity; c++)
1113 if (p > mac->value && *(p - 1) != ' ') *p++ = ' ';
1130 if (p > mac->value && *(p - 1) != ' ') *p++ = ' ';
1144 if (p > &mac->value[n - MAXTOKEN] && (s = newof(mac->value, char, n += MAXTOKEN, 0)) != mac->value)
1146 c = p - mac->value;
1147 mac->value = s;
1148 p = mac->value + c;
1156 while (p > mac->value && *(p - 1) == ' ') p--;
1157 if (p > mac->value && (pp.option & PLUSPLUS) && (pp.state & (COMPATIBILITY|TRANSITION)) != COMPATIBILITY)
1173 if (!mac->arity) /* ok */;
1176 p0 = mac->formals;
1177 mac->formkeys = newof(0, struct ppkeyarg, n, p1 - p0 + 1);
1178 s = (char*)&mac->formkeys[mac->arity];
1181 for (n = 0; n < mac->arity; n++)
1183 mac->formkeys[n].name = s + (formargs[n] - p0);
1184 mac->formkeys[n].value = s + (formvals[n] - p0);
1189 for (n = 1; n < mac->arity; n++)
1193 if ((i0 & SYM_FUNCTION) != (sym->flags & SYM_FUNCTION) || old.arity != mac->arity || !streq(old.value, mac->value)) goto redefined;
1196 if (mac->formals) goto redefined;
1198 else if (mac->formals)
1203 for (n = 0; n < mac->arity; n++)
1204 if (!streq(mac->formkeys[n].name, old.formkeys[n].name) || !streq(mac->formkeys[n].value, old.formkeys[n].value))
1209 if (!streq(mac->formals, old.formals)) goto redefined;
1214 if (mac->formkeys) free(mac->formkeys);
1215 mac->formkeys = old.formkeys;
1220 if (mac->formals) free(mac->formals);
1221 mac->formals = old.formals;
1223 free(mac->value);
1224 mac->value = old.value;
1230 if ((pp.option & KEYARGS) && mac->formkeys)
1231 free(mac->formkeys);
1240 mac->value = newof(mac->value, char, (mac->size = p - mac->value) + 1, 0);
1248 if (mac->formals)
1249 ppprintf("%s", mac->formals);
1252 if ((p = mac->value) && *p)
1295 if (pp.macref) (*pp.macref)(sym, error_info.file, n2, mac ? error_info.line - n2 + 1 : REF_UNDEF, mac ? strsum(mac->value, (long)mac->arity) : 0L);
1335 tp = mac->tuple;
1336 if (!tp && !mac->value)
1355 tp->nomatch = mac->tuple;
1356 mac->tuple = tp;
1418 mac = sym->macro;
1419 mac->arity = 0;
1420 if (mac->value)
1425 if ((pp.option & KEYARGS) && mac->formkeys) free(mac->formkeys);
1428 free(mac->formals);
1429 mac->formals = 0;
1430 n = strlen(mac->value) + 1;
1442 if (mac->value) free(mac->value);
1443 mac->value = oldof(0, char, 0, c);
1445 strcpy(mac->value, pp.tmpbuf);
1773 if ((mac = sym->macro) && !(sym->flags & (SYM_ACTIVE|SYM_READONLY)))
1775 if (mac->formals) free(mac->formals);
1776 free(mac->value);
1777 free(mac);
2145 if (mac = var.symbol->macro)
2155 if (mac->formals) free(mac->formals);
2156 free(mac->value);
2157 free(mac);
2173 if (mac = sym->macro)
2181 if (mac->formals) free(mac->formals);
2182 free(mac->value);
2183 free(mac);
2184 mac = sym->macro = 0;