Contents
Click on the parenthesized links to browse the named source files. (These files have no comments because the book explains them.)
- Introduction
Literate Programs (double.c)
Programming Style
Efficiency - Interfaces and Implementations
Interfaces (arith.h)
Implementations (arith.c) - Atoms Download/view this chapter (PDF, 52K)
Interface (atom.h)
Implementation (atom.c) - Exceptions and Assertions
Interface (except.h)
Implementation (except.c)
Assertions (assert.h) - Memory Management
Interface (mem.h)
Production Implementation (mem.c)
Checking Implementation (memchk.c) - More Memory Management
Interface (arena.h)
Implementation (arena.c) - Lists
Interface (list.h)
Implementation (list.c) - Tables
Interface (table.h)
Example: Word Frequencies (wf.c, getword.h, getword.c)
Implementation (table.c) - Sets
Interface (set.h)
Example: Cross-Reference Listings (xref.c, getword.h, getword.c)
Implementation (set.c)
Member Operations · Set Operations - Dynamic Arrays
Interfaces (array.h, arrayrep.h)
Implementation (array.c) - Sequences
Interface (seq.h)
Implementation (seq.c) - Rings
Interface (ring.h)
Implementation (ring.c) - Bit Vectors
Interface (bit.h)
Implementation (bit.c)
Member Operations · Comparisons · Set Operations - Formatting
Interface (fmt.h)
Formatting Functions · Conversion Functions
Implementation (fmt.c)
Formatting Functions · Conversion Functions - Low-Level Strings
Interface (str.h)
Example: Printing Identifiers (ids.c)
Implementation (str.c)
String Operations · Searching Strings · Conversion Functions - High-Level Strings
Interface (text.h)
Implementation (text.c)
String Operations · Memory Management · Searching Strings · Conversion Functions - Extended-Precision Arithmetic
Interface (xp.h)
Implementation (xp.c)
Addition and Subtraction · Multiplication · Division and Comparison · Shifting · String Conversions - Arbitrary-Precision Arithmetic
Interface (ap.h)
Example: A Calculator (calc.c)
Implementation (ap.c)
Negation and Multiplication · Addition and Subtraction · Division · Exponentiation · Comparisons · Convenience Functions · Shifting · String and Integer Conversions - Multiple-Precision Arithmetic
Interface (mp.h)
Example: Another Calculator (mpcalc.c)
Implementation (mp.c)
Conversions · Unsigned Arithmetic · Signed Arithmetic · Convenience Functions · Comparisons and Logical Operations · String Conversions - Threads
Interfaces
Threads (thread.h) · General Semaphores (sem.h) · Synchronous Communication Channels (chan.h)
Examples
Sorting Concurrently (sort.c) · Critical Regions (spin.c) · Generating Primes (sieve.c)
Implementations
Synchronous Communication Channels (chan.c) · Threads (thread.c) · Thread Creation and Context-Switching (thread.c, swtch.s) · Preemption · General Semaphores (thread.c) · Context-Switching on the MIPS and ALPHA
- Interface Summary
Bibliography
Index