BRL-CAD
comb_std.c File Reference
#include "common.h"
#include <string.h>
#include "tcl.h"
#include "bu/getopt.h"
#include "vmath.h"
#include "rtgeom.h"
#include "ged.h"
Include dependency graph for comb_std.c:

Go to the source code of this file.

Data Structures

struct  tokens
 

Macros

#define TOK_NULL   0
 
#define TOK_LPAREN   1
 
#define TOK_RPAREN   2
 
#define TOK_UNION   3
 
#define TOK_INTER   4
 
#define TOK_SUBTR   5
 
#define TOK_TREE   6
 

Functions

HIDDEN void free_tokens (struct bu_list *hp)
 
HIDDEN void append_union (struct bu_list *hp)
 
HIDDEN void append_inter (struct bu_list *hp)
 
HIDDEN void append_subtr (struct bu_list *hp)
 
HIDDEN void append_lparen (struct bu_list *hp)
 
HIDDEN void append_rparen (struct bu_list *hp)
 
HIDDEN int add_operator (struct ged *gedp, struct bu_list *hp, char *ptr, short int *last_tok)
 
HIDDEN int add_operand (struct ged *gedp, struct bu_list *hp, char *name)
 
HIDDEN void do_inter (struct bu_list *hp)
 
HIDDEN void do_union_subtr (struct bu_list *hp)
 
HIDDEN int do_paren (struct bu_list *hp)
 
HIDDEN union treeeval_bool (struct bu_list *hp)
 
HIDDEN int check_syntax (struct ged *gedp, struct bu_list *hp, char *comb_name, struct directory *dp)
 
int ged_comb_std (struct ged *gedp, int argc, const char *argv[])
 

Detailed Description

The c command.

Definition in file comb_std.c.

Macro Definition Documentation

#define TOK_NULL   0

Definition at line 47 of file comb_std.c.

Referenced by check_syntax(), and ged_comb_std().

#define TOK_LPAREN   1

Definition at line 48 of file comb_std.c.

Referenced by append_lparen(), check_syntax(), do_paren(), and ged_comb_std().

#define TOK_RPAREN   2

Definition at line 49 of file comb_std.c.

Referenced by append_rparen(), check_syntax(), do_paren(), and ged_comb_std().

#define TOK_UNION   3

Definition at line 50 of file comb_std.c.

Referenced by add_operator(), append_union(), check_syntax(), do_union_subtr(), and ged_comb_std().

#define TOK_INTER   4

Definition at line 51 of file comb_std.c.

Referenced by add_operator(), append_inter(), check_syntax(), do_inter(), and ged_comb_std().

#define TOK_SUBTR   5

Definition at line 52 of file comb_std.c.

Referenced by add_operator(), append_subtr(), check_syntax(), do_union_subtr(), and ged_comb_std().

#define TOK_TREE   6

Function Documentation

HIDDEN void free_tokens ( struct bu_list hp)

Definition at line 56 of file comb_std.c.

References BU_CK_LIST_HEAD, BU_LIST_DEQUEUE, BU_LIST_WHILE, db_free_tree(), tokens::l, rt_uniresource, TOK_TREE, tokens::tp, and tokens::type.

Referenced by add_operator(), and ged_comb_std().

Here is the call graph for this function:

HIDDEN void append_union ( struct bu_list hp)

Definition at line 72 of file comb_std.c.

References BU_ALLOC, BU_CK_LIST_HEAD, BU_LIST_INSERT, tokens::l, TOK_UNION, tokens::tp, and tokens::type.

Referenced by add_operator().

HIDDEN void append_inter ( struct bu_list hp)

Definition at line 86 of file comb_std.c.

References BU_ALLOC, BU_CK_LIST_HEAD, BU_LIST_INSERT, tokens::l, TOK_INTER, tokens::tp, and tokens::type.

Referenced by add_operator().

HIDDEN void append_subtr ( struct bu_list hp)

Definition at line 100 of file comb_std.c.

References BU_ALLOC, BU_CK_LIST_HEAD, BU_LIST_INSERT, tokens::l, TOK_SUBTR, tokens::tp, and tokens::type.

Referenced by add_operator().

HIDDEN void append_lparen ( struct bu_list hp)

Definition at line 114 of file comb_std.c.

References BU_ALLOC, BU_CK_LIST_HEAD, BU_LIST_INSERT, tokens::l, TOK_LPAREN, tokens::tp, and tokens::type.

Referenced by ged_comb_std().

