3 /**************************************************************************
5 * Copyright (C) 1995 Silicon Graphics, Inc. *
7 * These coded instructions, statements, and computer programs were *
8 * developed by SGI for public use. If any changes are made to this code*
9 * please try to get the changes back to the author. Feel free to make *
10 * modifications and changes to the code and release it. *
12 **************************************************************************/
14 /* include config.h, output from autoconf */
27 /* MAXHOSTNAMELEN is undefined on some systems */
28 #ifndef MAXHOSTNAMELEN
29 #define MAXHOSTNAMELEN 64
32 //FUZZ: disable check_for_NULL
33 /* SunOS doesn't define NULL */
37 //FUZZ: enable check_for_NULL
39 /* encapsulation of minor UNIX/WIN NT differences */
41 #define NETREAD(sock, buf, len) recv(sock, buf, len, 0)
42 #define NETWRITE(sock, buf, len) send(sock, buf, len, 0)
43 #define NETCLOSE(sock) closesocket(sock)
44 #define BADSOCKET(sock) ((sock) == INVALID_SOCKET)
45 #define BADSOCKET_ERRNO(sock) BADSOCKET(sock)
46 #define BADSOCKET_VALUE INVALID_SOCKET
47 #define S_ADDR S_un.S_addr
50 #error NT gettimeofday() doesn't support USE_TIMEZONE (yet)
52 #define GETTIMEOFDAY(timeval, tz) gettimeofday(timeval)
53 #endif /* USE_TIMEZONE */
55 typedef unsigned short NETPORT;
57 #define RANDOM_R rand_r
59 #define THREAD __declspec ( thread )
60 #define PROGPATH "c:\\webstone\\webclient"
61 #define FILENAME_SIZE 256
62 #define HAVE_VPRINTF 1
64 #define SIGCHLD 0 /* dummy value */
65 #define SIGALRM 0 /* dummy value */
67 typedef unsigned short ushort;
68 #define MAXPATHLEN 512
72 #define NETREAD(sock, buf, len) read(sock, buf, len)
73 #define NETWRITE(sock, buf, len) write(sock, buf, len)
74 #define NETCLOSE(sock) close(sock)
75 #define BADSOCKET(sock) ((sock) < 0)
76 #define BADSOCKET_ERRNO(sock) (BADSOCKET(sock) || errno)
77 #define BADSOCKET_VALUE (-1)
81 #define GETTIMEOFDAY(timeval,tz) gettimeofday(timeval, 0)
83 #define GETTIMEOFDAY(timeval,tz) gettimeofday(timeval, tz)
84 #endif /* USE_TIMEZONE */
86 typedef unsigned short NETPORT;
87 #define SRANDOM srandom
90 #define PROGPATH "/tmp/webclient" /* "/usr/local/bin/webclient" */
91 #define FILENAME_SIZE 1024
92 #define HAVE_VPRINTF 1
95 #define min(a,b) (((a) < (b)) ? a : b)
96 #define max(a,b) (((a) > (b)) ? a : b)
100 /* function prototypes */
103 int getopt(int argc, char ** argv, char *opts);
105 int gettimeofday(struct timeval *curTimeP);
106 int random_number(int max);
107 SOCKET rexec(const char **hostname, NETPORT port, char *username, char *password,
108 char *command, SOCKET *sockerr);
109 void sleep(int secs);
113 extern int rexec(char **, int, char *, char *, char *, int *);
118 #ifndef HAVE_STRERROR
119 /* strerror() is not available on SunOS 4.x and others */
120 char *strerror(int errnum);
127 #define INADDR_NONE -1