Skip to content

Commit

Permalink
open_db -> opendb, close_db -> closedb
Browse files Browse the repository at this point in the history
  • Loading branch information
starseeker committed Aug 29, 2023
1 parent a7bba28 commit 9bf31c3
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/libged/close/close.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ extern "C" {
#ifdef GED_PLUGIN
#include "../include/plugin.h"

struct ged_cmd_impl close_cmd_impl = {"close_db", ged_close_core, GED_CMD_DEFAULT};
struct ged_cmd_impl close_cmd_impl = {"closedb", ged_close_core, GED_CMD_DEFAULT};
const struct ged_cmd close_cmd = { &close_cmd_impl };

const struct ged_cmd *close_cmds[] = { &close_cmd, NULL };
Expand Down
12 changes: 6 additions & 6 deletions src/libged/garbage_collect/garbage_collect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,11 @@ ged_garbage_collect_core(struct ged *gedp, int argc, const char *argv[])

// If we got this far, we need to close the current database, open the new
// one, and verify the data
av[0] = "close_db";
av[0] = "closedb";
av[1] = NULL;
ged_exec(gedp, 1, (const char **)av);

av[0] = "open_db";
bu_exit(-1, "done");
av[0] = "opendb";
av[1] = bu_vls_cstr(&working_file);
av[2] = NULL;
if (ged_exec(gedp, 2, (const char **)av) != BRLCAD_OK) {
Expand Down Expand Up @@ -273,14 +273,14 @@ ged_garbage_collect_core(struct ged *gedp, int argc, const char *argv[])
}
if (ret == BRLCAD_ERROR) {
bu_vls_printf(gedp->ged_result_str, "ERROR: %s has incorrect data! Something is very wrong. Aborting garbage collect, database unchanged\n", bu_vls_cstr(&working_file));
av[0] = "close_db";
av[0] = "closedb";
av[1] = NULL;
ged_exec(gedp, 1, (const char **)av);
goto gc_cleanup;
}

// Done verifying
av[0] = "close_db";
av[0] = "closedb";
av[1] = NULL;
ged_exec(gedp, 1, (const char **)av);

Expand Down Expand Up @@ -314,7 +314,7 @@ ged_garbage_collect_core(struct ged *gedp, int argc, const char *argv[])
}

// Open the renamed, garbage collected file
av[0] = "open_db";
av[0] = "opendb";
av[1] = bu_vls_cstr(&fpath);
av[2] = NULL;
if (ged_exec(gedp, 2, (const char **)av) != BRLCAD_OK) {
Expand Down
3 changes: 3 additions & 0 deletions src/libged/ged.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ ged_init(struct ged *gedp)
gedp->fbs_open_client_handler = NULL;
gedp->fbs_close_client_handler = NULL;

gedp->ged_opendb_callback = NULL;
gedp->ged_closedb_callback = NULL;

gedp->ged_subprocess_init_callback = NULL;
gedp->ged_subprocess_end_callback = NULL;

Expand Down
2 changes: 1 addition & 1 deletion src/libged/open/open.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ extern "C" {
struct ged_cmd_impl reopen_cmd_impl = {"reopen", ged_reopen_core, GED_CMD_DEFAULT};
const struct ged_cmd reopen_cmd = { &reopen_cmd_impl };

struct ged_cmd_impl open_cmd_impl = {"open_db", ged_reopen_core, GED_CMD_DEFAULT};
struct ged_cmd_impl open_cmd_impl = {"opendb", ged_reopen_core, GED_CMD_DEFAULT};
const struct ged_cmd open_cmd = { &open_cmd_impl };


Expand Down
4 changes: 2 additions & 2 deletions src/libged/tests/draw/draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -719,15 +719,15 @@ main(int ac, char *av[]) {


// Done with moss.g
s_av[0] = "close_db";
s_av[0] = "closedb";
s_av[1] = NULL;
ged_exec(dbp, 1, s_av);
bu_file_delete("moss_tmp.g");

/* The rook model is a more appropriate test case for mode 3, since its
* wireframe is dramatically different when evaluated.*/
bu_vls_sprintf(&fname, "%s/rook.g", av[1]);
s_av[0] = "open_db";
s_av[0] = "opendb";
s_av[1] = bu_vls_cstr(&fname);
s_av[2] = NULL;
ged_exec(dbp, 2, s_av);
Expand Down

0 comments on commit 9bf31c3

Please sign in to comment.