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

fp.h File Reference

File Pointers. More...

Go to the source code of this file.

Data Structures

struct  _CxFP
 A file pointer. More...


Typedefs

typedef _CxFP CxFP
 A file pointer.


Functions

CxFPcxNewFp (void)
 Creates a file pointer structure.

void cxSetFpAccessMode (CxFile *file, CxAccessMode accessMode)
 Sets the access mode of the specified file.

void cxSetReadFunc (CxFP *fp, size_t(*fnc)(void *, size_t, size_t, CxFP *))
 Sets the read function for this file pointer.

void cxSetWriteFunc (CxFP *fp, size_t(*fnc)(const void *, size_t, size_t, CxFP *))
 Sets the write function for this file pointer.

void cxSetSeekFunc (CxFP *fp, void(*fnc)(CxFP *, long, int))
 Sets the seek function for this file pointer.

void cxSetCloseFunc (CxFP *fp, void(*fnc)(CxFP *))
 Sets the close function for this file pointer.

void cxSetError (CxFP *fp, int errnum, const char *errstr)
 Sets the current error number and string.

CxAccessMode cxGetFpAccessMode (CxFile *file)
 Returns the access mode of the specified file.


Detailed Description

File Pointers.

Id:
fp.h,v 1.3 2002/05/29 07:56:27 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 _CxFP CxFP
 

A file pointer.


Function Documentation

CxAccessMode cxGetFpAccessMode CxFile   file
 

Returns the access mode of the specified file.

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

CxFP* cxNewFp void   
 

Creates a file pointer structure.

Returns:
A new file pointer structure.
See also:
cxClose()

void cxSetCloseFunc CxFP   fp,
void(*    fnc)(CxFP *)
 

Sets the close function for this file pointer.

This should destroy the module-specific content associated with this file pointer in the moduleData variable.

This function must be in the following format:

 void closeFunction(CxFP *fp)
 {
     ...
 }

The name of the function can be changed, of course.

Parameters:
fp  The file pointer.
fnc  The close function.
See also:
cxSetReadFunc() , cxSetSeekFunc() , cxSetWriteFunc()

void cxSetError CxFP   fp,
int    errnum,
const char *    errstr
 

Sets the current error number and string.

Parameters:
fp  The file pointer.
errnum  The error number.
errstr  The error string.

void cxSetFpAccessMode CxFile   file,
CxAccessMode    accessMode
 

Sets the access mode of the specified file.

Parameters:
file  The file.
accessMode  The access mode.
See also:
cxGetFpAccessMode()

void cxSetReadFunc CxFP   fp,
size_t(*    fnc)(void *, size_t, size_t, CxFP *)
 

Sets the read function for this file pointer.

This should work just like libc's fread() function, but with a CxFP instead of a FILE. It must read from the file stored in the archive.

This function must be in the following format:

 size_t readFunction(void *ptr, size_t size, size_t nmemb, CxFP *fp)
 {
     ...
 }

The name of the function can be changed, of course.

Parameters:
fp  The file pointer.
fnc  The read function.
See also:
cxSetCloseFunc() , cxSetSeekFunc() , cxSetWriteFunc()

void cxSetSeekFunc CxFP   fp,
void(*    fnc)(CxFP *, long, int)
 

Sets the seek function for this file pointer.

This should work just like libc's fseek() function, but with a CxFP instead of a FILE. It must seek to the specified location in the file.

This function must be in the following format:

 void seekFunction(CxFP *fp, long offset, int whence)
 {
     ...
 }

The name of the function can be changed, of course.

Parameters:
fp  The file pointer.
fnc  The seek function.
See also:
cxSetCloseFunc() , cxSetReadFunc() , cxSetWriteFunc()

void cxSetWriteFunc CxFP   fp,
size_t(*    fnc)(const void *, size_t, size_t, CxFP *)
 

Sets the write function for this file pointer.

This should work just like libc's fwrite() function, but with a CxFP instead of a FILE. It must write to the file stored in the archive.

This function must be in the following format:

 size_t writeFunction(const void *ptr, size_t size, size_t nmemb, CxFP *fp)
 {
     ...
 }

The name of the function can be changed, of course.

Parameters:
fp  The file pointer.
fnc  The write function.
See also:
cxSetCloseFunc() , cxSetReadFunc() , cxSetSeekFunc()


Generated on Wed May 29 12:20:35 2002 for libcomprex by doxygen1.2.15-20020430