Back to index

avfs  1.0.1
Classes | Defines | Functions
uzip.c File Reference
#include "archive.h"
#include "zipconst.h"
#include "zfile.h"
#include "cache.h"
#include "oper.h"
#include "version.h"

Go to the source code of this file.

Classes

struct  ecrec
struct  cdirentry
struct  ldirentry
struct  zipnode

Defines

#define ECREC_THIS_DISK   4
#define ECREC_CDIR_DISK   6
#define ECREC_THIS_ENTRIES   8
#define ECREC_TOTAL_ENTRIES   10
#define ECREC_CDIR_SIZE   12
#define ECREC_CDIR_OFF   16
#define ECREC_COMMENT_LEN   20
#define ECREC_SIZE   22
#define CDIRENT_VERSION   4
#define CDIRENT_NEED_VERSION   6
#define CDIRENT_FLAG   8
#define CDIRENT_METHOD   10
#define CDIRENT_MOD_TIME   12
#define CDIRENT_CRC   16
#define CDIRENT_COMP_SIZE   20
#define CDIRENT_FILE_SIZE   24
#define CDIRENT_FNAME_LEN   28
#define CDIRENT_EXTRA_LEN   30
#define CDIRENT_COMMENT_LEN   32
#define CDIRENT_START_DISK   34
#define CDIRENT_INT_ATTR   36
#define CDIRENT_ATTR   38
#define CDIRENT_FILE_OFF   42
#define CDIRENT_SIZE   46
#define LDIRENT_NEED_VERSION   4
#define LDIRENT_FLAG   6
#define LDIRENT_METHOD   8
#define LDIRENT_MOD_TIME   10
#define LDIRENT_CRC   14
#define LDIRENT_COMP_SIZE   18
#define LDIRENT_FILE_SIZE   22
#define LDIRENT_FNAME_LEN   26
#define LDIRENT_EXTRA_LEN   28
#define LDIRENT_SIZE   30
#define dos_ftsec(ft)   (int)( 2 * ((ft >> 0) & 0x1F))
#define dos_ftmin(ft)   (int)( ((ft >> 5) & 0x3F))
#define dos_fthour(ft)   (int)( ((ft >> 11) & 0x1F))
#define dos_ftday(ft)   (int)( ((ft >> 16) & 0x1F))
#define dos_ftmonth(ft)   (int)(-1 + ((ft >> 21) & 0x0F))
#define dos_ftyear(ft)   (int)(80 + ((ft >> 25) & 0x7F))
#define BUFSIZE   512
#define SEARCHLEN   66000
#define BI(ptr, i)   ((avbyte) (ptr)[i])
#define DBYTE(ptr)   (BI(ptr,0) | (BI(ptr,1)<<8))
#define QBYTE(ptr)

Functions

static void conv_tolower (char *s)
static avoff_t find_ecrec (vfile *vf, long searchlen, struct ecrec *ecrec)
static avtime_t dos2unix_time (avuint dt)
static avmode_t dos2unix_attr (avuint da, avmode_t archmode)
static avmode_t zip_get_mode (struct cdirentry *cent, const char *path, avmode_t origmode)
static void zipnode_delete (struct zipnode *nod)
static void fill_zipentry (struct archive *arch, const char *path, struct entry *ent, struct cdirentry *cent, struct ecrec *ecrec)
static void insert_zipentry (struct archive *arch, char *path, struct cdirentry *cent, struct ecrec *ecrec)
static avoff_t read_entry (vfile *vf, struct archive *arch, avoff_t pos, struct ecrec *ecrec)
static int read_zipfile (vfile *vf, struct archive *arch)
static int parse_zipfile (void *data, ventry *ve, struct archive *arch)
static int zip_close (struct archfile *fil)
static int zip_open (ventry *ve, struct archfile *fil)
static avssize_t zip_deflate_read (vfile *vf, char *buf, avsize_t nbyte)
static avssize_t zip_read (vfile *vf, char *buf, avsize_t nbyte)
int av_init_module_uzip (struct vmodule *module)

Class Documentation

struct ecrec

Definition at line 18 of file uzip.c.

Class Members
avushort cdir_disk
avuint cdir_off
avuint cdir_size
avushort comment_len
avushort this_disk
avushort this_entries
avushort total_entries
struct cdirentry

