/******************************************************************************* ** ** Cabletron Systems Incorporated ** Post Office Box 5005 ** Rochester, NH 03866-5005 ** (c) Copyright Cabletron Systems Inc. 1999 ** ** Workfile: %M% ** Logfile: %P% ** Original Author: Todd Crowley ** SCCS Delta ID: %I% ** Last Delta Date/Time: %G% %U% ** *******************************************************************************/ /******************************************************************************/ /* */ /* File: LfapSysDepend.h */ /* */ /* This file contains all of the system dependent included header files, */ /* typedefs, and macros for the LFAP API. Each header file included in this */ /* file has an explanation with it which explains why the header file is */ /* being included, so that an implementor on a different platform can easily */ /* include the appropriate file for the standard functions. */ /* */ /******************************************************************************/ #ifndef LFAPSYSDEPEND_H_ #define LFAPSYSDEPEND_H_ /******************************************************************************/ /* */ /* System dependent header files. */ /* */ /******************************************************************************/ /* * Functions that need to be defined: Example Files (on Sun): * ---------------------------------- ----------------------- * * ntohs() and ntohl() macros netinet/in.h * * fprintf(), and stderr stdio.h * * malloc(), realloc(), and free() stdlib.h * * memset(), memcpy(), memmove(), and memcmp() string.h * * gettimeofday() (or time() on NT) time.h * * * Note: The only file that needs the gettimeofday() function is LfapDebug.c, * which should only be compiled if debugging printouts are desired. */ /* Portable and Standard ISO C Headers for any C programming environment */ #include #include #include #include /* BSD Socket Networking API */ #ifdef _WIN32 #include #else #include #include // gettimeofday() #include #endif /******************************************************************************/ /* */ /* System dependent typedefs. */ /* */ /******************************************************************************/ /* 8 bit integer */ #ifndef _LFAPUINT8_T #define _LFAPUINT8_T typedef unsigned char lfapui8_t; #endif #define LFAP_SIZEOF_UINT8_T sizeof(lfapui8_t) /* 16 bit integer */ #ifndef _LFAPUINT16_T #define _LFAPUINT16_T typedef unsigned short lfapui16_t; #endif #define LFAP_SIZEOF_UINT16_T sizeof(lfapui16_t) /* 32 bit integer */ #ifndef _LFAPUINT32_T #define _LFAPUINT32_T typedef unsigned long lfapui32_t; #endif #define LFAP_SIZEOF_UINT32_T sizeof(lfapui32_t) /* Need this one on windows for bitvectors */ #ifndef _LFAPBIT32_T #define _LFAPBIT32_T typedef unsigned int lfapbit32_t; #endif /* 64 bit integer */ #ifndef _LFAPUINT64_T #define _LFAPUINT64_T #ifdef _WIN32 typedef unsigned __int64 lfapui64_t; #else typedef unsigned long long lfapui64_t; #endif #endif #define LFAP_SIZEOF_UINT64_T sizeof(lfapui64_t) /******************************************************************************/ /* */ /* System dependent macros. */ /* */ /******************************************************************************/ /* macro for standard C function malloc */ #define lfap_malloc(size) malloc(size) /* macro for standard C function realloc */ #define lfap_realloc(ptr, size) realloc(ptr, size) /* macro for standard C function free */ #define lfap_free(ptr) free(ptr) /* macro for standard C function memset */ #define lfap_memset(ptr, val, size) memset(ptr, val, size) /* macro for standard C function memcpy */ #define lfap_memcpy(to, from, size) memcpy(to, from, size) /* macro for standard C function memmove */ #define lfap_memmove(to, from, size) memmove(to, from, size) /* macro for standard C function memcmp */ #define lfap_memcmp(frst, secnd, size) memcmp(frst, secnd, size) #endif /* LFAPSYSDEPEND_H_ */