You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Compliant Solution

In the first compilation module, which is included by the user, the abstract data type is declared as a pointer to a struct. The struct is declared as an incomplete type.

struct string_mx;

typedef struct string_mx *string_m;

In the "private" compilation unit struct string_mx is fully defined but non-visible to a user of the API.

struct string_mx {
    size_t size;
    size_t maxsize;
    unsigned char strtype;
    char *cstr;
};
  • No labels