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:

 

And the source function from `sic_repl.c':

 

The reason for separating the source function in this way, is that it makes it easy for the startup sequence in main to evaluate a startup file. In traditional Unix fashion, the startup file is named `.sicrc', and is evaluated if it is present in the user's home directory:

 


This document was generated by Joost van Baal on March, 17 2004 using texi2html