BRL-CAD
search.c File Reference
#include "common.h"
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <time.h>
#include <regex.h>
#include <limits.h>
#include "bu/cmd.h"
#include "db.h"
#include "./librt_private.h"
#include "./search.h"
Include dependency graph for search.c:

Go to the source code of this file.

Data Structures

struct  list_client_data_t
 

Functions

HIDDEN void print_path_with_bools (struct db_full_path *full_path)
 
HIDDEN void db_fullpath_list_subtree (struct db_full_path *path, int curr_bool, union tree *tp, void(*traverse_func)(struct db_full_path *path, void *), void *client_data)
 
HIDDEN void db_fullpath_list (struct db_full_path *path, void *client_data)
 
HIDDEN struct db_plan_tpalloc (enum db_search_ntype t, int(*f)(struct db_plan_t *, struct db_node_t *, struct db_i *, struct bu_ptbl *))
 
HIDDEN int f_expr (struct db_plan_t *plan, struct db_node_t *db_node, struct db_i *dbip, struct bu_ptbl *results)
 
HIDDEN int c_openparen (char *ignore, char ***ignored, int unused, struct db_plan_t **resultplan, int *db_search_isoutput)
 
HIDDEN int c_closeparen (char *ignore, char ***ignored, int unused, struct db_plan_t **resultplan, int *db_search_isoutput)
 
HIDDEN int f_not (struct db_plan_t *plan, struct db_node_t *db_node, struct db_i *dbip, struct bu_ptbl *results)
 
HIDDEN int c_not (char *ignore, char ***ignored, int unused, struct db_plan_t **resultplan, int *db_search_isoutput)
 
HIDDEN int find_execute_nested_plans (struct db_i *dbip, struct bu_ptbl *results, struct db_node_t *db_node, struct db_plan_t *plan)
 
HIDDEN int f_below (struct db_plan_t *plan, struct db_node_t *db_node, struct db_i *dbip, struct bu_ptbl *results)
 
HIDDEN int c_below (char *ignore, char ***ignored, int unused, struct db_plan_t **resultplan, int *db_search_isoutput)
 
HIDDEN int f_above (struct db_plan_t *plan, struct db_node_t *db_node, struct db_i *dbip, struct bu_ptbl *results)
 
HIDDEN int c_above (char *ignore, char ***ignored, int unused, struct db_plan_t **resultplan, int *db_search_isoutput)
 
HIDDEN int f_or (struct db_plan_t *plan, struct db_node_t *db_node, struct db_i *dbip, struct bu_ptbl *results)
 
HIDDEN int c_or (char *ignore, char ***ignored, int unused, struct db_plan_t **resultplan, int *db_search_isoutput)
 
HIDDEN int f_name (struct db_plan_t *plan, struct db_node_t *db_node, struct db_i *dbip, struct bu_ptbl *results)
 
HIDDEN int c_name (char *pattern, char ***ignored, int unused, struct db_plan_t **resultplan, int *db_search_isoutput)
 
HIDDEN int f_iname (struct db_plan_t *plan, struct db_node_t *db_node, struct db_i *dbip, struct bu_ptbl *results)
 
HIDDEN int c_iname (char *pattern, char ***ignored, int unused, struct db_plan_t **resultplan, int *db_search_isoutput)
 
HIDDEN int f_regex (struct db_plan_t *plan, struct db_node_t *db_node, struct db_i *dbip, struct bu_ptbl *results)
 
HIDDEN int c_regex_common (enum db_search_ntype type, char *regexp, int icase, struct db_plan_t **resultplan)
 
HIDDEN int c_regex (char *pattern, char ***ignored, int unused, struct db_plan_t **resultplan, int *db_search_isoutput)
 
HIDDEN int c_iregex (char *pattern, char ***ignored, int unused, struct db_plan_t **resultplan, int *db_search_isoutput)
 
HIDDEN int string_to_name_and_val (const char *in, struct bu_vls *name, struct bu_vls *value)
 
HIDDEN int avs_check (const char *keystr, const char *value, int checkval, int strcomparison, struct bu_attribute_value_set *avs)
 
HIDDEN int f_objparam (struct db_plan_t *plan, struct db_node_t *db_node, struct db_i *dbip, struct bu_ptbl *results)
 
HIDDEN int c_objparam (char *pattern, char ***ignored, int unused, struct db_plan_t **resultplan, int *db_search_isoutput)
 
HIDDEN int f_attr (struct db_plan_t *plan, struct db_node_t *db_node, struct db_i *dbip, struct bu_ptbl *results)
 
HIDDEN int c_attr (char *pattern, char ***ignored, int unused, struct db_plan_t **resultplan, int *db_search_isoutput)
 
HIDDEN int f_stdattr (struct db_plan_t *plan, struct db_node_t *db_node, struct db_i *dbip, struct bu_ptbl *results)
 
HIDDEN int c_stdattr (char *pattern, char ***ignored, int unused, struct db_plan_t **resultplan, int *db_search_isoutput)
 
HIDDEN int f_type (struct db_plan_t *plan, struct db_node_t *db_node, struct db_i *dbip, struct bu_ptbl *results)
 
HIDDEN int c_type (char *pattern, char ***ignored, int unused, struct db_plan_t **resultplan, int *db_search_isoutput)
 
HIDDEN int f_bool (struct db_plan_t *plan, struct db_node_t *db_node, struct db_i *dbip, struct bu_ptbl *results)
 
HIDDEN int c_bool (char *pattern, char ***ignored, int unused, struct db_plan_t **resultplan, int *db_search_isoutput)
 
HIDDEN int f_maxdepth (struct db_plan_t *plan, struct db_node_t *db_node, struct db_i *dbip, struct bu_ptbl *results)
 
HIDDEN int c_maxdepth (char *pattern, char ***ignored, int unused, struct db_plan_t **resultplan, int *db_search_isoutput)
 
HIDDEN int f_mindepth (struct db_plan_t *plan, struct db_node_t *db_node, struct db_i *dbip, struct bu_ptbl *results)
 
HIDDEN int c_mindepth (char *pattern, char ***ignored, int unused, struct db_plan_t **resultplan, int *db_search_isoutput)
 
HIDDEN int f_depth (struct db_plan_t *plan, struct db_node_t *db_node, struct db_i *dbip, struct bu_ptbl *results)
 
HIDDEN int c_depth (char *pattern, char ***ignored, int unused, struct db_plan_t **resultplan, int *db_search_isoutput)
 
HIDDEN int f_nnodes (struct db_plan_t *plan, struct db_node_t *db_node, struct db_i *dbip, struct bu_ptbl *results)
 
HIDDEN int c_nnodes (char *pattern, char ***ignored, int unused, struct db_plan_t **resultplan, int *db_search_isoutput)
 
HIDDEN int f_path (struct db_plan_t *plan, struct db_node_t *db_node, struct db_i *dbip, struct bu_ptbl *results)
 
HIDDEN int c_path (char *pattern, char ***ignored, int unused, struct db_plan_t **resultplan, int *db_search_isoutput)
 
HIDDEN int f_print (struct db_plan_t *plan, struct db_node_t *db_node, struct db_i *dbip, struct bu_ptbl *results)
 
HIDDEN int c_print (char *ignore, char ***ignored, int unused, struct db_plan_t **resultplan, int *db_search_isoutput)
 
HIDDEN int typecompare (const void *a, const void *b)
 
HIDDEN OPTIONoption (char *name)
 
HIDDEN int find_create (char ***argvp, struct db_plan_t **resultplan, struct bu_ptbl *results, int *db_search_isoutput, int quiet)
 
HIDDEN struct db_plan_tyanknode (struct db_plan_t **planp)
 
HIDDEN int yankexpr (struct db_plan_t **planp, struct db_plan_t **resultplan)
 
HIDDEN int paren_squish (struct db_plan_t *plan, struct db_plan_t **resultplan)
 
HIDDEN int not_squish (struct db_plan_t *plan, struct db_plan_t **resultplan)
 
HIDDEN int above_squish (struct db_plan_t *plan, struct db_plan_t **resultplan)
 
HIDDEN int below_squish (struct db_plan_t *plan, struct db_plan_t **resultplan)
 
HIDDEN int or_squish (struct db_plan_t *plan, struct db_plan_t **resultplan)
 
