Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

file.h File Reference

File structures. More...

#include <sys/types.h>
#include <time.h>
#include <libcomprex/fsnode.h>
#include <libcomprex/archive.h>
#include <libcomprex/types.h>

Go to the source code of this file.

Data Structures

struct  _CxFileData
 The data specific to a file node. More...


Structure (De)allocation Functions

CxFile * cxNewFile (void)
 Creates a new CxFile structure.

void cxDestroyFile (CxFile *file)
 Destroys a CxFile structure.


Attribute Modification Functions

void cxSetFileArchive (CxFile *file, CxArchive *archive)
 Sets the archive that owns the file.

void cxSetFileParent (CxFile *file, CxDirectory *parent)
 Sets the specified file's parent directory.

void cxSetFileName (CxFile *file, const char *name)
 Sets the base name of the specified file.

void cxSetFilePhysicalPath (CxFile *file, const char *path)
 Sets the full physical path to the file.

void cxSetFileMode (CxFile *file, mode_t mode)
 Sets the mode of the specified file.

void cxSetFileUid (CxFile *file, uid_t uid)
 Sets the user ID of the specified file.

void cxSetFileGid (CxFile *file, gid_t gid)
 Sets the group ID of the specified file.

void cxSetFileCompressedSize (CxFile *file, unsigned int size)
 Sets the compressed size of the specified file.

void cxSetFileSize (CxFile *file, unsigned int size)
 Sets the uncompressed size of the specified file.

void cxSetFileDate (CxFile *file, time_t date)
 Sets the timestamp of the specified file.

void cxSetFileLocal (CxFile *file, char isLocal)
 Sets whether or not the file is stored locally.


Attribute Retrieval Functions

CxArchive * cxGetFileArchive (CxFile *file)
 Returns the archive that owns the specified file.

CxDirectory * cxGetFileParent (CxFile *file)
 Returns the specified file's parent directory.

const char * cxGetFileName (CxFile *file)
 Returns the name of the specified file.

const char * cxGetFilePath (CxFile *file)
 Returns the full path to the specified file.

const char * cxGetFilePhysicalPath (CxFile *file)
 Returns the full physical path to the file.

mode_t cxGetFileMode (CxFile *file)
 Returns the mode of the specified file.

uid_t cxGetFileUid (CxFile *file)
 Returns the user ID of the specified file.

gid_t cxGetFileGid (CxFile *file)
 Returns the group ID of the specified file.

unsigned int cxGetFileCompressedSize (CxFile *file)
 Returns the compressed size of the specified file.

unsigned int cxGetFileSize (CxFile *file)
 Returns the uncompressed size of the specified file.

time_t cxGetFileDate (CxFile *file)
 Returns the timestamp of the specified file.

char cxIsFileLocal (CxFile *file)
 Returns whether or not the file is stored locally.


Iteration Functions

CxFile * cxGetNextFile (CxFile *file)
 Returns the next file in a list of files.

CxFile * cxGetPreviousFile (CxFile *file)
 Returns the previous file in a list of files.


Typedefs

typedef _CxFsNode CxFile
 A single file.

typedef _CxFileData CxFileData
 File data.


Detailed Description

File structures.

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 _CxFsNode CxFile
 

A single file.

typedef struct _CxFileData CxFileData
 

File data.


Function Documentation

void cxDestroyFile (  CxFile *    file ) 
 

Destroys a CxFile structure.

Parameters:
file The CxFile to destroy.
See also:
cxNewFile()

CxArchive* cxGetFileArchive (  CxFile *    file ) 
 

Returns the archive that owns the specified file.

Parameters:
file The file.
Returns:
The archive that owns this file.
See also:
cxSetFileArchive()

unsigned int cxGetFileCompressedSize (  CxFile *    file ) 
 

Returns the compressed size of the specified file.

Parameters:
file The file.
Returns:
The file's compressed size.
See also:
cxSetFileCompressedSize()

time_t cxGetFileDate (  CxFile *    file ) 
 

Returns the timestamp of the specified file.

Parameters:
file The file.
Returns:
The date/time timestamp in seconds since the epoch.
See also:
cxSetFileDate()

gid_t cxGetFileGid (  CxFile *    file ) 
 

Returns the group ID of the specified file.

Parameters:
file The file.
Returns:
The group ID of the specified file.
See also:
cxSetFileGid()

mode_t cxGetFileMode (  CxFile *    file ) 
 

Returns the mode of the specified file.

Parameters:
file The file.
Returns:
The file's mode.
See also:
cxSetFileMode()

const char* cxGetFileName (  CxFile *    file ) 
 

Returns the name of the specified file.

Parameters:
file The file.
Returns:
The file's name.
See also:
cxSetFileName()

CxDirectory* cxGetFileParent (  CxFile *    file ) 
 

Returns the specified file's parent directory.

Parameters:
file The file.
Returns:
The specified file's parent directory.
See also:
cxSetFileParent()

const char* cxGetFilePath (  CxFile *    file ) 
 

Returns the full path to the specified file.

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

Parameters:
file The file.
Returns:
The path to the file.
See also:
cxGetFilePhysicalPath()

cxSetFilePhysicalPath()

const char* cxGetFilePhysicalPath (  CxFile *    file ) 
 

Returns the full physical path to the file.

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

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

cxGetFilePath()

unsigned int cxGetFileSize (  CxFile *    file ) 
 

Returns the uncompressed size of the specified file.

Parameters:
file The file.
Returns:
The file's uncompressed size.
See also:
cxSetFileSize()

uid_t cxGetFileUid (  CxFile *    file ) 
 

Returns the user ID of the specified file.

Parameters:
file The file.
Returns:
The user ID of the specified file.
See also:
cxSetFileUid()

CxFile* cxGetNextFile (  CxFile *    file ) 
 

Returns the next file in a list of files.

Parameters:
file The current file.
Returns:
The next file in the list.
See also:
cxGetFirstFile()

cxGetPreviousFile()

CxFile* cxGetPreviousFile (  CxFile *    file ) 
 

Returns the previous file in a list of files.

Parameters:
file The current file.
Returns:
The previous file in the list.
See also:
cxGetFirstFile()

cxGetNextFile()

char cxIsFileLocal (  CxFile *    file ) 
 

Returns whether or not the file is stored locally.

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

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

CxFile* cxNewFile (  void    ) 
 

Creates a new CxFile structure.

Returns:
A new, empty CxFile structure.
See also:
cxDestroyFile()

void cxSetFileArchive (  CxFile *    file,
CxArchive *    archive
) 
 

Sets the archive that owns the file.

This should only be used by libcomprex.

Parameters:
file The file.
archive The archive that owns this file.
See also:
cxGetFileArchive()

void cxSetFileCompressedSize (  CxFile *    file,
unsigned int    size
) 
 

Sets the compressed size of the specified file.

Parameters:
file The file.
size The file's compressed size.
See also:
cxGetFileCompressedSize()

void cxSetFileDate (  CxFile *    file,
time_t    date
) 
 

Sets the timestamp of the specified file.

Parameters:
file The file.
date The date/time timestamp in seconds since the epoch.
See also:
cxGetFileDate()

void cxSetFileGid (  CxFile *    file,
gid_t    gid
) 
 

Sets the group ID of the specified file.

Parameters:
file The file.
gid The group ID.
See also:
cxGetFileGid()

void cxSetFileLocal (  CxFile *    file,
char    isLocal
) 
 

Sets whether or not the file is stored locally.

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

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

void cxSetFileMode (  CxFile *    file,
mode_t    mode
) 
 

Sets the mode of the specified file.

Parameters:
file The file.
mode The mode.
See also:
cxGetFileMode()

void cxSetFileName (  CxFile *    file,
const char *    name
) 
 

Sets the base name of the specified file.

Parameters:
file The file.
name The filename.
See also:
cxGetFileName()

void cxSetFileParent (  CxFile *    file,
CxDirectory *    parent
) 
 

Sets the specified file's parent directory.

Parameters:
file The file.
parent The parent directory.
See also:
cxGetFileParent()

void cxSetFilePhysicalPath (  CxFile *    file,
const char *    path
) 
 

Sets the full physical path to the file.

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

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

cxGetFilePath()

void cxSetFileSize (  CxFile *    file,
unsigned int    size
) 
 

Sets the uncompressed size of the specified file.

Parameters:
file The file.
size The file's uncompressed size.
See also:
cxGetFileSize()

void cxSetFileUid (  CxFile *    file,
uid_t    uid
) 
 

Sets the user ID of the specified file.

Parameters:
file The file.
uid The user ID.
See also:
cxGetFileUid()


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