You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829
  1. #ifndef UTIL_H
  2. #define UTIL_H
  3. #include <stdlib.h>
  4. #ifdef RAND
  5. #undef RAND
  6. #endif
  7. #define RAND(lb, ub) (rand() % ((ub) - (lb) + 1) + (lb))
  8. #ifdef MAX
  9. #undef MAX
  10. #endif
  11. #define MAX(x, y) ((x) > (y) ? (x) : (y))
  12. #ifdef MIN
  13. #undef MIN
  14. #endif
  15. #define MIN(x, y) ((x) < (y) ? (x) : (y))
  16. #ifdef UNUSED
  17. #undef UNUSED
  18. #endif
  19. #define UNUSED(x) (void)(x)
  20. void *xalloc(int size);
  21. void fatal(const char *format, ...);
  22. #endif