~ubuntu-branches/ubuntu/raring/clamav/raring-updates

« back to all changes in this revision

Viewing changes to win32/platform.h

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2011-06-18 11:56:34 UTC
  • mfrom: (0.35.21 sid)
  • Revision ID: james.westby@ubuntu.com-20110618115634-u2lovivet0qx34d0
Tags: 0.97.1+dfsg-1ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop build-dep on electric-fence (in Universe)
  - Add apparmor profiles for clamd and freshclam along with maintainer
    script changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef __PLATFORM_H
2
 
#define __PLATFORM_H
3
 
 
4
 
#include <winsock2.h>
5
 
#include <windows.h>
6
 
#include <stdio.h>
7
 
#include <stdlib.h>
8
 
#include <io.h>
9
 
#include <fcntl.h>
10
 
#include <direct.h>
11
 
#include <Ws2tcpip.h>
12
 
#include <process.h>
13
 
 
14
 
#ifdef __cplusplus
15
 
extern "C"
16
 
{
17
 
#endif
18
 
 
19
 
#include "gettimeofday.h"
20
 
#include "snprintf.h"
21
 
#include "net.h"
22
 
#include "w32_errno.h"
23
 
#include "w32_stat.h"
24
 
#include "random.h"
25
 
 
26
 
#ifdef __cplusplus
27
 
}
28
 
#else
29
 
typedef unsigned short mode_t;
30
 
#endif
31
 
 
32
 
#ifdef _WIN64
33
 
#define SIZEOF_VOID_P 8
34
 
#else
35
 
#define SIZEOF_VOID_P 4
36
 
#endif
37
 
 
38
 
#define strcasecmp lstrcmpi
39
 
#define strncasecmp strnicmp
40
 
#define mkdir(path, mode) mkdir(path)
41
 
#define sleep(sex) Sleep(1000*(sex))
42
 
#define getuid() 0
43
 
#define getgid() 0
44
 
 
45
 
char *strptime(const char *s, const char *format, struct tm *tm);
46
 
 
47
 
#define srand w32_srand
48
 
#define rand w32_rand
49
 
#define socket w32_socket
50
 
#define getsockopt w32_getsockopt
51
 
#define setsockopt w32_setsockopt
52
 
#define bind w32_bind
53
 
#define listen w32_listen
54
 
#define accept w32_accept
55
 
#define connect w32_connect
56
 
#define shutdown w32_shutdown
57
 
#define send w32_send
58
 
#define recv w32_recv
59
 
#define closesocket w32_closesocket
60
 
#define getservbyname w32_getservbyname
61
 
#define getaddrinfo w32_getaddrinfo
62
 
#ifdef gai_strerror
63
 
#undef gai_strerror
64
 
#endif
65
 
#define gai_strerror w32_strerror
66
 
#define freeaddrinfo w32_freeaddrinfo
67
 
#define inet_ntop w32_inet_ntop
68
 
#define gethostbyname w32_gethostbyname
69
 
#define select w32_select
70
 
#define poll w32_poll
71
 
#define strerror w32_strerror
72
 
#define strerror_r w32_strerror_r
73
 
#define ftruncate _chsize
74
 
#define getpid GetCurrentProcessId
75
 
 
76
 
#define PATH_MAX 32767
77
 
#define SEARCH_LIBDIR ""
78
 
#define WORDS_BIGENDIAN 0
79
 
#define EAI_SYSTEM 0
80
 
 
81
 
#ifndef MIN
82
 
#define MIN(a, b)       (((a) < (b)) ? (a) : (b))
83
 
#endif
84
 
#ifndef MAX
85
 
#define MAX(a,b)        (((a) > (b)) ? (a) : (b))
86
 
#endif
87
 
 
88
 
#ifndef HAVE_IN_PORT_T
89
 
typedef unsigned        short   in_port_t;
90
 
#endif
91
 
 
92
 
#ifndef HAVE_IN_ADDR_T
93
 
typedef unsigned        int     in_addr_t;
94
 
#endif
95
 
 
96
 
#define PATHSEP "\\"
97
 
 
98
 
void w32_glob(int *argc_ptr, char ***argv_ptr);
99
 
 
100
 
#undef DATADIR
101
 
#undef CONFDIR
102
 
#if !defined(THIS_IS_LIBCLAMAV) && defined(_MSC_VER)
103
 
#define LIBCLAMAV_EXPORT __declspec(dllimport)
104
 
#else
105
 
#define LIBCLAMAV_EXPORT
106
 
#endif
107
 
LIBCLAMAV_EXPORT extern const char *DATADIR;
108
 
LIBCLAMAV_EXPORT extern const char *CONFDIR;
109
 
LIBCLAMAV_EXPORT extern const char *CONFDIR_CLAMD;
110
 
LIBCLAMAV_EXPORT extern const char *CONFDIR_FRESHCLAM;
111
 
LIBCLAMAV_EXPORT extern const char *CONFDIR_MILTER;
112
 
#undef HAVE_CONFIG_H
113
 
 
114
 
#ifdef OUT
115
 
#undef OUT
116
 
#endif
117
 
 
118
 
int real_main(int, char**);
119
 
#define main main(int argc, char **argv) { _setmode(_fileno(stdin), _O_BINARY); w32_glob(&argc, &argv); return real_main(argc, argv); }; int real_main
120
 
 
121
 
#endif /* __PLATFORM_H */
122