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). | |
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;
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().
1.5.1