BRL-CAD
Loading...
Searching...
No Matches
database.h
Go to the documentation of this file.
1/* D A T A B A S E . H
2 * BRL-CAD
3 *
4 * Copyright (c) 2008-2025 United States Government as represented by
5 * the U.S. Army Research Laboratory.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public License
9 * version 2.1 as published by the Free Software Foundation.
10 *
11 * This library is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this file; see the file named COPYING for more
18 * information.
19 */
20/** @addtogroup ged_database
21 *
22 * Geometry EDiting Library Database Level Functions.
23 *
24 */
25/** @{ */
26/** @file ged/database.h */
27
28#ifndef GED_DATABASE_H
29#define GED_DATABASE_H
30
31#include "common.h"
32#include "ged/defines.h"
33
35
36/** Check if a database is open */
37#define GED_CHECK_DATABASE_OPEN(_gedp, _flags) \
38 if ((_gedp) == GED_NULL || (_gedp)->dbip == DBI_NULL) { \
39 int ged_check_database_open_quiet = (_flags) & GED_QUIET; \
40 if (!ged_check_database_open_quiet) { \
41 if ((_gedp) != GED_NULL) { \
42 bu_vls_trunc((_gedp)->ged_result_str, 0); \
43 bu_vls_printf((_gedp)->ged_result_str, "A database is not open!"); \
44 } else {\
45 bu_log("A database is not open!\n"); \
46 } \
47 } \
48 return (_flags); \
49 }
50
51/**
52 * Checks that each directory in the supplied path actually has the subdirectories
53 * that are implied by the path.
54 */
55GED_EXPORT extern int ged_path_validate(struct ged *gedp, const struct db_full_path * const path);
56
57/**
58 * Return a count of objects displayed
59 */
60GED_EXPORT extern size_t ged_who_argc(struct ged *gedp);
61
62/**
63 * Return a list of names of objects displayed
64 */
65GED_EXPORT extern int ged_who_argv(struct ged *gedp, char **start, const char **end);
66
67
68/* defined in copy.c */
70 struct ged *to_gedp,
71 const char *from,
72 const char *to,
73 int fflag);
74
76
77#endif /* GED_DATABASE_H */
78
79/** @} */
80
81/*
82 * Local Variables:
83 * tab-width: 8
84 * mode: C
85 * indent-tabs-mode: t
86 * c-file-style: "stroustrup"
87 * End:
88 * ex: shiftwidth=4 tabstop=8
89 */
Definition dvec.h:74
Header file for the BRL-CAD common definitions.
int ged_who_argv(struct ged *gedp, char **start, const char **end)
size_t ged_who_argc(struct ged *gedp)
int ged_dbcopy(struct ged *from_gedp, struct ged *to_gedp, const char *from, const char *to, int fflag)
int ged_path_validate(struct ged *gedp, const struct db_full_path *const path)
Definition defines.h:167