Using magic cookies for abstraction
Define a family of functions that knows about a particular kind of cookie
- One function (or more) allocates a magic cookie and returns (a pointer to) it
- Others act on the cookie, using it to store and retrieve state as needed
- One function (or more) deallocates it
Document the functions, not the cookie