Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

archive.h File Reference

Archive API. More...

#include <libcomprex/directory.h>
#include <libcomprex/file.h>
#include <libcomprex/fp.h>
#include <libcomprex/module.h>
#include <libcomprex/types.h>

Go to the source code of this file.

Data Structures

struct  _CxArchive
 A representation of an archive of files. More...


Structure (De)allocation Functions

CxArchive * cxNewArchive (void)
 Creates a new CxArchive structure.

void cxDestroyArchive (CxArchive *archive)
 Destroys a CxArchive structure.


Attribute Modification Functions

void cxSetArchiveModule (CxArchive *archive, CxModule *module)
 Sets the archive's asssociated module.

void cxSetArchiveType (CxArchive *archive, CxArchiveType type)
 Sets the archive type.

void cxSetArchiveAccessMode (CxArchive *archive, CxAccessMode mode)
 Sets the archive's file access mode.

void cxSetArchiveFileName (CxArchive *archive, const char *filename)
 Sets the archive's physical filename.

void cxSetArchivePath (CxArchive *archive, const char *path)
 Sets the full path to the archive.

void cxSetArchivePhysicalPath (CxArchive *archive, const char *path)
 Sets the full physical path to the archive.

void cxSetArchiveFileSize (CxArchive *archive, unsigned int fileSize)
 Sets the archive's physical file size.

void cxSetArchiveSize (CxArchive *archive, unsigned int archiveSize)
 Sets the total size of the archive's contents.

void cxSetArchiveLocal (CxArchive *archive, char isLocal)
 Sets whether or not the archive is stored locally.

void cxSetArchiveExtractCallback (CxArchive *archive, void(*callback)(CxArchive *, CxFile *, size_t, size_t))
 Sets the archive specific extraction callback.


Attribute Retrieval Functions

CxModule * cxGetArchiveModule (CxArchive *archive)
 Returns the archive's associated module.

CxArchiveType cxGetArchiveType (CxArchive *archive)
 Returns the archive type.

CxAccessMode cxGetArchiveAccessMode (CxArchive *archive)
 Returns the archive's file access mode.

const char * cxGetArchiveFileName (CxArchive *archive)
 Returns the archive's physical filename.

const char * cxGetArchivePath (CxArchive *archive)
 Returns the full path to the specified archive.

const char * cxGetArchivePhysicalPath (CxArchive *archive)
 Returns the full physical path to the file.

size_t cxGetArchiveFileCount (CxArchive *archive)
 Returns the total number of files in the archive.

unsigned int cxGetArchiveFileSize (CxArchive *archive)
 Returns the archive's physical file size.

unsigned int cxGetArchiveSize (CxArchive *archive)
 Returns the total size of the archive's contents.

char cxIsArchiveLocal (CxArchive *archive)
 Returns whether or not the archive is stored locally.

CxDirectory * cxGetArchiveRoot (CxArchive *archive)
 Returns the root directory in the archive.


Typedefs

typedef _CxArchive CxArchive
 An archive.


Detailed Description

Archive API.

Copyright:
(C) 2001-2003 The GNUpdate Project.
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.

You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.


Typedef Documentation

typedef struct _CxArchive CxArchive
 

An archive.


Function Documentation

void cxDestroyArchive (  CxArchive *    archive ) 
 

Destroys a CxArchive structure.

Parameters:
archive The structure to destroy.
See also:
cxNewArchive()

CxAccessMode cxGetArchiveAccessMode (  CxArchive *    archive ) 
 

Returns the archive's file access mode.

Parameters:
archive The archive.
Returns:
The archive's file access mode.
See also:
cxSetArchiveAccessMode()

size_t cxGetArchiveFileCount (  CxArchive *    archive ) 
 

Returns the total number of files in the archive.

Parameters:
archive The archive.
Returns:
The total number of files in the archive.

const char* cxGetArchiveFileName (  CxArchive *    archive ) 
 

Returns the archive's physical filename.

Parameters:
archive The archive.
Returns:
The archive's physical filename.
See also:
cxSetArchiveFileName()

unsigned int cxGetArchiveFileSize (  CxArchive *    archive ) 
 

Returns the archive's physical file size.

Parameters:
archive The archive.
Returns:
The archive's physical file size.
See also:
cxSetArchiveFileSize()

CxModule* cxGetArchiveModule (  CxArchive *    archive ) 
 

Returns the archive's associated module.

Parameters:
archive The archive.
Returns:
The archive's associated module.
See also:
cxSetArchiveModule()

const char* cxGetArchivePath (  CxArchive *    archive ) 
 

Returns the full path to the specified archive.

This may include such non-physical elements as FTP sites, archives, etc. in the path.

Parameters:
archive The archive.
Returns:
The path to the archive.
See also:
cxSetArchivePath()

cxGetArchivePhysicalPath()

cxSetArchivePhysicalPath()

const char* cxGetArchivePhysicalPath (  CxArchive *    archive ) 
 

Returns the full physical path to the file.

If the archive is non-local, this will be a temporary file.

Parameters:
archive The archive.
Returns:
The physical path to the file.
See also:
cxSetArchivePhysicalPath()

cxGetArchivePath()

cxSetArchivePath()

CxDirectory* cxGetArchiveRoot (  CxArchive *    archive ) 
 

Returns the root directory in the archive.

Parameters:
archive The archive.
Returns:
The archive's root directory.

unsigned int cxGetArchiveSize (  CxArchive *    archive ) 
 

Returns the total size of the archive's contents.

Parameters:
archive The archive.
Returns:
The total size of the archive's contents.
See also:
cxSetArchiveSize()

CxArchiveType cxGetArchiveType (  CxArchive *    archive ) 
 

Returns the archive type.

Parameters:
archive The archive.
Returns:
The archive's type.
See also:
cxSetArchiveType()

char cxIsArchiveLocal (  CxArchive *    archive ) 
 

Returns whether or not the archive is stored locally.

If the archive is located online, or within another archive, this will be 0. Otherwise, this will be 1.

Parameters:
archive The archive.
Returns:
1 if the archive is stored locally; 0 otherwise.
See also:
cxSetArchiveLocal()

CxArchive* cxNewArchive (  void    ) 
 

Creates a new CxArchive structure.

Returns:
A new, empty CxArchive structure.
See also:
cxDestroyArchive()

void cxSetArchiveAccessMode (  CxArchive *    archive,
CxAccessMode    mode
) 
 

Sets the archive's file access mode.

Parameters:
archive The archive.
mode The access mode.
See also:
cxGetArchiveAccessMode()

void cxSetArchiveExtractCallback (  CxArchive *    archive,
void(*    callback)(CxArchive *, CxFile *, size_t, size_t)
) 
 

Sets the archive specific extraction callback.

Parameters:
archive The archive.
callback The callback function.

void cxSetArchiveFileName (  CxArchive *    archive,
const char *    filename
) 
 

Sets the archive's physical filename.

Parameters:
archive The archive.
filename The physical filename.
See also:
cxGetArchiveFileName()

void cxSetArchiveFileSize (  CxArchive *    archive,
unsigned int    fileSize
) 
 

Sets the archive's physical file size.

Parameters:
archive The archive.
fileSize The physical size of the archive.
See also:
cxGetArchiveFileSize()

void cxSetArchiveLocal (  CxArchive *    archive,
char    isLocal
) 
 

Sets whether or not the archive is stored locally.

If the archive is located online, or within another archive, this should be 0. Otherwise, this should be 1.

Parameters:
archive The archive.
isLocal 1 if the archive is stored locally; 0 otherwise.
See also:
cxIsArchiveLocal()

void cxSetArchiveModule (  CxArchive *    archive,
CxModule *    module
) 
 

Sets the archive's asssociated module.

This should really only be used by libcomprex.

Parameters:
archive The archive.
module The associated module.
See also:
cxGetArchiveModule()

void cxSetArchivePath (  CxArchive *    archive,
const char *    path
) 
 

Sets the full path to the archive.

This may include such non-physical elements as FTP sites, archives, etc. in the path.

Parameters:
archive The archive.
path The path to the archive.
See also:
cxSetArchivePath()

cxGetArchivePhysicalPath()

cxSetArchivePhysicalPath()

void cxSetArchivePhysicalPath (  CxArchive *    archive,
const char *    path
) 
 

Sets the full physical path to the archive.

If the archive is non-local, this should be a temporary file.

Parameters:
archive The archive.
path The physical path to the file.
See also:
cxGetArchivePhysicalPath()

cxGetArchivePath()

cxSetArchivePath()

void cxSetArchiveSize (  CxArchive *    archive,
unsigned int    archiveSize
) 
 

Sets the total size of the archive's contents.

Parameters:
archive The archive.
archiveSize The total size of the archive's contents.
See also:
cxGetArchiveSize()

void cxSetArchiveType (  CxArchive *    archive,
CxArchiveType    type
) 
 

Sets the archive type.

Parameters:
archive The archive.
type The archive type.
See also:
cxGetArchiveType()


Generated on Wed Mar 5 20:47:43 2003 for libcomprex by doxygen1.2.18-20021020