BEAST/BSE - Better Audio System and Sound Engine
0.8.2
|
#include <sfi/sfitypes.hh>
Go to the source code of this file.
Classes | |
struct | SfiRing |
Defines | |
#define | sfi_ring_push_head |
#define | sfi_ring_push_tail |
#define | sfi_ring_tail(head) |
#define | sfi_ring_walk(node, head_bound) |
#define | sfi_ring_next(node, head_bound) |
Typedefs | |
typedef gint(* | SfiCompareFunc )(gconstpointer value1, gconstpointer value2, gpointer data) |
typedef gpointer(* | SfiRingDataFunc )(gpointer data, gpointer func_data) |
Functions | |
gint | sfi_pointer_cmp (gconstpointer value1, gconstpointer value2, gpointer dummy) |
SfiRing * | sfi_ring_prepend (SfiRing *head, gpointer data) |
SfiRing * | sfi_ring_prepend_uniq (SfiRing *head, gpointer data) |
SfiRing * | sfi_ring_append (SfiRing *head, gpointer data) |
SfiRing * | sfi_ring_append_uniq (SfiRing *head, gpointer data) |
SfiRing * | sfi_ring_insert (SfiRing *head, gpointer data, gint position) |
SfiRing * | sfi_ring_insert_before (SfiRing *head, SfiRing *sibling, gpointer data) |
gint | sfi_ring_position (const SfiRing *head, const SfiRing *node) |
gint | sfi_ring_index (const SfiRing *head, gconstpointer data) |
SfiRing * | sfi_ring_nth (const SfiRing *head, guint n) |
gpointer | sfi_ring_nth_data (const SfiRing *head, guint n) |
SfiRing * | sfi_ring_find (const SfiRing *head, gconstpointer data) |
SfiRing * | sfi_ring_remove_node (SfiRing *head, SfiRing *node) |
SfiRing * | sfi_ring_remove (SfiRing *head, gpointer data) |
guint | sfi_ring_length (const SfiRing *head) |
gint | sfi_ring_cmp_length (const SfiRing *head, guint test_length) |
SfiRing * | sfi_ring_copy (const SfiRing *head) |
SfiRing * | sfi_ring_copy_deep (const SfiRing *head, SfiRingDataFunc copy, gpointer func_data) |
SfiRing * | sfi_ring_copy_rest (const SfiRing *ring, const SfiRing *head) |
SfiRing * | sfi_ring_concat (SfiRing *head1, SfiRing *head2) |
SfiRing * | sfi_ring_split (SfiRing *head1, SfiRing *head2) |
SfiRing * | sfi_ring_reverse (SfiRing *head) |
gpointer | sfi_ring_pop_head (SfiRing **head) |
gpointer | sfi_ring_pop_tail (SfiRing **head) |
void | sfi_ring_free (SfiRing *head) |
void | sfi_ring_free_deep (SfiRing *head, GDestroyNotify data_destroy) |
SfiRing * | sfi_ring_from_list (GList *list) |
SfiRing * | sfi_ring_from_list_and_free (GList *list) |
SfiRing * | sfi_ring_from_slist (GSList *slist) |
SfiRing * | sfi_ring_from_slist_and_free (GSList *slist) |
SfiRing * | sfi_ring_insert_sorted (SfiRing *head, gpointer insertion_data, SfiCompareFunc cmp, gpointer cmp_data) |
SfiRing * | sfi_ring_merge_sorted (SfiRing *head1, SfiRing *head2, SfiCompareFunc cmp, gpointer data) |
SfiRing * | sfi_ring_sort (SfiRing *head, SfiCompareFunc cmp, gpointer data) |
SfiRing * | sfi_ring_uniq (SfiRing *sorted_ring1, SfiCompareFunc cmp, gpointer data) |
SfiRing * | sfi_ring_uniq_free_deep (SfiRing *sorted_ring1, SfiCompareFunc cmp, gpointer data, GDestroyNotify data_destroy) |
SfiRing * | sfi_ring_reorder (SfiRing *unordered_ring, const SfiRing *new_ring_order) |
SfiRing * | sfi_ring_copy_deep_uniq (const SfiRing *sorted_ring1, SfiRingDataFunc copy, gpointer copy_data, SfiCompareFunc cmp, gpointer cmp_data) |
SfiRing * | sfi_ring_copy_uniq (const SfiRing *sorted_ring1, SfiCompareFunc cmp, gpointer data) |
SfiRing * | sfi_ring_union (const SfiRing *sorted_set1, const SfiRing *sorted_set2, SfiCompareFunc cmp, gpointer data) |
SfiRing * | sfi_ring_intersection (const SfiRing *sorted_set1, const SfiRing *sorted_set2, SfiCompareFunc cmp, gpointer data) |
SfiRing * | sfi_ring_difference (const SfiRing *sorted_set1, const SfiRing *sorted_set2, SfiCompareFunc cmp, gpointer data) |
SfiRing * | sfi_ring_symmetric_difference (const SfiRing *sorted_set1, const SfiRing *sorted_set2, SfiCompareFunc cmp, gpointer data) |
gboolean | sfi_ring_includes (const SfiRing *sorted_super_set, const SfiRing *sorted_sub_set, SfiCompareFunc cmp, gpointer data) |
gboolean | sfi_ring_mismatch (SfiRing **sorted_ring1_p, SfiRing **sorted_ring2_p, SfiCompareFunc cmp, gpointer data) |
gboolean | sfi_ring_equals (const SfiRing *sorted_set1, const SfiRing *sorted_set2, SfiCompareFunc cmp, gpointer data) |
SfiRing * | sfi_ring_min_node (const SfiRing *head, SfiCompareFunc cmp, gpointer data) |
SfiRing * | sfi_ring_max_node (const SfiRing *head, SfiCompareFunc cmp, gpointer data) |
gpointer | sfi_ring_min (const SfiRing *head, SfiCompareFunc cmp, gpointer data) |
gpointer | sfi_ring_max (const SfiRing *head, SfiCompareFunc cmp, gpointer data) |
SfiRing* sfi_ring_difference | ( | const SfiRing * | sorted_set1, |
const SfiRing * | sorted_set2, | ||
SfiCompareFunc | cmp, | ||
gpointer | data | ||
) |
sorted_set1 | Sorted ring 1 |
sorted_set2 | Sorted ring 2 |
cmp | Compare function for node data |
data | Data argument passed into the cmp() function |
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))).
gboolean sfi_ring_equals | ( | const SfiRing * | sorted_ring1, |
const SfiRing * | sorted_ring2, | ||
SfiCompareFunc | cmp, | ||
gpointer | data | ||
) |
sorted_ring1 | Sorted ring 1 |
sorted_ring2 | Sorted ring 2 |
cmp | Compare function for node data |
data | Data argument passed into the cmp() function |
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))).
SfiRing* sfi_ring_intersection | ( | const SfiRing * | sorted_set1, |
const SfiRing * | sorted_set2, | ||
SfiCompareFunc | cmp, | ||
gpointer | data | ||
) |
sorted_set1 | Sorted ring 1 |
sorted_set2 | Sorted ring 2 |
cmp | Compare function for node data |
data | Data argument passed into the cmp() function |
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))).
gpointer sfi_ring_max | ( | const SfiRing * | head, |
SfiCompareFunc | cmp, | ||
gpointer | data | ||
) |
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 |
Find and return the maximum data pointer of a ring, measured by evaluating cmp(). The complexity is O(length (head)).
SfiRing* sfi_ring_max_node | ( | const SfiRing * | head, |
SfiCompareFunc | cmp, | ||
gpointer | data | ||
) |
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 |
Find and return the node holding the maximum data pointer of a ring, measured by evaluating cmp(). The complexity is O(length (head)).
gpointer sfi_ring_min | ( | const SfiRing * | head, |
SfiCompareFunc | cmp, | ||
gpointer | data | ||
) |
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 |
Find and return the minimum data pointer of a ring, measured by evaluating cmp(). The complexity is O(length (head)).
SfiRing* sfi_ring_min_node | ( | const SfiRing * | head, |
SfiCompareFunc | cmp, | ||
gpointer | data | ||
) |
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 |
Find and return the node holding the minimum data pointer of a ring, measured by evaluating cmp(). The complexity is O(length (head)).
gboolean sfi_ring_mismatch | ( | SfiRing ** | sorted_ring1_p, |
SfiRing ** | sorted_ring2_p, | ||
SfiCompareFunc | cmp, | ||
gpointer | data | ||
) |
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 |
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))).
SfiRing* sfi_ring_reorder | ( | SfiRing * | unordered_ring, |
const SfiRing * | new_ring_order | ||
) |
unordered_ring | Unsorted ring |
new_ring_order | Ring with arbitrary order |
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)).
SfiRing* sfi_ring_split | ( | SfiRing * | head1, |
SfiRing * | head2 | ||
) |
head1 | a non-empty ring |
head2 | a ring node different from head1 contained in head1 |
returns | head2 for convenience |
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.
SfiRing* sfi_ring_symmetric_difference | ( | const SfiRing * | sorted_set1, |
const SfiRing * | sorted_set2, | ||
SfiCompareFunc | cmp, | ||
gpointer | data | ||
) |
sorted_set1 | Sorted ring 1 |
sorted_set2 | Sorted ring 2 |
cmp | Compare function for node data |
data | Data argument passed into the cmp() function |
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))).
SfiRing* sfi_ring_union | ( | const SfiRing * | sorted_set1, |
const SfiRing * | sorted_set2, | ||
SfiCompareFunc | cmp, | ||
gpointer | data | ||
) |
sorted_set1 | Sorted ring 1 |
sorted_set2 | Sorted ring 2 |
cmp | Compare function for node data |
data | Data argument passed into the cmp() function |
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))).