This section gives a very simple external module which displays an oscillating mesh. To try out this example, make a copy of the file example1.c (it is distributed with Geomview in the doc subdirectory) in your directory and compile it with the command
cc -o example1 example1.c -lm
Then put the line
(emodule-define "Example 1" "./example1")
in a file called .geomview in your current directory. Then invoke Geomview; it is important that you compile the example program, create the .geomview file, and invoke Geomview all in the same directory. You should see "Example 1" in the Modules browser of Geomview's Main panel; climl#OOGL-File-Formats">OOGL File Formats, and see GCL, for an explanation of the format of the data in these commands.
The main program, at the bottom of the file, first calls
Initialize(). Next, the call to LakeDefine defines the
Lake that the lisp library will use. A Lake is a
structure that the lisp library uses internally as a type of
communiation vehicle. (It is like a unix stream but more general, hence
the name.) This call to LakeDefine defines a Lake
structure for doing I/O with stdin and stdout. The third
argument to LakeDefine should be NULL for external modules
(it is used by Geomview). Finally, the program enters its main loop
which parses and evaluates expressions from standard input.