aboutsummaryrefslogtreecommitdiff
path: root/src/survive_driverman.h
diff options
context:
space:
mode:
authorcnlohr <lohr85@gmail.com>2017-02-25 23:52:48 -0500
committercnlohr <lohr85@gmail.com>2017-02-25 23:52:48 -0500
commit55cedfc6a6b035d6eb54457782818fef61cae500 (patch)
treeca11020aeb8970830a6f52ada199767686078fd4 /src/survive_driverman.h
parentf92f5dc93cbb53a99da51984541a7e4a70605639 (diff)
downloadlibsurvive-55cedfc6a6b035d6eb54457782818fef61cae500.tar.gz
libsurvive-55cedfc6a6b035d6eb54457782818fef61cae500.tar.bz2
Huge shift: Put HTC vive into its own file, to free up the rest of the system for libsurvive.
Diffstat (limited to 'src/survive_driverman.h')
-rw-r--r--src/survive_driverman.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/survive_driverman.h b/src/survive_driverman.h
new file mode 100644
index 0000000..fb385da
--- /dev/null
+++ b/src/survive_driverman.h
@@ -0,0 +1,22 @@
+#ifndef SURVIVE_DRIVERMAN_H
+#define SURVIVE_DRIVERMAN_H
+
+//Driver registration
+#define MAX_DRIVERS 32
+
+void RegisterDriver( const char * name, void * data );
+void * GetDriver( const char * name );
+const char * GetDriverNameMatching( const char * prefix, int place );
+void ListDrivers();
+
+#define REGISTER_LINKTIME( func ) \
+ void __attribute__((constructor)) Register##func() { RegisterDriver( #func, &func ); }
+
+struct SurviveContext;
+
+typedef int (*DeviceDriver)( struct SurviveContext * ctx );
+typedef int (*DeviceDriverCb)( struct SurviveContext * ctx, void * driver );
+typedef int (*DeviceDriverMagicCb)( struct SurviveContext * ctx, void * driver, int magic_code, void * data, int datalen );
+
+#endif
+