C语言内的封装
摘要:前提 在翻libevent代码的时候,看到一段C的技巧记录下来:1 #define TAILQ_HEAD(name, type) 2 struct name { 3 struct type *tqh_first; /* first element */ 4 struct type **tqh_last; /* addr of last next element */ 5 }这样就通过预编译实现双链表结构体的定义。1 #ifdef _EVENT_DEFINED_TQENTRY2 #undef TAILQ_ENTRY3 struct event_list;4 struct evkey...
阅读全文
posted @ 2013-06-09 17:12
浙公网安备 33010602011771号