zip.c
author Ryan C. Gordon <icculus@icculus.org>
Fri, 06 Jul 2001 21:29:37 +0000
changeset 12 a4041c91d715
parent 11 677e01f5109e
child 14 7d822f0d5f57
permissions -rw-r--r--
Redesign of enumerateFiles code. More efficient and clean, less memory hungry. Some tiny snafus, though, for future maintanence (*shrug*).

/*
 * ZIP support routines for PhysicsFS.
 *
 * Please see the file LICENSE in the source's root directory.
 *
 *  This file written by Ryan C. Gordon.
 */

#include <stdio.h>
#include <stdlib.h>

#define __PHYSICSFS_INTERNAL__
#include "physfs_internal.h"

#if (!defined PHYSFS_SUPPORTS_ZIP)
#error PHYSFS_SUPPORTS_ZIP must be defined.
#endif


static const FileFunctions __PHYSFS_FileHandle_ZIP =
{
    ZIP_read,   /* read() method  */
    NULL,       /* write() method */
    ZIP_eof,    /* eof() method   */
    ZIP_tell,   /* tell() method  */
    ZIP_seek,   /* seek() method  */
    ZIP_close,  /* close() method */
};


const DirFunctions __PHYSFS_DirFunctions_ZIP =
{
    ZIP_isArchive,     /* isArchive() method      */
    ZIP_openArchive,   /* openArchive() method    */
    ZIP_enumerate,     /* enumerateFiles() method */
    ZIP_isDirectory,   /* isDirectory() method    */
    ZIP_isSymLink,     /* isSymLink() method      */
    ZIP_isOpenable,    /* isOpenable() method     */
    ZIP_openRead,      /* openRead() method       */
    NULL,              /* openWrite() method      */
    ZIP_dirClose,      /* close() method          */
};

const __PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_ZIP =
{
    "ZIP",
    "PkZip/WinZip/Info-Zip compatible"
};

/* end of zip.c ... */