summaryrefslogtreecommitdiff
path: root/pr/include/md/_win16.h
blob: 15edc7db789b9b2516c204c32dc91e5cc75c104e (plain)
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 
 * The contents of this file are subject to the Mozilla Public
 * License Version 1.1 (the "License"); you may not use this file
 * except in compliance with the License. You may obtain a copy of
 * the License at http://www.mozilla.org/MPL/
 * 
 * Software distributed under the License is distributed on an "AS
 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
 * implied. See the License for the specific language governing
 * rights and limitations under the License.
 * 
 * The Original Code is the Netscape Portable Runtime (NSPR).
 * 
 * The Initial Developer of the Original Code is Netscape
 * Communications Corporation.  Portions created by Netscape are 
 * Copyright (C) 1998-2000 Netscape Communications Corporation.  All
 * Rights Reserved.
 * 
 * Contributor(s):
 * 
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL"), in which case the provisions of the GPL are applicable 
 * instead of those above.  If you wish to allow use of your 
 * version of this file only under the terms of the GPL and not to
 * allow others to use your version of this file under the MPL,
 * indicate your decision by deleting the provisions above and
 * replace them with the notice and other provisions required by
 * the GPL.  If you do not delete the provisions above, a recipient
 * may use your version of this file under either the MPL or the
 * GPL.
 */

#ifndef nspr_win16_defs_h___
#define nspr_win16_defs_h___

#include <windows.h>
#include <winsock.h>
#include <errno.h>
#include <direct.h>

#include "nspr.h"
/* $$ fix this */
#define Remind(x)

/*
 * Internal configuration macros
 */

#define PR_LINKER_ARCH      "win16"
#define _PR_SI_SYSNAME        "WIN16"
#define _PR_SI_ARCHITECTURE   "x86"    /* XXXMB hardcode for now */

#define HAVE_DLL
#define _PR_NO_PREEMPT
#define _PR_LOCAL_THREADS_ONLY
#undef  _PR_GLOBAL_THREADS_ONLY
#undef  HAVE_THREAD_AFFINITY
#define _PR_HAVE_ATOMIC_OPS

/* --- Common User-Thread/Native-Thread Definitions --------------------- */

extern struct PRLock        *_pr_schedLock;
extern char                 * _pr_top_of_task_stack;


/* --- Typedefs --- */

#define PR_NUM_GCREGS           9
typedef PRInt32	               PR_CONTEXT_TYPE[PR_NUM_GCREGS];

#define _MD_MAGIC_THREAD	0x22222222
#define _MD_MAGIC_THREADSTACK	0x33333333
#define _MD_MAGIC_SEGMENT	0x44444444
#define _MD_MAGIC_DIR		0x55555555
#define _MD_MAGIC_CV        0x66666666


typedef struct _PRWin16PollDesc
{
	PRInt32 osfd;
	PRInt16 in_flags;
	PRInt16 out_flags;
} _PRWin16PollDesc;

typedef struct PRPollQueue
{
    PRCList links;              /* for linking PRPollQueue's together */
    _PRWin16PollDesc *pds;      /* array of poll descriptors */
    PRUintn npds;				/* length of the array */
    PRPackedBool on_ioq;        /* is this on the async i/o work q? */
    PRIntervalTime timeout;     /* timeout, in ticks */
    struct PRThread *thr;
} PRPollQueue;

#define _PR_POLLQUEUE_PTR(_qp) \
    ((PRPollQueue *) ((char*) (_qp) - offsetof(PRPollQueue,links)))

NSPR_API(PRInt32) _PR_WaitForFD(PRInt32 osfd, PRUintn how,
					PRIntervalTime timeout);
NSPR_API(void) _PR_Unblock_IO_Wait(struct PRThread *thr);

#define _PR_MD_MAX_OSFD             FD_SETSIZE
#define _PR_IOQ(_cpu)				((_cpu)->md.ioQ)
#define _PR_ADD_TO_IOQ(_pq, _cpu) 	PR_APPEND_LINK(&_pq.links, &_PR_IOQ(_cpu))
#define _PR_FD_READ_SET(_cpu)		((_cpu)->md.fd_read_set)
#define _PR_FD_READ_CNT(_cpu)		((_cpu)->md.fd_read_cnt)
#define _PR_FD_WRITE_SET(_cpu)		((_cpu)->md.fd_write_set)
#define _PR_FD_WRITE_CNT(_cpu)		((_cpu)->md.fd_write_cnt)
#define _PR_FD_EXCEPTION_SET(_cpu)	((_cpu)->md.fd_exception_set)
#define _PR_FD_EXCEPTION_CNT(_cpu)	((_cpu)->md.fd_exception_cnt)
#define _PR_IOQ_TIMEOUT(_cpu)		((_cpu)->md.ioq_timeout)
#define _PR_IOQ_MAX_OSFD(_cpu)		((_cpu)->md.ioq_max_osfd)

struct _MDCPU {
    PRCList		ioQ;
    fd_set		fd_read_set, fd_write_set, fd_exception_set;
    PRInt16		fd_read_cnt[_PR_MD_MAX_OSFD],fd_write_cnt[_PR_MD_MAX_OSFD],
				fd_exception_cnt[_PR_MD_MAX_OSFD];
    PRUint32	ioq_timeout;
    PRInt32		ioq_max_osfd;
};

struct _MDThread {
    /* The overlapped structure must be first! */
    HANDLE           blocked_sema;      /* Threads block on this when waiting
                                         * for IO or CondVar.
                                         */
    PRInt32         errcode;        /* preserved errno for this thread */
    CATCHBUF        context;        /* thread context for Throw() */
    void           *SP;             /* Stack pointer, used only by GarbColl */
    int             threadNumber;   /* instrumentation: order of creation */
	_PRWin16PollDesc thr_pd;       /* poll descriptor for i/o */
	PRPollQueue		thr_pq;        /* i/o parameters			*/
    void           *exceptionContext; /* mfc exception context */
    char            guardBand[24];  /* don't overwrite this */
    PRUint32        magic;          /* self identifier, for debug */
};

struct _MDThreadStack {
    PRUint32           magic;          /* for debugging */
    PRIntn          cxByteCount;    /* number of stack bytes to move */
    char *          stackTop;       /* high address on stack */
};

struct _MDSegment {
    PRUint32           magic;          /* for debugging */
};


struct _MDLock {
    PRUint32           magic;          /* for debugging */
    PRUint32           mutex;
};

struct _MDDir {
    PRUint32         magic;          /* for debugging */
    struct  dirent  *dir;
};

struct _MDCVar {
	PRUint32        magic;
};

struct _MDSemaphore {
	PRInt32			unused;
};

struct _MDFileDesc {
    PRInt32 osfd;
};

struct _MDProcess {
    HANDLE handle;
    DWORD id;
};

/*
** Microsoft 'struct _stat'
** ... taken directly from msvc 1.52c's header file sys/stat.h
** see PR_Stat() implemented in w16io.c
** See BugSplat: 98516
*/
#pragma pack(push)
#pragma pack(2)

typedef unsigned short _ino_t;
typedef short _dev_t;
typedef long _off_t;

typedef struct _MDMSStat {
    _dev_t st_dev;
    _ino_t st_ino;
    unsigned short st_mode;
    short st_nlink;
    short st_uid;
    short st_gid;
    _dev_t st_rdev;
    _off_t st_size;
    time_t st_atime;
    time_t st_mtime;
    time_t st_ctime;
} _MDMSStat;
#pragma pack(pop)

/* --- Errors --- */
    /* These are NSPR generated error codes which need to be unique from
     * OS error codes.
     */
#define _MD_UNIQUEBASE                 50000
#define _MD_EINTERRUPTED               _MD_UNIQUEBASE + 1
#define _MD_ETIMEDOUT                  _MD_UNIQUEBASE + 2
#define _MD_EIO                        _MD_UNIQUEBASE + 3

struct PRProcess;
struct PRProcessAttr;

/* --- Create a new process --- */
#define _MD_CREATE_PROCESS _PR_CreateWindowsProcess
extern struct PRProcess * _PR_CreateWindowsProcess(
    const char *path,
    char *const *argv,
    char *const *envp,
    const struct PRProcessAttr *attr
);

#define _MD_DETACH_PROCESS _PR_DetachWindowsProcess
extern PRStatus _PR_DetachWindowsProcess(struct PRProcess *process);

/* --- Wait for a child process to terminate --- */
#define _MD_WAIT_PROCESS _PR_WaitWindowsProcess
extern PRStatus _PR_WaitWindowsProcess(struct PRProcess *process, 
    PRInt32 *exitCode);

#define _MD_KILL_PROCESS _PR_KillWindowsProcess
extern PRStatus _PR_KillWindowsProcess(struct PRProcess *process);


/* --- Misc stuff --- */

#define MD_ASSERTINT( x )             PR_ASSERT( (x) < 65535 )

/* --- IO stuff --- */
#define MAX_PATH    256
#define _MD_ERRNO()                   errno
#define GetLastError()                errno

#define _MD_GET_FILE_ERROR()          errno
#define _MD_SET_FILE_ERROR(_err)      errno = (_err)

#define _MD_OPEN                      _PR_MD_OPEN
#define _MD_READ                      _PR_MD_READ
#define _MD_WRITE                     _PR_MD_WRITE
#define _MD_WRITEV                    _PR_MD_WRITEV
#define _MD_LSEEK                     _PR_MD_LSEEK
#define _MD_LSEEK64                   _PR_MD_LSEEK64
#define _MD_CLOSE_FILE                _PR_MD_CLOSE_FILE
#define _MD_GETFILEINFO               _PR_MD_GETFILEINFO
#define _MD_GETOPENFILEINFO           _PR_MD_GETOPENFILEINFO
#define _MD_STAT                      _PR_MD_STAT
#define _MD_RENAME                    _PR_MD_RENAME     
#define _MD_ACCESS                    _PR_MD_ACCESS     
#define _MD_DELETE                    _PR_MD_DELETE     
#define _MD_MKDIR                     _PR_MD_MKDIR      
#define _MD_RMDIR                     _PR_MD_RMDIR      
#define _MD_LOCKFILE                  _PR_MD_LOCKFILE
#define _MD_TLOCKFILE                 _PR_MD_TLOCKFILE
#define _MD_UNLOCKFILE                _PR_MD_UNLOCKFILE


/* --- Socket IO stuff --- */
#define _MD_EACCES                WSAEACCES
#define _MD_EADDRINUSE            WSAEADDRINUSE
#define _MD_EADDRNOTAVAIL         WSAEADDRNOTAVAIL
#define _MD_EAFNOSUPPORT          WSAEAFNOSUPPORT
#define _MD_EAGAIN                WSAEWOULDBLOCK
#define _MD_EALREADY              WSAEALREADY
#define _MD_EBADF                 WSAEBADF
#define _MD_ECONNREFUSED          WSAECONNREFUSED
#define _MD_ECONNRESET            WSAECONNRESET
#define _MD_EFAULT                WSAEFAULT
#define _MD_EINPROGRESS           WSAEINPROGRESS
#define _MD_EINTR                 WSAEINTR
#define _MD_EINVAL                EINVAL
#define _MD_EISCONN               WSAEISCONN
#define _MD_ENETUNREACH           WSAENETUNREACH
#define _MD_ENOENT                ENOENT
#define _MD_ENOTCONN              WSAENOTCONN
#define _MD_ENOTSOCK              WSAENOTSOCK
#define _MD_EOPNOTSUPP            WSAEOPNOTSUPP
#define _MD_EWOULDBLOCK           WSAEWOULDBLOCK
#define _MD_GET_SOCKET_ERROR()    WSAGetLastError()
#define _MD_SET_SOCKET_ERROR(_err) WSASetLastError(_err)

#define _MD_INIT_FILEDESC(fd)
#define _MD_MAKE_NONBLOCK             _PR_MD_MAKE_NONBLOCK
#define _MD_SHUTDOWN                  _PR_MD_SHUTDOWN
#define _MD_LISTEN                      _PR_MD_LISTEN
#define _MD_CLOSE_SOCKET              _PR_MD_CLOSE_SOCKET
#define _MD_SENDTO                    _PR_MD_SENDTO
#define _MD_RECVFROM                  _PR_MD_RECVFROM
#define _MD_SOCKETPAIR(s, type, proto, sv) -1
#define _MD_GETSOCKNAME               _PR_MD_GETSOCKNAME
#define _MD_GETPEERNAME               _PR_MD_GETPEERNAME
#define _MD_GETSOCKOPT                _PR_MD_GETSOCKOPT
#define _MD_SETSOCKOPT                _PR_MD_SETSOCKOPT
#define _MD_SELECT                    select
#define _MD_FSYNC                     _PR_MD_FSYNC
#define _MD_SOCKETAVAILABLE           _PR_MD_SOCKETAVAILABLE

#define _MD_INIT_ATOMIC()
#define _MD_ATOMIC_INCREMENT(x)       (*x++)
#define _MD_ATOMIC_ADD(ptr, val)      ((*x) += val)
#define _MD_ATOMIC_DECREMENT(x)       (*x--)
#define _MD_ATOMIC_SET(x,y)           (*x, y)

#define _MD_INIT_IO                   _PR_MD_INIT_IO

/* win95 doesn't have async IO */
#define _MD_SOCKET                    _PR_MD_SOCKET
#define _MD_CONNECT                   _PR_MD_CONNECT
#define _MD_ACCEPT                    _PR_MD_ACCEPT
#define _MD_BIND                      _PR_MD_BIND
#define _MD_RECV                      _PR_MD_RECV
#define _MD_SEND                      _PR_MD_SEND

#define _MD_CHECK_FOR_EXIT()

/* --- Scheduler stuff --- */
#define _MD_PAUSE_CPU                 _PR_MD_PAUSE_CPU

/* --- DIR stuff --- */
#define PR_DIRECTORY_SEPARATOR        '\\'
#define PR_DIRECTORY_SEPARATOR_STR    "\\"
#define PR_PATH_SEPARATOR		';'
#define PR_PATH_SEPARATOR_STR		";"
#define _MD_OPEN_DIR                  _PR_MD_OPEN_DIR
#define _MD_CLOSE_DIR                 _PR_MD_CLOSE_DIR
#define _MD_READ_DIR                  _PR_MD_READ_DIR

/* --- Segment stuff --- */
#define _MD_INIT_SEGS()
#define _MD_ALLOC_SEGMENT           _MD_AllocSegment
#define _MD_FREE_SEGMENT            _MD_FreeSegment

/* --- Environment Stuff --- */
#define _MD_GET_ENV                 _PR_MD_GET_ENV
#define _MD_PUT_ENV                 _PR_MD_PUT_ENV

/* --- Threading Stuff --- */
#define _MD_DEFAULT_STACK_SIZE      32767L
#define _MD_INIT_THREAD             _PR_MD_INIT_THREAD
#define _MD_CREATE_THREAD(t,f,p,sc,st,stsiz) (PR_SUCCESS)
#define _MD_YIELD                   _PR_MD_YIELD
#define _MD_SET_PRIORITY(t,p)            
#define _MD_CLEAN_THREAD(t)
#define _MD_SETTHREADAFFINITYMASK   _PR_MD_SETTHREADAFFINITYMASK
#define _MD_GETTHREADAFFINITYMASK   _PR_MD_GETTHREADAFFINITYMASK
#define _MD_EXIT_THREAD
#define _MD_SUSPEND_THREAD          _PR_MD_SUSPEND_THREAD
#define _MD_RESUME_THREAD           _PR_MD_RESUME_THREAD
#define _MD_SUSPEND_CPU             _PR_MD_SUSPEND_CPU
#define _MD_RESUME_CPU              _PR_MD_RESUME_CPU
#define _MD_BEGIN_SUSPEND_ALL()
#define _MD_BEGIN_RESUME_ALL()
#define _MD_END_SUSPEND_ALL()
#define _MD_END_RESUME_ALL()

/* --- Lock stuff --- */
/*
** Win16 does not need MD locks.
*/
#define _PR_LOCK                    _MD_LOCK
#define _PR_UNLOCK                  _MD_UNLOCK

#define _MD_NEW_LOCK(l)             (PR_SUCCESS)
#define _MD_FREE_LOCK(l)
#define _MD_LOCK(l)
#define _MD_TEST_AND_LOCK(l)        (-1)
#define _MD_UNLOCK(l)

/* --- lock and cv waiting --- */
#define _MD_WAIT                      _PR_MD_WAIT
#define _MD_WAKEUP_WAITER(a)
#define _MD_WAKEUP_CPUS               _PR_MD_WAKEUP_CPUS

/* --- CVar ------------------- */
#define _MD_WAIT_CV					  _PR_MD_WAIT_CV
#define _MD_NEW_CV					  _PR_MD_NEW_CV
#define _MD_FREE_CV					  _PR_MD_FREE_CV
#define _MD_NOTIFY_CV				  _PR_MD_NOTIFY_CV	
#define _MD_NOTIFYALL_CV			  _PR_MD_NOTIFYALL_CV

   /* XXXMB- the IOQ stuff is certainly not working correctly yet. */
#define _MD_IOQ_LOCK()                
#define _MD_IOQ_UNLOCK()              


/* --- Initialization stuff --- */
NSPR_API(void) _MD_INIT_RUNNING_CPU(struct _PRCPU *cpu );
#define _MD_START_INTERRUPTS()
#define _MD_STOP_INTERRUPTS()
#define _MD_DISABLE_CLOCK_INTERRUPTS()
#define _MD_ENABLE_CLOCK_INTERRUPTS()
#define _MD_BLOCK_CLOCK_INTERRUPTS()
#define _MD_UNBLOCK_CLOCK_INTERRUPTS()
#define _MD_EARLY_INIT                  _PR_MD_EARLY_INIT
#define _MD_FINAL_INIT                  _PR_MD_FINAL_INIT
#define _MD_INIT_CPUS()

/* --- User Threading stuff --- */
#define _MD_EXIT

#define _MD_CLEANUP_BEFORE_EXIT              _PR_MD_CLEANUP_BEFORE_EXIT

/* --- Intervals --- */
#define _MD_INTERVAL_INIT                 _PR_MD_INTERVAL_INIT
#define _MD_GET_INTERVAL                  _PR_MD_GET_INTERVAL
#define _MD_INTERVAL_PER_SEC              _PR_MD_INTERVAL_PER_SEC
#define _MD_INTERVAL_PER_MILLISEC()       (_PR_MD_INTERVAL_PER_SEC() / 1000)
#define _MD_INTERVAL_PER_MICROSEC()       (_PR_MD_INTERVAL_PER_SEC() / 1000000)

/* --- Scheduler stuff --- */
#define LOCK_SCHEDULER()                 0
#define UNLOCK_SCHEDULER()               0
#define _PR_LockSched()                	 0
#define _PR_UnlockSched()                0

/* --- Initialization stuff --- */
#define _MD_INIT_LOCKS()

/* --- Stack stuff --- */
#define _MD_INIT_STACK                   _PR_MD_INIT_STACK
#define _MD_CLEAR_STACK(stack)

/*
** Watcom needs to see this to make the linker work.
**
*/
NSPR_API(void) _PR_NativeDestroyThread(PRThread *thread);
NSPR_API(void) _PR_UserDestroyThread(PRThread *thread);


/*
** If thread emulation is used, then setjmp/longjmp stores the register
** state of each thread.
**
** CatchBuf layout:
**  context[0] - IP
**  context[1] - CS
**  context[2] - SP
**  context[3] - BP
**  context[4] - SI
**  context[5] - DI
**  context[6] - DS
**  context[7] - ?? (maybe flags)
**  context[8] - SS
*/
#define PR_CONTEXT_TYPE     CATCHBUF
#define PR_NUM_GCREGS       9

#define _MD_GET_SP(thread)  ((thread)->md.SP)
#define CONTEXT(_t)  ((_t)->md.context)

/*
** Initialize a thread context to run "e(o,a)" when started
*/
#define _MD_INIT_CONTEXT(_t, sp, epa, stat )   \
{                                              \
     *(stat) = PR_TRUE;                        \
     Catch((_t)->md.context );             \
     (_t)->md.context[0] = OFFSETOF(epa);         \
     (_t)->md.context[1] = SELECTOROF(epa);                       \
     (_t)->md.context[2] = OFFSETOF(_pr_top_of_task_stack - 64);  \
     (_t)->md.context[3]  = 0;                 \
}

#define _MD_SWITCH_CONTEXT(_t)                 \
    if (!Catch((_t)->md.context)) {            \
        int     garbCollPlaceHolder;           \
        (_t)->md.errcode = errno;              \
        (_t)->md.SP = &garbCollPlaceHolder;    \
        _PR_Schedule();                        \
    }

#define _MD_SAVE_CONTEXT(_t)                    \
    {                                           \
        int     garbCollPlaceHolder;            \
        Catch((_t)->md.context);                \
        (_t)->md.errcode = errno;               \
        (_t)->md.SP = &garbCollPlaceHolder;     \
    }

/*
** Restore a thread context, saved by _MD_SWITCH_CONTEXT
*/
#define _PR_MD_RESTORE_CONTEXT  _MD_RESTORE_CONTEXT

