Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
The standard C library
Plauger P., Prentice-Hall, Inc., Upper Saddle River, NJ, 1992. Type: Book (9780131315082)
Date Reviewed: Aug 1 1992

Although many books have been devoted to the C language, to my knowledge this book is the first work exclusively about the standard C library. Its ambitious goals make this book unique. The author, a well-known computer science writer, explains how to use each function from the standard C library as well as how to build a library, both generally and in C. For this reason, his code implementing the standard C library is accompanied by many explanations of the trickery involved, which will be useful to both users and implementors.

The book is structured in 16 chapters, similarly to the ISO C library standard. After the introduction, each chapter is dedicated to a header file: <assert.h>, <ctype.h>, <errno.h>, <float.h>, <limits.h>, <locale.h>, <math.h>, <setjmp.h>, <signal.h>, <stdarg.h>, <stddef.h>, <stdio.h>, <stdlib.h>, <string.h>, and <time.h>.

The introduction is structured in the same way as all of the remaining chapters. The “Background” section defines the fundamental terms “library,” “header,” “compiler,” and “librarian” and gives some guidelines for the design of a portable C library. Excerpts from the ISO C standard about standard headers, reserved identifiers, and use of the library functions (sections 7.1.1, 7.1.2, 7.1.3, and 7.1.7) are presented in the next section. “Using the Library” explains how to use library headers and how to create names in a program. “Implementing the Library” lists the assumptions one must conform to if one wants to use the implementation code from the book: some coding style rules and guidelines relate to the implementation of the header files. Some useful considerations on different testing methods derived from the author’s practical experience conclude the chapter.

Each of the remaining chapters is organized in seven sections. “Background” contains definitions of terms, basic elements, and problems relating to the header file it covers. The author’s goals, non-goals, and portability considerations relating to the implementation given in the book are presented. Based on his experience as a member of the ANSI standardizing committee X3J11 (which developed the X3.159-1989 standard for the C language), the author comments on the reasons some elements have been included in the standard. All this material, together with the historical considerations on the evolution of the header’s concepts in the context of the evolution of the UNIX operating system, makes the book pleasant reading.

The section on “What the C Standard Says” presents excerpts from the relevant portions of the ISO C standard, ISO 9899:1990, that contain information about the header.

In the next three sections, the interested reader will find practical advice on how to use the header and how to avoid some surprises. The “Using the Header” section describes and exemplifies some details concerning the use of each function from the header: this information makes the standard more readable. Also, Plauger justifies and exemplifies different ways of using it and gives programming guidelines.

The section on “Implementing the Header” presents a working implementation of the header file and of each function. In this section, the author tries to make a tradeoff between the highly parametrized form of the code, which makes it more portable, and making it readable. Because one of the author’s goals is to make the code as readable as possible, all the subtleties involved are explained and commented. Alternative implementations are also discussed. For those who want to use the code, Plauger lists his assumptions. Where appropriate, he presents the lessons he learned from his experience relating to the portability of the library across different computing environments.

The “Testing the Header” section presents some simple programs that test some or all of its features. The author’s main intent is to test the external behavior of each function from the header, so the expected results are given. He also tests for the implementation errors he believes to be the most common.

The “References” section lists and comments on the most significant references. The “Exercises” section gives some exercises in increasing order of difficulty. Because the author’s intent was not to write a tutorial, the exercises do not have answers.

The book ends with three appendices and a general index. Appendix A is a detailed treatment of topics related to the portability of the implementation code presented in the book. Two internal headers that summarize the environmental dependencies of the library are presented and exemplified for three execution environments--DEC VAX ULTRIX, GNU C under SunOS, and Borland Turbo C++. In Appendix B, the names of the entities defined in the author’s implementation of the library are indexed relative to the header, source file, and the page where they are defined. Definitions of terms with special meaning within the book are listed in AppendixC.

Except for the few spelling errors, the book is well written. The layout and typographical design are nice. On every page, the main ideas from the text are emphasized at the left. This typesetting style is useful for readers who use the book as a reference.

I recommend this book to those who want to learn the art of building libraries, particularly in C. The book could be useful as a university text. I also recommend this book to those who want to improve their programming skills by studying tight, professionally written library source code and by learning from the programming guidelines given by the author. The book will also be useful for experienced programmers, who will find the guidelines they need to use some pioneering features of the standard C library, such as locales, multibyte characters, and wide characters.

Reviewer:  Carmen Curelet-Balan Review #: CR115787
Bookmark and Share
 
Logic Programming (D.1.6 )
 
 
Formal Definitions And Theory (D.3.1 )
 
 
Processors (D.3.4 )
 
Would you recommend this review?
yes
no
Other reviews under "Logic Programming": Date
Parallel logic programming
Tick E. (ed), MIT Press, Cambridge, MA, 1991. Type: Book (9780262200875)
Aug 1 1992
Logic and objects
McCabe F., Prentice-Hall, Inc., Upper Saddle River, NJ, 1992. Type: Book (9780135360798)
Nov 1 1993
Constructing logic programs
Jacquet J. (ed), John Wiley & Sons, Inc., New York, NY, 1993. Type: Book (9780471937890)
Jan 1 1996
more...

E-Mail This Printer-Friendly
Send Your Comments
Contact Us
Reproduction in whole or in part without permission is prohibited.   Copyright 1999-2024 ThinkLoud®
Terms of Use
| Privacy Policy