aboutsummaryrefslogtreecommitdiff
path: root/src/survive_driverman.h
diff options
context:
space:
mode:
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
+