Index of /courses/undergraduate/201/source/libraries/think
Name Last modified Size Description
Parent Directory
exception.c 01-Sep-94 16:31 3k
exception.h 01-Sep-94 16:31 8k
extgraph.h 01-Sep-94 16:31 7k
gcalloc.h 01-Sep-94 16:31 8k
genlib.c 01-Sep-94 16:31 4k
genlib.h 01-Sep-94 16:31 6k
graphics.c 01-Sep-94 16:31 31k
graphics.h 01-Sep-94 16:31 5k
random.c 01-Sep-94 16:31 2k
random.h 01-Sep-94 16:31 2k
simpio.c 01-Sep-94 16:31 3k
simpio.h 01-Sep-94 16:31 2k
strlib.c 01-Sep-94 16:31 5k
strlib.h 01-Sep-94 16:31 7k
README file for the cslib/think directory
Last modified on Tue Aug 2 11:12:01 1994 by eroberts
------------------------------------------------------------------------
This directory contains the standard libraries used in conjunction with
This directory contains an implementation of the libraries used in
conjunction with "The Art and Science of C" (Addison-Wesley, 1995)
tailored for use with THINK C on the Apple Macintosh. With the
exception of the graphics library implementation, this package is
identical to the cslib/standard package.
In most implementations of the library package, the entire set of
library packages, including the graphics and random libraries, are
compiled together into a single library. On THINK C, the 32K segment
limit makes it impossible to put all of the libraries together and also
include the ANSI library, which must also be part of any project. At
Stanford, we solve the problem by separating the library into pieces.
The cslib.lib portion includes the genlib, simpio, strlib, and ANSI
packages, and therefore contains everything that most nongraphical
applications require. We then create two additional libraries,
graphics.lib and random.lib, which can be included by projects that
need them.
For THINK C, it is easiest to put the .h files for the extended library
somewhere in the system library tree so that students don't have to copy
them individually for each project they create. THINK C searches the
entire folder hierarchy rooted at the folder containing the THINK C
application; you can put these files anywhere in that tree.
Because the ANSI library supplied with THINK C is compiled with these
assumptions, it is also necessary to set the options in each THINK C
application to use 16-bit integers and make sure that enums are always
ints. Failure to set these options correctly can lead to extremely
hard-to-locate bugs. In addition, students will write much better code
if the "require prototypes" option is also set. These settings should
be made the default for new projects.
The settings used to compile the ANSI library in the are incompatible
with some of the more advanced toolbox interfaces. If you want, for
example, to provide your students with a library for working with
sounds, you will discover that you cannot include the Sound.h interface,
which requires 32-bit enumerations. It is possible to work around these
problems, but not without complicating the use of the libraries for more
conventional applications.
These libraries are in the public domain and may be freely copied and
distributed, although they remain under development. No warranties are
made concerning their correctness or stability, and no user support is
guaranteed. Bug reports and suggestions, however, are appreciated and
may be sent to
Eric Roberts <eroberts@cs.stanford.edu>