BRL-CAD
Collaboration diagram for Structure Parsing:

Files

file  parse.c
 
file  booleanize.c
 

Data Structures

struct  bu_structparse
 
struct  bu_structparse_map
 
struct  bu_external
 

Macros

#define offsetof(_t, _m)   (size_t)(&(((_t *)0)->_m))
 
#define bu_offsetof(_t, _m)   (size_t)offsetof(_t, _m)
 
#define bu_offsetofarray(_t, _a, _d, _i)   bu_offsetof(_t, _a) + sizeof(_d) * _i
 
#define bu_byteoffset(_i)   ((size_t)(((char *)&(_i))-((char *)0)))
 
#define BU_STRUCTPARSE_NULL   ((struct bu_structparse *)0)
 
#define BU_STRUCTPARSE_FUNC_NULL   ((void(*)(const struct bu_structparse *, const char *, void *, const char *, void *))0)
 
#define BU_CK_STRUCTPARSE(_sp)   /* nothing to do */
 
#define BU_STRUCTPARSE_INIT(_sp)
 
#define BU_STRUCTPARSE_INIT_ZERO   { {'\0', '\0', '\0', '\0'}, 0, NULL, 0, BU_STRUCTPARSE_FUNC_NULL, NULL, NULL }
 
#define BU_STRUCTPARSE_IS_INITIALIZED(_sp)   ((struct bu_structparse *)(_sp) != BU_STRUCTPARSE_NULL)
 
#define BU_EXTERNAL_NULL   ((struct bu_external *)0)
 
#define BU_CK_EXTERNAL(_p)   BU_CKMAG(_p, BU_EXTERNAL_MAGIC, "bu_external")
 
#define BU_EXTERNAL_INIT(_p)
 
#define BU_EXTERNAL_INIT_ZERO   { BU_EXTERNAL_MAGIC, 0, NULL }
 
#define BU_EXTERNAL_IS_INITIALIZED(_p)   (((struct bu_external *)(_p) != BU_EXTERNAL_NULL) && (_p)->ext_magic == BU_EXTERNAL_MAGIC)
 
#define BU_SP_SKIP_SEP(_cp)
 

Typedefs

typedef struct bu_structparse bu_structparse_t
 
typedef struct bu_external bu_external_t
 

Functions

int bu_struct_parse (const struct bu_vls *in_vls, const struct bu_structparse *desc, const char *base, void *data)
 
void bu_struct_print (const char *title, const struct bu_structparse *parsetab, const char *base)
 
int bu_struct_export (struct bu_external *ext, const void *base, const struct bu_structparse *imp)
 
int bu_struct_import (void *base, const struct bu_structparse *imp, const struct bu_external *ext, void *data)
 
size_t bu_struct_put (FILE *fp, const struct bu_external *ext)
 
size_t bu_struct_get (struct bu_external *ext, FILE *fp)
 
void bu_struct_wrap_buf (struct bu_external *ext, void *buf)
 
void bu_vls_struct_print (struct bu_vls *vls, const struct bu_structparse *sdp, const char *base)
 
void bu_vls_struct_print2 (struct bu_vls *vls, const char *title, const struct bu_structparse *sdp, const char *base)
 
void bu_vls_struct_item (struct bu_vls *vp, const struct bu_structparse *sdp, const char *base, int sep_char)
 
int bu_vls_struct_item_named (struct bu_vls *vp, const struct bu_structparse *sdp, const char *name, const char *base, int sep_char)
 
void bu_parse_mm (const struct bu_structparse *sdp, const char *name, char *base, const char *value)
 
int bu_key_eq_to_key_val (const char *in, const char **next, struct bu_vls *vls)
 
int bu_shader_to_list (const char *in, struct bu_vls *vls)
 
int bu_shader_to_key_eq (const char *in, struct bu_vls *vls)
 
int bu_fwrite_external (FILE *fp, const struct bu_external *ep)
 
void bu_hexdump_external (FILE *fp, const struct bu_external *ep, const char *str)
 
void bu_free_external (struct bu_external *ep)
 
void bu_copy_external (struct bu_external *op, const struct bu_external *ip)
 
