CHAPTER 7

The Function Interface Standard

All functions in the Companion Library and all routines presented in the text share a common interface standard. This standard has some impact on the efficiency of the programs, but, more importantly, it affects the efficiency of the programmer. Where there was a conflict, I chose to make the functions easier to remember and easier to use. Many parts of the standard–for example, the conventions on capitalization–are arbitrary, in the sense that another standard would serve equally well. The standard has been worked out to make the memorization task easier. For example, when a function requires both an input and an output vector, the input is first, followed by the output, in the argument list. This rule is always followed. The opposite rule would work just as well. However, if there were no rule at all, it would be more difficult to keep the argument sequence in mind. The only purpose of the standard is to make the programmer's job easier, in part by enhancing readability of the code.

7.1 HEADER FILES AND FUNCTION PROTOTYPES

Every routine in the Companion Library has a function prototype in one of the header files, using the modern ANSI standard style. The header files have names like numeric.inc. The three-letter file extension is chosen as an abbreviation for include. The usual convention in the C language for header files is .h; the .inc extension is used for the Companion Library to avoid name conflicts with other libraries.

Some of ...

Get Signal Processing in C now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.