Chapter 2. Interfaces and Implementations

A module comes in two parts, its interface and its implementation. The interface specifies what a module does. It declares the identifiers, types, and routines that are available to code that uses the module. An implementation specifies how a module accomplishes the purpose advertised by its interface. For a given module, there is usually one interface, but there might be many implementations that provide the facilities specified by the interface. Each implementation might use different algorithms and data structures, but they all must meet the specification given by the interface.

A client is a piece of code that uses a module. Clients import interfaces; implementations export them. Clients need to see ...

Get C Interfaces and Implementations: Techniques for Creating Reusable Software 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.