char * bu_next_token (char *str)
 
void bu_structparse_get_terse_form (struct bu_vls *logstr, const struct bu_structparse *sp)
 
int bu_structparse_argv (struct bu_vls *str, int argc, const char **argv, const struct bu_structparse *desc, char *base, void *data)
 
int bu_str_true (const char *str)
 
int bu_str_false (const char *str)
 

Detailed Description

Macro Definition Documentation

#define offsetof (   _t,
  _m 
)    (size_t)(&(((_t *)0)->_m))

The general problem of word-addressed hardware where (int *) and (char *) have different representations is handled in the parsing routines that use sp_offset, because of the limitations placed on compile-time initializers.

Files using bu_offsetof or bu_offsetofarray will need to include stddef.h in order to get offsetof()

Definition at line 62 of file parse.h.

#define bu_offsetof (   _t,
  _m 
)    (size_t)offsetof(_t, _m)

Definition at line 64 of file parse.h.

#define bu_offsetofarray (   _t,
  _a,
  _d,
  _i 
)    bu_offsetof(_t, _a) + sizeof(_d) * _i

Definition at line 65 of file parse.h.

#define bu_byteoffset (   _i)    ((size_t)(((char *)&(_i))-((char *)0)))

Convert address of global data object into byte "offset" from address 0.

Strictly speaking, the C language only permits initializers of the form: address +- constant, where here the intent is to measure the byte address of the indicated variable. Matching compensation code for the CRAY is located in librt/parse.c

Definition at line 81 of file parse.h.

#define BU_STRUCTPARSE_NULL   ((struct bu_structparse *)0)

Definition at line 151 of file parse.h.

#define BU_STRUCTPARSE_FUNC_NULL   ((void(*)(const struct bu_structparse *, const char *, void *, const char *, void *))0)

Definition at line 153 of file parse.h.

Referenced by dm_set_hook().

#define BU_CK_STRUCTPARSE (   _sp)    /* nothing to do */

assert the integrity of a bu_structparse struct.

Definition at line 171 of file parse.h.

#define BU_STRUCTPARSE_INIT (   _sp)
Value:
{ \
(_sp)->sp_fmt[0] = (_sp)->sp_fmt[1] = (_sp)->sp_fmt[2] = (_sp)->sp_fmt[3] = '\0'; \
(_sp)->sp_count = 0; \
(_sp)->sp_name = NULL; \
(_sp)->sp_offset = 0; \
(_sp)->sp_hook = BU_STRUCTPARSE_FUNC_NULL; \
(_sp)->sp_desc = NULL; \
(_sp)->sp_default = NULL; \
}
#define BU_STRUCTPARSE_FUNC_NULL
Definition: parse.h:153

initialize a bu_structparse struct without allocating any memory.

Definition at line 176 of file parse.h.

#define BU_STRUCTPARSE_INIT_ZERO   { {'\0', '\0', '\0', '\0'}, 0, NULL, 0, BU_STRUCTPARSE_FUNC_NULL, NULL, NULL }

macro suitable for declaration statement initialization of a bu_structparse struct. does not allocate memory.

Definition at line 190 of file parse.h.

#define BU_STRUCTPARSE_IS_INITIALIZED (   _sp)    ((struct bu_structparse *)(_sp) != BU_STRUCTPARSE_NULL)

returns truthfully whether a bu_structparse struct has been initialized. validates whether pointer is non-NULL.

Definition at line 196 of file parse.h.

#define BU_EXTERNAL_NULL   ((struct bu_external *)0)

Definition at line 219 of file parse.h.

#define BU_CK_EXTERNAL (   _p)    BU_CKMAG(_p, BU_EXTERNAL_MAGIC, "bu_external")

assert the integrity of a bu_external struct.

Definition at line 224 of file parse.h.

