Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Related Pages  

file.h File Reference

File structures. More...

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

Go to the source code of this file.

Data Structures

struct  _CxFile
 A representation of a file on the filesystem or in an archive. More...


Structure (De)allocation Functions

CxFilecxNewFile (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 cxSetFilePath (CxFile *file, const char *path)
 Sets the full path to the file.

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

void cxSetFileType (CxFile *file, CxFileType type)
 Sets the type of 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 isLocalFile)
 Sets whether or not the file is stored locally.


Attribute Retrieval Functions

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

CxDirectorycxGetFileParent (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.

CxFileType cxGetFileType (CxFile *file)
 Gets the type of 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

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

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


Typedefs

typedef _CxFile CxFile
 A single file.

typedef enum _CxFileType CxFileType
 A type of file.


Enumerations

enum  _CxFileType {
  CX_FILETYPE_UNKNOWN = 0, CX_FILETYPE_NORMAL, CX_FILETYPE_SYMLINK, CX_FILETYPE_HARDLINK,
  CX_FILETYPE_CHAR_DEVICE, CX_FILETYPE_BLOCK_DEVICE, CX_FILETYPE_FIFO
}
 A type of file. More...


Detailed Description

File structures.

Id:
file.h,v 1.22 2002/05/25 19:55:36 chipx86 Exp
Copyright:
(C) 2001-2002 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 _CxFile CxFile
 

A single file.

typedef enum _CxFileType CxFileType
 

A type of file.


Enumeration Type Documentation

enum _CxFileType
 

A type of file.

Enumeration values:
CX_FILETYPE_UNKNOWN  Unknown type.
CX_FILETYPE_NORMAL  A normal file.
CX_FILETYPE_SYMLINK  Symbolic link.
CX_FILETYPE_HARDLINK  Hard link.
CX_FILETYPE_CHAR_DEVICE  Character device.
CX_FILETYPE_BLOCK_DEVICE  Block device.
CX_FILETYPE_FIFO  FIFO.


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:
cxSetFilePath() , 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() , cxSetFilePath()

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()

CxFileType cxGetFileType CxFile   file
 

Gets the type of file.

Parameters:
file  The file.
Returns:
The type of file.
See also:
cxSetFileType()

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    isLocalFile
 

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.
isLocalFile  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 cxSetFilePath CxFile   file,
const char *    path
 

Sets the full path to the file.

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

Parameters:
file  The file.
path  The path to the file.
See also:
cxSetFilePath() , cxGetFilePhysicalPath() , cxSetFilePhysicalPath()

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() , cxSetFilePath()

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 cxSetFileType CxFile   file,
CxFileType    type
 

Sets the type of file.

Parameters:
file  The file.
type  The type of file.
See also:
cxGetFileType()

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 May 29 12:20:35 2002 for libcomprex by doxygen1.2.15-20020430