C Interfaces and Implementations

Contents

Click on the parenthesized links to browse the named source files. (These files have no comments because the book explains them.)

  1. Introduction
    Literate Programs (double.c)
    Programming Style
    Efficiency
  2. Interfaces and Implementations
    Interfaces (arith.h)
    Implementations (arith.c)
  3. Atoms Download/view this chapter (PDF, 52K)
    Interface (atom.h)
    Implementation (atom.c)
  4. Exceptions and Assertions
    Interface (except.h)
    Implementation (except.c)
    Assertions (assert.h)
  5. Memory Management
    Interface (mem.h)
    Production Implementation (mem.c)
    Checking Implementation (memchk.c)
  6. More Memory Management
    Interface (arena.h)
    Implementation (arena.c)
  7. Lists
    Interface (list.h)
    Implementation (list.c)
  8. Tables
    Interface (table.h)
    Example: Word Frequencies (wf.c, getword.h, getword.c)
    Implementation (table.c)
  9. Sets
    Interface (set.h)
    Example: Cross-Reference Listings (xref.c, getword.h, getword.c)
    Implementation (set.c)
    Member Operations · Set Operations
  10. Dynamic Arrays
    Interfaces (array.h, arrayrep.h)
    Implementation (array.c)
  11. Sequences
    Interface (seq.h)
    Implementation (seq.c)
  12. Rings
    Interface (ring.h)
    Implementation (ring.c)
  13. Bit Vectors
    Interface (bit.h)
    Implementation (bit.c)
    Member Operations · Comparisons · Set Operations
  14. Formatting
    Interface (fmt.h)
    Formatting Functions · Conversion Functions
    Implementation (fmt.c)
    Formatting Functions · Conversion Functions
  15. Low-Level Strings
    Interface (str.h)
    Example: Printing Identifiers (ids.c)
    Implementation (str.c)
    String Operations · Searching Strings · Conversion Functions
  16. High-Level Strings
    Interface (text.h)
    Implementation (text.c)
    String Operations · Memory Management · Searching Strings · Conversion Functions
  17. Extended-Precision Arithmetic
    Interface (xp.h)
    Implementation (xp.c)
    Addition and Subtraction · Multiplication · Division and Comparison · Shifting · String Conversions
  18. 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
  19. 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
  20. 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