#ifndef _HELPER_H_ #define _HELPER_H_ #include "types.h" #include "ldap.h" void bail(char *args, ...); int helper_realloc(char **memory, size_t *curSize, const size_t newSize, const char *location); int helper_connect4(char *address, int port, char *ip); int helper_newSocket(); void helper_nonblock(const int fd); void helper_printava(struct AttributeValueAssertion* a,const char* rel); void helper_printal(struct AttributeDescriptionList* a); void helper_printpal(struct PartialAttributeList *pal); void helper_printfilter(struct Filter* f); static inline int min(const int a, const int b) { return a < b ? a : b; } static inline int max(const int a, const int b) { return a > b ? a : b; } typedef enum { DEBUG_FATAL = 0, DEBUG_WARNING = 1, DEBUG_INFO = 2, DEBUG_VERBOSE = 3, DEBUG_TRACE = 4, } DebugLevel; /** Debug level for logging */ extern DebugLevel _debugLevel; /** Automatically restart on connection errors? */ extern int _autoRestart; void plog(const DebugLevel messageLevel, char *args, ...); #endif