Definition at line 38 of file uzip.c.

Class Members
avuint attr
avushort comment_len
avuint comp_size
avuint crc
avushort extra_len
avuint file_off
avuint file_size
avushort flag
avushort fname_len
avushort int_attr
avushort method
avuint mod_time
avushort need_version
avushort start_disk
avushort version
struct ldirentry

Definition at line 74 of file uzip.c.

Class Members
avuint comp_size
avuint crc
avushort extra_len
avuint file_size
avushort flag
avushort fname_len
avushort method
avuint mod_time
avushort need_version
struct zipnode

Definition at line 114 of file uzip.c.

Collaboration diagram for zipnode:
Class Members
struct cacheobj * cache
avuint crc
avoff_t headeroff
avushort method

Define Documentation

#define BI (   ptr,
 
)    ((avbyte) (ptr)[i])

Definition at line 109 of file uzip.c.

#define BUFSIZE   512

Definition at line 105 of file uzip.c.

#define CDIRENT_ATTR   38

Definition at line 69 of file uzip.c.

#define CDIRENT_COMMENT_LEN   32

Definition at line 66 of file uzip.c.

#define CDIRENT_COMP_SIZE   20

Definition at line 62 of file uzip.c.

#define CDIRENT_CRC   16

Definition at line 61 of file uzip.c.

#define CDIRENT_EXTRA_LEN   30

Definition at line 65 of file uzip.c.

#define CDIRENT_FILE_OFF   42

Definition at line 70 of file uzip.c.

#define CDIRENT_FILE_SIZE   24

Definition at line 63 of file uzip.c.

#define CDIRENT_FLAG   8

Definition at line 58 of file uzip.c.

#define CDIRENT_FNAME_LEN   28

Definition at line 64 of file uzip.c.

#define CDIRENT_INT_ATTR   36

Definition at line 68 of file uzip.c.

#define CDIRENT_METHOD   10

Definition at line 59 of file uzip.c.

#define CDIRENT_MOD_TIME   12

Definition at line 60 of file uzip.c.

#define CDIRENT_NEED_VERSION   6

Definition at line 57 of file uzip.c.

#define CDIRENT_SIZE   46

Definition at line 72 of file uzip.c.

#define CDIRENT_START_DISK   34

Definition at line 67 of file uzip.c.

#define CDIRENT_VERSION   4

Definition at line 56 of file uzip.c.

#define DBYTE (   ptr)    (BI(ptr,0) | (BI(ptr,1)<<8))

Definition at line 110 of file uzip.c.

#define dos_ftday (   ft)    (int)( ((ft >> 16) & 0x1F))

Definition at line 101 of file uzip.c.

#define dos_fthour (   ft)    (int)( ((ft >> 11) & 0x1F))

Definition at line 100 of file uzip.c.

#define dos_ftmin (   ft)    (int)( ((ft >> 5) & 0x3F))

Definition at line 99 of file uzip.c.

#define dos_ftmonth (   ft)    (int)(-1 + ((ft >> 21) & 0x0F))

Definition at line 102 of file uzip.c.

#define dos_ftsec (   ft)    (int)( 2 * ((ft >> 0) & 0x1F))

Definition at line 98 of file uzip.c.

#define dos_ftyear (   ft)    (int)(80 + ((ft >> 25) & 0x7F))

Definition at line 103 of file uzip.c.

#define ECREC_CDIR_DISK   6

Definition at line 29 of file uzip.c.

#define ECREC_CDIR_OFF   16

Definition at line 33 of file uzip.c.

#define ECREC_CDIR_SIZE   12

Definition at line 32 of file uzip.c.

#define ECREC_COMMENT_LEN   20

Definition at line 34 of file uzip.c.

#define ECREC_SIZE   22

Definition at line 36 of file uzip.c.

#define ECREC_THIS_DISK   4

Definition at line 28 of file uzip.c.

#define ECREC_THIS_ENTRIES   8

Definition at line 30 of file uzip.c.

#define ECREC_TOTAL_ENTRIES   10

Definition at line 31 of file uzip.c.

#define LDIRENT_COMP_SIZE   18

Definition at line 91 of file uzip.c.

#define LDIRENT_CRC   14

Definition at line 90 of file uzip.c.

#define LDIRENT_EXTRA_LEN   28

Definition at line 94 of file uzip.c.

