BRL-CAD
Collaboration diagram for Logging:

Files

file  backtrace.c
 
file  bomb.c
 
file  crashreport.c
 
file  fgets.c
 
file  linebuf.c
 
file  hook.c
 BRL-CAD support library's hook utility.
 
file  log.c
 parallel safe version of fprintf for logging
 
file  sscanf.c
 
file  scan.c
 
file  dirname.c
 Routines to process file and path names.
 
file  basename.c
 
file  lex.c
 
file  mread.c
 

Data Structures

struct  bu_hook_list
 
struct  bu_lex_t_int
 
struct  bu_lex_t_dbl
 
struct  bu_lex_t_key
 
struct  bu_lex_t_id
 
union  bu_lex_token
 
struct  bu_lex_key
 

Macros

#define BU_HOOK_LIST_NULL   ((struct bu_hook_list *) 0)
 
#define BU_CK_HOOK_LIST(_hl)   BU_CKMAG(_hl, BU_HOOK_LIST_MAGIC, "bu_hook_list")
 
#define BU_HOOK_LIST_INIT(_hl)
 
#define BU_HOOK_LIST_INIT_ZERO   { {BU_HOOK_LIST_MAGIC, BU_LIST_NULL, BU_LIST_NULL}, NULL, NULL }
 
#define BU_HOOK_LIST_IS_INITIALIZED(_p)   (((struct bu_hook_list *)(_p) != BU_HOOK_LIST_NULL) && LIKELY((_p)->l.magic == BU_HOOK_LIST_MAGIC))
 
#define BU_LEX_ANY   0 /* pseudo type */
 
#define BU_LEX_INT   1
 
#define BU_LEX_DOUBLE   2
 
#define BU_LEX_SYMBOL   3
 
#define BU_LEX_KEYWORD   4
 
#define BU_LEX_IDENT   5
 
#define BU_LEX_NUMBER   6 /* Pseudo type */
 
#define BU_LEX_NEED_MORE   0
 

Typedefs

typedef int(* bu_hook_t) (void *, void *)
 
typedef struct bu_hook_list bu_hook_list_t
 

Functions

int bu_backtrace (FILE *fp)
 
void bu_bomb_add_hook (bu_hook_t func, void *clientdata)
 
void bu_bomb (const char *str) _BU_ATTR_NORETURN
 
void bu_exit (int status, const char *fmt,...) _BU_ATTR_NORETURN _BU_ATTR_PRINTF23
 
int bu_crashreport (const char *filename)
 
char * bu_fgets (char *s, int size, FILE *stream)
 
void bu_setlinebuf (FILE *fp)
 
void bu_hook_list_init (struct bu_hook_list *hlp)
 
void bu_hook_add (struct bu_hook_list *hlp, bu_hook_t func, void *clientdata)
 
void bu_hook_delete (struct bu_hook_list *hlp, bu_hook_t func, void *clientdata)
 
void bu_hook_call (struct bu_hook_list *hlp, void *buf)
 
void bu_hook_save_all (struct bu_hook_list *hlp, struct bu_hook_list *save_hlp)
 
void bu_hook_delete_all (struct bu_hook_list *hlp)
 
void bu_hook_restore_all (struct bu_hook_list *hlp, struct bu_hook_list *restore_hlp)
 
void bu_log_indent_delta (int delta)
 
void bu_log_indent_vls (struct bu_vls *v)
 
void bu_log_add_hook (bu_hook_t func, void *clientdata)
 
void bu_log_delete_hook (bu_hook_t func, void *clientdata)
 
void bu_log_hook_save_all (struct bu_hook_list *save_hlp)
 
void bu_log_hook_delete_all (void)
 
void bu_log_hook_restore_all (struct bu_hook_list *restore_hlp)
 
void bu_putchar (int c)
 
void bu_log (const char *,...) _BU_ATTR_PRINTF12
 
void bu_flog (FILE *, const char *,...) _BU_ATTR_PRINTF23
 
int bu_vsscanf (const char *src, const char *fmt, va_list ap)
 
int bu_sscanf (const char *src, const char *fmt,...) _BU_ATTR_SCANF23
 
int bu_scan_fastf_t (int *c, const char *src, const char *delim, int n,...)
 
char * bu_dirname (const char *path)
 
void bu_basename (char *basename, const char *path)
 
int bu_lex (union bu_lex_token *token, struct bu_vls *rtstr, struct bu_lex_key *keywords, struct bu_lex_key *symbols)
 
long int bu_mread (int fd, void *bufp, long int n)
 

Detailed Description

Macro Definition Documentation

#define BU_HOOK_LIST_NULL   ((struct bu_hook_list *) 0)

Definition at line 76 of file log.h.

#define BU_CK_HOOK_LIST (   _hl)    BU_CKMAG(_hl, BU_HOOK_LIST_MAGIC, "bu_hook_list")

assert the integrity of a non-head node bu_hook_list struct.

Definition at line 81 of file log.h.

#define BU_HOOK_LIST_INIT (   _hl)
Value:
{ \
(_hl)->hookfunc = (_hl)->clientdata = NULL; \
}
#define BU_HOOK_LIST_MAGIC
Definition: magic.h:54
#define BU_LIST_INIT_MAGIC(_hp, _magic)
Definition: list.h:156

initialize a bu_hook_list struct without allocating any memory. this macro is not suitable for initialization of a list head node.

Definition at line 87 of file log.h.

#define BU_HOOK_LIST_INIT_ZERO   { {BU_HOOK_LIST_MAGIC, BU_LIST_NULL, BU_LIST_NULL}, NULL, NULL }

macro suitable for declaration statement initialization of a bu_hook_list struct. does not allocate memory. not suitable for initialization of a list head node.

Definition at line 97 of file log.h.

#define BU_HOOK_LIST_IS_INITIALIZED (   _p)    (((struct bu_hook_list *)(_p) != BU_HOOK_LIST_NULL) && LIKELY((_p)->l.magic == BU_HOOK_LIST_MAGIC))

returns truthfully whether a non-head node bu_hook_list has been initialized via BU_HOOK_LIST_INIT() or BU_HOOK_LIST_INIT_ZERO.

Definition at line 103 of file log.h.

#define BU_LEX_ANY   0 /* pseudo type */

Definition at line 495 of file log.h.

#define BU_LEX_INT   1

Definition at line 500 of file log.h.

Referenced by bu_lex(), and get_token().

#define BU_LEX_DOUBLE   2

Definition at line 505 of file log.h.

Referenced by bu_lex(), and get_token().

#define BU_LEX_SYMBOL   3

Definition at line 510 of file log.h.

Referenced by bu_lex(), and get_token().

#define BU_LEX_KEYWORD   4

Definition at line 511 of file log.h.

Referenced by bu_lex(), and get_token().

#define BU_LEX_IDENT   5

Definition at line 516 of file log.h.

Referenced by bu_lex(), and get_token().

#define BU_LEX_NUMBER   6 /* Pseudo type */

Definition at line 517 of file log.h.

#define BU_LEX_NEED_MORE   0

Definition at line 529 of file log.h.

Referenced by bu_lex().

Typedef Documentation

typedef int(* bu_hook_t) (void *, void *)

log indentation hook

Definition at line 68 of file log.h.

typedef struct bu_hook_list bu_hook_list_t

Definition at line 75 of file log.h.

Function Documentation

int bu_backtrace ( FILE *  fp)

this routine provides a trace of the call stack to the caller, generally called either directly, via a signal handler, or through bu_bomb() with the appropriate bu_debug flags set.

the routine waits indefinitely (in a spin loop) until a signal (SIGINT) is received, at which point execution continues, or until some other signal is received that terminates the application.

the stack backtrace will be written to the provided 'fp' file pointer. it's the caller's responsibility to open and close that pointer if necessary. If 'fp' is NULL, stdout will be used.

returns truthfully if a backtrace was attempted.

Definition at line 300 of file backtrace.c.

References backtrace(), backtrace_sigint(), BT_BUFSIZE, bu_argv0_full_path(), bu_debug, BU_DEBUG_BACKTRACE, bu_free(), bu_log(), bu_process_id(), bu_strdup, bu_whereis(), bu_which(), and UNLIKELY.

Referenced by bu_crashreport().

Here is the call graph for this function:

void bu_bomb_add_hook ( bu_hook_t  func,
void *  clientdata 
)

Adds a hook to the list of bu_bomb hooks. The top (newest) one of these will be called with its associated client data and a string to be processed. Typically, these hook functions will display the output (possibly in an X window) or record it.

NOTE: The hook functions are all non-PARALLEL.

Definition at line 84 of file bomb.c.

References bu_hook_add().

Referenced by main().

Here is the call graph for this function:

void bu_bomb ( const char *  str)

Abort the running process.

The bu_bomb routine is called on a fatal error, generally where no recovery is possible. Error handlers may, however, be registered with BU_SETJUMP(). This routine intentionally limits calls to other functions and intentionally uses no stack variables. Just in case the application is out of memory, bu_bomb deallocates a small buffer of memory.

Before termination, it optionally performs the following operations in the order listed:

  1. Outputs str to standard error
  2. Calls any callback functions set in the global bu_bomb_hook_list variable with str passed as an argument.
  3. Jumps to any user specified error handler registered with the BU_SETJUMP() facility.
  4. Outputs str to the terminal device in case standard error is redirected.
  5. Aborts abnormally (via abort()) if BU_DEBUG_COREDUMP is defined.
  6. Exits with exit(12).

Only produce a core-dump when that debugging bit is set. Note that this function is meant to be a last resort semi-graceful abort.

This routine should never return unless there is a BU_SETJUMP() handler registered.

Definition at line 91 of file bomb.c.

References bu_crashreport(), bu_debug, BU_DEBUG_COREDUMP, bu_file_exists(), bu_getprogname(), bu_hook_call(), bu_jmpbuf, BU_LIST_NON_EMPTY, bu_parallel_id(), bu_process_id(), BU_SEM_MAPPEDFILE, BU_SEM_SYSCALL, bu_semaphore_acquire(), bu_semaphore_release(), bu_setjmp_valid, bu_hook_list::l, LIKELY, and UNLIKELY.

Referenced by _db_recurse_subtree(), _db_walk_subtree(), _rt_tree_region_assign(), absorp_coeff(), add_seg(), Add_vert(), Add_vert_and_norm(), air_setup(), alloc(), are_equal(), atmos_irradiance(), background_light(), bangbang(), bbd_render(), bbd_setup(), bmp_render(), bn_2line3_colinear(), bn_angle_measure(), bn_ck_table(), bn_coplanar(), bn_dist_line3_line3(), bn_distsq_line3_line3(), bn_distsq_pt3_lseg3_v2(), bn_gauss_init(), bn_isect_line2_lseg2(), bn_isect_line3_line3(), bn_isect_line_lseg(), bn_isect_lseg3_lseg3(), bn_mat_ck(), bn_mat_inv(), bn_randmt_state_deserialize(), bn_randmt_state_serialize(), bn_tabdata_add(), bn_tabdata_blend2(), bn_tabdata_blend3(), bn_tabdata_copy(), bn_tabdata_freq_shift(), bn_tabdata_incr_mul2_scale(), bn_tabdata_incr_mul3_scale(), bn_tabdata_join1(), bn_tabdata_join2(), bn_tabdata_mul(), bn_tabdata_mul3(), bn_tabdata_scale(), bn_table_delete_sample_pts(), bn_table_lin_interp(), bn_table_make_uniform(), bn_table_merge2(), bn_table_read(), bn_unif_init(), bot2soup(), bu_argv_from_string(), bu_avail_cpus(), bu_badmagic(), bu_bitv_and(), bu_bitv_or(), bu_ck_list(), bu_ck_list_magic(), bu_ck_malloc_ptr(), bu_cv_htond(), bu_cv_htonf(), bu_cv_ntohd(), bu_cv_ntohf(), bu_exit(), bu_flog(), bu_heap_get(), bu_hsv_to_rgb(), bu_lex(), bu_log(), bu_mem_barriercheck(), bu_prmem(), bu_putchar(), bu_rb_delete(), bu_realloc(), bu_semaphore_acquire(), bu_semaphore_init(), bu_semaphore_release(), bu_str_escape(), bu_str_unescape(), bu_struct_get(), bu_struct_wrap_buf(), bu_vls_addr(), bu_vls_fwrite(), bu_vls_init(), bu_vls_init_if_uninit(), bu_vls_struct_print(), bu_vls_vprintf(), bu_vls_write(), bu_vsscanf(), build_etree(), bwtxt_render(), check_bbpt_hit_elev(), combmem_get(), cut_unimonotone(), db5_decode_length(), db5_decode_signed(), db5_encode_length(), db5_export_object3(), db_add_anim(), db_apply_state_from_one_member(), db_ck_left_heavy_tree(), db_ck_tree(), db_ck_v4gift_tree(), db_count_subtree_regions(), db_count_tree_nodes(), db_delete(), db_dup_path_tail(), db_dup_subtree(), db_find_named_leaf(), db_find_named_leafs_parent(), db_flatten_tree(), db_follow_path(), db_free_tree(), db_fullpath_list_subtree(), db_functree_subtree(), db_is_tree_all_unions(), db_path_to_mat(), db_put_external(), db_read(), db_tally_subtree_regions(), db_traverse_subtree(), db_tree_counter(), db_tree_del_lhs(), db_tree_del_rhs(), db_tree_describe(), db_tree_flatten_describe(), db_tree_funcleaf(), db_tree_list(), db_tree_mul_dbleaf(), db_tree_nleaves(), db_zapper(), dimen_hook(), do_grid(), do_region_end1(), draw_dsp_bb(), dup_bot(), edge_hit_ray_state(), evaluate(), ext_setup(), fill_out_bsp(), find_spec_wgt(), free_soup(), gauss_setup(), gcv_execute(), ged_put_comb(), get_file_data(), get_obj_data(), get_pole_dist_to_face(), grass_setup(), hist_pr_suppress(), img_load_datasource(), brlcad::initialBBox(), insert_above(), insert_in_bsp(), isect_ray_dsp_bb(), isect_ray_edgeuse(), isect_ray_planar_face(), isect_ray_snurb_face(), isect_ray_triangle(), lambda_to_rgb(), linear_pipe_shot(), main(), make_hole_in_prepped_regions(), memdebug_add(), memdebug_check(), mk_metaball(), mk_tree_pure(), new_image(), nmg_2lu_identical(), nmg_assess_eu(), nmg_assess_vu(), nmg_assoc_void_shells(), nmg_boolean(), nmg_booltree_evaluate(), nmg_break_all_es_on_v(), nmg_break_eg_on_v(), nmg_check_radial(), nmg_check_radial_angles(), nmg_ck_e(), nmg_ck_eu(), nmg_ck_f(), nmg_ck_face_worthless_edges(), nmg_ck_fg(), nmg_ck_fu(), nmg_ck_fu_verts(), nmg_ck_hitmiss_list(), nmg_ck_l(), nmg_ck_lu(), nmg_ck_lu_orientation(), nmg_ck_lueu(), nmg_ck_v_in_2fus(), nmg_ck_vu(), nmg_ck_vu_ptbl(), nmg_class_pt_euvu(), nmg_class_pt_fu_except(), nmg_class_pt_lu_except(), nmg_class_pt_s(), nmg_classify_lu_lu(), nmg_classify_lu_lu_new(), nmg_classify_pt_loop_new(), nmg_close_shell(), nmg_cnurb_is_on_crv(), nmg_cnurb_lseg_coincident(), nmg_common_v_2eg(), nmg_crackshells(), nmg_cut_lu_into_coplanar_and_non(), nmg_decompose_shell(), nmg_demote_eu(), nmg_demote_lu(), nmg_do_bool(), nmg_dump_model(), nmg_dup_shell(), nmg_edge_collapse(), nmg_edge_fuse(), nmg_edge_g(), nmg_edge_g_cnurb(), nmg_edge_g_cnurb_plinear(), nmg_edgeuse_with_eg_tabulate(), nmg_enlist_one_vu(), nmg_enlist_vu(), nmg_eu_2s_orient_bad(), nmg_eu_2vecs_perp(), nmg_eval_shell(), nmg_evaluate_boolean(), nmg_extrude_cleanup(), nmg_extrude_face(), nmg_face_coincident_vu_sort(), nmg_face_cutjoin(), nmg_face_g_snurb(), nmg_face_rs_init(), nmg_face_state_transition(), nmg_fcut_face(), nmg_find_e(), nmg_find_edge_between_2fu(), nmg_find_eg_between_2fg(), nmg_find_eu_in_face(), nmg_find_eu_leftvec(), nmg_find_eu_with_vu_in_lu(), nmg_find_first_last_use_of_v_in_fu(), nmg_find_fu_of_lu(), nmg_find_model(), nmg_find_outer_and_void_shells(), nmg_find_pt_in_lu(), nmg_find_radial_eu(), nmg_find_s_of_eu(), nmg_find_s_of_lu(), nmg_find_shell(), nmg_find_v_in_shell(), nmg_findeu(), nmg_fix_decomposed_shell_normals(), nmg_fix_overlapping_loops(), nmg_flatten_face(), nmg_get_edge_lines(), nmg_hollow_shell(), nmg_is_crack_outie(), nmg_is_edge_in_looplist(), nmg_is_vertex_in_looplist(), nmg_isect2d_prep(), nmg_isect_2faceuse(), nmg_isect_edge2p_edge2p(), nmg_isect_eu_fu(), nmg_isect_line2_edge2p(), nmg_isect_line2_face2pNEW(), nmg_isect_potcut_fu(), nmg_isect_two_generic_faces(), nmg_je(), nmg_jeg(), nmg_keu(), nmg_keu_zl(), nmg_kfu(), nmg_kill_cracks(), nmg_klu(), nmg_kvu(), nmg_loop_g(), nmg_make_connect_faces(), nmg_make_faces_at_vert(), nmg_make_faces_within_tol(), nmg_mc_realize_cube(), nmg_meonvu(), nmg_mf(), nmg_ml(), nmg_mlv(), nmg_move_lu_between_fus(), nmg_mv_shell_to_region(), nmg_next_radial_eu(), nmg_pl_isect(), nmg_plot_open_edges(), nmg_plot_ray_face(), nmg_polytonmg(), nmg_pr_fg(), nmg_pr_ptbl_vert_list(), nmg_prev_radial_eu(), nmg_propagate_normals(), nmg_radial_build_list(), nmg_radial_find_an_original(), nmg_radial_join_eu(), nmg_radial_join_eu_NEW(), nmg_radial_mark_cracks(), nmg_radial_mark_flips(), nmg_radial_verify_monotone(), nmg_radial_verify_pointers(), nmg_reclassify_lu_eu(), nmg_region_v_unique(), nmg_repair_v_near_v(), nmg_rt_isect_plfu(), nmg_sanitize_fu(), nmg_search_v_eg(), nmg_shell_a(), nmg_shell_manifolds(), nmg_simplify_inter(), nmg_snurb_calc_lu_uv_orient(), nmg_snurb_fu_eval(), nmg_snurb_fu_get_norm(), nmg_snurb_fu_get_norm_at_vu(), nmg_snurb_is_planar(), nmg_split_trim(), nmg_to_arb(), nmg_translate_face(), nmg_tri_kill_accordions(), nmg_triangulate_fu(), nmg_triangulate_rm_degen_loopuse(), nmg_triangulate_rm_holes(), nmg_triangulate_shell(), nmg_use_edge_g(), nmg_uv_in_lu(), nmg_vedge(), nmg_vertex_fuse(), nmg_vertexuse_a_cnurb(), nmg_vertexuse_nv(), nmg_veu(), nmg_vface(), nmg_vfg(), nmg_vfu(), nmg_visit(), nmg_vlg(), nmg_vloop(), nmg_vlu(), nmg_vregion(), nmg_vsshell(), nmg_vvertex(), nmg_vvu(), obj_contents_destroy(), obj_fparse(), obj_groups(), obj_groupset(), obj_materiallibs(), obj_materiallibset(), obj_materials(), obj_normals(), obj_num_groupsets(), obj_num_materiallibsets(), obj_num_texmaplibsets(), obj_objects(), obj_parse(), obj_parse_error(), obj_parser_create(), obj_parser_destroy(), obj_polygonal_attributes(), obj_polygonal_nv_face_vertices(), obj_polygonal_nv_faces(), obj_polygonal_tnv_face_vertices(), obj_polygonal_tnv_faces(), obj_polygonal_tv_face_vertices(), obj_polygonal_tv_faces(), obj_polygonal_tv_line_vertices(), obj_polygonal_tv_lines(), obj_polygonal_v_face_vertices(), obj_polygonal_v_faces(), obj_polygonal_v_line_vertices(), obj_polygonal_v_lines(), obj_polygonal_v_point_vertices(), obj_polygonal_v_points(), obj_shadow_objs(), obj_texmaplibs(), obj_texmaplibset(), obj_texmaps(), obj_texture_coord(), obj_trace_objs(), obj_vertices(), ozone_absorption(), parse_struct_lookup(), permute_cell(), persp_hook(), phong_render(), pick_edges(), pick_eu(), pl_ray(), pleu(), print_loopuse_tree(), ptbl_vsort(), rb_walk(), record_face_hit(), reindex(), remove_from_bsp(), rr_render(), rt_advance_to_next_cell(), rt_arb_std_type(), rt_ars_class(), rt_ars_free(), rt_binunif_export5(), rt_binunif_import5_minor_type(), rt_boolweave(), rt_bot_condense(), rt_bot_face_fuse(), rt_bot_vertex_fuse(), rt_cell_n_on_ray(), rt_ck_vlist(), rt_cline_norm(), rt_cnurb_par_edge(), rt_comb_export4(), rt_comb_export5(), rt_comb_v5_serialize(), rt_constraint_export5(), rt_copy_curve(), rt_cut_it(), rt_dsp_norm(), rt_dsp_shot(), rt_dspline_n(), rt_ell_norms(), rt_extrude_norm(), rt_extrude_shot(), rt_free_soltab(), rt_get_region_seglist_for_partition(), rt_get_solidbitv(), rt_gettrees_muves(), rt_grp_curve(), rt_grp_import4(), rt_grp_import5(), rt_grp_norm(), rt_grp_uv(), rt_hf_shot(), rt_join_cnurbs(), rt_joint_curve(), rt_joint_import5(), rt_joint_norm(), rt_joint_uv(), rt_memget(), rt_memget_nosplit(), rt_metaball_describe(), rt_metaball_export5(), rt_metaball_point_value_metaball(), rt_nmg_ialloc(), rt_nmg_idisk(), rt_nmg_import4_fastf(), rt_nmg_magic_to_kind(), rt_nmg_shot(), rt_nugrid_cut(), rt_nurb_c_eval(), rt_nurb_free(), rt_nurb_kvmult(), rt_nurb_s_eval(), rt_partition_len(), rt_plot_cell(), rt_pr_cut_info(), rt_pr_soltab(), rt_shader_mat(), rt_shoot_many_rays_worker(), rt_shootray(), rt_shootray_bundle(), rt_sketch_describe(), rt_sketch_export4(), rt_sketch_export5(), rt_sketch_import4(), rt_sketch_import5(), rt_spect_make_CIE_XYZ(), rt_tgc_tess(), rt_tree_max_raynum(), rt_tree_test_ready(), rt_vshootray(), rt_weave0seg(), run_client(), run_server(), scloud_setup(), soup_rm_face(), spectral_dist_table(), split_face_single(), swap_cell_pts(), tesselate_pipe_bend(), tesselate_pipe_start(), toyota_setup(), tp_3axis(), tthrm_render(), tthrm_setup(), txt_load_datasource(), txt_render(), validate_tbl2d(), vertex_neighborhood(), and wray().

Here is the call graph for this function:

void bu_exit ( int  status,
const char *  fmt,
  ... 
)

Semi-graceful termination of the application that doesn't cause a stack trace, exiting with the specified status after printing the given message. It's okay for this routine to use the stack, contrary to bu_bomb's behavior since it should be called for expected termination situations.

This routine should generally not be called within a library. Use bu_bomb or (better) cascade the error back up to the application.

This routine should never return.

Definition at line 195 of file bomb.c.

References bu_bomb(), BU_SETJUMP, BU_UNSETJUMP, bu_vls_addr(), bu_vls_free(), BU_VLS_INIT_ZERO, bu_vls_vprintf(), and LIKELY.

Referenced by _ged_editit(), bu_binary_to_bitv2(), bu_get_urandom_number(), compare_bu_to_system_basename(), fb_read_fd(), gcv_convert(), gcv_stl_read(), get_args(), icv_create(), icv_rect(), icv_rot(), main(), obj_vlist(), read_args(), rt_bound_internal(), test_quat_bisect(), test_quat_distance(), test_quat_double(), test_quat_exp(), test_quat_log(), test_quat_make_nearest(), test_quat_mat2quat(), test_quat_quat2mat(), test_quat_sberp(), and test_quat_slerp().

Here is the call graph for this function:

int bu_crashreport ( const char *  filename)

this routine writes out details of the currently running process to the specified file, including an informational header about the execution environment, stack trace details, kernel and hardware information, and current version information.

returns truthfully if the crash report was written.

due to various reasons, this routine is NOT thread-safe.

Definition at line 44 of file crashreport.c.

References bu_argv0_full_path(), bu_backtrace(), bu_fgets(), bu_getprogname(), bu_log(), bu_parallel_id(), bu_process_id(), bu_which(), CR_BUFSIZE, memset(), time(), and UNLIKELY.

Referenced by bu_bomb().

Here is the call graph for this function:

char* bu_fgets ( char *  s,
int  size,
FILE *  stream 
)

Reads in at most one less than size characters from stream and stores them into the buffer pointed to by s. Reading stops after an EOF, CR, LF, or a CR/LF combination. If a LF or CR is read, it is stored into the buffer. If a CR/LF is read, just a CR is stored into the buffer. A '\0' is stored after the last character in the buffer. Returns s on success, and NULL on error or when end of file occurs while no characters have been read.

Definition at line 31 of file fgets.c.

References s, and UNLIKELY.

Referenced by bn_read_table_and_tabdata(), bu_avail_cpus(), bu_crashreport(), bu_vls_gets(), ged_edcodes(), ged_nirt(), ged_rcodes(), ged_rmater(), getText(), main(), move_all_file(), points_setup(), ppm_read(), and verbIn().

void bu_setlinebuf ( FILE *  fp)

Definition at line 44 of file linebuf.c.

References BUFSIZE, and UNLIKELY.

Referenced by bu_log(), and port_setlinebuf().

void bu_hook_list_init ( struct bu_hook_list hlp)

Definition at line 30 of file hook.c.

References BU_LIST_INIT, bu_hook_list::clientdata, bu_hook_list::hookfunc, and bu_hook_list::l.

void bu_hook_add ( struct bu_hook_list hlp,
bu_hook_t  func,
void *  clientdata 
)
void bu_hook_delete ( struct bu_hook_list hlp,
bu_hook_t  func,
void *  clientdata 
)
void bu_hook_call ( struct bu_hook_list hlp,
void *  buf 
)

Definition at line 68 of file hook.c.

References BU_LIST_FOR, bu_hook_list::clientdata, bu_hook_list::hookfunc, bu_hook_list::l, and UNLIKELY.

Referenced by bu_bomb(), and log_call_hooks().

void bu_hook_save_all ( struct bu_hook_list hlp,
struct bu_hook_list save_hlp 
)

Definition at line 82 of file hook.c.

References BU_LIST_APPEND, BU_LIST_DEQUEUE, BU_LIST_WHILE, and bu_hook_list::l.

Referenced by bu_log_hook_save_all().

void bu_hook_delete_all ( struct bu_hook_list hlp)

Definition at line 96 of file hook.c.

References BU_LIST_DEQUEUE, BU_LIST_WHILE, BU_PUT, and bu_hook_list::l.

Referenced by bu_hook_restore_all(), and bu_log_hook_delete_all().

void bu_hook_restore_all ( struct bu_hook_list hlp,
struct bu_hook_list restore_hlp 
)

Definition at line 108 of file hook.c.

References bu_hook_delete_all(), BU_LIST_APPEND, BU_LIST_DEQUEUE, BU_LIST_WHILE, and bu_hook_list::l.

Referenced by bu_log_hook_restore_all().

Here is the call graph for this function:

void bu_log_indent_delta ( int  delta)

Change global indentation level by indicated number of characters. Call with a large negative number to cancel all indentation.

Definition at line 54 of file log.c.

Referenced by bu_struct_print(), bu_vls_struct_print2(), isect_ray_dsp_bb(), parse_dmatprint(), parse_matprint(), parse_vls_dmatprint(), parse_vls_matprint(), recurse_dsp_bb(), rt_cell_n_on_ray(), rt_pr_partitions(), rt_pr_pt_vls(), rt_shootray(), rt_shootray_bundle(), and rt_submodel_print().

void bu_log_indent_vls ( struct bu_vls v)

For multi-line vls generators, honor logindent level like bu_log() does, and prefix the proper number of spaces. Should be called at the front of each new line.

Definition at line 62 of file log.c.

References bu_vls_spaces().

Referenced by bu_vls_struct_print2(), parse_vls_dmatprint(), parse_vls_matprint(), rt_pr_hit_vls(), rt_pr_hitarray_vls(), rt_pr_partitions(), rt_pr_pt_vls(), and rt_pr_seg_vls().

Here is the call graph for this function:

void bu_log_add_hook ( bu_hook_t  func,
void *  clientdata 
)

Adds a hook to the list of bu_log hooks. The top (newest) one of these will be called with its associated client data and a string to be processed. Typically, these hook functions will display the output (possibly in an X window) or record it.

NOTE: The hook functions are all non-PARALLEL.

Definition at line 69 of file log.c.

References bu_hook_add().

Referenced by ged_log().

Here is the call graph for this function:

void bu_log_delete_hook ( bu_hook_t  func,
void *  clientdata 
)

Removes the hook matching the function and clientdata parameters from the hook list. Note that it is not necessarily the active (top) hook.

Definition at line 76 of file log.c.

References bu_hook_delete().

Referenced by ged_log().

Here is the call graph for this function:

void bu_log_hook_save_all ( struct bu_hook_list save_hlp)

Definition at line 92 of file log.c.

References bu_hook_save_all().

Here is the call graph for this function:

void bu_log_hook_delete_all ( void  )

Definition at line 99 of file log.c.

References bu_hook_delete_all().

Here is the call graph for this function:

void bu_log_hook_restore_all ( struct bu_hook_list restore_hlp)

Definition at line 106 of file log.c.

References bu_hook_restore_all().

Here is the call graph for this function:

void bu_putchar ( int  c)

Log a single character with no flushing.

Definition at line 139 of file log.c.

References bu_bomb(), BU_LIST_IS_EMPTY, bu_hook_list::l, LIKELY, log_call_hooks(), and UNLIKELY.

Here is the call graph for this function:

void bu_log ( const char *  ,
  ... 
)

