BRL-CAD
db_fullpath.c
Go to the documentation of this file.
1 /* D B _ F U L L P A T H . C
2  * BRL-CAD
3  *
4  * Copyright (c) 1990-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 /** @addtogroup dbio */
21 /** @{ */
22 /** @file librt/db_fullpath.c
23  *
24  * Routines to manipulate "db_full_path" structures
25  *
26  */
27 
28 #include "common.h"
29 
30 #include <limits.h>
31 #include <math.h>
32 #include <string.h>
33 #include "bio.h"
34 
35 #include "vmath.h"
36 #include "raytrace.h"
37 
38 
39 void
41 {
42  if (!pathp)
43  return;
44 
45  pathp->fp_len = 0;
46  pathp->fp_maxlen = 0;
47  pathp->fp_names = (struct directory **)NULL;
48  pathp->fp_bool = (int *)NULL;
49  pathp->magic = DB_FULL_PATH_MAGIC;
50 }
51 
52 
53 void
55 {
56  RT_CK_FULL_PATH(pp);
57 
58  if (!dp)
59  return;
60 
61  RT_CK_DIR(dp);
62 
63  if (pp->fp_maxlen <= 0) {
64  pp->fp_maxlen = 32;
65  pp->fp_names = (struct directory **)bu_malloc(
66  pp->fp_maxlen * sizeof(struct directory *),
67  "db_full_path array");
68  pp->fp_bool = (int *)bu_calloc(
69  pp->fp_maxlen, sizeof(int),
70  "db_full_path bool array");
71  } else if (pp->fp_len >= pp->fp_maxlen) {
72  pp->fp_maxlen *= 4;
73  pp->fp_names = (struct directory **)bu_realloc(
74  (char *)pp->fp_names,
75  pp->fp_maxlen * sizeof(struct directory *),
76  "enlarged db_full_path array");
77  pp->fp_bool = (int *)bu_realloc(
78  (char *)pp->fp_bool,
79  pp->fp_maxlen * sizeof(int),
80  "enlarged db_full_path bool array");
81  }
82  pp->fp_names[pp->fp_len++] = dp;
83 }
84 
85 
86 void
87 db_dup_full_path(struct db_full_path *newp, const struct db_full_path *oldp)
88 {
89  RT_CK_FULL_PATH(newp);
90  RT_CK_FULL_PATH(oldp);
91 
92  newp->fp_maxlen = oldp->fp_maxlen;
93  newp->fp_len = oldp->fp_len;
94  if (oldp->fp_len <= 0) {
95  newp->fp_names = (struct directory **)0;
96  newp->fp_bool = (int *)0;
97  return;
98  }
99  newp->fp_names = (struct directory **)bu_malloc(
100  newp->fp_maxlen * sizeof(struct directory *),
101  "db_full_path array (duplicate)");
102  memcpy((char *)newp->fp_names, (char *)oldp->fp_names, newp->fp_len * sizeof(struct directory *));
103  newp->fp_bool = (int *)bu_malloc(
104  newp->fp_maxlen * sizeof(int),
105  "db_full_path bool array (duplicate)");
106  memcpy((char *)newp->fp_bool, (char *)oldp->fp_bool, newp->fp_len * sizeof(int));
107 }
108 
109 
110 void
111 db_extend_full_path(struct db_full_path *pathp, size_t incr)
112 {
113  size_t newlen;
114 
115  RT_CK_FULL_PATH(pathp);
116 
117  if (pathp->fp_maxlen <= 0) {
118  pathp->fp_len = 0;
119  pathp->fp_maxlen = incr;
120  pathp->fp_names = (struct directory **)bu_malloc(
121  pathp->fp_maxlen * sizeof(struct directory *),
122  "empty fp_names extension");
123  pathp->fp_bool = (int *)bu_malloc(
124  pathp->fp_maxlen * sizeof(int),
125  "empty fp_bool bool extension");
126  return;
127  }
128 
129  newlen = pathp->fp_len + incr;
130  if (pathp->fp_maxlen < newlen) {
131  pathp->fp_maxlen = newlen+1;
132  pathp->fp_names = (struct directory **)bu_realloc(
133  (char *)pathp->fp_names,
134  pathp->fp_maxlen * sizeof(struct directory *),
135  "fp_names extension");
136  pathp->fp_bool = (int *)bu_realloc(
137  (char *)pathp->fp_bool,
138  pathp->fp_maxlen * sizeof(int),
139  "fp_names bool extension");
140  }
141 }
142 
143 
144 void
145 db_append_full_path(struct db_full_path *dest, const struct db_full_path *src)
146 {
147  if (!src)
148  return;
149 
150  RT_CK_FULL_PATH(dest);
151  RT_CK_FULL_PATH(src);
152 
153  db_extend_full_path(dest, src->fp_len);
154  memcpy((char *)&dest->fp_names[dest->fp_len],
155  (char *)&src->fp_names[0],
156  src->fp_len * sizeof(struct directory *));
157  memcpy((char *)&dest->fp_bool[dest->fp_len],
158  (char *)&src->fp_bool[0],
159  src->fp_len * sizeof(int));
160  dest->fp_len += src->fp_len;
161 }
162 
163 
164 void
165 db_dup_path_tail(struct db_full_path *newp, const struct db_full_path *oldp, off_t start)
166 {
167  RT_CK_FULL_PATH(newp);
168  RT_CK_FULL_PATH(oldp);
169 
170  if (start < 0 || (size_t)start > oldp->fp_len-1)
171  bu_bomb("db_dup_path_tail: start offset out of range\n");
172 
173  newp->fp_maxlen = newp->fp_len = oldp->fp_len - start;
174  if (newp->fp_len <= 0) {
175  newp->fp_names = (struct directory **)0;
176  newp->fp_bool = (int *)0;
177  return;
178  }
179  newp->fp_names = (struct directory **)bu_malloc(
180  newp->fp_maxlen * sizeof(struct directory *),
181  "db_full_path array (duplicate)");
182  memcpy((char *)newp->fp_names, (char *)&oldp->fp_names[start], newp->fp_len * sizeof(struct directory *));
183  newp->fp_bool = (int *)bu_malloc(
184  newp->fp_maxlen * sizeof(int),
185  "db_full_path bool array (duplicate)");
186  memcpy((char *)newp->fp_bool, (char *)&oldp->fp_bool[start], newp->fp_len * sizeof(int));
187 }
188 
189 
190 char *
192 {
193  char *cp;
194  char *buf;
195  size_t len;
196  size_t rem;
197  size_t i;
198  long j;
199 
200  RT_CK_FULL_PATH(pp);
201  BU_ASSERT_SIZE_T(pp->fp_len, <, LONG_MAX);
202 
203  len = 3; /* leading slash, trailing null, spare */
204  for (j=pp->fp_len-1; j >= 0; j--) {
205  if (pp->fp_names[j])
206  len += strlen(pp->fp_names[j]->d_namep) + 1;
207  else
208  len += 16;
209  }
210 
211  buf = (char *)bu_malloc(len, "pathname string");
212  cp = buf;
213  rem = len;
214 
215  for (i = 0; i < pp->fp_len; i++) {
216  *cp++ = '/';
217  rem--;
218  if (pp->fp_names[i]) {
219  bu_strlcpy(cp, pp->fp_names[i]->d_namep, rem);
220  rem -= strlen(pp->fp_names[i]->d_namep);
221  } else {
222  bu_strlcpy(cp, "**NULL**", rem);
223  rem -= 8;
224  }
225  cp += strlen(cp);
226  }
227  *cp++ = '\0';
228  return buf;
229 }
230 
231 
232 void
233 db_path_to_vls(struct bu_vls *str, const struct db_full_path *pp)
234 {
235  size_t i;
236 
237  if (!pp)
238  return;
239 
240  BU_CK_VLS(str);
241  RT_CK_FULL_PATH(pp);
242 
243  for (i = 0; i < pp->fp_len; i++) {
244  bu_vls_putc(str, '/');
245  if (pp->fp_names[i])
246  bu_vls_strcat(str, pp->fp_names[i]->d_namep);
247  else
248  bu_vls_strcat(str, "**NULL**");
249  }
250 }
251 
252 
253 void
254 db_fullpath_to_vls(struct bu_vls *vls, const struct db_full_path *full_path, const struct db_i *dbip, int fp_flags)
255 {
256  size_t i;
257  int type;
258  const struct bn_tol tol = {BN_TOL_MAGIC, BN_TOL_DIST, BN_TOL_DIST * BN_TOL_DIST, 1e-6, 1.0 - 1e-6 };
259 
260  if (!full_path)
261  return;
262 
263  BU_CK_VLS(vls);
264  RT_CK_FULL_PATH(full_path);
265 
266  if (!full_path->fp_names[0]) {
267  bu_vls_strcat(vls, "**NULL**");
268  return;
269  }
270 
271  if ((fp_flags & DB_FP_PRINT_TYPE) && !dbip) {
272  bu_log("Warning - requested object type printing, but dbip is NULL - object types will not be printed!");
273  }
274 
275  for (i = 0; i < full_path->fp_len; i++) {
276  bu_vls_putc(vls, '/');
277  if (fp_flags & DB_FP_PRINT_BOOL) {
278  switch (full_path->fp_bool[i]) {
279  case 2:
280  bu_vls_strcat(vls, "u ");
281  break;
282  case 3:
283  bu_vls_strcat(vls, "+ ");
284  break;
285  case 4:
286  bu_vls_strcat(vls, "- ");
287  break;
288  }
289  }
290  bu_vls_strcat(vls, full_path->fp_names[i]->d_namep);
291  if ((fp_flags & DB_FP_PRINT_TYPE) && dbip) {
292  struct rt_db_internal intern;
293  if (!(rt_db_get_internal(&intern, full_path->fp_names[i], dbip, NULL, &rt_uniresource) < 0)) {
294  if (intern.idb_meth->ft_label) {
295  bu_vls_putc(vls, '(');
296  switch (intern.idb_minor_type) {
297  case DB5_MINORTYPE_BRLCAD_ARB8:
298  type = rt_arb_std_type(&intern, &tol);
299  switch (type) {
300  case 4:
301  bu_vls_strcat(vls, "arb4");
302  break;
303  case 5:
304  bu_vls_strcat(vls, "arb5");
305  break;
306  case 6:
307  bu_vls_strcat(vls, "arb6");
308  break;
309  case 7:
310  bu_vls_strcat(vls, "arb7");
311  break;
312  case 8:
313  bu_vls_strcat(vls, "arb8");
314  break;
315  default:
316  break;
317  }
318  break;
319  case DB5_MINORTYPE_BRLCAD_COMBINATION:
320  if (full_path->fp_names[i]->d_flags & RT_DIR_REGION) {
321  bu_vls_putc(vls, 'r');
322  } else {
323  bu_vls_putc(vls, 'c');
324  }
325  break;
326  default:
327  bu_vls_strcat(vls, intern.idb_meth->ft_label);
328  break;
329  }
330 
331  }
332  bu_vls_putc(vls, ')');
333  rt_db_free_internal(&intern);
334  }
335  }
336 
337  }
338 }
339 
340 
341 void
342 db_pr_full_path(const char *msg, const struct db_full_path *pathp)
343 {
344  char *sofar;
345 
346  if (!msg)
347  msg = "FULL PATH: ";
348 
349  if (pathp) {
350  sofar = db_path_to_string(pathp);
351  bu_log("%s%s\n", msg, sofar);
352  bu_free(sofar, "path string");
353  } else {
354  bu_log("%s**NULL**\n", msg);
355  }
356 
357 }
358 
359 
360 int
361 db_string_to_path(struct db_full_path *pp, const struct db_i *dbip, const char *str)
362 {
363  char *cp;
364  char *slashp;
365  struct directory *dp;
366  char *copy;
367  size_t nslash = 0;
368  int ret = 0;
369  size_t len;
370 
371  /* assume NULL str is '/' */
372  if (!str) {
373  db_full_path_init(pp);
374  return 0;
375  }
376 
377  while (*str == '/') str++; /* strip off leading slashes */
378  if (*str == '\0') {
379  /* Path of a lone slash */
380  db_full_path_init(pp);
381  return 0;
382  }
383 
384  copy = bu_strdup(str);
385 
386  /* eliminate all trailing slashes */
387  len = strlen(copy);
388  while (copy[len - 1] == '/') {
389  copy[len - 1] = '\0';
390  --len;
391  }
392 
393  cp = copy;
394  while (*cp) {
395  if ((slashp = strchr(cp, '/')) == NULL) break;
396  nslash++;
397  cp = slashp+1;
398  }
399 
400  /* Make a path structure just big enough */
402  pp->fp_maxlen = pp->fp_len = nslash+1;
403  pp->fp_names = (struct directory **)bu_malloc(
404  pp->fp_maxlen * sizeof(struct directory *),
405  "db_string_to_path path array");
406  pp->fp_bool = (int *)bu_calloc(
407  pp->fp_maxlen, sizeof(int),
408  "db_string_to_path bool array");
409 
410  RT_CK_DBI(dbip);
411 
412  /* Build up path array */
413  cp = copy;
414  nslash = 0;
415  while (*cp) {
416  if ((slashp = strchr(cp, '/')) == NULL) {
417  /* Last element of string, has no trailing slash */
418  slashp = cp + strlen(cp) - 1;
419  } else {
420  *slashp = '\0';
421  }
422  if ((dp = db_lookup(dbip, cp, LOOKUP_NOISY)) == RT_DIR_NULL) {
423  bu_log("db_string_to_path() of '%s' failed on '%s'\n",
424  str, cp);
425  ret = -1; /* FAILED */
426  /* Fall through, storing null dp in this location */
427  }
428  pp->fp_names[nslash++] = dp;
429  cp = slashp+1;
430  }
431  BU_ASSERT_SIZE_T(nslash, ==, pp->fp_len);
432  bu_free(copy, "db_string_to_path() duplicate string");
433  return ret;
434 }
435 
436 
437 int
438 db_argv_to_path(struct db_full_path *pp, struct db_i *dbip, int argc, const char *const *argv)
439 {
440  struct directory *dp;
441  int ret = 0;
442  int i;
443 
444  if (!pp)
445  return -1;
446 
447  /* Make a path structure just big enough */
449  pp->fp_maxlen = pp->fp_len = argc;
450  pp->fp_names = (struct directory **)bu_malloc(
451  pp->fp_maxlen * sizeof(struct directory *),
452  "db_argv_to_path path array");
453  pp->fp_bool = (int *)bu_calloc(
454  pp->fp_maxlen, sizeof(int),
455  "db_argv_to_path bool array");
456 
457  RT_CK_DBI(dbip);
458 
459  for (i = 0; i<argc; i++) {
460  if ((dp = db_lookup(dbip, argv[i], LOOKUP_NOISY)) == RT_DIR_NULL) {
461  bu_log("db_argv_to_path() failed on element %d='%s'\n",
462  i, argv[i]);
463  ret = -1; /* FAILED */
464  /* Fall through, storing null dp in this location */
465  }
466  pp->fp_names[i] = dp;
467  }
468  return ret;
469 }
470 
471 
472 void
474 {
475  if (!pp)
476  return;
477 
478  RT_CK_FULL_PATH(pp);
479 
480  if (pp->fp_maxlen > 0) {
481  if (pp->fp_names)
482  bu_free((char *)pp->fp_names, "db_full_path array");
483  if (pp->fp_bool)
484  bu_free((char *)pp->fp_bool, "db_full_path bool array");
485  pp->fp_maxlen = pp->fp_len = 0;
486  pp->fp_names = (struct directory **)0;
487  }
488 }
489 
490 
491 int
492 db_identical_full_paths(const struct db_full_path *a, const struct db_full_path *b)
493 {
494  long i;
495 
496  if (!a && !b)
497  return 1;
498  else if (!a || !b)
499  return 0;
500 
501  RT_CK_FULL_PATH(a);
502  RT_CK_FULL_PATH(b);
503  BU_ASSERT_SIZE_T(a->fp_len, <, LONG_MAX);
504 
505  if (a->fp_len != b->fp_len) return 0;
506 
507  for (i = a->fp_len-1; i >= 0; i--) {
508  if (a->fp_names[i] != b->fp_names[i]) return 0;
509  }
510  return 1;
511 }
512 
513 
514 int
516  const struct db_full_path *a,
517  const struct db_full_path *b,
518  const int skip_first)
519 {
520  size_t i = 0;
521 
522  RT_CK_FULL_PATH(a);
523  RT_CK_FULL_PATH(b);
524 
525  if (b->fp_len > a->fp_len)
526  return 0;
527 
528  if (skip_first)
529  i = 1;
530  else
531  i = 0;
532 
533  for (; i < a->fp_len; i++) {
534  size_t j;
535 
536  if (a->fp_names[i] != b->fp_names[0])
537  continue;
538 
539  /* First element matches, check remaining length */
540  if (b->fp_len > a->fp_len - i)
541  return 0;
542 
543  /* Check remainder of 'b' */
544  for (j = 1; j < b->fp_len; j++) {
545  if (a->fp_names[i+j] != b->fp_names[j]) goto step;
546  }
547 
548  /* 'b' is a proper subset */
549  return 1;
550 
551  step:
552  ;
553  }
554  return 0;
555 }
556 
557 
558 int
560  const struct db_full_path *a,
561  const struct db_full_path *b)
562 {
563  size_t i;
564 
565  RT_CK_FULL_PATH(a);
566  RT_CK_FULL_PATH(b);
567 
568  if (a->fp_len > b->fp_len) return 0;
569 
570  for (i = 0; i < a->fp_len; i++) {
571  if (a->fp_names[i] != b->fp_names[i]) return 0;
572  }
573 
574  return 1;
575 }
576 
577 
578 int
579 db_full_path_search(const struct db_full_path *a, const struct directory *dp)
580 {
581  long i;
582 
583  if (!dp)
584  return 0;
585 
586  RT_CK_FULL_PATH(a);
587  RT_CK_DIR(dp);
588  BU_ASSERT_SIZE_T(a->fp_len, <, LONG_MAX);
589 
590  for (i = a->fp_len-1; i >= 0; i--) {
591  if (a->fp_names[i] == dp) return 1;
592  }
593  return 0;
594 }
595 
596 
597 int
598 cyclic_path(const struct db_full_path *fp, const char *name)
599 {
600  /* skip the last one added since it is currently being tested. */
601  long int depth;
602  const char *test_name;
603 
604  if (!name || !fp)
605  return 0;
606 
607  RT_CK_FULL_PATH(fp);
608 
609  depth = fp->fp_len - 1;
610 
611  if (name && !name[0] == '\0') {
612  test_name = name;
613  } else {
614  test_name = DB_FULL_PATH_CUR_DIR(fp)->d_namep;
615  }
616 
617  /* check the path to see if it is groundhog day */
618  while (--depth >= 0) {
619  if (BU_STR_EQUAL(test_name, fp->fp_names[depth]->d_namep)) {
620  return 1;
621  }
622  }
623 
624  /* not cyclic */
625  return 0;
626 }
627 
628 
629 int
631  struct db_i *dbip,
632  struct db_full_path *pathp,
633  mat_t mat, /* result */
634  int depth, /* number of arcs */
635  struct resource *resp)
636 {
637  int ret = 0;
638  struct db_tree_state ts = RT_DBTS_INIT_IDN;
639  struct db_full_path null_path;
640 
641  RT_CHECK_DBI(dbip);
642  RT_CK_FULL_PATH(pathp);
643  if (!mat) bu_bomb("db_path_to_mat() NULL matrix pointer\n");
644 
645  db_full_path_init(&null_path);
646  db_init_db_tree_state(&ts, dbip, resp);
647 
648  ret = db_follow_path(&ts, &null_path, pathp, LOOKUP_NOISY, depth);
649  db_free_full_path(&null_path);
650  MAT_COPY(mat, ts.ts_mat); /* implicit return */
652 
653  /* Return 0 if we failed, else return 1 */
654  return (ret < 0) ? 0 : 1;
655 }
656 
657 
658 /** @} */
659 /*
660  * Local Variables:
661  * mode: C
662  * tab-width: 8
663  * indent-tabs-mode: t
664  * c-file-style: "stroustrup"
665  * End:
666  * ex: shiftwidth=4 tabstop=8
667  */
int db_follow_path(struct db_tree_state *tsp, struct db_full_path *total_path, const struct db_full_path *new_path, int noisy, long pdepth)
Definition: db_tree.c:682
char * d_namep
pointer to name string
Definition: raytrace.h:859
Definition: raytrace.h:800
void db_add_node_to_full_path(struct db_full_path *pp, struct directory *dp)
Definition: db_fullpath.c:54
void bu_log(const char *,...) _BU_ATTR_PRINTF12
Definition: log.c:176
#define RT_CHECK_DBI(_p)
Definition: raytrace.h:828
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
void db_extend_full_path(struct db_full_path *pathp, size_t incr)
Definition: db_fullpath.c:111
int db_argv_to_path(struct db_full_path *pp, struct db_i *dbip, int argc, const char *const *argv)
Definition: db_fullpath.c:438
size_t fp_len
Definition: db_fullpath.h:44
int db_full_path_search(const struct db_full_path *a, const struct directory *dp)
Definition: db_fullpath.c:579
void db_dup_full_path(struct db_full_path *newp, const struct db_full_path *oldp)
Definition: db_fullpath.c:87
void db_dup_path_tail(struct db_full_path *newp, const struct db_full_path *oldp, off_t start)
Definition: db_fullpath.c:165
void db_fullpath_to_vls(struct bu_vls *vls, const struct db_full_path *full_path, const struct db_i *dbip, int fp_flags)
Definition: db_fullpath.c:254
Definition: clone.c:90
void bu_vls_strcat(struct bu_vls *vp, const char *s)
Definition: vls.c:368
struct directory * db_lookup(const struct db_i *, const char *name, int noisy)
Definition: db_lookup.c:153
void db_free_db_tree_state(struct db_tree_state *tsp)
Definition: db_tree.c:76
#define BN_TOL_MAGIC
Definition: magic.h:74
Header file for the BRL-CAD common definitions.
#define DB_FULL_PATH_CUR_DIR(_pp)
Definition: db_fullpath.h:51
#define RT_DIR_REGION
region
Definition: raytrace.h:885
void db_full_path_init(struct db_full_path *pathp)
Definition: db_fullpath.c:40
char ft_label[9]
Definition: raytrace.h:2044
void * bu_malloc(size_t siz, const char *str)
Definition: malloc.c:314
#define DB_FP_PRINT_BOOL
Definition: db_fullpath.h:107
int db_full_path_match_top(const struct db_full_path *a, const struct db_full_path *b)
Definition: db_fullpath.c:559
char * strchr(const char *sp, int c)
int db_full_path_subset(const struct db_full_path *a, const struct db_full_path *b, const int skip_first)
Definition: db_fullpath.c:515
int * fp_bool
array of boolean flags
Definition: db_fullpath.h:47
int db_identical_full_paths(const struct db_full_path *a, const struct db_full_path *b)
Definition: db_fullpath.c:492
#define BU_CK_VLS(_vp)
Definition: vls.h:69
struct resource rt_uniresource
default. Defined in librt/globals.c
Definition: globals.c:41
size_t fp_maxlen
Definition: db_fullpath.h:45
void db_init_db_tree_state(struct db_tree_state *tsp, struct db_i *dbip, struct resource *resp)
Definition: db_tree.c:93
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
int db_string_to_path(struct db_full_path *pp, const struct db_i *dbip, const char *str)
Definition: db_fullpath.c:361
const struct rt_functab * idb_meth
for ft_ifree(), etc.
Definition: raytrace.h:194
#define bu_strlcpy(dst, src, size)
Definition: str.h:60
void db_free_full_path(struct db_full_path *pp)
Definition: db_fullpath.c:473
#define DB_FP_PRINT_TYPE
Definition: db_fullpath.h:108
mat_t ts_mat
transform matrix
Definition: raytrace.h:1050
#define BN_TOL_DIST
Definition: tol.h:109
uint32_t magic
Definition: db_fullpath.h:43
void * bu_realloc(void *ptr, size_t siz, const char *str)
Support for uniform tolerances.
Definition: tol.h:71
struct directory ** fp_names
array of dir pointers
Definition: db_fullpath.h:46
char * db_path_to_string(const struct db_full_path *pp)
Definition: db_fullpath.c:191
void db_path_to_vls(struct bu_vls *str, const struct db_full_path *pp)
Definition: db_fullpath.c:233
#define RT_CK_DBI(_p)
Definition: raytrace.h:829
#define RT_CK_FULL_PATH(_p)
Definition: db_fullpath.h:59
#define DB_FULL_PATH_MAGIC
Definition: magic.h:203
#define RT_DIR_NULL
Definition: raytrace.h:875
#define LOOKUP_NOISY
Definition: raytrace.h:892
int cyclic_path(const struct db_full_path *fp, const char *name)
Definition: db_fullpath.c:598
void db_pr_full_path(const char *msg, const struct db_full_path *pathp)
Definition: db_fullpath.c:342
int idb_minor_type
ID_xxx.
Definition: raytrace.h:193
#define BU_ASSERT_SIZE_T(_lhs, _relation, _rhs)
Definition: defines.h:253
void bu_free(void *ptr, const char *str)
Definition: malloc.c:328
int rt_arb_std_type(const struct rt_db_internal *ip, const struct bn_tol *tol)
Definition: arb8.c:317
bn_poly_t rem[1]
int d_flags
flags
Definition: raytrace.h:869
Definition: vls.h:56
void bu_bomb(const char *str) _BU_ATTR_NORETURN
Definition: bomb.c:91
void db_append_full_path(struct db_full_path *dest, const struct db_full_path *src)
Definition: db_fullpath.c:145
#define RT_DBTS_INIT_IDN
Definition: raytrace.h:1078
void bu_vls_putc(struct bu_vls *vp, int c)
Definition: vls.c:666
void rt_db_free_internal(struct rt_db_internal *ip)
Definition: dir.c:216
int db_path_to_mat(struct db_i *dbip, struct db_full_path *pathp, mat_t mat, int depth, struct resource *resp)
Definition: db_fullpath.c:630
#define bu_strdup(s)
Definition: str.h:71
#define BU_STR_EQUAL(s1, s2)
Definition: str.h:126