BRL-CAD
#include "common.h"
#include <limits.h>
#include <math.h>
#include <string.h>
#include "bio.h"
#include "bu/debug.h"
#include "bu/file.h"
#include "bu/list.h"
#include "bu/log.h"
#include "bu/malloc.h"
#include "bu/mapped_file.h"
#include "bu/parallel.h"
#include "bu/str.h"
#include "bu/vls.h"
Include dependency graph for mappedfile.c:

Go to the source code of this file.

Functions

struct bu_mapped_filebu_open_mapped_file (const char *name, const char *appl)
 
void bu_close_mapped_file (struct bu_mapped_file *mp)
 
void bu_pr_mapped_file (const char *title, const struct bu_mapped_file *mp)
 
void bu_free_mapped_files (int verbose)
 
struct bu_mapped_filebu_open_mapped_file_with_path (char *const *path, const char *name, const char *appl)
 

Detailed Description

Routines for sharing large read-only data files.

Routines for sharing large read-only data files like height fields, bit map solids, texture maps, etc. Uses memory mapped files where available.

Each instance of the file has the raw data available as element "buf". If a particular application needs to transform the raw data in a manner that is identical across all uses of that application (e.g. height fields, EBMs, etc.), then the application should provide a non-null "appl" string, to tag the format of the "apbuf". This will keep different applications from sharing that instance of the file.

Thus, if the same filename is opened for interpretation as both an EBM and a height field, they will be assigned different mapped file structures, so that the "apbuf" pointers are distinct.

Definition in file mappedfile.c.