HIDDEN struct db_plan_tdb_search_form_plan (char **argv, int quiet)
 
HIDDEN void find_execute_plans (struct db_i *dbip, struct bu_ptbl *results, struct db_node_t *db_node, struct db_plan_t *plan)
 
HIDDEN void db_search_free_plan (void **vplan)
 
int db_full_path_list_add (const char *path, int local, struct db_i *dbip, struct db_full_path_list *path_list)
 
void _db_free_full_path_list (struct db_full_path_list *path_list)
 
void db_free_full_path_list (struct db_full_path_list *path_list)
 
void db_search_freeplan (void **vplan)
 
void db_search_free (struct bu_ptbl *search_results)
 
struct db_full_path_list_db_search_full_paths (void *searchplan, struct db_full_path_list *pathnames, struct db_i *dbip)
 
struct db_full_path_listdb_search_full_paths (void *searchplan, struct db_full_path_list *pathnames, struct db_i *dbip)
 
struct bu_ptbldb_search_unique_objects (void *searchplan, struct db_full_path_list *pathnames, struct db_i *dbip)
 
void * db_search_formplan (char **argv, struct db_i *dbip)
 
int db_search (struct bu_ptbl *search_results, int search_flags, const char *plan_str, int input_path_cnt, struct directory **input_paths, struct db_i *dbip)
 Search for objects in a geometry database using filters. More...
 

Function Documentation

HIDDEN void print_path_with_bools ( struct db_full_path full_path)

Definition at line 140 of file search.c.

References BU_ALLOC, bu_log(), bu_vls_addr(), BU_VLS_INIT_ZERO, bu_vls_sprintf(), directory::d_namep, db_dup_full_path(), db_free_full_path(), DB_FULL_PATH_CUR_BOOL, DB_FULL_PATH_CUR_DIR, db_full_path_init(), DB_FULL_PATH_POP, and db_full_path::fp_len.

Here is the call graph for this function:

HIDDEN void db_fullpath_list_subtree ( struct db_full_path path,
int  curr_bool,
union tree tp,
void(*)(struct db_full_path *path, void *)  traverse_func,
void *  client_data 
)
HIDDEN void db_fullpath_list ( struct db_full_path path,
void *  client_data 
)

This walker builds a list of db_full_path entries corresponding to the contents of the tree under *path. It does so while assigning the boolean operation associated with each path entry to the db_full_path structure. This list is then used for further processing and filtering by the search routines.

Definition at line 238 of file search.c.

References directory::d_flags, DB_FULL_PATH_CUR_DIR, db_fullpath_list_subtree(), list_client_data_t::dbip, rt_db_internal::idb_ptr, OP_UNION, RT_CK_DBI, RT_CK_FULL_PATH, rt_db_free_internal(), rt_db_get_internal(), RT_DIR_COMB, rt_uniresource, and rt_comb_internal::tree.

Referenced by _db_search_full_paths(), and db_search().

Here is the call graph for this function:

HIDDEN int f_expr ( struct db_plan_t plan,
struct db_node_t db_node,
struct db_i dbip,
struct bu_ptbl results 
)

Definition at line 279 of file search.c.

References db_plan_t::eval, db_node_t::matched_filters, and db_plan_t::next.

Referenced by yankexpr().

HIDDEN int c_openparen ( char *  ignore,
char ***  ignored,
int  unused,
struct db_plan_t **  resultplan,
int *  db_search_isoutput 
)

Definition at line 298 of file search.c.

References BRLCAD_OK, N_OPENPAREN, and palloc().

Referenced by db_search_form_plan().

Here is the call graph for this function:

HIDDEN int c_closeparen ( char *  ignore,
char ***  ignored,
int  unused,
struct db_plan_t **  resultplan,
int *  db_search_isoutput 
)

Definition at line 306 of file search.c.

References BRLCAD_OK, N_CLOSEPAREN, and palloc().

Referenced by db_search_form_plan().

Here is the call graph for this function:

HIDDEN int f_not ( struct db_plan_t plan,
struct db_node_t db_node,
struct db_i dbip,
struct bu_ptbl results 
)

