physfs.c
changeset 130 2deec3eb7430
parent 126 f5135b499c0c
child 132 b53fa5093749
equal deleted inserted replaced
129:28340d5fe57b 130:2deec3eb7430
   360 {
   360 {
   361     char *ptr;
   361     char *ptr;
   362 
   362 
   363     BAIL_IF_MACRO(initialized, ERR_IS_INITIALIZED, 0);
   363     BAIL_IF_MACRO(initialized, ERR_IS_INITIALIZED, 0);
   364     BAIL_IF_MACRO(argv0 == NULL, ERR_INVALID_ARGUMENT, 0);
   364     BAIL_IF_MACRO(argv0 == NULL, ERR_INVALID_ARGUMENT, 0);
       
   365     BAIL_IF_MACRO(!__PHYSFS_platformInit(), NULL, 0);
   365 
   366 
   366     baseDir = calculateBaseDir(argv0);
   367     baseDir = calculateBaseDir(argv0);
   367     BAIL_IF_MACRO(baseDir == NULL, NULL, 0);
   368     BAIL_IF_MACRO(baseDir == NULL, NULL, 0);
   368     ptr = __PHYSFS_platformRealPath(baseDir);
   369     ptr = __PHYSFS_platformRealPath(baseDir);
   369     free(baseDir);
   370     free(baseDir);
   436 
   437 
   437 
   438 
   438 int PHYSFS_deinit(void)
   439 int PHYSFS_deinit(void)
   439 {
   440 {
   440     BAIL_IF_MACRO(!initialized, ERR_NOT_INITIALIZED, 0);
   441     BAIL_IF_MACRO(!initialized, ERR_NOT_INITIALIZED, 0);
       
   442     BAIL_IF_MACRO(!__PHYSFS_platformDeinit(), NULL, 0);
   441 
   443 
   442     closeFileHandleList(&openWriteList);
   444     closeFileHandleList(&openWriteList);
   443     BAIL_IF_MACRO(!PHYSFS_setWriteDir(NULL), ERR_FILES_STILL_OPEN, 0);
   445     BAIL_IF_MACRO(!PHYSFS_setWriteDir(NULL), ERR_FILES_STILL_OPEN, 0);
   444 
   446 
   445     freeSearchPath();
   447     freeSearchPath();