HIDDEN void append_rparen ( struct bu_list hp)

Definition at line 128 of file comb_std.c.

References BU_ALLOC, BU_CK_LIST_HEAD, BU_LIST_INSERT, tokens::l, TOK_RPAREN, tokens::tp, and tokens::type.

Referenced by ged_comb_std().

HIDDEN int add_operator ( struct ged gedp,
struct bu_list hp,
char *  ptr,
short int *  last_tok 
)

Definition at line 142 of file comb_std.c.

References append_inter(), append_subtr(), append_union(), BU_CK_LIST_HEAD, bu_vls_printf(), DB_OP_INTERSECT, DB_OP_SUBTRACT, DB_OP_UNION, db_str2op(), free_tokens(), GED_ERROR, GED_OK, ged::ged_result_str, TOK_INTER, TOK_SUBTR, and TOK_UNION.

Referenced by ged_comb_std().

Here is the call graph for this function:

HIDDEN int add_operand ( struct ged gedp,
struct bu_list hp,
char *  name 
)

Definition at line 171 of file comb_std.c.

References BU_ALLOC, BU_CK_LIST_HEAD, BU_LIST_INSERT, bu_malloc(), bu_strlcpy, bu_vls_printf(), ged::ged_result_str, tokens::l, OP_DB_LEAF, RT_GET_TREE, rt_uniresource, strchr(), tree::tree_db_leaf::tl_mat, tree::tree_db_leaf::tl_name, TOK_TREE, tokens::tp, tree::tr_l, and tokens::type.

Referenced by ged_comb_std().

Here is the call graph for this function:

HIDDEN void do_inter ( struct bu_list hp)

Definition at line 227 of file comb_std.c.

References BU_ALLOC, bu_free(), BU_LIST_DEQUEUE, BU_LIST_FOR, BU_LIST_NEXT, BU_LIST_PREV, tokens::l, OP_INTERSECT, RT_TREE_INIT, tree::tree_node::tb_left, tree::tree_node::tb_op, tree::tree_node::tb_regionp, tree::tree_node::tb_right, TOK_INTER, TOK_TREE, tokens::tp, tree::tr_b, and tokens::type.

Referenced by eval_bool().

Here is the call graph for this function:

HIDDEN void do_union_subtr ( struct bu_list hp)

Definition at line 262 of file comb_std.c.

References BU_ALLOC, bu_free(), BU_LIST_DEQUEUE, BU_LIST_FOR, BU_LIST_NEXT, BU_LIST_PREV, tokens::l, OP_SUBTRACT, OP_UNION, RT_TREE_INIT, tree::tree_node::tb_left, tree::tree_node::tb_op, tree::tree_node::tb_regionp, tree::tree_node::tb_right, TOK_SUBTR, TOK_TREE, TOK_UNION, tokens::tp, tree::tr_b, and tokens::type.

Referenced by eval_bool().

Here is the call graph for this function:

HIDDEN int do_paren ( struct bu_list hp)

Definition at line 300 of file comb_std.c.

References bu_list::back, bu_free(), BU_LIST_DEQUEUE, BU_LIST_FOR, BU_LIST_IS_EMPTY, BU_LIST_NEXT, BU_LIST_PREV, bu_list::forw, tokens::l, TOK_LPAREN, TOK_RPAREN, TOK_TREE, and tokens::type.

Referenced by eval_bool().

Here is the call graph for this function:

HIDDEN union tree* eval_bool ( struct bu_list hp)

Definition at line 334 of file comb_std.c.

References bu_free(), BU_LIST_DEQUEUE, BU_LIST_NEXT, do_inter(), do_paren(), do_union_subtr(), tokens::l, and tokens::tp.

Referenced by ged_comb_std().

Here is the call graph for this function:

HIDDEN int check_syntax ( struct ged gedp,
struct bu_list hp,
char *  comb_name,
struct directory dp 
)

Definition at line 356 of file comb_std.c.

References BU_LIST_FOR, BU_STR_EQUAL, bu_vls_printf(), db_lookup(), rt_wdb::dbip, ged::ged_result_str, ged::ged_wdbp, LOOKUP_QUIET, RT_DIR_NULL, tree::tree_db_leaf::tl_name, TOK_INTER, TOK_LPAREN, TOK_NULL, TOK_RPAREN, TOK_SUBTR, TOK_TREE, TOK_UNION, tokens::tp, tree::tr_l, and tokens::type.

Referenced by ged_comb_std().

Here is the call graph for this function: