1/*************************************************************************** 2#*** 3#*** Copyright 2005 Hon Hai Precision Ind. Co. Ltd. 4#*** All Rights Reserved. 5#*** No portions of this material shall be reproduced in any form without the 6#*** written permission of Hon Hai Precision Ind. Co. Ltd. 7#*** 8#*** All information contained in this document is Hon Hai Precision Ind. 9#*** Co. Ltd. company private, proprietary, and trade secret property and 10#*** are protected by international intellectual property laws and treaties. 11#*** 12#**************************************************************************** 13*** 14*** Filename: acosTypes.h 15*** 16*** Description: 17*** This is the header file containing basic type definitions of ACOS libraries. 18*** The following definition refer the fxxing Ambit Coding Rule D01.1. 19*** When this header file is included, programmer should avoid re-declaration issue. Because 20*** if there is same definition respective to different type. There will be some trouble. 21*** 22*** History: 23*** 24*** Modify Reason Author Date Search Flag(Option) 25*** -------------------------------------------------------------------------------------- 26*** File Creation Jasmine Yang 11/02/2005 27******************************************************************************* 28*** 29*** 30*** Caution: 1. If you would like to use vxWorks's general types and only ACOS "IN" "OUT" 31*** definitions. Please include "vxworks.h" first than include "acosTypes.h" to 32*** avoid compiler error. 33*** 34*** Example: 35*** #include <vxWorks.h> 36*** #include "acosTypes.h" 37*** int test(IN int nArg) //ACOS definition(IN) 38*** { 39*** UINT8 ucTest; //ACOS definition(UINT8) 40*** UINT16 usTest; //ACOS definition(UINT16) 41*** UINT32 ulTest; //vxWorks definition(UINT32) 42*** IMPORT int nTest; //vxWorks definition(IMPORT) 43*** return OK; //vxWorks definition(OK) 44*** } 45*** 46*** 47*** 2. If you would like to use only ACOS general types as well as vxWorks's extra definitions, 48*** please don't include "vxworks.h" before including "acosTypes.h" 49*** 50*** Example: 51*** #include "acosTypes.h" 52*** #include <vxWorks.h> 53*** int test(IN int nArg) //ACOS definition(IN) 54*** { 55*** UINT8 ucTest; //ACOS definition(UINT8) 56*** UINT16 usTest; //ACOS definition(UINT16) 57*** UINT32 ulTest; //ACOS definition(UINT32) 58*** IMPORT int nTest; //vxWorks definition(IMPORT) 59*** return OK; //ACOS definition(OK) 60*** } 61*** 62*** 63*** 3. If you are building ACOS library, you should never include "vxworks.h" 64*** 65*** Example: 66*** #include "acosTypes.h" 67*** int test(IN int nArg) //ACOS definition(IN) 68*** { 69*** UINT8 ucTest; //ACOS definition(UINT8) 70*** UINT16 usTest; //ACOS definition(UINT16) 71*** UINT32 ulTest; //ACOS definition(UINT32) 72*** return OK; //ACOS definition(OK) 73*** } 74********************************************************************************************************/ 75#ifndef _ACOS_TYPES_H 76#define _ACOS_TYPES_H 77 78#ifdef __cplusplus 79extern "C" 80{ 81#endif 82 83#ifndef IN 84#define IN 85#endif 86 87#ifndef OUT 88#define OUT 89#endif 90 91#ifndef bool 92#define bool int 93#define false 0 94#define true 1 95#endif 96 97#if !defined(__INCvxWorksh) /* not include vxWorks.h */ 98 99#if !defined(FALSE) || (FALSE!=0) 100#define FALSE 0 101#endif 102 103#if !defined(TRUE) || (TRUE!=1) 104#define TRUE 1 105#endif 106 107#ifndef NULL 108#ifdef __cplusplus 109#define NULL 0 110#else 111#define NULL ((void *)0) 112#endif 113#endif 114 115/* return status values */ 116#if !defined(OK) || (OK!=0) 117#define OK 0 118#endif 119 120#if !defined(ERROR) || (ERROR!=(-1)) 121#define ERROR (-1) 122#endif 123 124/* ACOS types */ 125#ifndef INT8 126#define INT8 char 127#endif 128 129#ifndef INT16 130#define INT16 short 131#endif 132 133#ifndef INT32 134#define INT32 long 135#endif 136 137#ifndef UINT8 138#define UINT8 unsigned char 139#endif 140 141#ifndef UNIT16 142#define UINT16 unsigned short 143#endif 144 145#ifndef UNIT32 146#define UINT32 unsigned int 147#endif 148 149#ifndef BOOL 150#define BOOL int 151#endif 152 153#ifndef STATUS 154#define STATUS int 155#endif 156 157#ifndef uint8 158#define uint8 unsigned char 159#endif 160 161#ifndef uint16 162#define uint16 unsigned int 163#endif 164 165#ifndef uint32 166#define uint32 unsigned int 167#endif 168 169#ifndef UCHAR 170#define UCHAR unsigned char 171#endif 172 173#ifndef USHORT 174#define USHORT unsigned short 175#endif 176 177#ifndef UINT 178#define UINT unsigned int 179#endif 180 181#ifndef ULONG 182#define ULONG unsigned long 183#endif 184 185#ifndef INLINE 186 187#ifdef _MSC_VER 188 189#define INLINE __inline 190 191#elif __GNUC__ 192 193#define INLINE __inline__ 194 195#else 196 197#define INLINE 198 199#endif /* _MSC_VER */ 200 201#endif /* INLINE */ 202 203#ifndef IMPORT 204#define IMPORT extern 205#endif 206 207#ifndef LOCAL 208#define LOCAL static 209#endif 210 211#endif /* __INCvxWorksh */ 212 213#ifdef __cplusplus 214} 215#endif 216 217/* here defined general constant*/ 218#ifndef MAX_IF_NAME_LEN 219#define MAX_IF_NAME_LEN 20 /* mirror, ixe0, ixe1 ..., brenda add, 2003/07/24 */ 220#endif 221 222/* CMI definitions */ 223//#include "acosCmiTypes.h" 224//#include "epivers.h" 225/* Driver Version String, ASCII, 32 chars max */ 226#ifndef EPI_VERSION_STR 227#define EPI_VERSION_STR "3.90.23.0" 228#define EPI_ROUTER_VERSION_STR "3.91.23.0" 229#endif 230#ifndef EZC_VERSION_STR 231#define EZC_VERSION_STR "2" 232#endif 233 234#ifndef MAX_NVPARSE 235/* 256 entries per list */ 236#define MAX_NVPARSE 256 //in "Nvparse.h" 237#endif 238 239#ifndef ETHER_ADDR_LEN 240#define ETHER_ADDR_LEN 6 241#endif 242 243#define min(a,b) ((a) < (b) ? (a) : (b)) 244#define max(a,b) ((a) > (b) ? (a) : (b)) 245#ifndef MIN 246#define MIN(a,b) (((a)<(b)) ? (a):(b)) 247#endif 248#endif /* _ACOS_TYPES_H */ 249