#ifndef __USUALS_H__ #define __USUALS_H__ #include #include #include #include #include #include "compat.h" #ifndef NULL #define NULL 0 #endif #ifndef max #define max(a,b) (((a) > (b)) ? (a) : (b)) #endif #ifndef min #define min(a,b) (((a) < (b)) ? (a) : (b)) #endif #define countof(x) (sizeof(x) / sizeof(x[0])) #define RETURN(x) { ret = (x); goto finally; } /* * To be used like this: * if(CHECK_BUF(b)) * return HA_CRITERROR; */ #define CHECK_BUF(b) (ha_buferr(b) ? (ha_memerr(NULL), 1) : 0) #define CHECK_RBUF(rq) (ha_buferr((rq)->buf) ? (ha_memerr(rq), 1) : 0) #endif /* __USUALS_H__ */