Definition at line 319 of file search.c.

References db_plan_t::eval, db_node_t::matched_filters, and db_plan_t::next.

Referenced by c_not().

HIDDEN int c_not ( char *  ignore,
char ***  ignored,
int  unused,
struct db_plan_t **  resultplan,
int *  db_search_isoutput 
)

Definition at line 333 of file search.c.

References BRLCAD_OK, f_not(), N_NOT, and palloc().

Here is the call graph for this function:

HIDDEN int find_execute_nested_plans ( struct db_i dbip,
struct bu_ptbl results,
struct db_node_t db_node,
struct db_plan_t plan 
)

Definition at line 341 of file search.c.

References db_plan_t::eval, and db_plan_t::next.

Referenced by f_above(), and f_below().

HIDDEN int f_below ( struct db_plan_t plan,
struct db_node_t db_node,
struct db_i dbip,
struct bu_ptbl results 
)

Definition at line 358 of file search.c.

References db_dup_full_path(), db_free_full_path(), db_full_path_init(), DB_FULL_PATH_POP, DB_SEARCH_FLAT, find_execute_nested_plans(), db_node_t::flags, db_full_path::fp_len, db_node_t::matched_filters, db_plan_t::min_depth, and db_node_t::path.

Referenced by c_below().

Here is the call graph for this function:

HIDDEN int c_below ( char *  ignore,
char ***  ignored,
int  unused,
struct db_plan_t **  resultplan,
int *  db_search_isoutput 
)

Definition at line 387 of file search.c.

References BRLCAD_OK, f_below(), N_BELOW, and palloc().

Here is the call graph for this function:

HIDDEN int f_above ( struct db_plan_t plan,
struct db_node_t db_node,
struct db_i dbip,
struct bu_ptbl results 
)

Definition at line 401 of file search.c.

References BU_PTBL_GET, BU_PTBL_LEN, db_full_path_match_top(), find_execute_nested_plans(), db_node_t::flags, db_full_path::fp_len, db_node_t::full_paths, db_node_t::matched_filters, db_plan_t::min_depth, and db_node_t::path.

Referenced by c_above().

Here is the call graph for this function:

HIDDEN int c_above ( char *  ignore,
char ***  ignored,
int  unused,
struct db_plan_t **  resultplan,
int *  db_search_isoutput 
)

Definition at line 435 of file search.c.

References BRLCAD_OK, f_above(), N_ABOVE, and palloc().

Here is the call graph for this function:

HIDDEN int f_or ( struct db_plan_t plan,
struct db_node_t db_node,
struct db_i dbip,
struct bu_ptbl results 
)

Definition at line 449 of file search.c.

References db_plan_t::eval, db_node_t::matched_filters, and db_plan_t::next.

Referenced by c_or().

HIDDEN int c_or ( char *  ignore,
char ***  ignored,
int  unused,
struct db_plan_t **  resultplan,
int *  db_search_isoutput 
)

Definition at line 469 of file search.c.

References BRLCAD_OK, f_or(), N_OR, and palloc().

Here is the call graph for this function:

HIDDEN int f_name ( struct db_plan_t plan,
struct db_node_t db_node,
struct db_i dbip,
struct bu_ptbl results 
)

Definition at line 483 of file search.c.

References bu_fnmatch(), directory::d_namep, DB_FULL_PATH_CUR_DIR, db_node_t::matched_filters, and db_node_t::path.

Referenced by c_name().

Here is the call graph for this function:

HIDDEN int c_name ( char *  pattern,
char ***  ignored,
int  unused,
struct db_plan_t **  resultplan,
int *  db_search_isoutput 
)

Definition at line 502 of file search.c.

References BRLCAD_OK, f_name(), N_NAME, and palloc().

Here is the call graph for this function:

HIDDEN int f_iname ( struct db_plan_t plan,
struct db_node_t db_node,
struct db_i dbip,
struct bu_ptbl results 
)

Definition at line 520 of file search.c.

References bu_fnmatch(), BU_FNMATCH_CASEFOLD, directory::d_namep, DB_FULL_PATH_CUR_DIR, db_node_t::matched_filters, and db_node_t::path.

Referenced by c_iname().

