New developer version 0.6.8; added select () function; added demonstrating example...
[ZeXOS.git] / kernel / include / mytypes.h
blobc20047cc4ba569d4c2a7a137b9ceabd1c2671645
1 /*
2 * ZeX/OS
3 * Copyright (C) 2007 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef MYTYPES_H_
21 #define MYTYPES_H_
23 /* hardware datatypes */
24 typedef unsigned char BYTE; /* 8-bit byte */
25 typedef unsigned short WORD; /* 16-bit word */
26 typedef unsigned long DWORD; /* 32-bit dword */
27 typedef unsigned long addr_t; /* address that should not be deref'd */
29 /* integer types */
30 typedef unsigned char UINT8; /* 8-bit unsigned integer */
31 typedef signed char INT8; /* 8-bit signed integer */
32 typedef unsigned short UINT16; /* 16-bit unsigned integer */
33 typedef signed short INT16; /* 16-bit signed integer */
34 typedef unsigned long UINT32; /* 32-bit unsigned integer */
35 typedef signed long INT32; /* 32-bit signed integer */
37 /* logical datatypes */
38 typedef unsigned char CHAR; /* ISO 8859-1 character */
39 typedef unsigned char *STRPTR; /* C-style NUL-terminated string */
40 typedef enum { false = 0, true = 1 } bool; /* boolean value */
44 /* useful macros */
45 #define BITFIELD(name,width) unsigned int name : width
46 #define HIBYTE(x) ((BYTE)((x) >> 8))
47 #define LOBYTE(x) ((BYTE)((x) & 0xff))
48 #define ABS(x) ((x) < 0 ? -(x) : (x)) /* NB: multiple evaluations! */
50 #endif /* MYTYPES_H_ */