// header widget.h
typedef struct widget Widget;
// functions for widgets
Widget *create_widget(...);
void destroy_widget(Widget *);
int use_widget_somehow(Widget *, ...);
// header widget_impl.h (if more than one implementation file needed
// otherwise this goes in widget.c
#include "widget.h"
// internal layout of widget struct
struct widget {
char *name;
int stuff;
...
};
// declare common internal functions used by more than one widget file
void super_secret_widget_func(Widget *);
// widget1.c
#include "widget_impl.h"
// implement widget functions...