BRL-CAD
|
#include "common.h"
#include <stdio.h>
#include "bu/magic.h"
#include "bu/file.h"
#include "bu/mapped_file.h"
#include "bu/ptbl.h"
#include "bn/tol.h"
#include "rt/mem.h"
#include "rt/op.h"
#include "rt/directory.h"
#include "rt/anim.h"
#include "rt/tol.h"
Go to the source code of this file.
Data Structures | |
struct | db_i |
Macros | |
#define | DBI_NULL ((struct db_i *)0) |
#define | RT_CHECK_DBI(_p) BU_CKMAG(_p, DBI_MAGIC, "struct db_i") |
#define | RT_CK_DBI(_p) RT_CHECK_DBI(_p) |
#define | DB_OPEN_READONLY "r" |
#define | DB_OPEN_READWRITE "rw" |
Typedefs | |
typedef void(* | dbi_changed_t) (struct db_i *, struct directory *, int, void *) |
typedef void(* | dbi_update_nref_t) (struct db_i *, struct directory *, struct directory *, const char *, db_op_t, matp_t, void *) |
Functions | |
int | db_add_changed_clbk (struct db_i *dbip, dbi_changed_t c, void *u_data) |
int | db_rm_changed_clbk (struct db_i *dbip, dbi_changed_t c, void *u_data) |
int | db_add_update_nref_clbk (struct db_i *dbip, dbi_update_nref_t c, void *u_data) |
int | db_rm_update_nref_clbk (struct db_i *dbip, dbi_update_nref_t c, void *u_data) |
struct db_i * | db_open (const char *name, const char *mode) |
struct db_i * | db_open_inmem (void) |
struct db_i * | db_create (const char *name, int version) |
struct db_i * | db_create_inmem (void) |
void | db_close (struct db_i *dbip) |
Definition at line 146 of file db_instance.h.
Definition at line 147 of file db_instance.h.
#define RT_CK_DBI | ( | _p | ) | RT_CHECK_DBI(_p) |
Definition at line 148 of file db_instance.h.
#define DB_OPEN_READONLY "r" |
for db_open(), open the specified file as read-only
Definition at line 160 of file db_instance.h.
#define DB_OPEN_READWRITE "rw" |
for db_open(), open the specified file as read-write
Definition at line 165 of file db_instance.h.
Definition at line 53 of file db_instance.h.
typedef void(* dbi_update_nref_t) (struct db_i *, struct directory *, struct directory *, const char *, db_op_t, matp_t, void *) |
Definition at line 85 of file db_instance.h.
|
extern |
|
extern |
|
extern |
|
extern |
Open the named database.
The 'name' parameter specifies the file or filepath to a .g geometry database file for reading and/or writing.
The 'mode' parameter specifies whether to open read-only or in read-write mode, specified via the DB_OPEN_READONLY and DB_OPEN_READWRITE symbols respectively.
As a convenience, the returned db_t structure's dbi_filepath field is a C-style argv array of dirs to search when attempting to open related files (such as data files for EBM solids or texture-maps). The default values are "." and the directory containing the ".g" file. They may be overridden by setting the environment variable BRLCAD_FILE_PATH.
Returns: DBI_NULL error db_i * success
"open" an in-memory-only database instance. this initializes a dbip for use, creating an inmem dbi_wdbp as the means to add geometry to the directory (use wdb_export_external()).
Create a new database containing just a header record, regardless of whether the database previously existed or not, and open it for reading and writing.
This routine also calls db_dirbuild(), so the caller doesn't need to.
Returns: DBI_NULL on error db_i * on success
creates an in-memory-only database. this is very similar to db_open_inmem() with the exception that the this routine adds a default _GLOBAL object.