This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
tango-tfe/common/include/tfe_utils.h

18 lines
566 B
C
Raw Normal View History

//#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 likely(expr) __builtin_expect((expr), 1)
#define unlikely(expr) __builtin_expect((expr), 0)
int addr_sock_to_layer(struct sockaddr * sock_addr, int sockaddrlen, struct layer_addr * layer_addr);
int addr_layer_to_sock(struct layer_addr * layer_addr, struct sockaddr * sock_addr);
char* tfe_strdup(const char* s);
#define TFE_LOG_ERROR
#define TFE_LOG_INFO
#define TFE_LOG_DEBUG