CTL Containers

Collaboration diagram for CTL Containers:


Files

file  array.h
 Simple fixed C array helpers & iterators.
file  dg/array.h
 Declare vector container/patterns Everything in the ve.
file  vector.h
 Declare vector container/patterns.
file  ll.h
 "Invasive" Linked List C templates
file  fifo.c
 Unit tests for fifo/lifo stacks.
file  fifo.h
 Simple first-in, first-out stacks.
file  imultiset.h
 "Invasive" set of ordered, non-unique data
file  iset.h
 "Invasive" set of ordered, unique data
file  ll.c
 "Invasive" Linked List unit tests
file  ll.h
 "Invasive" Linked List C templates
file  tree.c
 Tree basic implementation.
file  tree.h
 Tree Base Class templates.
file  tree.temp.h
 Tree template functions.

Modules

 Singly Linked Lists
 First-in-first-out stacks

Defines

#define countof(a)   (sizeof (a)/sizeof (*a))
 Determine number of members within an array.
#define indexof(a, p)   ((p)-(a))
 Determine index of pointer 'p' in array 'a'.
#define inbounds(a, i)   ( (size_t)(i) < countof(a) )
 See if index 'i' is in bounds for fully typed simple array 'a'.
#define memberof(a, p)   ( inbounds((a),indexof((a),(p))) && ((void*)((a)+indexof((a),(p))) == (void*)(p)) )
 See if 'p' is a valid pointer to a member of 'a'.
#define array_bsort(atype, array, count, compare)
 Bubble sort an array Wins over qsort for small, or nearly sorted arrays Usually wins over qsort in 2D animation.
#define array_qsort(atype, array, count, compare)   qsort((array),(count),sizeof(atype),(int (*)(const void *, const void *))(compare))
 Quicker sort an array Wins over bsort for most unsorted cases Usually wins over qsort in 2D animation.
#define array_lsearch(atype, array, count, compare, key)   lsearch( (key), (array), (count), sizeof(atype), (compare) )
 Linear search a sorted array for a particular key.
#define array_bsearch(atype, array, count, compare, key)   bsearch( (key), (array), (count), sizeof(atype), (compare) )
 Binary search a sorted array for a particular key.
#define array_fill(type, dst, count, value)
 Fill memory with a value, by type.
#define ctl_declare_array(label, type, size)
 Declare a fixed array type Similar to 'vector.h' in every way except it doesn't allocate or grow.
#define ctl_array_foreach_const(label, instance, iterator)
 Iterate each member of a array.
#define ctl_array_foreach_const_reverse(label, instance, iterator)
 Iterate each member of a array, backwards.
#define ctl_array_foreach(label, instance, iterator)
 Iterate each member of a array.
#define ctl_array_foreach_reverse(label, instance, iterator)
 Iterate each member of a array, backwards.
#define ctl_array_foreach_mutable(label, instance, iterator)
 Iterate each member of a array.
#define ctl_array_foreach_mutable_reverse(label, instance, iterator)
 Iterate each member of a array backwards.
#define ctl_implement_array(label, type, rawcook)
 Make array functions and data from template.
#define ctl_declare_list(label, type)
 Declare a doubly-linked list Like stl std::list, allocates objects by list membership, and frees them when removed from list.
#define ctl_list_foreach(label, instance, iterator)
 Iterate each member of a linked list.
#define ctl_list_foreach_reverse(label, instance, iterator)
 Iterate each member of a linked list backwards.
#define ctl_list_foreach_const(label, instance, iterator)
 Iterate each member of a linked list.
#define ctl_list_foreach_const_reverse(label, instance, iterator)
 Iterate each member of a linked list backwards.
#define ctl_list_foreach_mutable(label, instance, iterator)
 Iterate each member of a linked list, and the currently iterated member can be deleted.
#define ctl_list_foreach_mutable_reverse(label, instance, iterator)
 Iterate each member of a linked list backwards, and the currently iterated member can be deleted.
#define CTL_POOL_DELTA   16
 Define how fast memory pool lists grow This can be predefined/redefined to grow pools by larger/smaller segments when allocating nodes for non-invasive containers.
#define ctl_implement_list(label, type)
 Implement a linked list.
#define ctl_declare_map(label, keytype, type)   ctl_declare_map_base(label,keytype,type,ctlt_unique)
 Declare a map (a container of sorted, unique objects, sorted/accessed by a key) Like stl std::map, allocates objects by container membership, and frees them when removed from container. Use 'label_set_order' to set the sort order before adding things to the tree.
#define ctl_implement_map(label, keytype, type)   ctl_implement_map_base(label,keytype,type,ctlt_unique)
 Implement a map (a container of sorted, unique objects) Like stl std::map, allocates objects by container membership, and frees them when removed from container. Use 'label_set_order' to set the sort order before adding things to the tree.
#define ctl_map_foreach(label, instance, iterator)
 map iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code
#define ctl_map_foreach_const(label, instance, iterator)
 Constant fixed C map iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.
#define ctl_map_foreach_reverse(label, instance, iterator)
 Backward C map iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.
#define ctl_map_foreach_const_reverse(label, instance, iterator)
 Backward, constant C map iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.
#define ctl_map_from(label, instance, key, iterator)
 Iterators for avl data; key some point in tree to the end in a given direction.
#define ctl_map_from_const(label, instance, key, iterator)
 Const data variant.
#define ctl_map_from_reverse(label, instance, key, iterator)
 Iterate backwards variant.
#define ctl_map_from_const_reverse(label, instance, key, iterator)
 Const data variant of reverse variant.
#define ctl_map_from_to(label, instance, keyfrom, keyto, iterator)
 From->to iterators for avl data.
#define ctl_map_from_to_const(label, instance, keyfrom, keyto, iterator)
 Const data variant.
#define ctl_map_from_to_reverse(label, instance, keyfrom, keyto, iterator)
 Iterate backwards variant.
#define ctl_map_from_to_const_reverse(label, instance, keyfrom, keyto, iterator)
 Const data variant of reverse variant.
#define ctl_declare_multimap(label, keytype, type)   ctl_declare_map_base(label,keytype,type,ctlt_multiple)
 Declare a multimap (a container of sorted, NON-unique objects, sorted/accessed by a key) Like stl std::multimap, allocates objects by container membership, and frees them when removed from container.
#define ctl_implement_multimap(label, keytype, type)   ctl_implement_map_base(label,keytype,type,ctlt_multiple)
 Implement a multimap (a container of sorted, NON-unique objects, sorted/accessed by a key) Like stl std::multimap, allocates objects by container membership, and frees them when removed from container.
#define ctl_multimap_foreach(label, instance, iterator)
 multimap iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code
#define ctl_multimap_foreach_const(label, instance, iterator)
 Constant fixed C multimap iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.
#define ctl_multimap_foreach_reverse(label, instance, iterator)
 Backward C multimap iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.
#define ctl_multimap_foreach_const_reverse(label, instance, iterator)
 Backward, constant C multimap iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.
#define ctl_multimap_from(label, instance, key, iterator)
 Iterators for avl data; key some point in tree to the end in a given direction.
#define ctl_multimap_from_const(label, instance, key, iterator)
 Const data variant.
#define ctl_multimap_from_reverse(label, instance, key, iterator)
 Iterate backwards variant.
#define ctl_multimap_from_const_reverse(label, instance, key, iterator)
 Const data variant of reverse variant.
#define ctl_multimap_from_to(label, instance, keyfrom, keyto, iterator)
 From->to iterators for avl data.
#define ctl_multimap_from_to_const(label, instance, keyfrom, keyto, iterator)
 Const data variant.
#define ctl_multimap_from_to_reverse(label, instance, keyfrom, keyto, iterator)
 Iterate backwards variant.
#define ctl_multimap_from_to_const_reverse(label, instance, keyfrom, keyto, iterator)
 Const data variant of reverse variant.
#define CTL_POOL_DELTA   16
 Define how fast memory pool lists grow This can be predefined/redefined to grow pools by larger/smaller segments when allocating nodes for non-invasive containers.
#define ctl_declare_set(label, type)   ctl_declare_set_base(label,type,ctlt_unique)
 Declare a set (a container of sorted, unique objects) Like stl std::set, allocates objects by container membership, and frees them when removed from container. Use 'label_set_order' to set the sort order before adding things to the tree.
#define ctl_declare_set(label, type)   ctl_declare_set_base(label,type,ctlt_unique)
 Declare a set (a container of sorted, unique objects) Like stl std::set, allocates objects by container membership, and frees them when removed from container. Use 'label_set_order' to set the sort order before adding things to the tree.
#define ctl_implement_set(label, type)   ctl_implement_set_base(label,type,ctlt_unique)
 Implement a set (a container of sorted, unique objects) Like stl std::set, allocates objects by container membership, and frees them when removed from container. Use 'label_set_order' to set the sort order before adding things to the tree.
#define ctl_implement_set(label, type)   ctl_implement_set_base(label,type,ctlt_unique)
 Implement a set (a container of sorted, unique objects) Like stl std::set, allocates objects by container membership, and frees them when removed from container. Use 'label_set_order' to set the sort order before adding things to the tree.
#define ctl_set_foreach(label, instance, iterator)
 set iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code
#define ctl_set_foreach_const(label, instance, iterator)
 Constant fixed C set iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.
#define ctl_set_foreach_reverse(label, instance, iterator)
 Backward C set iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.
#define ctl_set_foreach_const_reverse(label, instance, iterator)
 Backward, constant C set iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.
#define ctl_set_from(label, instance, key, iterator)
 Iterators for avl data; key some point in tree to the end in a given direction.
#define ctl_set_from_const(label, instance, key, iterator)
 Const data variant.
#define ctl_set_from_reverse(label, instance, key, iterator)
 Iterate backwards variant.
#define ctl_set_from_const_reverse(label, instance, key, iterator)
 Const data variant of reverse variant.
#define ctl_set_from_to(label, instance, keyfrom, keyto, iterator)
 From->to iterators for avl data.
#define ctl_set_from_to_const(label, instance, keyfrom, keyto, iterator)
 Const data variant.
#define ctl_set_from_to_reverse(label, instance, keyfrom, keyto, iterator)
 Iterate backwards variant.
#define ctl_set_from_to_const_reverse(label, instance, keyfrom, keyto, iterator)
 Const data variant of reverse variant.
#define ctl_declare_multiset(label, type)   ctl_declare_set_base(label,type,ctlt_multiple)
 Declare a multiset (a container of sorted, NON-unique objects) Like stl std::multiset, allocates objects by container membership, and frees them when removed from container.
#define ctl_implement_multiset(label, type)   ctl_implement_set_base(label,type,ctlt_multiple)
 Implement a multiset (a container of sorted, NON-unique objects) Like stl std::multiset, allocates objects by container membership, and frees them when removed from container.
#define ctl_multiset_foreach(label, instance, iterator)
 set iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code
#define ctl_multiset_foreach_const(label, instance, iterator)
 Constant fixed C set iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.
#define ctl_multiset_foreach_reverse(label, instance, iterator)
 Backward C set iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.
#define ctl_multiset_foreach_const_reverse(label, instance, iterator)
 Backward, constant C set iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.
#define ctl_multiset_from(label, instance, key, iterator)
 Iterators for avl data; key some point in tree to the end in a given direction.
#define ctl_multiset_from_const(label, instance, key, iterator)
 Const data variant.
#define ctl_multiset_from_reverse(label, instance, key, iterator)
 Iterate backwards variant.
#define ctl_multiset_from_const_reverse(label, instance, key, iterator)
 Const data variant of reverse variant.
#define ctl_multiset_from_to(label, instance, keyfrom, keyto, iterator)
 From->to iterators for avl data.
