Fear of the void
Posted Jun 22, 2004 12:46 UTC (Tue) by
steve_rotolo (guest, #15915)
Parent article:
Fear of the void
Consider the following interface:
struct funky; // forward decl
struct funky * funky_alloc (void);
void funky_dealloc (struct funky *);
int funky_dowhatever (struct funky *);
No magic, just C. The structure is private. All the user sees is pointers but the pointers are typed so the compiler can do the "magic" checking. Keep it simple.
(
Log in to post comments)