How to make a structure extern and define its typedef
In C, structures have no linkage, only objects and functions do. So you can write this:
// header file 'node.h'
typedef struct node_
{
/* ... */
} node;
extern node root_node;
Then provide an implementation somewhere:
// source file
#include <node.h>
node root_node;
You can't make a struct extern
. Just define it in an include-guard protected header and include that header everywhere you need it.
EDIT for SquareRootOfTwentyThree
I use those therms in the following way:
A structure type definition describes the members that are part of the structure. It contains the struct keyword followed by an optional identifier (the structure tag) and a brace-enclosed list of members.
A structure declaration has the same form as a structure definition except the declaration does not have a brace-enclosed list of members.
So "definition" is exactly what I meant.