forked from neosmart/pevents
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpevents.h
42 lines (36 loc) · 1.15 KB
/
pevents.h
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
/*
* WIN32 Events for POSIX
* Author: Mahmoud Al-Qudsi <[email protected]>
* Copyright (C) 2011 - 2015 by NeoSmart Technologies
* This code is released under the terms of the MIT License
*/
#pragma once
#if defined(_WIN32) && !defined(CreateEvent)
#error Must include Windows.h prior to including pevents.h!
#endif
#ifndef WAIT_TIMEOUT
#include <errno.h>
#define WAIT_TIMEOUT ETIMEDOUT
#endif
#include <stdint.h>
namespace neosmart
{
//Type declarations
struct neosmart_event_t_;
typedef neosmart_event_t_ * neosmart_event_t;
//WIN32-style functions
neosmart_event_t CreateEvent(bool manualReset = false, bool initialState = false);
int DestroyEvent(neosmart_event_t event);
int WaitForEvent(neosmart_event_t event, uint64_t milliseconds = -1);
int SetEvent(neosmart_event_t event);
int ResetEvent(neosmart_event_t event);
#ifdef WFMO
int WaitForMultipleEvents(neosmart_event_t *events, int count, bool waitAll, uint64_t milliseconds);
int WaitForMultipleEvents(neosmart_event_t *events, int count, bool waitAll, uint64_t milliseconds, int &index);
#endif
#ifdef PULSE
int PulseEvent(neosmart_event_t event);
#endif
//POSIX-style functions
//TBD
}