From bedd2e7ccb1595c23e159eaa952ae1b0b5a3d2ad Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Sat, 15 Mar 2014 01:49:50 +0100 Subject: Lean and mean initial commit Not much functionality yet --- helper.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 helper.h (limited to 'helper.h') diff --git a/helper.h b/helper.h new file mode 100644 index 0000000..840813d --- /dev/null +++ b/helper.h @@ -0,0 +1,27 @@ +#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); +void helper_nonblock(const int fd); + +void helper_printava(struct AttributeValueAssertion* a,const char* rel); +void helper_printal(struct AttributeDescriptionList* a); +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; +} + +#endif + -- cgit v1.2.3-55-g7522