Back to index

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

Go to the source code of this file.

Functions

 zip_replace (struct zip *za, int idx, struct zip_source *source)
int _zip_replace (struct zip *za, int idx, const char *name, struct zip_source *source)

Function Documentation

int _zip_replace ( struct zip za,
int  idx,
const char *  name,
struct zip_source source 
)

Definition at line 58 of file zip_replace.c.

{
    if (idx == -1) {
       if (_zip_entry_new(za) == NULL)
           return -1;

       idx = za->nentry - 1;
    }
    
    _zip_unchange_data(za->entry+idx);

    if (name && _zip_set_name(za, idx, name) != 0)
       return -1;
    
    za->entry[idx].state = ((za->cdir == NULL || idx >= za->cdir->nentry)
                         ? ZIP_ST_ADDED : ZIP_ST_REPLACED);
    za->entry[idx].source = source;

    return idx;
}

Here is the call graph for this function:

Here is the caller graph for this function:

zip_replace ( struct zip za,
int  idx,
struct zip_source source 
)

Definition at line 41 of file zip_replace.c.

{
    if (idx < 0 || idx >= za->nentry || source == NULL) {
       _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
       return -1;
    }

    if (_zip_replace(za, idx, NULL, source) == -1)
       return -1;

    return 0;
}

Here is the call graph for this function: