bu_mapped_file Struct Reference

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. More...

#include <bu.h>

Collaboration diagram for bu_mapped_file:

Collaboration graph
[legend]

Data Fields

bu_list l
char * name
 bu_strdup() of file name
genptr_t buf
 In-memory copy of file (may be mmapped).
long buflen
 # bytes in 'buf'
int is_mapped
 1=mmap() used, 0=bu_malloc/fread
char * appl
 bu_strdup() of tag for application using 'apbuf'
genptr_t apbuf
 opt: application-specific buffer
long apbuflen
 opt: application-specific buflen
long modtime
 date stamp, in case file is modified
int uses
 # ptrs to this struct handed out
int dont_restat
 1=on subsequent opens, don't re-stat()

Detailed Description

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 1070 of file bu.h.


Field Documentation

struct bu_list l
 

Definition at line 1071 of file bu.h.

Referenced by bu_free_mapped_files(), and bu_open_mapped_file().

char* name
 

bu_strdup() of file name

Definition at line 1072 of file bu.h.

Referenced by bu_free_mapped_files(), bu_open_mapped_file(), and bu_pr_mapped_file().

genptr_t buf
 

In-memory copy of file (may be mmapped).

Definition at line 1073 of file bu.h.

Referenced by bu_free_mapped_files(), bu_open_mapped_file(), db_open(), rt_ebm_import(), rt_ebm_import5(), rt_hf_import(), and rt_mk_binunif().

long buflen
 

# bytes in 'buf'

Definition at line 1074 of file bu.h.

Referenced by bu_free_mapped_files(), bu_open_mapped_file(), db5_scan(), db_open(), rt_ebm_import(), rt_ebm_import5(), and rt_hf_import().

int is_mapped
 

1=mmap() used, 0=bu_malloc/fread

Definition at line 1075 of file bu.h.

Referenced by bu_free_mapped_files(), and bu_open_mapped_file().

char* appl
 

bu_strdup() of tag for application using 'apbuf'

Definition at line 1076 of file bu.h.

Referenced by bu_free_mapped_files(), and bu_open_mapped_file().

genptr_t apbuf
 

opt: application-specific buffer

Definition at line 1077 of file bu.h.

Referenced by bu_free_mapped_files(), db_open(), rt_ebm_import(), rt_ebm_import5(), rt_hf_import(), rt_hf_plot(), and rt_hf_prep().

long apbuflen
 

opt: application-specific buflen

Definition at line 1078 of file bu.h.

Referenced by rt_ebm_import(), rt_ebm_import5(), and rt_hf_import().

long modtime
 

date stamp, in case file is modified

Definition at line 1079 of file bu.h.

Referenced by bu_open_mapped_file().

int uses
 

# ptrs to this struct handed out

Definition at line 1080 of file bu.h.

Referenced by bu_close_mapped_file(), bu_free_mapped_files(), bu_open_mapped_file(), rt_dsp_prep(), and rt_hf_prep().

int dont_restat
 

1=on subsequent opens, don't re-stat()

Definition at line 1081 of file bu.h.

Referenced by rt_submodel_prep().


The documentation for this struct was generated from the following file:
Generated on Mon Sep 18 01:25:11 2006 for BRL-CAD by  doxygen 1.4.6