Commit | Line | Data |
---|---|---|
f645fe31 KB |
1 | /*- |
2 | * Copyright (c) 1991 The Regents of the University of California. | |
3 | * All rights reserved. | |
4 | * | |
5 | * This code is derived from software contributed to Berkeley by | |
a93b814a | 6 | * Ozan Yigit at York University. |
f645fe31 KB |
7 | * |
8 | * %sccs.include.redist.c% | |
9 | * | |
a93b814a | 10 | * @(#)stdd.h 5.2 (Berkeley) %G% |
f645fe31 KB |
11 | */ |
12 | ||
13 | /* | |
14 | * standard defines | |
15 | */ | |
16 | ||
17 | #define max(a,b) ((a) > (b)? (a): (b)) | |
18 | #define min(a,b) ((a) < (b)? (a): (b)) | |
19 | ||
20 | #define iswhite(c) ((c) == ' ' || (c) == '\t') | |
21 | ||
22 | /* | |
23 | * STREQ is an optimised strcmp(a,b)==0 | |
24 | * STREQN is an optimised strncmp(a,b,n)==0; assumes n > 0 | |
25 | */ | |
26 | #define STREQ(a, b) ((a)[0] == (b)[0] && strcmp(a, b) == 0) | |
27 | #define STREQN(a, b, n) ((a)[0] == (b)[0] && strncmp(a, b, n) == 0) | |
28 | ||
29 | #define YES 1 | |
30 | #define NO 0 |