BRL-CAD
|
#include <mapped_file.h>
Data Fields | |
char * | name |
void * | buf |
size_t | buflen |
int | is_mapped |
char * | appl |
void * | apbuf |
size_t | apbuflen |
time_t | modtime |
int | uses |
void * | handle |
Structure for opening a mapped file.
Each file is opened and mapped only once (per application, as tagged by the string in "appl" field). Subsequent opens require an exact match on both strings.
Before allocating apbuf and performing data conversion into it, openers should check to see if the file has already been opened and converted previously.
When used in RT, the mapped files are not closed at the end of a frame, so that subsequent frames may take advantage of the large data files having already been read and converted. Examples include EBMs, texture maps, and height fields.
For appl == "db_i", file is a ".g" database & apbuf is (struct db_i *).
Definition at line 81 of file mapped_file.h.
char* name |
bu_strdup() of file name
Definition at line 82 of file mapped_file.h.
void* buf |
In-memory copy of file (may be mmapped)
Definition at line 83 of file mapped_file.h.
size_t buflen |
Definition at line 84 of file mapped_file.h.
int is_mapped |
1=mmap() used, 0=bu_malloc/fread
Definition at line 85 of file mapped_file.h.
char* appl |
bu_strdup() of tag for application using 'apbuf'
Definition at line 86 of file mapped_file.h.
void* apbuf |
opt: application-specific buffer
Definition at line 87 of file mapped_file.h.
size_t apbuflen |
opt: application-specific buflen
Definition at line 88 of file mapped_file.h.
time_t modtime |
date stamp, in case file is modified
Definition at line 89 of file mapped_file.h.
int uses |
Definition at line 90 of file mapped_file.h.
void* handle |
PRIVATE - for internal file-specific implementation data
Definition at line 91 of file mapped_file.h.