Here is the call graph for this function:

HIDDEN int c_iname ( char *  pattern,
char ***  ignored,
int  unused,
struct db_plan_t **  resultplan,
int *  db_search_isoutput 
)

Definition at line 539 of file search.c.

References BRLCAD_OK, f_iname(), N_INAME, and palloc().

Here is the call graph for this function:

HIDDEN int f_regex ( struct db_plan_t plan,
struct db_node_t db_node,
struct db_i dbip,
struct bu_ptbl results 
)

Definition at line 559 of file search.c.

References db_path_to_string(), db_node_t::matched_filters, and db_node_t::path.

Referenced by c_regex_common().

Here is the call graph for this function:

HIDDEN int c_regex_common ( enum db_search_ntype  type,
char *  regexp,
int  icase,
struct db_plan_t **  resultplan 
)

Definition at line 569 of file search.c.

References BRLCAD_ERROR, BRLCAD_OK, bu_log(), f_regex(), and palloc().

Referenced by c_iregex(), and c_regex().

Here is the call graph for this function:

HIDDEN int c_regex ( char *  pattern,
char ***  ignored,
int  unused,
struct db_plan_t **  resultplan,
int *  db_search_isoutput 
)

Definition at line 595 of file search.c.

References c_regex_common(), and N_REGEX.

Here is the call graph for this function:

HIDDEN int c_iregex ( char *  pattern,
char ***  ignored,
int  unused,
struct db_plan_t **  resultplan,
int *  db_search_isoutput 
)

Definition at line 602 of file search.c.

References c_regex_common(), and N_IREGEX.

Here is the call graph for this function:

HIDDEN int string_to_name_and_val ( const char *  in,
struct bu_vls name,
struct bu_vls value 
)

Definition at line 609 of file search.c.

References bu_vls_strcpy(), and bu_vls_strncpy().

Referenced by f_attr(), f_depth(), f_objparam(), and find_create().

Here is the call graph for this function:

HIDDEN int avs_check ( const char *  keystr,
const char *  value,
int  checkval,
int  strcomparison,
struct bu_attribute_value_set avs 
)

Definition at line 651 of file search.c.

References BU_AVS_FOR, bu_fnmatch(), bu_strcmp(), bu_attribute_value_pair::name, and bu_attribute_value_pair::value.

Referenced by f_attr(), and f_objparam().

Here is the call graph for this function:

HIDDEN int f_objparam ( struct db_plan_t plan,
struct db_node_t db_node,
struct db_i dbip,
struct bu_ptbl results 
)

Definition at line 750 of file search.c.

References avs_check(), BRLCAD_ERROR, bu_avs_free(), bu_avs_init_empty(), bu_vls_addr(), bu_vls_free(), BU_VLS_INIT_ZERO, DB_FULL_PATH_CUR_DIR, db_node_t::matched_filters, db_node_t::path, rt_db_free_internal(), rt_db_get_internal(), RT_DB_INTERNAL_INIT, rt_uniresource, string_to_name_and_val(), and tcl_list_to_avs().

Referenced by c_objparam().

Here is the call graph for this function:

HIDDEN int c_objparam ( char *  pattern,
char ***  ignored,
int  unused,
struct db_plan_t **  resultplan,
int *  db_search_isoutput 
)

Definition at line 824 of file search.c.

References BRLCAD_OK, f_objparam(), N_ATTR, and palloc().

Here is the call graph for this function:

HIDDEN int f_attr ( struct db_plan_t plan,
struct db_node_t db_node,
struct db_i dbip,
struct bu_ptbl results 
)

Definition at line 842 of file search.c.

References avs_check(), bu_avs_free(), bu_avs_init_empty(), bu_vls_addr(), bu_vls_free(), BU_VLS_INIT_ZERO, db5_get_attributes(), DB_FULL_PATH_CUR_DIR, db_node_t::matched_filters, db_node_t::path, and string_to_name_and_val().

Referenced by c_attr().

Here is the call graph for this function:

HIDDEN int c_attr ( char *  pattern,
char ***  ignored,
int  unused,
struct db_plan_t **  resultplan,
int *  db_search_isoutput 
)

Definition at line 898 of file search.c.