#define ctl_multiset_from_to_const(label, instance, keyfrom, keyto, iterator)
 Const data variant.
#define ctl_multiset_from_to_reverse(label, instance, keyfrom, keyto, iterator)
 Iterate backwards variant.
#define ctl_multiset_from_to_const_reverse(label, instance, keyfrom, keyto, iterator)
 Const data variant of reverse variant.
#define CTL_POOL_DELTA   16
 Define how fast memory pool lists grow This can be predefined/redefined to grow pools by larger/smaller segments when allocating nodes for non-invasive containers.
#define ctl_declare_vector(label, type)
 Declare a vector (a dynamically grown/shrunk array of items).
#define ctl_vector_foreach_const(label, instance, iterator)
 Iterate each member of a vector.
#define ctl_vector_foreach_const_reverse(label, instance, iterator)
 Iterate each member of a vector, backwards.
#define ctl_vector_foreach(label, instance, iterator)
 Iterate each member of a vector.
#define ctl_vector_foreach_reverse(label, instance, iterator)
 Iterate each member of a vector, backwards.
#define ctl_vector_foreach_mutable(label, instance, iterator)
 Iterate each member of a vector.
#define ctl_vector_foreach_mutable_reverse(label, instance, iterator)
 Iterate each member of a vector backwards.
#define ctl_implement_vector(label, type, rawcook)
 Make vector functions and data from template.
#define ctl_imultiset(type, mlabel, compare)   ctl_tree(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple)
 Get the class name of the 'multiset'; a tree that can contain multiple instances of data.
#define ctl_imultiset_decllink(type, mlabel)   ctlt_node_type(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple) mlabel
 Declare a tree link member.
#define ctl_imultiset_initlink(type, mlabel, curr)   ctl_tree_node_init(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, &curr->mlabel)
 Initialize a link.
#define ctl_imultiset_auto(type, mlabel, compare, ilabel)   ctl_tree_auto(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, compare, ilabel )
 Make a tree from auto variables for stack or global use Uses non-standard ANSI extension: non-const initializers.
#define ctl_imultiset_init(type, mlabel, compare, ilabel)   ctl_tree_init(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, compare, ilabel )
 Make a tree initially empty.
#define ctl_imultiset_size(type, mlabel, ilabel)   ctl_tree_size(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, ilabel )
 Get size of tree.
#define ctl_imultiset_insert(type, mlabel, ilabel, data)   (type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, insert)( (ilabel), (data) )
 Insert a new member (MUST NOT BE IN ANY OTHER TREE).
#define ctl_imultiset_find(type, mlabel, ilabel, value)   (type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, find)( (ilabel), (value) )
 Find a member, given a template member as a value.
#define ctl_imultiset_remove(type, mlabel, ilabel, value)   (type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, remove)( (ilabel), (value) )
 Remove a member.
#define ctl_imultiset_unlink(type, mlabel, ilabel, data)   (type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, unlink)( (ilabel), (data) )
 Remove a member.
#define ctl_imultiset_reset(type, mlabel, ilabel)   ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, reset)( ilabel )
 Remove a all tree members member.
#define ctl_imultiset_front(type, mlabel, ilabel)   ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, front)( ilabel )
 Get first member of set.
#define ctl_imultiset_back(type, mlabel, ilabel)   ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, back)( ilabel )
 Get last member of set.
#define ctl_imultiset_pop_front(type, mlabel, ilabel)   ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, pop_front)( ilabel )
 Get and remove the first member of the set.
#define ctl_imultiset_pop_back(type, mlabel, ilabel)   ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, pop_back)( ilabel )
 Get and remove the last member of the set.
#define ctl_imultiset_foreach(type, mlabel, ilabel, label)
 set iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code
#define ctl_imultiset_foreach_const(type, mlabel, ilabel, label)
 Constant fixed C set iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.
#define ctl_imultiset_foreach_reverse(type, mlabel, ilabel, label)
 Backward C set iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.
#define ctl_imultiset_foreach_reverse_const(type, mlabel, ilabel, label)
 Backward, constant C set iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.
#define ctl_imultiset_from(type, mlabel, ilabel, from, label)
 Iterators for avl data; from some point in tree to the end in a given direction.
#define ctl_imultiset_from_const(type, mlabel, ilabel, from, label)
 Const data variant.
#define ctl_imultiset_from_reverse(type, mlabel, ilabel, from, label)
 Iterate backwards variant.
#define ctl_imultiset_from_reverse_const(type, mlabel, ilabel, from, label)
 Const data variant of reverse variant.
#define ctl_imultiset_from_to(type, mlabel, ilabel, from, to, label)
 From->to iterators for avl data.
#define ctl_imultiset_from_to_const(type, mlabel, ilabel, from, to, label)
 Const data variant.
#define ctl_imultiset_from_to_reverse(type, mlabel, ilabel, from, to, label)
 Iterate backwards variant.
#define ctl_imultiset_from_to_reverse_const(type, mlabel, ilabel, from, to, label)
 Const data variant of reverse variant.
#define ctl_iset(type, mlabel, compare)   ctl_tree(ctlt_relative(offsetof(type,mlabel)),ctlt_unique)
 Get the class name of the 'set'; unique-instance tree.
#define ctl_iset_decllink(type, mlabel)   ctlt_node_type(ctlt_relative(offsetof(type,mlabel)),ctlt_unique) mlabel
 Declare a tree link member.
#define ctl_iset_initlink(type, mlabel, curr)   ctl_tree_node_init(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, &curr->mlabel)
 Initialize a link.
#define ctl_iset_auto(type, mlabel, compare, ilabel)   ctl_tree_auto(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, compare, ilabel )
 Make a tree from auto variables for stack or global use Uses non-standard ANSI extension: non-const initializers.
#define ctl_iset_init(type, mlabel, compare, ilabel)   ctl_tree_init(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, compare, ilabel )
 Make a tree initially empty.
#define ctl_iset_size(type, mlabel, ilabel)   ctl_tree_size(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, ilabel )
 Get size of tree.
#define ctl_iset_insert(type, mlabel, ilabel, data)   (type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, insert)( (ilabel), (data) )
 Insert a new member (MUST NOT BE IN ANY OTHER TREE).
#define ctl_iset_find(type, mlabel, ilabel, value)   (type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, find)( (ilabel), (value) )
 Find a member, given a template member as a value.
#define ctl_iset_remove(type, mlabel, ilabel, value)   (type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, remove)( (ilabel), (value) )
 Remove a member.
#define ctl_iset_unlink(type, mlabel, ilabel, data)   (type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, unlink)( (ilabel), (data) )
 Remove a member.
#define ctl_iset_reset(type, mlabel, ilabel)   ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, reset)( ilabel )
 Remove a all tree members member.
#define ctl_iset_front(type, mlabel, ilabel)   ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, front)( ilabel )
 Get first member of set.
#define ctl_iset_back(type, mlabel, ilabel)   ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, back)( ilabel )
 Get last member of set.
#define ctl_iset_pop_front(type, mlabel, ilabel)   ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, pop_front)( ilabel )
 Get and remove the first member of the set.
#define ctl_iset_pop_back(type, mlabel, ilabel)   ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, pop_back)( ilabel )
 Get and remove the last member of the set.
#define ctl_iset_foreach(type, mlabel, ilabel, label)
 iset iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code
#define ctl_iset_foreach_const(type, mlabel, ilabel, label)
 Constant fixed C iset iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.
#define ctl_iset_foreach_reverse(type, mlabel, ilabel, label)
 Backward C iset iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.
#define ctl_iset_foreach_reverse_const(type, mlabel, ilabel, label)
 Backward, constant C iset iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.
#define ctl_iset_from(type, mlabel, ilabel, from, label)
 Iterators for avl data; from some point in tree to the end in a given direction.
#define ctl_iset_from_const(type, mlabel, ilabel, from, label)
 Const data variant.
#define ctl_iset_from_reverse(type, mlabel, ilabel, from, label)
 Iterate backwards variant.
#define ctl_iset_from_reverse_const(type, mlabel, ilabel, from, label)
 Const data variant of reverse variant.
#define ctl_iset_from_to(type, mlabel, ilabel, from, to, label)
 From->to iterators for avl data.
#define ctl_iset_from_to_const(type, mlabel, ilabel, from, to, label)
 Const data variant.
#define ctl_iset_from_to_reverse(type, mlabel, ilabel, from, to, label)
 Iterate backwards variant.
#define ctl_iset_from_to_reverse_const(type, mlabel, ilabel, from, to, label)
 Const data variant of reverse variant.
#define ctl_tree(offset, multiple)   ppConcat4(ctl_tree_,ctlt_offset_name(offset),_,ctlt_multi_name(multiple))
 Build template naming from offset,multiple.
#define ctl_tree_(offset, multiple, label)   ppConcat3(ctl_tree(offset,multiple),_,label)
 Build template function/data naming.
#define ctl_tree_node_to_data(offset, multiple, tree, node)   ppConcat(ctl_tree_node_data_,offset)(offset,multiple, tree, node )
 Get data from node.
#define ctl_tree_data_to_node(offset, multiple, tree, data)   ppConcat(ctl_tree_data_node_,offset)(offset,multiple, tree, data )
 Get node from from data.
#define ctl_tree_node_init(offset, multiple, node)   { (node)->left = (node)->right = NULL; (node)->balance = 0; }
 Initialize a node to a clear state.
#define ctl_tree_auto(offset, multiple, comparator, label)
 Initialize a tree on stack or as global Uses non-standard ANSI extension: non-const initializers.
#define ctl_tree_init(offset, multiple, comparator, tree)   { (tree)->found = (tree)->root = NULL; (tree)->compare = (tree_compare)(comparator); (tree)->size = 0; ctlt_offset_for_relative(offset, (tree)->data_offset = ctlt_getoffset(offset,multiple);) }
 Initialize a tree tree.
#define ctl_tree_size(offset, multiple,tree)   ((tree)->size)
 Get the count of members in this tree.

Define Documentation

#define array_bsearch ( atype,
array,
count,
compare,
key   )     bsearch( (key), (array), (count), sizeof(atype), (compare) )

Binary search a sorted array for a particular key.

Parameters:
atype Type of array elements
array Instance of array
count Count of elements to sort
compare Function that returns ((p1)-(p2)), like qsort wants from memcmp,strcmp,etc.
key Pointer to thing we're looking for in array

Definition at line 125 of file array.h.

#define array_bsort ( atype,
array,
count,
compare   ) 

Value:

{\
    atype* aStart = (array);\
    atype* aEnd = aStart + (count);\
    int bSorted;\
    do {\
        atype* aCurr = aStart;\
        aEnd--;\
        bSorted = 0;\
        while( aCurr < aEnd )\
        {\
            if( compare( *aCurr, *(aCurr+1) ) > 0 )\
            {\
                atype tmp = *aCurr;\
                *aCurr = *(aCurr+1);\
                *(aCurr+1) = tmp;\
                bSorted = 1;\
            }\
            aCurr++;\
        }\
    } while( bSorted );\
}
Bubble sort an array Wins over qsort for small, or nearly sorted arrays Usually wins over qsort in 2D animation.

Parameters:
atype Type of array elements
array Instance of array
count Count of elements to sort
compare Function or macro that returns ((p1)-(p2)), like qsort wants from memcmp,strcmp,etc.

Definition at line 66 of file array.h.

#define array_fill ( type,
dst,
count,
value   ) 

Value:

{\
    type* ppScr2(fill,begin) = (dst);\
    type* ppScr2(fill,curr) = ppScr2(fill,begin)+(count);\
    type ppScr2(fill,val) = (value);\
    while( ppScr2(fill,curr)-- > ppScr2(fill,begin) )\
        *ppScr2(fill,curr) = ppScr2(fill,val);\
}
Fill memory with a value, by type.

Parameters:
type What type is the collection
dst Where to do the fill
count Count of items to fill with value
value Value to fill those items with

Definition at line 135 of file array.h.

#define array_lsearch ( atype,
array,
count,
compare,
key   )     lsearch( (key), (array), (count), sizeof(atype), (compare) )

Linear search a sorted array for a particular key.

Parameters:
atype Type of array elements
array Instance of array
count Count of elements to sort
compare Function that returns ((p1)-(p2)), like qsort wants from memcmp,strcmp,etc.
key Pointer to thing we're looking for in array

Definition at line 113 of file array.h.

#define array_qsort ( atype,
array,
count,
compare   )     qsort((array),(count),sizeof(atype),(int (*)(const void *, const void *))(compare))

Quicker sort an array Wins over bsort for most unsorted cases Usually wins over qsort in 2D animation.

Parameters:
atype Type of array elements
array Instance of array
count Count of elements to sort
compare Function that returns ((p1)-(p2)), like qsort wants from memcmp,strcmp,etc.

Definition at line 99 of file array.h.

Referenced by BMI_Clut_Make(), and GUI_BlibInit().

#define countof (  )     (sizeof (a)/sizeof (*a))

Determine number of members within an array.

Parameters:
a Array we're checking; must be a fully qualified C array, with known length.
Returns:
Count of items in 'a'

Definition at line 20 of file array.h.

Referenced by BMI_Clut_Make(), ctl_profiles_dump(), ctl_profiles_dump_averages_sheet(), Socket_Create(), Socket_Create_Client(), Socket_Create_Listener(), Socket_Create_Login(), Socket_Create_Raw(), and Socket_Create_User().

#define ctl_array_foreach ( label,
instance,
iterator   ) 

Value:

ppConcat(label,_type)* iterator = (instance)->array;\
    const ppConcat(label,_type)* ppConcat(end_,iterator) = iterator + (instance)->count;\
    for( ; iterator < ppConcat(end_,iterator); iterator++ )
Iterate each member of a array.

Parameters:
label Label given to array type
instance Pointer to array instance
iterator What the user wants to call the iterated pointer
This is the simplest and fastest way to do it, but you can't modify the list while you do it. This will generally need to be wrapped in its own {} scope Insertions/deletions in array will potentially crash this

Definition at line 114 of file dg/array.h.

#define ctl_array_foreach_const ( label,
instance,
iterator   ) 

Value:

const ppConcat(label,_type)* iterator = (instance)->array;\
    const ppConcat(label,_type)* ppConcat(end_,iterator) = iterator + (instance)->count;\
    for( ; iterator < ppConcat(end_,iterator); iterator++ )
Iterate each member of a array.

Parameters:
label Label given to array type
instance Pointer to array instance
iterator What the user wants to call the iterated pointer
This is the simplest and fastest way to do it, but you can't modify the list while you do it. Insertions/deletions in array will potentially crash this

Definition at line 83 of file dg/array.h.

#define ctl_array_foreach_const_reverse ( label,
instance,
iterator   ) 

Value:

const ppConcat(label,_type)* ppConcat(end_,iterator) = (instance)->array;\
    const ppConcat(label,_type)* iterator = ppConcat(end_,iterator) + (instance)->count;\
    while( iterator-- > ppConcat(end_,iterator) )
Iterate each member of a array, backwards.

Parameters:
label Label given to array type
instance Pointer to array instance
iterator What the user wants to call the iterated pointer
This is the simplest and fastest way to do it Insertions/deletions in array will potentially crash this

Definition at line 98 of file dg/array.h.

#define ctl_array_foreach_mutable ( label,
instance,
iterator   ) 

Value:

ppConcat(label,_type)* iterator;\
    int ppConcat(index_,iterator);\
    label* ppConcat(instance_,iterator) = (instance);\
    for( ppConcat(index_,iterator) = 0; ppConcat(index_,iterator) < (int)ppConcat(instance_,iterator)->count && intentional_assignment(iterator=ppConcat(instance_,iterator)->array + ppConcat(index_,iterator)); ppConcat(index_,iterator)++ )
Iterate each member of a array.

Parameters:
label Label given to array type
instance Pointer to array instance
iterator What the user wants to call the iterated pointer
Insertions/deletions are allowed, and continue iteration, but at a cost

Definition at line 144 of file dg/array.h.

#define ctl_array_foreach_mutable_reverse ( label,
instance,
iterator   ) 

Value:

ppConcat(label,_type)* iterator;\
    int ppConcat(index_,iterator);\
    label* ppConcat(instance_,iterator) = (instance);\
    for( ppConcat(index_,iterator) = (int)ppConcat(instance_,iterator)->count; ppConcat(index_,iterator) > 0 && intentional_assignment(iterator=ppConcat(instance_,iterator)->array + ppConcat(index_,iterator)-1); ppConcat(index_,iterator) = min(ppConcat(index_,iterator)-1,(int)ppConcat(instance_,iterator)->count) )
Iterate each member of a array backwards.

Parameters:
label Label given to array type
instance Pointer to array instance
iterator What the user wants to call the iterated pointer
Insertions/deletions are allowed to happen, and continue iteration, but at a cost

Definition at line 159 of file dg/array.h.

#define ctl_array_foreach_reverse ( label,
instance,
iterator   ) 

Value:

ppConcat(label,_type)* ppConcat(end_,iterator) = (instance)->array;\
    const ppConcat(label,_type)* iterator = ppConcat(end_,iterator) + (instance)->count;\
    while( iterator-- > ppConcat(end_,iterator) )
Iterate each member of a array, backwards.

Parameters:
label Label given to array type
instance Pointer to array instance
iterator What the user wants to call the iterated pointer
This is the simplest and fastest way to do it This will generally need to be wrapped in its own {} scope Insertions/deletions in array will potentially crash this

Definition at line 130 of file dg/array.h.

#define ctl_declare_array ( label,
type,
size   ) 

Declare a fixed array type Similar to 'vector.h' in every way except it doesn't allocate or grow.

Parameters:
label What to call the member
type Type for vector contents
size Maximum length this can ever be

Definition at line 25 of file dg/array.h.

#define ctl_declare_list ( label,
type   ) 

Declare a doubly-linked list Like stl std::list, allocates objects by list membership, and frees them when removed from list.

Parameters:
label What to typedef this list as
type Type of object this list contains

Definition at line 20 of file list.h.

#define ctl_declare_map ( label,
keytype,
type   )     ctl_declare_map_base(label,keytype,type,ctlt_unique)

Declare a map (a container of sorted, unique objects, sorted/accessed by a key) Like stl std::map, allocates objects by container membership, and frees them when removed from container. Use 'label_set_order' to set the sort order before adding things to the tree.

Parameters:
label What to call the member
keytype Type used to look up map contents
type Type for map contents

Definition at line 28 of file map.h.

#define ctl_declare_multimap ( label,
keytype,
type   )     ctl_declare_map_base(label,keytype,type,ctlt_multiple)

Declare a multimap (a container of sorted, NON-unique objects, sorted/accessed by a key) Like stl std::multimap, allocates objects by container membership, and frees them when removed from container.

Parameters:
label What to call the member
keytype Type used to look up map contents
type Type for map contents

Definition at line 191 of file map.h.

#define ctl_declare_multiset ( label,
type   )     ctl_declare_set_base(label,type,ctlt_multiple)

Declare a multiset (a container of sorted, NON-unique objects) Like stl std::multiset, allocates objects by container membership, and frees them when removed from container.

Parameters:
label What to call the member
type Type for set contents

Definition at line 196 of file set.h.

#define ctl_declare_set ( label,
type   )     ctl_declare_set_base(label,type,ctlt_unique)

Declare a set (a container of sorted, unique objects) Like stl std::set, allocates objects by container membership, and frees them when removed from container. Use 'label_set_order' to set the sort order before adding things to the tree.

Parameters:
label What to call the member
type Type for set contents

Definition at line 47 of file set.h.

#define ctl_declare_set ( label,
type   )     ctl_declare_set_base(label,type,ctlt_unique)

Declare a set (a container of sorted, unique objects) Like stl std::set, allocates objects by container membership, and frees them when removed from container. Use 'label_set_order' to set the sort order before adding things to the tree.

Parameters:
label What to call the member
type Type for set contents

Definition at line 47 of file set.h.

#define ctl_declare_vector ( label,
type   ) 

Declare a vector (a dynamically grown/shrunk array of items).

Parameters:
label What to call the member
type Type for vector contents
To use as an efficient LIFO, use label_push_back and label_pop_back Maintains the order of items as they are inserted/added/changed.

To use as a 'bag' (don't care about order), use label_bag_erase to remove members instead of label_erase or label_erase_range

Don't put objects that are pointed at by other things in a vector - they might move when the vector is modified.

You are MUCH better off using vector for scalars and smallish compounds containing mainly scalars. Though this supports full-blown records, using this for complex/large records will cost you dearly.

A vector of scalars, or a vector of coordinate sets is (generally) a more appropriate use for a vector than a vector of compounds containing compounds and containers.

Use a 'set' or 'multiset' with an 'index' member if you want to do fast lookups on complicated things.

Use a 'list' if you just want a queue of things you'll search linearly and insert randomly to, or as a fifo.

Definition at line 51 of file vector.h.

#define ctl_implement_array ( label,
type,
rawcook   ) 

Make array functions and data from template.

Parameters:
label What to call the member
type Type for array contents
rawcook 'ctl_cooked' for compounds with initializations 'ctl_raw' for data (like scalars) that doesn't need any particular value

Definition at line 186 of file dg/array.h.

#define ctl_implement_list ( label,
type   ) 

Implement a linked list.

Parameters:
label What to typedef this list as
type Type of object this list contains

Definition at line 180 of file list.h.

#define ctl_implement_map ( label,
keytype,
type   )     ctl_implement_map_base(label,keytype,type,ctlt_unique)

Implement a map (a container of sorted, unique objects) Like stl std::map, allocates objects by container membership, and frees them when removed from container. Use 'label_set_order' to set the sort order before adding things to the tree.

Parameters:
label What to call the member
keytype Type used to look up map contents
type Type for map contents

Definition at line 38 of file map.h.

#define ctl_implement_multimap ( label,
keytype,
type   )     ctl_implement_map_base(label,keytype,type,ctlt_multiple)

Implement a multimap (a container of sorted, NON-unique objects, sorted/accessed by a key) Like stl std::multimap, allocates objects by container membership, and frees them when removed from container.

Parameters:
label What to call the member
keytype Type used to look up map contents
type Type for map contents

Definition at line 200 of file map.h.

#define ctl_implement_multiset ( label,
type   )     ctl_implement_set_base(label,type,ctlt_multiple)

Implement a multiset (a container of sorted, NON-unique objects) Like stl std::multiset, allocates objects by container membership, and frees them when removed from container.

Parameters:
label What to call the member
type Type for set contents

Definition at line 204 of file set.h.

#define ctl_implement_set ( label,
type   )     ctl_implement_set_base(label,type,ctlt_unique)

Implement a set (a container of sorted, unique objects) Like stl std::set, allocates objects by container membership, and frees them when removed from container. Use 'label_set_order' to set the sort order before adding things to the tree.

Parameters:
label What to call the member
type Type for set contents

Definition at line 56 of file set.h.

#define ctl_implement_set ( label,
type   )     ctl_implement_set_base(label,type,ctlt_unique)

Implement a set (a container of sorted, unique objects) Like stl std::set, allocates objects by container membership, and frees them when removed from container. Use 'label_set_order' to set the sort order before adding things to the tree.

