Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

fsnode.h File Reference

Filesystem node structures. More...

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

Go to the source code of this file.

Data Structures

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


Utility Functions

#define CX_IS_DIRECTORY(node)   (cxGetFsNodeType(node) == CX_FSNODETYPE_DIRECTORY)
 Returns true if the specified node type is a directory.


Structure (De)allocation Functions

CxFsNodecxNewFsNode (void)
 Creates a new CxFsNode structure.

void cxDestroyFsNode (CxFsNode *node)
 Destroys a CxFsNode structure.


Attribute Modification Functions

void cxSetFsNodeArchive (CxFsNode *node, CxArchive *archive)
 Sets the archive that owns the node.

void cxSetFsNodeParent (CxFsNode *node, CxDirectory *parent)
 Sets the specified node's parent directory.

void cxSetFsNodeName (CxFsNode *node, const char *name)
 Sets the base name of the specified node.

void cxSetFsNodeType (CxFsNode *node, CxFsNodeType type)
 Sets the type of node.

void cxSetFsNodeMode (CxFsNode *node, mode_t mode)
 Sets the mode of the specified node.

void cxSetFsNodeUid (CxFsNode *node, uid_t uid)
 Sets the user ID of the specified node.

void cxSetFsNodeGid (CxFsNode *node, gid_t gid)
 Sets the group ID of the specified node.

void cxSetFsNodeDate (CxFsNode *node, time_t date)
 Sets the timestamp of the specified node.

void cxSetFsNodeLocal (CxFsNode *node, char isLocal)
 Sets whether or not the node is stored locally.


Attribute Retrieval Functions

CxArchivecxGetFsNodeArchive (CxFsNode *node)
 Returns the archive that owns the specified node.

CxDirectorycxGetFsNodeParent (CxFsNode *node)
 Returns the specified node's parent directory.

const char * cxGetFsNodeName (CxFsNode *node)
 Returns the name of the specified node.

const char * cxGetFsNodePath (CxFsNode *node)
 Returns the full path to the specified node.

CxFsNodeType cxGetFsNodeType (CxFsNode *node)
 Gets the type of node.

mode_t cxGetFsNodeMode (CxFsNode *node)
 Returns the mode of the specified node.

uid_t cxGetFsNodeUid (CxFsNode *node)
 Returns the user ID of the specified node.

gid_t cxGetFsNodeGid (CxFsNode *node)
 Returns the group ID of the specified node.

time_t cxGetFsNodeDate (CxFsNode *node)
 Returns the timestamp of the specified node.

char cxIsFsNodeLocal (CxFsNode *node)
 Returns whether or not the node is stored locally.


Iteration Functions

CxFsNodecxGetNextFsNode (CxFsNode *node)
 Returns the next node in a list of nodes.

CxFsNodecxGetPreviousFsNode (CxFsNode *node)
 Returns the previous node in a list of nodes.


Typedefs

typedef _CxFsNode CxFsNode
 A filesystem node.

typedef enum _CxFsNodeType CxFsNodeType
 A type of node.


Enumerations

enum  _CxFsNodeType { CX_FSNODETYPE_UNKNOWN = 0, CX_FSNODETYPE_FILE, CX_FSNODETYPE_DIRECTORY }
 A type of filesystem node. More...


Detailed Description

Filesystem node 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.


Define Documentation

#define CX_IS_DIRECTORY node       (cxGetFsNodeType(node) == CX_FSNODETYPE_DIRECTORY)
 

Returns true if the specified node type is a directory.

Parameters:
node The node to check.
Returns:
true if the node is a directory.


Typedef Documentation

typedef struct _CxFsNode CxFsNode
 

A filesystem node.

typedef enum _CxFsNodeType CxFsNodeType
 

A type of node.


Enumeration Type Documentation

enum _CxFsNodeType
 

A type of filesystem node.

Enumeration values:
CX_FSNODETYPE_UNKNOWN  Unknown node type.
CX_FSNODETYPE_FILE  A single file.
CX_FSNODETYPE_DIRECTORY  A directory.


Function Documentation

void cxDestroyFsNode CxFsNode   node
 

Destroys a CxFsNode structure.

Parameters:
node The CxFsNode to destroy.
See also:
cxNewFsNode()

