1.1 | Example of an annotated listing | 11 |
1.2 | UML-based diagram notation | 12 |
2.1 | The Unix echo program | 21 |
2.2 | Expanding tab stops (declarations) | 26 |
2.3 | Expanding tab stops (main part) | 27 |
2.4 | The getopt manual page | 29 |
2.5 | Expanding tab stops (supplementary functions) | 36 |
2.6 | The goto statement used for a common error handler | 43 |
2.7 | The use of goto to reexecute code | 44 |
2.8 | Exiting a loop using the goto statement | 45 |
2.9 | A conditional expression formatted like an if statement (left) and like cascading if--else statements (right) | 47 |
2.10 | Location detection code replacing the conditional expression | 48 |
2.11 | Binary search implementation | 56 |
2.12 | Maintaining the binary search invariant | 58 |
3.1 | Pointer access for an array-based stack | 65 |
3.2 | Parameterization using function arguments | 68 |
3.3 | Accessing internal type representation using a union | 84 |
3.4 | Dynamic storage allocation | 85 |
3.5 | Memory allocation readjustment | 86 |
4.1 | A structure pointer as a table cursor | 102 |
4.2 | A pointer-based matrix | 104 |
4.3 | Explicit matrix element access | 105 |
4.4 | A stack abstract data type | 106 |
4.5 | A queue with an explicit element count | 110 |
4.6 | Table-driven program operation | 112 |
4.7 | Hash function and hash table access | 115 |
4.8 | Linked list definition and basic operations | 118 |
4.9 | A singly linked list | 118 |
4.10 | A doubly linked list | 121 |
4.11 | Adding an element in a doubly linked list | 123 |
4.12 | A circular linked list | 123 |
4.13 | A hash table of linked lists | 124 |
4.14 | A binary tree of name server Internet addresses | 127 |
4.15 | Parse tree generated by lint for kp->flags & F-NEEDARG && !(ip->arg = *++*argvp) | 130 |
4.16 | Graph nodes accessed through an array of linked lists | 133 |
4.17 | A three-node graph and its representation in tsort | 134 |
4.18 | A simple call graph | 136 |
4.19 | A call graph represented as a gprof data structure | 136 |
4.20 | Program dependencies represented by a Makefile | 138 |
4.21 | Program dependencies represented in a make data
structure | 138 |
5.1 | Bourne shell command grammar | 144 |
5.2 | Recursively printing the parsed command tree | 146 |
5.3 | Recursive descent parser for shell commands | 148 |
5.4 | Tail recursion used instead of a loop | 149 |
5.5 | Exception handling in Java | 150 |
5.6 | Exception propagation across method calls | 152 |
5.7 | Work crew multithreaded code | 157 |
5.8 | Boss/worker multithreaded code | 158 |
5.9 | A code block protected by mutual exclusion locks | 158 |
5.10 | Spawning off a separate process to send mail | 160 |
5.11 | Potential security hole created by passing unverified arguments to the shell | 161 |
5.12 | Pipeline to summarize a list of compressed manual page files | 161 |
5.13 | Thread synchronization in Java | 164 |
5.14 | A signal handler and its installation | 165 |
5.15 | Avoiding nonreentrant code in a signal handler | 166 |
5.16 | Race conditions introduced by a signal handler | 167 |
5.17 | Synchronous handling of signals | 169 |
5.18 | A nonlocal jump using longjmp | 170 |
5.19 | Setting mutual exclusion regions to protect data structures | 171 |
5.20 | Macros using locally defined variables | 175 |
6.1 | The source code tree structure of the apache Web server | 182 |
6.2 | The NetBSD kernel main source tree | 184 |
6.3 | The Linux kernel source tree | 185 |
6.4 | The source tree of the architecture-specific part of the NetBSD kernel | 187 |
6.5 | The FreeBSD system source tree | 188 |
6.6 | The steps of a typical build process | 189 |
6.7 | A typical set of project dependencies | 190 |
6.8 | Representative dependencies in the apache Web server | 191 |
6.9 | Makefile from the apache Web server | 193 |
6.10 | The ant build file written in XML | 197 |
6.11 | The configuration process of GNU autoconf | 200 |
6.12 | Revision tree and symbolic names for the file cat.c | 204 |
6.13 | Sample RCS/CVS log output | 208 |
6.14 | Tools used in building the IBM 3270 terminal emulator | 213 |
6.15 | javadoc comments embedded in a Java file | 215 |
6.16 | Using the JUnit test framework | 221 |
7.1 | Wrong tab settings used in Java code | 229 |
8.1 | TCP connection diagram | 247 |
8.2 | The first page of the perlguts manual | 250 |
8.3 | ASCII drawings in source code comments | 257 |
8.4 | A mathematical proof in a source code comment | 258 |
8.5 | Documentation in mdoc format | 261 |
8.6 | Documentation in Texinfo format | 262 |
9.1 | A blackboard in the apache Web server | 270 |
9.2 | Remote procedure calls in the yp/NIS implementation | 272 |
9.3 | Data-flow diagram for creating manual page descriptions | 274 |
9.4 | The filter-based implementation of the makewhatis command | 274 |
9.5 | A class representation in UML | 276 |
9.6 | Simple generalization relationships | 277 |
9.7 | Realization and generalization relationships | 278 |
9.8 | A file write operation: from a user program to the device | 280 |
9.9 | Examples of program slicing | 284 |
9.10 | Implicit event registration and handling in Xt | 287 |
9.11 | Explicit handling of Microsoft Windows messages | 288 |
9.12 | The BSD Unix swap process scheduler | 290 |
9.13 | Code for a state machine | 292 |
9.14 | UML state transition diagram for a state machine | 293 |
9.15 | An nvi editor module | 294 |
9.16 | Namespace definition and use in C++ | 298 |
9.17 | Package definition and use in Java | 298 |
9.18 | Declaration of a C++ class for the CRC algorithm | 300 |
9.19 | The Java class for the input stream of an HTTP post operation | 301 |
9.20 | Runtime polymorphism in C++ | 307 |
9.21 | Operator overloading in C++ | 310 |
9.22 | Declaration of a Perl directory access class | 311 |
9.23 | An object class with a shared method table implemented in C | 314 |
9.24 | The library-structured rayshade program | 321 |
9.25 | The process structure of the GNU compiler system | 324 |
9.26 | A simple JavaBean servlet component | 326 |
9.27 | Using a JavaBean in a Java server page | 326 |
9.28 | Use of a Singleton pattern in Java document renderer | 333 |
9.29 | A C++ Singleton template | 333 |
9.30 | Reading the DHCP daemon configuration file | 334 |
9.31 | Reading the DNS specifications | 334 |
9.32 | Compiling a time-zone file | 334 |
9.33 | Parsing an SQL SELECT statement | 335 |
9.34 | The sed command interpreter | 335 |
10.1 | Regular expression matches | 342 |
10.2 | Generating tags from Visual Basic source files | 344 |
10.3 | Bird's-eye view of source code using Microsoft Word | 345 |
10.4 | Changing an identifier name under RCS control | 349 |
10.5 | Comparing files: output of the diff -c command | 356 |
10.6 | Locating code blocks with incorrect indentation | 358 |
10.7 | A signature survey of Java code | 359 |
10.8 | Symbol listing generated by the Microsoft Macro Assembler | 362 |
10.9 | Object code symbols (Unix nm) | 363 |
10.10 | Object code symbols (Windows dumpbin) | 363 |
10.11 | Microsoft Visual Studio source browser on troff classes | 366 |
10.12 | Sample output from the LXR Web-based source browser | 367 |
10.13 | The source code of rmdir typeset by using vgrind | 369 |
10.14 | Output from the trace program under MS-DOS | 370 |
10.15 | The Microsoft Windows API Spy program | 371 |
10.16 | Output from the strace program under Linux | 371 |
10.17 | Basic block count output from gprof | 373 |
11.1 | The moon phase algorithm transcribed into Java | 389 |