File: util.h

package info (click to toggle)
xbill 2.1-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 808 kB
  • sloc: ansic: 3,252; sh: 197; makefile: 101
file content (29 lines) | stat: -rw-r--r-- 418 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef UTIL_H
#define UTIL_H

#include <stdlib.h>

#ifdef RAND
#undef RAND
#endif
#define RAND(lb, ub) (rand() % ((ub) - (lb) + 1) + (lb))

#ifdef MAX
#undef MAX
#endif
#define MAX(x, y) ((x) > (y) ? (x) : (y))

#ifdef MIN
#undef MIN
#endif
#define MIN(x, y) ((x) < (y) ? (x) : (y))

#ifdef UNUSED
#undef UNUSED
#endif
#define UNUSED(x) (void)(x)

void *xalloc(int size);
void fatal(const char *format, ...);

#endif