1*c2c66affSColin Finck // Various things you need when porting BSD and GNU utilities to
2*c2c66affSColin Finck // Win32.
3*c2c66affSColin Finck 
4*c2c66affSColin Finck #ifndef VARIOUS_H
5*c2c66affSColin Finck #define VARIOUS_H
6*c2c66affSColin Finck 
7*c2c66affSColin Finck /* types.h */
8*c2c66affSColin Finck typedef unsigned char u_char;
9*c2c66affSColin Finck typedef unsigned int u_int;
10*c2c66affSColin Finck typedef float f4byte_t;
11*c2c66affSColin Finck typedef double f8byte_t;
12*c2c66affSColin Finck //typedef __int16 s2byte_t;
13*c2c66affSColin Finck //typedef __int32 s4byte_t;
14*c2c66affSColin Finck //typedef __int64 s8byte_t;
15*c2c66affSColin Finck //typedef unsigned __int16 u2byte_t;
16*c2c66affSColin Finck //typedef unsigned __int32 u4byte_t;
17*c2c66affSColin Finck //typedef unsigned __int64 u8byte_t;
18*c2c66affSColin Finck //typedef __int32 quad_t;
19*c2c66affSColin Finck //typedef unsigned __int32 u_quad_t;
20*c2c66affSColin Finck //typedef unsigned __int16 u_int16_t;
21*c2c66affSColin Finck //typedef unsigned __int32 u_int32_t;
22*c2c66affSColin Finck 
23*c2c66affSColin Finck typedef long uid_t;  // SunOS 5.5
24*c2c66affSColin Finck 
25*c2c66affSColin Finck #define __P(x) x
26*c2c66affSColin Finck //#define __STDC__ 1
27*c2c66affSColin Finck 
28*c2c66affSColin Finck /* utmp.h */
29*c2c66affSColin Finck #define UT_LINESIZE 8
30*c2c66affSColin Finck #define UT_HOSTSIZE 16
31*c2c66affSColin Finck 
32*c2c66affSColin Finck /* stat.h */
33*c2c66affSColin Finck //#define  S_ISREG(mode)   (((mode)&0xF000) == 0x8000)
34*c2c66affSColin Finck //#define  S_ISDIR(mode)   (((mode)&0xF000) == 0x4000)
35*c2c66affSColin Finck 
36*c2c66affSColin Finck #undef MIN //take care of windows default
37*c2c66affSColin Finck #undef MAX //take care of windows default
38*c2c66affSColin Finck #define MIN(a, b) ((a) <= (b) ? (a) : (b))
39*c2c66affSColin Finck #define MAX(a, b) ((a) > (b) ? (a) : (b))
40*c2c66affSColin Finck 
41*c2c66affSColin Finck #define bcopy(s1, s2, n)  memmove(s2, s1, n)
42*c2c66affSColin Finck #define bcmp(s1, s2, n)  (memcmp(s1, s2, n) != 0)
43*c2c66affSColin Finck #define bzero(s, n)  memset(s, 0, n)
44*c2c66affSColin Finck 
45*c2c66affSColin Finck #define index(s, c)  strchr(s, c)
46*c2c66affSColin Finck #define rindex(s, c)  strrchr(s, c)
47*c2c66affSColin Finck 
48*c2c66affSColin Finck //#ifndef _WINSOCKAPI_
49*c2c66affSColin Finck //struct timeval {
50*c2c66affSColin Finck //        long    tv_sec;         /* seconds */
51*c2c66affSColin Finck //        long    tv_usec;        /* and microseconds */
52*c2c66affSColin Finck //};
53*c2c66affSColin Finck //#endif
54*c2c66affSColin Finck 
55*c2c66affSColin Finck #endif
56