Referenced by bu_copy_external(), bu_free_external(), bu_fwrite_external(), bu_hexdump_external(), db5_export_object3(), db5_import_attributes(), db5_make_free_object(), db5_make_free_object_hdr(), db5_realloc(), db_fwrite_external(), db_inmem(), db_put_external(), db_put_external5(), db_wrap_v4_external(), db_wrap_v5_external(), nmg_stash_model_to_file(), rt_arb_export4(), rt_arb_export5(), rt_arb_import4(), rt_arb_import5(), rt_arbn_export4(), rt_arbn_export5(), rt_arbn_import4(), rt_arbn_import5(), rt_ars_export4(), rt_ars_export5(), rt_ars_import4(), rt_ars_import5(), rt_binunif_import5_minor_type(), rt_bot_export4(), rt_bot_export5(), rt_bot_import4(), rt_bot_import5(), rt_brep_import5(), rt_cline_export4(), rt_cline_export5(), rt_cline_import4(), rt_cline_import5(), rt_comb_import4(), rt_comb_import5(), rt_constraint_import5(), rt_db_cvt_to_external5(), rt_db_external5_to_internal5(), rt_db_put_internal5(), rt_dsp_export4(), rt_dsp_export5(), rt_dsp_import4(), rt_dsp_import5(), rt_ebm_export4(), rt_ebm_export5(), rt_ebm_import4(), rt_ebm_import5(), rt_ehy_export4(), rt_ehy_export5(), rt_ehy_import4(), rt_ehy_import5(), rt_ell_export4(), rt_ell_export5(), rt_ell_import4(), rt_ell_import5(), rt_epa_export4(), rt_epa_export5(), rt_epa_import4(), rt_epa_import5(), rt_eto_export4(), rt_eto_export5(), rt_eto_import4(), rt_eto_import5(), rt_extrude_export4(), rt_extrude_export5(), rt_extrude_import4(), rt_extrude_import5(), rt_fwrite_internal(), rt_grp_export4(), rt_grp_export5(), rt_grp_import4(), rt_grp_import5(), rt_hf_export4(), rt_hf_import4(), rt_hlf_export4(), rt_hlf_export5(), rt_hlf_import4(), rt_hlf_import5(), rt_hrt_export5(), rt_hrt_import5(), rt_hyp_export5(), rt_hyp_import5(), rt_id_solid(), rt_joint_export4(), rt_joint_export5(), rt_joint_import4(), rt_joint_import5(), rt_metaball_export5(), rt_metaball_import5(), rt_nmg_export4_internal(), rt_nmg_export5(), rt_nmg_import4(), rt_nmg_import4_internal(), rt_nmg_import5(), rt_nurb_export4(), rt_nurb_import4(), rt_nurb_import5(), rt_obj_export(), rt_obj_import(), rt_part_export4(), rt_part_export5(), rt_part_import4(), rt_part_import5(), rt_pg_export4(), rt_pg_import4(), rt_pipe_export4(), rt_pipe_export5(), rt_pipe_import4(), rt_pipe_import5(), rt_pnts_export5(), rt_pnts_import5(), rt_revolve_export5(), rt_revolve_import5(), rt_rhc_export4(), rt_rhc_export5(), rt_rhc_import4(), rt_rhc_import5(), rt_rpc_export4(), rt_rpc_export5(), rt_rpc_import4(), rt_rpc_import5(), rt_sketch_export4(), rt_sketch_export5(), rt_sketch_import4(), rt_sketch_import5(), rt_submodel_export4(), rt_submodel_export5(), rt_submodel_import4(), rt_submodel_import5(), rt_superell_export4(), rt_superell_export5(), rt_superell_import4(), rt_superell_import5(), rt_tgc_export4(), rt_tgc_export5(), rt_tgc_import4(), rt_tgc_import5(), rt_tor_export4(), rt_tor_export5(), rt_tor_import4(), rt_tor_import5(), rt_vol_export4(), rt_vol_export5(), rt_vol_import4(), rt_vol_import5(), rt_xxx_export5(), rt_xxx_import5(), wdb_export_external(), and wdb_put_internal().

#define BU_EXTERNAL_INIT_ZERO   { BU_EXTERNAL_MAGIC, 0, NULL }

macro suitable for declaration statement initialization of a bu_external struct. does not allocate memory.

Definition at line 239 of file parse.h.

