#ifndef ULIB_UTIL_UTIL_H_
#define ULIB_UTIL_UTIL_H_

#include <string/string.h>

#define ARRLEN(X) (sizeof((X))/sizeof((X)[0]))

#define ZERO(X) string_memset((X), 0, sizeof(*(X)))

#define MIN(a, b) \
({ \
  typeof(a) _a = (a); \
  typeof(b) _b = (b); \
  (_a < _b ? _a : _b); \
})

#define MAX(a, b) \
({ \
  typeof(a) _a = (a); \
  typeof(b) _b = (b); \
  (_a > _b ? _a : _b); \
})

void quit(void);

#endif // ULIB_UTIL_UTIL_H_
