Update CHANGES, remove some old deprecated code

Yikes, been a while since I checked this list.  Add notes about globals
removed.  Additionally, try to clean out some of the lower hanging fruit
on the "deprecated" list.
This commit is contained in:
Clifford Yapp committed 2025-04-11 23:21:15 -04:00
1 parent 9a90cde487
commit ac6c6dd2b2
28 files changed
+117 -575

No files matched your search

+75 -53
View File
@@ -134,26 +134,26 @@ removed at any time.
include/raytrace librt
db_search_context removed in favor of new db_search params -
old db_search function signature can temporarily be obtained
under the name db_search_old
under the name db_search_old [deprecated 7.42]
libged "how" command and its exposure in Tcl
Currently returning an internal GED numerical value - will
either be changed to report a human readable string instead
or (more likely) retired as a command outright in favor of
a "view obj [name] info mode" subcommand.
a "view obj [name] info mode" subcommand. [deprecated 7.42]
include/ged/commands.h
current ged_cmd_valid functionality will be replaced by
ged_cmd_exists and ged_cmd_same.
ged_cmd_exists and ged_cmd_same. [deprecated 7.42]
include/bg/plane.h
removing tri_specific structure - only used internally in
one place in BRL-CAD code as of v7.40.2.
one place in BRL-CAD code as of v7.40.2. [deprecated 7.42]
MGED features
predictor frame for velocity-based navigation will be removed.
Early idea in 3D space navigation that doesn't seemed to have
panned out in practice.
panned out in practice. [deprecated 7.42]
GED commands
removing command-line-supplied edit string support from the
@@ -166,11 +166,13 @@ GED commands
editit (-e opt)
edmater (-E opt)
red (-E opt)
[deprecated 7.42]
ability to specify xyz center with trailing arguments on
the nirt commad line (i.e. nirt obj1 obj2 ... x y z at
MGED command prompt) will be removed in favor of an --xyz
option instead (i.e. nirt -xyz x y z obj1 obj2 ...)
[deprecated 7.42]
7.40
----
@@ -183,18 +185,21 @@ include/bu/process.h
bu_process_args: replaced by bu_process_args_n
bu_process_id: replaced by bu_pid
bu_terminate: replaced by bu_pid_terminate
[deprecated 7.40]
MGED commands
p, r and g optional arguments to summary command -
info can be obtained via search
info can be obtained via search [deprecated 7.40]
dbip, get_dbip - exposure of low-level pointer information
Shouldn't be using this at a user/scripting level
[deprecated 7.40]
7.38
----
MGED commands
E (a.k.a "big E") - replaced by "draw -m5"
[deprecated 7.38]
7.32
----
@@ -204,7 +209,7 @@ include/bg/chull.h
indexes into provided points array, to allow the caller
to decide if new arrays are needed. [deprecated 7.32]
bg_polyline_2d_chull, bg_2d_chull, bg_3d_coplanar_chull,
bg_3d_chull
bg_3d_chull [deprecated 7.32]
include/bu/exit.h
TODO: warrants discussion
@@ -214,6 +219,7 @@ include/bu/exit.h
path from the calling application. (Currently available as
bu_backtrace_app and bu_crashreport_app, these would replace
existing versions after deprecation is final.)
[deprecated 7.32]
MGED gui
The following will be removed from MGED's menu bar (unused
@@ -222,12 +228,14 @@ MGED gui
that are seldom changed.)
Settings->Mouse Behavior->Pick Raytrace-Object(s)
[deprecated 7.32]
MGED overlay command
Instead of an optional second argument being the view object
name, command will take (potentially) multiple plot files
as input to overlay. Optional view object name will be
specified with the -N option.
[deprecated 7.32]
7.30
----
@@ -248,13 +256,6 @@ include/bu/redblack.h
7.28
----
include/bu/malloc.h
bu_ck_malloc_ptr, bu_mem_barriercheck, bu_prmem
replaced by modern memory analyzers [deprecated 7.28]
include/rt/mem.h
rt_memprint [deprecated 7.28]
include/vmath.h
VCOMB3, VCOMB3N, VJOIN4
Removed as inconsistent and unused API [deprecated 7.28]
@@ -282,42 +283,14 @@ signal analysis tools
include/bu/ptbl.h
BU_PTBL_BASEADDR, BU_PTBL_LASTADDR, BU_PTBL_END
Removed as private implementation detail [deprecated 7.26]
include/bu/hash.h
bu_hash_tbl_find, bu_set_hash_value, bu_get_hash_value,
bu_get_hash_key, bu_hash_tbl_add, bu_hash_tbl_print,
bu_hash_tbl_free, bu_hash_tbl_first, bu_hash_tbl_next,
bu_hash_tbl_traverse, bu_hash_record. public structs
bu_hash_entry and bu_hash_tbl will be made private.
Replaced with new API [deprecated 7.26]
include/bu/cmd.h
remove struct bu_cmdhist and struct bu_cmdhist_obj [deprecated 7.26]
BU_CMDHIST_NULL, BU_CMDHIST_OBJ_NULL, bu_cmdhist_histor, bu_cmdhist_add,
bu_cmdhist_curr, bu_cmdhist_nest, bu_cmdhist_prev [deprecated 7.26]
nirt
-T - use LIBRT_BOT_MINTIE environment variable instead [deprecated 7.26]
all global variables
global variables are no longer considered published public API [deprecated 7.26]
bn_mat_identity -> MAT_INIT_IDN or MAT_IDN() or NULL
include/bn.h
tp_setup, no longer needs to be public API [deprecated 7.26]
include/raytrace.h
curve_to_tcl_list
db_full_path_appendresult tcl_obj_to_int_array
tcl_obj_to_fastf_array tcl_list_to_int_array
tcl_list_to_fastf_array *_tcl_*, removal of all tcl-specific
API functions [deprecated 7.26]
include/rt/solid.h
shouldn't be public API - this level of detail belongs inside the display
manager [deprecated 7.26]
include/ged/defines.h
remove struct ged_drawable - shouldn't be public API [deprecated 7.26]
remove freesolid from struct ged - exposes struct solid [deprecated 7.26]
include/ged/view.h
remove current forms of dl_erasePathFromDisplay and invent_solid - they
expose the struct solid type [deprecated 7.26]
include/tclcad.h
tclcad_bn_mat_print tclcad_rt_parse_ray tclcad_rt_pr_cutter
tclcad_rt_pr_hit tclcad_rt_rt tclcad_rt_import_from_path, removal of all
tclcad_rt_rt tclcad_rt_import_from_path, removal of all
tcl-specific API functions [deprecated 7.26]
librt, fast4-g
removal of CLINE entity support [deprecated 7.26]
@@ -341,8 +314,6 @@ include/raytrace.h librt
----
include/raytrace.h librt
nmg_model_break_e_on_v -> nmg_break_e_on_v [deprecation 7.22]
RT_GET_TREE -> BU_GET [deprecation 7.22]
RT_FREE_TREE -> BU_PUT [deprecation 7.22]
7.20
----
@@ -352,12 +323,8 @@ librt
bspline primitive [deprecated 7.20]
poly primitive [deprecated 7.20]
hf primitive [deprecated 7.20]
include/bu.h
bu_vls_init_if_uninit() -> bu_vls_init() [deprecated 7.20]
GNU Autotools configure compatibility script
./configure -> cmake . [deprecated 7.20]
include/raytrace.h
rt_load_attrs() -> rt_gettrees_and_attrs() or db5_import_attributs() [deprecated 7.20]
7.18
----
@@ -454,7 +421,23 @@ include/raytrace.h
7.42.0
------
librt
include/bu.h
bu_brlcad_root: replaced by bu_dir [deprecated 7.32]
bu_brlcad_dir: replaced by bu_dir [deprecated 7.32]
bu_ck_malloc_ptr, bu_mem_barriercheck, bu_prmem
replaced by modern memory analyzers [deprecated 7.28]
remove struct bu_cmdhist and struct bu_cmdhist_obj [deprecated 7.26]
BU_CMDHIST_NULL, BU_CMDHIST_OBJ_NULL, bu_cmdhist_histor, bu_cmdhist_add,
bu_cmdhist_curr, bu_cmdhist_nest, bu_cmdhist_prev [deprecated 7.26]
bu_vls_init_if_uninit() -> bu_vls_init() [deprecated 7.20]
include/bn.h
tp_setup, no longer needs to be public API [deprecated 7.26]
include/raytrace.h
global variables in RTG (except the vlfree list, renamed
to rt_vlfree) are removed - rtg_parallel and rtg_headwdb
[deprecated 7.26]
@@ -462,14 +445,27 @@ librt
rt_initial_tree_state is replaced by the new initialization
macro RT_DBTS_INIT [deprecated 7.26]
curve_to_tcl_list is now internal [deprecated 7.26]
rt_i struct's Orca_hash_tbl is replaced by rti_udata and
a generic rt_gettrees_clbk mechanism - see src/rt/rtshot.c
for a worked example reproducing previous behavior with
the new mechanism.
include/bu/app.h
bu_brlcad_root: replaced by bu_dir [deprecated 7.32]
bu_brlcad_dir: replaced by bu_dir [deprecated 7.32]
RT_GET_TREE -> BU_GET [deprecation 7.22]
RT_FREE_TREE -> BU_PUT [deprecation 7.22]
rt_load_attrs() -> rt_gettrees_and_attrs() or db5_import_attributs() [deprecated 7.20]
include/ged/defines.h
remove struct ged_drawable - shouldn't be public API [deprecated 7.26]
include/tclcad.h
tclcad_bn_mat_print tclcad_rt_parse_ray tclcad_rt_pr_cutter
tclcad_rt_pr_hit [deprecated 7.26]
nirt
-T - new BoT raytracing makes obsolete [deprecated 7.26]
7.38.0
------
@@ -488,6 +484,23 @@ libtermio, libcursor
nirt
Behavior available under the --old flag [deprecated 7.30]
include/rt/solid.h
shouldn't be public API - this level of detail belongs inside the display
manager [deprecated 7.26]
include/ged/defines.h
remove freesolid from struct ged - exposes struct solid [deprecated 7.26]
7.30.4
------
include/bu/hash.h
bu_hash_tbl_find, bu_set_hash_value, bu_get_hash_value,
bu_get_hash_key, bu_hash_tbl_add, bu_hash_tbl_print,
bu_hash_tbl_free, bu_hash_tbl_first, bu_hash_tbl_next,
bu_hash_tbl_traverse, bu_hash_record. public structs
bu_hash_entry and bu_hash_tbl will be made private.
Replaced with new API [deprecated 7.26]
7.30.2
------
ray tracing tools
@@ -539,6 +552,9 @@ include/bu/hash.h
bu_hash_entry and bu_hash_tbl will be made private.
Replaced with new API [deprecated 7.26]
include/rt/mem.h
rt_memprint [deprecated 7.28]
7.30.0
------
fbed, pp-fb
@@ -657,6 +673,12 @@ librtserver and Java Native Interface (JNI) bindings
pl*
pl* -> plot3* [deprecated 7.16]
include/raytrace.h
db_full_path_appendresult tcl_obj_to_int_array
tcl_obj_to_fastf_array tcl_list_to_int_array
tcl_list_to_fastf_array *_tcl_*, removal of all tcl-specific
API functions from librt to libtclcad
7.24.0
------
include/bu.h
-42
View File
@@ -84,48 +84,6 @@ BU_EXPORT extern int bu_cmd(const struct bu_cmdtab *cmds, int argc, const char *
* Returns BRLCAD_OK if cmdname defines a command in the cmds table, and BRLCAD_ERROR otherwise */
BU_EXPORT extern int bu_cmd_valid(const struct bu_cmdtab *cmds, const char *cmdname);
/** @brief Routines for maintaining a command history */
/**
* Prints out the command history.
*
* USAGE:
* history [-delays] [-outfile filename]
*/
DEPRECATED BU_EXPORT extern int bu_cmdhist_history(void *data, int argc, const char **argv);
/**
* Add a command to the history list.
*
* USAGE:
* procname add cmd
*/
DEPRECATED BU_EXPORT extern int bu_cmdhist_add(void *data, int argc, const char **argv);
/**
* Return the current command.
*
* USAGE:
* procname curr
*/
DEPRECATED BU_EXPORT extern int bu_cmdhist_curr(void *data, int argc, const char **argv);
/**
* Set the current command to the next command.
*
* USAGE:
* procname next
*/
DEPRECATED BU_EXPORT extern int bu_cmdhist_next(void *data, int argc, const char **argv);
/**
* Set the current command to the previous command.
*
* USAGE:
* procname prev
*/
DEPRECATED BU_EXPORT extern int bu_cmdhist_prev(void *data, int argc, const char **argv);
__END_DECLS
#endif /* BU_CMD_H */
-9
View File
@@ -255,15 +255,6 @@ BU_EXPORT extern int bu_shmget(int *shmid, char **shared_memory, int key, size_t
/** @} */
/* DEPRECATED */
BU_EXPORT extern void bu_prmem(const char *str);
/* DEPRECATED: use valgrind/memcheck, SGcheck */
BU_EXPORT extern void bu_ck_malloc_ptr(void *ptr, const char *str);
/* DEPRECATED: use valgrind/memcheck, SGcheck */
BU_EXPORT extern int bu_mem_barriercheck(void);
__END_DECLS
#endif /* BU_MALLOC_H */
-8
View File
@@ -94,14 +94,6 @@ typedef struct bu_vls bu_vls_t;
*/
BU_EXPORT extern void bu_vls_init(struct bu_vls *vp);
/**
* DEPRECATED: use if (!vls) bu_vls_init(vls)
*
* If a VLS is uninitialized, initialize it. If it is already
* initialized, leave it alone, caller wants to append to it.
*/
DEPRECATED BU_EXPORT extern void bu_vls_init_if_uninit(struct bu_vls *vp);
/**
* Allocate storage for a struct bu_vls, call bu_vls_init on it, and
* return the result. Allows for creation of dynamically allocated
-7
View File
@@ -70,13 +70,6 @@ __BEGIN_DECLS
BV_EXPORT extern int *tp_getchar(const unsigned char *c);
/*
* Once-only setup routine
* Used by libplot3/symbol.c, so it can't be static.
* DEPRECATED: libplot3 has been merged into libbn, so this no longer needs to be public.
*/
BV_EXPORT extern void tp_setup(void);
/** @} */
__END_DECLS
-11
View File
@@ -36,15 +36,6 @@
__BEGIN_DECLS
RT_EXPORT extern int curve_to_vlist(struct bu_list *vlfree,
struct bu_list *vhead,
const struct bg_tess_tol *ttol,
point_t V,
vect_t u_vec,
vect_t v_vec,
struct rt_sketch_internal *sketch_ip,
struct rt_curve *crv);
RT_EXPORT extern int rt_check_curve(const struct rt_curve *crv,
const struct rt_sketch_internal *skt,
int noisy);
@@ -59,8 +50,6 @@ RT_EXPORT extern void rt_curve_free(struct rt_curve *crv);
RT_EXPORT extern void rt_copy_curve(struct rt_curve *crv_out,
const struct rt_curve *crv_in);
RT_EXPORT extern struct rt_sketch_internal *rt_copy_sketch(const struct rt_sketch_internal *sketch_ip);
RT_EXPORT extern int curve_to_tcl_list(struct bu_vls *vls,
struct rt_curve *crv);
RT_EXPORT extern struct bv_scene_obj *
db_sketch_to_scene_obj(const char *sname, struct db_i *dbip, struct directory *dp, struct bview *sv, int flags);
-4
View File
@@ -223,10 +223,6 @@ RT_EXPORT extern int rt_gettrees_and_attrs(struct rt_i *rtip,
const char **argv,
int ncpus);
DEPRECATED RT_EXPORT extern int rt_load_attrs(struct rt_i *rtip,
char **attrs);
/* Print the partitions */
RT_EXPORT extern void rt_pr_partitions(const struct rt_i *rtip,
const struct partition *phead,
-22
View File
@@ -222,28 +222,6 @@ union tree {
(_p)->tr_b.tb_right = NULL; \
}
/**
* RT_GET_TREE returns a union tree pointer with the magic number is
* set to RT_TREE_MAGIC.
*
* DEPRECATED, use BU_GET()+RT_TREE_INIT()
*/
#define RT_GET_TREE(_tp, _res) { \
BU_GET((_tp), union tree); \
RT_TREE_INIT((_tp)); \
}
/**
* RT_FREE_TREE deinitializes a tree union pointer.
*
* DEPRECATED, use BU_PUT()
*/
#define RT_FREE_TREE(_tp, _res) { \
BU_PUT((_tp), union tree); \
}
/**
* flattened version of the union tree
*/
-47
View File
@@ -59,49 +59,11 @@ struct tclcad_obj {
#define TCLCAD_OBJ_NULL (struct tclcad_obj *)0
TCLCAD_EXPORT extern void tclcad_bn_mat_print(Tcl_Interp *interp, const char *title, const mat_t m);
/**
* Allow specification of a ray to trace, in two convenient formats.
*
* Examples -
* {0 0 0} dir {0 0 -1}
* {20 -13.5 20} at {10 .5 3}
*/
TCLCAD_EXPORT extern int tclcad_rt_parse_ray(Tcl_Interp *interp,
struct xray *rp,
const char *const*argv);
/**
* Format a "union cutter" structure in a TCL-friendly format. Useful
* for debugging space partitioning
*
* Examples -
* type cutnode
* type boxnode
*/
TCLCAD_EXPORT extern void tclcad_rt_pr_cutter(Tcl_Interp *interp,
const union cutter *cutp);
TCLCAD_EXPORT extern int tclcad_rt_cutter(ClientData clientData,
Tcl_Interp *interp,
int argc,
const char *const*argv);
/**
* Format a hit in a TCL-friendly format.
*
* It is possible that a solid may have been removed from the
* directory after this database was prepped, so check pointers
* carefully.
*
* It might be beneficial to use some format other than %g to give the
* user more precision.
*/
TCLCAD_EXPORT extern void tclcad_rt_pr_hit(Tcl_Interp *interp, struct hit *hitp, const struct seg *segp, int flipflag);
/**
* Generic interface for the LIBRT_class manipulation routines.
*
@@ -141,15 +103,6 @@ TCLCAD_EXPORT extern int tclcad_rt_import_from_path(Tcl_Interp *interp,
const char *path,
struct rt_wdb *wdb);
/**
* Take a db_full_path and append it to the TCL result string.
*
* NOT moving to db_fullpath.h because it is evil Tcl_Interp api
*/
TCLCAD_EXPORT extern void db_full_path_appendresult(Tcl_Interp *interp,
const struct db_full_path *pp);
/**
* Expects the Tcl_obj argument (list) to be a Tcl list and extracts
* list elements, converts them to int, and stores them in the passed
-3
View File
@@ -47,13 +47,11 @@ bu_jmpbuf
bu_list_path
bu_log
bu_malloc
bu_mem_barriercheck
bu_optarg
bu_opterr
bu_optind
bu_plong
bu_printb
bu_prmem
bu_pid
bu_ptbl_free
bu_ptbl_init
@@ -76,7 +74,6 @@ bu_vls_addr
bu_vls_extend
bu_vls_free
bu_vls_gets
bu_vls_init_if_uninit
bu_vls_init
bu_vls_printf
bu_vls_putc
-1
View File
@@ -16,7 +16,6 @@ bu_jmpbuf
bu_log
bu_log_add_hook
bu_optarg
bu_prmem
bu_ptbl_free
bu_ptbl_init
bu_setjmp_valid
-1
View File
@@ -31,7 +31,6 @@ set(
bitv.c
bomb.c
booleanize.c
brlcad_path.c
bu_init.cpp
cache.cpp
cmd.c
-176
View File
@@ -1,176 +0,0 @@
/* B R L C A D _ P A T H . C
* BRL-CAD
*
* Copyright (c) 2004-2025 United States Government as represented by
* the U.S. Army Research Laboratory.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this file; see the file named COPYING for more
* information.
*/
#include "common.h"
#ifdef HAVE_SYS_PARAM_H /* for MAXPATHLEN */
# include <sys/param.h>
#endif
#include <stdlib.h>
#include <string.h>
#include "bio.h"
#include "whereami.h"
#include "bu/app.h"
#include "bu/debug.h"
#include "bu/file.h"
#include "bu/log.h"
#include "bu/malloc.h"
#include "bu/path.h"
#include "bu/str.h"
#include "bu/vls.h"
#include "brlcad_version.h"
/* defaults for configure-less compiles */
#ifndef BRLCAD_ROOT
# define BRLCAD_ROOT "/usr/brlcad"
#endif
/* arbitrary buffer size large enough to hold a couple paths and a label */
#define MAX_WHERE_SIZE (size_t)((MAXPATHLEN*2) + 64)
/**
* put a left-hand and right-hand path together and test whether they
* exist or not.
*
* @return boolean on whether a match was found.
*/
static int
join_path(char result[MAXPATHLEN], const char *lhs, const char *rhs, struct bu_vls *searched, const char *where)
{
size_t llen, rlen;
static const char *currdir=".";
/* swap right with left if there is no left so logic is simplified
* later on.
*/
if (lhs == NULL && rhs != NULL) {
lhs = rhs;
rhs = NULL;
}
if (lhs == NULL) {
if (searched && where) {
bu_vls_strcat(searched, where);
}
return 0;
}
rlen = 0;
if (rhs) {
rlen = strlen(rhs);
}
/* be safe */
if (rlen + 2 > MAXPATHLEN) {
bu_log("Warning: path is way too long (%zu characters > %d)\n", rlen+2, MAXPATHLEN);
if (searched && where) {
bu_vls_strcat(searched, where);
}
return 0;
}
/* an empty left hand implies current directory (plus a slash is appended later) */
if (lhs[0] == '\0') {
lhs = currdir;
}
/* left-hand path should exist independent of right-hand path */
if (!bu_file_exists(lhs, NULL)) {
if (searched && where) {
bu_vls_strcat(searched, where);
}
return 0;
}
/* start fresh */
memset(result, 0, (size_t)MAXPATHLEN);
bu_strlcpy(result, lhs, (size_t)MAXPATHLEN);
/* nothing to add, so just return what we have */
if (!rhs || (rlen == 0)) {
return 1;
}
/* be safe again */
llen = strlen(result);
if (llen + rlen + 3 > MAXPATHLEN) {
bu_log("Warning: path is way too long (%zu characters > %d)\n", llen+rlen+3, MAXPATHLEN);
if (searched && where) {
bu_vls_strcat(searched, where);
}
return 0;
}
if ((*(result+llen-1) != BU_DIR_SEPARATOR) && (rhs[0] != BU_DIR_SEPARATOR)) {
/* let the caller give "/usr/brlcad" and "bin" and get "/usr/brlcad/bin" */
*(result+llen) = BU_DIR_SEPARATOR;
llen++;
} else if ((*(result+llen-1) == BU_DIR_SEPARATOR) && (rhs[0] == BU_DIR_SEPARATOR)) {
/* let the caller give "/usr/brlcad/" and "/bin" and get "/usr/brlcad/bin"*/
rhs++;
rlen--;
}
/* found a match */
bu_strlcpy(result+llen, rhs, (size_t)(MAXPATHLEN - llen));
if (bu_file_exists(result, NULL)) {
return 1;
}
/* close, but no match */
if (searched && where) {
bu_vls_strcat(searched, where);
}
return 0;
}
/**
* print out an error/warning message if we cannot find the specified
* BRLCAD_ROOT (compile-time install path)
*/
static void
root_missing(const char *paths)
{
bu_log("\
Unable to locate where BRL-CAD %s is installed while searching:\n\
%s\n\
This version of BRL-CAD was compiled to be installed at:\n\
%s\n\n", brlcad_version(), paths, BRLCAD_ROOT);
return;
}
/*
* Local Variables:
* mode: C
* tab-width: 8
* indent-tabs-mode: t
* c-file-style: "stroustrup"
* End:
* ex: shiftwidth=4 tabstop=8
*/
-25
View File
@@ -276,14 +276,6 @@ bu_realloc(register void *ptr, size_t siz, const char *str)
}
void
bu_prmem(const char *str)
{
fprintf(stderr, "bu_prmem: no op\n");
fprintf(stderr, "bu_prmem: str=%s\n", str);
}
size_t
bu_malloc_len_roundup(register size_t nbytes)
{
@@ -313,23 +305,6 @@ bu_malloc_len_roundup(register size_t nbytes)
}
void
bu_ck_malloc_ptr(void *ptr, const char *str)
{
if (UNLIKELY(ptr == (char *)NULL)) {
fprintf(stderr, "bu_ck_malloc_ptr(%p, %s) null pointer\n\n", ptr, str);
bu_bomb("Goodbye");
}
}
int
bu_mem_barriercheck(void)
{
return 0;
}
int
#ifdef HAVE_SYS_SHM_H
bu_shmget(int *shmid, char **shared_memory, int key, size_t size)
-14
View File
@@ -77,20 +77,6 @@ bu_vls_init(struct bu_vls *vp)
}
void
bu_vls_init_if_uninit(struct bu_vls *vp)
{
bu_log("DEPRECATION WARNING: bu_vls_init_if_uninit() should no longer be called.\n\t\tUse bu_vls_init() instead.\n");
if (UNLIKELY(vp == (struct bu_vls *)NULL))
bu_bomb("bu_vls_init_if_uninit() passed NULL pointer");
if (vp->vls_magic == BU_VLS_MAGIC)
return;
bu_vls_init(vp);
}
struct bu_vls *
bu_vls_vlsinit(void)
{
+1 -1
View File
@@ -1080,7 +1080,7 @@ static int tp_ctable[] = {
VFONT_LAST
};
void
static void
tp_setup(void)
{
register int *p; /* pointer to stroke table */
@@ -2420,7 +2420,8 @@ convert_leaf(db_tree_state *tree_state, const db_full_path *path,
}
tree *result;
RT_GET_TREE(result, tree_state->ts_resp);
BU_GET(result, union tree);
RT_TREE_INIT(result);
result->tr_op = OP_NOP;
return result;
}
+10
View File
@@ -63,6 +63,16 @@
__BEGIN_DECLS
/* Used by sketch extrude revolve */
extern int curve_to_vlist(struct bu_list *vlfree,
struct bu_list *vhead,
const struct bg_tess_tol *ttol,
point_t V,
vect_t u_vec,
vect_t v_vec,
struct rt_sketch_internal *sketch_ip,
struct rt_curve *crv);
/* db_flip.c */
/**
-69
View File
@@ -1402,75 +1402,6 @@ rt_ck(struct rt_i *rtip)
}
/**
* Loads a new set of attribute values (corresponding to the provided
* list of attribute names) for each region structure in the provided
* rtip.
*
* Returns -
* The number of region structures affected
*/
int rt_load_attrs(struct rt_i *rtip, char **attrs)
{
struct region *regp;
struct bu_attribute_value_set avs;
struct directory *dp;
const char *reg_name;
const char *attr;
int attr_count=0;
int region_count=0;
int did_set, i;
RT_CHECK_RTI(rtip);
RT_CK_DBI(rtip->rti_dbip);
if (db_version(rtip->rti_dbip) < 5)
return 0;
while (attrs[attr_count])
attr_count++;
for (BU_LIST_FOR(regp, region, &(rtip->HeadRegion))) {
RT_CK_REGION(regp);
did_set = 0;
reg_name = strrchr(regp->reg_name, '/');
if (reg_name == NULL)
reg_name = regp->reg_name;
else
reg_name++;
dp = db_lookup(rtip->rti_dbip, reg_name, LOOKUP_NOISY);
if (dp == RT_DIR_NULL)
continue;
bu_avs_init_empty(&avs);
if (db5_get_attributes(rtip->rti_dbip, &avs, dp)) {
bu_log("rt_load_attrs: Failed to get attributes for region %s\n", reg_name);
continue;
}
bu_avs_init_empty(&(regp->attr_values));
for (i = 0; i < attr_count; i++) {
attr = bu_avs_get(&avs, attrs[i]);
if (attr == NULL)
continue;
bu_avs_add(&(regp->attr_values), attrs[i], attr);
did_set = 1;
}
if (did_set)
region_count++;
bu_avs_free(&avs);
}
return region_count;
}
/**
* Routine called by "rt_find_paths". Used for recursing through a
* tree to find a path to the specified "end". The resulting path is
+1
View File
@@ -39,6 +39,7 @@
#include "nmg.h"
#include "rt/geom.h"
#include "raytrace.h"
#include "../../librt_private.h"
/* local interface header */
#include "./revolve.h"
+1 -1
View File
@@ -2237,7 +2237,7 @@ rt_copy_sketch(const struct rt_sketch_internal *sketch_ip)
}
int
static int
curve_to_tcl_list(struct bu_vls *vls, struct rt_curve *crv)
{
size_t i, j;
-13
View File
@@ -1322,19 +1322,6 @@ bn_cmd_random(ClientData UNUSED(clientData),
return TCL_OK;
}
void
tclcad_bn_mat_print(Tcl_Interp *interp,
const char *title,
const mat_t m)
{
char obuf[1024]; /* snprintf may be non-PARALLEL */
bn_mat_print_guts(title, m, obuf, 1024);
Tcl_AppendResult(interp, obuf, "\n", (char *)NULL);
}
void
tclcad_bn_setup(Tcl_Interp *interp)
{
-26
View File
@@ -58,31 +58,6 @@ lwrapper_func(ClientData data, Tcl_Interp *interp, int argc, const char *argv[])
#define TINYBUFSIZ 32
#define SMALLBUFSIZ 256
/**
* A wrapper for bu_prmem. Prints map of memory currently in use, to
* stderr.
*
* \@param clientData - UNUSED, present for signature matching
* @param argc - number of elements in argv
* @param argv - command name and arguments
*
* @return BRLCAD_OK if successful, otherwise, BRLCAD_ERROR.
*/
static int
tcl_bu_prmem(void *UNUSED(clientData),
int argc,
const char **argv)
{
if (argc != 2) {
bu_log("Usage: bu_prmem title\n");
return BRLCAD_ERROR;
}
bu_prmem(argv[1]);
return BRLCAD_OK;
}
/**
* Given arguments of alternating keywords and values and a specific
* keyword ("Iwant"), return the value associated with that keyword.
@@ -425,7 +400,6 @@ Bu_Init(Tcl_Interp *interp)
static struct bu_cmdtab cmds[] = {
{"bu_units_conversion", tcl_bu_units_conversion},
{"bu_dir", tcl_bu_dir},
{"bu_prmem", tcl_bu_prmem},
{"bu_get_value_by_keyword", tcl_bu_get_value_by_keyword},
{"bu_rgb_to_hsv", tcl_bu_rgb_to_hsv},
{"bu_hsv_to_rgb", tcl_bu_hsv_to_rgb},
+3 -17
View File
@@ -77,7 +77,7 @@ static struct dbcmdstruct tclcad_rt_cmds[] = {
};
int
static int
tclcad_rt_parse_ray(Tcl_Interp *interp, struct xray *rp, const char *const*argv)
{
if (bn_decode_vect(rp->r_pt, argv[0]) != 3) {
@@ -110,7 +110,7 @@ tclcad_rt_parse_ray(Tcl_Interp *interp, struct xray *rp, const char *const*argv)
}
void
static void
tclcad_rt_pr_cutter(Tcl_Interp *interp, const union cutter *cutp)
{
static const char xyz[4] = "XYZ";
@@ -200,7 +200,7 @@ tclcad_rt_cutter(ClientData clientData, Tcl_Interp *interp, int argc, const char
}
void
static void
tclcad_rt_pr_hit(Tcl_Interp *interp, struct hit *hitp, const struct seg *segp, int flipflag)
{
struct bu_vls str = BU_VLS_INIT_ZERO;
@@ -709,20 +709,6 @@ Rt_Init(Tcl_Interp *interp)
/* TCL-oriented C support for LIBRT */
void
db_full_path_appendresult(Tcl_Interp *interp, const struct db_full_path *pp)
{
size_t i;
RT_CK_FULL_PATH(pp);
for (i=0; i<pp->fp_len; i++) {
Tcl_AppendResult(interp, "/", pp->fp_names[i]->d_namep, (char *)NULL);
}
}
int
tcl_obj_to_int_array(Tcl_Interp *interp, Tcl_Obj *list, int **array, int *array_len)
{
+23 -12
View File
@@ -607,6 +607,17 @@ cmd_zap(ClientData clientData, Tcl_Interp *UNUSED(interp), int UNUSED(argc), con
}
static void
mged_bn_mat_print(Tcl_Interp *interp,
const char *title,
const mat_t m)
{
char obuf[1024]; /* snprintf may be non-PARALLEL */
bn_mat_print_guts(title, m, obuf, 1024);
Tcl_AppendResult(interp, obuf, "\n", (char *)NULL);
}
int
f_status(ClientData clientData, Tcl_Interp *interp, int argc, const char *argv[])
{
@@ -633,14 +644,14 @@ f_status(ClientData clientData, Tcl_Interp *interp, int argc, const char *argv[]
Tcl_AppendResult(interp, bu_vls_addr(&vls), (char *)NULL);
bu_vls_free(&vls);
tclcad_bn_mat_print(interp, "toViewcenter", view_state->vs_gvp->gv_center);
tclcad_bn_mat_print(interp, "Viewrot", view_state->vs_gvp->gv_rotation);
tclcad_bn_mat_print(interp, "model2view", view_state->vs_gvp->gv_model2view);
tclcad_bn_mat_print(interp, "view2model", view_state->vs_gvp->gv_view2model);
mged_bn_mat_print(interp, "toViewcenter", view_state->vs_gvp->gv_center);
mged_bn_mat_print(interp, "Viewrot", view_state->vs_gvp->gv_rotation);
mged_bn_mat_print(interp, "model2view", view_state->vs_gvp->gv_model2view);
mged_bn_mat_print(interp, "view2model", view_state->vs_gvp->gv_view2model);
if (GEOM_EDIT_STATE != ST_VIEW) {
tclcad_bn_mat_print(interp, "model2objview", view_state->vs_model2objview);
tclcad_bn_mat_print(interp, "objview2model", view_state->vs_objview2model);
mged_bn_mat_print(interp, "model2objview", view_state->vs_model2objview);
mged_bn_mat_print(interp, "objview2model", view_state->vs_objview2model);
}
return TCL_OK;
@@ -673,32 +684,32 @@ f_status(ClientData clientData, Tcl_Interp *interp, int argc, const char *argv[]
}
if (BU_STR_EQUAL(argv[1], "toViewcenter")) {
tclcad_bn_mat_print(interp, "toViewcenter", view_state->vs_gvp->gv_center);
mged_bn_mat_print(interp, "toViewcenter", view_state->vs_gvp->gv_center);
return TCL_OK;
}
if (BU_STR_EQUAL(argv[1], "Viewrot")) {
tclcad_bn_mat_print(interp, "Viewrot", view_state->vs_gvp->gv_rotation);
mged_bn_mat_print(interp, "Viewrot", view_state->vs_gvp->gv_rotation);
return TCL_OK;
}
if (BU_STR_EQUAL(argv[1], "model2view")) {
tclcad_bn_mat_print(interp, "model2view", view_state->vs_gvp->gv_model2view);
mged_bn_mat_print(interp, "model2view", view_state->vs_gvp->gv_model2view);
return TCL_OK;
}
if (BU_STR_EQUAL(argv[1], "view2model")) {
tclcad_bn_mat_print(interp, "view2model", view_state->vs_gvp->gv_view2model);
mged_bn_mat_print(interp, "view2model", view_state->vs_gvp->gv_view2model);
return TCL_OK;
}
if (BU_STR_EQUAL(argv[1], "model2objview")) {
tclcad_bn_mat_print(interp, "model2objview", view_state->vs_model2objview);
mged_bn_mat_print(interp, "model2objview", view_state->vs_model2objview);
return TCL_OK;
}
if (BU_STR_EQUAL(argv[1], "objview2model")) {
tclcad_bn_mat_print(interp, "objview2model", view_state->vs_objview2model);
mged_bn_mat_print(interp, "objview2model", view_state->vs_objview2model);
return TCL_OK;
}
-2
View File
@@ -537,8 +537,6 @@ ph_gettrees(struct pkg_conn *UNUSED(pc), char *buf)
view_end(&APP);
view_cleanup(rtip);
rt_clean(rtip);
if (optical_debug&OPTICAL_DEBUG_RTMEM_END)
bu_prmem("After rt_clean");
}
/* Load the desired portion of the model */
+1 -4
View File
@@ -465,8 +465,6 @@ int cm_clean(const int UNUSED(argc), const char **UNUSED(argv))
rt_clean(APP.a_rt_i);
if (OPTICAL_DEBUG&OPTICAL_DEBUG_RTMEM_END)
bu_prmem("After cm_clean");
return 0;
}
@@ -485,8 +483,7 @@ int cm_closedb(const int UNUSED(argc), const char **UNUSED(argv))
bu_free((void *)APP.a_rt_i, "struct rt_i");
APP.a_rt_i = RTI_NULL;
bu_prmem("After _closedb");
bu_exit(0, NULL);
bu_exit(0, "After _closedb");
return 1; /* for compiler */
}
-6
View File
@@ -163,7 +163,6 @@ package provide cadwidgets::Ged 1.0
method bounds_all {args}
method brep {args}
method bu_units_conversion {args}
method bu_prmem {args}
method bu_get_value_by_keyword {args}
method bu_rgb_to_hsv {args}
method bu_hsv_to_rgb {args}
@@ -1387,10 +1386,6 @@ package provide cadwidgets::Ged 1.0
uplevel \#0 bu_units_conversion $args
}
::itcl::body cadwidgets::Ged::bu_prmem {args} {
uplevel \#0 bu_prmem $args
}
::itcl::body cadwidgets::Ged::bu_get_value_by_keyword {args} {
uplevel \#0 bu_get_value_by_keyword $args
}
@@ -6225,7 +6220,6 @@ package provide cadwidgets::Ged 1.0
[brepname] - convert the non-BREP object to BREP form
[suffix] - convert non-BREP comb to unevaluated BREP form}}
$help add bu_units_conversion {{units} {}}
$help add bu_prmem {{title} {}}
$help add bu_get_value_by_keyword {{iwant list} {}}
$help add bu_rgb_to_hsv {{rgb} {}}
$help add bu_hsv_to_rgb {{hsv} {}}