The routine is primarily called to log library events.

The function is essentially a semaphore-protected version of fprintf(stderr) with optional logging hooks and automatic indentation options. The main difference is that this function does not keep track of characters printed, so nothing is returned.

This function recognizes a V format specifier to print a bu_vls struct pointer. See bu_vsscanf() for details.

Definition at line 176 of file log.c.

References bu_bomb(), BU_LIST_IS_EMPTY, BU_SEM_SYSCALL, bu_semaphore_acquire(), bu_semaphore_release(), bu_setlinebuf(), bu_vls_addr(), bu_vls_free(), BU_VLS_INIT_ZERO, bu_vls_strlen(), bu_vls_vprintf(), bu_hook_list::l, LIKELY, log_call_hooks(), log_do_indent_level(), and UNLIKELY.

Referenced by _db_recurse_subtree(), _db_walk_dispatcher(), _db_walk_subtree(), _ged_bot_dump(), _ged_delete_pipept(), _ged_dir_getspace(), _ged_drawtrees(), _ged_editit(), _ged_move_pipept(), _ged_open_dbip(), _ged_rt_output_handler(), _osgLoadSolid(), _rb_delete(), _rb_describe_node(), _rb_insert(), _rb_select(), _rt_check_overlap(), _rt_find_identical_solid(), _rt_gettree_leaf(), _rt_gettree_region_end(), _rt_tree_kill_dead_solid_refs(), above_squish(), Add_bot_face(), add_seg(), air_free(), air_mass(), air_render(), air_setup(), airtest_render(), allocate_per_region_data(), anim_dirn2mat(), append_solid_to_display_list(), ars_rd_curve(), Auto(), backtrace(), bbd_render(), bbd_setup(), below_squish(), bend_pipe_shot(), binterp(), bmp_render(), bn_2line3_colinear(), bn_3d_chull(), bn_between(), bn_ck_table(), bn_cx_div(), bn_dist_line3_line3(), bn_dist_line3_pt3(), bn_dist_pt2_along_line2(), bn_dist_pt2_lseg2(), bn_dist_pt3_line3(), bn_dist_pt3_lseg3(), bn_distsq_line3_pt3(), bn_hlf_class(), bn_htov_move(), bn_isect_line2_line2(), bn_isect_line2_lseg2(), bn_isect_line3_line3(), bn_isect_lseg2_lseg2(), bn_isect_lseg3_lseg3(), bn_isect_planes(), bn_isect_pt2_lseg2(), bn_mat_ck(), bn_mat_fromto(), bn_mat_inv(), bn_mat_lookat(), bn_mat_print(), bn_pr_poly(), bn_pr_roots(), bn_pr_tabdata(), bn_pr_table(), bn_print_table_and_tabdata(), bn_read_table_and_tabdata(), bn_spm_dump(), bn_spm_pix_load(), bn_spm_pix_save(), bn_spm_save(), bn_tabdata_add(), bn_tabdata_area1(), bn_tabdata_area2(), bn_tabdata_binary_read(), bn_tabdata_blend2(), bn_tabdata_blend3(), bn_tabdata_constval(), bn_tabdata_copy(), bn_tabdata_dup(), bn_tabdata_free(), bn_tabdata_freq_shift(), bn_tabdata_from_array(), bn_tabdata_get_constval(), bn_tabdata_incr_mul2_scale(), bn_tabdata_incr_mul3_scale(), bn_tabdata_join1(), bn_tabdata_join2(), bn_tabdata_malloc_array(), bn_tabdata_mk_linear_filter(), bn_tabdata_mul(), bn_tabdata_mul3(), bn_tabdata_mul_area1(), bn_tabdata_mul_area2(), bn_tabdata_resample_avg(), bn_tabdata_resample_max(), bn_tabdata_scale(), bn_tabdata_to_tcl(), bn_table_delete_sample_pts(), bn_table_find_x(), bn_table_free(), bn_table_interval_num_samples(), bn_table_lin_interp(), bn_table_make_uniform(), bn_table_merge2(), bn_table_read(), bn_table_scale(), bn_table_write(), bn_vec_ortho(), brdf_render(), brep_build_bvh(), brep_conversion_comb(), brep_conversion_tree(), brep_edge3d_plot(), brep_edge_info(), brep_face_info(), brep_facetrim_plot(), brep_intersect_curve_curve(), brep_intersect_curve_surface(), brep_intersect_point_curve(), brep_intersect_point_point(), brep_intersect_point_surface(), brep_intersect_surface_surface(), brep_isosurface_plot(), brep_loop_info(), brep_loop_plot(), brep_surface_bezier_info(), brep_surface_cv_plot(), brep_surface_info(), brep_surface_knot_plot(), brep_surface_normal_plot(), brep_surface_plot(), brep_surface_uv_plot(), brep_surfaceleafs_plot(), brep_translate_scv(), brep_trim_bezier_info(), brep_trim_direction_plot(), brep_trim_info(), brep_trim_plot(), brep_trimleafs_plot(), brick_render(), bu_avs_add(), bu_avs_add_nonunique(), bu_avs_init(), bu_avs_new(), bu_avs_print(), bu_backtrace(), bu_binary_to_bitv2(), bu_binstr_to_hexstr(), bu_brlcad_data(), bu_brlcad_root(), bu_ck_list(), bu_ck_list_magic(), bu_close_mapped_file(), bu_cmd(), bu_cmdhist_add(), bu_cmdhist_curr(), bu_cmdhist_history(), bu_cmdhist_next(), bu_cmdhist_prev(), bu_crashreport(), bu_dlclose(), bu_dlerror(), bu_dlopen(), bu_dlsym(), bu_file_exists(), BU_FORTRAN(), bu_free_mapped_files(), bu_fwrite_external(), bu_get_urandom_number(), bu_gethostname(), bu_gettime(), bu_heap_get(), bu_heap_log(), bu_hex_to_bitv(), bu_hexdump_external(), bu_hexstr_to_binstr(), bu_hsv_to_rgb(), bu_mm_cvt(), bu_nice_set(), bu_observer_cmd(), bu_open_mapped_file(), bu_parallel(), bu_pr_bitv(), bu_pr_mapped_file(), bu_pr_ptbl(), bu_pr_vlb(), bu_printb(), bu_ptbl_cat(), bu_ptbl_cat_uniq(), bu_ptbl_free(), bu_ptbl_init(), bu_ptbl_ins(), bu_ptbl_ins_unique(), bu_ptbl_reset(), bu_ptbl_rm(), bu_rb_delete(), bu_rb_diagnose_tree(), bu_rb_extreme(), bu_rb_insert(), bu_rb_neighbor(), bu_rb_select(), bu_rb_set_uniqv(), bu_rb_summarize_tree(), bu_shader_to_key_eq(), bu_struct_export(), bu_struct_get(), bu_struct_import(), bu_struct_parse(), bu_struct_print(), bu_struct_wrap_buf(), bu_structparse_argv(), bu_temp_file(), bu_vlb_initialize(), bu_vls_addr(), bu_vls_init(), bu_vls_init_if_uninit(), bu_vls_struct_item(), bu_vls_struct_print(), bu_vls_struct_print2(), bu_whereis(), bu_which(), build_topo_list(), BuildIrradianceCache(), BuildPhotonMap(), bw_read(), bw_write(), bwtxt_render(), c_regex_common(), categorize_trimmed_faces(), check_bbpt_hit_elev(), check_domain(), check_hitstate(), cho_cmd(), classify_seg(), colinear_edge_ray(), combmem_vls_print_member_info(), comm_error(), compare_bu_to_system_basename(), compose(), compute_normal_at_gridpoint(), construct_loops_from_segments(), conv_tree(), cook_render(), curve_fitting(), curve_to_vlist(), cut_unimonotone(), cylinder_csg(), data_missing(), db5_crack_disk_header(), db5_diradd(), db5_diradd_handler(), db5_fwrite_ident(), db5_get_raw_internal_fp(), db5_get_raw_internal_ptr(), db5_import_attributes(), db5_realloc(), db5_replace_attributes(), db5_scan(), db5_sync_attr_to_comb(), db5_update_attributes(), db5_update_ident(), db_add_anim(), db_alloc(), db_apply_anims(), db_apply_state_from_comb(), db_apply_state_from_memb(), db_apply_state_from_one_member(), db_argv_to_path(), db_ck_left_heavy_tree(), db_ck_tree(), db_ck_v4gift_tree(), db_close(), db_count_subtree_regions(), db_count_tree_nodes(), db_create(), db_delete(), db_delrec(), db_diff(), db_diff3(), db_diradd(), db_dirbuild(), db_dircheck(), db_do_anim(), db_dump(), db_dup_subtree(), db_find_named_leaf(), db_find_named_leafs_parent(), db_flatten_tree(), db_follow_path(), db_free_tree(), db_fullpath_list_subtree(), db_fullpath_to_vls(), db_functree(), db_functree_subtree(), db_fwrite_external(), db_fwrite_ident(), db_get(), db_get_external(), db_getmrec(), db_is_tree_all_unions(), db_lookup(), db_lookup_by_attr(), db_mkbool_tree(), db_mkgift_tree(), db_open(), db_parse_1anim(), db_pr_combined_tree_state(), db_pr_dir(), db_pr_full_path(), db_pr_tree_state(), db_preorder_traverse(), db_put(), db_put_external(), db_put_external5(), db_read(), db_recurse(), db_region_mat(), db_scan(), db_string_to_path(), db_tally_subtree_regions(), db_traverse_subtree(), db_tree_counter(), db_tree_del_dbleaf(), db_tree_describe(), db_tree_funcleaf(), db_tree_list(), db_tree_mul_dbleaf(), db_tree_nleaves(), db_update_ident(), db_update_nref(), db_version(), db_walk_tree(), db_wrap_v5_external(), db_write(), db_write_anim(), db_zapper(), DegreeReduction(), dimen_hook(), discont_radius_shot(), dl_botdump(), dl_polybinout(), dl_zap(), dm_fogHint(), dm_osgInit(), dm_osgLoadMatrix(), dm_osgReshape(), dm_processOptions(), dm_validXType(), dmo_cmd(), dmo_png_tcl(), dmo_size_tcl(), do_grid(), do_quad(), do_region_end(), do_region_end1(), do_region_end2(), do_tri(), dpix_read(), dpix_write(), draw_dsp_bb(), dsp_get_data(), dsp_layers(), dsp_pos(), dump_bitv(), edge_hit_ray_state(), emist_render(), envmap_setup(), eu_touch_func(), eval_etree(), eval_op(), existing_client_handler(), ext_setup(), face_brep_location(), fb_cmd_common_file_size(), fbm_render(), fbm_setup(), fbo_cell_tcl(), fbo_clear_tcl(), fbo_close_tcl(), fbo_cmd(), fbo_configure_tcl(), fbo_coords_ok(), fbo_cursor_tcl(), fbo_flush_tcl(), fbo_getcursor_tcl(), fbo_getheight_tcl(), fbo_getsize_tcl(), fbo_getwidth_tcl(), fbo_listen_tcl(), fbo_open_tcl(), fbo_pixel_tcl(), fbo_rect_tcl(), fbo_refresh_tcl(), fbo_tcllist2color(), fbs_rfbbwreadrect(), fbs_rfbbwwriterect(), fbs_rfbclear(), fbs_rfbcursor(), fbs_rfbhelp(), fbs_rfbread(), fbs_rfbreadrect(), fbs_rfbscursor(), fbs_rfbsetcursor(), fbs_rfbunknown(), fbs_rfbview(), fbs_rfbwindow(), fbs_rfbwmap(), fbs_rfbwrite(), fbs_rfbwriterect(), fbs_rfbzoom(), fill_out_bsp(), find_create(), find_path(), fire_render(), fire_row(), fire_setup(), flat_setup(), fractal_render(), gauss_render(), gauss_setup(), gcv_bottess(), gcv_bottess_region_end(), gcv_brlcad_read(), gcv_brlcad_write(), gcv_execute(), gcv_fastgen4_read(), gcv_reader(), gcv_region_end(), gcv_region_end_mc(), gcv_stl_read(), gcv_writer(), ged_annotate(), ged_bot_face_sort(), ged_bot_fuse(), ged_bot_merge(), ged_concat(), ged_draw_guts(), ged_E(), ged_erase(), ged_fbclear(), ged_gdiff(), ged_gqa(), ged_human(), ged_loadview(), ged_log(), ged_ls(), ged_make(), ged_memprint(), ged_nirt(), ged_nmg_collapse(), ged_open(), ged_osgLoadScene(), ged_prefix(), ged_pull(), ged_saveview(), ged_search(), ged_tables(), ged_xpush(), get_args(), get_curve_intervals_inside_or_on_face(), get_face_intersection_curves(), get_file_data(), get_joinable_ssi_curves(), get_kernel(), get_kernel3(), get_obj_data(), get_pole_dist_to_face(), get_subcurves_inside_faces(), get_surface(), GetCurveType(), getLocation(), GetMaterial(), getText(), grabCoordinates(), grass_render(), grass_setup(), guess_class_from_hitlist_max(), guess_class_from_hitlist_min(), hist_pr_suppress(), hit_ins(), HitRef(), hook_verify(), icv_add(), icv_divide(), icv_fade(), icv_filter3(), icv_gray2rgb(), icv_multiply(), icv_normalize(), icv_read(), icv_resize(), icv_rgb2gray(), icv_rot(), icv_saturate(), icv_sub(), icv_write(), img_load_datasource(), insert_above(), insert_in_bsp(), insert_node(), interval_2d_to_3d(), invent_solid(), invert(), is_loop_valid(), is_point_inside_brep(), is_point_on_brep_surface(), isect_ray_cell_top(), isect_ray_dsp_bb(), isect_ray_edgeuse(), isect_ray_faceuse(), isect_ray_loopuse(), isect_ray_lseg(), isect_ray_planar_face(), isect_ray_snurb_face(), isect_ray_triangle(), isect_ray_vertexuse(), LinkedCurve::IsValid(), lambda_to_rgb(), light_cvt_visible(), light_gen_sample_pts(), light_hit(), light_init(), light_maker(), light_miss(), light_obs(), light_pt_set(), light_render(), light_setup(), linear_pipe_shot(), link_curves(), load_dynamic_shader(), LoadFile(), loop_boolean(), main(), make_bot_object(), make_hole(), make_hole_in_prepped_regions(), make_near_list(), make_shape(), makeBody(), Manual(), mbound_render(), mk_addmember(), mk_binunif(), mk_bot_w_normals(), mk_brep(), mk_comb(), mk_hyp(), mk_metaball(), mk_pipe(), mk_tree_gift(), mk_write_color_table(), mlib_free(), mlib_setup(), move_all_func(), new_client(), new_image(), ninterp(), nmg_2_vrml(), nmg_2face_plot(), nmg_2lu_identical(), nmg_add_loop_to_face(), nmg_assess_eu(), nmg_assess_vu(), nmg_assoc_void_shells(), nmg_boolean(), nmg_booltree_evaluate(), nmg_booltree_leaf_tess(), nmg_booltree_leaf_tnurb(), nmg_bot(), nmg_break_all_es_on_v(), nmg_break_e_on_v(), nmg_break_eg_on_v(), nmg_break_eu_on_v(), nmg_break_long_edges(), nmg_brep_face(), nmg_bsegs(), nmg_build_loopuse_tree(), nmg_calc_face_plane(), nmg_calc_new_v(), nmg_cface(), nmg_check_radial(), nmg_check_radial_angles(), nmg_ck_closed_surf(), nmg_ck_eg_verts(), nmg_ck_face_worthless_edges(), nmg_ck_fu_verts(), nmg_ck_hitmiss_list(), nmg_ck_lu_orientation(), nmg_ck_lueu(), nmg_ck_v_in_fus(), nmg_ck_vert_on_fus(), nmg_ck_vu_ptbl(), nmg_class_lu_fu(), nmg_class_pt_euvu(), nmg_class_pt_fu_except(), nmg_class_pt_lu_except(), nmg_class_pt_s(), nmg_class_ray_vs_shell(), nmg_class_shells(), nmg_classify_lu_lu(), nmg_classify_lu_lu_new(), nmg_classify_pt_loop(), nmg_classify_pt_loop_new(), nmg_close_shell(), nmg_cmface(), nmg_cnurb_is_linear(), nmg_cnurb_is_on_crv(), nmg_cnurb_lseg_coincident(), nmg_cnurb_to_vlist(), nmg_common_v_2eg(), nmg_compare_edgeuse(), nmg_compare_faceuse(), nmg_compare_loopuse(), nmg_compare_region(), nmg_compare_region_a(), nmg_compare_shell(), nmg_compare_shell_a(), nmg_compare_vertexuse(), nmg_complex_vertex_solve(), nmg_crackshells(), nmg_cut_loop(), nmg_cut_lu_into_coplanar_and_non(), nmg_dangling_face(), nmg_decompose_shell(), nmg_demote_eu(), nmg_demote_lu(), nmg_dist_to_cross(), nmg_do_radial_join(), nmg_does_fu_use_eg(), nmg_dup_face(), nmg_dup_loop(), nmg_dup_shell(), nmg_edge_collapse(), nmg_edge_g(), nmg_edge_g_cnurb(), nmg_edge_g_cnurb_plinear(), nmg_edge_g_fuse(), nmg_edge_geom_isect_line(), nmg_enlist_one_vu(), nmg_enlist_vu(), nmg_eu_2s_orient_bad(), nmg_eu_to_vlist(), nmg_euprint(), nmg_eval_action(), nmg_eval_linear_trim_to_tol(), nmg_eval_plot(), nmg_eval_shell(), nmg_eval_trim_to_tol(), nmg_evaluate_boolean(), nmg_extrude_cleanup(), nmg_extrude_face(), nmg_extrude_shell(), nmg_face_bb(), nmg_face_coincident_vu_sort(), nmg_face_cutjoin(), nmg_face_fix_radial_parity(), nmg_face_g(), nmg_face_g_snurb(), nmg_face_lu_plot(), nmg_face_new_g(), nmg_face_plot(), nmg_face_rs_init(), nmg_face_state_transition(), nmg_faceuse_area(), nmg_fcut_face(), nmg_find_e(), nmg_find_edge_between_2fu(), nmg_find_eg_between_2fg(), nmg_find_eg_on_line(), nmg_find_eu_in_face(), nmg_find_eu_leftvec(), nmg_find_first_last_use_of_v_in_fu(), nmg_find_fu_of_lu(), nmg_find_fu_of_vu(), nmg_find_isect_faces(), nmg_find_model(), nmg_find_path(), nmg_find_radial_eu(), nmg_find_shell(), nmg_find_top_face(), nmg_find_top_face_in_dir(), nmg_find_zero_length_edges(), nmg_findeu(), nmg_fix_crossed_loops(), nmg_fix_decomposed_shell_normals(), nmg_fix_normals(), nmg_fix_overlapping_loops(), nmg_flatten_face(), nmg_follow_free_edges_to_vertex(), nmg_fu_planeeqn(), nmg_fu_touchingloops(), nmg_fuse_inters(), nmg_get_edge_lines(), nmg_get_interior_pt(), nmg_get_max_edge_inters(), nmg_gluefaces(), nmg_hollow_shell(), nmg_in_vert(), nmg_index_of_struct(), nmg_invert_shell(), nmg_is_crack_outie(), nmg_isect2d_prep(), nmg_isect_2colinear_edge2p(), nmg_isect_construct_nice_ray(), nmg_isect_edge2p_edge2p(), nmg_isect_eu_eu(), nmg_isect_eu_fu(), nmg_isect_face3p_shell_int(), nmg_isect_fu_jra(), nmg_isect_line2_edge2p(), nmg_isect_line2_face2pNEW(), nmg_isect_line2_vertex2(), nmg_isect_ray_model(), nmg_isect_ray_shell(), nmg_isect_shell_self(), nmg_isect_two_generic_faces(), nmg_isect_two_ptbls(), nmg_isect_vert2p_face2p(), nmg_je(), nmg_jeg(), nmg_jf(), nmg_jfg(), nmg_jl(), nmg_join_2loops(), nmg_join_2singvu_loops(), nmg_join_singvu_loop(), nmg_join_touchingloops(), nmg_js(), nmg_jv(), nmg_k0eu(), nmg_keu(), nmg_kfu(), nmg_kill_accordions(), nmg_kill_cracks(), nmg_kill_cracks_at_vertex(), nmg_kill_non_common_cracks(), nmg_kill_snakes(), nmg_kill_zero_length_edgeuses(), nmg_klu(), nmg_km(), nmg_kr(), nmg_ks(), nmg_kvu(), nmg_loop_g(), nmg_loop_is_a_crack(), nmg_loop_is_ccw(), nmg_loop_split_at_touching_jaunt(), nmg_lu_reorient(), nmg_m_reindex(), nmg_make_connect_faces(), nmg_make_dualvu(), nmg_make_faces_at_vert(), nmg_make_faces_within_tol(), nmg_manifolds(), nmg_mc_realize_cube(), nmg_me(), nmg_meonvu(), nmg_mesh_faces(), nmg_mesh_two_faces(), nmg_mf(), nmg_mk_model_from_region(), nmg_mk_new_face_from_loop(), nmg_ml(), nmg_mlv(), nmg_mm(), nmg_mmr(), nmg_model_face_fuse(), nmg_model_fuse(), nmg_move_edge_thru_pt(), nmg_move_lu_between_fus(), nmg_moveltof(), nmg_movevu(), nmg_mrsv(), nmg_msv(), nmg_mv_fu_between_shells(), nmg_mv_lu_between_shells(), nmg_mv_shell_to_region(), nmg_onon_fix(), nmg_open_shells_connect(), nmg_pick_best_edge_g(), nmg_pl_2fu(), nmg_pl_comb_fu(), nmg_pl_hitmiss_list(), nmg_pl_isect(), nmg_pl_lu_around_eu(), nmg_plot_lu_around_eu(), nmg_plot_lu_ray(), nmg_plot_open_edges(), nmg_plot_ray_face(), nmg_polytonmg(), nmg_pr_class_status(), nmg_pr_e(), nmg_pr_eg(), nmg_pr_eu(), nmg_pr_eu_briefly(), nmg_pr_eu_endpoints(), nmg_pr_f(), nmg_pr_fg(), nmg_pr_fu(), nmg_pr_fu_around_eu(), nmg_pr_fu_around_eu_vecs(), nmg_pr_fu_briefly(), nmg_pr_fus_in_fg(), nmg_pr_inter(), nmg_pr_l(), nmg_pr_lg(), nmg_pr_lu(), nmg_pr_lu_briefly(), nmg_pr_m(), nmg_pr_one_eu_vecs(), nmg_pr_orient(), nmg_pr_ptbl(), nmg_pr_ptbl_vert_list(), nmg_pr_r(), nmg_pr_radial(), nmg_pr_radial_list(), nmg_pr_s(), nmg_pr_s_briefly(), nmg_pr_sa(), nmg_pr_struct_counts(), nmg_pr_v(), nmg_pr_vg(), nmg_pr_vu(), nmg_pr_vu_briefly(), nmg_pr_vu_stuff(), nmg_pr_vua(), nmg_propagate_normals(), nmg_purge_unwanted_intersection_points(), nmg_r_radial_check(), nmg_radial_build_list(), nmg_radial_check_parity(), nmg_radial_find_an_original(), nmg_radial_implement_decisions(), nmg_radial_join_eu(), nmg_radial_join_eu_NEW(), nmg_radial_mark_cracks(), nmg_radial_mark_flips(), nmg_radial_verify_monotone(), nmg_radial_verify_pointers(), nmg_ray_segs(), nmg_reclassify_lu_eu(), nmg_region_a(), nmg_region_end(), nmg_region_v_unique(), nmg_remove_short_eus_inter(), nmg_repair_v_near_v(), nmg_reverse_face(), nmg_reverse_face_and_radials(), nmg_reverse_radials(), nmg_rm_redundancies(), nmg_rt_isect_plfu(), nmg_rt_print_hitlist(), nmg_rt_print_hitmiss(), nmg_s_join_touchingloops(), nmg_s_radial_check(), nmg_s_radial_harmonize(), nmg_s_split_touchingloops(), nmg_sanitize_s_lv(), nmg_search_v_eg(), nmg_select_collapse(), nmg_set_lu_orientation(), nmg_shell_a(), nmg_shell_coplanar_face_merge(), nmg_shell_manifolds(), nmg_show_broken_classifier_stuff(), nmg_simple_vertex_solve(), nmg_simplify_face(), nmg_simplify_inter(), nmg_simplify_loop(), nmg_simplify_shell(), nmg_snurb_fu_eval(), nmg_snurb_fu_get_norm(), nmg_snurb_fu_get_norm_at_vu(), nmg_snurb_is_planar(), nmg_split_edges_at_pts(), nmg_split_loops_handler(), nmg_split_loops_into_faces(), nmg_split_lu_at_vu(), nmg_split_touchingloops(), nmg_split_trim(), nmg_stash_model_to_file(), nmg_to_poly(), nmg_tri_kill_accordions(), nmg_triangulate_fu(), nmg_triangulate_model(), nmg_triangulate_model_mc(), nmg_triangulate_rm_degen_loopuse(), nmg_triangulate_rm_holes(), nmg_triangulate_shell(), nmg_two_face_fuse(), nmg_unbreak_handler(), nmg_unbreak_region_edges(), nmg_unglueedge(), nmg_use_edge_g(), nmg_uv_in_lu(), nmg_vedge(), nmg_veg(), nmg_vertex_fuse(), nmg_vertex_g(), nmg_vertex_gv(), nmg_vertexuse_a_cnurb(), nmg_vertexuse_nv(), nmg_veu(), nmg_vface(), nmg_vfg(), nmg_vfu(), nmg_visit(), nmg_vlu(), nmg_vregion(), nmg_vsshell(), nmg_vu_angle_measure(), nmg_vvu(), nmg_wedge_class(), noise_setup(), normalizedInput_hook(), not_squish(), observer_attach(), observer_detach(), observer_show(), ON_Boolean(), ON_Intersect(), ON_Surface_Quad_Split(), options_prep(), or_squish(), osl_parse(), osl_setup(), paren_squish(), parse_dmatprint(), parse_key_val_to_vls(), parse_list_elem(), parse_matprint(), parse_struct_lookup(), permute_cell(), persp_hook(), phong_render(), pick_edges(), pick_eu(), pipe_end_shot(), pipe_scale_radius(), pipe_seg_scale_id(), pipe_seg_scale_od(), pipe_seg_scale_radius(), pipe_start_shot(), pix_read(), pix_write(), pl_ray(), pleu(), plot_cell_top(), plot_dsp_bb(), plot_layers(), plot_neighborhood(), plot_seg(), plot_setBGColor(), plot_setFGColor(), png_write(), points_setup(), port_setlinebuf(), ppm_read(), ppm_write(), pr_shadework(), print_diff_summary(), print_loopuse_tree(), print_path_with_bools(), print_seg_list(), print_subbrep_object(), print_thrm_seg(), prj_render(), prj_setup(), project_point(), project_pt(), promote_ints(), ps_setBGColor(), ps_setFGColor(), ptbl_vsort(), pull_comb(), ray_hit_edge(), ray_hit_vertex(), ray_miss_vertex(), rb_rot_left(), rb_rot_right(), rb_walk(), rbound_render(), read_args(), record_face_hit(), recurse_dsp_bb(), reindex(), remove_from_bsp(), root_missing(), rr_hit(), rr_refract(), rr_render(), rt_advance_to_next_cell(), rt_arb_add_pt(), rt_arb_calc_points(), rt_arb_class(), rt_arb_get_cgtype(), rt_arb_import4(), rt_arb_mk_planes(), rt_arb_print(), rt_arb_shot(), rt_arb_tess(), rt_arb_tnurb(), rt_arb_uv(), rt_arbn_import4(), rt_arbn_norm(), rt_arbn_plot(), rt_arbn_prep(), rt_arbn_print(), rt_arbn_shot(), rt_arbn_tess(), rt_arc2d_to_cnurb(), rt_ars_import4(), rt_ars_prep(), rt_ars_print(), rt_ars_shot(), rt_ars_tess(), rt_ars_uv(), rt_bend_pipe_prep(), rt_bin_mime_import5(), rt_bin_unif_export5(), rt_bin_unif_import5(), rt_binunif_describe(), rt_binunif_dump(), rt_binunif_export5(), rt_binunif_import5_minor_type(), rt_booleval(), rt_boolfinal(), rt_boolweave(), rt_bot_condense(), rt_bot_decimate(), rt_bot_export4(), rt_bot_import4(), rt_bot_import5(), rt_bot_smooth(), rt_bot_sort_faces(), rt_bot_tess(), rt_bot_vertex_fuse(), rt_bound_internal(), rt_bound_tree(), rt_brep_plot(), rt_brep_plot_poly(), rt_brep_prep(), rt_brep_process_selection(), rt_brep_shot(), rt_cell_n_on_ray(), rt_check_curve(), rt_ck_overlap(), rt_ck_vlist(), rt_cline_import4(), rt_cline_norm(), rt_cline_print(), rt_cline_tess(), rt_cnurb_par_edge(), rt_comb_export4(), rt_comb_import4(), rt_comb_import5(), rt_comb_v5_serialize(), rt_copy_sketch(), rt_ct_box(), rt_ct_measure(), rt_ct_old_assess(), rt_ct_optim(), rt_ct_release_storage(), rt_curve_free(), rt_cut_extend(), rt_cut_it(), rt_cut_optimize_parallel(), rt_db_cvt_to_external5(), rt_db_external5_to_internal5(), rt_db_flip_endian(), rt_db_get_internal(), rt_db_lookup_internal(), rt_db_put_internal(), rt_db_put_internal5(), rt_default_logoverlap(), rt_default_multioverlap(), rt_del_regtree(), rt_do_cmd(), rt_dsp_bbox(), rt_dsp_class(), rt_dsp_curve(), rt_dsp_describe(), rt_dsp_export4(), rt_dsp_export5(), rt_dsp_free(), rt_dsp_ifree(), rt_dsp_import4(), rt_dsp_import5(), rt_dsp_norm(), rt_dsp_plot(), rt_dsp_prep(), rt_dsp_print(), rt_dsp_shot(), rt_dsp_tess(), rt_dsp_uv(), rt_dspline_matrix(), rt_ebm_centroid(), rt_ebm_dda(), rt_ebm_import4(), rt_ebm_import5(), rt_ebm_norm(), rt_ebm_print(), rt_ehy_brep(), rt_ehy_export4(), rt_ehy_export5(), rt_ehy_import4(), rt_ehy_import5(), rt_ehy_norm(), rt_ehy_tess(), rt_ell_brep(), rt_ell_import4(), rt_ell_prep(), rt_ell_surf_area(), rt_ell_tess(), rt_ell_tnurb(), rt_epa_export4(), rt_epa_export5(), rt_epa_import4(), rt_epa_import5(), rt_epa_norm(), rt_epa_tess(), rt_eto_import4(), rt_eto_plot(), rt_eto_prep(), rt_eto_print(), rt_eto_shot(), rt_eto_tess(), rt_extrude_bbox(), rt_extrude_import4(), rt_extrude_import5(), rt_extrude_plot(), rt_extrude_prep(), rt_extrude_shot(), rt_extrude_tess(), rt_extrude_xform(), rt_fastgen_plate_vol_overlap(), rt_fastgen_vol_vol_overlap(), rt_fdiff(), rt_find_paths(), rt_fr_cut(), rt_fwrite_internal(), rt_generic_xform(), rt_gettrees_muves(), rt_grp_import4(), rt_grp_import5(), rt_grp_print(), rt_hf_export4(), rt_hf_export5(), rt_hf_import4(), rt_hf_import5(), rt_hf_prep(), rt_hf_print(), rt_hf_shot(), rt_hf_to_dsp(), rt_hlf_import4(), rt_hlf_import5(), rt_hlf_norm(), rt_hlf_print(), rt_hlf_uv(), rt_hlf_xform(), rt_hrt_adaptive_plot(), rt_hrt_curve(), rt_hrt_prep(), rt_hrt_shot(), rt_hrt_tess(), rt_hrt_uv(), rt_hrt_volume(), rt_hrt_vshot(), rt_htbl_free(), rt_htbl_init(), rt_htbl_reset(), rt_hyp_norm(), rt_hyp_shot(), rt_hyp_tess(), rt_id_solid(), rt_init_resource(), rt_insert_color(), rt_join_cnurbs(), rt_joint_find_selections(), rt_joint_import5(), rt_joint_print(), rt_joint_process_selection(), rt_load_attrs(), rt_memfree(), rt_memprint(), rt_metaball_curve(), rt_metaball_norm_internal(), rt_metaball_point_value_metaball(), rt_metaball_print(), rt_metaball_tess(), rt_metaballpt_print(), rt_mirror(), rt_mk_binunif(), rt_new_rti(), rt_nmg_edisk(), rt_nmg_export4_internal(), rt_nmg_export5(), rt_nmg_ialloc(), rt_nmg_idisk(), rt_nmg_import4(), rt_nmg_import4_fastf(), rt_nmg_import4_internal(), rt_nmg_import5(), rt_nmg_magic_to_kind(), rt_nmg_mc_crosspew(), rt_nmg_mc_pew(), rt_nmg_mirror(), rt_nmg_shot(), rt_nugrid_cut(), rt_nurb_brep(), rt_nurb_c_bound(), rt_nurb_c_check(), rt_nurb_c_eval(), rt_nurb_c_print(), rt_nurb_curvature(), rt_nurb_export4(), rt_nurb_export5(), rt_nurb_import4(), rt_nurb_import5(), rt_nurb_intersect(), rt_nurb_kvmult(), rt_nurb_pr_kv(), rt_nurb_pr_mesh(), rt_nurb_print(), rt_nurb_print_pt_type(), rt_nurb_project_srf(), rt_nurb_s_bound(), rt_nurb_s_check(), rt_nurb_s_eval(), rt_nurb_s_print(), rt_nurb_shot(), rt_optim_tree(), rt_part_import4(), rt_part_import5(), rt_part_prep(), rt_part_print(), rt_part_tess(), rt_pg_export4(), rt_pg_export5(), rt_pg_import4(), rt_pg_import5(), rt_pg_prep(), rt_pg_print(), rt_pg_shot(), rt_pg_tess(), rt_pg_to_bot(), rt_pgface(), rt_pipe_ck(), rt_pipe_import4(), rt_pipe_norm(), rt_pipe_shot(), rt_pipe_surf_area(), rt_pipept_print(), rt_plot_cell(), rt_plot_solid(), rt_pnts_describe(), rt_pnts_export5(), rt_pnts_import5(), rt_pnts_print(), rt_poly_findroot(), rt_pr_cut(), rt_pr_cut_info(), rt_pr_hit(), rt_pr_mater(), rt_pr_partitions(), rt_pr_pt(), rt_pr_region(), rt_pr_seg(), rt_pr_soltab(), rt_pr_tol(), rt_pr_tree(), rt_pr_tree_val(), rt_pr_tree_vls(), rt_pr_uvcoord(), rt_prep_parallel(), rt_rec_curve(), rt_rec_norm(), rt_rec_shot(), rt_region_color_map(), rt_regionfix(), rt_reprep(), rt_retrieve_binunif(), rt_revolve_bbox(), rt_revolve_brep(), rt_revolve_ifree(), rt_revolve_import5(), rt_revolve_plot(), rt_revolve_prep(), rt_revolve_shot(), rt_revolve_tess(), rt_revolve_uv(), rt_revolve_xform(), rt_rhc_import4(), rt_rhc_import5(), rt_rhc_norm(), rt_rpc_export4(), rt_rpc_export5(), rt_rpc_import4(), rt_rpc_import5(), rt_rpc_norm(), rt_seg_planeclip(), rt_shoot_many_rays_worker(), rt_shootray(), rt_shootray_bundle(), rt_sketch_bounds(), rt_sketch_brep(), rt_sketch_contains(), rt_sketch_degree(), rt_sketch_export4(), rt_sketch_export5(), rt_sketch_ifree(), rt_sketch_import4(), rt_sketch_import5(), rt_sketch_plot(), rt_solid_bitfinder(), rt_spect_black_body(), rt_spect_black_body_fast(), rt_spect_black_body_points(), rt_spect_make_CIE_XYZ(), rt_sph_prep(), rt_sph_print(), rt_submodel_a_hit(), rt_submodel_curve(), rt_submodel_import4(), rt_submodel_import5(), rt_submodel_norm(), rt_submodel_plot(), rt_submodel_prep(), rt_submodel_print(), rt_submodel_wireframe_leaf(), rt_superell_brep(), rt_superell_curve(), rt_superell_import4(), rt_superell_prep(), rt_superell_shot(), rt_superell_tess(), rt_superell_uv(), rt_tgc_centroid(), rt_tgc_import4(), rt_tgc_norm(), rt_tgc_prep(), rt_tgc_print(), rt_tgc_shot(), rt_tgc_surf_area(), rt_tgc_tess(), rt_tgc_volume(), rt_tgc_vshot(), rt_tor_export4(), rt_tor_import4(), rt_tor_import5(), rt_tor_prep(), rt_tor_print(), rt_tor_shot(), rt_tor_tess(), rt_tor_vshot(), rt_traverse_tree(), rt_tree_elim_nops(), rt_tri_mc_realize_cube(), rt_unprep(), rt_uv_in_trim(), rt_vlist_solid(), rt_vlist_to_uplot(), rt_vol_import4(), rt_vol_import5(), rt_vol_norm(), rt_vol_print(), rt_vol_shot(), rt_vshootray(), rt_weave0seg(), run_client(), run_server(), SanityCheck(), scloud_render(), scloud_setup(), seg_to_vlist(), select_filter(), server_ciao(), server_data(), server_helo(), set_inpoint(), set_outpoint(), setStance(), setup(), setup_socket(), sh_null_print(), sh_null_render(), sh_stk_dosetup(), sh_stk_print(), sh_stk_render(), sh_stk_setup(), shade_inputs(), shoot_and_plot(), show_help(), show_seg(), shrink_image(), skylight_spectral_dist(), soup_rm_face(), split_face_into_loops(), split_face_single(), split_pipept(), split_trimmed_face(), spm_print(), state0(), state1(), state2(), state3(), state4(), state5and6(), stxt_free(), stxt_read(), stxt_transp_hook(), subbrep_split(), subbreps_boolean_tree(), LinkedCurve::SubCurve(), swap_cell_pts(), tables_new(), tcl_bu_brlcad_data(), tcl_bu_brlcad_dir(), tcl_bu_brlcad_root(), tcl_bu_get_value_by_keyword(), tcl_bu_hsv_to_rgb(), tcl_bu_mem_barriercheck(), tcl_bu_prmem(), tcl_bu_rgb_to_hsv(), tcl_bu_units_conversion(), tcl_render(), tcl_setup(), tclcad_auto_path(), Tclcad_Init(), temp_render(), temp_setup(), tesselate_pipe_bend(), tesselate_pipe_end(), tesselate_pipe_linear(), tesselate_pipe_start(), test_nmg_clone_model(), test_nmg_mm(), test_nmg_mmr(), test_nmg_mrsv(), test_nmg_msv(), text(), tie_push(), tmist_render(), to_more_args_func(), toon_setup(), toyota_setup(), tthrm_print(), tthrm_render(), tthrm_setup(), txt_beginDList(), txt_close(), txt_configureWin(), txt_debug(), txt_draw(), txt_drawBegin(), txt_drawDList(), txt_drawEnd(), txt_drawLine2D(), txt_drawLine3D(), txt_drawLines3D(), txt_drawPoint2D(), txt_drawPoint3D(), txt_drawPoints3D(), txt_drawString2D(), txt_drawVList(), txt_drawVListHiddenLine(), txt_endDList(), txt_freeDLists(), txt_genDLists(), txt_getDisplayImage(), txt_load_datasource(), txt_loadMatrix(), txt_loadPMatrix(), txt_logfile(), txt_makeCurrent(), txt_normal(), txt_open(), txt_openFb(), txt_render(), txt_reshape(), txt_setBGColor(), txt_setDepthMask(), txt_setFGColor(), txt_setLight(), txt_setLineAttr(), txt_setTransparency(), txt_setup(), txt_setWinBounds(), txt_setZBuffer(), txt_transp_hook(), under_sample(), unprep_leaf(), unresolved(), usage(), validate_tbl2d(), verbIn(), verbose(), vertex_neighborhood(), viewshade(), vo_observer_cmd(), vu_touch_func(), wdb_dbopen(), wdb_export(), wdb_export_external(), wdb_importFg4Section_cmd(), wdb_put_internal(), wood_setup(), wraypaint(), wraypts(), WritePhotonFile(), WritePhotons(), XGLUE(), xxx_setup(), and yankexpr().

