| 1 | /* emx/gcc */ | 
|---|
| 2 | #ifndef _UTILS_H_ | 
|---|
| 3 | #define _UTILS_H_ | 
|---|
| 4 |  | 
|---|
| 5 | #ifndef TCPCALL | 
|---|
| 6 | #define TCPCALL _System | 
|---|
| 7 | #endif | 
|---|
| 8 |  | 
|---|
| 9 | #ifdef TCPV40HDRS | 
|---|
| 10 |  | 
|---|
| 11 | unsigned long   TCPCALL lswap(unsigned long); | 
|---|
| 12 | unsigned short  TCPCALL bswap(unsigned short); | 
|---|
| 13 | int             TCPCALL rexec(char **, int, char *, char *, char *, int *); | 
|---|
| 14 |  | 
|---|
| 15 | /* Definition for bswap */ | 
|---|
| 16 | #ifndef htonl | 
|---|
| 17 | #include <machine/endian.h> | 
|---|
| 18 | #endif | 
|---|
| 19 |  | 
|---|
| 20 | #define ovbcopy(x,y,z)  bcopy((x),(y),(z)) | 
|---|
| 21 | #define copyout(x,y,z)  memcpy((y),(x),(z)) | 
|---|
| 22 | #ifndef XP_OS2_VACPP /* mozilla */ | 
|---|
| 23 | /* We've got the real thing now. (aliased at least) | 
|---|
| 24 | #define strcasecmp(x,y)     strcmpi((x),(y)) | 
|---|
| 25 | #define strncasecmp(x,y,z)  strnicmp(x,y,z) | 
|---|
| 26 | */ | 
|---|
| 27 | #endif | 
|---|
| 28 |  | 
|---|
| 29 | #ifdef __cplusplus | 
|---|
| 30 | extern "C" { | 
|---|
| 31 | #endif | 
|---|
| 32 |  | 
|---|
| 33 | #if !defined(_SIZE_T_DECLARED) && !defined(_SIZE_T) /* bird: emx */ | 
|---|
| 34 | typedef __size_t        size_t; | 
|---|
| 35 | #define _SIZE_T_DECLARED | 
|---|
| 36 | #define _SIZE_T                         /* bird: emx */ | 
|---|
| 37 | #endif | 
|---|
| 38 |  | 
|---|
| 39 | int strcasecmp (__const__ char *, __const__ char *); | 
|---|
| 40 | int strncasecmp (__const__ char *, __const__ char *, size_t); | 
|---|
| 41 |  | 
|---|
| 42 | #ifdef __cplusplus | 
|---|
| 43 | } | 
|---|
| 44 | #endif | 
|---|
| 45 |  | 
|---|
| 46 | #ifndef MIN | 
|---|
| 47 | #define MIN(a,b) (((a)<(b))?(a):(b)) | 
|---|
| 48 | #define imin(x,y) MIN((x),(y)) | 
|---|
| 49 | #define MAX(a,b) (((a)>(b))?(a):(b)) | 
|---|
| 50 | #endif | 
|---|
| 51 | #ifndef min | 
|---|
| 52 | #define min(a,b) (((a)<(b))?(a):(b)) | 
|---|
| 53 | #endif | 
|---|
| 54 | /* timercmp */ | 
|---|
| 55 | #include <sys/time.h> | 
|---|
| 56 |  | 
|---|
| 57 | #else | 
|---|
| 58 | int     TCPCALL rexec(char **, int, char *, char *, char *, int *); | 
|---|
| 59 | #endif /*TCPV40HDRS*/ | 
|---|
| 60 |  | 
|---|
| 61 | #endif | 
|---|