CxArchive* cxGetFsNodeArchive CxFsNode   node
 

Returns the archive that owns the specified node.

Parameters:
node The node.
Returns:
The archive that owns this node.
See also:
cxSetFsNodeArchive()

time_t cxGetFsNodeDate CxFsNode   node
 

Returns the timestamp of the specified node.

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

gid_t cxGetFsNodeGid CxFsNode   node
 

Returns the group ID of the specified node.

Parameters:
node The node.
Returns:
The group ID of the specified node.
See also:
cxSetFsNodeGid()

mode_t cxGetFsNodeMode CxFsNode   node
 

Returns the mode of the specified node.

Parameters:
node The node.
Returns:
The node's mode.
See also:
cxSetFsNodeMode()

const char* cxGetFsNodeName CxFsNode   node
 

Returns the name of the specified node.

Parameters:
node The node.
Returns:
The node's name.
See also:
cxSetFsNodeName()

CxDirectory* cxGetFsNodeParent CxFsNode   node
 

Returns the specified node's parent directory.

Parameters:
node The node.
Returns:
The specified node's parent directory.
See also:
cxSetFsNodeParent()

const char* cxGetFsNodePath CxFsNode   node
 

Returns the full path to the specified node.

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

Parameters:
node The node.
Returns:
The path to the node.

CxFsNodeType cxGetFsNodeType CxFsNode   node
 

Gets the type of node.

Parameters:
node The node.
Returns:
The type of node.
See also:
cxSetFsNodeType()

uid_t cxGetFsNodeUid CxFsNode   node
 

Returns the user ID of the specified node.

Parameters:
node The node.
Returns:
The user ID of the specified node.
See also:
cxSetFsNodeUid()

CxFsNode* cxGetNextFsNode CxFsNode   node
 

Returns the next node in a list of nodes.

Parameters:
node The current node.
Returns:
The next node in the list.
See also:
cxGetPreviousFsNode()

CxFsNode* cxGetPreviousFsNode CxFsNode   node
 

Returns the previous node in a list of nodes.

Parameters:
node The current node.
Returns:
The previous node in the list.
See also:
cxGetNextFsNode()

char cxIsFsNodeLocal CxFsNode   node
 

Returns whether or not the node is stored locally.

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

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

CxFsNode* cxNewFsNode void   
 

Creates a new CxFsNode structure.

Returns:
A new, empty CxFsNode structure.
See also:
cxDestroyFsNode()

void cxSetFsNodeArchive CxFsNode   node,
CxArchive   archive
 

Sets the archive that owns the node.

This should only be used by libcomprex.

Parameters:
node The node.
archive The archive that owns this node.
See also:
cxGetFsNodeArchive()

void cxSetFsNodeDate CxFsNode   node,
time_t    date
 

Sets the timestamp of the specified node.

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

void cxSetFsNodeGid CxFsNode   node,
gid_t    gid
 

Sets the group ID of the specified node.

Parameters:
node The node.
gid The group ID.
See also:
cxGetFsNodeGid()

void cxSetFsNodeLocal CxFsNode   node,
char    isLocal
 

Sets whether or not the node is stored locally.

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

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

void cxSetFsNodeMode CxFsNode   node,
mode_t    mode
 

Sets the mode of the specified node.

Parameters:
node The node.
mode The mode.
See also:
cxGetFsNodeMode()

void cxSetFsNodeName CxFsNode   node,
const char *    name
 

Sets the base name of the specified node.

Parameters:
node The node.
name The nodename.
See also:
cxGetFsNodeName()

void cxSetFsNodeParent CxFsNode   node,
CxDirectory   parent
 

Sets the specified node's parent directory.

Parameters:
node The node.
parent The parent directory.
See also:
cxGetFsNodeParent()

void cxSetFsNodeType CxFsNode   node,
CxFsNodeType    type
 

Sets the type of node.

Parameters:
node The node.
type The type of node.
See also:
cxGetFsNodeType()

void cxSetFsNodeUid CxFsNode   node,
uid_t    uid
 

Sets the user ID of the specified node.

Parameters:
node The node.
uid The user ID.
See also:
cxGetFsNodeUid()


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