Referenced by db5_get_attributes(), and rt_db_get_internal5().

#define BU_EXTERNAL_IS_INITIALIZED (   _p)    (((struct bu_external *)(_p) != BU_EXTERNAL_NULL) && (_p)->ext_magic == BU_EXTERNAL_MAGIC)

returns truthfully whether a bu_external struct has been initialized. is not reliable unless the struct has been initialized with BU_EXTERNAL_INIT().

Definition at line 246 of file parse.h.

#define BU_SP_SKIP_SEP (   _cp)
Value:
{ \
while (*(_cp) && (*(_cp) == ' ' || *(_cp) == '\n' || \
*(_cp) == '\t' || *(_cp) == '{')) ++(_cp); \
}

Skip the separator(s) (i.e. whitespace and open-braces)

Parameters
_cp- character pointer

Definition at line 457 of file parse.h.

Referenced by bu_structparse_argv().

Typedef Documentation

Definition at line 150 of file parse.h.

typedef struct bu_external bu_external_t

Definition at line 218 of file parse.h.

Function Documentation

int bu_struct_parse ( const struct bu_vls in_vls,
const struct bu_structparse desc,
const char *  base,
void *  data 
)

ASCII to struct elements.

Parse the structure element description in the vls string "vls" according to the structure description in "parsetab"

Returns
<0 failure
0 OK

Definition at line 878 of file parse.c.

References BU_CK_VLS, bu_log(), bu_struct_print(), bu_vls_addr(), bu_vls_free(), BU_VLS_INIT_ZERO, bu_vls_vlscat(), parse_struct_lookup(), and UNLIKELY.

Referenced by air_setup(), bbd_setup(), brdf_setup(), cglass_setup(), ckr_setup(), cloud_setup(), cmirror_setup(), cook_setup(), fbm_setup(), fire_setup(), flat_setup(), gauss_setup(), GetMaterial(), glass_setup(), grass_setup(), light_setup(), mirror_setup(), nmg_2_vrml(), noise_setup(), phong_setup(), points_setup(), prj_setup(), rt_dsp_import4(), rt_ebm_import4(), rt_ebm_import5(), rt_hf_import4(), rt_submodel_import4(), rt_submodel_import5(), rt_vol_import4(), rt_vol_import5(), rtrans_setup(), scloud_setup(), setup(), spm_setup(), stxt_setup(), tcl_setup(), temp_setup(), toon_setup(), toyota_setup(), tthrm_setup(), txt_setup(), wood_setup(), and xxx_setup().

Here is the call graph for this function:

void bu_struct_print ( const char *  title,
const struct bu_structparse parsetab,
const char *  base 
)

struct elements to ASCII.

Definition at line 1221 of file parse.c.

References BU_ASSERT, bu_log(), bu_log_indent_delta(), bu_vls_addr(), COMMA, delta, parse_dmatprint(), parse_matprint(), bu_structparse::sp_count, bu_structparse::sp_fmt, bu_structparse::sp_name, bu_structparse::sp_offset, UNLIKELY, bu_vls::vls_len, bu_vls::vls_magic, bu_vls::vls_max, and bu_vls::vls_offset.

Referenced by air_print(), air_render(), airtest_render(), bbd_print(), bbd_render(), bbd_setup(), brdf_print(), brdf_render(), bu_struct_parse(), camo_print(), camo_render(), ckr_print(), cloud_print(), cook_print(), fbm_print(), fbm_render(), fbm_setup(), fire_print(), fire_setup(), flat_print(), flat_render(), flat_setup(), fractal_render(), gauss_print(), gauss_render(), gauss_setup(), grass_print(), grass_render(), grass_setup(), light_print(), marble_render(), noise_print(), noise_setup(), osl_print(), osl_render(), osl_setup(), phong_print(), phong_render(), points_print(), prj_print(), rt_ebm_import4(), rt_ebm_import5(), rt_vol_import4(), rt_vol_import5(), rtrans_print(), rtrans_render(), rtrans_setup(), scloud_print(), scloud_setup(), setup(), spm_print(), stxt_print(), tcl_print(), tcl_render(), tcl_setup(), temp_print(), toon_print(), toon_render(), toon_setup(), toyota_print(), txt_print(), txt_setup(), wood_print(), xxx_print(), xxx_render(), and xxx_setup().

Here is the call graph for this function:

int bu_struct_export ( struct bu_external ext,
const void *  base,
const struct bu_structparse imp 
)

struct elements to machine-independent binary.

copies ext data to base

Definition at line 120 of file parse.c.

References BU_ASSERT, bu_cv_htond(), bu_cv_htonf(), BU_EXTERNAL_INIT, bu_free(), bu_log(), bu_malloc(), CKMEM, bu_external::ext_buf, bu_external::ext_nbytes, PARSE_INIT_GETPUT_1, PARSE_INIT_GETPUT_2, s, bu_structparse::sp_count, bu_structparse::sp_fmt, bu_structparse::sp_offset, and UNLIKELY.

Referenced by dl_polybinout().

Here is the call graph for this function:

int bu_struct_import ( void *  base,
const struct bu_structparse imp,
const struct bu_external ext,
void *  data 
)

machine-independent binary to struct elements.

copies ext data to base

Definition at line 295 of file parse.c.

References BU_ASSERT, BU_ASSERT_LONG, bu_cv_ntohd(), bu_cv_ntohf(), bu_log(), bu_external::ext_buf, PARSE_CK_GETPUT, bu_structparse::sp_count, bu_structparse::sp_fmt, bu_structparse::sp_hook, bu_structparse::sp_name, bu_structparse::sp_offset, and UNLIKELY.

Here is the call graph for this function:

size_t bu_struct_put ( FILE *  fp,
const struct bu_external ext 
)

Put a structure in external form to a stdio file. All formatting must have been accomplished previously.

Returns number of bytes written. On error, a short byte count (or zero) is returned. Use feof(3) or ferror(3) to determine which errors occur.

Definition at line 457 of file parse.c.

References bu_external::ext_buf, bu_external::ext_nbytes, PARSE_CK_GETPUT, and UNLIKELY.

Referenced by dl_polybinout().

size_t bu_struct_get ( struct bu_external ext,
FILE *  fp 
)

Obtain the next structure in external form from a stdio file.

Returns number of bytes read into the bu_external. On error, zero is returned.

Definition at line 469 of file parse.c.

References bu_bomb(), BU_EXTERNAL_INIT, bu_free(), bu_identify_magic(), bu_log(), bu_malloc(), bu_realloc(), BU_SEM_SYSCALL, bu_semaphore_acquire(), bu_semaphore_release(), bu_external::ext_buf, bu_external::ext_nbytes, PARSE_MAGIC_1, PARSE_MAGIC_2, and UNLIKELY.

Here is the call graph for this function:

void bu_struct_wrap_buf ( struct bu_external ext,
void *  buf 
)

Given a buffer with an external representation of a structure (e.g. the ext_buf portion of the output from bu_struct_export), check it for damage in shipment, and if it's OK, wrap it up in an bu_external structure, suitable for passing to bu_struct_import().

Definition at line 542 of file parse.c.

References bu_bomb(), BU_EXTERNAL_INIT, bu_identify_magic(), bu_log(), bu_external::ext_buf, bu_external::ext_nbytes, PARSE_MAGIC_1, PARSE_MAGIC_2, and UNLIKELY.

Here is the call graph for this function:

void bu_vls_struct_print ( struct bu_vls vls,
const struct bu_structparse sdp,
const char *  base 
)

This differs from bu_struct_print in that this output is less readable by humans, but easier to parse with the computer.

Referenced by rt_constraint_export5(), rt_dsp_export4(), rt_dsp_import4(), rt_ebm_export4(), rt_ebm_export5(), rt_hf_describe(), rt_hf_export4(), rt_submodel_export4(), rt_submodel_export5(), rt_vol_export4(), and rt_vol_export5().

void bu_vls_struct_print2 ( struct bu_vls vls,
const char *  title,
const struct bu_structparse sdp,
const char *  base 
)

This differs from bu_struct_print in that it prints to a vls.

Definition at line 1606 of file parse.c.

