zpwin_osenv.h
5.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
/************************************************************************
Copyright (c) 2005-2007 by Juphoon System Software, Inc.
All rights reserved.
This software is confidential and proprietary to Juphoon System,
Inc. No part of this software may be reproduced, stored, transmitted,
disclosed or used in any form or by any means other than as expressly
provided by the written license agreement between Juphoon and its
licensee.
THIS SOFTWARE IS PROVIDED BY JUPHOON "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL JUPHOON BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Juphoon System Software, Inc.
Email: support@juphoon.com
Web: http://www.juphoon.com
************************************************************************/
/*************************************************
File name : zpwin_osenv.h
Module : windows os environment
Author : zocol
Version : 0.1
Created on : 2010-02-28
Description :
included files required by os environment
Modify History:
1. Date: Author: Modification:
*************************************************/
#ifndef _ZPWIN_OSENV_H__
#define _ZPWIN_OSENV_H__
/**
* @file zpwin_osenv.h
* @brief Included and typedefs files required by windows.
*
*/
/*lint -save -e* */
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <stdarg.h>
#include <time.h>
/*lint -restore */
/** @{ */
/* zos support ipv6 */
#define ZOS_SUPT_IPV6 ZTRUE
/** @} */
/* windows system */
#if ZPLATFORM == ZPLATFORM_WIN32
/*lint -save -e* */
/* is support ipv6 */
#ifdef ZOS_SUPT_IPV6
#include <winsock2.h>
#include <ws2tcpip.h>
#else
#include <winsock.h>
#endif
#if _MSC_VER > 1200
#include <iphlpapi.h>
#endif
#include <windows.h>
#include <fcntl.h>
#include <direct.h>
#include <sys/types.h>
#include <sys/stat.h>
/*lint -restore */
#ifdef _WIN64
#define ZOS_SUPT_64BIT
#endif
#endif
/** @{ */
#define ZFUNC_EXPORT _declspec(dllexport)
#define ZFUNC_IMPORT _declspec(dllimport)
#define ZFUNC_NORMAL
/** @} */
/** @{ */
/* zos function type */
#ifdef ZOS_SUPT_DLL_EXPORT /* export dll */
#define ZFUNC ZFUNC_EXPORT
#elif defined(ZOS_SUPT_DLL_IMPORT) /* import dll */
#define ZFUNC ZFUNC_IMPORT
#else /* static library */
#define ZFUNC ZFUNC_NORMAL
#endif
/** @} */
/** @{ */
/* windows data type */
typedef double ZDOUBLE; /**< @brief Type of double. */
typedef float ZFLOAT; /**< @brief Type of float. */
typedef __int64 ZLLONG; /**< @brief Type of longlong. */
typedef unsigned __int64 ZULLONG; /**< @brief Type of unsigned long long. */
typedef __int64 ZINT64; /**< @brief Type of longlong. */
typedef unsigned __int64 ZUINT64; /**< @brief Type of unsigned long long. */
#ifdef _WIN64
typedef __int64 ZLONG; /**< @brief Type of long. */
#else
typedef long ZLONG; /**< @brief Type of long. */
#endif
typedef int ZINT; /**< @brief Type of int. */
typedef short ZSHORT; /**< @brief Type of short. */
typedef char ZCHAR; /**< @brief Type of char. */
#ifdef _WIN64
typedef unsigned __int64 ZULONG; /**< @brief Type of unsigned long. */
#else
typedef unsigned int ZULONG; /**< @brief Type of unsigned long. */
#endif
typedef unsigned int ZUINT; /**< @brief Type of unsigned int. */
typedef size_t ZSIZE_T; /**< @brief Type of size_t. */
typedef unsigned short ZUSHORT; /**< @brief Type of unsinged short. */
typedef unsigned char ZUCHAR; /**< @brief Type of unsigned char. */
typedef int ZBOOL; /**< @brief Type of int. */
typedef void ZVOID; /**< @brief Type of void. */
typedef void * ZHTTPOBJ; /**< @biref Type of http object. */
/** @} */
/** @{ */
typedef time_t ZTIME_T; /**< @brief Type of time_t. */
typedef LONGLONG ZHRTIME_T; /**< @brief Type of high resolution time. */
/** @} */
/** @{ */
typedef struct tagZOS_TIMESPEC
{
ZTIME_T tv_sec; /* seconds */
ZLONG tv_nsec; /* nanoseconds (0 -1,000,000,000) */
} ST_ZOS_TIMESPEC;
/** @} */
/** @{ */
typedef struct tm ST_ZOS_TM; /**< @brief Type of tm. */
/** @} */
/** @{ */
typedef HANDLE ZTHREAD_ID; /**< @brief Type of thread id. */
/** @} */
/** @{ */
typedef CRITICAL_SECTION ZMUTEX; /**< @brief Type of mutex. */
typedef SRWLOCK ZSHAREX; /**< @brief Type of shared-exclusive lock. */
typedef HANDLE ZSEM; /**< @brief Type of semaphore. */
/** @} */
/** @{ */
typedef SOCKET ZSOCKET; /**< @brief Type of socket. */
#define ZSOCKET_INVALID INVALID_SOCKET /**< @brief Invalid socket. */
/** @} */
/** @{ */
typedef va_list ZVA_LIST; /**< @brief Variable argument list. */
/** @} */
/** @{ */
/* variable argument list macro definitions */
#define ZOS_VA_START(_ap, _last) va_start(_ap, _last)
#define ZOS_VA_END(_ap) va_end(_ap)
#define ZOS_VA_ARG(_ap, _type) va_arg(_ap, _type)
/** @} */
#endif /* _ZPWIN_OSENV_H__ */