liveBook · Manning

Function pointer type

A function pointer is a value that designates a callable function and can be stored, passed, or invoked indirectly.

How 4 Manning books explain it

Modern C

A function pointer is a pointer value that designates a function and can be passed to or invoked by other code.

How it is used
Deploys function pointers for callbacks, generic searching and sorting, selectable logging behavior, and thread entry functions.
How deep it goes
Explains decay, declaration syntax, invocation forms, generic callbacks, and exact type matching, with detailed comparison examples.
Examples
Uses atexit declarations, equivalent calls, qsort comparisons, logging tables, and thrd_create callbacks as concrete examples.
What you can do after
Apply it via C callback interfaces, typedef readable signatures, implement comparison functions, and select functions through pointer variables or tables.

Read how Modern C explains function pointer type →

Modern C, Third Edition

A function pointer is a C pointer value that designates a function and can be used to invoke or pass that function indirectly.

How it is used
Deploys function pointers for indirect calls, callbacks, generic algorithms, configurable behavior, and thread entry functions.
How deep it goes
Explains decay, declaration syntax, equivalent calls, callback contracts, and exact matching, while stopping short of broader pointer internals.
Examples
Uses equivalent call expressions, qsort and bsearch comparison functions, configurable loggers, and thrd_create callbacks.
What you can do after
Build callback-based C interfaces and apply qsort, bsearch, logging, or thread creation with correctly matched function types.

Read how Modern C, Third Edition explains function pointer type →

Refactoring to Rust

A function pointer is a value that refers to a callable function and can be passed as an argument or stored for later invocation.

How it is used
Uses function pointers to register callbacks across the NGINX HTTP FFI boundary.
How deep it goes
Defines the Rust and C callback signatures and demonstrates invocation, but defers general function-pointer behavior beyond this FFI case.
Examples
Demonstrates `read_body_handler` passed as `Some(...)` to NGINX request-body parsing.
What you can do after
Apply it via Rust FFI by declaring a C-compatible callback type and passing a matching handler to an API.

Read how Refactoring to Rust explains function pointer type →

Rust in Action: Systems programming concepts and techniques

A function pointer is a value that identifies a function and can be passed or stored so that the function can be invoked indirectly.

How it is used
Supplies callbacks that an operating system can invoke, particularly registered signal handlers.
How deep it goes
Explains executable-code addresses, pointer casts, and function signatures through small programs; does not develop a general callback API.
Examples
Uses an address-printing `noop` program and a `libc::signal` shutdown-handler program.
What you can do after
Apply it via `libc::signal` to register a handler and recognize why the example casts its function address.

Read how Rust in Action: Systems programming concepts and techniques explains function pointer type →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.