|
Context algorithm
Semi-predictive context algorithm implementation
|
#include <stdio.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include "mapfile.h"#include "debug.h"#include <sys/mman.h>Go to the source code of this file.
Functions | |
| static int | fileOpen (char *name, Uint *textlen, BOOL writefile) |
| Opens a file and reads gets its size. More... | |
| static void * | fileParts (int fd, Uint offset, Uint len, BOOL writemap) |
| Maps an open file into RAM memory. More... | |
| static void * | genfile2String (char *name, Uint *textlen, BOOL writefile, BOOL writemap) |
| Opens a file and maps it into memory. More... | |
| void | freetextspace (Uchar *text, Uint textlen) |
| Frees the memory used by the mapping of a file. More... | |
| void * | file2String (char *name, Uint *textlen) |
| Opens a file and maps it into memory. More... | |
| void* file2String | ( | char * | name, |
| Uint * | textlen | ||
| ) |
Maps an open file into RAM memory.
| [in] | fd | file descriptor of the file to map. |
| [in] | offset | start the map at this offset from the file begining. |
| [in] | len | length of the section of the file to map. |
| [in] | writemap | flag indicating if it will be possible to write the file though the memory map. |
Opens a file and maps it into memory.
| [in] | name | name and path of the file to open. |
| [out] | textlen | size in bytes of the file. |
| [in] | writefile | flag indicating if the file shall be open with write aceess. |
| [in] | writemap | flag indicating if it will be possible to write the file though the memory map. |