#define LDIRENT_FILE_SIZE   22

Definition at line 92 of file uzip.c.

#define LDIRENT_FLAG   6

Definition at line 87 of file uzip.c.

#define LDIRENT_FNAME_LEN   26

Definition at line 93 of file uzip.c.

#define LDIRENT_METHOD   8

Definition at line 88 of file uzip.c.

#define LDIRENT_MOD_TIME   10

Definition at line 89 of file uzip.c.

#define LDIRENT_NEED_VERSION   4

Definition at line 86 of file uzip.c.

#define LDIRENT_SIZE   30

Definition at line 96 of file uzip.c.

#define QBYTE (   ptr)
Value:
(BI(ptr,0) | (BI(ptr,1)<<8) | \
                   (BI(ptr,2)<<16) | (BI(ptr,3)<<24))

Definition at line 111 of file uzip.c.

#define SEARCHLEN   66000

Definition at line 107 of file uzip.c.


Function Documentation

int av_init_module_uzip ( struct vmodule module)

Definition at line 543 of file uzip.c.

{
    int res;
    struct avfs *avfs;
    struct ext_info zipexts[5];
    struct archparams *ap;

    zipexts[0].from = ".zip",   zipexts[0].to = NULL;
    zipexts[1].from = ".jar",   zipexts[1].to = NULL;
    zipexts[2].from = ".ear",   zipexts[2].to = NULL;
    zipexts[3].from = ".war",   zipexts[3].to = NULL;
    zipexts[4].from = NULL;

    res = av_archive_init("uzip", zipexts, AV_VER, module, &avfs);
    if(res < 0)
        return res;

    ap = (struct archparams *) avfs->data;
    ap->parse = parse_zipfile;
    ap->open = zip_open;
    ap->close = zip_close;
    ap->read = zip_read;

    av_add_avfs(avfs);

    return 0;
}

Here is the call graph for this function:

static void conv_tolower ( char *  s) [static]

Definition at line 121 of file uzip.c.

{
    for(; *s; s++) *s = tolower(*s);
}

Here is the caller graph for this function:

static avmode_t dos2unix_attr ( avuint  da,
avmode_t  archmode 
) [static]

Definition at line 204 of file uzip.c.

{
    avmode_t mode = (archmode & 0666);
    if (da & 0x01) mode = mode & ~0222;
    if (da & 0x10) mode = mode | ((mode & 0444) >> 2) | AV_IFDIR;
    else mode |= AV_IFREG;

    return mode;
}

Here is the caller graph for this function:

static avtime_t dos2unix_time ( avuint  dt) [static]

Definition at line 190 of file uzip.c.