Parameters:
label What to call the member
type Type for set contents

Definition at line 56 of file set.h.

#define ctl_implement_vector ( label,
type,
rawcook   ) 

Make vector functions and data from template.

Parameters:
label What to call the member
type Type for vector contents
rawcook 'ctl_cooked' for compounds with initializations 'ctl_raw' for data (like scalars) that doesn't need any particular value

Definition at line 217 of file vector.h.

#define ctl_imultiset ( type,
mlabel,
compare   )     ctl_tree(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple)

Get the class name of the 'multiset'; a tree that can contain multiple instances of data.

Parameters:
type Template: Structure type this link belongs to.
mlabel Template: A unique label for this sort of link
compare Template: Comparison of types for tree search/placement

Definition at line 26 of file imultiset.h.

#define ctl_imultiset_auto ( type,
mlabel,
compare,
ilabel   )     ctl_tree_auto(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, compare, ilabel )

Make a tree from auto variables for stack or global use Uses non-standard ANSI extension: non-const initializers.

Parameters:
type Template: Structure type this link belongs to.
mlabel Template: A unique label for this sort of link
compare Template: Comparison of types for tree search/placement
ilabel Template/param: Whatever dereferencing is required + the base ilabel from ctl_imultiset_decl

Definition at line 55 of file imultiset.h.

#define ctl_imultiset_back ( type,
mlabel,
ilabel   )     ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, back)( ilabel )

Get last member of set.

Parameters:
type Template: Structure type this link belongs to.
mlabel Template: A unique label for this sort of link
ilabel Template/param: Whatever dereferencing is required + the base ilabel from ctl_imultiset_decl

Definition at line 147 of file imultiset.h.

#define ctl_imultiset_decllink ( type,
mlabel   )     ctlt_node_type(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple) mlabel

Declare a tree link member.

Parameters:
type Template: Structure type this link belongs to.
mlabel Template: A unique label for this sort of link

Definition at line 34 of file imultiset.h.

#define ctl_imultiset_find ( type,
mlabel,
ilabel,
value   )     (type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, find)( (ilabel), (value) )

Find a member, given a template member as a value.

Parameters:
type Template: Structure type this link belongs to.
mlabel Template: A unique label for this sort of link
ilabel Template/param: Whatever dereferencing is required + the base ilabel from ctl_imultiset_decl
value Pointer a node we manufactured to compare with
Returns:
Pointer to found object if it's there; otherwise NULL

Definition at line 98 of file imultiset.h.

#define ctl_imultiset_foreach ( type,
mlabel,
ilabel,
label   ) 

Value:

ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, iterator ) ppConcat(stack_,label);\
    type* label = (type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, iterator_begin)( &ppConcat(stack_,label), (ilabel) );\
    for ( ; label; label = (type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, iterator_next)( &ppConcat(stack_,label) ) )
set iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code

Parameters:
type What type is the collection
mlabel Template: A unique label for this sort of link
ilabel Template/param: Whatever dereferencing is required + the base ilabel from ctl_imultiset_decl
label What to call the iterator (i.e. curr)

Definition at line 176 of file imultiset.h.

#define ctl_imultiset_foreach_const ( type,
mlabel,
ilabel,
label   ) 

Value:

ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, iterator ) ppConcat(stack_,label);\
    const type* label = (const type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, iterator_begin)( &ppConcat(stack_,label), (ilabel) );\
    for ( ; label; label = (const type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, iterator_next)( &ppConcat(stack_,label) ) )
Constant fixed C set iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.

Parameters:
type What type is the collection
mlabel Template: A unique label for this sort of link
ilabel Pointer to instance of the ctl_rtree we're iterating
label What to call the iterator (i.e. curr)

Definition at line 190 of file imultiset.h.

#define ctl_imultiset_foreach_reverse ( type,
mlabel,
ilabel,
label   ) 

Value:

ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, iterator ) ppConcat(stack_,label);\
    type* label = (type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, iterator_rbegin)( &ppConcat(stack_,label), (ilabel) );\
    for ( ; label; label = (type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, iterator_prev)( &ppConcat(stack_,label) ) )
Backward C set iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.

Parameters:
type What type is the collection
mlabel Template: A unique label for this sort of link
ilabel Pointer to instance of the ctl_rtree we're iterating
label What to call the iterator (i.e. curr)

Definition at line 204 of file imultiset.h.

#define ctl_imultiset_foreach_reverse_const ( type,
mlabel,
ilabel,
label   ) 

Value:

ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, iterator ) ppConcat(stack_,label);\
    const type* label = (const type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, iterator_rbegin)( &ppConcat(stack_,label), (ilabel) );\
    for ( ; label; label = (const type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, iterator_prev)( &ppConcat(stack_,label) ) )
Backward, constant C set iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.

Parameters:
type What type is the collection
mlabel Template: A unique label for this sort of link
ilabel Pointer to instance of the ctl_rtree we're iterating
label What to call the iterator (i.e. curr)

Definition at line 218 of file imultiset.h.

#define ctl_imultiset_from ( type,
mlabel,
ilabel,
from,
label   ) 

Value:

ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, iterator ) ppConcat(stack_,label);\
    type* label = (type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, iterator_begin_from)( &ppConcat(stack_,label), (ilabel), (from) );\
    for ( ; label; label = (type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, iterator_next)( &ppConcat(stack_,label) ) )
Iterators for avl data; from some point in tree to the end in a given direction.

Parameters:
type What type is the collection
mlabel Template: A unique label for this sort of link
ilabel Pointer to instance of the ctl_rtree we're iterating
from Starting value as an ilabel-based type
label What to call the iterator (i.e. curr)

Definition at line 232 of file imultiset.h.

#define ctl_imultiset_from_to ( type,
mlabel,
ilabel,
from,
to,
label   ) 

Value:

ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, iterator ) ppConcat(stack_,label);\
    type* label = (type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, iterator_begin_from)( &ppConcat(stack_,label), (ilabel), (from) );\
    for( ; label && (ilabel)->compare(label,(to)) < 0; label = (type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, iterator_next)( &ppConcat(stack_,label) ) )
From->to iterators for avl data.

Parameters:
type What type is the collection
mlabel Template: A unique label for this sort of link
ilabel Pointer to instance of the ctl_rtree we're iterating
from Starting value as an ilabel-based type
to Ending value as an ilabel-based type;
label What to call the iterator (i.e. curr) 'to' value is not invlusive. If it encounters a value >= 'to' (<= for reverse), iteration stops. This behavior better supports floats or values where it's just easier to specify the next higher than the maximum of current.

Definition at line 270 of file imultiset.h.

#define ctl_imultiset_front ( type,
mlabel,
ilabel   )     ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, front)( ilabel )

Get first member of set.

Parameters:
type Template: Structure type this link belongs to.
mlabel Template: A unique label for this sort of link
ilabel Template/param: Whatever dereferencing is required + the base ilabel from ctl_imultiset_decl

Definition at line 138 of file imultiset.h.

#define ctl_imultiset_init ( type,
mlabel,
compare,
ilabel   )     ctl_tree_init(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, compare, ilabel )

Make a tree initially empty.

Parameters:
type Template: Structure type this link belongs to.
mlabel Template: A unique label for this sort of link
compare Template: Comparison of types for tree search/placement
ilabel Template/param: Whatever dereferencing is required + the base ilabel from ctl_imultiset_decl

Definition at line 66 of file imultiset.h.

#define ctl_imultiset_initlink ( type,
mlabel,
curr   )     ctl_tree_node_init(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, &curr->mlabel)

Initialize a link.

Parameters:
type Template: Structure type this link belongs to.
mlabel Template: A unique label for this sort of link
curr Instance of link we are initializing

Definition at line 44 of file imultiset.h.

#define ctl_imultiset_insert ( type,
mlabel,
ilabel,
data   )     (type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, insert)( (ilabel), (data) )

Insert a new member (MUST NOT BE IN ANY OTHER TREE).

Parameters:
type Template: Structure type this link belongs to.
mlabel Template: A unique label for this sort of link
ilabel Template/param: Whatever dereferencing is required + the base ilabel from ctl_imultiset_decl
data Pointer to new member we're adding
Returns:
Pointer to curr if it was inserted; pointer to something else if it already existed

Definition at line 87 of file imultiset.h.

#define ctl_imultiset_pop_back ( type,
mlabel,
ilabel   )     ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, pop_back)( ilabel )

Get and remove the last member of the set.

Parameters:
type Template: Structure type this link belongs to.
mlabel Template: A unique label for this sort of link
ilabel Template/param: Whatever dereferencing is required + the base ilabel from ctl_imultiset_decl

Definition at line 165 of file imultiset.h.

#define ctl_imultiset_pop_front ( type,
mlabel,
ilabel   )     ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, pop_front)( ilabel )

Get and remove the first member of the set.

Parameters:
type Template: Structure type this link belongs to.
mlabel Template: A unique label for this sort of link
ilabel Template/param: Whatever dereferencing is required + the base ilabel from ctl_imultiset_decl

Definition at line 156 of file imultiset.h.

#define ctl_imultiset_remove ( type,
mlabel,
ilabel,
value   )     (type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, remove)( (ilabel), (value) )

Remove a member.

Parameters:
type Template: Structure type this link belongs to.
mlabel Template: A unique label for this sort of link
ilabel Template/param: Whatever dereferencing is required + the base ilabel from ctl_imultiset_decl
value Pointer a node we manufactured to compare with
Returns:
Pointer to member we've removed, or NULL if not found.

Definition at line 109 of file imultiset.h.

#define ctl_imultiset_reset ( type,
mlabel,
ilabel   )     ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, reset)( ilabel )

Remove a all tree members member.

Parameters:
type Template: Structure type this link belongs to.
mlabel Template: A unique label for this sort of link
ilabel Template/param: Whatever dereferencing is required + the base ilabel from ctl_imultiset_decl

Definition at line 129 of file imultiset.h.

#define ctl_imultiset_size ( type,
mlabel,
ilabel   )     ctl_tree_size(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, ilabel )

Get size of tree.

Parameters:
type Template: Structure type this link belongs to.
mlabel Template: A unique label for this sort of link
ilabel Template/param: Whatever dereferencing is required + the base ilabel from ctl_imultiset_decl

Definition at line 76 of file imultiset.h.

#define ctl_imultiset_unlink ( type,
mlabel,
ilabel,
data   )     (type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_multiple, unlink)( (ilabel), (data) )

Remove a member.

Parameters:
type Template: Structure type this link belongs to.
mlabel Template: A unique label for this sort of link
ilabel Template/param: Whatever dereferencing is required + the base ilabel from ctl_imultiset_decl
data Pointer to what is known to be the actual value from the tree
Returns:
Pointer to member we've removed, or NULL if not found.

Definition at line 120 of file imultiset.h.

#define ctl_iset ( type,
mlabel,
compare   )     ctl_tree(ctlt_relative(offsetof(type,mlabel)),ctlt_unique)

Get the class name of the 'set'; unique-instance tree.

Parameters:
type Template: Structure type this link belongs to.
mlabel Template: A unique label for this sort of link
compare Template: Comparison of types for tree search/placement

Definition at line 25 of file iset.h.

#define ctl_iset_auto ( type,
mlabel,
compare,
ilabel   )     ctl_tree_auto(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, compare, ilabel )

Make a tree from auto variables for stack or global use Uses non-standard ANSI extension: non-const initializers.

Parameters:
type Template: Structure type this link belongs to.
mlabel Template: A unique label for this sort of link
compare Template: Comparison of types for tree search/placement
ilabel Template/param: Whatever dereferencing is required + the base ilabel from ctl_iset_decl

Definition at line 54 of file iset.h.

