Back: A Loadable Module Forward: Integrating Dmalloc FastBack:
Integrating Dmalloc Up: A Complex GNU Autotools Project
FastForward: M4 Top: Autoconf, Automake, and Libtool Contents:
Table of Contents Index: Index About: About this document  20.3
Interpreting Commands from a File  For all practical purposes,
any interpreter is pretty useless if it only works
interactively. I have added a `source' built-in command to
`sic_builtin.c' which takes lines of input from a file and
evaluates them using `sic_repl.c' in much the same way as lines
typed at the prompt are evaluated otherwise. Here is the built-
in handler:  /* List of built in functions. */ #define
builtin_functions               \         BUILTIN(exit,
0, 1)   \         BUILTIN(load,           1, 1)   \
BUILTIN(source,         1, -1)  \         BUILTIN(unload,
1, -1)    int status = SIC_OKAY;   int i;    for (i = 1; status
== SIC_OKAY && argv[i]; ++i)     status = source (sic, argv[i]);
return status;  And the source function