~ubuntu-branches/ubuntu/utopic/tinymux/utopic

« back to all changes in this revision

Viewing changes to src/config.h

  • Committer: Bazaar Package Importer
  • Author(s): Ervin Hearn III
  • Date: 2008-04-11 23:18:25 UTC
  • mfrom: (1.1.5 upstream) (6.1.1 gutsy)
  • Revision ID: james.westby@ubuntu.com-20080411231825-1pq4trckagyk8roo
Tags: 2.6.5.27-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// config.h
2
2
//
3
 
// $Id: config.h,v 1.16 2006/09/05 23:42:17 sdennis Exp $
 
3
// $Id: config.h 3050 2007-12-30 06:36:06Z brazilofmux $
4
4
//
5
5
 
6
6
#ifndef CONFIG_H
21
21
 * Database R/W flags.
22
22
 */
23
23
 
24
 
#define MANDFLAGS  (V_LINK|V_PARENT|V_XFLAGS|V_ZONE|V_POWERS|V_3FLAGS|V_QUOTED)
25
 
#define OFLAGS     (V_DATABASE|V_ATRKEY|V_ATRNAME|V_ATRMONEY)
26
 
 
27
 
#define OUTPUT_VERSION  1
 
24
#define MANDFLAGS_V2  (V_LINK|V_PARENT|V_XFLAGS|V_ZONE|V_POWERS|V_3FLAGS|V_QUOTED)
 
25
#define OFLAGS_V2     (V_DATABASE|V_ATRKEY|V_ATRNAME|V_ATRMONEY)
 
26
 
 
27
#define MANDFLAGS_V3  (V_LINK|V_PARENT|V_XFLAGS|V_ZONE|V_POWERS|V_3FLAGS|V_QUOTED|V_ATRKEY)
 
28
#define OFLAGS_V3     (V_DATABASE|V_ATRNAME|V_ATRMONEY)
 
29
 
 
30
#define OUTPUT_VERSION  2
28
31
#ifdef MEMORY_BASED
29
 
#define OUTPUT_FLAGS    (MANDFLAGS)
 
32
#define OUTPUT_FLAGS    (MANDFLAGS_V2)
30
33
#else // MEMORY_BASED
31
 
#define OUTPUT_FLAGS    (MANDFLAGS|OFLAGS)
 
34
#define OUTPUT_FLAGS    (MANDFLAGS_V2|OFLAGS_V2)
32
35
#endif // MEMORY_BASED
33
36
 
34
 
#define UNLOAD_VERSION  1
35
 
#define UNLOAD_FLAGS    (MANDFLAGS)
 
37
#define UNLOAD_VERSION  2
 
38
#define UNLOAD_FLAGS    (MANDFLAGS_V2)
36
39
 
37
40
#define MIN_SUPPORTED_VERSION 1
38
 
#define MAX_SUPPORTED_VERSION 2
 
41
#define MAX_SUPPORTED_VERSION 3
39
42
 
40
43
/* magic lock cookies */
41
44
#define NOT_TOKEN   '!'
86
89
#if (_MSC_VER >= 1400)
87
90
// 1400 is Visual C++ 2005
88
91
#define LOCALTIME_TIME_T_MAX_VALUE 32535215999ui64
 
92
#define MUX_ULONG_PTR ULONG_PTR
 
93
#define MUX_PULONG_PTR PULONG_PTR
 
94
#elif (_MSC_VER >= 1200)
 
95
// 1310 is Visual C++ .NET 2003
 
96
// 1300 is Visual C++ .NET 2002
 
97
// 1200 is Visual C++ 6.0
 
98
#define MUX_ULONG_PTR DWORD
 
99
#define MUX_PULONG_PTR LPDWORD
 
100
#elif
 
101
#error TinyMUX Requires at least version 6.0 of Visual C++.
89
102
#endif
90
103
 
91
104
#define SIZEOF_PATHNAME (_MAX_PATH + 1)
92
 
#define SOCKET_WRITE(s,b,n,f) send(s,b,n,f)
93
 
#define SOCKET_READ(s,b,n,f) recv(s,b,n,f)
 
105
#define SOCKET_WRITE(s,b,n,f) send(s,b,static_cast<int>(n),f)
 
106
#define SOCKET_READ(s,b,n,f) recv(s,b,static_cast<int>(n),f)
94
107
#define SOCKET_CLOSE(s) closesocket(s)
95
108
#define IS_SOCKET_ERROR(cc) ((cc) == SOCKET_ERROR)
96
109
#define IS_INVALID_SOCKET(s) ((s) == INVALID_SOCKET)
98
111
#define SOCKET_EINTR       (WSAEINTR)
99
112
#define SOCKET_EWOULDBLOCK (WSAEWOULDBLOCK)
100
113
#define SOCKET_EBADF       (WSAEBADF)
101
 
#define popen _popen
102
 
#define pclose _pclose
 
114
 
 
115
#define popen       _popen
 
116
#define pclose      _pclose
 
117
#define mux_tzset   _tzset
 
118
#define mux_getpid  _getpid
 
119
#define mux_close   _close
 
120
#define mux_read    _read
 
121
#define mux_write   _write
 
122
#define mux_lseek   _lseek
103
123
 
104
124
#else // WIN32
105
125
 
106
126
#define DCL_CDECL
107
127
#define DCL_INLINE inline
108
 
#define INVALID_HANDLE_VALUE (-1)
109
128
#ifndef O_BINARY
110
129
#define O_BINARY 0
111
130
#endif // O_BINARY
123
142
#else // PATH_MAX
124
143
#define SIZEOF_PATHNAME (4095 + 1)
125
144
#endif // PATH_MAX
126
 
#define SOCKET_WRITE(s,b,n,f) write(s,b,n)
127
 
#define SOCKET_READ(s,b,n,f) read(s,b,n)
128
 
#define SOCKET_CLOSE(s) close(s)
 
145
#define SOCKET_WRITE(s,b,n,f) mux_write(s,b,n)
 
146
#define SOCKET_READ(s,b,n,f) mux_read(s,b,n)
 
147
#define SOCKET_CLOSE(s) mux_close(s)
129
148
#define IS_SOCKET_ERROR(cc) ((cc) < 0)
130
149
#define IS_INVALID_SOCKET(s) ((s) < 0)
131
150
#define SOCKET_LAST_ERROR (errno)
138
157
#define INVALID_SOCKET (-1)
139
158
#define SD_BOTH (2)
140
159
 
 
160
#define mux_tzset   tzset
 
161
#define mux_getpid  getpid
 
162
#define mux_close   close
 
163
#define mux_read    read
 
164
#define mux_write   write
 
165
#define mux_lseek   lseek
 
166
 
141
167
#endif // WIN32
142
168
 
143
169
#define isTRUE(x) ((x) != 0)
208
234
 
209
235
typedef   signed char INT8;
210
236
typedef unsigned char UINT8;
 
237
typedef UINT8  UTF8;
 
238
typedef UINT8 *PUTF8;
211
239
 
212
240
#ifndef HAVE_IN_ADDR_T
213
241
typedef UINT32 in_addr_t;