From 48a90f15013d57d7de4634744e154c46dd636130 Mon Sep 17 00:00:00 2001 From: Oliver Lehmann Date: Wed, 12 Jul 1989 08:20:19 +0000 Subject: [PATCH] ING_DB --- WEGA/contrib/ingres/dbs/src/monitor/mcall.c | 51 +++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 WEGA/contrib/ingres/dbs/src/monitor/mcall.c diff --git a/WEGA/contrib/ingres/dbs/src/monitor/mcall.c b/WEGA/contrib/ingres/dbs/src/monitor/mcall.c new file mode 100644 index 0000000..975e276 --- /dev/null +++ b/WEGA/contrib/ingres/dbs/src/monitor/mcall.c @@ -0,0 +1,51 @@ +# include +# include "gen.h" +# include "../h/dbs.h" + +/* +** MCALL -- call a macro +** +** This takes care of springing a macro and processing it for +** any side effects. Replacement text is saved away in a static +** buffer and returned. +** +** Parameters: +** mac -- the macro to spring. +** +** Returns: +** replacement text. +*/ +char *mcall(mac) +char *mac; +{ + static char buf[FILENAME + 1]; + register int c; + register char *p; + extern int macsget(); + +# ifdef xMTR2 + AAtTfp(18, -1, "MCALL: `%s'\n", mac); +# endif + + /* set up to process the macro */ + macinit(macsget, &mac, FALSE); + + /* process it -- throw away result */ + for (p = buf; (c = macgetch()) > 0; ) + { +# ifdef xMTR2 + if (AAtTf(18, 1)) + putchar(c); +# endif + if (p < &buf[sizeof buf]) + *p++ = c; + } + *p = 0; + +# ifdef xMTR2 + if (AAtTf(18, 1)) + putchar('\n'); +# endif + + return (buf); +}