summaryrefslogtreecommitdiffstats
path: root/include/joedog/defs.h
blob: 2b33f2b7e22e51a7dcaabc1e6a9a348b1700a82b (plain)
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
30
31
32
#ifndef JOEDOG_DEFS_H
#define JOEDOG_DEFS_H
#define private static
#define public 

#include <ctype.h>

#define  ISUPPER(x)     (((unsigned)(x) >= 'A') && ((unsigned)(x) <= 'Z'))
#define  ISLOWER(x)     (((unsigned)(x) >= 'a') && ((unsigned)(x) <= 'z'))
#define  ISCOMMENT(x)   (x == '#')
#define  ISSEPARATOR(x) (('='==(x))||(':'==(x)))
#define  ISSPACE(x)     isspace((unsigned char)(x))
#define  ISOPERAND(x) ('<'==(x)||'>'==(x)||'='==(x))
#define  ISDIGIT(x)     isdigit ((unsigned char)(x)) 
#define  ISNUMBER(v)  (((v) > (char)0x2f) && ((v) < (char)0x3a))
#define  ISQUOTE(x)   (x == '"' || x == '\'') 
#if STDC_HEADERS
# define TOLOWER(Ch) tolower (Ch)
# define TOUPPER(Ch) toupper (Ch)
#else
# define TOLOWER(Ch) (ISUPPER (Ch) ? tolower (Ch) : (Ch))
# define TOUPPER(Ch) (ISLOWER (Ch) ? toupper (Ch) : (Ch))
#endif

#ifndef  EXIT_SUCCESS
# define EXIT_SUCCESS   0
#endif /*EXIT_SUCESS*/
#ifndef  EXIT_FAILURE
# define EXIT_FAILURE   1
#endif /*EXIT_FAILURE*/ 

#endif/*JOEDOG_DEFS_H*/