Back to index

php5  5.3.10
Functions
zip_stat_index.c File Reference
#include "zipint.h"

Go to the source code of this file.

Functions

 zip_stat_index (struct zip *za, int index, int flags, struct zip_stat *st)

Function Documentation

zip_stat_index ( struct zip za,
int  index,
int  flags,
struct zip_stat st 
)

Definition at line 41 of file zip_stat_index.c.

{
    const char *name;
    
    if (index < 0 || index >= za->nentry) {
       _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
       return -1;
    }

    if ((name=zip_get_name(za, index, flags)) == NULL)
       return -1;
    

    if ((flags & ZIP_FL_UNCHANGED) == 0
       && ZIP_ENTRY_DATA_CHANGED(za->entry+index)) {
       if (za->entry[index].source->f(za->entry[index].source->ud,
                                 st, sizeof(*st), ZIP_SOURCE_STAT) < 0) {
           _zip_error_set(&za->error, ZIP_ER_CHANGED, 0);
           return -1;
       }
    }
    else {
       if (za->cdir == NULL || index >= za->cdir->nentry) {
           _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
           return -1;
       }
       
       st->crc = za->cdir->entry[index].crc;
       st->size = za->cdir->entry[index].uncomp_size;
       st->mtime = za->cdir->entry[index].last_mod;
       st->comp_size = za->cdir->entry[index].comp_size;
       st->comp_method = za->cdir->entry[index].comp_method;
       if (za->cdir->entry[index].bitflags & ZIP_GPBF_ENCRYPTED) {
           if (za->cdir->entry[index].bitflags & ZIP_GPBF_STRONG_ENCRYPTION) {
              /* XXX */
              st->encryption_method = ZIP_EM_UNKNOWN;
           }
           else
              st->encryption_method = ZIP_EM_TRAD_PKWARE;
       }
       else
           st->encryption_method = ZIP_EM_NONE;
       /* st->bitflags = za->cdir->entry[index].bitflags; */
    }

    st->index = index;
    st->name = name;
    
    return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function: