]> git.xonotic.org Git - xonotic/xonotic.git/blobdiff - misc/builddeps/dp.linux64/include/d0_blind_id/d0.h
Handle errors right.
[xonotic/xonotic.git] / misc / builddeps / dp.linux64 / include / d0_blind_id / d0.h
index 858b020b2a17378b75897720c1eb1c2e823ef64b..4c8708e32a513a92a5d46a17b702f5d8a3f7e2b0 100644 (file)
@@ -30,7 +30,7 @@
  * SUCH DAMAGE.
  *
  * $Format:commit %H$
- * $Id: 8bcedf6746fc5fd1cd5709800f5ce5bcb5532a87 $
+ * $Id: 6c55afeb50f24bd316079ae46582e65f8020b19b $
  */
 
 #ifndef __D0_H__
 #include <unistd.h> // size_t
 
 #define D0_EXPORT __attribute__((__visibility__("default")))
+#define D0_USED __attribute__((used))
 #define D0_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
 #define D0_BOOL int
 
-extern void *(*d0_malloc)(size_t len);
-extern void (*d0_free)(void *p);
-extern const char *d0_bsd_license_notitce;
+typedef void *(d0_malloc_t)(size_t len);
+typedef void (d0_free_t)(void *p);
+typedef void *(d0_createmutex_t)(void);
+typedef void (d0_destroymutex_t)(void *);
+typedef int (d0_lockmutex_t)(void *); // zero on success
+typedef int (d0_unlockmutex_t)(void *); // zero on success
+
+extern d0_malloc_t *d0_malloc;
+extern d0_free_t *d0_free;
+extern d0_createmutex_t *d0_createmutex;
+extern d0_destroymutex_t *d0_destroymutex;
+extern d0_lockmutex_t *d0_lockmutex;
+extern d0_unlockmutex_t *d0_unlockmutex;
+
+void d0_setmallocfuncs(d0_malloc_t *m, d0_free_t *f);
+void d0_setmutexfuncs(d0_createmutex_t *c, d0_destroymutex_t *d, d0_lockmutex_t *l, d0_unlockmutex_t *u);
+void d0_initfuncs(void); // initializes them, this needs to be only called internally once
+
+extern const char *d0_bsd_license_notice;
 
 #endif