References BRLCAD_OK, f_attr(), N_ATTR, and palloc().

Here is the call graph for this function:

HIDDEN int f_stdattr ( struct db_plan_t plan,
struct db_node_t db_node,
struct db_i dbip,
struct bu_ptbl results 
)

Definition at line 918 of file search.c.

References BU_AVS_FOR, bu_avs_free(), bu_avs_init_empty(), BU_STR_EQUAL, db5_get_attributes(), DB_FULL_PATH_CUR_DIR, db_node_t::matched_filters, bu_attribute_value_pair::name, and db_node_t::path.

Referenced by c_stdattr().

Here is the call graph for this function:

HIDDEN int c_stdattr ( char *  pattern,
char ***  ignored,
int  unused,
struct db_plan_t **  resultplan,
int *  db_search_isoutput 
)

Definition at line 972 of file search.c.

References BRLCAD_OK, f_stdattr(), N_STDATTR, and palloc().

Here is the call graph for this function:

HIDDEN int f_type ( struct db_plan_t plan,
struct db_node_t db_node,
struct db_i dbip,
struct bu_ptbl results 
)

Definition at line 991 of file search.c.

References BN_TOL_DIST, BN_TOL_MAGIC, bu_fnmatch(), directory::d_flags, directory::d_major_type, DB_FULL_PATH_CUR_DIR, rt_functab::ft_label, rt_db_internal::idb_major_type, rt_db_internal::idb_meth, rt_db_internal::idb_minor_type, db_node_t::matched_filters, db_node_t::path, rt_arb_std_type(), rt_db_free_internal(), rt_db_get_internal(), RT_DIR_COMB, RT_DIR_REGION, and rt_uniresource.

Referenced by c_type().

Here is the call graph for this function:

HIDDEN int c_type ( char *  pattern,
char ***  ignored,
int  unused,
struct db_plan_t **  resultplan,
int *  db_search_isoutput 
)

Definition at line 1084 of file search.c.

References BRLCAD_OK, f_type(), N_TYPE, and palloc().

Here is the call graph for this function:

HIDDEN int f_bool ( struct db_plan_t plan,
struct db_node_t db_node,
struct db_i dbip,
struct bu_ptbl results 
)

Definition at line 1104 of file search.c.

References DB_FULL_PATH_CUR_BOOL, db_node_t::matched_filters, and db_node_t::path.

Referenced by c_bool().

HIDDEN int c_bool ( char *  pattern,
char ***  ignored,
int  unused,
struct db_plan_t **  resultplan,
int *  db_search_isoutput 
)

Definition at line 1115 of file search.c.

References BRLCAD_OK, bu_fnmatch(), f_bool(), N_BOOL, and palloc().

Here is the call graph for this function:

HIDDEN int f_maxdepth ( struct db_plan_t plan,
struct db_node_t db_node,
struct db_i dbip,
struct bu_ptbl results 
)

Definition at line 1140 of file search.c.

References db_full_path::fp_len, db_node_t::matched_filters, and db_node_t::path.

Referenced by c_maxdepth().

HIDDEN int c_maxdepth ( char *  pattern,
char ***  ignored,
int  unused,
struct db_plan_t **  resultplan,
int *  db_search_isoutput 
)

Definition at line 1149 of file search.c.

References BRLCAD_OK, f_maxdepth(), N_MAXDEPTH, and palloc().

Here is the call graph for this function:

HIDDEN int f_mindepth ( struct db_plan_t plan,
struct db_node_t db_node,
struct db_i dbip,
struct bu_ptbl results 
)

Definition at line 1169 of file search.c.

References db_full_path::fp_len, db_node_t::matched_filters, and db_node_t::path.

Referenced by c_mindepth().

HIDDEN int c_mindepth ( char *  pattern,
char ***  ignored,
int  unused,
struct db_plan_t **  resultplan,
int *  db_search_isoutput 
)

Definition at line 1178 of file search.c.

References BRLCAD_OK, f_mindepth(), N_MINDEPTH, and palloc().

Here is the call graph for this function:

HIDDEN int f_depth ( struct db_plan_t plan,
struct db_node_t db_node,
struct db_i dbip,
struct bu_ptbl results 
)

