Allocation and deallocation
Because user code deals with pointers, all objects must be allocated and deallocated inside the implementation
- struct Token *Token_make(FILE *f) {
struct Token *tp =
malloc(sizeof(struct Token));
/* ... */
return tp;
}
- void Token_destroy(struct Token *tp)
{ free(tp->s); free(tp); }