References BU_ASSERT, bu_log(), bu_log_indent_delta(), bu_log_indent_vls(), bu_vls_addr(), bu_vls_printf(), COMMA, delta, parse_vls_dmatprint(), parse_vls_matprint(), bu_structparse::sp_count, bu_structparse::sp_fmt, bu_structparse::sp_name, bu_structparse::sp_offset, UNLIKELY, bu_vls::vls_len, bu_vls::vls_magic, bu_vls::vls_max, and bu_vls::vls_offset.

Here is the call graph for this function:

void bu_vls_struct_item ( struct bu_vls vp,
const struct bu_structparse sdp,
const char *  base,
int  sep_char 
)

Convert a structure element (indicated by sdp) to its ASCII representation in a VLS.

Definition at line 1097 of file parse.c.

References BU_ASSERT, bu_log(), bu_vls_printf(), bu_vls_vlscat(), bu_structparse::sp_count, bu_structparse::sp_fmt, bu_structparse::sp_name, bu_structparse::sp_offset, and UNLIKELY.

Referenced by bu_vls_struct_item_named(), rt_dsp_get(), and rt_generic_get().

Here is the call graph for this function:

int bu_vls_struct_item_named ( struct bu_vls vp,
const struct bu_structparse sdp,
const char *  name,
const char *  base,
int  sep_char 
)

Convert a structure element called "name" to an ASCII representation in a VLS.

Definition at line 1203 of file parse.c.

References BU_STR_EQUAL, bu_vls_struct_item(), bu_structparse::sp_name, and UNLIKELY.

Referenced by rt_dsp_get(), and rt_generic_get().

Here is the call graph for this function:

void bu_parse_mm ( const struct bu_structparse sdp,
const char *  name,
char *  base,
const char *  value 
)

This allows us to specify the "size" parameter as values like ".5m" or "27in" rather than using mm all the time.

Definition at line 1794 of file parse.c.

References bu_mm_value(), bu_structparse::sp_offset, and UNLIKELY.

Here is the call graph for this function:

int bu_key_eq_to_key_val ( const char *  in,
const char **  next,
struct bu_vls vls 
)

Definition at line 1821 of file parse.c.

References BU_CK_VLS, bu_vls_putc(), bu_vls_strcat(), bu_vls_strncat(), STATE_IN_KEYWORD, STATE_IN_QUOTED_VALUE, STATE_IN_VALUE, and UNLIKELY.

Referenced by bu_shader_to_list().

Here is the call graph for this function:

int bu_shader_to_list ( const char *  in,
struct bu_vls vls 
)

Take an old v4 shader specification of the form

shadername arg1=value1 arg2=value2 color=1/2/3

and convert it into the v5 {} list form

shadername {arg1 value1 arg2 value2 color 1/2/3}

Note – the input string is smashed with nulls.

Note – the v5 version is used everywhere internally, and in v5 databases.

Returns
1 error
0 OK

Definition at line 1933 of file parse.c.

References BU_CK_VLS, BU_FLSTR, bu_free(), bu_key_eq_to_key_val(), bu_strdup, bu_strncasecmp(), bu_vls_putc(), bu_vls_strcat(), bu_vls_strlen(), bu_vls_strncat(), bu_vls_trunc(), OSL::Strings::shader, and UNLIKELY.

Referenced by ged_mater(), mk_comb(), and rt_comb_import4().

Here is the call graph for this function:

int bu_shader_to_key_eq ( const char *  in,
struct bu_vls vls 
)

Definition at line 2279 of file parse.c.

References BU_CK_VLS, bu_free(), bu_log(), BU_STR_EQUAL, bu_vls_putc(), bu_vls_strcat(), bu_vls_strlen(), parse_key_val_to_vls(), parse_list_elem(), parse_list_length(), OSL::Strings::shader, and UNLIKELY.

Referenced by db_apply_state_from_comb(), and rt_comb_export4().

Here is the call graph for this function:

int bu_fwrite_external ( FILE *  fp,
const struct bu_external ep 
)

Take a block of memory, and write it into a file.

