archivers/zip.c
changeset 37 768c8484b0cd
parent 32 09a8197fad3b
child 39 bc29e1ee7ef6
equal deleted inserted replaced
36:60b6076ae5c2 37:768c8484b0cd
   102     unz = unzOpen(name);
   102     unz = unzOpen(name);
   103     if ((unz == NULL) || (unzGetGlobalInfo(unz, &global) != UNZ_OK))
   103     if ((unz == NULL) || (unzGetGlobalInfo(unz, &global) != UNZ_OK))
   104     {
   104     {
   105         if (unz)
   105         if (unz)
   106             unzClose(unz);
   106             unzClose(unz);
   107         free(retval); 
   107         free(retval);
   108         BAIL_IF_MACRO(1, ERR_UNSUPPORTED_ARCHIVE, NULL);
   108         BAIL_IF_MACRO(1, ERR_UNSUPPORTED_ARCHIVE, NULL);
   109     } /* if */
   109     } /* if */
   110 
   110 
   111     retval->opaque = malloc(sizeof (ZIPinfo));
   111     retval->opaque = malloc(sizeof (ZIPinfo));
   112     if (retval->opaque == NULL)
   112     if (retval->opaque == NULL)
   115         unzClose(unz);
   115         unzClose(unz);
   116         BAIL_IF_MACRO(1, ERR_OUT_OF_MEMORY, NULL);
   116         BAIL_IF_MACRO(1, ERR_OUT_OF_MEMORY, NULL);
   117     } /* if */
   117     } /* if */
   118 
   118 
   119     ((ZIPinfo *) (retval->opaque))->handle = unz;
   119     ((ZIPinfo *) (retval->opaque))->handle = unz;
   120     ((ZIPinfo *) (retval->opaque))->totalEntries = global.number_entry;        
   120     ((ZIPinfo *) (retval->opaque))->totalEntries = global.number_entry;
   121 
   121 
   122     return(retval);
   122     return(retval);
   123 } /* ZIP_openArchive */
   123 } /* ZIP_openArchive */
   124 
   124 
   125 
   125 
   241 
   241 
   242 const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_ZIP =
   242 const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_ZIP =
   243 {
   243 {
   244     "ZIP",
   244     "ZIP",
   245     "PkZip/WinZip/Info-Zip compatible",
   245     "PkZip/WinZip/Info-Zip compatible",
   246     "Ryan C. Gordon",
   246     "Ryan C. Gordon (icculus@linuxgames.com)",
   247     "http://www.icculus.org/",
   247     "http://www.icculus.org/~icculus/",
   248 };
   248 };
   249 
   249 
   250 /* end of zip.c ... */
   250 /* end of zip.c ... */
   251 
   251