l_file_t Struct Reference

File representation. More...


Data Fields

HANDLE handle
 File "system" handle.
char * base_ptr
 Base of the file.
char * data_ptr
 Data pointer.
unsigned short size
 Current size of the file.
unsigned short preserved
 Number of preallocated bytes (>= size).


Detailed Description

File representation.

libl uses this structure for all its operations, i.e. the pointer type l_file_p.

data_ptr can be used to access the file data at any time. One can also use pointer arithmetic on it, because all functions are based on the difference of data_ptr from base_ptr for determining the current file position.

The C definition of the structure looks like this:

typedef struct {
        HANDLE          handle;
        char            *base_ptr;
        char            *data_ptr;
        unsigned short  size;
        unsigned short  preserved;
} l_file_t, *l_file_p;

Note:
If you are accessing data_ptr directly for writing files (e.g. with memcpy ), you may want to update the size member of the structure as well to prevent libl to truncate the file at the wrong number of bytes when calling lclose().


Generated on Mon Jan 7 22:10:10 2008 for libl by  doxygen 1.5.1