physfs_internal.h
changeset 845 3f150ffcf50c
parent 844 68272bd212a5
child 850 2bc230284fed
--- a/physfs_internal.h	Tue Mar 20 17:57:45 2007 +0000
+++ b/physfs_internal.h	Tue Mar 20 18:33:56 2007 +0000
@@ -1719,39 +1719,18 @@
 void __PHYSFS_platformReleaseMutex(void *mutex);
 
 /*
- * Called during PHYSFS_init() to initialize the allocator, if the user
+ * Called at the start of PHYSFS_init() to prepare the allocator, if the user
  *  hasn't selected their own allocator via PHYSFS_setAllocator().
- *  Return zero on initialization error (which will make PHYSFS_init() fail,
- *  too), non-zero on success.
- */
-int __PHYSFS_platformAllocatorInit(void);
-
-/*
- * Called during PHYSFS_deinit() to deinitialize the allocator, if the user
- *  hasn't selected their own allocator via PHYSFS_setAllocator().
+ *  If the platform has a custom allocator, it should fill in the fields of
+ *  (a) with the proper function pointers and return non-zero.
+ * If the platform just wants to use malloc()/free()/etc, return zero
+ *  immediately and the higher level will handle it. The Init and Deinit
+ *  fields of (a) are optional...set them to NULL if you don't need them.
+ *  Everything else must be implemented. All rules follow those for
+ *  PHYSFS_setAllocator(). If Init isn't NULL, it will be called shortly
+ *  after this function returns non-zero.
  */
-void __PHYSFS_platformAllocatorDeinit(void);
-
-/*
- * Implement malloc. It's safe to just pass through from the C runtime.
- *  This is used for allocation if the user hasn't selected their own
- *  allocator via PHYSFS_setAllocator().
- */
-void *__PHYSFS_platformAllocatorMalloc(PHYSFS_uint64 s);
-
-/*
- * Implement realloc. It's safe to just pass through from the C runtime.
- *  This is used for allocation if the user hasn't selected their own
- *  allocator via PHYSFS_setAllocator().
- */
-void *__PHYSFS_platformAllocatorRealloc(void *ptr, PHYSFS_uint64 s);
-
-/*
- * Implement free. It's safe to just pass through from the C runtime.
- *  This is used for deallocation if the user hasn't selected their own
- *  allocator via PHYSFS_setAllocator().
- */
-void __PHYSFS_platformAllocatorFree(void *ptr);
+int __PHYSFS_platformSetDefaultAllocator(PHYSFS_Allocator *a);
 
 #ifdef __cplusplus
 }