wut/include/coreinit/event.h

77 lines
1.2 KiB
C
Raw Normal View History

2016-01-07 13:07:13 +01:00
#pragma once
#include <wut.h>
#include "thread.h"
#include "threadqueue.h"
2016-01-07 17:02:54 +01:00
/**
* \defgroup coreinit_event Event Object
* \ingroup coreinit
* @{
*/
2016-01-07 15:09:43 +01:00
#ifdef __cplusplus
extern "C" {
#endif
2016-01-07 13:07:13 +01:00
typedef struct OSEvent OSEvent;
typedef uint32_t OSEventMode;
2016-01-07 13:07:13 +01:00
enum OSEventMode
{
OS_EVENT_MODE_MANUAL = 0,
OS_EVENT_MODE_AUTO = 1,
};
#define OS_EVENT_TAG 0x65566E54u
2016-01-07 13:07:13 +01:00
struct OSEvent
{
uint32_t tag;
const char *name;
UNKNOWN(4);
BOOL value;
OSThreadQueue queue;
OSEventMode mode;
};
CHECK_OFFSET(OSEvent, 0x0, tag);
CHECK_OFFSET(OSEvent, 0x4, name);
CHECK_OFFSET(OSEvent, 0xc, value);
CHECK_OFFSET(OSEvent, 0x10, queue);
CHECK_OFFSET(OSEvent, 0x20, mode);
CHECK_SIZE(OSEvent, 0x24);
#pragma pack(pop)
void
OSInitEvent(OSEvent *event,
BOOL value,
OSEventMode mode);
void
OSInitEventEx(OSEvent *event,
BOOL value,
OSEventMode mode,
char *name);
void
OSSignalEvent(OSEvent *event);
void
OSSignalEventAll(OSEvent *event);
void
OSWaitEvent(OSEvent *event);
void
OSResetEvent(OSEvent *event);
BOOL
OSWaitEventWithTimeout(OSEvent *event,
OSTime timeout);
2016-01-07 15:09:43 +01:00
#ifdef __cplusplus
}
#endif
2016-01-07 17:02:54 +01:00
/** @} */