Caller is responsible for freeing memory of external representation, using bu_free_external().

Returns
<0 error
0 OK

Definition at line 2368 of file parse.c.

References BU_CK_EXTERNAL, bu_log(), bu_external::ext_buf, bu_external::ext_nbytes, and UNLIKELY.

Referenced by db5_fwrite_ident(), and db_fwrite_external().

Here is the call graph for this function:

void bu_hexdump_external ( FILE *  fp,
const struct bu_external ep,
const char *  str 
)

Definition at line 2390 of file parse.c.

References BU_CK_EXTERNAL, bu_log(), bu_external::ext_buf, bu_external::ext_nbytes, and UNLIKELY.

Here is the call graph for this function:

void bu_copy_external ( struct bu_external op,
const struct bu_external ip 
)

Definition at line 2454 of file parse.c.

References BU_CK_EXTERNAL, BU_EXTERNAL_INIT, bu_malloc(), bu_external::ext_buf, bu_external::ext_nbytes, and UNLIKELY.

Here is the call graph for this function:

char* bu_next_token ( char *  str)

Advance pointer through string over current token, across white space, to beginning of next token.

Definition at line 2469 of file parse.c.

Referenced by rt_bot_adjust(), and rt_pipe_adjust().

void bu_structparse_get_terse_form ( struct bu_vls logstr,
const struct bu_structparse sp 
)

Definition at line 2483 of file parse.c.

References BU_STR_EQUAL, bu_vls_free(), BU_VLS_INIT_ZERO, bu_vls_printf(), bu_structparse::sp_count, bu_structparse::sp_fmt, bu_structparse::sp_name, and UNLIKELY.

Referenced by rt_generic_form().

Here is the call graph for this function:

int bu_structparse_argv ( struct bu_vls str,
int  argc,
const char **  argv,
const struct bu_structparse desc,
char *  base,
void *  data 
)

Support routine for db adjust and db put. Much like the bu_struct_parse routine which takes its input as a bu_vls. This routine, however, takes the arguments as lists, a more Tcl-friendly method. There is a log vls for storing messages.

Operates on argv[0] and argv[1], then on argv[2] and argv[3], ...

Parameters
str- vls for dumping info that might have gone to bu_log
argc- number of elements in argv
argv- contains the keyword-value pairs
desc- structure description
base- base addr of users struct
data- user data to be passed to the sp_hook function
Return values
BRLCAD_OKif successful,
BRLCAD_ERRORon failure

Definition at line 2522 of file parse.c.

References BRLCAD_ERROR, BRLCAD_OK, BU_ASSERT, bu_log(), BU_SP_SKIP_SEP, BU_STR_EQUAL, bu_vls_addr(), bu_vls_free(), BU_VLS_INIT_ZERO, bu_vls_printf(), bu_vls_strcpy(), bu_vls_trunc(), bu_structparse::sp_count, bu_structparse::sp_fmt, bu_structparse::sp_hook, bu_structparse::sp_name, bu_structparse::sp_offset, and UNLIKELY.

Referenced by rt_dsp_adjust(), and rt_generic_adjust().

Here is the call graph for this function:

int bu_str_true ( const char *  str)

Returns truthfully if a given input string represents an "affirmative string".

Input values that are null, empty, begin with the letter 'n', or are 0-valued return as false. Any other input value returns as true. Strings that strongly indicate true return as 1, other values still return as true but may be a value greater than 1.

Definition at line 32 of file booleanize.c.

References BU_STR_EQUAL, bu_vls_addr(), bu_vls_free(), BU_VLS_INIT_ZERO, bu_vls_strcpy(), and bu_vls_trimspace().

Referenced by attr_add(), automatic_test(), bu_str_false(), db5_sync_attr_to_comb(), ged_make(), ged_mater(), and rt_db_flip_endian().

Here is the call graph for this function:

int bu_str_false ( const char *  str)

Returns truthfully if a given input string represents a "negative string".

Input values that are null, empty, begin with the letter 'n', or are 0-valued return as true. Any other input value returns as false.

Definition at line 113 of file booleanize.c.

References bu_str_true().

Here is the call graph for this function: