physfs.h
changeset 751 74dc021744de
parent 747 3da194b12f43
child 754 e7cd7411eadf
equal deleted inserted replaced
749:8cffa18efa85 751:74dc021744de
  1845 
  1845 
  1846 
  1846 
  1847 /* Everything above this line is part of the PhysicsFS 1.0 API. */
  1847 /* Everything above this line is part of the PhysicsFS 1.0 API. */
  1848 
  1848 
  1849 /**
  1849 /**
  1850  * \struct PHYSFS_allocator
  1850  * \struct PHYSFS_Allocator
  1851  * \brief PhysicsFS allocation function pointers.
  1851  * \brief PhysicsFS allocation function pointers.
  1852  *
  1852  *
  1853  * (This is for limited, hardcore use. If you don't immediately see a need
  1853  * (This is for limited, hardcore use. If you don't immediately see a need
  1854  *  for it, you can probably ignore this forever.)
  1854  *  for it, you can probably ignore this forever.)
  1855  *
  1855  *
  1866  *
  1866  *
  1867  * \sa PHYSFS_setAllocator
  1867  * \sa PHYSFS_setAllocator
  1868  */
  1868  */
  1869 typedef struct
  1869 typedef struct
  1870 {
  1870 {
  1871     int (*Init)(void);
  1871     int (*Init)(void);   /**< Initialize. Can be NULL. Zero on failure. */
  1872     void (*Deinit)(void);
  1872     void (*Deinit)(void);  /**< Deinitialize your allocator. Can be NULL. */
  1873     void *(*Malloc)(PHYSFS_uint64);
  1873     void *(*Malloc)(PHYSFS_uint64);  /**< Allocate like malloc(). */
  1874     void *(*Realloc)(void *, PHYSFS_uint64);
  1874     void *(*Realloc)(void *, PHYSFS_uint64); /**< Reallocate like realloc(). */
  1875     void (*Free)(void *);
  1875     void (*Free)(void *); /**< Free memory from Malloc or Realloc. */
  1876 } PHYSFS_Allocator;
  1876 } PHYSFS_Allocator;
  1877 
  1877 
  1878 
  1878 
  1879 /**
  1879 /**
  1880  * \fn int PHYSFS_setAllocator(PHYSFS_Allocator *allocator)
  1880  * \fn int PHYSFS_setAllocator(const PHYSFS_Allocator *allocator)
  1881  * \brief Hook your own allocation routines into PhysicsFS.
  1881  * \brief Hook your own allocation routines into PhysicsFS.
  1882  *
  1882  *
  1883  * (This is for limited, hardcore use. If you don't immediately see a need
  1883  * (This is for limited, hardcore use. If you don't immediately see a need
  1884  *  for it, you can probably ignore this forever.)
  1884  *  for it, you can probably ignore this forever.)
  1885  *
  1885  *
  1901  *
  1901  *
  1902  *    \param allocator Structure containing your allocator's entry points.
  1902  *    \param allocator Structure containing your allocator's entry points.
  1903  *   \return zero on failure, non-zero on success. This call only fails
  1903  *   \return zero on failure, non-zero on success. This call only fails
  1904  *           when used between PHYSFS_init() and PHYSFS_deinit() calls.
  1904  *           when used between PHYSFS_init() and PHYSFS_deinit() calls.
  1905  */
  1905  */
  1906 __EXPORT__ int PHYSFS_setAllocator(PHYSFS_Allocator *allocator);
  1906 __EXPORT__ int PHYSFS_setAllocator(const PHYSFS_Allocator *allocator);
  1907 
  1907 
  1908 
  1908 
  1909 /**
  1909 /**
  1910  * \fn int PHYSFS_mount(const char *newDir, const char *mountPoint, int appendToPath);
  1910  * \fn int PHYSFS_mount(const char *newDir, const char *mountPoint, int appendToPath);
  1911  * \brief Add an archive or directory to the search path.
  1911  * \brief Add an archive or directory to the search path.