|
|
1.1 root 1: /* xpevent.h */
2:
3: /* *nix emulation of Win32 *Event API */
4:
5: /* $Id: xpevent.h,v 1.4 2005/01/24 10:46:07 deuce Exp $ */
6:
7: /****************************************************************************
8: * @format.tab-size 4 (Plain Text/Source Code File Header) *
9: * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
10: * *
11: * Copyright 2005 Rob Swindell - http://www.synchro.net/copyright.html *
12: * *
13: * This library is free software; you can redistribute it and/or *
14: * modify it under the terms of the GNU Lesser General Public License *
15: * as published by the Free Software Foundation; either version 2 *
16: * of the License, or (at your option) any later version. *
17: * See the GNU Lesser General Public License for more details: lgpl.txt or *
18: * http://www.fsf.org/copyleft/lesser.html *
19: * *
20: * Anonymous FTP access to the most recent released source is available at *
21: * ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
22: * *
23: * Anonymous CVS access to the development source and modification history *
24: * is available at cvs.synchro.net:/cvsroot/sbbs, example: *
25: * cvs -d :pserver:[email protected]:/cvsroot/sbbs login *
26: * (just hit return, no password is necessary) *
27: * cvs -d :pserver:[email protected]:/cvsroot/sbbs checkout src *
28: * *
29: * For Synchronet coding style and modification guidelines, see *
30: * http://www.synchro.net/source.html *
31: * *
32: * You are encouraged to submit any modifications (preferably in Unix diff *
33: * format) via e-mail to [email protected] *
34: * *
35: * Note: If this box doesn't appear square, then you need to fix your tabs. *
36: ****************************************************************************/
37:
38: #ifndef _XPEVENT_H_
39: #define _XPEVENT_H_
40:
41: #include <pthread.h>
42: #include "gen_defs.h"
43:
44: #if defined(__solaris__)
45: #include <xpsem.h> /* u_int32_t */
46: #endif
47:
48: /* Opaque type definition. */
49: struct xpevent;
50: typedef struct xpevent *xpevent_t;
51:
52: #if defined(__cplusplus)
53: extern "C" {
54: #endif
55: xpevent_t CreateEvent(void *sec, BOOL bManualReset, BOOL bInitialState, void *name);
56: BOOL SetEvent(xpevent_t event);
57: BOOL ResetEvent(xpevent_t event);
58: BOOL CloseEvent(xpevent_t event);
59: DWORD WaitForEvent(xpevent_t event, DWORD ms);
60: #if defined(__cplusplus)
61: }
62: #endif
63:
64: struct xpevent {
65: #define EVENT_MAGIC ((u_int32_t) 0x09fa4014)
66: u_int32_t magic;
67: pthread_mutex_t lock;
68: pthread_cond_t gtzero;
69: BOOL value;
70: BOOL mreset;
71: DWORD nwaiters;
72: };
73:
74: #define INFINITE ((DWORD)(-1))
75: enum {
76: WAIT_OBJECT_0
77: ,WAIT_TIMEOUT
78: ,WAIT_FAILED
79: };
80:
81: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.