So I understand that typedefs are acceptable for opaque structs that can only be manipulated by accessor functions.
Is this the appropriate way to use opaque typedef structs that are self referential within the accessor functions?
typedef struct foo {
struct foo *bar;
int member;
} foo1;
foo1 * blah1 = (foo1*) malloc(...);
blah1->bar->member = 999;
The alternative is this:
typedef struct {
struct foo* bar;
int member;
}foo;
So when you do something like this:
foo * blah1 = (foo*) malloc(...);
blah1->bar->member = 999;
You'll get this error:
dereferencing pointer to incomplete type