{
    struct avtm ut;

    ut.sec = dos_ftsec(dt);
    ut.min = dos_ftmin(dt);
    ut.hour = dos_fthour(dt);
    ut.day = dos_ftday(dt);
    ut.mon = dos_ftmonth(dt);
    ut.year = dos_ftyear(dt);

    return av_mktime(&ut);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void fill_zipentry ( struct archive arch,
const char *  path,
struct entry ent,
struct cdirentry cent,
struct ecrec ecrec 
) [static]

Definition at line 236 of file uzip.c.

{
    struct archnode *nod;
    struct zipnode *info;
    int isdir = AV_ISDIR(zip_get_mode(cent, path, 0));

    nod = av_arch_new_node(arch, ent, isdir);
    
    nod->st.mode = zip_get_mode(cent, path, nod->st.mode);
    nod->st.size = cent->file_size;
    nod->st.blocks = AV_BLOCKS(cent->comp_size);
    nod->st.blksize = 4096;
    nod->st.mtime.sec = dos2unix_time(cent->mod_time);
    nod->st.mtime.nsec = 0;
    nod->st.atime = nod->st.mtime;
    nod->st.ctime = nod->st.mtime;
    nod->realsize = cent->comp_size;

    AV_NEW_OBJ(info, zipnode_delete);
    nod->data = info;

    info->cache = NULL;
    info->crc = cent->crc;
    info->method = 0;

    /* FIXME: multivolume archives */
    if(cent->start_disk != 0 || ecrec->cdir_disk != 0)
        info->headeroff = -1;
    else
        info->headeroff = cent->file_off;

}

Here is the call graph for this function:

Here is the caller graph for this function:

static avoff_t find_ecrec ( vfile *  vf,
long  searchlen,
struct ecrec ecrec 
) [static]

Definition at line 126 of file uzip.c.

{
    int res;
    avoff_t bufstart;
    int pos;
    char buf[BUFSIZE+3];
    avoff_t sres;
    int found;
  
    sres = av_lseek(vf, 0, AVSEEK_END);
    if(sres < 0)
        return sres;
    if(sres < ECREC_SIZE) {
        av_log(AVLOG_ERROR, "UZIP: Broken archive");
        return -EIO;
    }
  
    pos = 0;
    bufstart = sres - (ECREC_SIZE - 4);
    buf[0] = buf[1] = buf[2] = 0;
    found = 0;

    for(;searchlen && (bufstart || pos); searchlen--) {
       if(!pos) {
           pos = BUFSIZE;
           if(bufstart < pos) pos = bufstart;
           bufstart -= pos;
           buf[pos]   = buf[0];
           buf[pos+1] = buf[1];
           buf[pos+2] = buf[2];
            res = av_pread_all(vf, buf, pos, bufstart);
            if(res < 0)
                return res;
       }
       pos--;
       if(buf[pos] == 'P' && buf[pos+1] == 'K' && 
          buf[pos+2] == 5 && buf[pos+3] == 6) {
           found = 1;
           break;
       }
    } 
  
    if(!found) {
        av_log(AVLOG_ERROR, 
               "UZIP: Couldn't find End of Central Directory Record");
        return -EIO;
    }

    bufstart += pos;
    res = av_pread_all(vf, buf, ECREC_SIZE, bufstart);
    if(res < 0)
        return res;
  
    ecrec->this_disk =     DBYTE(buf+ECREC_THIS_DISK);
    ecrec->cdir_disk =     DBYTE(buf+ECREC_CDIR_DISK);
    ecrec->this_entries =  DBYTE(buf+ECREC_THIS_ENTRIES);
    ecrec->total_entries = DBYTE(buf+ECREC_TOTAL_ENTRIES);
    ecrec->cdir_size =     QBYTE(buf+ECREC_CDIR_SIZE);
    ecrec->cdir_off =      QBYTE(buf+ECREC_CDIR_OFF);
    ecrec->comment_len =   DBYTE(buf+ECREC_COMMENT_LEN);

    return bufstart;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void insert_zipentry ( struct archive arch,
char *  path,
struct cdirentry cent,
struct ecrec ecrec 
) [static]

Definition at line 271 of file uzip.c.

{
    struct entry *ent;
    int entflags = 0;

    /* FIXME: option for uzip, not to convert filenames to lowercase */
    switch((cent->version & 0xFF00) >> 8) {
    case OS_CPM:
    case OS_VM_CMS:
    case OS_MVS:
    case OS_TANDEM:
    case OS_TOPS20:
    case OS_VMS:
       conv_tolower(path);

       /* fall through */
    case OS_MSDOS: /* some shitty windows zipper produces zipfiles in this
                      type */
    case OS_NT:
    case OS_WIN95:
 
       entflags |= NSF_NOCASE;
    }

    ent = av_arch_create(arch, path, entflags);
    if(ent == NULL)
        return;

    fill_zipentry(arch, path, ent, cent, ecrec);
    av_unref_obj(ent);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int parse_zipfile ( void *  data,
ventry *  ve,
struct archive arch 
) [static]

Definition at line 399 of file uzip.c.

{
    int res;
    vfile *vf;

    res = av_open(ve->mnt->base, AVO_RDONLY, 0, &vf);
    if(res < 0)
        return res;

    res = read_zipfile(vf, arch);
    av_close(vf);
    
    return res;  
}

Here is the call graph for this function:

Here is the caller graph for this function:

static avoff_t read_entry ( vfile *  vf,
struct archive arch,
avoff_t  pos,
struct ecrec ecrec 
) [static]

Definition at line 304 of file uzip.c.

{
    int res;
    char buf[CDIRENT_SIZE];
    struct cdirentry ent;
    char *filename;

    res = av_pread_all(vf, buf, CDIRENT_SIZE, pos);
    if(res < 0)
        return res;
  
    if(buf[0] != 'P' || buf[1] != 'K' || buf[2] != 1 || buf[3] != 2) {
        av_log(AVLOG_ERROR, "UZIP: Broken archive");
        return -EIO;
    }

    ent.version      = DBYTE(buf+CDIRENT_VERSION);
    ent.need_version = DBYTE(buf+CDIRENT_NEED_VERSION);
    ent.flag         = DBYTE(buf+CDIRENT_FLAG);
    ent.method       = DBYTE(buf+CDIRENT_METHOD);
    ent.mod_time     = QBYTE(buf+CDIRENT_MOD_TIME);
    ent.crc          = QBYTE(buf+CDIRENT_CRC);
    ent.comp_size    = QBYTE(buf+CDIRENT_COMP_SIZE);
    ent.file_size    = QBYTE(buf+CDIRENT_FILE_SIZE);
    ent.fname_len    = DBYTE(buf+CDIRENT_FNAME_LEN);
    ent.extra_len    = DBYTE(buf+CDIRENT_EXTRA_LEN);
    ent.comment_len  = DBYTE(buf+CDIRENT_COMMENT_LEN);
    ent.start_disk   = DBYTE(buf+CDIRENT_START_DISK);
    ent.int_attr     = DBYTE(buf+CDIRENT_INT_ATTR);
    ent.attr         = QBYTE(buf+CDIRENT_ATTR);
    ent.file_off     = QBYTE(buf+CDIRENT_FILE_OFF);

    filename = av_malloc(ent.fname_len + 1);
    res = av_pread_all(vf, filename, ent.fname_len, pos + CDIRENT_SIZE);
    if(res < 0) {
        av_free(filename);
        return res;
    }
    filename[ent.fname_len] = '\0';

    insert_zipentry(arch, filename, &ent, ecrec);
    av_free(filename);

    return pos + CDIRENT_SIZE + ent.fname_len + ent.extra_len +
        ent.comment_len;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int read_zipfile ( vfile *  vf,
struct archive arch 
) [static]

Definition at line 353 of file uzip.c.

{
    avoff_t ecrec_pos;
    struct ecrec ecrec;
    avoff_t extra_bytes;
    avoff_t cdir_end;
    avoff_t cdir_pos;
    int nument;

    ecrec_pos = find_ecrec(vf, SEARCHLEN, &ecrec);
    if(ecrec_pos < 0)
        return ecrec_pos;

    cdir_end = ecrec.cdir_size+ecrec.cdir_off;

    if(ecrec.this_disk != ecrec.cdir_disk) {
        av_log(AVLOG_ERROR, "UZIP: Cannot handle multivolume archives");
        return -EIO;
    }
  
    extra_bytes = ecrec_pos - cdir_end;
    if(extra_bytes < 0) {
        av_log(AVLOG_ERROR, "UZIP: Broken archive");
        return -EIO;
    }
  
    if(ecrec.cdir_off == 0 && ecrec.cdir_size == 0) {
       /* Empty zipfile */
       return 0;
    }
  
    cdir_pos = ecrec.cdir_off + extra_bytes;
  
    for(nument = 0; nument < ecrec.total_entries; nument++) {
       if(cdir_pos >= ecrec_pos) {
            av_log(AVLOG_ERROR, "UZIP: Broken archive");
            return -EIO;
       }
       cdir_pos = read_entry(vf, arch, cdir_pos, &ecrec);
       if(cdir_pos < 0) 
            return cdir_pos;
    }
  
    return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int zip_close ( struct archfile fil) [static]

Definition at line 414 of file uzip.c.

{
    struct zfile *zfil = fil->data;

    av_unref_obj(zfil);
    return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static avssize_t zip_deflate_read ( vfile *  vf,
char *  buf,
avsize_t  nbyte 
) [static]

Definition at line 490 of file uzip.c.

{
    avssize_t res;
    struct archfile *fil = arch_vfile_file(vf);
    struct zfile *zfil = (struct zfile *) fil->data;
    struct zipnode *info = (struct zipnode *) fil->nod->data;
    struct zcache *zc;

    zc = (struct zcache *) av_cacheobj_get(info->cache);
    if(zc == NULL) {
        av_unref_obj(info->cache);
        info->cache = NULL;
        zc = av_zcache_new();
    }
    
    res = av_zfile_pread(zfil, zc, buf, nbyte, vf->ptr);
    if(res >= 0) {
        avoff_t cachesize;

        vf->ptr += res;
        cachesize = av_zcache_size(zc);
        if(cachesize != 0) {
            /* FIXME: name of this cacheobj? */
            if(info->cache == NULL)
                info->cache = av_cacheobj_new(zc, "(uzip:index)");
            av_cacheobj_setsize(info->cache, cachesize);
        }
    }
    else {
        av_unref_obj(info->cache);
        info->cache = NULL;
    }
    av_unref_obj(zc);

    return res;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static avmode_t zip_get_mode ( struct cdirentry cent,
const char *  path,
avmode_t  origmode 
) [static]

Definition at line 214 of file uzip.c.

{
    avmode_t mode;

    /* FIXME: Handle other architectures */
    if((cent->version & 0xFF00) >> 8 == OS_UNIX) 
       mode = (cent->attr >> 16) & 0xFFFF;
    else
       mode = dos2unix_attr(cent->attr & 0xFF, origmode);

    if(path[0] && path[strlen(path)-1] == '/')
        mode = (mode & 07777) | AV_IFDIR;

    return mode;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int zip_open ( ventry *  ve,
struct archfile fil 
) [static]

Definition at line 422 of file uzip.c.

{
    int res;
    char buf[LDIRENT_SIZE];
    struct ldirentry ent;
    int headersize;
    struct zipnode *info = (struct zipnode *) fil->nod->data;
    avoff_t offset;

    if(info == NULL) {
        /* no info means accessing base zip directory without any filename */
        return -EISDIR;
    }
  
    offset = info->headeroff;
    if(offset == -1) {
        av_log(AVLOG_ERROR, "UZIP: Cannot handle multivolume archives");
        return -ENOENT;
    }

    res = av_pread_all(fil->basefile, buf, LDIRENT_SIZE, offset);
    if(res < 0)
        return res;

    if(buf[0] != 'P' || buf[1] != 'K' || buf[2] != 3 || buf[3] != 4) {
        av_log(AVLOG_ERROR, "UZIP: Broken archive");
        return -EIO;
    }

    ent.need_version = DBYTE(buf+LDIRENT_NEED_VERSION);
    ent.flag         = DBYTE(buf+LDIRENT_FLAG);
    ent.method       = DBYTE(buf+LDIRENT_METHOD);
    ent.mod_time     = QBYTE(buf+LDIRENT_MOD_TIME);
    ent.crc          = QBYTE(buf+LDIRENT_CRC);
    ent.comp_size    = QBYTE(buf+LDIRENT_COMP_SIZE);
    ent.file_size    = QBYTE(buf+LDIRENT_FILE_SIZE);
    ent.fname_len    = DBYTE(buf+LDIRENT_FNAME_LEN);
    ent.extra_len    = DBYTE(buf+LDIRENT_EXTRA_LEN);

    if(ent.method != METHOD_STORE && ent.method != METHOD_DEFLATE) {
        av_log(AVLOG_ERROR, "UZIP: Cannot handle compression method %i",
               ent.method);
        return -ENOENT;
    }

    if((ent.flag & 0x08) != 0) {
       /* can't trust local header, use central directory: */
    
       ent.comp_size = fil->nod->realsize;
       ent.file_size = fil->nod->st.size;
       ent.crc = info->crc;
    }

    info->method = ent.method;
    headersize = LDIRENT_SIZE + ent.fname_len + ent.extra_len;
    fil->nod->offset = offset + headersize;

    if(ent.method == METHOD_DEFLATE) {
        struct zfile *zfil;

        zfil = av_zfile_new(fil->basefile, fil->nod->offset, ent.crc, 1);
        fil->data = zfil;
    }

    return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static avssize_t zip_read ( vfile *  vf,
char *  buf,
avsize_t  nbyte 
) [static]

Definition at line 527 of file uzip.c.

{
    avssize_t res;
    struct archfile *fil = arch_vfile_file(vf);
    struct zfile *zfil = (struct zfile *) fil->data;

    if(zfil != NULL)
        res = zip_deflate_read(vf, buf, nbyte);
    else
        res = av_arch_read(vf, buf, nbyte);

    return res;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void zipnode_delete ( struct zipnode nod) [static]

Definition at line 231 of file uzip.c.

{
    av_unref_obj(nod->cache);
}

Here is the call graph for this function:

Here is the caller graph for this function: