整理目录结构,编写CMakeLists.txt文件

This commit is contained in:
Lu
2018-08-17 20:29:38 +08:00
parent 093afcce8d
commit 86c18a15c3
68 changed files with 13 additions and 11566 deletions

20
common/include/tfe_util.h Normal file
View File

@@ -0,0 +1,20 @@
//#define ALLOC(t,n) (t *)calloc(sizeof(t),(n))
/* Allocates an array of objects using malloc() */
#define ALLOC(type, number) \
((type *)calloc(sizeof(type), number))
#define log_err_printf(fmt, args...) \
fprintf(stderr, "file %s, line %d, " fmt, \
__FILE__, __LINE__, ##args)
#define log_dbg_printf(fmt, args...) \
fprintf(stdout, "file %s, line %d, " fmt, \
__FILE__, __LINE__, ##args)
#define likely(expr) __builtin_expect((expr), 1)
#define unlikely(expr) __builtin_expect((expr), 0)
int addr_sock2layer(struct sockaddr * sock_addr, int sockaddrlen, struct layer_addr* layer_addr);
int addr_layer2sock(struct layer_addr* layer_addr,struct sockaddr * sock_addr);
char* tfe_strdup(const char* s);