code reading dds

Code ReadingFigures

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

Book homepage | Author homepage

Valid XHTML 1.0! Level Triple-A conformance icon, W3C-WAI Web Content Accessibility Guidelines 1.0 (C) Copyright 2000-2003 D. Spinellis. May be freely uploaded by WWW viewers and similar programs. All other rights reserved.
Last modified: 2003.05.15