#define ctl_iset_back ( type,
mlabel,
ilabel   )     ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, back)( ilabel )

Get last member of set.

Parameters:
type Template: Structure type this link belongs to.
mlabel Template: A unique label for this sort of link
ilabel Template/param: Whatever dereferencing is required + the base ilabel from ctl_iset_decl

Definition at line 146 of file iset.h.

#define ctl_iset_decllink ( type,
mlabel   )     ctlt_node_type(ctlt_relative(offsetof(type,mlabel)),ctlt_unique) mlabel

Declare a tree link member.

Parameters:
type Template: Structure type this link belongs to.
mlabel Template: A unique label for this sort of link

Definition at line 33 of file iset.h.

#define ctl_iset_find ( type,
mlabel,
ilabel,
value   )     (type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, find)( (ilabel), (value) )

Find a member, given a template member as a value.

Parameters:
type Template: Structure type this link belongs to.
mlabel Template: A unique label for this sort of link
ilabel Template/param: Whatever dereferencing is required + the base ilabel from ctl_iset_decl
value Pointer a node we manufactured to compare with
Returns:
Pointer to found object if it's there; otherwise NULL

Definition at line 97 of file iset.h.

#define ctl_iset_foreach ( type,
mlabel,
ilabel,
label   ) 

Value:

ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, iterator ) ppConcat(stack_,label);\
    type* label = (type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, iterator_begin)( &ppConcat(stack_,label), (ilabel) );\
    for ( ; label; label = (type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, iterator_next)( &ppConcat(stack_,label) ) )
iset iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code

Parameters:
type What type is the collection
mlabel Template: A unique label for this sort of link
ilabel Template/param: Whatever dereferencing is required + the base ilabel from ctl_iset_decl
label What to call the iterator (i.e. curr)

Definition at line 176 of file iset.h.

#define ctl_iset_foreach_const ( type,
mlabel,
ilabel,
label   ) 

Value:

ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, iterator ) ppConcat(stack_,label);\
    const type* label = (const type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, iterator_begin)( &ppConcat(stack_,label), (ilabel) );\
    for ( ; label; label = (const type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, iterator_next)( &ppConcat(stack_,label) ) )
Constant fixed C iset iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.

Parameters:
type What type is the collection
mlabel Template: A unique label for this sort of link
ilabel Pointer to instance of the ctl_rtree we're iterating
label What to call the iterator (i.e. curr)

Definition at line 190 of file iset.h.

#define ctl_iset_foreach_reverse ( type,
mlabel,
ilabel,
label   ) 

Value:

ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, iterator ) ppConcat(stack_,label);\
    type* label = (type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, iterator_rbegin)( &ppConcat(stack_,label), (ilabel) );\
    for ( ; label; label = (type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, iterator_prev)( &ppConcat(stack_,label) ) )
Backward C iset iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.

Parameters:
type What type is the collection
mlabel Template: A unique label for this sort of link
ilabel Pointer to instance of the ctl_rtree we're iterating
label What to call the iterator (i.e. curr)

Definition at line 204 of file iset.h.

#define ctl_iset_foreach_reverse_const ( type,
mlabel,
ilabel,
label   ) 

Value:

ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, iterator ) ppConcat(stack_,label);\
    const type* label = (const type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, iterator_rbegin)( &ppConcat(stack_,label), (ilabel) );\
    for ( ; label; label = (const type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, iterator_prev)( &ppConcat(stack_,label) ) )
Backward, constant C iset iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.

Parameters:
type What type is the collection
mlabel Template: A unique label for this sort of link
ilabel Pointer to instance of the ctl_rtree we're iterating
label What to call the iterator (i.e. curr)

Definition at line 218 of file iset.h.

#define ctl_iset_from ( type,
mlabel,
ilabel,
from,
label   ) 

Value:

ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, iterator ) ppConcat(stack_,label);\
    type* label = (type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, iterator_begin_from)( &ppConcat(stack_,label), (ilabel), (from) );\
    for ( ; label; label = (type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, iterator_next)( &ppConcat(stack_,label) ) )
Iterators for avl data; from some point in tree to the end in a given direction.

Parameters:
type What type is the collection
mlabel Template: A unique label for this sort of link
ilabel Pointer to instance of the ctl_rtree we're iterating
from Starting value as an ilabel-based type
label What to call the iterator (i.e. curr)

Definition at line 233 of file iset.h.

#define ctl_iset_from_to ( type,
mlabel,
ilabel,
from,
to,
label   ) 

Value:

ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, iterator ) ppConcat(stack_,label);\
    type* label = (type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, iterator_begin_from)( &ppConcat(stack_,label), (ilabel), (from) );\
    for( ; label && (ilabel)->compare(label,(to)) < 0; label = (type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, iterator_next)( &ppConcat(stack_,label) ) )
From->to iterators for avl data.

Parameters:
type What type is the collection
mlabel Template: A unique label for this sort of link
ilabel Pointer to instance of the ctl_rtree we're iterating
from Starting value as an ilabel-based type
to Ending value as an ilabel-based type;
label What to call the iterator (i.e. curr) 'to' value is not invlusive. If it encounters a value >= 'to' (<= for reverse), iteration stops. This behavior better supports floats or values where it's just easier to specify the next higher than the maximum of current.

Definition at line 271 of file iset.h.

#define ctl_iset_front ( type,
mlabel,
ilabel   )     ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, front)( ilabel )

Get first member of set.

Parameters:
type Template: Structure type this link belongs to.
mlabel Template: A unique label for this sort of link
ilabel Template/param: Whatever dereferencing is required + the base ilabel from ctl_iset_decl

Definition at line 137 of file iset.h.

#define ctl_iset_init ( type,
mlabel,
compare,
ilabel   )     ctl_tree_init(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, compare, ilabel )

Make a tree initially empty.

Parameters:
type Template: Structure type this link belongs to.
mlabel Template: A unique label for this sort of link
compare Template: Comparison of types for tree search/placement
ilabel Template/param: Whatever dereferencing is required + the base ilabel from ctl_iset_decl

Definition at line 65 of file iset.h.

#define ctl_iset_initlink ( type,
mlabel,
curr   )     ctl_tree_node_init(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, &curr->mlabel)

Initialize a link.

Parameters:
type Template: Structure type this link belongs to.
mlabel Template: A unique label for this sort of link
curr Instance of link we are initializing

Definition at line 43 of file iset.h.

#define ctl_iset_insert ( type,
mlabel,
ilabel,
data   )     (type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, insert)( (ilabel), (data) )

Insert a new member (MUST NOT BE IN ANY OTHER TREE).

Parameters:
type Template: Structure type this link belongs to.
mlabel Template: A unique label for this sort of link
ilabel Template/param: Whatever dereferencing is required + the base ilabel from ctl_iset_decl
data Pointer to new member we're adding
Returns:
Pointer to curr if it was inserted; pointer to something else if it already existed

Definition at line 86 of file iset.h.

#define ctl_iset_pop_back ( type,
mlabel,
ilabel   )     ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, pop_back)( ilabel )

Get and remove the last member of the set.

Parameters:
type Template: Structure type this link belongs to.
mlabel Template: A unique label for this sort of link
ilabel Template/param: Whatever dereferencing is required + the base ilabel from ctl_iset_decl

Definition at line 164 of file iset.h.

#define ctl_iset_pop_front ( type,
mlabel,
ilabel   )     ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, pop_front)( ilabel )

Get and remove the first member of the set.

Parameters:
type Template: Structure type this link belongs to.
mlabel Template: A unique label for this sort of link
ilabel Template/param: Whatever dereferencing is required + the base ilabel from ctl_iset_decl

Definition at line 155 of file iset.h.

#define ctl_iset_remove ( type,
mlabel,
ilabel,
value   )     (type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, remove)( (ilabel), (value) )

Remove a member.

Parameters:
type Template: Structure type this link belongs to.
mlabel Template: A unique label for this sort of link
ilabel Template/param: Whatever dereferencing is required + the base ilabel from ctl_iset_decl
value Pointer a node we manufactured to compare with
Returns:
Pointer to member we've removed, or NULL if not found.

Definition at line 108 of file iset.h.

#define ctl_iset_reset ( type,
mlabel,
ilabel   )     ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, reset)( ilabel )

Remove a all tree members member.

Parameters:
type Template: Structure type this link belongs to.
mlabel Template: A unique label for this sort of link
ilabel Template/param: Whatever dereferencing is required + the base ilabel from ctl_iset_decl

Definition at line 128 of file iset.h.

#define ctl_iset_size ( type,
mlabel,
ilabel   )     ctl_tree_size(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, ilabel )

Get size of tree.

Parameters:
type Template: Structure type this link belongs to.
mlabel Template: A unique label for this sort of link
ilabel Template/param: Whatever dereferencing is required + the base ilabel from ctl_iset_decl

Definition at line 75 of file iset.h.

#define ctl_iset_unlink ( type,
mlabel,
ilabel,
data   )     (type*)ctl_tree_(ctlt_relative(offsetof(type,mlabel)),ctlt_unique, unlink)( (ilabel), (data) )

Remove a member.

Parameters:
type Template: Structure type this link belongs to.
mlabel Template: A unique label for this sort of link
ilabel Template/param: Whatever dereferencing is required + the base ilabel from ctl_iset_decl
data Pointer to what is known to be the actual value from the tree
Returns:
Pointer to member we've removed, or NULL if not found.

Definition at line 119 of file iset.h.

#define ctl_list_foreach ( label,
instance,
iterator   ) 

Value:

ppConcat(label,_type)* iterator;\
    ppConcat(label,_node)* ppConcat(_,iterator) = (instance)->_dllfront(list);\
    for( ; NULL != ppConcat(_,iterator) && intentional_assignment(iterator = &ppConcat(_,iterator)->obj); ppConcat(_,iterator) = ppConcat(_,iterator)->_dllnext(link) )
Iterate each member of a linked list.

Parameters:
label Label given to linked list type
instance Pointer to linked list instance
iterator What the user wants to call the iterated pointer
This is the simplest and fastest way to do it, but you can't modify the list while you do it. This will generally need to be wrapped in its own {} scope

Definition at line 79 of file list.h.

#define ctl_list_foreach_const ( label,
instance,
iterator   ) 

Value:

const ppConcat(label,_type)* iterator;\
    const ppConcat(label,_node)* ppConcat(_,iterator) = (instance)->_dllfront(list);\
    for( ; NULL != ppConcat(_,iterator) && intentional_assignment(iterator = &ppConcat(_,iterator)->obj); ppConcat(_,iterator) = ppConcat(_,iterator)->_dllnext(link) )
Iterate each member of a linked list.

Parameters:
label Label given to linked list type
instance Pointer to linked list instance
iterator What the user wants to call the iterated pointer
This is the simplest and fastest way to do it, but you can't modify the list while you do it. This will generally need to be wrapped in its own {} scope

Definition at line 109 of file list.h.

#define ctl_list_foreach_const_reverse ( label,
instance,
iterator   ) 

Value:

const ppConcat(label,_type)* iterator;\
    const ppConcat(label,_node)* ppConcat(_,iterator) = (instance)->_dllback(list);\
    for( ; NULL != ppConcat(_,iterator) && intentional_assignment(iterator = &ppConcat(_,iterator)->obj); ppConcat(_,iterator) = ppConcat(_,iterator)->_dllprev(link) )
Iterate each member of a linked list backwards.

Parameters:
label Label given to linked list type
instance Pointer to linked list instance
iterator What the user wants to call the iterated pointer
This is the simplest and fastest way to do it, but you can't modify the list while you do it. This will generally need to be wrapped in its own {} scope

Definition at line 124 of file list.h.

#define ctl_list_foreach_mutable ( label,
instance,
iterator   ) 

