BRL-CAD
tables.c
Go to the documentation of this file.
1 /* T A B L E S . C
2  * BRL-CAD
3  *
4  * Copyright (c) 2008-2014 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 /** @file libged/tables.c
21  *
22  * The tables command.
23  *
24  */
25 
26 #include "common.h"
27 
28 #include <stdlib.h>
29 #ifdef HAVE_SYS_TYPES_H
30 # include <sys/types.h>
31 #endif
32 #ifdef HAVE_PWD_H
33 # include <pwd.h>
34 #endif
35 #include <ctype.h>
36 #include <string.h>
37 
38 #include "bu/units.h"
39 #include "./ged_private.h"
40 
41 
42 /* structure to distinguish new solids from existing (old) solids */
43 struct identt {
44  size_t i_index;
45  char i_name[NAMESIZE+1];
46  mat_t i_mat;
47 };
48 
49 
50 #define ABORTED -99
51 #define OLDSOLID 0
52 #define NEWSOLID 1
53 #define SOL_TABLE 1
54 #define REG_TABLE 2
55 #define ID_TABLE 3
56 
57 static int idfd = 0;
58 static int rd_idfd = 0;
59 static FILE *tabptr = NULL;
60 
61 
62 HIDDEN int
63 tables_check(char *a, char *b)
64 {
65 
66  int c= sizeof(struct identt);
67 
68  while (c--) if (*a++ != *b++) return 0; /* no match */
69  return 1; /* match */
70 
71 }
72 
73 
74 HIDDEN size_t
75 tables_sol_number(const matp_t matrix, char *name, size_t *old, size_t *numsol)
76 {
77  off_t i;
78  struct identt idbuf1, idbuf2;
79  static struct identt identt = {0, {0}, MAT_INIT_ZERO};
80  ssize_t readval;
81 
82  memset(&idbuf1, 0, sizeof(struct identt));
83  bu_strlcpy(idbuf1.i_name, name, sizeof(idbuf1.i_name));
84  MAT_COPY(idbuf1.i_mat, matrix);
85 
86  for (i = 0; i < (ssize_t)*numsol; i++) {
87  (void)lseek(rd_idfd, i*sizeof(identt), 0);
88  readval = read(rd_idfd, &idbuf2, sizeof identt);
89 
90  if (readval < 0) {
91  perror("READ ERROR");
92  }
93 
94  idbuf1.i_index = i + 1;
95 
96  if (tables_check((char *)&idbuf1, (char *)&idbuf2) == 1) {
97  *old = 1;
98  return idbuf2.i_index;
99  }
100  }
101  (*numsol)++;
102  idbuf1.i_index = *numsol;
103 
104  (void)lseek(idfd, 0, 2);
105  i = write(idfd, &idbuf1, sizeof identt);
106  if (i < 0)
107  perror("write");
108 
109  *old = 0;
110  return idbuf1.i_index;
111 }
112 
113 
114 HIDDEN void
115 tables_new(struct ged *gedp, struct directory *dp, struct bu_ptbl *cur_path, const fastf_t *old_mat, int flag, size_t *numreg, size_t *numsol)
116 {
117  struct rt_db_internal intern;
118  struct rt_comb_internal *comb;
119  struct rt_tree_array *tree_list;
120  size_t node_count;
121  size_t actual_count;
122  size_t i, k;
123 
124  RT_CK_DIR(dp);
125  BU_CK_PTBL(cur_path);
126 
127  if (!(dp->d_flags & RT_DIR_COMB))
128  return;
129 
130  if (rt_db_get_internal(&intern, dp, gedp->ged_wdbp->dbip, (fastf_t *)NULL, &rt_uniresource) < 0) {
131  bu_vls_printf(gedp->ged_result_str, "Database read error, aborting\n");
132  return;
133  }
134 
135  comb = (struct rt_comb_internal *)intern.idb_ptr;
136  RT_CK_COMB(comb);
137 
138  if (comb->tree && db_ck_v4gift_tree(comb->tree) < 0) {
140  if (db_ck_v4gift_tree(comb->tree) < 0) {
141  bu_vls_printf(gedp->ged_result_str, "Cannot flatten tree for editing\n");
142  intern.idb_meth->ft_ifree(&intern);
143  return;
144  }
145  }
146 
147  if (!comb->tree) {
148  /* empty combination */
149  intern.idb_meth->ft_ifree(&intern);
150  return;
151  }
152 
153  node_count = db_tree_nleaves(comb->tree);
154  tree_list = (struct rt_tree_array *)bu_calloc(node_count,
155  sizeof(struct rt_tree_array), "tree list");
156 
157  /* flatten tree */
158  actual_count = (struct rt_tree_array *)db_flatten_tree(tree_list,
159  comb->tree, OP_UNION, 0, &rt_uniresource) - tree_list;
160  BU_ASSERT_SIZE_T(actual_count, ==, node_count);
161 
162  if (dp->d_flags & RT_DIR_REGION) {
163  struct bu_vls str = BU_VLS_INIT_ZERO;
164 
165  (*numreg)++;
166  bu_vls_printf(&str, " %-4zu %4ld %4ld %4ld %4ld ",
167  *numreg, comb->region_id, comb->aircode, comb->GIFTmater, comb->los);
168  bu_vls_fwrite(tabptr, &str);
169  bu_vls_free(&str);
170 
171  for (k = 0; k < BU_PTBL_LEN(cur_path); k++) {
172  struct directory *path_dp;
173 
174  path_dp = (struct directory *)BU_PTBL_GET(cur_path, k);
175  RT_CK_DIR(path_dp);
176  fprintf(tabptr, "/%s", path_dp->d_namep);
177  }
178  fprintf(tabptr, "/%s:\n", dp->d_namep);
179 
180  if (flag == ID_TABLE)
181  goto out;
182 
183  for (i = 0; i < actual_count; i++) {
184  char op;
185  int nsoltemp=0;
186  struct rt_db_internal sol_intern;
187  struct directory *sol_dp;
188  mat_t temp_mat;
189  size_t old;
190 
191  switch (tree_list[i].tl_op) {
192  case OP_UNION:
193  op = DB_OP_UNION;
194  break;
195  case OP_SUBTRACT:
196  op = DB_OP_UNION;
197  break;
198  case OP_INTERSECT:
199  op = DB_OP_INTERSECT;
200  break;
201  default:
202  bu_log("unrecognized operation in region %s\n", dp->d_namep);
203  op = '?';
204  break;
205  }
206 
207  if ((sol_dp=db_lookup(gedp->ged_wdbp->dbip, tree_list[i].tl_tree->tr_l.tl_name, LOOKUP_QUIET)) != RT_DIR_NULL) {
208  if (sol_dp->d_flags & RT_DIR_COMB) {
209  fprintf(tabptr, " RG %c %s\n",
210  op, sol_dp->d_namep);
211  continue;
212  } else if (!(sol_dp->d_flags & RT_DIR_SOLID)) {
213  fprintf(tabptr, " ?? %c %s\n",
214  op, sol_dp->d_namep);
215  continue;
216  } else {
217  if (tree_list[i].tl_tree->tr_l.tl_mat) {
218  bn_mat_mul(temp_mat, old_mat,
219  tree_list[i].tl_tree->tr_l.tl_mat);
220  } else {
221  MAT_COPY(temp_mat, old_mat);
222  }
223  if (rt_db_get_internal(&sol_intern, sol_dp, gedp->ged_wdbp->dbip, temp_mat, &rt_uniresource) < 0) {
224  bu_log("Could not import %s\n", tree_list[i].tl_tree->tr_l.tl_name);
225  nsoltemp = 0;
226  }
227  nsoltemp = tables_sol_number((const matp_t)temp_mat, tree_list[i].tl_tree->tr_l.tl_name, &old, numsol);
228  fprintf(tabptr, " %c [%d] ", op, nsoltemp);
229  }
230  } else {
231  const matp_t mat = (const matp_t)old_mat;
232  nsoltemp = tables_sol_number(mat, tree_list[i].tl_tree->tr_l.tl_name, &old, numsol);
233  fprintf(tabptr, " %c [%d] ", op, nsoltemp);
234  continue;
235  }
236 
237  if (flag == REG_TABLE || old) {
238  (void) fprintf(tabptr, "%s\n", tree_list[i].tl_tree->tr_l.tl_name);
239  continue;
240  } else
241  (void) fprintf(tabptr, "%s: ", tree_list[i].tl_tree->tr_l.tl_name);
242 
243  if (!old && (sol_dp->d_flags & RT_DIR_SOLID)) {
244  /* if we get here, we must be looking for a solid table */
245  struct bu_vls tmp_vls = BU_VLS_INIT_ZERO;
246 
247  if (!OBJ[sol_intern.idb_type].ft_describe ||
248  OBJ[sol_intern.idb_type].ft_describe(&tmp_vls, &sol_intern, 1, gedp->ged_wdbp->dbip->dbi_base2local, &rt_uniresource, gedp->ged_wdbp->dbip) < 0) {
249  bu_vls_printf(gedp->ged_result_str, "%s describe error\n", tree_list[i].tl_tree->tr_l.tl_name);
250  }
251  fprintf(tabptr, "%s", bu_vls_addr(&tmp_vls));
252  bu_vls_free(&tmp_vls);
253  }
254  if (nsoltemp && (sol_dp->d_flags & RT_DIR_SOLID))
255  rt_db_free_internal(&sol_intern);
256  }
257  } else if (dp->d_flags & RT_DIR_COMB) {
258  int cur_length;
259 
260  bu_ptbl_ins(cur_path, (long *)dp);
261  cur_length = BU_PTBL_END(cur_path);
262 
263  for (i = 0; i < actual_count; i++) {
264  struct directory *nextdp;
265  mat_t new_mat;
266 
267  /* For the 'idents' command skip over non-union combinations above the region level,
268  * these members of a combination don't add positively to the defined regions of space
269  * and their region ID's will not show up along a shotline unless positively added
270  * elsewhere in the hierarchy. This is causing headaches for users generating an
271  * association table from our 'idents' listing.
272  */
273  if (flag == ID_TABLE) {
274  switch (tree_list[i].tl_op) {
275  case OP_UNION:
276  break;
277  case OP_SUBTRACT:
278  case OP_INTERSECT:
279  continue;
280  break;
281  default:
282  bu_log("unrecognized operation in combination %s\n", dp->d_namep);
283  break;
284  }
285  }
286 
287  nextdp = db_lookup(gedp->ged_wdbp->dbip, tree_list[i].tl_tree->tr_l.tl_name, LOOKUP_NOISY);
288  if (nextdp == RT_DIR_NULL) {
289  bu_vls_printf(gedp->ged_result_str, "\tskipping this object\n");
290  continue;
291  }
292 
293  /* recurse */
294  if (tree_list[i].tl_tree->tr_l.tl_mat) {
295  bn_mat_mul(new_mat, old_mat, tree_list[i].tl_tree->tr_l.tl_mat);
296  } else {
297  MAT_COPY(new_mat, old_mat);
298  }
299  tables_new(gedp, nextdp, cur_path, new_mat, flag, numreg, numsol);
300  bu_ptbl_trunc(cur_path, cur_length);
301  }
302  } else {
303  bu_vls_printf(gedp->ged_result_str, "Illegal flags for %s skipping\n", dp->d_namep);
304  return;
305  }
306 
307 out:
308  bu_free((char *)tree_list, "new_tables: tree_list");
309  intern.idb_meth->ft_ifree(&intern);
310  return;
311 }
312 
313 
314 int
315 ged_tables(struct ged *gedp, int argc, const char *argv[])
316 {
317  static const char sortcmd_orig[] = "sort -n +1 -2 -o /tmp/ord_id ";
318  static const char sortcmd_long[] = "sort --numeric --key=2, 2 --output /tmp/ord_id ";
319  static const char catcmd[] = "cat /tmp/ord_id >> ";
320  struct bu_vls tmp_vls = BU_VLS_INIT_ZERO;
321  struct bu_vls cmd = BU_VLS_INIT_ZERO;
322  struct bu_ptbl cur_path;
323  int flag;
324  int status;
325  char *timep;
326  time_t now;
327  int i;
328  const char *usage = "file object(s)";
329 
330  size_t numreg = 0;
331  size_t numsol = 0;
332 
334  GED_CHECK_ARGC_GT_0(gedp, argc, GED_ERROR);
335 
336  /* initialize result */
337  bu_vls_trunc(gedp->ged_result_str, 0);
338 
339  /* must be wanting help */
340  if (argc == 1) {
341  bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage);
342  return GED_HELP;
343  }
344 
345  if (argc < 3) {
346  bu_vls_printf(gedp->ged_result_str, "Usage: %s %s", argv[0], usage);
347  return GED_ERROR;
348  }
349 
350  bu_ptbl_init(&cur_path, 8, "f_tables: cur_path");
351 
352  status = GED_OK;
353 
354  /* find out which ascii table is desired */
355  if (BU_STR_EQUAL(argv[0], "solids")) {
356  /* complete summary - down to solids/parameters */
357  flag = SOL_TABLE;
358  } else if (BU_STR_EQUAL(argv[0], "regions")) {
359  /* summary down to solids as members of regions */
360  flag = REG_TABLE;
361  } else if (BU_STR_EQUAL(argv[0], "idents")) {
362  /* summary down to regions */
363  flag = ID_TABLE;
364  } else {
365  /* should never reach here */
366  bu_vls_printf(gedp->ged_result_str, "%s: input error\n", argv[0]);
367  status = GED_ERROR;
368  goto end;
369  }
370 
371  /* open the file */
372  if ((tabptr=fopen(argv[1], "w+")) == NULL) {
373  bu_vls_printf(gedp->ged_result_str, "%s: Can't open %s\n", argv[0], argv[1]);
374  status = GED_ERROR;
375  goto end;
376  }
377 
378  if (flag == SOL_TABLE || flag == REG_TABLE) {
379  /* temp file for discrimination of solids */
380  /* !!! this needs to be a bu_temp_file() */
381  if ((idfd = creat("/tmp/mged_discr", 0600)) < 0) {
382  perror("/tmp/mged_discr");
383  status = GED_ERROR;
384  goto end;
385  }
386  rd_idfd = open("/tmp/mged_discr", 2);
387  }
388 
389  (void)time(&now);
390  timep = ctime(&now);
391  timep[24] = '\0';
392  fprintf(tabptr, "1 -8 Summary Table {%s} (written: %s)\n", argv[0], timep);
393  fprintf(tabptr, "2 -7 file name : %s\n", gedp->ged_wdbp->dbip->dbi_filename);
394  fprintf(tabptr, "3 -6 \n");
395  fprintf(tabptr, "4 -5 \n");
396 #ifndef _WIN32
397  fprintf(tabptr, "5 -4 user : %s\n", getpwuid(getuid())->pw_gecos);
398 #else
399  {
400  char uname[256];
401  DWORD dwNumBytes = 256;
402  if (GetUserName(uname, &dwNumBytes))
403  fprintf(tabptr, "5 -4 user : %s\n", uname);
404  else
405  fprintf(tabptr, "5 -4 user : UNKNOWN\n");
406  }
407 #endif
408  fprintf(tabptr, "6 -3 target title : %s\n", gedp->ged_wdbp->dbip->dbi_title);
409  fprintf(tabptr, "7 -2 target units : %s\n",
411  fprintf(tabptr, "8 -1 objects :");
412  for (i = 2; i < argc; i++) {
413  if ((i%8) == 0)
414  fprintf(tabptr, "\n ");
415  fprintf(tabptr, " %s", argv[i]);
416  }
417  fprintf(tabptr, "\n\n");
418 
419  /* make the tables */
420  for (i = 2; i < argc; i++) {
421  struct directory *dp;
422 
423  bu_ptbl_reset(&cur_path);
424  if ((dp = db_lookup(gedp->ged_wdbp->dbip, argv[i], LOOKUP_NOISY)) != RT_DIR_NULL)
425  tables_new(gedp, dp, &cur_path, (const fastf_t *)bn_mat_identity, flag, &numreg, &numsol);
426  else
427  bu_vls_printf(gedp->ged_result_str, "%s: skip this object\n", argv[i]);
428  }
429 
430  bu_vls_printf(gedp->ged_result_str, "Summary written in: %s\n", argv[1]);
431 
432  if (flag == SOL_TABLE || flag == REG_TABLE) {
433  struct bu_vls str = BU_VLS_INIT_ZERO;
434 
435  /* FIXME: should not assume /tmp */
436  bu_file_delete("/tmp/mged_discr\0");
437 
438  bu_vls_printf(&str, "\n\nNumber Primitives = %zu Number Regions = %zu\n",
439  numsol, numreg);
440  bu_vls_fwrite(tabptr, &str);
441  bu_vls_free(&str);
442 
443  bu_vls_printf(gedp->ged_result_str, "Processed %lu Primitives and %lu Regions\n",
444  numsol, numreg);
445 
446  (void)fclose(tabptr);
447  } else {
448  int ret;
449 
450  fprintf(tabptr, "* 9999999\n* 9999999\n* 9999999\n* 9999999\n* 9999999\n");
451  (void)fclose(tabptr);
452 
453  bu_vls_printf(gedp->ged_result_str, "Processed %lu Regions\n", numreg);
454 
455  /* make ordered idents - tries newer gnu 'sort' syntax if not successful */
456  bu_vls_strcpy(&cmd, sortcmd_orig);
457  bu_vls_strcat(&cmd, argv[1]);
458  bu_vls_strcat(&cmd, " 2> /dev/null");
459  if (system(bu_vls_addr(&cmd)) != 0) {
460  bu_vls_trunc(&cmd, 0);
461  bu_vls_strcpy(&cmd, sortcmd_long);
462  bu_vls_strcat(&cmd, argv[1]);
463  ret = system(bu_vls_addr(&cmd));
464  if (ret != 0)
465  bu_log("WARNING: sort failure detected\n");
466  }
467  bu_vls_printf(gedp->ged_result_str, "%s\n", bu_vls_addr(&cmd));
468 
469  bu_vls_trunc(&cmd, 0);
470  bu_vls_strcpy(&cmd, catcmd);
471  bu_vls_strcat(&cmd, argv[1]);
472  bu_vls_printf(gedp->ged_result_str, "%s\n", bu_vls_addr(&cmd));
473  ret = system(bu_vls_addr(&cmd));
474  if (ret != 0)
475  bu_log("WARNING: cat failure detected\n");
476 
477  bu_file_delete("/tmp/ord_id\0");
478  }
479 
480 end:
481  bu_vls_free(&cmd);
482  bu_vls_free(&tmp_vls);
483  bu_ptbl_free(&cur_path);
484 
485  return status;
486 }
487 
488 
489 /*
490  * Local Variables:
491  * tab-width: 8
492  * mode: C
493  * indent-tabs-mode: t
494  * c-file-style: "stroustrup"
495  * End:
496  * ex: shiftwidth=4 tabstop=8
497  */
ptrdiff_t ssize_t
Definition: common.h:119
void usage(struct ged *gedp)
Definition: coil.c:315
#define GED_OK
Definition: ged.h:55
char * d_namep
pointer to name string
Definition: raytrace.h:859
void bu_log(const char *,...) _BU_ATTR_PRINTF12
Definition: log.c:176
int rt_db_get_internal(struct rt_db_internal *ip, const struct directory *dp, const struct db_i *dbip, const mat_t mat, struct resource *resp)
Definition: dir.c:76
mat_t i_mat
Definition: tables.c:46
size_t db_tree_nleaves(const union tree *tp)
Definition: db_comb.c:99
Definition: ged.h:338
void(* ft_ifree)(struct rt_db_internal *)
Definition: raytrace.h:2159
const mat_t bn_mat_identity
Matrix and vector functionality.
Definition: mat.c:46
struct db_i * dbip
Definition: raytrace.h:1266
Definition: clone.c:90
void bu_ptbl_init(struct bu_ptbl *b, size_t len, const char *str)
Definition: ptbl.c:32
void bu_vls_strcat(struct bu_vls *vp, const char *s)
Definition: vls.c:368
HIDDEN size_t tables_sol_number(const matp_t matrix, char *name, size_t *old, size_t *numsol)
Definition: tables.c:75
void bu_vls_trunc(struct bu_vls *vp, int len)
Definition: vls.c:198
#define GED_CHECK_ARGC_GT_0(_gedp, _argc, _flags)
Definition: ged.h:202
struct directory * db_lookup(const struct db_i *, const char *name, int noisy)
Definition: db_lookup.c:153
#define RT_CK_COMB(_p)
Definition: raytrace.h:955
union tree * tl_tree
Definition: raytrace.h:1247
struct rt_wdb * ged_wdbp
Definition: ged.h:340
Header file for the BRL-CAD common definitions.
#define BU_CK_PTBL(_p)
Definition: ptbl.h:74
long time(time_t *)
#define RT_DIR_REGION
region
Definition: raytrace.h:885
int bu_ptbl_ins(struct bu_ptbl *b, long *p)
void bu_ptbl_reset(struct bu_ptbl *b)
Definition: ptbl.c:49
#define GED_ERROR
Definition: ged.h:61
#define HIDDEN
Definition: common.h:86
HIDDEN void tables_new(struct ged *gedp, struct directory *dp, struct bu_ptbl *cur_path, const fastf_t *old_mat, int flag, size_t *numreg, size_t *numsol)
Definition: tables.c:115
Definition: ptbl.h:62
struct rt_tree_array * db_flatten_tree(struct rt_tree_array *rt_tree_array, union tree *tp, int op, int avail, struct resource *resp)
Definition: db_comb.c:138
void bu_vls_free(struct bu_vls *vp)
Definition: vls.c:248
#define OP_SUBTRACT
Binary: L subtract R.
Definition: raytrace.h:1129
void db_non_union_push(union tree *tp, struct resource *resp)
Definition: db_tree.c:1426
void * memset(void *s, int c, size_t n)
#define OP_INTERSECT
Binary: L intersect R.
Definition: raytrace.h:1128
struct resource rt_uniresource
default. Defined in librt/globals.c
Definition: globals.c:41
Definition: tables.c:43
#define GED_CHECK_DATABASE_OPEN(_gedp, _flags)
Definition: ged.h:114
char * dbi_title
title from IDENT rec
Definition: raytrace.h:809
void * bu_calloc(size_t nelem, size_t elsize, const char *str)
Definition: malloc.c:321
#define RT_CK_DIR(_dp)
Definition: raytrace.h:876
#define RT_DIR_SOLID
this name is a solid
Definition: raytrace.h:883
#define BU_PTBL_GET(ptbl, i)
Definition: ptbl.h:108
#define LOOKUP_QUIET
Definition: raytrace.h:893
const struct rt_functab * idb_meth
for ft_ifree(), etc.
Definition: raytrace.h:194
#define bu_strlcpy(dst, src, size)
Definition: str.h:60
#define ID_TABLE
Definition: tables.c:55
void bu_vls_fwrite(FILE *fp, const struct bu_vls *vp)
Definition: vls.c:544
void bu_ptbl_trunc(struct bu_ptbl *tbl, int end)
Definition: ptbl.c:267
char * tl_name
Name of this leaf (bu_strdup'ed)
Definition: raytrace.h:1174
#define SOL_TABLE
Definition: tables.c:53
goto out
Definition: nmg_mod.c:3846
void bn_mat_mul(mat_t o, const mat_t a, const mat_t b)
char * bu_vls_addr(const struct bu_vls *vp)
Definition: vls.c:111
HIDDEN int tables_check(char *a, char *b)
Definition: tables.c:63
struct bu_vls * ged_result_str
Definition: ged.h:357
double dbi_base2local
unit conversion factors
Definition: raytrace.h:808
#define BU_PTBL_LEN(ptbl)
Definition: ptbl.h:107
void bu_ptbl_free(struct bu_ptbl *b)
Definition: ptbl.c:226
struct tree::tree_db_leaf tr_l
void * idb_ptr
Definition: raytrace.h:195
const char * bu_units_string(const double mm)
#define RT_DIR_COMB
combination
Definition: raytrace.h:884
const struct rt_functab OBJ[]
Definition: table.c:159
Definition: op.h:35
#define BU_PTBL_END(ptbl)
Definition: ptbl.h:106
union tree * tree
Leading to tree_db_leaf leaves.
Definition: raytrace.h:938
void bu_vls_printf(struct bu_vls *vls, const char *fmt,...) _BU_ATTR_PRINTF23
Definition: vls.c:694
#define RT_DIR_NULL
Definition: raytrace.h:875
#define LOOKUP_NOISY
Definition: raytrace.h:892
int(* ft_describe)(struct bu_vls *, const struct rt_db_internal *, int, double, struct resource *, struct db_i *)
Definition: raytrace.h:2162
#define GED_HELP
Definition: ged.h:62
#define BU_ASSERT_SIZE_T(_lhs, _relation, _rhs)
Definition: defines.h:253
void bu_vls_strcpy(struct bu_vls *vp, const char *s)
Definition: vls.c:310
char i_name[NAMESIZE+1]
Definition: tables.c:45
void bu_free(void *ptr, const char *str)
Definition: malloc.c:328
double dbi_local2base
local2mm
Definition: raytrace.h:807
off_t end
Definition: ptbl.h:64
size_t i_index
Definition: tables.c:44
#define BU_VLS_INIT_ZERO
Definition: vls.h:84
#define REG_TABLE
Definition: tables.c:54
int d_flags
flags
Definition: raytrace.h:869
Definition: vls.h:56
char * dbi_filename
file name
Definition: raytrace.h:805
double fastf_t
Definition: defines.h:300
#define OP_UNION
Binary: L union R.
Definition: raytrace.h:1127
int db_ck_v4gift_tree(const union tree *tp)
Definition: db_comb.c:927
void rt_db_free_internal(struct rt_db_internal *ip)
Definition: dir.c:216
int ged_tables(struct ged *gedp, int argc, const char *argv[])
Definition: tables.c:315
int bu_file_delete(const char *path)
Definition: file.c:278
#define BU_STR_EQUAL(s1, s2)
Definition: str.h:126