|
/opt/src/beast/sfi/sfiring.h
SYNOPSIS
| struct
| SfiRing; |
| |
| gint
| sfi_pointer_cmp
| (value1, value2, dummy); |
| SfiRing*
| sfi_ring_append
| (head, data); |
| SfiRing*
| sfi_ring_append_uniq
| (head, data); |
| gint
| sfi_ring_cmp_length
| (head, test_length); |
| SfiRing*
| sfi_ring_concat
| (head1, head2); |
| SfiRing*
| sfi_ring_copy
| (head); |
| SfiRing*
| sfi_ring_copy_deep
| (head, copy, func_data); |
| SfiRing*
| sfi_ring_copy_deep_uniq
| (sorted_ring1, copy, copy_data, cmp, cmp_data); |
| SfiRing*
| sfi_ring_copy_rest
| (ring, head); |
| SfiRing*
| sfi_ring_copy_uniq
| (sorted_ring1, cmp, data); |
| SfiRing*
| sfi_ring_difference
| (sorted_set1, sorted_set2, cmp, data); |
| gboolean
| sfi_ring_equals
| (sorted_set1, sorted_set2, cmp, data); |
| SfiRing*
| sfi_ring_find
| (head, data); |
| void
| sfi_ring_free
| (head); |
| void
| sfi_ring_free_deep
| (head, data_destroy); |
| SfiRing*
| sfi_ring_from_list
| (list); |
| SfiRing*
| sfi_ring_from_list_and_free
| (list); |
| SfiRing*
| sfi_ring_from_slist
| (slist); |
| SfiRing*
| sfi_ring_from_slist_and_free
| (slist); |
| gboolean
| sfi_ring_includes
| (sorted_super_set, sorted_sub_set, cmp, data); |
| gint
| sfi_ring_index
| (head, data); |
| SfiRing*
| sfi_ring_insert
| (head, data, position); |
| SfiRing*
| sfi_ring_insert_before
| (head, sibling, data); |
| SfiRing*
| sfi_ring_insert_sorted
| (head, insertion_data, cmp, cmp_data); |
| SfiRing*
| sfi_ring_intersection
| (sorted_set1, sorted_set2, cmp, data); |
| guint
| sfi_ring_length
| (head); |
| gpointer
| sfi_ring_max
| (head, cmp, data); |
| SfiRing*
| sfi_ring_max_node
| (head, cmp, data); |
| SfiRing*
| sfi_ring_merge_sorted
| (head1, head2, cmp, data); |
| gpointer
| sfi_ring_min
| (head, cmp, data); |
| SfiRing*
| sfi_ring_min_node
| (head, cmp, data); |
| gboolean
| sfi_ring_mismatch
| (sorted_ring1_p, sorted_ring2_p, cmp, data); |
| SfiRing*
| sfi_ring_nth
| (head, n); |
| gpointer
| sfi_ring_nth_data
| (head, n); |
| gpointer
| sfi_ring_pop_head
| (head); |
| gpointer
| sfi_ring_pop_tail
| (head); |
| gint
| sfi_ring_position
| (head, node); |
| SfiRing*
| sfi_ring_prepend
| (head, data); |
| SfiRing*
| sfi_ring_prepend_uniq
| (head, data); |
| SfiRing*
| sfi_ring_remove
| (head, data); |
| SfiRing*
| sfi_ring_remove_node
| (head, node); |
| SfiRing*
| sfi_ring_reorder
| (unordered_ring, new_ring_order); |
| SfiRing*
| sfi_ring_reverse
| (head); |
| SfiRing*
| sfi_ring_sort
| (head, cmp, data); |
| SfiRing*
| sfi_ring_split
| (head1, head2); |
| SfiRing*
| sfi_ring_symmetric_difference
| (sorted_set1, sorted_set2, cmp, data); |
| SfiRing*
| sfi_ring_union
| (sorted_set1, sorted_set2, cmp, data); |
| SfiRing*
| sfi_ring_uniq
| (sorted_ring1, cmp, data); |
| SfiRing*
| sfi_ring_uniq_free_deep
| (sorted_ring1, cmp, data, data_destroy); |
DESCRIPTION
SfiRing | | /opt/src/beast/sfi/sfiring.h:39 |
sfi_pointer_cmp | | /opt/src/beast/sfi/sfiring.h:31 |
sfi_ring_append | | /opt/src/beast/sfi/sfiring.h:49 |
sfi_ring_append_uniq | | /opt/src/beast/sfi/sfiring.h:51 |
sfi_ring_cmp_length | | /opt/src/beast/sfi/sfiring.h:74 |
sfi_ring_concat | | /opt/src/beast/sfi/sfiring.h:82 |
sfi_ring_copy | | /opt/src/beast/sfi/sfiring.h:75 |
sfi_ring_copy_deep | | /opt/src/beast/sfi/sfiring.h:78 |
sfi_ring_copy_deep_uniq | | /opt/src/beast/sfi/sfiring.h:129 |
sfi_ring_copy_rest | | /opt/src/beast/sfi/sfiring.h:80 |
sfi_ring_copy_uniq | | /opt/src/beast/sfi/sfiring.h:132 |
sfi_ring_difference | | /opt/src/beast/sfi/sfiring.h:144 |
Collect and return all data items from sorted_set1 which are not contained in
sorted_set2, according to the cmp() function.
In mathematical terms, the returned ring is the difference (sorted_set1, sorted_set2).
The complexity is O(MAX (length (sorted_set1), length (sorted_set2))).
| sorted_set1: | | Sorted ring 1
|
| sorted_set2: | | Sorted ring 2
|
| cmp: | | Compare function for node data
|
| data: | | Data argument passed into the cmp() function
|
| RETURNS: | | Newly created (or empty) ring |
|
sfi_ring_equals | | /opt/src/beast/sfi/sfiring.h:161 |
Compare two rings according to the cmp() function. Return FALSE as
soon as a mismatch is found, returns TRUE for rings which are equal according to cmp().
The complexity is at most O(MIN (length (sorted_ring1), length (sorted_ring2))).
| sorted_ring1: | | Sorted ring 1
|
| sorted_ring2: | | Sorted ring 2
|
| cmp: | | Compare function for node data
|
| data: | | Data argument passed into the cmp() function
|
| RETURNS: | | TRUE for equal rings, FALSE otherwise |
|
sfi_ring_find | | /opt/src/beast/sfi/sfiring.h:67 |
sfi_ring_free | | /opt/src/beast/sfi/sfiring.h:90 |
sfi_ring_free_deep | | /opt/src/beast/sfi/sfiring.h:92 |
sfi_ring_from_list | | /opt/src/beast/sfi/sfiring.h:94 |
sfi_ring_from_list_and_free | | /opt/src/beast/sfi/sfiring.h:95 |
sfi_ring_from_slist | | /opt/src/beast/sfi/sfiring.h:96 |
sfi_ring_from_slist_and_free | | /opt/src/beast/sfi/sfiring.h:97 |
sfi_ring_includes | | /opt/src/beast/sfi/sfiring.h:153 |
sfi_ring_index | | /opt/src/beast/sfi/sfiring.h:61 |
sfi_ring_insert | | /opt/src/beast/sfi/sfiring.h:54 |
sfi_ring_insert_before | | /opt/src/beast/sfi/sfiring.h:57 |
sfi_ring_insert_sorted | | /opt/src/beast/sfi/sfiring.h:107 |
sfi_ring_intersection | | /opt/src/beast/sfi/sfiring.h:140 |
Return a newly created ring that contains all data items which are contained
in both sets, sorted_set1 and sorted_set2.
Items are considered equal according to the cmp() function.
For two equal items contained in both sets, the data pointer from
sorted_set1 will be added to the resulting set.
In mathematical terms, the returned ring is the intersection (sorted_set1, sorted_set2).
The complexity is O(MAX (length (sorted_set1), length (sorted_set2))).
| sorted_set1: | | Sorted ring 1
|
| sorted_set2: | | Sorted ring 2
|
| cmp: | | Compare function for node data
|
| data: | | Data argument passed into the cmp() function
|
| RETURNS: | | Newly created (or empty) ring |
|
sfi_ring_length | | /opt/src/beast/sfi/sfiring.h:72 |
sfi_ring_max | | /opt/src/beast/sfi/sfiring.h:173 |
Find and return the maximum data pointer of a ring, measured by evaluating cmp().
The complexity is O(length (head)).
| head: | | Head node of a ring or NULL for an empty ring
|
| cmp: | | Compare function for node data
|
| data: | | Data argument passed into the cmp() function
|
| RETURNS: | | Maximum data argument or NULL for empty rings |
|
sfi_ring_max_node | | /opt/src/beast/sfi/sfiring.h:167 |
Find and return the node holding the maximum data pointer of a ring, measured by evaluating cmp().
The complexity is O(length (head)).
| head: | | Head node of a ring or NULL for an empty ring
|
| cmp: | | Compare function for node data
|
| data: | | Data argument passed into the cmp() function
|
| RETURNS: | | Node with maximum data argument or NULL for empty rings |
|
sfi_ring_merge_sorted | | /opt/src/beast/sfi/sfiring.h:111 |
sfi_ring_min | | /opt/src/beast/sfi/sfiring.h:170 |
Find and return the minimum data pointer of a ring, measured by evaluating cmp().
The complexity is O(length (head)).
| head: | | Head node of a ring or NULL for an empty ring
|
| cmp: | | Compare function for node data
|
| data: | | Data argument passed into the cmp() function
|
| RETURNS: | | Minimum data argument or NULL for empty rings |
|
sfi_ring_min_node | | /opt/src/beast/sfi/sfiring.h:164 |
Find and return the node holding the minimum data pointer of a ring, measured by evaluating cmp().
The complexity is O(length (head)).
| head: | | Head node of a ring or NULL for an empty ring
|
| cmp: | | Compare function for node data
|
| data: | | Data argument passed into the cmp() function
|
| RETURNS: | | Node with minimum data argument or NULL for empty rings |
|
sfi_ring_mismatch | | /opt/src/beast/sfi/sfiring.h:157 |
Compare two rings according to the cmp() function. For mismatching rings,
sorted_ring1_p and sorted_ring2_p are set to point to the mismatching nodes.
The complexity is at most O(MIN (length (sorted_ring1), length (sorted_ring2))).
| sorted_ring1_p: | | Pointer to sorted ring 1
|
| sorted_ring2_p: | | Pointer to sorted ring 2
|
| cmp: | | Compare function for node data
|
| data: | | Data argument passed into the cmp() function
|
| RETURNS: | | TRUE for mismatching rings, FALSE otherwise |
|
sfi_ring_nth | | /opt/src/beast/sfi/sfiring.h:63 |
sfi_ring_nth_data | | /opt/src/beast/sfi/sfiring.h:65 |
sfi_ring_pop_head | | /opt/src/beast/sfi/sfiring.h:86 |
sfi_ring_pop_tail | | /opt/src/beast/sfi/sfiring.h:87 |
sfi_ring_position | | /opt/src/beast/sfi/sfiring.h:59 |
sfi_ring_prepend | | /opt/src/beast/sfi/sfiring.h:45 |
sfi_ring_prepend_uniq | | /opt/src/beast/sfi/sfiring.h:47 |
sfi_ring_remove | | /opt/src/beast/sfi/sfiring.h:71 |
sfi_ring_remove_node | | /opt/src/beast/sfi/sfiring.h:69 |
sfi_ring_reorder | | /opt/src/beast/sfi/sfiring.h:123 |
Reorders the data pointers of unordered_ring according to the order
as given by new_ring_order.
The complexity involves roughly 3 * length(unordered_ring) + qsort(unordered_ring) + length(new_ring_order) * bsearch(unordered_ring)),
i.e. it is at worst O(length(unordered_ring) * log (length(unordered_ring)) * length(new_ring_order)).
| unordered_ring: | | Unsorted ring
|
| new_ring_order: | | Ring with arbitrary order
|
| RETURNS: | | Reordered version of unordered_ring |
|
sfi_ring_reverse | | /opt/src/beast/sfi/sfiring.h:85 |
sfi_ring_sort | | /opt/src/beast/sfi/sfiring.h:114 |
sfi_ring_split | | /opt/src/beast/sfi/sfiring.h:84 |
Split a ring into two parts, starting the second ring with head2.
head2 must therefore be non-NULL and must be contained in the ring
formed by head1.
| head1: | | a non-empty ring
|
| head2: | | a ring node different from head1 contained in head1
|
| returns: | | head2 for convenience |
|
sfi_ring_symmetric_difference | | /opt/src/beast/sfi/sfiring.h:148 |
Collect and return all data items from sorted_set1 which are not contained in
sorted_set2, and all data items from sorted_set2 which are not contained in
sorted_set1, according to the cmp() function.
In mathematical terms, the returned ring is the union (difference (sorted_set1, sorted_set2)
+ difference (sorted_set2, sorted_set1)).
The complexity is O(MAX (length (sorted_set1), length (sorted_set2))).
| sorted_set1: | | Sorted ring 1
|
| sorted_set2: | | Sorted ring 2
|
| cmp: | | Compare function for node data
|
| data: | | Data argument passed into the cmp() function
|
| RETURNS: | | Newly created (or empty) ring |
|
sfi_ring_union | | /opt/src/beast/sfi/sfiring.h:136 |
Return a newly created ring that contains all data items from sorted_set1
and sorted_set2, omitting duplicates.
Items are considered equal according to the cmp() function.
For two equal items contained in both sets, the data pointer from
sorted_set1 will be added to the resulting set.
In mathematical terms, the returned ring is the union (sorted_set1, sorted_set2).
The complexity is O(MAX (length (sorted_set1), length (sorted_set2))).
| sorted_set1: | | Sorted ring 1
|
| sorted_set2: | | Sorted ring 2
|
| cmp: | | Compare function for node data
|
| data: | | Data argument passed into the cmp() function
|
| RETURNS: | | Newly created (or empty) ring |
|
sfi_ring_uniq | | /opt/src/beast/sfi/sfiring.h:117 |
sfi_ring_uniq_free_deep | | /opt/src/beast/sfi/sfiring.h:121 |
|
|