Here is the call graph for this function:

void bu_flog ( FILE *  ,
const char *  ,
  ... 
)

Just like bu_log() except that you can send output to a specified file pointer.

Definition at line 246 of file log.c.

References bu_bomb(), BU_LIST_IS_EMPTY, BU_SEM_SYSCALL, bu_semaphore_acquire(), bu_semaphore_release(), bu_vls_addr(), bu_vls_free(), BU_VLS_INIT_ZERO, bu_vls_strlen(), bu_vls_vprintf(), bu_hook_list::l, LIKELY, log_call_hooks(), log_do_indent_level(), and UNLIKELY.

Referenced by anim_mat_print(), and anim_mat_printf().

Here is the call graph for this function:

int bu_vsscanf ( const char *  src,
const char *  fmt,
va_list  ap 
)

Custom vsscanf which wraps the system sscanf, and is wrapped by bu_sscanf.

bu_vsscanf differs notably from the underlying system sscanf in that:

  • A maximum field width is required for unsuppressed s and %[...] conversions. If a s or %[...] conversion is encountered which does not include a maximum field width, the routine bombs in order to avoid an accidental buffer overrun.
  • V and %#V have been added as valid conversions. Both expect a pointer to a struct bu_vls as their argument.

    V is comparable to %[^]. It instructs bu_vsscanf to read arbitrary characters from the source and store them in the vls buffer. The default maximum field width is infinity.

    %#V is comparable to s. It instructs bu_vsscanf to skip leading whitespace, and then read characters from the source and store them in the vls buffer until the next whitespace character is encountered. The default maximum field width is infinity.

  • 0 is always a valid field width for unsuppressed c, s, and %[...] conversions and causes '\0' to be written to the supplied char* argument.
  • a/e/f/g and A/E/F/G are always synonyms for float conversion.
  • The C99 conversions hh[diouxX], z[diouxX], and t[diouxX] are always supported.

This routine has an associated test program named test_sscanf, which compares its behavior to the system sscanf.

Definition at line 107 of file sscanf.c.

References ALTERNATE, BU_ASSERT, bu_bomb(), bu_vls_addr(), BU_VLS_INIT_ZERO, bu_vls_putc(), bu_vls_sprintf(), bu_vls_strcat(), bu_vls_strlen(), bu_vls_trunc(), CT_CCL, CT_CHAR, CT_FLOAT, CT_INT, CT_STRING, CT_VLS, EXIT_DUE_TO_INPUT_FAILURE, EXIT_DUE_TO_MATCH_FAILURE, EXIT_DUE_TO_MISC_ERROR, FREE_FORMAT_PART, GET_FORMAT_PART, HAVEWIDTH, INTMAXT, LONG, LONGDBL, LONGLONG, NOSKIP, NUMERIC_CHAR_TO_INT, PFXOK, POINTER, PTRDIFFT, SHORT, SHORTSHORT, SIZET, SSCANF_SIGNED_UNSIGNED, SSCANF_TYPE, SUPPRESS, UNSIGNED, UPDATE_COUNTS, and OSL::Strings::width.

Referenced by bu_sscanf().

Here is the call graph for this function:

int bu_sscanf ( const char *  src,
const char *  fmt,
  ... 
)

Initializes the va_list, then calls bu_vsscanf.

This routine has an associated test program named test_sscanf, which compares its behavior to the system sscanf.

Definition at line 676 of file sscanf.c.

References bu_vsscanf().

Referenced by bu_vls_vprintf(), ged_bot_edge_split(), ged_bot_face_split(), ged_find_arb_edge_nearest_pt(), ged_find_bot_edge_nearest_pt(), ged_find_botpt_nearest_pt(), ged_move_botpt(), ged_move_botpts(), redraw_edited_path(), test_quat_distance(), test_quat_sberp(), test_quat_slerp(), to_axes(), to_bg(), to_bounds(), to_constrain_rmode(), to_constrain_tmode(), to_data_arrows(), to_data_axes(), to_data_labels(), to_data_lines(), to_data_move(), to_data_move_object_mode(), to_data_move_point_mode(), to_data_pick(), to_data_polygons(), to_data_scale(), to_data_scale_mode(), to_data_vZ(), to_dlist_on(), to_extract_contours_av(), to_faceplate(), to_fontsize(), to_handle_expose(), to_hide_view(), to_light(), to_listen(), to_mouse_append_pt_common(), to_mouse_constrain_rot(), to_mouse_constrain_trans(), to_mouse_find_arb_edge(), to_mouse_find_bot_edge(), to_mouse_find_botpt(), to_mouse_find_metaballpt(), to_mouse_find_pipept(), to_mouse_joint_selection_translate(), to_mouse_move_arb_edge(), to_mouse_move_arb_face(), to_mouse_move_botpt(), to_mouse_move_botpts(), to_mouse_move_pt_common(), to_mouse_orotate(), to_mouse_oscale(), to_mouse_otranslate(), to_mouse_poly_circ(), to_mouse_poly_cont(), to_mouse_poly_ell(), to_mouse_poly_rect(), to_mouse_protate(), to_mouse_pscale(), to_mouse_ptranslate(), to_mouse_rect(), to_mouse_rot(), to_mouse_rotate_arb_face(), to_mouse_trans(), to_move_arb_edge_mode(), to_move_arb_face_mode(), to_move_botpt_mode(), to_move_botpts_mode(), to_move_metaballpt_mode(), to_move_pipept_mode(), to_orotate_mode(), to_oscale_mode(), to_otranslate_mode(), to_poly_circ_mode(), to_poly_cont_build(), to_poly_ell_mode(), to_poly_rect_mode(), to_protate_mode(), to_pscale_mode(), to_ptranslate_mode(), to_rect_mode(), to_refresh_on(), to_rotate_arb_face_mode(), to_rotate_mode(), to_scale_mode(), to_screen2model(), to_screen2view(), to_set_fb_mode(), to_snap_view(), to_translate_mode(), to_transparency(), to_view2screen(), to_view_win_size(), to_vslew(), to_zbuffer(), and to_zclip().

Here is the call graph for this function:

int bu_scan_fastf_t ( int *  c,
const char *  src,
const char *  delim,
int  n,
  ... 
)

Scans a sequence of fastf_t numbers from a string or stdin

Scanning fastf_t numbers with bu_sscanf() is difficult, because doing so requires scanning to some intermediate type like double and then assigning to the fastf_t variable to convert the value to whatever type fastf_t really is. This function makes it possible to scan a series of fastf_t numbers separated by some character(s) easily, by doing the required conversion internally to the functions. As series of delimiter characters will be skipped, empty scan fields are not supported (e.g., "0.0,,0.0,1.0" will scan as 3 fields, not 4 with the 2nd skipped).

Parameters
[out]cReturns number of characters scanned by the function
[in]srcA source string to scan from, or NULL to read from stdin
[in]delimAny delimiter character(s) to skip between scan values
[in]nNumber of fastf_t values to scan from the src input string
[out]...Pointers to fastf_t for storing scanned values (optional)

Definition at line 32 of file scan.c.

References bu_free(), bu_malloc(), bu_strlcat, bu_strlcpy, and UNLIKELY.

Referenced by test_quat_bisect(), test_quat_distance(), test_quat_double(), test_quat_exp(), test_quat_log(), test_quat_make_nearest(), test_quat_mat2quat(), test_quat_quat2mat(), test_quat_sberp(), and test_quat_slerp().

Here is the call graph for this function:

char* bu_dirname ( const char *  path)

Given a string containing a hierarchical path, return a dynamic string to the parent path.

This function is similar if not identical to most dirname() BSD system function implementations; but that system function cannot be used due to significantly inconsistent behavior across platforms.

This function always recognizes paths separated by a '/' (i.e., geometry paths) as well as whatever the native platform directory separator may be. It is assumed that all file and directory names in the path will not contain a path separator, even if escaped.

It is the caller's responsibility to bu_free() the pointer returned from this routine.

Examples of strings returned:

 /usr/dir/file      /usr/dir


/usr/dir/ /usr
/usr/file /usr
/usr/ /
/usr /
/ /
. .
.. .
usr .
a/b a
a/ .
../a/b ../a

This routine will return "." if other valid results are not available but should never return NULL.

Definition at line 30 of file dirname.c.

References BU_DIR_SEPARATOR, bu_free(), BU_STR_EQUAL, bu_strdup, and UNLIKELY.

Referenced by automatic_test(), bu_brlcad_root(), and db_open().

Here is the call graph for this function:

void bu_basename ( char *  basename,
const char *  path 
)

Given a string containing a hierarchical path, return a dynamic string to the portion after the last path separator.

This function is similar if not identical to most basename() BSD system function implementations; but that system function cannot be used due to significantly inconsistent behavior across platforms.

This function always recognizes paths separated by a '/' (i.e., geometry paths) as well as whatever the native platform directory separator may be. It is assumed that all file and directory names in the path will not contain a path separator, even if escaped.

It is the caller's responsibility to allocate basename with enough memory to hold a string with length strlen(path), since that is the maximum possible size of bu_basename's output.

Examples of strings returned:

 /usr/dir/file      file


/usr/dir/ dir
/usr/ usr
/usr usr
/ /
. .
.. ..
usr usr
a/b b
a/ a
/// /

Definition at line 30 of file basename.c.

References BU_DIR_SEPARATOR, bu_strlcpy, and UNLIKELY.

Referenced by _ged_editit(), _path_scrub(), _rt_getregion(), bu_getprogname(), ged_bot_flip(), ged_bot_split(), ged_bot_sync(), main(), rt_shader_mat(), to_mouse_brep_selection_append(), to_mouse_brep_selection_translate(), to_mouse_joint_select(), and to_mouse_joint_selection_translate().

int bu_lex ( union bu_lex_token token,
struct bu_vls rtstr,
struct bu_lex_key keywords,
struct bu_lex_key symbols 
)

Definition at line 144 of file lex.c.

References bu_bomb(), bu_free(), BU_LEX_DOUBLE, BU_LEX_IDENT, BU_LEX_INT, BU_LEX_KEYWORD, BU_LEX_NEED_MORE, BU_LEX_SYMBOL, BU_STR_EQUAL, lex_getone(), bu_lex_key::string, bu_lex_token::t_dbl, bu_lex_token::t_id, bu_lex_token::t_int, bu_lex_token::t_key, bu_lex_key::tok_val, bu_lex_token::type, bu_lex_t_int::value, bu_lex_t_dbl::value, bu_lex_t_key::value, and bu_lex_t_id::value.

Referenced by get_token().

Here is the call graph for this function:

long int bu_mread ( int  fd,
void *  bufp,
long int  n 
)

"Multiple try" read. Read multiple times until quantity is obtained or an error occurs. This is useful for pipes.

Definition at line 31 of file mread.c.

References UNLIKELY.

Referenced by fb_read_fd().