/*
 * Memory-mapped files
 */

struct _MDFileMap {
    PRInt8 unused;
};

extern PRStatus _MD_CreateFileMap(struct PRFileMap *fmap, PRInt64 size);
#define _MD_CREATE_FILE_MAP _MD_CreateFileMap

extern PRInt32 _MD_GetMemMapAlignment(void);
#define _MD_GET_MEM_MAP_ALIGNMENT _MD_GetMemMapAlignment

extern void * _MD_MemMap(struct PRFileMap *fmap, PRInt64 offset,
        PRUint32 len);
#define _MD_MEM_MAP _MD_MemMap

extern PRStatus _MD_MemUnmap(void *addr, PRUint32 size);
#define _MD_MEM_UNMAP _MD_MemUnmap

extern PRStatus _MD_CloseFileMap(struct PRFileMap *fmap);
#define _MD_CLOSE_FILE_MAP _MD_CloseFileMap


/* --- Error mapping ----------------------------------- */
extern void _PR_MD_map_error( int err );

#define _PR_MD_MAP_OPENDIR_ERROR        _PR_MD_map_error
#define _PR_MD_MAP_CLOSEDIR_ERROR       _PR_MD_map_error
#define _PR_MD_MAP_READDIR_ERROR        _PR_MD_map_error
#define _PR_MD_MAP_DELETE_ERROR         _PR_MD_map_error
#define _PR_MD_MAP_STAT_ERROR           _PR_MD_map_error
#define _PR_MD_MAP_FSTAT_ERROR          _PR_MD_map_error
#define _PR_MD_MAP_RENAME_ERROR         _PR_MD_map_error
#define _PR_MD_MAP_ACCESS_ERROR         _PR_MD_map_error
#define _PR_MD_MAP_MKDIR_ERROR          _PR_MD_map_error
#define _PR_MD_MAP_RMDIR_ERROR          _PR_MD_map_error
#define _PR_MD_MAP_READ_ERROR           _PR_MD_map_error
#define _PR_MD_MAP_TRANSMITFILE_ERROR   _PR_MD_map_error
#define _PR_MD_MAP_WRITE_ERROR          _PR_MD_map_error
#define _PR_MD_MAP_LSEEK_ERROR          _PR_MD_map_error
#define _PR_MD_MAP_FSYNC_ERROR          _PR_MD_map_error
#define _PR_MD_MAP_CLOSE_ERROR          _PR_MD_map_error
#define _PR_MD_MAP_SOCKET_ERROR         _PR_MD_map_error
#define _PR_MD_MAP_RECV_ERROR           _PR_MD_map_error
#define _PR_MD_MAP_RECVFROM_ERROR       _PR_MD_map_error
#define _PR_MD_MAP_SEND_ERROR           _PR_MD_map_error
#define _PR_MD_MAP_SENDTO_ERROR         _PR_MD_map_error
#define _PR_MD_MAP_ACCEPT_ERROR         _PR_MD_map_error
#define _PR_MD_MAP_ACCEPTEX_ERROR       _PR_MD_map_error
#define _PR_MD_MAP_CONNECT_ERROR        _PR_MD_map_error
#define _PR_MD_MAP_BIND_ERROR           _PR_MD_map_error
#define _PR_MD_MAP_LISTEN_ERROR         _PR_MD_map_error
#define _PR_MD_MAP_SHUTDOWN_ERROR       _PR_MD_map_error
#define _PR_MD_MAP_GETSOCKNAME_ERROR    _PR_MD_map_error
#define _PR_MD_MAP_GETPEERNAME_ERROR    _PR_MD_map_error
#define _PR_MD_MAP_GETSOCKOPT_ERROR     _PR_MD_map_error
#define _PR_MD_MAP_SETSOCKOPT_ERROR     _PR_MD_map_error
#define _PR_MD_MAP_OPEN_ERROR           _PR_MD_map_error
#define _PR_MD_MAP_GETHOSTNAME_ERROR    _PR_MD_map_error
#define _PR_MD_MAP_SELECT_ERROR         _PR_MD_map_error
#define _PR_MD_MAP_LOCKF_ERROR          _PR_MD_map_error
#define _PR_MD_MAP_WSASTARTUP_ERROR     _PR_MD_map_error

#endif /* nspr_win16_defs_h___ */