Definition at line 1197 of file search.c.

References bu_vls_addr(), bu_vls_free(), BU_VLS_INIT_ZERO, bu_vls_strlen(), db_full_path::fp_len, db_node_t::matched_filters, db_node_t::path, and string_to_name_and_val().

Referenced by c_depth().

Here is the call graph for this function:

HIDDEN int c_depth ( char *  pattern,
char ***  ignored,
int  unused,
struct db_plan_t **  resultplan,
int *  db_search_isoutput 
)

Definition at line 1249 of file search.c.

References BRLCAD_OK, f_depth(), N_DEPTH, and palloc().

Here is the call graph for this function:

HIDDEN int f_nnodes ( struct db_plan_t plan,
struct db_node_t db_node,
struct db_i dbip,
struct bu_ptbl results 
)

Definition at line 1272 of file search.c.

References directory::d_flags, DB_FULL_PATH_CUR_DIR, db_tree_nleaves(), rt_db_internal::idb_ptr, if(), db_node_t::matched_filters, db_node_t::path, rt_db_free_internal(), rt_db_get_internal(), RT_DIR_COMB, rt_uniresource, and rt_comb_internal::tree.

Referenced by c_nnodes().

Here is the call graph for this function:

HIDDEN int c_nnodes ( char *  pattern,
char ***  ignored,
int  unused,
struct db_plan_t **  resultplan,
int *  db_search_isoutput 
)

Definition at line 1359 of file search.c.

References BRLCAD_OK, f_nnodes(), N_NNODES, and palloc().

Here is the call graph for this function:

HIDDEN int f_path ( struct db_plan_t plan,
struct db_node_t db_node,
struct db_i dbip,
struct bu_ptbl results 
)

Definition at line 1378 of file search.c.

References bu_fnmatch(), db_path_to_string(), db_node_t::matched_filters, and db_node_t::path.

Referenced by c_path().

Here is the call graph for this function:

HIDDEN int c_path ( char *  pattern,
char ***  ignored,
int  unused,
struct db_plan_t **  resultplan,
int *  db_search_isoutput 
)

Definition at line 1387 of file search.c.

References BRLCAD_OK, f_path(), N_PATH, and palloc().

Here is the call graph for this function:

HIDDEN int f_print ( struct db_plan_t plan,
struct db_node_t db_node,
struct db_i dbip,
struct bu_ptbl results 
)

Definition at line 1405 of file search.c.

References BU_ALLOC, bu_ptbl_ins(), bu_ptbl_ins_unique(), db_dup_full_path(), DB_FULL_PATH_CUR_DIR, db_full_path_init(), DB_SEARCH_FLAT, DB_SEARCH_RETURN_UNIQ_DP, db_node_t::flags, and db_node_t::path.

Referenced by c_print().

Here is the call graph for this function:

HIDDEN int c_print ( char *  ignore,
char ***  ignored,
int  unused,
struct db_plan_t **  resultplan,
int *  db_search_isoutput 
)

Definition at line 1424 of file search.c.

References BRLCAD_OK, f_print(), N_PRINT, and palloc().

Referenced by db_search_form_plan().

Here is the call graph for this function:

HIDDEN int typecompare ( const void *  a,
const void *  b 
)

Definition at line 1434 of file search.c.

References bu_strcmp().

Referenced by option().

Here is the call graph for this function:

HIDDEN OPTION* option ( char *  name)

Definition at line 1441 of file search.c.

References _option::create, _option::flags, N_ABOVE, _option::name, _option::token, and typecompare().

Referenced by find_create().

Here is the call graph for this function:

HIDDEN int find_create ( char ***  argvp,
struct db_plan_t **  resultplan,
struct bu_ptbl results,
int *  db_search_isoutput,
int  quiet 
)

Definition at line 1461 of file search.c.

References BRLCAD_ERROR, BRLCAD_OK, bu_log(), bu_vls_addr(), bu_vls_free(), BU_VLS_INIT_ZERO, bu_vls_strlen(), _option::create, _option::flags, db_plan_t::max_depth, db_plan_t::min_depth, N_OK, O_ARGV, O_ARGVP, O_NONE, O_ZERO, option(), string_to_name_and_val(), and _option::token.

