Back to index

php5  5.3.10
Functions
zip_entry_new.c File Reference
#include <stdlib.h>
#include "zipint.h"

Go to the source code of this file.

Functions

struct zip_entry_zip_entry_new (struct zip *za)

Function Documentation

struct zip_entry* _zip_entry_new ( struct zip za) [read]

Definition at line 43 of file zip_entry_new.c.

{
    struct zip_entry *ze;
    if (!za) {
       ze = (struct zip_entry *)malloc(sizeof(struct zip_entry));
       if (!ze) {
           _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
           return NULL;
       }
    }
    else {
       if (za->nentry >= za->nentry_alloc-1) {
           za->nentry_alloc += 16;
           za->entry = (struct zip_entry *)realloc(za->entry,
                                              sizeof(struct zip_entry)
                                              * za->nentry_alloc);
           if (!za->entry) {
              _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
              return NULL;
           }
       }
       ze = za->entry+za->nentry;
    }

    ze->state = ZIP_ST_UNCHANGED;

    ze->ch_filename = NULL;
    ze->ch_comment = NULL;
    ze->ch_comment_len = -1;
    ze->source = NULL;

    if (za)
       za->nentry++;

    return ze;
}

Here is the call graph for this function:

Here is the caller graph for this function: