7.3. A Sample Shell Application

What I need now is a program that uses 'libsic.a', if only to give me confidence that it is working. In this section, I write a simple shell that uses the library. But first, I create a directory to put it in:

$ mkdir src
$ ls -F
COPYING  Makefile.am  aclocal.m4  configure*    config/   sic/
INSTALL  Makefile.in  bootstrap*  configure.in  replace/  src/
$ cd src

To put this shell together, we need to provide just a few things for integration with 'libsic.a'.

7.3.1. 'sic_repl.c'

In 'sic_repl.c' (Read Eval Print Loop), there is a loop for reading strings typed by the user, evaluating them, and printing the results. GNU readline is ideally suited to this, but it is not always available—or sometimes people just may not want ...

Get GNU Autoconf, Automake, and Libtool now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.