struct List // this should be in list.h { }; extern struct List *pList_emptylist; // in list.h // provider-only definitions struct _Listnode; struct _List { struct _Listnode *first; }; struct _List _List_emptylist = { NULL }; struct List *pList_emptylist = (struct List *)&_List_emptylist; struct _Listnode { char firstvalue; // we can change this type struct _List rest; // where is the next one? };
There is a difference between a struct _List
and a
struct _Listnode
. The first represent an entire list, whereas
the second represent a component of a list. The published type
struct List
is a mask of struct _List
. This means that
struct _Listnode
has no exposure to consumer code.