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