BRL-CAD
attr.c File Reference
#include "common.h"
#include <string.h>
#include "bu/sort.h"
#include "./ged_private.h"
Include dependency graph for attr.c:

Go to the source code of this file.

Enumerations

enum  attr_cmd_t {
  ATTR_APPEND, ATTR_GET, ATTR_RM, ATTR_SET,
  ATTR_SHOW, ATTR_SORT, ATTR_LIST, ATTR_UNKNOWN
}
 

Functions

HIDDEN int attr_cmp (const void *p1, const void *p2, void *arg)
 
HIDDEN int attr_cmp_nocase (const void *p1, const void *p2, void *arg)
 
HIDDEN int attr_cmp_value (const void *p1, const void *p2, void *arg)
 
HIDDEN int attr_cmp_value_nocase (const void *p1, const void *p2, void *arg)
 
HIDDEN int attr_pretty_print (struct ged *gedp, struct directory *dp, const char *name)
 
HIDDEN attr_cmd_t attr_cmd (const char *arg)
 
HIDDEN void attr_print (struct ged *gedp, struct bu_attribute_value_set *avs, const size_t max_attr_name_len)
 
int ged_attr (struct ged *gedp, int argc, const char *argv[])
 

Detailed Description

The attr command.

Definition in file attr.c.

Enumeration Type Documentation

enum attr_cmd_t
Enumerator
ATTR_APPEND 
ATTR_GET 
ATTR_RM 
ATTR_SET 
ATTR_SHOW 
ATTR_SORT 
ATTR_LIST 
ATTR_UNKNOWN 

Definition at line 34 of file attr.c.

Function Documentation

HIDDEN int attr_cmp ( const void *  p1,
const void *  p2,
void *  arg 
)

Definition at line 50 of file attr.c.

References bu_strcmp().

Referenced by ged_attr().

Here is the call graph for this function:

HIDDEN int attr_cmp_nocase ( const void *  p1,
const void *  p2,
void *  arg 
)

Definition at line 58 of file attr.c.

References bu_strcasecmp().

Referenced by ged_attr().

Here is the call graph for this function:

HIDDEN int attr_cmp_value ( const void *  p1,
const void *  p2,
void *  arg 
)

Definition at line 66 of file attr.c.

References bu_strcmp().

Referenced by ged_attr().

Here is the call graph for this function:

HIDDEN int attr_cmp_value_nocase ( const void *  p1,
const void *  p2,
void *  arg 
)

Definition at line 74 of file attr.c.

References bu_strcasecmp().

Referenced by ged_attr().

Here is the call graph for this function:

HIDDEN int attr_pretty_print ( struct ged gedp,
struct directory dp,
const char *  name 
)

Definition at line 82 of file attr.c.

References binu_types, bu_vls_printf(), directory::d_flags, directory::d_major_type, directory::d_minor_type, rt_functab::ft_label, GED_DB_GET_INTERNAL, GED_ERROR, GED_OK, ged::ged_result_str, rt_db_internal::idb_meth, rt_db_free_internal(), RT_DIR_COMB, RT_DIR_REGION, RT_DIR_SOLID, and rt_uniresource.

Referenced by ged_attr().

Here is the call graph for this function:

HIDDEN attr_cmd_t attr_cmd ( const char *  arg)

Definition at line 115 of file attr.c.

References ATTR_APPEND, ATTR_GET, ATTR_LIST, ATTR_RM, ATTR_SET, ATTR_SHOW, ATTR_SORT, ATTR_UNKNOWN, BU_STR_EQUIV, and SORT.

Referenced by ged_attr().

HIDDEN void attr_print ( struct ged gedp,
struct bu_attribute_value_set avs,
const size_t  max_attr_name_len 
)

Definition at line 147 of file attr.c.

References bu_attribute_value_set::avp, bu_vls_printf(), ged::ged_result_str, bu_attribute_value_pair::name, and bu_attribute_value_pair::value.

Referenced by ged_attr().

Here is the call graph for this function:

int ged_attr ( struct ged gedp,
int  argc,
const char *  argv[] 
)

Set, get, show, remove or append to attribute values for the specified object. The arguments for "set" and "append" subcommands are attribute name/value pairs. The arguments for "get", "rm", and "show" subcommands are attribute names. The "set" subcommand sets the specified attributes for the object. The "append" subcommand appends the provided value to an existing attribute, or creates a new attribute if it does not already exist. The "get" subcommand retrieves and displays the specified attributes. The "rm" subcommand deletes the specified attributes. The "show" subcommand does a "get" and displays the results in a user readable format.

Definition at line 168 of file attr.c.

References ATTR_APPEND, attr_cmd(), attr_cmp(), attr_cmp_nocase(), attr_cmp_value(), attr_cmp_value_nocase(), ATTR_GET, ATTR_LIST, attr_pretty_print(), attr_print(), ATTR_RM, ATTR_SET, ATTR_SHOW, ATTR_SORT, bu_attribute_value_set::avp, bu_avs_add(), bu_avs_add_vls(), bu_avs_free(), bu_avs_get(), bu_avs_init_empty(), bu_avs_merge(), bu_avs_remove(), bu_sort(), BU_STR_EQUAL, BU_STR_EQUIV, bu_vls_addr(), bu_vls_free(), BU_VLS_INIT_ZERO, bu_vls_printf(), bu_vls_putc(), bu_vls_strcat(), bu_vls_trunc(), bu_attribute_value_set::count, directory::d_flags, directory::d_namep, db5_get_attributes(), db5_replace_attributes(), db5_standardize_avs(), db5_update_attributes(), db_ls(), DB_LS_HIDDEN, db_version(), rt_wdb::dbip, GED_CHECK_ARGC_GT_0, GED_CHECK_DATABASE_OPEN, GED_CHECK_READ_ONLY, GED_ERROR, GED_HELP, GED_OK, ged::ged_result_str, ged::ged_wdbp, bu_attribute_value_pair::name, RT_DIR_REGION, usage(), and bu_attribute_value_pair::value.

Here is the call graph for this function: