Linked Lists
[libbu (utility functions)]

Collaboration diagram for Linked Lists:


Files

file  list.c
 Support routines for linked lists.

Data Structures

struct  bu_list

Defines

#define BU_LIST_HEAD_MAGIC   0x01016580
#define BU_LIST_NULL   ((struct bu_list *)0)
#define BU_LIST_CLOSE(hp)
#define BU_LIST_INSERT(old, new)
#define BU_LIST_APPEND(old, new)
#define BU_LIST_DEQUEUE(cur)
#define BU_LIST_DQ(cur)
#define BU_LIST_DQ_T(cur, type)
#define BU_LIST_DEQUEUE_T(cur, type)
#define BU_LIST_PUSH(hp, p)   BU_LIST_APPEND(hp, (struct bu_list *)(p))
#define BU_LIST_POP(structure, hp, p)
#define BU_LIST_POP_T(hp, type)   (type *)bu_list_pop( hp )
#define BU_LIST_INSERT_LIST(dest_hp, src_hp)
#define BU_LIST_APPEND_LIST(dest_hp, src_hp)
#define BU_LIST_IS_EMPTY(hp)   ((hp)->forw == (hp))
#define BU_LIST_NON_EMPTY(hp)   ((hp)->forw != (hp))
#define BU_LIST_NON_EMPTY_P(p, structure, hp)   (((p)=(struct structure *)((hp)->forw)) != (struct structure *)(hp))
#define BU_LIST_IS_CLEAR(hp)
#define BU_LIST_UNINITIALIZED(hp)   ((hp)->forw == BU_LIST_NULL)
#define BU_LIST_IS_INITIALIZED(hp)   ((hp)->forw != BU_LIST_NULL)
#define BU_LIST_INIT(hp)
#define BU_LIST_MAGIC_SET(hp, val)   {(hp)->magic = (val);}
#define BU_LIST_MAGIC_OK(hp, val)   ((hp)->magic == (val))
#define BU_LIST_MAGIC_WRONG(hp, val)   ((hp)->magic != (val))
#define BU_LIST_LAST(structure, hp)   ((struct structure *)((hp)->back))
#define BU_LIST_BACK(structure, hp)   ((struct structure *)((hp)->back))
#define BU_LIST_PREV(structure, hp)   ((struct structure *)((hp)->back))
#define BU_LIST_FIRST(structure, hp)   ((struct structure *)((hp)->forw))
#define BU_LIST_FORW(structure, hp)   ((struct structure *)((hp)->forw))
#define BU_LIST_NEXT(structure, hp)   ((struct structure *)((hp)->forw))
#define BU_LIST_IS_HEAD(p, hp)   (((struct bu_list *)(p)) == (hp))
#define BU_LIST_NOT_HEAD(p, hp)   (((struct bu_list *)(p)) != (hp))
#define BU_CK_LIST_HEAD(_p)   BU_CKMAG( (_p), BU_LIST_HEAD_MAGIC, "bu_list")
#define BU_LIST_PREV_IS_HEAD(p, hp)   (((struct bu_list *)(p))->back == (hp))
#define BU_LIST_PREV_NOT_HEAD(p, hp)   (((struct bu_list *)(p))->back != (hp))
#define BU_LIST_NEXT_IS_HEAD(p, hp)   (((struct bu_list *)(p))->forw == (hp))
#define BU_LIST_NEXT_NOT_HEAD(p, hp)   (((struct bu_list *)(p))->forw != (hp))
#define BU_LIST_EACH(hp, p, type)
#define BU_LIST_REVEACH(hp, p, type)
#define BU_LIST_TAIL(hp, start, p, type)
#define BU_LIST_FOR(p, structure, hp)
#define BU_LIST_FOR_BACKWARDS(p, structure, hp)
#define BU_LIST_FOR_CIRC(p, structure, hp)
#define BU_LIST_FOR2(p1, p2, structure, hp1, hp2)
#define BU_LIST_WHILE(p, structure, hp)   (((p)=(struct structure *)((hp)->forw)) != (struct structure *)(hp))
#define BU_LIST_FIRST_MAGIC(hp)   ((hp)->forw->magic)
#define BU_LIST_LAST_MAGIC(hp)   ((hp)->back->magic)
#define BU_LIST_PNEXT(structure, p)   ((struct structure *)(((struct bu_list *)(p))->forw))
#define BU_LIST_PLAST(structure, p)   ((struct structure *)(((struct bu_list *)(p))->back))
#define BU_LIST_PNEXT_PNEXT(structure, p)   ((struct structure *)(((struct bu_list *)(p))->forw->forw))
#define BU_LIST_PNEXT_PLAST(structure, p)   ((struct structure *)(((struct bu_list *)(p))->forw->back))
#define BU_LIST_PLAST_PNEXT(structure, p)   ((struct structure *)(((struct bu_list *)(p))->back->forw))
#define BU_LIST_PLAST_PLAST(structure, p)   ((struct structure *)(((struct bu_list *)(p))->back->back))
#define BU_LIST_PNEXT_CIRC(structure, p)
#define BU_LIST_PPREV_CIRC(structure, p)
#define BU_LIST_MAIN_PTR(_type, _ptr2, _name2)   ((struct _type *)(((char *)(_ptr2)) - offsetof(struct _type, _name2.magic)))

Typedefs

typedef bu_list bu_list_t

Functions

bu_listbu_list_new ()
bu_listbu_list_pop (struct bu_list *hp)
int bu_list_len (const struct bu_list *hd)
void bu_list_reverse (struct bu_list *hd)
void bu_list_free (struct bu_list *hd)
void bu_list_parallel_append (struct bu_list *headp, struct bu_list *itemp)
bu_listbu_list_parallel_dequeue (struct bu_list *headp)
void bu_ck_list (const struct bu_list *hd, const char *str)
void bu_ck_list_magic (const struct bu_list *hd, const char *str, const long magic)
int bu_list_len (register const struct bu_list *hd)
void bu_list_reverse (register struct bu_list *hd)
void bu_ck_list_magic (const struct bu_list *hd, const char *str, const long int magic)
bu_listbu_list_dequeue_next (struct bu_list *hp, struct bu_list *p)

Detailed Description

B U _ L I S T

Doubly-linked list support

These macros assume that all user-provided structures will have a "struct bu_list" as their first element (often named "l" [ell]). Thus, a pointer to the bu_list struct is a "pun" for the user-provided structure as well, and the pointers can be converted back and forth safely with type casts.

Furthermore, the head of the linked list could be a full instance of the user-provided structure (although the storage-conscious programmer could make the head just an bu_list structure, with careful type casting). This results in a doubly-linked circular list, with the head having the same shape as all the list members. The application is free to make use of this symmetry and store data values in the head, or the extra storage in the head can be ignored.

Where a macro expects an argument "p", it should be a pointer to a user-provided structure.

Where a macro expects an argument "hp", it should be a pointer to a "struct bu_list" located in the list head, e.g., &(head.l).

Where a macro expects an argument "old", "new", or "cur", it should be a pointer to the "struct bu_list" located either in a user-provided structure, e.g. &((p)->l), or for the case of "old" it may also be in the list head, e.g. BU_LIST_INSERT( &(head.l), &((p)->l) );

Dequeueing the head of a list is a valid and well defined operation which should be performed with caution. Unless a pointer to some other element of the list is retained by the application, the rest of the linked list can no longer be referred to.

The "magic" field of the list header _must_ be set to the constant BU_LIST_HEAD_MAGIC, but the "magic" field of all list members should be established by user code, to identify the type of structure that the bu_list structure is embedded in. It is permissible for one list to contain an arbitrarily mixed set of user "magic" numbers, as long as the head is properly marked.

There is a dual set of terminology used in some of the macros: FIRST / LAST from the point of view of the list head NEXT / PREV from the point of view of a list member forw / back the actual pointer names


Define Documentation

#define BU_LIST_HEAD_MAGIC   0x01016580
 

Definition at line 526 of file bu.h.

Referenced by bu_ck_list(), bu_ck_list_magic(), bu_identify_magic(), get_solidbitv(), nmg_index_of_struct(), nmg_klu(), and nmg_vvu().

#define BU_LIST_NULL   ((struct bu_list *)0)
 

Definition at line 527 of file bu.h.

Referenced by bu_bitv_free(), bu_realloc(), and rt_nmg_idisk().

#define BU_LIST_CLOSE hp   ) 
 

Value:

{ \
        assert( (hp) != NULL ); \
        if( (hp) == NULL ) \
                return; \
        assert( BU_LIST_IS_EMPTY( (hp) ) ); \
        bu_list_free( (hp) ); \
        bu_free( (char *)(hp), "bu_list head" ); \
}

Definition at line 534 of file bu.h.

#define BU_LIST_INSERT old,
new   ) 
 

Value:

{ \
        (new)->back = (old)->back; \
        (old)->back = (new); \
        (new)->forw = (old); \
        (new)->back->forw = (new);  }

Definition at line 549 of file bu.h.

Referenced by bend_pipe_shot(), bu_list_parallel_append(), do_intersect(), do_subtract(), do_union(), eval_op(), isect_ray_lseg(), isect_ray_planar_face(), linear_pipe_shot(), nmg_cut_loop(), nmg_edge_g(), nmg_edge_g_cnurb(), nmg_edge_g_cnurb_plinear(), nmg_eins(), nmg_eval_linear_trim_to_tol(), nmg_eval_trim_to_tol(), nmg_fix_overlapping_loops(), nmg_jfg(), nmg_jl(), nmg_join_2loops(), nmg_jv(), nmg_mk_new_face_from_loop(), nmg_ml(), nmg_mlv(), nmg_move_lu_between_fus(), nmg_radial_build_list(), nmg_radial_sorted_list_insert(), nmg_split_linear_trim(), nmg_split_lu_at_vu(), nmg_split_trim(), nmg_use_edge_g(), pipe_end_shot(), pipe_start_shot(), promote_ints(), rt_arb_shot(), rt_arbn_shot(), rt_arc2d_to_cnurb(), rt_bend_pipe_prep(), rt_boolweave(), rt_cline_shot(), rt_ebm_dda(), rt_ell_shot(), rt_epa_shot(), rt_find_identical_solid(), rt_get_seg(), rt_linear_pipe_prep(), rt_metaball_import5(), rt_metaball_prep(), rt_metaball_shot(), rt_nurb_shot(), rt_part_shot(), rt_pipe_hitsort(), rt_pipe_import5(), rt_pipe_shot(), rt_pipe_tcladjust(), rt_rec_shot(), rt_rhc_shot(), rt_rpc_shot(), rt_seg_planeclip(), rt_sph_shot(), rt_submodel_a_hit(), rt_vol_shot(), shoot_and_plot(), wdb_add_operand(), wdb_append_inter(), wdb_append_lparen(), wdb_append_rparen(), wdb_append_subtr(), wdb_append_union(), and wdb_which_cmd().

#define BU_LIST_APPEND old,
new   ) 
 

Value:

{ \
        (new)->forw = (old)->forw; \
        (new)->back = (old); \
        (old)->forw = (new); \
        (new)->forw->back = (new);  }

Definition at line 560 of file bu.h.

Referenced by bu_add_hook(), bu_list_reverse(), bu_log_add_hook(), bu_open_mapped_file(), bu_realloc(), dgo_drawH_part2(), dgo_invent_solid(), dgo_open_cmd(), eval_op(), make_near_list(), nmg_cut_loop(), nmg_demote_lu(), nmg_do_radial_flips(), nmg_eins(), nmg_eusplit(), nmg_face_g(), nmg_face_g_snurb(), nmg_face_new_g(), nmg_fix_overlapping_loops(), nmg_jl(), nmg_join_2loops(), nmg_me(), nmg_meonvu(), nmg_merge_regions(), nmg_mf(), nmg_ml(), nmg_mmr(), nmg_moveltof(), nmg_movevu(), nmg_mrsv(), nmg_msv(), nmg_mv_eu_between_shells(), nmg_mv_fu_between_shells(), nmg_mv_lu_between_shells(), nmg_mv_shell_to_region(), nmg_radial_sorted_list_insert(), nmg_split_lu_at_vu(), nmg_triangulate_fu(), promote_ints(), rt_nurb_bezier(), rt_nurb_c_xsplit(), rt_nurb_intersect(), rt_pipe_import(), rt_rebuild_overlaps(), subdivide_bezier(), vo_open_cmd(), wdb_init_obj(), and wdb_shells_cmd().

#define BU_LIST_DEQUEUE cur   ) 
 

Value:

{ \
        (cur)->forw->back = (cur)->back; \
        (cur)->back->forw = (cur)->forw; \
        (cur)->forw = (cur)->back = BU_LIST_NULL;  /* sanity */ }

Definition at line 567 of file bu.h.

Referenced by bn_vlist_cleanup(), bu_delete_hook(), bu_free(), bu_free_mapped_files(), bu_list_dequeue_next(), bu_list_free(), bu_list_parallel_dequeue(), bu_list_reverse(), bu_log_delete_hook(), bu_observer_free(), bu_rb_free_node(), bu_rb_free_package(), bu_realloc(), classify_seg(), dgo_deleteProc(), dgo_zap_cmd(), eliminate_overlaps(), eval_op(), get_solidbitv(), isect_ray_snurb_face(), make_near_list(), nmg_class_ray_vs_shell(), nmg_cut_loop(), nmg_demote_lu(), nmg_do_radial_flips(), nmg_edge_g(), nmg_edge_g_cnurb(), nmg_edge_g_cnurb_plinear(), nmg_eins(), nmg_eu_radial_check(), nmg_eusplit(), nmg_face_new_g(), nmg_fix_overlapping_loops(), nmg_jfg(), nmg_jl(), nmg_join_2loops(), nmg_jv(), nmg_keu(), nmg_kfu(), nmg_klu(), nmg_kr(), nmg_ks(), nmg_kvu(), nmg_merge_regions(), nmg_mf(), nmg_mk_new_face_from_loop(), nmg_ml(), nmg_move_lu_between_fus(), nmg_moveltof(), nmg_movevu(), nmg_mv_eu_between_shells(), nmg_mv_fu_between_shells(), nmg_mv_lu_between_shells(), nmg_mv_shell_to_region(), nmg_radial_join_eu_NEW(), nmg_radial_merge_lists(), nmg_s_radial_harmonize(), nmg_split_lu_at_vu(), nmg_triangulate_fu(), nmg_use_edge_g(), promote_ints(), rt_boolweave(), rt_clean(), rt_clean_resource(), rt_del_regtree(), rt_free_soltab(), rt_join_cnurbs(), rt_metaball_ifree(), rt_nurb_bezier(), rt_nurb_free(), rt_nurb_intersect(), rt_pipe_hitsort(), rt_pipe_ifree(), rt_pipe_shot(), rt_process_casec(), rt_rebuild_overlaps(), rt_seg_planeclip(), rt_shootray(), rt_shootray_bundle(), shoot_and_plot(), subdivide_bezier(), wdb_deleteProc(), wdb_do_inter(), wdb_do_paren(), wdb_do_union_subtr(), wdb_eval_bool(), wdb_free_tokens(), and wdb_shells_cmd().

#define BU_LIST_DQ cur   ) 
 

Value:

{\
        (cur)->forw->back = (cur)->back; \
        (cur)->back->forw = (cur)->forw; }

Definition at line 573 of file bu.h.

#define BU_LIST_DQ_T cur,
type   ) 
 

Value:

(\
        (cur)->forw->back = (cur)->back, \
        (cur)->back->forw = (cur)->forw, \
        (type *)(cur) )

Definition at line 577 of file bu.h.

#define BU_LIST_DEQUEUE_T cur,
type   ) 
 

Value:

(\
        (cur)->forw->back = (cur)->back, \
        (cur)->back->forw = (cur)->forw, \
        (cur)->forw = (cur)->back = BU_LIST_NULL, \
        (type *)(cur) )

Definition at line 585 of file bu.h.

#define BU_LIST_PUSH hp,
 )     BU_LIST_APPEND(hp, (struct bu_list *)(p))
 

Definition at line 599 of file bu.h.

#define BU_LIST_POP structure,
hp,
 ) 
 

Value:

{                                                       \
                if (BU_LIST_NON_EMPTY(hp))                              \
                {                                                       \
                    (p) = ((struct structure *)((hp)->forw));           \
                    BU_LIST_DEQUEUE((struct bu_list *)(p));             \
                }                                                       \
                else                                                    \
                     (p) = (struct structure *) 0;                      \
        }

Definition at line 602 of file bu.h.

Referenced by bu_list_pop().

#define BU_LIST_POP_T hp,
type   )     (type *)bu_list_pop( hp )
 

Definition at line 613 of file bu.h.

#define BU_LIST_INSERT_LIST dest_hp,
src_hp   ) 
 

Value:

if( BU_LIST_NON_EMPTY(src_hp) )  { \
                register struct bu_list *_first = (src_hp)->forw; \
                register struct bu_list *_last = (src_hp)->back; \
                (dest_hp)->forw->back = _last; \
                _last->forw = (dest_hp)->forw; \
                (dest_hp)->forw = _first; \
                _first->back = (dest_hp); \
                (src_hp)->forw = (src_hp)->back = (src_hp); \
        }
"Bulk transfer" all elements from the list headed by src_hd onto the list headed by dest_hd, without examining every element in the list. src_hd is left with a valid but empty list.

BU_LIST_INSERT_LIST places src_hd elements at head of dest_hd list, BU_LIST_APPEND_LIST places src_hd elements at end of dest_hd list.

Definition at line 624 of file bu.h.

Referenced by bu_list_reverse(), eval_etree(), and eval_op().

#define BU_LIST_APPEND_LIST dest_hp,
src_hp   ) 
 

Value:

if( BU_LIST_NON_EMPTY(src_hp) )  {\
                register struct bu_list *_first = (src_hp)->forw; \
                register struct bu_list *_last = (src_hp)->back; \
                _first->back = (dest_hp)->back; \
                (dest_hp)->back->forw = _first; \
                (dest_hp)->back = _last; \
                _last->forw = (dest_hp); \
                (src_hp)->forw = (src_hp)->back = (src_hp); \
        }

Definition at line 635 of file bu.h.

Referenced by dgo_drawH_part2(), dgo_invent_solid(), nmg_merge_models(), rt_dsp_shot(), and subdivide_bezier().

#define BU_LIST_IS_EMPTY hp   )     ((hp)->forw == (hp))
 

Test if a doubly linked list is empty, given head pointer

Definition at line 647 of file bu.h.

Referenced by bu_flog(), bu_log(), bu_putchar(), dgo_autoview(), dgo_cvt_vlblock_to_solids(), dgo_get_autoview_cmd(), eval_op(), get_solidbitv(), make_near_list(), nmg_isect_ray_model(), nmg_keu(), nmg_kfu(), nmg_kill_snakes(), nmg_klu(), nmg_kr(), nmg_ks(), nmg_kvu(), nmg_ml(), nmg_move_lu_between_fus(), nmg_movevu(), nmg_mv_eu_between_shells(), nmg_mv_fu_between_shells(), nmg_mv_lu_between_shells(), nmg_mv_shell_to_region(), nmg_radial_sorted_list_insert(), nmg_ray_segs(), nmg_sanitize_s_lv(), nmg_shell_a(), nmg_shell_manifolds(), nmg_simplify_face(), nmg_simplify_shell_edges(), rt_dsp_shot(), rt_ebm_dda(), rt_nmg_tess(), rt_pipe_plot(), rt_pipe_prep(), rt_pipe_tess(), rt_plot_solid(), rt_plot_vlblock(), rt_shootray(), rt_shootray_bundle(), rt_vlblock_free(), rt_vol_shot(), show_seg(), and wdb_do_paren().

#define BU_LIST_NON_EMPTY hp   )     ((hp)->forw != (hp))
 

Definition at line 648 of file bu.h.

Referenced by bu_bomb(), free_etree(), isect_ray_snurb_face(), nmg_class_shells(), nmg_classify_s_vs_s(), nmg_demote_lu(), nmg_do_bool(), nmg_extrude_cleanup(), nmg_jeg(), nmg_jfg(), nmg_join_2loops(), nmg_js(), nmg_keg(), nmg_kfu(), nmg_kill_wire_edges(), nmg_klu(), nmg_km(), nmg_kr(), nmg_ks(), nmg_merge_regions(), nmg_ml(), nmg_rm_redundancies(), nmg_shell_is_empty(), nmg_shell_manifolds(), nmg_vshell(), rt_boolweave(), rt_nmg_tclget(), rt_pipe_free(), rt_process_uplot_value(), shoot_and_plot(), and wdb_nmg_simplify_cmd().

#define BU_LIST_NON_EMPTY_P p,
structure,
hp   )     (((p)=(struct structure *)((hp)->forw)) != (struct structure *)(hp))
 

Definition at line 649 of file bu.h.

#define BU_LIST_IS_CLEAR hp   ) 
 

Value:

((hp)->magic == 0 && \
                        (hp)->forw == BU_LIST_NULL && \
                        (hp)->back == BU_LIST_NULL)

Definition at line 651 of file bu.h.

#define BU_LIST_UNINITIALIZED hp   )     ((hp)->forw == BU_LIST_NULL)
 

Definition at line 656 of file bu.h.

Referenced by bn_vlblock_init(), bn_vlist_cleanup(), bu_open_mapped_file(), dgo_E_cmd(), nmg_class_ray_vs_shell(), rt_cell_n_on_ray(), rt_cut_clean(), rt_get_seg(), Rt_Init(), rt_init_resource(), rt_shootray(), and rt_shootray_bundle().

#define BU_LIST_IS_INITIALIZED hp   )     ((hp)->forw != BU_LIST_NULL)
 

Definition at line 657 of file bu.h.

Referenced by rt_clean_resource(), and rt_free_rti().

#define BU_LIST_INIT hp   ) 
 

Value:

{ \
        (hp)->forw = (hp)->back = (hp); \
        (hp)->magic = BU_LIST_HEAD_MAGIC;       /* used by circ. macros */ }

Definition at line 658 of file bu.h.

Referenced by bn_vlblock_init(), bn_vlist_cleanup(), bu_bitv_new(), bu_hook_list_init(), bu_list_new(), bu_list_reverse(), bu_open_mapped_file(), bu_ptbl_init(), bu_rb_create(), build_etree(), Cho_Init(), classify_seg(), db5_diradd(), db_diradd(), db_diradd5(), dgo_E_cmd(), Dgo_Init(), dgo_invent_solid(), dgo_open_cmd(), eval_etree(), eval_op(), facetize_region_end(), isect_ray_snurb_face(), nmg_class_pt_lu_except(), nmg_class_ray_vs_shell(), nmg_edge_g(), nmg_edge_g_cnurb(), nmg_edge_g_cnurb_plinear(), nmg_eu_radial_check(), nmg_eusplit(), nmg_face_g(), nmg_face_g_snurb(), nmg_face_new_g(), nmg_flatten_face(), nmg_kvu(), nmg_me(), nmg_meonvu(), nmg_mf(), nmg_ml(), nmg_mlv(), nmg_mm(), nmg_mmr(), nmg_mrsv(), nmg_msv(), nmg_radial_join_eu_NEW(), nmg_s_radial_harmonize(), nmg_triangulate_fu(), rt_arc2d_to_cnurb(), rt_clean_resource(), rt_cline_shot(), rt_dsp_shot(), rt_ebm_shot(), rt_ebm_tess(), rt_get_seg(), rt_htbl_init(), Rt_Init(), rt_init_resource(), rt_metaball_import5(), rt_metaball_prep(), rt_new_rti(), rt_nmg_ialloc(), rt_nmg_shot(), rt_nurb_bezier(), rt_nurb_intersect(), rt_nurb_prep(), rt_pipe_import(), rt_pipe_import5(), rt_pipe_prep(), rt_pipe_shot(), rt_pipe_tcladjust(), rt_plot_solid(), rt_process_casec(), rt_shootray(), rt_shootray_bundle(), rt_vstub(), shoot_and_plot(), subdivide_bezier(), Vo_Init(), vo_open_cmd(), wdb_comb_std_cmd(), wdb_init_obj(), wdb_rmap_cmd(), wdb_track_cmd(), and wdb_which_cmd().

#define BU_LIST_MAGIC_SET hp,
val   )     {(hp)->magic = (val);}
 

Definition at line 661 of file bu.h.

Referenced by bu_realloc(), isect_ray_lseg(), isect_ray_planar_face(), and nmg_flatten_face().

#define BU_LIST_MAGIC_OK hp,
val   )     ((hp)->magic == (val))
 

Definition at line 662 of file bu.h.

#define BU_LIST_MAGIC_WRONG hp,
val   )     ((hp)->magic != (val))
 

Definition at line 663 of file bu.h.

Referenced by bu_free(), bu_realloc(), and rt_shootray().

#define BU_LIST_LAST structure,
hp   )     ((struct structure *)((hp)->back))
 

Definition at line 668 of file bu.h.

Referenced by dgo_drawH_part2(), dgo_invent_solid(), nmg_dup_loop(), nmg_edge_collapse(), nmg_extrude_cleanup(), rt_ebm_dda(), rt_extrude_plot(), rt_pipe_shot(), rt_pipe_tcladjust(), rt_process_uplot_value(), rt_tgc_tnurb(), and rt_vol_shot().

#define BU_LIST_BACK structure,
hp   )     ((struct structure *)((hp)->back))
 

Definition at line 670 of file bu.h.

#define BU_LIST_PREV structure,
hp   )     ((struct structure *)((hp)->back))
 

Definition at line 672 of file bu.h.

Referenced by bu_cmdhist_history(), nmg_radial_sorted_list_insert(), nmg_shell_coplanar_face_merge(), nmg_simplify_face(), nmg_simplify_shell(), rt_pipe_hitsort(), tesselate_pipe_end(), wdb_do_inter(), wdb_do_paren(), and wdb_do_union_subtr().

#define BU_LIST_FIRST structure,
hp   )     ((struct structure *)((hp)->forw))
 

Definition at line 674 of file bu.h.

Referenced by add_solid(), bu_free_mapped_files(), bu_list_parallel_dequeue(), bu_log_call_hooks(), bu_observer_free(), eliminate_overlaps(), eval_op(), isect_ray_snurb_face(), make_near_list(), nmg_add_loop_to_face(), nmg_booltree_evaluate(), nmg_ck_closed_surf(), nmg_ck_fu_verts(), nmg_ck_lu(), nmg_ck_lueu(), nmg_class_lu_fu(), nmg_class_shells(), nmg_classify_lu_lu(), nmg_classify_s_vs_s(), nmg_cut_loop(), nmg_cut_lu_into_coplanar_and_non(), nmg_decompose_shell(), nmg_demote_lu(), nmg_do_bool(), nmg_do_radial_flips(), nmg_dup_loop(), nmg_edge_collapse(), nmg_enlist_vu(), nmg_extrude_cleanup(), nmg_extrude_shell(), nmg_face_rs_init(), nmg_find_max_index(), nmg_find_model(), nmg_find_pt_in_lu(), nmg_find_pt_in_shell(), nmg_find_vertex_in_lu(), nmg_fix_normals(), nmg_fix_overlapping_loops(), nmg_flatten_face(), nmg_fu_planeeqn(), nmg_hollow_shell(), nmg_is_vertex_in_looplist(), nmg_isect_vert2p_face2p(), nmg_jeg(), nmg_jfg(), nmg_js(), nmg_jv(), nmg_kfu(), nmg_kill_anti_loops(), nmg_kill_cracks(), nmg_kill_cracks_at_vertex(), nmg_kill_non_common_cracks(), nmg_kill_snakes(), nmg_kill_wire_edges(), nmg_kill_zero_length_edgeuses(), nmg_klu(), nmg_km(), nmg_kr(), nmg_ks(), nmg_loop_g(), nmg_loop_plane_area(), nmg_lu_is_convex(), nmg_lu_to_vlist(), nmg_m_reindex(), nmg_m_set_high_bit(), nmg_m_struct_count(), nmg_make_dualvu(), nmg_meonvu(), nmg_merge_regions(), nmg_ml(), nmg_model_edge_g_fuse(), nmg_move_edge_thru_pt(), nmg_moveltof(), nmg_reclassify_lu_eu(), nmg_rm_redundancies(), nmg_sanitize_fu(), nmg_sanitize_s_lv(), nmg_simplify_loop(), nmg_simplify_shell_edges(), nmg_split_loops_handler(), nmg_split_lu_at_vu(), nmg_tabulate_face_g_verts(), nmg_to_arb(), nmg_to_poly(), nmg_to_tgc(), nmg_triangulate_fu(), nmg_visit_loopuse(), nmg_vlist_to_wire_edges(), nmg_vlu(), promote_ints(), rt_arb_tess(), rt_arb_tnurb(), rt_ars_prep(), rt_boolweave(), rt_bot_tess(), rt_cline_tess(), rt_ebm_tess(), rt_ehy_tess(), rt_ell_tess(), rt_ell_tnurb(), rt_epa_tess(), rt_join_cnurbs(), rt_new_rti(), rt_nmg_tclget(), rt_nmg_tess(), rt_part_tess(), rt_pg_tess(), rt_pipe_ck(), rt_pipe_hitsort(), rt_pipe_norm(), rt_pipe_plot(), rt_pipe_prep(), rt_pipe_shot(), rt_pipe_tess(), rt_rhc_tess(), rt_rpc_tess(), rt_shootray(), rt_shootray_bundle(), rt_tgc_tnurb(), rt_vls_pipept(), rt_vol_tess(), stash_shell(), tesselate_pipe_end(), tesselate_pipe_linear(), tesselate_pipe_start(), wdb_facetize_cmd(), wdb_nmg_simplify_cmd(), and wdb_shells_cmd().

#define BU_LIST_FORW structure,
hp   )     ((struct structure *)((hp)->forw))
 

Definition at line 676 of file bu.h.

#define BU_LIST_NEXT structure,
hp   )     ((struct structure *)((hp)->forw))
 

Definition at line 678 of file bu.h.

Referenced by bu_free_mapped_files(), bu_list_dequeue_next(), dgo_zap_cmd(), nmg_edge_collapse(), nmg_kill_cracks_at_vertex(), nmg_rm_redundancies(), nmg_shell_a(), nmg_shell_coplanar_face_merge(), nmg_simplify_shell_edges(), nmg_vertex_gv(), rt_ell_tnurb(), rt_extrude_plot(), rt_join_cnurbs(), rt_pipe_ck(), rt_pipe_hitsort(), rt_pipe_norm(), rt_pipe_plot(), rt_pipe_prep(), rt_pipe_shot(), rt_pipe_tess(), rt_tgc_tnurb(), rt_vls_pipept(), tesselate_pipe_start(), wdb_do_inter(), wdb_do_paren(), wdb_do_union_subtr(), and wdb_eval_bool().

#define BU_LIST_IS_HEAD p,
hp   )     (((struct bu_list *)(p)) == (hp))
 

Definition at line 682 of file bu.h.

Referenced by bu_cmdhist_next(), dgo_get_eyemodel_cmd(), eliminate_overlaps(), nmg_fix_overlapping_loops(), nmg_shell_coplanar_face_merge(), promote_ints(), rt_pipe_hitsort(), rt_pipe_plot(), rt_pipe_prep(), rt_pipe_tess(), and wdb_which_cmd().

#define BU_LIST_NOT_HEAD p,
hp   )     (((struct bu_list *)(p)) != (hp))
 

Definition at line 684 of file bu.h.

Referenced by bu_cmdhist_curr(), bu_cmdhist_history(), bu_cmdhist_prev(), bu_free_mapped_files(), bu_list_parallel_dequeue(), bu_observer_free(), dgo_zap_cmd(), eliminate_overlaps(), eval_op(), make_near_list(), nmg_break_crossed_loops(), nmg_class_shells(), nmg_classify_lu_lu(), nmg_do_radial_flips(), nmg_edge_collapse(), nmg_extrude_cleanup(), nmg_find_pt_in_shell(), nmg_js(), nmg_jv(), nmg_kill_cracks(), nmg_kill_cracks_at_vertex(), nmg_kill_non_common_cracks(), nmg_kill_snakes(), nmg_kill_zero_length_edgeuses(), nmg_radial_mark_cracks(), nmg_rm_redundancies(), nmg_sanitize_fu(), nmg_sanitize_s_lv(), nmg_shell_a(), nmg_shell_coplanar_face_merge(), nmg_simplify_loop(), nmg_simplify_shell_edges(), nmg_split_loops_handler(), promote_ints(), rt_ebm_tess(), rt_join_cnurbs(), rt_nmg_tess(), rt_pipe_ck(), rt_pipe_hitsort(), rt_pipe_shot(), and rt_vls_pipept().

#define BU_CK_LIST_HEAD _p   )     BU_CKMAG( (_p), BU_LIST_HEAD_MAGIC, "bu_list")
 

Definition at line 686 of file bu.h.

Referenced by bu_list_reverse(), make_near_list(), nmg_cnurb_is_on_crv(), nmg_cnurb_to_vlist(), nmg_do_radial_flips(), nmg_do_radial_join(), nmg_find_radial_eu(), nmg_insure_radial_list_is_increasing(), nmg_lu_to_vlist(), nmg_pr_radial_list(), nmg_radial_build_list(), nmg_radial_check_parity(), nmg_radial_exchange_marked(), nmg_radial_find_an_original(), nmg_radial_implement_decisions(), nmg_radial_mark_cracks(), nmg_radial_mark_flips(), nmg_radial_merge_lists(), nmg_radial_sorted_list_insert(), nmg_radial_verify_monotone(), nmg_radial_verify_pointers(), nmg_snurb_fu_to_vlist(), nmg_snurb_to_vlist(), rt_join_cnurbs(), wdb_add_operand(), wdb_add_operator(), wdb_append_inter(), wdb_append_lparen(), wdb_append_rparen(), wdb_append_subtr(), wdb_append_union(), and wdb_free_tokens().

#define BU_LIST_PREV_IS_HEAD p,
hp   )     (((struct bu_list *)(p))->back == (hp))
 

Definition at line 689 of file bu.h.

#define BU_LIST_PREV_NOT_HEAD p,
hp   )     (((struct bu_list *)(p))->back != (hp))
 

Definition at line 691 of file bu.h.

#define BU_LIST_NEXT_IS_HEAD p,
hp   )     (((struct bu_list *)(p))->forw == (hp))
 

Definition at line 695 of file bu.h.

Referenced by nmg_shell_coplanar_face_merge().

#define BU_LIST_NEXT_NOT_HEAD p,
hp   )     (((struct bu_list *)(p))->forw != (hp))
 

Definition at line 697 of file bu.h.

Referenced by nmg_to_arb(), nmg_to_tgc(), rt_nmg_tess(), and rt_pipe_hitsort().

#define BU_LIST_EACH hp,
p,
type   ) 
 

Value:

for( (p)=(type *)BU_LIST_FIRST(bu_list,hp); \
              BU_LIST_NOT_HEAD(p,hp); \
              (p)=(type *)BU_LIST_PNEXT(bu_list,p) ) \

Definition at line 700 of file bu.h.

#define BU_LIST_REVEACH hp,
p,
type   ) 
 

Value:

for( (p)=(type *)BU_LIST_LAST(bu_list,hp); \
              BU_LIST_NOT_HEAD(p,hp); \
              (p)=(type *)BU_LIST_PREV(bu_list,((struct bu_list *)(p))) ) \

Definition at line 705 of file bu.h.

#define BU_LIST_TAIL hp,
start,
p,
type   ) 
 

Value:

for( (p)=(type *)start ; \
              BU_LIST_NOT_HEAD(p,hp); \
              (p)=(type *)BU_LIST_PNEXT(bu_list,(p)) )

Definition at line 710 of file bu.h.

#define BU_LIST_FOR p,
structure,
hp   ) 
 

Value:

(p)=BU_LIST_FIRST(structure,hp); \
        BU_LIST_NOT_HEAD(p,hp); \
        (p)=BU_LIST_PNEXT(structure,p)
Intended as innards for a for() loop to visit all nodes on list, e.g.: for( BU_LIST_FOR( p, structure, hp ) ) { work_on( p ); }

Definition at line 721 of file bu.h.

