Back to index

php5  5.3.10
zip_file_get_offset.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "zipint.h"

Go to the source code of this file.


unsigned int _zip_file_get_offset (struct zip *za, int idx)

Function Documentation

unsigned int _zip_file_get_offset ( struct zip za,
int  idx 

Definition at line 54 of file zip_file_get_offset.c.

    struct zip_dirent de;
    unsigned int offset;

    offset = za->cdir->entry[idx].offset;

    if (fseeko(za->zp, offset, SEEK_SET) != 0) {
       _zip_error_set(&za->error, ZIP_ER_SEEK, errno);
       return 0;

    if (_zip_dirent_read(&de, za->zp, NULL, NULL, 1, &za->error) != 0)
       return 0;

    offset += LENTRYSIZE + de.filename_len + de.extrafield_len;


    return offset;

Here is the call graph for this function:

Here is the caller graph for this function: