summaryrefslogtreecommitdiff
path: root/src/os/events_windows.h
diff options
context:
space:
mode:
authorZoRo <dos21h@gmail.com>2022-02-19 12:47:26 +0000
committerZoRo <dos21h@gmail.com>2022-02-19 12:47:26 +0000
commit3d7c48a6e5c5c532cdd66b3ba5a8c5911bcf2383 (patch)
treeb60e21b31eb84cbcbfa97bc10a3cdf1180ce82da /src/os/events_windows.h
downloadlibrusb-3d7c48a6e5c5c532cdd66b3ba5a8c5911bcf2383.tar.gz
librusb-3d7c48a6e5c5c532cdd66b3ba5a8c5911bcf2383.zip
Initial
Diffstat (limited to 'src/os/events_windows.h')
-rw-r--r--src/os/events_windows.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/os/events_windows.h b/src/os/events_windows.h
new file mode 100644
index 0000000..0c5e0b0
--- /dev/null
+++ b/src/os/events_windows.h
@@ -0,0 +1,46 @@
+/*
+ * libusb event abstraction on Microsoft Windows
+ *
+ * Copyright © 2020 Chris Dickens <christopher.a.dickens@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef LIBUSB_EVENTS_WINDOWS_H
+#define LIBUSB_EVENTS_WINDOWS_H
+
+typedef HANDLE usbi_os_handle_t;
+#define USBI_OS_HANDLE_FORMAT_STRING "HANDLE %p"
+
+typedef struct usbi_event {
+ HANDLE hEvent;
+} usbi_event_t;
+#define USBI_EVENT_OS_HANDLE(e) ((e)->hEvent)
+#define USBI_EVENT_POLL_EVENTS 0
+#define USBI_INVALID_EVENT { INVALID_HANDLE_VALUE }
+
+#define HAVE_OS_TIMER 1
+typedef struct usbi_timer {
+ HANDLE hTimer;
+} usbi_timer_t;
+#define USBI_TIMER_OS_HANDLE(t) ((t)->hTimer)
+#define USBI_TIMER_POLL_EVENTS 0
+
+static inline int usbi_timer_valid(usbi_timer_t *timer)
+{
+ return timer->hTimer != NULL;
+}
+
+#endif