[getdns-api] getdns-api review - no brainers sections 2.2, 2.3, 2.6, 2.7

Willem Toorop willem at nlnetlabs.nl
Fri Jan 31 03:48:17 MST 2014


op 29-01-14 21:11, Goyal, Neel schreef:
> I strongly support the implementation of 2.2 (type aliases for opaque
> types),
> 
> typedef struct getdns_dict* getdns_dict_t; 
> typedef struct getdns_list* getdns_list_t;

Yes... unfortunately we just removed those typedefs, but this was
primarily to make the April 2013 spec consistent because it had a
typedef for the pointer to context (section 5.1):

typedef struct getdns_context_t *getdns_context_t

but for dicts and lists only the struct (not including the pointer).

typedef struct getdns_dict some_dict;
typedef struct getdns_list some_list;


Personally I feel more comfortable when I can "see" the pointers being
passed around.  So me personally would rather see this:

typedef struct getdns_context getdns_context;
typedef struct getdns_dict getdns_dict;
typedef struct getdns_list getdns_list;

or no typedefs at all. (the structs are opaque anyway).


But I can live with:

typedef struct getdns_context* getdns_context_t;
typedef struct getdns_dict* getdns_dict_t;
typedef struct getdns_list* getdns_list_t;

If it is everybody's preference.  At least it has the virtue that it
indicates that the types cannot be dereferenced by the user.

-- Willem



More information about the getdns-api mailing list