Glossary

alignment

A requirement that data elements begin at certain boundaries in memory. For example, given an 8-bit alignment requirement, a struct holding a 1-bit char followed by an 8-bit int might need 7 bits of padding after the char so that the int starts on an 8-bit boundary.

ASCII

American Standard Code for Information Interchange. A standard mapping from the naïve English character set to the numbers 0–127. Tip: on many systems, man ascii will print the table of codes.

automatic allocation

For an automatically allocated variable, its space in memory is allocated by the system at the point of the variable’s declaration, then removed at the end of the given scope.

Autotools

A set of programs from GNU that simplify automatic compilation on any system, including Autoconf, Automake, and Libtool.

Benford’s law

Leading digits in a wide range of data sets tend to have a log-like distribution: 1 has about 30% frequency, 2 about 17.5%, … 9 about 4.5%.

Boolean

True/false. Named after George Boole, an English mathematician living in the early-to-mid 1800s.

BSD

Berkeley Software Distribution. An implementation of POSIX.

callback function

A function (A) that is sent as an input to another function (B) so that function B can call function A over the course of its operation. For example, generalized sort functions typically take as input a function to compare two elements.

call graph

A box-and-arrow diagram showing which functions call and are called by which other functions.

cetology

The study of whales.

compiler

Formally, the program that converts the (human-readable) text of a program into (human-illegible) machine instructions. Often used to refer to the preprocessor + compiler + linker.

debugger

A program for interactive execution of a compiled program, allowing users to pause the program, check and modify variable values, et cetera. Often useful for understanding bugs.

deep copy

A copy of a structure containing pointers, which follows all pointers and makes copies of the pointed-to data.

encoding

The means by which human-language characters are converted into numeric codes for processing by the computer. See also ASCII, multibyte encoding, and wide-character encoding.

environment variable

A variable present in the environment of a program, set by the parent program (typically the shell).

external pointer

See opaque pointer.

floating point

A representation of a number akin to scientific notation, like 2.3×10^4, with an exponent part (in this example, 4) and a mantissa (here, 2.3). After writing down the mantissa, think of the exponent allowing the decimal point to float to its correct position.

frame

The space in the stack in which function information (such as inputs and automatic variables) is stored.

GDB

GNU debugger.

global

A variable is global when its scope is the entire program. C doesn’t really have global scope, but if a variable is in a header that can reasonably be expected to be included in every code file in a program, then it is reasonable to call it a global variable.

glyph

A symbol used for written communication.

GNU

Gnu’s Not Unix.

GSL

GNU Scientific Library.

heap

The space of memory from which manually allocated memory is taken. Compare with the stack.

IDE

Integrated development environment. Typically a program with a graphical interface based around a text editor, with facilities for compilation, debugging, and other programmer-friendly features.

integration test

A test that executes a sequence of steps that involve several segments of a code base (each of which should have its own unit test).

library

Basically, a program that has no main function, and is therefore a set of functions, typedefs, and variables available for use by other programs.

linker

The program that joins together disparate portions of a program (such as separate object files and libraries) and thus reconciles references to external-to-one-object-file functions or variables.

Linux

Technically, an operating system kernel, but generally used to refer to a full suite of BSD/GNU/Internet Systems Consortium/Linux/Xorg/… utilities bundled as a unified package.

macro

A (typically) short blob of text for which a (typically) longer blob is substituted.

manual allocation

Allocation of a variable on the heap at the programmer’s request, using malloc or calloc, and freed at the user’s request via free.

multibyte encoding

An encoding of text that uses a variable number of chars to represent a single human-language character. Contrast with wide-character encoding.

mutex

Short for mutual exclusion, a structure that can be used to ensure that only one thread is using a resource at a time. 

NaN

Not-a-Number. The IEEE 754 (floating-point) standard defines this as the outcome of mathematical impossibilities like 0/0 or log(-1). Often used as a flag for missing or bad data.

object

A data structure and the associated functions that act on the data structure. Ideally, the object encapsulates a concept, providing a limited set of entry points for other code to interact with the object.

object file

A file containing machine-readable instructions. Typically the result of running a compiler on a source code file.

opaque pointer

A pointer to data in a format that can’t be read by the function handling the pointer, but that can be passed on to other functions that can read the data. A function in a scripting language might call one C function that returns an opaque pointer to C-side data, and then a later function in the scripting language would use that pointer to act on the same C-side data.

POSIX

The Portable Operating System Interface. An IEEE standard to which UNIX-like operating systems conform, describing a set of C functions, the shell, and some basic utilities.

preprocessor

Conceptually, a program that runs just before the compiler, executing directives such as #include and #define. In practice, typically a part of the compiler.

process

A running program.

profiler

A program that reports where your program is spending its time, so you know where to focus your efforts at speedup.

pthread

POSIX thread. A thread generated using the C threading interface defined in the POSIX standard.

RNG

Random number generator, where random basically means that one can reasonably expect that a sequence of random numbers is not systematically related to any other sequence.

RTFM

Read the manual.

Sapir-Whorf Hypothesis

The claim that the language we speak determines the thoughts we are capable of having. Its weakest form, that we often think in words, is obvious; its strongest form, that we are incapable of thoughts that our language lacks words or constructions for, is clearly false.

scope

The portion of the code base over which a variable is declared and accessible. Good coding style depends on keeping the scope of variables small.

segfault

Segmentation fault.

segmentation fault

Touching an incorrect segment of memory. Causes the operating system to halt the program immediately, and so often used metonymically to refer to any program-halting error.

SHA

Secure Hash Algorithm.

shell

A program that allows users to interact with an operating system, either at a command line or via scripts.

SQL

Structured Query Language. A standardized means of interacting with databases.

stack

The space in memory where function execution occurs. Notably, automatic variables are placed here. Each function gets a frame, and every time a subfunction is called, its frame is conceptually stacked on top of the calling function’s frame.

static allocation

The method by which variables with file scope and variables inside functions declared as static are allocated. Allocation occurs before the program starts, and the variable continues to exist until the end of the program.

test harness

A system for running a sequence of unit tests and integration tests. Provides easy setup and teardown of auxiliary structures, and allows for checking of failures that may (correctly) halt the main program.

thread

A sequence of instructions that a computer executes independently of any other thread.

token

A set of characters to be treated as a semantic unit, such as a variable name, a keyword, or an operator like * or +. The first step in parsing text is to break it down into tokens; strtok_r and strtok_n are designed for this.

type punning

Casting a variable of one type to a second type, thus forcing the compiler to treat the variable as data of the second type. For example, given struct {int a; char *b:} astruct, then (int) astruct is an integer (but for a safer alternative, see “C, with fewer seams”). Frequently not portable; always bad form.

type qualifier

A descriptor of how the compiler may handle a variable. Is unrelated to the type of the variable (int, float, et cetera). C’s only type qualifiers are const, restrict, volatile, and _Atomic.

union

A single block of memory that can be interpreted as one of several types.

unit test

A block of code to test a small piece of a code base. Compare with integration test.

UI

User interface. For a C library, this includes the typedefs, macro definitions, and function declarations that users are expected to be comfortable with when using the library.

UTF

Unicode Transformation Format.

variadic function

A function that takes in a variable number of inputs (e.g., printf).

wide-character encoding

An encoding of text where each human-language character is given a fixed number of chars. For example, UTF-32 guarantees that each Unicode character is expressed in exactly 4 bytes. Contrast this definition with multibyte encoding.

XML

Extensible Markup Language.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.122.11