#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "hyport.h"
#include "zipsup.h"
#include "hypool.h"
Functions | |
HyZipCache * | zipCache_new (HyPortLibrary *portLib, char *zipName, IDATA zipNameLength) |
Creates a new, empty zip cache for the provided zip file. | |
BOOLEAN | zipCache_addElement (HyZipCache *zipCache, char *elementName, UDATA elementOffset) |
Add an association between a file or directory named elementName and offset elementOffset to the zip cache provided. | |
UDATA | zipCache_findElement (HyZipCache *zipCache, const char *elementName, BOOLEAN searchDirList) |
Returns the offset associated with a file or directory element named elementName in a zipCache. | |
void | zipCache_kill (HyZipCache *zipCache) |
Deletes a zip cache and frees its resources. | |
IDATA | zipCache_enumNew (HyZipCache *zipCache, char *directoryName, void **handle) |
Searches for a directory named elementName in zipCache and if found provides a handle to it that can be used to enumerate through all of the directory's files. | |
IDATA | zipCache_enumElement (void *handle, char *nameBuf, UDATA nameBufSize, UDATA *offset) |
Gets the name and offset of the next element in the directory being enumerated. | |
IDATA | zipCache_enumGetDirName (void *handle, char *nameBuf, UDATA nameBufSize) |
Gets the name of the directory on which the enumeration is based. | |
void | zipCache_enumKill (void *handle) |
Frees any resources allocated by zipCache_enumNew. |
BOOLEAN zipCache_addElement | ( | HyZipCache * | zipCache, | |
char * | elementName, | |||
UDATA | elementOffset | |||
) |
Add an association between a file or directory named elementName and offset elementOffset to the zip cache provided.
[in] | zipCache | the zip cache being added to |
[in] | elementName | the name of the file or directory element |
[in] | elementOffset | the corresponding offset of the element |
IDATA zipCache_enumElement | ( | void * | handle, | |
char * | nameBuf, | |||
UDATA | nameBufSize, | |||
UDATA * | offset | |||
) |
Gets the name and offset of the next element in the directory being enumerated.
If nameBufSize is insufficient to hold the entire name, returns the required size for nameBuf.
[in] | handle | returned from zipCache_enumNew. Used to enumerate the elements corresponding to the directory name returned by zipCache_enumGetDirName |
[out] | nameBuf | holder for element in the directory being enumerated |
[in] | nameBufSize | |
[out] | offset | the offset of the next element |
-1 if all the directories have been returned already
the required size of nameBuf if nameBufSize is insufficient to hold the entire name (does not skip the element)
IDATA zipCache_enumGetDirName | ( | void * | handle, | |
char * | nameBuf, | |||
UDATA | nameBufSize | |||
) |
Gets the name of the directory on which the enumeration is based.
[in] | handle | handle returned from zipCache_enumNew. |
[out] | nameBuf | buffer to hold the directory name |
[in] | nameBufSize |
-3 on param failures
the required size for nameBuf if nameBufSize is insufficient to hold the entire name
void zipCache_enumKill | ( | void * | handle | ) |
Frees any resources allocated by zipCache_enumNew.
[in] | handle | enumerate on this handle |
IDATA zipCache_enumNew | ( | HyZipCache * | zipCache, | |
char * | directoryName, | |||
void ** | handle | |||
) |
Searches for a directory named elementName in zipCache and if found provides a handle to it that can be used to enumerate through all of the directory's files.
The search is NOT recursive.
[in] | zipCache | the zip cache that is being searched |
[in] | directoryName | the directory we want to enumerate |
[out] | handle | enumerate all the files in directory directoryName on this handle |
-1 if the directory is not found
-2 if there is not enough memory to complete this call
UDATA zipCache_findElement | ( | HyZipCache * | zipCache, | |
const char * | elementName, | |||
BOOLEAN | searchDirList | |||
) |
Returns the offset associated with a file or directory element named elementName in a zipCache.
[in] | zipCache | the zip cache we are searching |
[in] | elementName | the name of the element of which we want the offset |
[in] | searchDirList | when TRUE, search the dir list even if elementName does not end in '/' |
-1 if no element of that name has been explicitly added to the cache.
void zipCache_kill | ( | HyZipCache * | zipCache | ) |
Deletes a zip cache and frees its resources.
[in] | zipCache | the zip cache to be freed |
HyZipCache* zipCache_new | ( | HyPortLibrary * | portLib, | |
char * | zipName, | |||
IDATA | zipNameLength | |||
) |
Creates a new, empty zip cache for the provided zip file.
[in] | portLib | the port library |
[in] | zipName | the zip file name |
[in] | zipNameLength |
Genereated on Tue Dec 9 14:12:59 2008 by Doxygen.
(c) Copyright 2005, 2008 The Apache Software Foundation or its licensors, as applicable.