There are two different approaches that shall be used to define the data structures containing the private data for an ADT:
/* Definition of the pdf_foo_t ADT */
struct pdf_foo_s
{
int data_a;
int data_b;
};
and then a typedef that defines pdf_foo_t as a pointer to that
structure:
typedef struct pdf_foo_s *pdf_foo_t;
typedef struct pdf_foo_s pdf_foo_t;
This alternative is indicated in the case where the private data of the ADT is small, allowing the developer to allocate instances of the ADT in the stack and thus avoiding fragmentation of the heap.
Note that both alternatives allow to copy a reference using the C assignation operator, like in:
reference_to_adt_instance1 = adt_instance1;