Referenced by bu_call_hook(), bu_cmdhist_history(), bu_delete_hook(), bu_list_len(), bu_log_delete_hook(), bu_observer_notify(), bu_open_mapped_file(), cho_open_tcl(), dgo_E_cmd(), dgo_eraseobjall_callback(), dgo_get_eyemodel_cmd(), dgo_impending_wdb_close(), dgo_notifyWdb(), dgo_qray_data_to_vlist(), dgo_rtabort_cmd(), dgo_zapall(), eval_op(), get_solidbitv(), isect_ray_planar_face(), make_near_list(), nmg_bad_face_normals(), nmg_bot(), nmg_break_crossed_loops(), nmg_break_long_edges(), nmg_calc_face_plane(), nmg_check_closed_shell(), nmg_ck_closed_region(), nmg_ck_closed_surf(), nmg_ck_eg_verts(), nmg_ck_face_worthless_edges(), nmg_ck_fg_verts(), nmg_ck_fu(), nmg_ck_fu_verts(), nmg_ck_hitmiss_list(), nmg_ck_lu(), nmg_ck_lueu(), nmg_ck_v_in_2fus(), nmg_ck_vert_on_fus(), nmg_ck_vu_ptbl(), nmg_class_pt_lu_except(), nmg_class_pt_s(), nmg_class_ray_vs_shell(), nmg_classify_lu_lu(), nmg_close_shell(), nmg_cnurb_is_on_crv(), nmg_common_v_2eg(), nmg_connect_same_fu_orients(), nmg_count_shell_kids(), nmg_crackshells(), nmg_cut_lu_into_coplanar_and_non(), nmg_dangling_face(), nmg_decompose_shell(), nmg_do_radial_join(), nmg_does_fu_use_eg(), nmg_dup_face(), nmg_dup_loop(), nmg_dup_shell(), nmg_edge_collapse(), nmg_edgeuse_with_eg_tabulate(), nmg_eu_is_part_of_crack(), nmg_eu_radial_check(), nmg_eu_to_vlist(), nmg_extrude_cleanup(), nmg_extrude_shell(), nmg_face_bb(), nmg_face_new_g(), nmg_face_rs_init(), nmg_faces_are_radial(), nmg_faceuse_area(), nmg_find_e(), nmg_find_edge_between_2fu(), nmg_find_eg_between_2fg(), nmg_find_eu_in_face(), nmg_find_eu_with_vu_in_lu(), nmg_find_fu_with_fg_in_s(), nmg_find_isect_faces(), nmg_find_max_index(), nmg_find_outer_and_void_shells(), nmg_find_pt_in_face(), nmg_find_pt_in_lu(), nmg_find_pt_in_model(), nmg_find_pt_in_shell(), nmg_find_radial_eu(), nmg_find_repeated_v_in_lu(), nmg_find_top_face_in_dir(), nmg_find_v_in_face(), nmg_find_v_in_shell(), nmg_find_vertex_in_lu(), nmg_findeu(), nmg_fix_decomposed_shell_normals(), nmg_fix_normals(), nmg_fix_overlapping_loops(), nmg_flatten_face(), nmg_follow_free_edges_to_vertex(), nmg_fu_touchingloops(), nmg_get_interior_pt(), nmg_get_touching_jaunts(), nmg_glue_face_in_shell(), nmg_hollow_shell(), nmg_insure_radial_list_is_increasing(), nmg_intersect_loops_self(), nmg_invert_shell(), nmg_is_common_bigloop(), nmg_is_edge_in_edgelist(), nmg_is_edge_in_facelist(), nmg_is_edge_in_looplist(), nmg_is_loop_in_facelist(), nmg_is_vertex_a_selfloop_in_shell(), nmg_is_vertex_in_edgelist(), nmg_is_vertex_in_face(), nmg_is_vertex_in_facelist(), nmg_is_vertex_in_looplist(), nmg_isect_eu_fu(), nmg_isect_face3p_shell_int(), nmg_isect_fu_jra(), nmg_isect_ray_model(), nmg_isect_shell_self(), nmg_isect_vert2p_face2p(), nmg_join_touchingloops(), nmg_k0eu(), nmg_kill_accordions(), nmg_kill_anti_loops(), nmg_kill_cracks(), nmg_kill_cracks_at_vertex(), nmg_kill_non_common_cracks(), nmg_loop_g(), nmg_loop_is_a_crack(), nmg_loop_plane_area(), nmg_loop_plane_newell(), nmg_loop_touches_self(), nmg_lu_to_vlist(), nmg_m_reindex(), nmg_m_set_high_bit(), nmg_m_struct_count(), nmg_m_to_vlist(), nmg_make_dualvu(), nmg_make_faces_at_vert(), nmg_make_faces_within_tol(), nmg_manifolds(), nmg_merge_models(), nmg_mesh_face_shell(), nmg_mesh_shell_shell(), nmg_mesh_two_faces(), nmg_mk_model_from_region(), nmg_mk_new_face_from_loop(), nmg_model_area(), nmg_model_bb(), nmg_model_fuse(), nmg_move_edge_thru_pt(), nmg_open_shells_connect(), nmg_pl_fu(), nmg_pl_hitmiss_list(), nmg_pl_isect(), nmg_pr_fu(), nmg_pr_fu_briefly(), nmg_pr_fus_in_fg(), nmg_pr_lu(), nmg_pr_lu_briefly(), nmg_pr_m(), nmg_pr_r(), nmg_pr_radial_list(), nmg_pr_s(), nmg_pr_s_briefly(), nmg_propagate_normals(), nmg_r_radial_check(), nmg_r_to_vlist(), nmg_radial_exchange_marked(), nmg_radial_find_an_original(), nmg_radial_implement_decisions(), nmg_radial_mark_cracks(), nmg_radial_mark_flips(), nmg_radial_verify_monotone(), nmg_radial_verify_pointers(), nmg_ray_segs(), nmg_rebound(), nmg_reclassify_lu_eu(), nmg_region_a(), nmg_region_area(), nmg_reverse_face_and_radials(), nmg_reverse_radials(), nmg_rm_redundancies(), nmg_rt_print_hitlist(), nmg_s_join_touchingloops(), nmg_s_split_touchingloops(), nmg_s_to_vlist(), nmg_search_v_eg(), nmg_shell_a(), nmg_shell_area(), nmg_shell_coplanar_face_merge(), nmg_shell_manifolds(), nmg_show_broken_classifier_stuff(), nmg_show_each_loop(), nmg_simplify_face(), nmg_simplify_shell(), nmg_simplify_shell_edges(), nmg_snurb_calc_lu_uv_orient(), nmg_split_loops_handler(), nmg_split_touchingloops(), nmg_tabulate_face_g_verts(), nmg_to_arb(), nmg_to_poly(), nmg_to_tgc(), nmg_translate_face(), nmg_triangulate_fu(), nmg_triangulate_model(), nmg_triangulate_shell(), nmg_two_face_fuse(), nmg_unbreak_edge(), nmg_unbreak_shell_edge_unsafe(), nmg_uv_in_lu(), nmg_veg(), nmg_veu(), nmg_vfu(), nmg_visit_faceuse(), nmg_visit_loopuse(), nmg_visit_model(), nmg_visit_region(), nmg_visit_shell(), nmg_vlblock_fu(), nmg_vlblock_lu(), nmg_vlblock_m(), nmg_vlblock_r(), nmg_vlblock_s(), nmg_vlist_to_eu(), nmg_vlist_to_wire_edges(), nmg_vlu(), nmg_vregion(), nmg_vshell(), nmg_vvertex(), promote_ints(), rt_ck(), rt_ck_vlist(), rt_clean(), rt_dsp_shot(), rt_find_identical_solid(), rt_getregion(), rt_gettrees_muves(), rt_join_cnurbs(), rt_label_vlist_verts(), rt_load_attrs(), rt_metaball_describe(), rt_metaball_export5(), rt_metaball_get_bounding_sphere(), rt_metaball_norm(), rt_metaball_plot(), rt_metaball_point_value(), rt_metaball_prep(), rt_nmg_prep(), rt_nmg_tclget(), rt_nurb_prep(), rt_nurb_shot(), rt_pipe_describe(), rt_pipe_export(), rt_pipe_export5(), rt_pipe_shot(), rt_pipe_tcladjust(), rt_pipe_tclget(), rt_pipe_tess(), rt_prep_parallel(), rt_regionfix(), rt_submodel_a_hit(), rt_vlist_copy(), rt_vlist_export(), rt_vlist_to_uplot(), show_seg(), stash_shell(), tesselate_pipe_end(), tesselate_pipe_linear(), tesselate_pipe_start(), wdb_check_syntax(), wdb_do_inter(), wdb_do_paren(), wdb_do_union_subtr(), wdb_get_obj_bounds(), wdb_nmg_simplify_cmd(), wdb_shells_cmd(), and wdb_which_cmd().

#define BU_LIST_FOR_BACKWARDS p,
structure,
hp   ) 
 

Value:

(p)=BU_LIST_LAST(structure,hp); \
        BU_LIST_NOT_HEAD(p,hp); \
        (p)=BU_LIST_PLAST(structure,p)

Definition at line 726 of file bu.h.

Referenced by nmg_radial_sorted_list_insert(), and rt_nmg_tclget().

#define BU_LIST_FOR_CIRC p,
structure,
hp   ) 
 

Value:

(p)=BU_LIST_PNEXT_CIRC(structure,hp); \
        (p) != (hp); \
        (p)=BU_LIST_PNEXT_CIRC(structure,p)
Process all the list members except hp and the actual head. Useful when starting somewhere besides the head.

Definition at line 735 of file bu.h.

Referenced by nmg_radial_check_parity(), and nmg_radial_mark_flips().

#define BU_LIST_FOR2 p1,
p2,
structure,
hp1,
hp2   ) 
 

Value:

(p1)=BU_LIST_FIRST(structure,hp1),                      \
                (p2)=BU_LIST_FIRST(structure,hp2);                      \
                BU_LIST_NOT_HEAD((struct bu_list *)(p1),(hp1)) &&       \
                BU_LIST_NOT_HEAD((struct bu_list *)(p2),(hp2));         \
                (p1)=BU_LIST_NEXT(structure,(struct bu_list *)(p1)),    \
                (p2)=BU_LIST_NEXT(structure,(struct bu_list *)(p2))

Definition at line 747 of file bu.h.

Referenced by nmg_extrude_face().

#define BU_LIST_WHILE p,
structure,
hp   )     (((p)=(struct structure *)((hp)->forw)) != (struct structure *)(hp))
 

Innards for a while() loop that constantly picks off the first element. Useful mostly for a loop that will dequeue every list element, e.g.: while( BU_LIST_WHILE(p, structure, hp) ) {
BU_LIST_DEQUEUE( &(p->l) );
free( (char *)p );
}

Definition at line 763 of file bu.h.

Referenced by bn_vlist_cleanup(), bu_list_free(), bu_list_reverse(), bu_rb_free(), classify_seg(), eval_op(), nmg_class_ray_vs_shell(), nmg_eu_radial_check(), nmg_radial_join_eu_NEW(), nmg_radial_merge_lists(), nmg_s_radial_harmonize(), nmg_triangulate_fu(), rt_clean(), rt_clean_resource(), rt_metaball_ifree(), rt_nurb_bezier(), rt_nurb_free(), rt_nurb_intersect(), rt_pipe_hitsort(), rt_pipe_ifree(), rt_pipe_shot(), rt_process_casec(), rt_seg_planeclip(), shoot_and_plot(), and wdb_free_tokens().

#define BU_LIST_FIRST_MAGIC hp   )     ((hp)->forw->magic)
 

Return the magic number of the first (or last) item on a list

Definition at line 767 of file bu.h.

Referenced by nmg_bot(), nmg_break_crossed_loops(), nmg_break_long_edges(), nmg_calc_face_plane(), nmg_check_closed_shell(), nmg_ck_closed_surf(), nmg_ck_face_worthless_edges(), nmg_ck_fu_verts(), nmg_ck_lu(), nmg_ck_lueu(), nmg_class_lu_fu(), nmg_class_pt_lu_except(), nmg_classify_lu_lu(), nmg_close_shell(), nmg_connect_same_fu_orients(), nmg_crackshells(), nmg_cut_lu_into_coplanar_and_non(), nmg_dangling_face(), nmg_decompose_shell(), nmg_demote_lu(), nmg_does_fu_use_eg(), nmg_dup_loop(), nmg_extrude_face(), nmg_face_rs_init(), nmg_faces_are_radial(), nmg_faceuse_area(), nmg_find_edge_between_2fu(), nmg_find_eg_between_2fg(), nmg_find_eu_with_vu_in_lu(), nmg_find_max_index(), nmg_find_pt_in_lu(), nmg_find_top_face_in_dir(), nmg_find_vertex_in_lu(), nmg_fix_overlapping_loops(), nmg_flatten_face(), nmg_fu_planeeqn(), nmg_get_interior_pt(), nmg_get_touching_jaunts(), nmg_glue_face_in_shell(), nmg_hollow_shell(), nmg_intersect_loops_self(), nmg_is_common_bigloop(), nmg_is_edge_in_looplist(), nmg_is_vertex_in_looplist(), nmg_isect_eu_fu(), nmg_isect_face3p_shell_int(), nmg_isect_fu_jra(), nmg_isect_vert2p_face2p(), nmg_join_touchingloops(), nmg_kill_accordions(), nmg_kill_anti_loops(), nmg_kill_cracks(), nmg_kill_cracks_at_vertex(), nmg_kill_non_common_cracks(), nmg_kill_snakes(), nmg_kill_zero_length_edgeuses(), nmg_klu(), nmg_loop_g(), nmg_loop_is_a_crack(), nmg_loop_plane_area(), nmg_loop_plane_newell(), nmg_loop_touches_self(), nmg_lu_is_convex(), nmg_lu_reorient(), nmg_lu_to_vlist(), nmg_m_reindex(), nmg_m_set_high_bit(), nmg_m_struct_count(), nmg_make_dualvu(), nmg_meonvu(), nmg_mesh_two_faces(), nmg_move_edge_thru_pt(), nmg_open_shells_connect(), nmg_pl_isect(), nmg_pr_lu(), nmg_pr_lu_briefly(), nmg_propagate_normals(), nmg_reclassify_lu_eu(), nmg_reverse_face_and_radials(), nmg_reverse_radials(), nmg_rm_redundancies(), nmg_sanitize_s_lv(), nmg_show_each_loop(), nmg_simplify_loop(), nmg_simplify_shell_edges(), nmg_snurb_calc_lu_uv_orient(), nmg_split_loops_handler(), nmg_split_touchingloops(), nmg_tabulate_face_g_verts(), nmg_to_poly(), nmg_to_tgc(), nmg_translate_face(), nmg_triangulate_fu(), nmg_uv_in_lu(), nmg_visit_loopuse(), nmg_vlblock_lu(), nmg_vlu(), nmg_vvu(), rt_nmg_tclget(), and tesselate_pipe_end().

#define BU_LIST_LAST_MAGIC hp   )     ((hp)->back->magic)
 

Definition at line 768 of file bu.h.

#define BU_LIST_PNEXT structure,
 )     ((struct structure *)(((struct bu_list *)(p))->forw))
 

Return pointer to next (or previous) element, which may be the head

Definition at line 771 of file bu.h.

Referenced by bu_cmdhist_next(), bu_observer_free(), dgo_zap_cmd(), eliminate_overlaps(), eval_op(), make_near_list(), nmg_break_crossed_loops(), nmg_class_shells(), nmg_classify_lu_lu(), nmg_do_radial_flips(), nmg_eusplit(), nmg_extrude_cleanup(), nmg_find_pt_in_shell(), nmg_fix_overlapping_loops(), nmg_js(), nmg_jv(), nmg_kill_cracks(), nmg_kill_non_common_cracks(), nmg_kill_snakes(), nmg_kill_zero_length_edgeuses(), nmg_pr_lu(), nmg_pr_lu_briefly(), nmg_radial_mark_cracks(), nmg_rm_redundancies(), nmg_sanitize_fu(), nmg_sanitize_s_lv(), nmg_shell_a(), nmg_simplify_loop(), nmg_simplify_shell_edges(), nmg_split_loops_handler(), nmg_triangulate_fu(), nmg_vlblock_lu(), promote_ints(), rt_ebm_tess(), and rt_nmg_tess().

#define BU_LIST_PLAST structure,
 )     ((struct structure *)(((struct bu_list *)(p))->back))
 

Definition at line 773 of file bu.h.

Referenced by bu_cmdhist_prev(), bu_delete_hook(), bu_log_delete_hook(), make_near_list(), nmg_extrude_cleanup(), nmg_sanitize_s_lv(), nmg_simplify_loop(), and promote_ints().

#define BU_LIST_PNEXT_PNEXT structure,
 )     ((struct structure *)(((struct bu_list *)(p))->forw->forw))
 

Return pointer two links away, which may include the head

Definition at line 777 of file bu.h.

Referenced by nmg_class_shells(), nmg_find_pt_in_shell(), and nmg_sanitize_s_lv().

#define BU_LIST_PNEXT_PLAST structure,
 )     ((struct structure *)(((struct bu_list *)(p))->forw->back))
 

Definition at line 779 of file bu.h.

Referenced by nmg_ck_fu(), nmg_vlu(), nmg_vregion(), and nmg_vvu().

#define BU_LIST_PLAST_PNEXT structure,
 )     ((struct structure *)(((struct bu_list *)(p))->back->forw))
 

Definition at line 781 of file bu.h.

Referenced by nmg_ck_fu().

#define BU_LIST_PLAST_PLAST structure,
 )     ((struct structure *)(((struct bu_list *)(p))->back->back))
 

Definition at line 783 of file bu.h.

#define BU_LIST_PNEXT_CIRC structure,
 ) 
 

Value:

((BU_LIST_FIRST_MAGIC((struct bu_list *)(p)) == BU_LIST_HEAD_MAGIC) ? \
                BU_LIST_PNEXT_PNEXT(structure,(struct bu_list *)(p)) : \
                BU_LIST_PNEXT(structure,p) )
Return pointer to circular next element; ie, ignoring the list head

Definition at line 787 of file bu.h.

Referenced by nmg_2lu_identical(), nmg_assess_eu(), nmg_assess_vu(), nmg_break_all_es_on_v(), nmg_break_eu_on_v(), nmg_ck_eu(), nmg_ck_face_worthless_edges(), nmg_class_lu_fu(), nmg_class_pt_euvu(), nmg_classify_lu_lu(), nmg_cut_loop(), nmg_do_radial_flips(), nmg_edge_collapse(), nmg_face_rs_init(), nmg_face_state_transition(), nmg_find_eu_leftvec(), nmg_find_first_last_use_of_v_in_fu(), nmg_find_matching_eu_in_s(), nmg_find_next_use_of_2e_in_lu(), nmg_fu_planeeqn(), nmg_get_touching_jaunts(), nmg_insert_vu_if_on_edge(), nmg_isect_2colinear_edge2p(), nmg_isect_edge2p_edge2p(), nmg_isect_line2_edge2p(), nmg_isect_line2_face2pNEW(), nmg_isect_two_ptbls(), nmg_jl(), nmg_join_2loops(), nmg_kill_anti_loops(), nmg_kill_cracks(), nmg_kill_non_common_cracks(), nmg_kill_snakes(), nmg_kill_zero_length_edgeuses(), nmg_loop_plane_area(), nmg_loop_plane_newell(), nmg_lu_is_convex(), nmg_move_edge_thru_pt(), nmg_radial_verify_pointers(), nmg_search_v_eg(), nmg_simplify_shell_edges(), nmg_split_lu_at_vu(), nmg_to_arb(), nmg_unbreak_edge(), nmg_unbreak_handler(), nmg_unbreak_shell_edge_unsafe(), nmg_veu(), nmg_vu_angle_measure(), pick_eu(), and tesselate_pipe_linear().

#define BU_LIST_PPREV_CIRC structure,
 ) 
 

Value:

((BU_LIST_LAST_MAGIC((struct bu_list *)(p)) == BU_LIST_HEAD_MAGIC) ? \
                BU_LIST_PLAST_PLAST(structure,(struct bu_list *)(p)) : \
                BU_LIST_PLAST(structure,p) )
Return pointer to circular last element; ie, ignoring the list head

Definition at line 793 of file bu.h.

Referenced by nmg_assess_eu(), nmg_assess_vu(), nmg_break_all_es_on_v(), nmg_ck_eu(), nmg_class_pt_euvu(), nmg_classify_lu_lu(), nmg_do_radial_flips(), nmg_do_radial_join(), nmg_face_state_transition(), nmg_find_eu_leftvec(), nmg_find_first_last_use_of_v_in_fu(), nmg_find_isect_faces(), nmg_insert_vu_if_on_edge(), nmg_join_2loops(), nmg_join_2singvu_loops(), nmg_join_singvu_loop(), nmg_kill_accordions(), nmg_kill_anti_loops(), nmg_kill_cracks(), nmg_kill_cracks_at_vertex(), nmg_move_edge_thru_pt(), nmg_offset_eu_vert(), nmg_radial_implement_decisions(), nmg_radial_mark_flips(), nmg_radial_verify_pointers(), nmg_veu(), and nmg_vu_angle_measure().

#define BU_LIST_MAIN_PTR _type,
_ptr2,
_name2   )     ((struct _type *)(((char *)(_ptr2)) - offsetof(struct _type, _name2.magic)))
 

Support for membership on multiple linked lists.

When a structure of type '_type' contains more than one bu_list structure within it (such as the NMG edgeuse), this macro can be used to convert a pointer '_ptr2' to a "midway" bu_list structure (an element called '_name2' in structure '_type') back into a pointer to the overall enclosing structure. Examples:

eu = BU_LIST_MAIN_PTR( edgeuse, midway, l2 );

eu1 = BU_LIST_MAIN_PTR(edgeuse, BU_LIST_FIRST(bu_list, &eg1->eu_hd2), l2);

Files using BU_LIST_MAIN_PTR will need to include stddef.h

Definition at line 813 of file bu.h.

Referenced by nmg_ck_eg_verts(), nmg_common_v_2eg(), nmg_edgeuse_with_eg_tabulate(), nmg_index_of_struct(), nmg_jeg(), nmg_model_edge_g_fuse(), nmg_veg(), and rt_find_identical_solid().


Typedef Documentation

typedef struct bu_list bu_list_t
 

Definition at line 529 of file bu.h.


Function Documentation

struct bu_list * bu_list_new void   ) 
 

B U _ L I S T _ N E W

Creates and initializes a bu_list head structure

Definition at line 57 of file list.c.

References BU_GETSTRUCT, and BU_LIST_INIT.

struct bu_list * bu_list_pop struct bu_list hp  ) 
 

B U _ L I S T _ P O P

Returns the results of BU_LIST_POP

Definition at line 73 of file list.c.

References BU_LIST_POP.

int bu_list_len const struct bu_list hd  ) 
 

Referenced by nmg_insure_radial_list_is_increasing(), nmg_pl_hitmiss_list(), nmg_pr_eg(), nmg_unbreak_edge(), and nmg_unbreak_handler().

void bu_list_reverse struct bu_list hd  ) 
 

Referenced by nmg_insure_radial_list_is_increasing().

void bu_list_free struct bu_list hd  ) 
 

B U _ L I S T _ F R E E

Given a list of structures allocated with bu_malloc() enrolled on a bu_list head, walk the list and free the structures. This routine can only be used when the structures have no interior pointers.

Definition at line 130 of file list.c.

References bu_free(), BU_LIST_DEQUEUE, and BU_LIST_WHILE.

Here is the call graph for this function:

void bu_list_parallel_append struct bu_list headp,
struct bu_list itemp
 

B U _ L I S T _ P A R A L L E L _ A P P E N D

Simple parallel-safe routine for appending a data structure to the end of a bu_list doubly-linked list.

Issues:
Only one semaphore shared by all list heads.
No portable way to notify waiting thread(s) that are sleeping

Definition at line 150 of file list.c.

References BU_LIST_INSERT, BU_SEM_LISTS, bu_semaphore_acquire(), and bu_semaphore_release().

Here is the call graph for this function:

struct bu_list * bu_list_parallel_dequeue struct bu_list headp  ) 
 

B U _ L I S T _ P A R A L L E L _ D E Q U E U E

Simple parallel-safe routine for dequeueing one data structure from the head of a bu_list doubly-linked list. If the list is empty, wait until some other thread puts something on the list.

Issues:
No portable way to not spin and burn CPU time while waiting
for something to show up on the list.

Definition at line 170 of file list.c.

References BU_LIST_DEQUEUE, BU_LIST_FIRST, BU_LIST_NOT_HEAD, BU_SEM_LISTS, bu_semaphore_acquire(), and bu_semaphore_release().

Here is the call graph for this function:

void bu_ck_list const struct bu_list hd,
const char *  str
 

B U _ C K _ L I S T

Generic bu_list doubly-linked list checker.

Definition at line 198 of file list.c.

References back, bu_bomb(), BU_LIST_HEAD_MAGIC, bu_log(), forw, and magic.

Here is the call graph for this function:

void bu_ck_list_magic const struct bu_list hd,
const char *  str,
const long  magic
 

Referenced by nmg_veg(), and nmg_veu().

int bu_list_len register const struct bu_list hd  ) 
 

B U _ L I S T _ L E N

Returns the number of elements on a bu_list brand linked list.

Definition at line 88 of file list.c.

References BU_LIST_FOR.

void bu_list_reverse register struct bu_list hd  ) 
 

B U _ L I S T _ R E V E R S E

Reverses the order of elements in a bu_list linked list.

Definition at line 105 of file list.c.

References BU_CK_LIST_HEAD, BU_LIST_APPEND, BU_LIST_DEQUEUE, BU_LIST_INIT, BU_LIST_INSERT_LIST, and BU_LIST_WHILE.

void bu_ck_list_magic const struct bu_list hd,
const char *  str,
const long int  magic
 

B U _ C K _ L I S T _ M A G I C

bu_list doubly-linked list checker which checks the magic number for all elements in the linked list

Definition at line 242 of file list.c.

References back, bu_bomb(), bu_identify_magic(), BU_LIST_HEAD_MAGIC, bu_log(), forw, and magic.

Here is the call graph for this function:

struct bu_list* bu_list_dequeue_next struct bu_list hp,
struct bu_list p
 

Definition at line 297 of file list.c.

References BU_LIST_DEQUEUE, and BU_LIST_NEXT.


Generated on Mon Sep 18 01:25:20 2006 for BRL-CAD by  doxygen 1.4.6