[getdns-api] typedefs for structs

Willem Toorop willem at nlnetlabs.nl
Wed Nov 20 16:30:43 CET 2013


In the current API typedef for structs usage seems inconsistent.

getdns_context_t is defined as pointer type: struct getdns_context_t *
by typedef struct getdns_context_t *getdns_context_t;

But the other structs (getdns_bindata, getdns_dict and getdns_list) just
have an equally named alias for the struct:

typedef struct getdns_bindata getdns_bindata;
typedef struct getdns_dict getdns_dict;
typedef struct getdns_list getdns_list;

Furthermore, those typedefs are not used in the function prototypes at
all whilst the getdns_context_t struct is used *only* by its typedef name.

Is there a reason for this inconsistency?

Personally I would prefer loosing the typedefs and use all struct types
explicitly as structs in the API function prototypes.

What do you think?
_______________________________________________
getdns-api mailing list
getdns-api at vpnc.org



More information about the spec mailing list