Skip to content

Commit

Permalink
Move dup-only function to dup plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
starseeker committed Dec 2, 2024
1 parent ef276fb commit 0efd1be
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 24 deletions.
13 changes: 13 additions & 0 deletions src/libged/dup/dup.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@

#include "../ged_private.h"

static struct directory **
_ged_getspace(struct db_i *dbip,
size_t num_entries)
{
struct directory **dir_basep;

if (num_entries == 0)
num_entries = db_directory_size(dbip);

/* Allocate and cast num_entries worth of pointers */
dir_basep = (struct directory **) bu_calloc((num_entries+1), sizeof(struct directory *), "_ged_getspace *dir[]");
return dir_basep;
}

struct dir_check_stuff {
struct db_i *main_dbip;
Expand Down
9 changes: 0 additions & 9 deletions src/libged/ged_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -437,15 +437,6 @@ GED_EXPORT extern void _ged_vls_col_pr4v(struct bu_vls *vls,
int no_decorate,
int ssflag);

/**
* This routine walks through the directory entry list and mallocs
* enough space for pointers to hold the number of entries specified
* by the argument if > 0.
*
*/
GED_EXPORT extern struct directory ** _ged_getspace(struct db_i *dbip,
size_t num_entries);


GED_EXPORT extern int invent_solid(struct ged *gedp, char *name, struct bu_list *vhead, long int rgb, int copy, fastf_t transparency, int dmode, int csoltab);

Expand Down
15 changes: 0 additions & 15 deletions src/libged/ged_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -529,21 +529,6 @@ _ged_vls_col_pr4v(struct bu_vls *vls,

/*********************************************************/

struct directory **
_ged_getspace(struct db_i *dbip,
size_t num_entries)
{
struct directory **dir_basep;

if (num_entries == 0)
num_entries = db_directory_size(dbip);

/* Allocate and cast num_entries worth of pointers */
dir_basep = (struct directory **) bu_calloc((num_entries+1), sizeof(struct directory *), "_ged_getspace *dir[]");
return dir_basep;
}


void
_ged_cmd_help(struct ged *gedp, const char *usage, struct bu_opt_desc *d)
{
Expand Down

0 comments on commit 0efd1be

Please sign in to comment.