Go to the first, previous, next, last section, table of contents.

IC File Formats and Management

This section explains how IC deals with multiple source files.

C Programs

All files containing C code must be named with the ".c" suffix.

Loading functions from more than one C file can be done by issuing commands at the IC prompt to load each of the files. For example, to load the C files named foo.c and bar.c:

C> load foo.c
C> load bar.c

Alternatively, the files could be loaded with a single command:

C> load foo.c bar.c

If the files to be loaded contain dependencies (for example, if one file has a function that references a variable or function defined in the other file), then the second method (multiple file names to one load command) or the following approach must be used.

List Files

If the program is separated into multiple files that are always loaded together, a "list file" may be created. This file tells IC to load a set of named files. Continuing the previous example, a file called gnu.lis can be created containing the following lines.:

foo.c
bar.c

Then typing the command load gnu.lis from the C prompt would cause both foo.c and bar.c to be loaded.

File and Function Management

Unloading Files

When files are loaded into IC, they stay loaded until they are explicitly unloaded. This is usually the functionality that is desired. If one of the program files is being worked on, the other ones will remain in memory so that they don't have to be explicitly re-loaded each time the one undergoing development is reloaded.

However, suppose the file foo.c is loaded, which contains a definition for the function main. Then the file bar.c is loaded, which happens to also contain a definition for main. There will be an error message, because both files contain a main. IC will unload bar.c, due to the error, and re-download foo.c and any other files that are presently loaded.

The solution is to first unload the file containing the main that is not desired, and then load the file that contains the new main:

C> unload foo.c
C> load bar.c

Go to the first, previous, next, last section, table of contents.