Value:

ppConcat(label,_type)* iterator;\
    ppConcat(label,_node)* ppConcat(_,iterator) = (instance)->_dllback(list);\
    ppConcat(label,_node)* ppConcat3(_,iterator,_next) = ppConcat(_,iterator)?ppConcat(_,iterator)->_dllnext(link):NULL; \
    for ( ; NULL != ppConcat(_,iterator) && intentional_assignment(iterator = &ppConcat(_,iterator)->obj); (void)(intentional_assignment(ppConcat(_,iterator) = ppConcat3(_,iterator,_next) ) && intentional_assignment(ppConcat3(_,iterator,_next) = ppConcat3(_,iterator,_next)->_dllnext(link))) )
Iterate each member of a linked list, and the currently iterated member can be deleted.

Parameters:
label Label given to linked list type
instance Pointer to linked list instance
iterator What the user wants to call the iterated pointer
This is a little slower than ctl_list_foreach, so use this only where you are iterating and deleting This will generally need to be wrapped in its own {} scope

Definition at line 139 of file list.h.

#define ctl_list_foreach_mutable_reverse ( label,
instance,
iterator   ) 

Value:

ppConcat(label,_type)* iterator;\
    ppConcat(label,_node)* ppConcat(_,iterator) = (instance)->_dllfront(list);\
    ppConcat(label,_node)* ppConcat3(_,iterator,_prev) = ppConcat(_,iterator)?ppConcat(_,iterator)->_dllprev(link):NULL; \
    for ( ; NULL != ppConcat(_,iterator) && intentional_assignment(iterator = &ppConcat(_,iterator)->obj); (void)(intentional_assignment(ppConcat(_,iterator) = ppConcat3(_,iterator,_prev)) && intentional_assignment(ppConcat3(_,iterator,_prev) = ppConcat3(_,iterator,_prev)->_dllprev(link))) )
Iterate each member of a linked list backwards, and the currently iterated member can be deleted.

Parameters:
label Label given to linked list type
instance Pointer to linked list instance
iterator What the user wants to call the iterated pointer
This is a little slower than ctl_list_foreach, so use this only where you are iterating and deleting This will generally need to be wrapped in its own {} scope

Definition at line 155 of file list.h.

#define ctl_list_foreach_reverse ( label,
instance,
iterator   ) 

Value:

ppConcat(label,_type)* iterator;\
    ppConcat(label,_node)* ppConcat(_,iterator) = (instance)->_dllback(list);\
    for( ; NULL != ppConcat(_,iterator) && intentional_assignment(iterator = &ppConcat(_,iterator)->obj); ppConcat(_,iterator) = ppConcat(_,iterator)->_dllprev(link) )
Iterate each member of a linked list backwards.

Parameters:
label Label given to linked list type
instance Pointer to linked list instance
iterator What the user wants to call the iterated pointer
This is the simplest and fastest way to do it, but you can't modify the list while you do it. This will generally need to be wrapped in its own {} scope

Definition at line 94 of file list.h.

#define ctl_map_foreach ( label,
instance,
iterator   ) 

Value:

ppConcat(label,_iterator) ppConcat(stack_,iterator);\
    const ppConcat(label,_keytype)* ppConcat(iterator,_key) = (const ppConcat(label,_keytype)*)ctl_tree_(ctlt_after,ctlt_unique,iterator_begin)( &ppConcat(stack_,iterator), (instance) );\
    ppConcat(label,_type)* iterator = ppConcat(label,_obj_from_key)( ppConcat(iterator,_key) );\
    for ( ; ppConcat(iterator,_key); ppConcat(iterator,_key) = (ppConcat(label,_keytype)*)ctl_tree_(ctlt_after,ctlt_unique, iterator_next)( &ppConcat(stack_,iterator) ), iterator = ppConcat(label,_obj_from_key)( ppConcat(iterator,_key) ) )
map iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code

Parameters:
label Label from declaration of map
instance Pointer to map instance
iterator What to call the iterator (i.e. curr)

Definition at line 48 of file map.h.

#define ctl_map_foreach_const ( label,
instance,
iterator   ) 

Value:

ppConcat(label,_iterator) ppConcat(stack_,iterator);\
    const ppConcat(label,_keytype)* ppConcat(iterator,_key) = (const ppConcat(label,_keytype)*)ctl_tree_(ctlt_after,ctlt_unique,iterator_begin)( &ppConcat(stack_,iterator), (instance) );\
    const ppConcat(label,_type)* iterator = ppConcat(label,_obj_from_key)( ppConcat(iterator,_key) );\
    for ( ; ppConcat(iterator,_key); ppConcat(iterator,_key) = (ppConcat(label,_keytype)*)ctl_tree_(ctlt_after,ctlt_unique, iterator_next)( &ppConcat(stack_,iterator) ), iterator = ppConcat(label,_obj_from_key)( ppConcat(iterator,_key) ) )
Constant fixed C map iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.

Parameters:
label Label from declaration of map
instance Pointer to map instance
iterator What to call the iterator (i.e. curr)

Definition at line 62 of file map.h.

#define ctl_map_foreach_const_reverse ( label,
instance,
iterator   ) 

Value:

ppConcat(label,_iterator) ppConcat(stack_,iterator);\
    const ppConcat(label,_keytype)* ppConcat(iterator,_key) = (const ppConcat(label,_keytype)*)ctl_tree_(ctlt_after,ctlt_unique, iterator_rbegin)( &ppConcat(stack_,iterator), (instance) );\
    const ppConcat(label,_type)* iterator = ppConcat(label,_obj_from_key)( ppConcat(iterator,_key) );\
    for ( ; ppConcat(iterator,_key); ppConcat(iterator,_key) = (ppConcat(label,_keytype)*)(ppConcat(label,_keytype)*)ctl_tree_(ctlt_after,ctlt_unique, iterator_prev)( &ppConcat(stack_,iterator) ), iterator=ppConcat(label,_obj_from_key)( ppConcat(iterator,_key) ) )
Backward, constant C map iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.

Parameters:
label Label from declaration of map
instance Pointer to map instance
iterator What to call the iterator (i.e. curr)

Definition at line 90 of file map.h.

#define ctl_map_foreach_reverse ( label,
instance,
iterator   ) 

Value:

ppConcat(label,_iterator) ppConcat(stack_,iterator);\
    const ppConcat(label,_keytype)* ppConcat(iterator,_key) = (const ppConcat(label,_keytype)*)ctl_tree_(ctlt_after,ctlt_unique, iterator_rbegin)( &ppConcat(stack_,iterator), (instance) );\
    ppConcat(label,_type)* iterator = ppConcat(label,_obj_from_key)( ppConcat(iterator,_key) );\
    for ( ; ppConcat(iterator,_key); ppConcat(iterator,_key) = (ppConcat(label,_keytype)*)(ppConcat(label,_keytype)*)ctl_tree_(ctlt_after,ctlt_unique, iterator_prev)( &ppConcat(stack_,iterator) ), iterator=ppConcat(label,_obj_from_key)( ppConcat(iterator,_key) ) )
Backward C map iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.

Parameters:
label Label from declaration of map
instance Pointer to map instance
iterator What to call the iterator (i.e. curr)

Definition at line 76 of file map.h.

#define ctl_map_from ( label,
instance,
key,
iterator   ) 

Value:

ppConcat(label,_iterator) ppConcat(stack_,iterator);\
    const ppConcat(label,_keytype)* ppConcat(iterator,_key) = (ppConcat(label,_keytype)*)ctl_tree_(ctlt_after,ctlt_unique, iterator_begin_from)( &ppConcat(stack_,iterator), (instance), (key) );\
    ppConcat(label,_type)* iterator = ppConcat(label,_obj_from_key)( ppConcat(iterator,_key) );\
    for ( ; ppConcat(iterator,_key); ppConcat(iterator,_key) = (ppConcat(label,_keytype)*)ctl_tree_(ctlt_after,ctlt_unique, iterator_next)( &ppConcat(stack_,iterator) ), iterator = ppConcat(label,_obj_from_key)( ppConcat(iterator,_key) ) )
Iterators for avl data; key some point in tree to the end in a given direction.

Parameters:
label Label key declaration of map
instance Pointer to map instance
iterator What to call the iterator (i.e. curr)
key Pointer to starting key value

Definition at line 105 of file map.h.

#define ctl_map_from_to ( label,
instance,
keyfrom,
keyto,
iterator   ) 

Value:

ppConcat(label,_iterator) ppConcat(stack_,iterator);\
    const ppConcat(label,_keytype)* ppConcat(iterator,_key) = (const ppConcat(label,_keytype)*)ctl_tree_(ctlt_after,ctlt_unique, iterator_begin_from)( &ppConcat(stack_,iterator), (instance), (keyfrom) );\
    const ppConcat(label,_type)* iterator = ppConcat(label,_obj_from_key)( ppConcat(iterator,_key) );\
    for( ; ppConcat(iterator,_key) && (instance)->compare(ppConcat(iterator,_key),(keyto)) < 0; ppConcat(iterator,_key) = (ppConcat(label,_keytype)*)ctl_tree_(ctlt_after,ctlt_unique, iterator_next)( &ppConcat(stack_,iterator) ), iterator = ppConcat(label,_obj_from_key)( ppConcat(iterator,_key) ) )
From->to iterators for avl data.

Parameters:
label Label from declaration of map
instance Pointer to map instance
iterator What to call the iterator (i.e. curr and curr_key)
keyfrom Starting key value
keyto Ending key value 'keyto' value is not invlusive. If it encounters a value >= 'keyto' (<= for reverse), iteration stops. This behavior better supports floats or values where it's just easier keyto specify the next higher than the maximum of current.

Definition at line 146 of file map.h.

#define ctl_multimap_foreach ( label,
instance,
iterator   ) 

Value:

ppConcat(label,_iterator) ppConcat(stack_,iterator);\
    const ppConcat(label,_keytype)* ppConcat(iterator,_key) = (const ppConcat(label,_keytype)*)ctl_tree_(ctlt_after,ctlt_multiple,iterator_begin)( &ppConcat(stack_,iterator), (instance) );\
    ppConcat(label,_type)* iterator = ppConcat(label,_obj_from_key)( ppConcat(iterator,_key) );\
    for ( ; ppConcat(iterator,_key); ppConcat(iterator,_key) = (ppConcat(label,_keytype)*)ctl_tree_(ctlt_after,ctlt_multiple, iterator_next)( &ppConcat(stack_,iterator) ), iterator = ppConcat(label,_obj_from_key)( ppConcat(iterator,_key) ) )
multimap iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code

Parameters:
label Label from declaration of multimap
instance Pointer to multimap instance
iterator What to call the iterator (i.e. curr)

Definition at line 210 of file map.h.

#define ctl_multimap_foreach_const ( label,
instance,
iterator   ) 

Value:

ppConcat(label,_iterator) ppConcat(stack_,iterator);\
    const ppConcat(label,_keytype)* ppConcat(iterator,_key) = (const ppConcat(label,_keytype)*)ctl_tree_(ctlt_after,ctlt_multiple,iterator_begin)( &ppConcat(stack_,iterator), (instance) );\
    const ppConcat(label,_type)* iterator = ppConcat(label,_obj_from_key)( ppConcat(iterator,_key) );\
    for ( ; ppConcat(iterator,_key); ppConcat(iterator,_key) = (ppConcat(label,_keytype)*)ctl_tree_(ctlt_after,ctlt_multiple, iterator_next)( &ppConcat(stack_,iterator) ), iterator = ppConcat(label,_obj_from_key)( ppConcat(iterator,_key) ) )
Constant fixed C multimap iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.

Parameters:
label Label from declaration of multimap
instance Pointer to multimap instance
iterator What to call the iterator (i.e. curr)

Definition at line 224 of file map.h.

#define ctl_multimap_foreach_const_reverse ( label,
instance,
iterator   ) 

Value:

ppConcat(label,_iterator) ppConcat(stack_,iterator);\
    const ppConcat(label,_keytype)* ppConcat(iterator,_key) = (const ppConcat(label,_keytype)*)ctl_tree_(ctlt_after,ctlt_multiple, iterator_rbegin)( &ppConcat(stack_,iterator), (instance) );\
    const ppConcat(label,_type)* iterator = ppConcat(label,_obj_from_key)( ppConcat(iterator,_key) );\
    for ( ; ppConcat(iterator,_key); ppConcat(iterator,_key) = (ppConcat(label,_keytype)*)(ppConcat(label,_keytype)*)ctl_tree_(ctlt_after,ctlt_multiple, iterator_prev)( &ppConcat(stack_,iterator) ), iterator=ppConcat(label,_obj_from_key)( ppConcat(iterator,_key) ) )
Backward, constant C multimap iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.

Parameters:
label Label from declaration of multimap
instance Pointer to multimap instance
iterator What to call the iterator (i.e. curr)

Definition at line 252 of file map.h.

#define ctl_multimap_foreach_reverse ( label,
instance,
iterator   ) 

Value:

ppConcat(label,_iterator) ppConcat(stack_,iterator);\
    const ppConcat(label,_keytype)* ppConcat(iterator,_key) = (const ppConcat(label,_keytype)*)ctl_tree_(ctlt_after,ctlt_multiple, iterator_rbegin)( &ppConcat(stack_,iterator), (instance) );\
    ppConcat(label,_type)* iterator = ppConcat(label,_obj_from_key)( ppConcat(iterator,_key) );\
    for ( ; ppConcat(iterator,_key); ppConcat(iterator,_key) = (ppConcat(label,_keytype)*)(ppConcat(label,_keytype)*)ctl_tree_(ctlt_after,ctlt_multiple, iterator_prev)( &ppConcat(stack_,iterator) ), iterator=ppConcat(label,_obj_from_key)( ppConcat(iterator,_key) ) )
Backward C multimap iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.

Parameters:
label Label from declaration of multimap
instance Pointer to multimap instance
iterator What to call the iterator (i.e. curr)

Definition at line 238 of file map.h.

#define ctl_multimap_from ( label,
instance,
key,
iterator   ) 

Value:

ppConcat(label,_iterator) ppConcat(stack_,iterator);\
    const ppConcat(label,_keytype)* ppConcat(iterator,_key) = (ppConcat(label,_keytype)*)ctl_tree_(ctlt_after,ctlt_multiple, iterator_begin_from)( &ppConcat(stack_,iterator), (instance), (key) );\
    ppConcat(label,_type)* iterator = ppConcat(label,_obj_from_key)( ppConcat(iterator,_key) );\
    for ( ; ppConcat(iterator,_key); ppConcat(iterator,_key) = (ppConcat(label,_keytype)*)ctl_tree_(ctlt_after,ctlt_multiple, iterator_next)( &ppConcat(stack_,iterator) ), iterator = ppConcat(label,_obj_from_key)( ppConcat(iterator,_key) ) )
Iterators for avl data; key some point in tree to the end in a given direction.

Parameters:
label Label key declaration of multimap
instance Pointer to multimap instance
iterator What to call the iterator (i.e. curr)
key Pointer to starting key value

Definition at line 267 of file map.h.

#define ctl_multimap_from_to ( label,
instance,
keyfrom,
keyto,
iterator   ) 

Value:

ppConcat(label,_iterator) ppConcat(stack_,iterator);\
    const ppConcat(label,_keytype)* ppConcat(iterator,_key) = (const ppConcat(label,_keytype)*)ctl_tree_(ctlt_after,ctlt_multiple, iterator_begin_from)( &ppConcat(stack_,iterator), (instance), (keyfrom) );\
    const ppConcat(label,_type)* iterator = ppConcat(label,_obj_from_key)( ppConcat(iterator,_key) );\
    for( ; ppConcat(iterator,_key) && (instance)->compare(ppConcat(iterator,_key),(keyto)) < 0; ppConcat(iterator,_key) = (ppConcat(label,_keytype)*)ctl_tree_(ctlt_after,ctlt_multiple, iterator_next)( &ppConcat(stack_,iterator) ), iterator = ppConcat(label,_obj_from_key)( ppConcat(iterator,_key) ) )
From->to iterators for avl data.

Parameters:
label Label from declaration of multimap
instance Pointer to multimap instance
iterator What to call the iterator (i.e. curr and curr_key)
keyfrom Starting key value
keyto Ending key value 'keyto' value is not invlusive. If it encounters a value >= 'keyto' (<= for reverse), iteration stops. This behavior better supports floats or values where it's just easier keyto specify the next higher than the maximum of current.

Definition at line 308 of file map.h.

#define ctl_multiset_foreach ( label,
instance,
iterator   ) 

Value:

ppConcat(label,_iterator) ppConcat(stack_,iterator);\
    ppConcat(label,_type)* iterator = (ppConcat(label,_type)*)ctl_tree_(ctlt_after,ctlt_multiple,iterator_begin)( &ppConcat(stack_,iterator), (instance) );\
    for ( ; iterator; iterator = (ppConcat(label,_type)*)ctl_tree_(ctlt_after,ctlt_multiple, iterator_next)( &ppConcat(stack_,iterator) ) )
set iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code

Parameters:
label Label from declaration of multiset
instance Pointer to multiset instance
iterator What to call the iterator (i.e. curr)

Definition at line 214 of file set.h.

#define ctl_multiset_foreach_const ( label,
instance,
iterator   ) 

Value:

ppConcat(label,_iterator) ppConcat(stack_,iterator);\
    const ppConcat(label,_type)* iterator = (const ppConcat(label,_type)*)ctl_tree_(ctlt_after,ctlt_multiple,iterator_begin)( &ppConcat(stack_,iterator), (instance) );\
    for ( ; iterator; iterator = (const ppConcat(label,_type)*)ctl_tree_(ctlt_after,ctlt_multiple, iterator_next)( &ppConcat(stack_,iterator) ) )
Constant fixed C set iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.

Parameters:
label Label from declaration of multiset
instance Pointer to multiset instance
iterator What to call the iterator (i.e. curr)

Definition at line 227 of file set.h.

#define ctl_multiset_foreach_const_reverse ( label,
instance,
iterator   ) 

Value:

ppConcat(label,_iterator) ppConcat(stack_,iterator);\
    const ppConcat(label,_type)* iterator = (const ppConcat(label,_type)*)ctl_tree_(ctlt_after,ctlt_multiple,iterator_rbegin)( &ppConcat(stack_,iterator), (instance) );\
    for ( ; iterator; iterator = (const ppConcat(label,_type)*)ctl_tree_(ctlt_after,ctlt_multiple, iterator_prev)( &ppConcat(stack_,iterator) ) )
Backward, constant C set iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.

Parameters:
label Label from declaration of multiset
instance Pointer to multiset instance
iterator What to call the iterator (i.e. curr)

Definition at line 253 of file set.h.

#define ctl_multiset_foreach_reverse ( label,
instance,
iterator   ) 

Value:

ppConcat(label,_iterator) ppConcat(stack_,iterator);\
    ppConcat(label,_type)* iterator = (ppConcat(label,_type)*)ctl_tree_(ctlt_after,ctlt_multiple,iterator_rbegin)( &ppConcat(stack_,iterator), (instance) );\
    for ( ; iterator; iterator = (ppConcat(label,_type)*)ctl_tree_(ctlt_after,ctlt_multiple, iterator_prev)( &ppConcat(stack_,iterator) ) )
Backward C set iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.

Parameters:
label Label from declaration of multiset
instance Pointer to multiset instance
iterator What to call the iterator (i.e. curr)

Definition at line 240 of file set.h.

#define ctl_multiset_from ( label,
instance,
key,
iterator   ) 

Value:

ppConcat(label,_iterator) ppConcat(stack_,iterator);\
    ppConcat(label,_type)* iterator = (ppConcat(label,_type)*)ctl_tree_(ctlt_after,ctlt_multiple, iterator_begin_from)( &ppConcat(stack_,iterator), (instance), (key) );\
    for ( ; iterator; iterator = (ppConcat(label,_type)*)ctl_tree_(ctlt_after,ctlt_multiple, iterator_next)( &ppConcat(stack_,iterator) ) )
Iterators for avl data; key some point in tree to the end in a given direction.

Parameters:
label Label key declaration of multiset
instance Pointer to multiset instance
iterator What to call the iterator (i.e. curr)
key Pointer to starting key value

Definition at line 267 of file set.h.

#define ctl_multiset_from_to ( label,
instance,
keyfrom,
keyto,
iterator   ) 

Value:

ppConcat(label,_iterator) ppConcat(stack_,iterator);\
    ppConcat(label,_type)* iterator = (ppConcat(label,_type)*)ctl_tree_(ctlt_after,ctlt_multiple, iterator_begin_from)( &ppConcat(stack_,iterator), (instance), (keyfrom) );\
    for( ; iterator && (instance)->compare(iterator,(keyto)) < 0; iterator = (ppConcat(label,_type)*)ctl_tree_(ctlt_after,ctlt_multiple, iterator_next)( &ppConcat(stack_,iterator) ) )
From->to iterators for avl data.

Parameters:
label Label from declaration of multiset
instance Pointer to multiset instance
iterator What to call the iterator (i.e. curr )
keyfrom Starting key value
keyto Ending key value 'keyto' value is not invlusive. If it encounters a value >= 'keyto' (<= for reverse), iteration stops. This behavior better supports floats or values where it's just easier keyto specify the next higher than the maximum of current.

Definition at line 304 of file set.h.

#define ctl_set_foreach ( label,
instance,
iterator   ) 

Value:

ppConcat(label,_iterator) ppConcat(stack_,iterator);\
    ppConcat(label,_type)* iterator = (ppConcat(label,_type)*)ctl_tree_(ctlt_after,ctlt_unique,iterator_begin)( &ppConcat(stack_,iterator), (instance) );\
    for ( ; iterator; iterator = (ppConcat(label,_type)*)ctl_tree_(ctlt_after,ctlt_unique, iterator_next)( &ppConcat(stack_,iterator) ) )
set iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code

Parameters:
label Label from declaration of set
instance Pointer to set instance
iterator What to call the iterator (i.e. curr)

Definition at line 66 of file set.h.

#define ctl_set_foreach_const ( label,
instance,
iterator   ) 

Value:

ppConcat(label,_iterator) ppConcat(stack_,iterator);\
    const ppConcat(label,_type)* iterator = (const ppConcat(label,_type)*)ctl_tree_(ctlt_after,ctlt_unique,iterator_begin)( &ppConcat(stack_,iterator), (instance) );\
    for ( ; iterator; iterator = (const ppConcat(label,_type)*)ctl_tree_(ctlt_after,ctlt_unique, iterator_next)( &ppConcat(stack_,iterator) ) )
Constant fixed C set iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.

Parameters:
label Label from declaration of set
instance Pointer to set instance
iterator What to call the iterator (i.e. curr)

Definition at line 79 of file set.h.

#define ctl_set_foreach_const_reverse ( label,
instance,
iterator   ) 

Value:

ppConcat(label,_iterator) ppConcat(stack_,iterator);\
    const ppConcat(label,_type)* iterator = (const ppConcat(label,_type)*)ctl_tree_(ctlt_after,ctlt_unique,iterator_rbegin)( &ppConcat(stack_,iterator), (instance) );\
    for ( ; iterator; iterator = (const ppConcat(label,_type)*)ctl_tree_(ctlt_after,ctlt_unique, iterator_prev)( &ppConcat(stack_,iterator) ) )
