00001 #ifndef WIN32_H
00002 #define WIN32_H
00003
00012 #if !defined(AFX_STDAFX_H__31666CA1_2474_11D5_AE6C_F07569C10000__INCLUDED_)
00013 #define AFX_STDAFX_H__31666CA1_2474_11D5_AE6C_F07569C10000__INCLUDED_
00014
00015
00016 #define VERSION "1.9.1 (trunk) snapshot 20061229"
00017
00018 #pragma warning(disable: 4761)
00019
00020 #if _MSC_VER > 1000
00021 #pragma once
00022 #endif
00023
00024 #endif
00025
00026 #define WIN32_LEAN_AND_MEAN
00027 #include <windows.h>
00028 #include <windowsx.h>
00029 #include <mmsystem.h>
00030 #include <winsock2.h>
00031 #include <time.h>
00032 #include <direct.h>
00033 #include <math.h>
00034
00035 #include <sys/stat.h>
00036
00037 #include <io.h>
00038 #include <stdio.h>
00039 #include <stdlib.h>
00040 #include <sys/types.h>
00041 #include <process.h>
00042
00043 #define __STDC__ 1
00044
00045
00046 #ifndef HAVE_SNPRINTF
00047 #define HAVE_SNPRINTF 1
00048 #endif
00049 #define snprintf _snprintf
00050
00051
00052 #define CS_LOGSTATS
00053 #define HAVE_SRAND
00054 #ifndef HAVE_FCNTL_H
00055 #define HAVE_FCNTL_H
00056 #endif
00057 #ifndef HAVE_STDDEF_H
00058 #define HAVE_STDDEF_H
00059 #endif
00060 #define GETTIMEOFDAY_TWO_ARGS
00061 #define MAXPATHLEN 256
00062 #define HAVE_STRTOL
00063 #define HAVE_STRERROR
00064
00065
00066 #define inline __inline
00067 #define unlink(__a) _unlink(__a)
00068 #define mkdir(__a, __b) mkdir(__a)
00069 #define getpid() _getpid()
00070 #define popen(__a, __b) _popen(__a, __b)
00071 #define pclose(__a) _pclose(__a)
00072 #define vsnprintf _vsnprintf
00073 #define strtok_r(x, y, z) strtok(x, y)
00074
00075 #define R_OK 6
00076 #define F_OK 6
00077
00078 #define PREFIXDIR ""
00079
00080 #define S_ISDIR(x) (((x)&S_IFMT) == S_IFDIR)
00081 #define S_ISREG(x) (((x)&S_IFMT) == S_IFREG)
00082
00083 #ifndef S_ISGID
00084 #define S_ISGID 0002000
00085 #endif
00086 #ifndef S_IWOTH
00087 #define S_IWOTH 0000200
00088 #endif
00089 #ifndef S_IWGRP
00090 #define S_IWGRP 0000020
00091 #endif
00092 #ifndef S_IWUSR
00093 #define S_IWUSR 0000002
00094 #endif
00095 #ifndef S_IROTH
00096 #define S_IROTH 0000400
00097 #endif
00098 #ifndef S_IRGRP
00099 #define S_IRGRP 0000040
00100 #endif
00101 #ifndef S_IRUSR
00102 #define S_IRUSR 0000004
00103 #endif
00104
00105 #define WIFEXITED(x) 1
00106 #define WEXITSTATUS(x) x
00107
00108
00109 #define DATADIR "share"
00110 #define LIBDIR "share"
00111 #define CONFDIR "share"
00112
00113
00114 #define LOCALDIR "var"
00115
00116 #define COMPRESS "/usr/bin/compress"
00117 #define UNCOMPRESS "/usr/bin/uncompress"
00118 #define GZIP "/bin/gzip"
00119 #define GUNZIP "/bin/gunzip"
00120 #define BZIP "/usr/bin/bzip2"
00121 #define BUNZIP "/usr/bin/bunzip2"
00122
00123
00124 #define PLUGIN_SUFFIX ".dll"
00125
00126
00127
00128 typedef struct dirent {
00129 long d_ino;
00130 off_t d_off;
00131 unsigned short d_reclen;
00132 char d_name[_MAX_FNAME+1];
00133 }dirent;
00134
00135 #define NAMLEN(dirent) strlen((dirent)->d_name)
00136
00137
00138 typedef struct {
00139 long handle;
00140 short offset;
00141 short finished;
00142 struct _finddata_t fileinfo;
00143 char *dir;
00144 struct dirent dent;
00145 } DIR;
00146
00147 #ifndef socklen_t
00148 #define socklen_t int
00149 #endif
00150
00151
00152 extern int gettimeofday(struct timeval *time_Info, struct timezone *timezone_Info);
00153 extern DIR *opendir(const char *);
00154 extern struct dirent *readdir(DIR *);
00155 extern int closedir(DIR *);
00156 extern void rewinddir(DIR *);
00157 extern int strncasecmp(const char *s1, const char *s2, int n);
00158 extern int strcasecmp(const char *s1, const char *s2);
00159 extern void service_register();
00160 extern void service_unregister();
00161 extern void service_handle();
00162
00163
00164 extern int bRunning;
00165
00166
00167 #define sleep(x) Sleep(x*1000)
00168
00169 #endif