1: # include "../ingres.h"
2:
3: /*
4: ** MCALL -- call a macro
5: **
6: ** This takes care of springing a macro and processing it for
7: ** any side effects. Replacement text is saved away in a static
8: ** buffer and returned.
9: **
10: ** Parameters:
11: ** mac -- the macro to spring.
12: **
13: ** Returns:
14: ** replacement text.
15: **
16: ** Side Effects:
17: ** Any side effects of the macro.
18: **
19: ** Called By:
20: ** go.c
21: ** proc_error
22: **
23: ** Compilation Flags:
24: ** none
25: **
26: ** Trace Flags:
27: ** 18
28: **
29: ** Diagnostics:
30: ** none
31: **
32: ** Syserrs:
33: ** none
34: **
35: ** History:
36: ** 8/10/78 (eric) -- broken off from go().
37: */
38:
39: char *
40: mcall(mac)
41: char *mac;
42: {
43: register char c;
44: register char *m;
45: register char *p;
46: static char buf[100];
47: extern char macsget();
48:
49: m = mac;
50:
51: # ifdef xMTR2
52: tTfp(18, -1, "mcall('%s')\n", m);
53: # endif
54:
55: /* set up to process the macro */
56: macinit(&macsget, &mac, FALSE);
57:
58: /* process it -- throw away result */
59: for (p = buf; (c = macgetch()) > 0; )
60: {
61: # ifdef xMTR2
62: if (tTf(18, 1))
63: putchar(c);
64: # endif
65: if (p < &buf[sizeof buf])
66: *p++ = c;
67: }
68:
69: *p = 0;
70:
71: return (buf);
72: }
Defined functions
mcall
defined in line
39; used 3 times