Backward, constant C set iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.

Parameters:
label Label from declaration of set
instance Pointer to set instance
iterator What to call the iterator (i.e. curr)

Definition at line 105 of file set.h.

#define ctl_set_foreach_reverse ( label,
instance,
iterator   ) 

Value:

ppConcat(label,_iterator) ppConcat(stack_,iterator);\
    ppConcat(label,_type)* iterator = (ppConcat(label,_type)*)ctl_tree_(ctlt_after,ctlt_unique,iterator_rbegin)( &ppConcat(stack_,iterator), (instance) );\
    for ( ; iterator; iterator = (ppConcat(label,_type)*)ctl_tree_(ctlt_after,ctlt_unique, iterator_prev)( &ppConcat(stack_,iterator) ) )
Backward C set iterator Iterator is available after loop, so these loops should be wrapped in their own { } braces, if you don't want it interfering with other code.

Parameters:
label Label from declaration of set
instance Pointer to set instance
iterator What to call the iterator (i.e. curr)

Definition at line 92 of file set.h.

#define ctl_set_from ( label,
instance,
key,
iterator   ) 

Value:

ppConcat(label,_iterator) ppConcat(stack_,iterator);\
    ppConcat(label,_type)* iterator = (ppConcat(label,_type)*)ctl_tree_(ctlt_after,ctlt_unique, iterator_begin_from)( &ppConcat(stack_,iterator), (instance), (key) );\
    for ( ; iterator; iterator = (ppConcat(label,_type)*)ctl_tree_(ctlt_after,ctlt_unique, iterator_next)( &ppConcat(stack_,iterator) ) )
Iterators for avl data; key some point in tree to the end in a given direction.

Parameters:
label Label key declaration of set
instance Pointer to set instance
iterator What to call the iterator (i.e. curr)
key Pointer to starting key value

Definition at line 119 of file set.h.

#define ctl_set_from_to ( label,
instance,
keyfrom,
keyto,
iterator   ) 

Value:

ppConcat(label,_iterator) ppConcat(stack_,iterator);\
    ppConcat(label,_type)* iterator = (ppConcat(label,_type)*)ctl_tree_(ctlt_after,ctlt_unique, iterator_begin_from)( &ppConcat(stack_,iterator), (instance), (keyfrom) );\
    for( ; iterator && (instance)->compare(iterator,(keyto)) < 0; iterator = (ppConcat(label,_type)*)ctl_tree_(ctlt_after,ctlt_unique, iterator_next)( &ppConcat(stack_,iterator) ) )
From->to iterators for avl data.

Parameters:
label Label from declaration of set
instance Pointer to set instance
iterator What to call the iterator (i.e. curr )
keyfrom Starting key value
keyto Ending key value 'keyto' value is not invlusive. If it encounters a value >= 'keyto' (<= for reverse), iteration stops. This behavior better supports floats or values where it's just easier keyto specify the next higher than the maximum of current.

Definition at line 156 of file set.h.

#define ctl_tree ( offset,
multiple   )     ppConcat4(ctl_tree_,ctlt_offset_name(offset),_,ctlt_multi_name(multiple))

Build template naming from offset,multiple.

Parameters:
offset Template: How to find node from data, data from node
multiple Template: Whether tree wants unique, or multiple copies of members

Definition at line 162 of file tree.h.

#define ctl_tree_ ( offset,
multiple,
label   )     ppConcat3(ctl_tree(offset,multiple),_,label)

Build template function/data naming.

Parameters:
offset Template: How to find node from data, data from node
multiple Template: Whether tree wants unique, or multiple copies of members
label Name of thing we want to generate a template name for

Definition at line 171 of file tree.h.

#define ctl_tree_auto ( offset,
multiple,
comparator,
label   ) 

Value:

ctl_tree(offset,multiple) label = \
        { NULL, (tree_compare)(comparator), 0, NULL, ctlt_offset_for_relative(offset, ctlt_getoffset(offset,multiple)) }
Initialize a tree on stack or as global Uses non-standard ANSI extension: non-const initializers.

Parameters:
offset Template: How to find node from data, data from node
multiple Template: Whether tree wants unique, or multiple copies of members
comparator ctl_tree_comparator to order tree
label What to call the tree

Definition at line 273 of file tree.h.

#define ctl_tree_data_to_node ( offset,
multiple,
tree,
data   )     ppConcat(ctl_tree_data_node_,offset)(offset,multiple, tree, data )

Get node from from data.

Parameters:
offset Template: How to find node from data, data from node
multiple Template: Whether tree wants unique, or multiple copies of members
tree Pointer to ctl_tree
data Data pointer node to translate
Returns:
pointer to node/link

Definition at line 247 of file tree.h.

#define ctl_tree_init ( offset,
multiple,
comparator,
tree   )     { (tree)->found = (tree)->root = NULL; (tree)->compare = (tree_compare)(comparator); (tree)->size = 0; ctlt_offset_for_relative(offset, (tree)->data_offset = ctlt_getoffset(offset,multiple);) }

Initialize a tree tree.

Parameters:
offset Template: How to find node from data, data from node
multiple Template: Whether tree wants unique, or multiple copies of members
comparator ctl_tree_comparator to order tree
tree Pointer to ctl_tree

Definition at line 285 of file tree.h.

#define ctl_tree_node_init ( offset,
multiple,
node   )     { (node)->left = (node)->right = NULL; (node)->balance = 0; }

Initialize a node to a clear state.

Parameters:
offset Template: How to find node from data, data from node
multiple Template: Whether tree wants unique, or multiple copies of members
node Node pointer to check

Definition at line 262 of file tree.h.

#define ctl_tree_node_to_data ( offset,
multiple,
tree,
node   )     ppConcat(ctl_tree_node_data_,offset)(offset,multiple, tree, node )

Get data from node.

Parameters:
offset Template: How to find node from data, data from node
multiple Template: Whether tree wants unique, or multiple copies of members
tree Pointer to ctl_tree
node Node pointer node to translate
Returns:
void pointer to object

Definition at line 230 of file tree.h.

#define ctl_tree_size ( offset,
multiple,
tree   )     ((tree)->size)

Get the count of members in this tree.

Parameters:
offset Template: How to find node from data, data from node
multiple Template: Whether tree wants unique, or multiple copies of members
tree Pointer to the ctl_tree class
Returns:
Count of live links

Definition at line 295 of file tree.h.

#define ctl_vector_foreach ( label,
instance,
iterator   ) 

Value:

ppConcat(label,_type)* iterator = (instance)->array;\
    const ppConcat(label,_type)* ppConcat(end_,iterator) = iterator + (instance)->count;\
    for( ; iterator < ppConcat(end_,iterator); iterator++ )
Iterate each member of a vector.

Parameters:
label Label given to vector type
instance Pointer to vector instance
iterator What the user wants to call the iterated pointer
This is the simplest and fastest way to do it, but you can't modify the list while you do it. This will generally need to be wrapped in its own {} scope Insertions/deletions in array will potentially crash this

Definition at line 145 of file vector.h.

#define ctl_vector_foreach_const ( label,
instance,
iterator   ) 

Value:

const ppConcat(label,_type)* iterator = (instance)->array;\
    const ppConcat(label,_type)* ppConcat(end_,iterator) = iterator + (instance)->count;\
    for( ; iterator < ppConcat(end_,iterator); iterator++ )
Iterate each member of a vector.

Parameters:
label Label given to vector type
instance Pointer to vector instance
iterator What the user wants to call the iterated pointer
This is the simplest and fastest way to do it, but you can't modify the list while you do it. Insertions/deletions in array will potentially crash this

Definition at line 114 of file vector.h.

#define ctl_vector_foreach_const_reverse ( label,
instance,
iterator   ) 

Value:

const ppConcat(label,_type)* ppConcat(end_,iterator) = (instance)->array;\
    const ppConcat(label,_type)* iterator = ppConcat(end_,iterator) + (instance)->count;\
    while( iterator-- > ppConcat(end_,iterator) )
Iterate each member of a vector, backwards.

Parameters:
label Label given to vector type
instance Pointer to vector instance
iterator What the user wants to call the iterated pointer
This is the simplest and fastest way to do it Insertions/deletions in array will potentially crash this

Definition at line 129 of file vector.h.

#define ctl_vector_foreach_mutable ( label,
instance,
iterator   ) 

Value:

ppConcat(label,_type)* iterator;\
    int ppConcat(index_,iterator);\
    label* ppConcat(instance_,iterator) = (instance);\
    for( ppConcat(index_,iterator) = 0; ppConcat(index_,iterator) < (int)ppConcat(instance_,iterator)->count && intentional_assignment(iterator=ppConcat(instance_,iterator)->array + ppConcat(index_,iterator)); ppConcat(index_,iterator)++ )
Iterate each member of a vector.

Parameters:
label Label given to vector type
instance Pointer to vector instance
iterator What the user wants to call the iterated pointer
Insertions/deletions are allowed, and continue iteration, but at a cost

Definition at line 175 of file vector.h.

#define ctl_vector_foreach_mutable_reverse ( label,
instance,
iterator   ) 

Value:

ppConcat(label,_type)* iterator;\
    int ppConcat(index_,iterator);\
    label* ppConcat(instance_,iterator) = (instance);\
    for( ppConcat(index_,iterator) = (int)ppConcat(instance_,iterator)->count; ppConcat(index_,iterator) > 0 && intentional_assignment(iterator=ppConcat(instance_,iterator)->array + ppConcat(index_,iterator)-1); ppConcat(index_,iterator) = min(ppConcat(index_,iterator)-1,(int)ppConcat(instance_,iterator)->count) )
Iterate each member of a vector backwards.

Parameters:
label Label given to vector type
instance Pointer to vector instance
iterator What the user wants to call the iterated pointer
Insertions/deletions are allowed to happen, and continue iteration, but at a cost

Definition at line 190 of file vector.h.

#define ctl_vector_foreach_reverse ( label,
instance,
iterator   ) 

Value:

ppConcat(label,_type)* ppConcat(end_,iterator) = (instance)->array;\
    const ppConcat(label,_type)* iterator = ppConcat(end_,iterator) + (instance)->count;\
    while( iterator-- > ppConcat(end_,iterator) )
Iterate each member of a vector, backwards.

Parameters:
label Label given to vector type
instance Pointer to vector instance
iterator What the user wants to call the iterated pointer
This is the simplest and fastest way to do it This will generally need to be wrapped in its own {} scope Insertions/deletions in array will potentially crash this

Definition at line 161 of file vector.h.

#define inbounds ( a,
 )     ( (size_t)(i) < countof(a) )

See if index 'i' is in bounds for fully typed simple array 'a'.

Parameters:
a Array we're checking; must be a fully qualified C array, with known length.
i Index to check

Definition at line 41 of file array.h.

#define indexof ( a,
 )     ((p)-(a))

Determine index of pointer 'p' in array 'a'.

Parameters:
a Array we're checking
p Pointer to item that should be in it
Returns:
Zero based index of pointer within array, 'a'

Definition at line 31 of file array.h.

#define memberof ( a,
 )     ( inbounds((a),indexof((a),(p))) && ((void*)((a)+indexof((a),(p))) == (void*)(p)) )

See if 'p' is a valid pointer to a member of 'a'.

Parameters:
a Array we're checking
p Pointer to item that should be in it
Returns:
true if 'p' appears to be a valid member pointer within 'a'

Definition at line 52 of file array.h.


Generated on Fri Jan 2 15:28:36 2009 for Squat by  doxygen 1.5.6