Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

utils.h File Reference

Utility functions. More...

#include <libcomprex/comprex.h>

Go to the source code of this file.

Defines

#define CX_LINK(ptr)   ++(ptr)->refCount
 Updates the reference count on a structure.

#define CX_UNLINK(ptr)   --(ptr)->refCount
 Decrements the reference count on a structure.


Functions

void cxSplitPath (const char *path, char **dir, char **basename)
 Splits the specified path into a directory part and a filename part.

char * cxGetBaseName (const char *path)
 Returns the base filename for the specified path.

char * cxGetBasePath (const char *path)
 Returns the base path for the specified path.

char * cxFixPath (const char *path)
 Fixes up the specified path by processing all ".." and "." that may be in the path.

char * cxGetFullFilePath (const char *filename)
 Returns the full, absolute path for the specified filename.

void cxMakePhysDirs (const char *path, CxArchive *archive)
 Makes a directory and all its parent directories, if missing, on the filesystem.

void cxApplyFsNodeInfo (CxFsNode *node, const char *path)
 Applies the information from an FsNode to a physical file or directory.


Detailed Description

Utility functions.

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_LINK ptr       ++(ptr)->refCount
 

Updates the reference count on a structure.

Parameters:
ptr The structure that is in use.

#define CX_UNLINK ptr       --(ptr)->refCount
 

Decrements the reference count on a structure.

Note:
This should not be called manually. Please use the appropriate cxDestroy*() function, as it will handle this automatically.
Parameters:
ptr The structure that is no longer to be in use.


Function Documentation

void cxApplyFsNodeInfo CxFsNode   node,
const char *    path
 

Applies the information from an FsNode to a physical file or directory.

This applies the mode, UID, GID, and timestamp, if available.

Parameters:
node The FsNode.
path The path to apply the information to.

char* cxFixPath const char *    path
 

Fixes up the specified path by processing all ".." and "." that may be in the path.

Parameters:
path The path
Returns:
The path, possibly shortened and processed.
See also:
cxGetFullFilePath()

char* cxGetBaseName const char *    path
 

Returns the base filename for the specified path.

The base filename is the part not containing path information.

Parameters:
path The path.
Returns:
The base filename.
See also:
cxGetBasePath()

cxSplitPath()

char* cxGetBasePath const char *    path
 

Returns the base path for the specified path.

The base path is the part not containing the actual filename.

Parameters:
path The path.
Returns:
The base path.
See also:
cxGetBaseName()

cxSplitPath()

char* cxGetFullFilePath const char *    filename
 

Returns the full, absolute path for the specified filename.

This prepends the current working directory, if the specified path is not an absolute path.

The path will be processed by using the cxFixPath() function.

Parameters:
filename The filename
Returns:
The processed, absolute path name to the file.
See also:
cxFixPath()

void cxMakePhysDirs const char *    path,
CxArchive   archive
 

Makes a directory and all its parent directories, if missing, on the filesystem.

If an archive is specified (not NULL), the modes and permissions in the path will reflect those in the archive.

Parameters:
path The path to create.
archive The archive to use as a base for permissions and modes.

void cxSplitPath const char *    path,
char **    dir,
char **    basename
 

Splits the specified path into a directory part and a filename part.

Parameters:
path The path to split.
dir The returned directory part.
basename The returned filename part.
See also:
cxGetBaseName()

cxGetBasePath()


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