Referenced by db_search_form_plan().

Here is the call graph for this function:

HIDDEN struct db_plan_t* yanknode ( struct db_plan_t **  planp)

Definition at line 1554 of file search.c.

References db_plan_t::next.

Referenced by above_squish(), below_squish(), not_squish(), or_squish(), and yankexpr().

HIDDEN int yankexpr ( struct db_plan_t **  planp,
struct db_plan_t **  resultplan 
)

Definition at line 1574 of file search.c.

References BRLCAD_ERROR, BRLCAD_OK, bu_log(), db_plan_t::eval, f_expr(), N_CLOSEPAREN, N_EXPR, N_OPENPAREN, db_plan_t::next, db_plan_t::type, and yanknode().

Referenced by paren_squish().

Here is the call graph for this function:

HIDDEN int paren_squish ( struct db_plan_t plan,
struct db_plan_t **  resultplan 
)

Definition at line 1638 of file search.c.

References BRLCAD_ERROR, BRLCAD_OK, bu_log(), N_CLOSEPAREN, db_plan_t::next, db_plan_t::type, and yankexpr().

Referenced by db_search_form_plan().

Here is the call graph for this function:

HIDDEN int not_squish ( struct db_plan_t plan,
struct db_plan_t **  resultplan 
)

Definition at line 1680 of file search.c.

References BRLCAD_ERROR, BRLCAD_OK, bu_log(), N_EXPR, N_NOT, N_OR, db_plan_t::next, db_plan_t::type, and yanknode().

Referenced by db_search_form_plan().

Here is the call graph for this function:

HIDDEN int above_squish ( struct db_plan_t plan,
struct db_plan_t **  resultplan 
)

Definition at line 1744 of file search.c.

References BRLCAD_ERROR, BRLCAD_OK, bu_log(), N_ABOVE, N_EXPR, N_OR, db_plan_t::next, db_plan_t::type, and yanknode().

Referenced by db_search_form_plan().

Here is the call graph for this function:

HIDDEN int below_squish ( struct db_plan_t plan,
struct db_plan_t **  resultplan 
)

Definition at line 1804 of file search.c.

References BRLCAD_ERROR, BRLCAD_OK, bu_log(), N_BELOW, N_EXPR, N_OR, db_plan_t::next, db_plan_t::type, and yanknode().

Referenced by db_search_form_plan().

Here is the call graph for this function:

HIDDEN int or_squish ( struct db_plan_t plan,
struct db_plan_t **  resultplan 
)

Definition at line 1864 of file search.c.

References BRLCAD_ERROR, BRLCAD_OK, bu_log(), N_EXPR, N_NOT, N_OR, db_plan_t::next, db_plan_t::type, and yanknode().

Referenced by db_search_form_plan().

Here is the call graph for this function:

HIDDEN struct db_plan_t* db_search_form_plan ( char **  argv,
int  quiet 
)

Definition at line 1919 of file search.c.

References above_squish(), below_squish(), BRLCAD_OK, c_closeparen(), c_openparen(), c_print(), find_create(), db_plan_t::next, not_squish(), or_squish(), and paren_squish().

Referenced by db_search(), and db_search_formplan().

Here is the call graph for this function:

HIDDEN void find_execute_plans ( struct db_i dbip,
struct bu_ptbl results,
struct db_node_t db_node,
struct db_plan_t plan 
)

Definition at line 2009 of file search.c.

References db_plan_t::eval, and db_plan_t::next.

Referenced by _db_search_full_paths(), and db_search().

HIDDEN void db_search_free_plan ( void **  vplan)

Definition at line 2016 of file search.c.

References BU_PUT, and db_plan_t::next.

Referenced by db_search(), and db_search_freeplan().

void _db_free_full_path_list ( struct db_full_path_list path_list)

Definition at line 2055 of file search.c.

References bu_free(), BU_LIST_DEQUEUE, BU_LIST_IS_EMPTY, BU_LIST_WHILE, db_free_full_path(), db_full_path_list::l, and db_full_path_list::path.

Referenced by db_free_full_path_list(), and db_search_unique_objects().

Here is the call graph for this function: