#include "common.h"
#include <stdio.h>
#include <math.h>
#include <fcntl.h>
#include <strings.h>
#include "machine.h"
#include "bu.h"
Include dependency graph for mappedfile.c:
Go to the source code of this file.
Functions | |
bu_mapped_file * | bu_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) |
bu_mapped_file * | bu_open_mapped_file_with_path (char *const *path, const char *name, const char *appl) |
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.