struct _host { int status; str name; }; typedef struct _host host; void host_free(host *); host host_copy(host *); #define T host // <- custom type #include // functions to implement void host_free(host *h) { str_free(&h->name); } host host_copy(host *h) { host _ = *h; _.name = str_copy(&h->name); return _; }