00001 /**************************************************************************** 00002 * Copyright (c) 2002-2003 by Michael Fischer. All rights reserved. 00003 * 00004 * Redistribution and use in source and binary forms, with or without 00005 * modification, are permitted provided that the following conditions 00006 * are met: 00007 * 00008 * 1. Redistributions of source code must retain the above copyright 00009 * notice, this list of conditions and the following disclaimer. 00010 * 2. Redistributions in binary form must reproduce the above copyright 00011 * notice, this list of conditions and the following disclaimer in the 00012 * documentation and/or other materials provided with the distribution. 00013 * 3. Neither the name of the author nor the names of its contributors may 00014 * be used to endorse or promote products derived from this software 00015 * without specific prior written permission. 00016 * 00017 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00018 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00019 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00020 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 00021 * THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00022 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00023 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 00024 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 00025 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00026 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 00027 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00028 * SUCH DAMAGE. 00029 * 00030 **************************************************************************** 00031 * History: 00032 * 00033 * 14.12.02 mifi First Version 00034 * 18.01.03 mifi Change Licence from GPL to BSD. 00035 * 07.02.04 mifi Add some macros. 00036 ****************************************************************************/ 00037 #ifndef __TYPEDEFS_H__ 00038 #define __TYPEDEFS_H__ 00039 00040 /* 00041 * some types to use Windows like source 00042 */ 00043 typedef char CHAR; /* 8-bit signed data */ 00044 typedef unsigned char BYTE; /* 8-bit unsigned data */ 00045 typedef unsigned short WORD; /* 16-bit unsigned data */ 00046 typedef long LONG; /* 32-bit signed data */ 00047 typedef unsigned long ULONG; /* 32-bit unsigned data */ 00048 typedef unsigned long DWORD; /* 32-bit unsigned data */ 00049 00050 /* 00051 * some define for the BSD files 00052 */ 00053 typedef unsigned char u_int8_t; 00054 typedef unsigned short u_int16_t; 00055 typedef unsigned long u_int32_t; 00056 00057 #define FALSE 0 00058 #define TRUE 1 00059 00060 /************************************************************************** 00061 * Some WORD, BYTE macro's 00062 ***************************************************************************/ 00063 #define HIBYTE(_a) ((((WORD)(_a)) >> 8) & 0x00FF) 00064 #define LOBYTE(_a) (((WORD)(_a)) & 0x00FF) 00065 00066 #define HIWORD(_a) ((((DWORD)(_a)) >> 16) & 0xFFFF) 00067 #define LOWORD(_a) (((DWORD)(_a)) & 0xFFFF) 00068 00069 #define SWAP(_a) ((LOBYTE((_a)) << 8) | HIBYTE((_a))) 00070 00071 #endif /* !__TYPEDEFS_H_ */