Ecore_Data.h File Reference

Contains threading, list, hash, debugging and tree functions. More...


Functions

EAPI int ecore_direct_compare (const void *key1, const void *key2)
 Perform a direct comparison of two keys' values.
EAPI int ecore_str_compare (const void *key1, const void *key2)
 Perform a string comparison of two keys values.
EAPI unsigned int ecore_direct_hash (const void *key)
 Just casts the key to an unsigned int.
EAPI unsigned int ecore_str_hash (const void *key)
 Compute the hash value of a string.
EAPI Ecore_List * ecore_list_new (void)
 Create and initialize a new list.
EAPI int ecore_list_init (Ecore_List *list)
 Initialize a list to some sane starting values.
EAPI int ecore_list_append (Ecore_List *list, void *_data)
 Append data to the list.
EAPI int ecore_list_prepend (Ecore_List *list, void *_data)
 Prepend data to the beginning of the list.
EAPI int ecore_list_insert (Ecore_List *list, void *_data)
 Insert data in front of the current point in the list.
EAPI int ecore_list_append_list (Ecore_List *list, Ecore_List *append)
 Append a list to the list.
EAPI int ecore_list_prepend_list (Ecore_List *list, Ecore_List *prepend)
 Prepend a list to the beginning of the list.
EAPI int ecore_list_remove_destroy (Ecore_List *list)
 Remove and free the data in lists current position.
EAPI void * ecore_list_remove (Ecore_List *list)
 Remove the current item from the list.
EAPI void * ecore_list_remove_first (Ecore_List *list)
 Remove the first item from the list.
EAPI void * ecore_list_remove_last (Ecore_List *list)
 Remove the last item from the list.
EAPI void * ecore_list_current (Ecore_List *list)
 Retrieve the data pointed to by the current item in list.
EAPI void * ecore_list_first (Ecore_List *list)
 Retrieve the data pointed to by the first item in list.
EAPI void * ecore_list_last (Ecore_List *list)
 Retrieve the data pointed to by the last item in list.
EAPI int ecore_list_index (Ecore_List *list)
 Returns the number of the current node.
EAPI int ecore_list_nodes (Ecore_List *list)
 Find the number of nodes in the list.
EAPI int ecore_list_for_each (Ecore_List *list, Ecore_For_Each function, void *user_data)
 Execute function for each node in list.
EAPI void * ecore_list_goto_first (Ecore_List *list)
 Make the current item the first item in the list.
EAPI void * ecore_list_goto_last (Ecore_List *list)
 Make the current item the last item in the list.
EAPI void * ecore_list_goto_index (Ecore_List *list, int index)
 Make the current item the item with the given index number.
EAPI void * ecore_list_goto (Ecore_List *list, void *_data)
 Make the current item the node that contains data.
EAPI void * ecore_list_next (Ecore_List *list)
 Retrieve the data pointed to by the current item, and make the next item the current item.
EAPI void * ecore_list_find (Ecore_List *list, Ecore_Compare_Cb function, const void *user_data)
 Find data in list using the compare function func.
EAPI int ecore_list_sort (Ecore_List *list, Ecore_Compare_Cb compare, char order)
 Sort data in list using the compare function compare.
EAPI int ecore_list_mergesort (Ecore_List *list, Ecore_Compare_Cb compare, char order)
 Sort data in list using the compare function compare.
EAPI int ecore_list_heapsort (Ecore_List *list, Ecore_Compare_Cb compare, char order)
 Sort data in list using the compare function compare.
EAPI int ecore_list_is_empty (Ecore_List *list)
 Checks the list for any nodes.
EAPI int ecore_list_clear (Ecore_List *list)
 Remove all nodes from list.
EAPI void ecore_list_destroy (Ecore_List *list)
 Free a list and all of it's nodes.
EAPI Ecore_List_Node * ecore_list_node_new (void)
 Allocates and initializes a new list node.
EAPI int ecore_list_node_destroy (Ecore_List_Node *_e_node, Ecore_Free_Cb free_func)
 Calls the function to free the data and the node.
EAPI int ecore_list_set_free_cb (Ecore_List *list, Ecore_Free_Cb free_func)
 Set the function for freeing data.
EAPI Ecore_DList * ecore_dlist_new (void)
 Creates and initialises a new doubly linked list.
EAPI int ecore_dlist_init (Ecore_DList *list)
 Initialises a list to some sane starting values.
EAPI void ecore_dlist_destroy (Ecore_DList *list)
 Frees a doubly linked list and all of its nodes.
EAPI int ecore_dlist_append (Ecore_DList *_e_dlist, void *_data)
 Appends data to the given doubly linked list.
EAPI int ecore_dlist_prepend (Ecore_DList *_e_dlist, void *_data)
 Adds data to the very beginning of the given doubly linked list.
EAPI int ecore_dlist_insert (Ecore_DList *_e_dlist, void *_data)
 Inserts data at the current point in the given doubly linked list.
EAPI int ecore_dlist_append_list (Ecore_DList *_e_dlist, Ecore_DList *append)
 Appends a list to the given doubly linked list.
EAPI int ecore_dlist_prepend_list (Ecore_DList *_e_dlist, Ecore_DList *prepend)
 Adds a list to the very beginning of the given doubly linked list.
EAPI void * ecore_dlist_current (Ecore_DList *list)
 Return the data in the current list item.
EAPI int ecore_dlist_index (Ecore_DList *list)
 Retrieves the index of the current node of the given doubly linked list.
EAPI void * ecore_dlist_remove (Ecore_DList *_e_dlist)
 Removes the current item from the given doubly linked list.
EAPI void * ecore_dlist_remove_first (Ecore_DList *_e_dlist)
 Removes the first item from the given doubly linked list.
EAPI int ecore_dlist_remove_destroy (Ecore_DList *list)
 Removes and frees the data at the current position in the given doubly linked list.
EAPI void * ecore_dlist_remove_last (Ecore_DList *_e_dlist)
 Removes the last item from the given doubly linked list.
EAPI void * ecore_dlist_goto_first (Ecore_DList *_e_dlist)
 Move the current pointer to the first item in the list.
EAPI void * ecore_dlist_goto_last (Ecore_DList *_e_dlist)
 Move the pointer to the current item to the last item.
EAPI void * ecore_dlist_goto_index (Ecore_DList *_e_dlist, int index)
 Moves the current item to the index number in the given doubly linked list.
EAPI void * ecore_dlist_goto (Ecore_DList *_e_dlist, void *_data)
 Move the current item to the node that contains data.
EAPI void * ecore_dlist_next (Ecore_DList *list)
 Move to the next item in the list and return current item.
EAPI void * ecore_dlist_previous (Ecore_DList *list)
 Move to the previous item and return current item.
EAPI int ecore_dlist_sort (Ecore_DList *list, Ecore_Compare_Cb compare, char order)
 Sort data in list using the compare function compare.
EAPI int ecore_dlist_mergesort (Ecore_DList *list, Ecore_Compare_Cb compare, char order)
 Sort data in list using the compare function compare.
EAPI int ecore_dlist_is_empty (Ecore_DList *_e_dlist)
 Returns whether there is anything in the given doubly linked list.
EAPI int ecore_dlist_clear (Ecore_DList *_e_dlist)
 Remove all nodes from the list.
EAPI int ecore_dlist_set_free_cb (Ecore_DList *dlist, Ecore_Free_Cb free_func)
 Sets the function used for freeing data stored in a doubly linked list.
EAPI Ecore_Hash * ecore_hash_new (Ecore_Hash_Cb hash_func, Ecore_Compare_Cb compare)
 Creates and initializes a new hash.
EAPI int ecore_hash_init (Ecore_Hash *hash, Ecore_Hash_Cb hash_func, Ecore_Compare_Cb compare)
 Initializes the given hash.
EAPI int ecore_hash_set_free_key (Ecore_Hash *hash, Ecore_Free_Cb function)
 Sets the function to destroy the keys of the given hash.
EAPI int ecore_hash_set_free_value (Ecore_Hash *hash, Ecore_Free_Cb function)
 Sets the function to destroy the values in the given hash.
EAPI void ecore_hash_destroy (Ecore_Hash *hash)
 Frees the hash table and the data contained inside it.
EAPI int ecore_hash_count (Ecore_Hash *hash)
 Counts the number of nodes in a hash table.
EAPI int ecore_hash_for_each_node (Ecore_Hash *hash, Ecore_For_Each for_each_func, void *user_data)
 Runs the for_each_func function on each entry in the given hash.
EAPI Ecore_List * ecore_hash_keys (Ecore_Hash *hash)
 Retrieves an ecore_list of all keys in the given hash.
EAPI void * ecore_hash_get (Ecore_Hash *hash, const void *key)
 Retrieves the value associated with the given key from the given hash table.
EAPI int ecore_hash_set (Ecore_Hash *hash, void *key, void *value)
 Sets a key-value pair in the given hash table.
EAPI int ecore_hash_set_hash (Ecore_Hash *hash, Ecore_Hash *set)
 Sets all key-value pairs from set in the given hash table.
EAPI void * ecore_hash_remove (Ecore_Hash *hash, const void *key)
 Removes the value associated with the given key in the given hash table.
EAPI void * ecore_hash_find (Ecore_Hash *hash, Ecore_Compare_Cb compare, const void *value)
 Retrieves the first value that matches table.
EAPI void ecore_hash_dump_graph (Ecore_Hash *hash)
 Prints the distribution of the given hash table for graphing.
EAPI void ecore_hash_dump_stats (Ecore_Hash *hash)
 Prints the distribution of the given hash table for graphing.
EAPI int ecore_path_group_new (char *group_name)
 Creates a new path group.
EAPI void ecore_path_group_del (int group_id)
 Destroys a previously created path group.
EAPI void ecore_path_group_add (int group_id, char *path)
 Adds a directory to be searched for files.
EAPI void ecore_path_group_remove (int group_id, char *path)
 Removes the given directory from the given group.
EAPI char * ecore_path_group_find (int group_id, char *name)
 Finds a file in a group of paths.
EAPI Ecore_List * ecore_path_group_available (int group_id)
 Retrieves a list of all available files in the given path.
EAPI Ecore_Plugin * ecore_plugin_load (int group_id, const char *plugin)
 Loads the specified plugin from the specified path group.
EAPI void ecore_plugin_unload (Ecore_Plugin *plugin)
 Unloads the given plugin from memory.
EAPI Ecore_Sheap * ecore_sheap_new (Ecore_Compare_Cb compare, int size)
 Allocate and initialize a new binary heap.
EAPI void ecore_sheap_destroy (Ecore_Sheap *heap)
 Free up the memory used by the heap.
EAPI int ecore_sheap_init (Ecore_Sheap *heap, Ecore_Compare_Cb compare, int size)
 Initialize a binary heap to default values.
EAPI int ecore_sheap_set_free_cb (Ecore_Sheap *heap, Ecore_Free_Cb free_func)
 Set the function for freeing data.
EAPI int ecore_sheap_insert (Ecore_Sheap *heap, void *data)
 Insert new data into the heap.
EAPI void * ecore_sheap_extract (Ecore_Sheap *heap)
 Extract the item at the top of the heap.
EAPI void * ecore_sheap_extreme (Ecore_Sheap *heap)
 Examine the item at the top of the heap.
EAPI int ecore_sheap_change (Ecore_Sheap *heap, void *item, void *newval)
 Change the value of the specified item in the heap.
EAPI int ecore_sheap_set_compare (Ecore_Sheap *heap, Ecore_Compare_Cb compare)
 Change the comparison function for the heap.
EAPI void ecore_sheap_set_order (Ecore_Sheap *heap, char order)
 Change the order of the heap.
EAPI void ecore_sheap_sort (Ecore_Sheap *heap)
 Sort the data in the heap.
EAPI int ecore_string_init (void)
 Initialize the ecore string internal structure.
EAPI void ecore_string_shutdown (void)
 Shutdown the ecore string internal structures.
EAPI const char * ecore_string_instance (const char *string)
 Retrieves an instance of a string for use in an ecore program.
EAPI void ecore_string_release (const char *string)
 Notes that the given string has lost an instance.
EAPI Ecore_Tree * ecore_tree_new (Ecore_Compare_Cb compare_func)
 Allocate a new tree structure.
EAPI int ecore_tree_init (Ecore_Tree *tree, Ecore_Compare_Cb compare_func)
 Initialize a tree structure to some sane initial values.
EAPI int ecore_tree_destroy (Ecore_Tree *tree)
 Free the tree and it's stored data.
EAPI int ecore_tree_is_empty (Ecore_Tree *tree)
 Test to see if the tree has any nodes.
EAPI void * ecore_tree_get (Ecore_Tree *tree, void *key)
 Return the value corresponding to key.
EAPI Ecore_Tree_Node * ecore_tree_get_node (Ecore_Tree *tree, void *key)
 Return the node corresponding to key.
EAPI void * ecore_tree_get_closest_larger (Ecore_Tree *tree, void *key)
 Find the closest value greater than or equal to the key.
EAPI void * ecore_tree_get_closest_smaller (Ecore_Tree *tree, void *key)
 Find the closest value <= key.
EAPI int ecore_tree_set (Ecore_Tree *tree, void *key, void *value)
 Set the value associated with key to value.
EAPI int ecore_tree_remove (Ecore_Tree *tree, void *key)
 Remove the key from the tree.
EAPI int ecore_tree_add_node (Ecore_Tree *tree, Ecore_Tree_Node *node)
 Place a node in the tree.
EAPI int ecore_tree_remove_node (Ecore_Tree *tree, Ecore_Tree_Node *node)
 Remove the node from the tree.
EAPI int ecore_tree_for_each_node (Ecore_Tree *tree, Ecore_For_Each for_each_func, void *user_data)
 Execute the function for each node in the tree.
EAPI int ecore_tree_for_each_node_value (Ecore_Tree *tree, Ecore_For_Each for_each_func, void *user_data)
 Execute function for each value in the tree.
EAPI Ecore_Strbuf * ecore_strbuf_new (void)
 Create a new string buffer.
EAPI void ecore_strbuf_free (Ecore_Strbuf *buf)
 Free a string buffer.
EAPI void ecore_strbuf_append (Ecore_Strbuf *buf, const char *str)
 Append a string to a buffer, reallocating as necessary.
EAPI void ecore_strbuf_append_char (Ecore_Strbuf *buf, char c)
 Append a character to a string buffer, reallocating as necessary.
EAPI void ecore_strbuf_insert (Ecore_Strbuf *buf, const char *str, size_t pos)
 Insert a string to a buffer, reallocating as necessary.
EAPI const char * ecore_strbuf_string_get (Ecore_Strbuf *buf)
 Retrieve a pointer to the contents of a string buffer.
EAPI size_t ecore_strbuf_length_get (Ecore_Strbuf *buf)
 Retrieve the length of the string buffer content.
EAPI int ecore_strbuf_replace (Ecore_Strbuf *buf, const char *str, const char *with, unsigned int n)
 Replace the n-th string with an other string.
EAPI int ecore_strbuf_replace_all (Ecore_Strbuf *buf, const char *str, const char *with)
 Replace all strings with an other string.


Detailed Description

Contains threading, list, hash, debugging and tree functions.


Function Documentation

EAPI int ecore_direct_compare ( const void *  key1,
const void *  key2 
)

Perform a direct comparison of two keys' values.

Parameters:
key1 The first key to compare
key2 The second key to compare
Returns:
A strcmp style value to indicate the larger key

EAPI unsigned int ecore_direct_hash ( const void *  key  ) 

Just casts the key to an unsigned int.

Parameters:
key The key to return compute a hash value
Returns:
The key cast to an unsigned int.

EAPI int ecore_dlist_clear ( Ecore_DList *  list  ) 

Remove all nodes from the list.

Parameters:
list,: the list to remove all nodes from
Returns:
Returns TRUE on success, FALSE on errors

EAPI void* ecore_dlist_current ( Ecore_DList *  list  ) 

Return the data in the current list item.

Parameters:
list,: the list to the return the current data
Returns:
Returns value of the current data item, NULL if no current item

EAPI void* ecore_dlist_goto ( Ecore_DList *  list,
void *  data 
)

Move the current item to the node that contains data.

Parameters:
list,: the list to move the current item in
data,: the data to find and set the current item to
Returns:
Returns specified data on success, NULL on error

EAPI void* ecore_dlist_goto_first ( Ecore_DList *  list  ) 

Move the current pointer to the first item in the list.

Parameters:
list,: the list to change the current to the first item
Returns:
Returns a pointer to the first item on success, NULL on failure.

EAPI void* ecore_dlist_goto_index ( Ecore_DList *  list,
int  index 
)

Moves the current item to the index number in the given doubly linked list.

Parameters:
list The given doubly linked list.
index The position to move the current item
Returns:
The node at specified index on success, NULL on error.

EAPI void* ecore_dlist_goto_last ( Ecore_DList *  list  ) 

Move the pointer to the current item to the last item.

Parameters:
list,: the list to move the current item pointer to the last
Returns:
Returns a pointer to the last item in the list , NULL if empty.

EAPI int ecore_dlist_index ( Ecore_DList *  list  )  [inline]

Retrieves the index of the current node of the given doubly linked list.

Parameters:
list The given doubly linked list.
Returns:
The index of the current node.

EAPI int ecore_dlist_is_empty ( Ecore_DList *  list  ) 

Returns whether there is anything in the given doubly linked list.

Parameters:
list The given doubly linked list.
Returns:
TRUE if there are nodes, FALSE otherwise.

EAPI int ecore_dlist_mergesort ( Ecore_DList *  list,
Ecore_Compare_Cb  compare,
char  order 
)

Sort data in list using the compare function compare.

Parameters:
list The list.
compare The function to compare the data of list
order The sort direction
Returns:
true on success
Mergesort is a stable, in-place sorting algorithm

EAPI void* ecore_dlist_next ( Ecore_DList *  list  ) 

Move to the next item in the list and return current item.

Parameters:
list,: the list to move to the next item in.
Returns:
Returns data in the current list node, or NULL on error

EAPI void* ecore_dlist_previous ( Ecore_DList *  list  ) 

Move to the previous item and return current item.

Parameters:
list,: the list to move to the previous item in.
Returns:
Returns data in the current list node, or NULL on error

EAPI int ecore_dlist_sort ( Ecore_List *  list,
Ecore_Compare_Cb  compare,
char  order 
)

Sort data in list using the compare function compare.

Parameters:
list The list.
compare The function to compare the data of list
order The sort direction
Returns:
true on success
This is a wrapper function for mergesort and heapsort. It tries to choose the fastest algorithm depending on the number of notes. Note: The sort may be unstable.

EAPI void ecore_hash_dump_graph ( Ecore_Hash *  hash  ) 

Prints the distribution of the given hash table for graphing.

Parameters:
hash The given hash table.

EAPI void ecore_hash_dump_stats ( Ecore_Hash *  hash  ) 

Prints the distribution of the given hash table for graphing.

Parameters:
hash The given hash table.

EAPI int ecore_list_clear ( Ecore_List *  list  ) 

Remove all nodes from list.

Parameters:
list The list.
Returns:
Returns TRUE on success, FALSE on error.
Note:
The data for each item on the list is not freed by ecore_list_clear().

EAPI void* ecore_list_current ( Ecore_List *  list  )  [inline]

Retrieve the data pointed to by the current item in list.

Parameters:
list The list.
Returns:
Returns the data at current position, can be NULL.

EAPI void* ecore_list_find ( Ecore_List *  list,
Ecore_Compare_Cb  function,
const void *  user_data 
)

Find data in list using the compare function func.

Parameters:
list The list.
function The function to test each node of list with
user_data Data to match against (used by function)
Returns:
the first matching data node, or NULL if none match

EAPI void* ecore_list_first ( Ecore_List *  list  )  [inline]

Retrieve the data pointed to by the first item in list.

Parameters:
list The list.
Returns:
Returns the data at current position, can be NULL.

EAPI int ecore_list_heapsort ( Ecore_List *  list,
Ecore_Compare_Cb  compare,
char  order 
)

Sort data in list using the compare function compare.

Parameters:
list The list.
compare The function to compare the data of list
order The sort direction
Returns:
true on success
Heapsort is a unstable sorting algorithm, it needs to allocate extra memomry, but there for it is for a great number of nodes faster than mergesort

EAPI int ecore_list_index ( Ecore_List *  list  ) 

Returns the number of the current node.

Parameters:
list The list to return the number of the current node.
Returns:
The number of the current node in the list.

EAPI int ecore_list_is_empty ( Ecore_List *  list  ) 

Checks the list for any nodes.

Parameters:
list The list to check for nodes
Returns:
TRUE if no nodes in list, FALSE if the list contains nodes

EAPI void* ecore_list_last ( Ecore_List *  list  )  [inline]

Retrieve the data pointed to by the last item in list.

Parameters:
list The list.
Returns:
Returns the data at current position, can be NULL.

EAPI int ecore_list_mergesort ( Ecore_List *  list,
Ecore_Compare_Cb  compare,
char  order 
)

Sort data in list using the compare function compare.

Parameters:
list The list.
compare The function to compare the data of list
order The sort direction
Returns:
true on success
Mergesort is a stable, in-place sorting algorithm

EAPI void* ecore_list_next ( Ecore_List *  list  )  [inline]

Retrieve the data pointed to by the current item, and make the next item the current item.

Parameters:
list The list to retrieve data from.
Returns:
The current item in the list on success, NULL on failure.

EAPI int ecore_list_nodes ( Ecore_List *  list  ) 

Find the number of nodes in the list.

Parameters:
list The list to find the number of nodes
Returns:
The number of nodes in the list.

EAPI int ecore_list_set_free_cb ( Ecore_List *  list,
Ecore_Free_Cb  free_func 
)

Set the function for freeing data.

Parameters:
list The list that will use this function when nodes are destroyed.
free_func The function that will free the key data.
Returns:
TRUE on successful set, FALSE otherwise.

EAPI int ecore_list_sort ( Ecore_List *  list,
Ecore_Compare_Cb  compare,
char  order 
)

Sort data in list using the compare function compare.

Parameters:
list The list.
compare The function to compare the data of list
order The sort direction
Returns:
true on success
This is a wrapper function for mergesort and heapsort. It tries to choose the fastest algorithm depending on the number of notes. Note: The sort may be unstable.

EAPI int ecore_sheap_change ( Ecore_Sheap *  heap,
void *  item,
void *  newval 
)

Change the value of the specified item in the heap.

Parameters:
heap The heap to search for the item to change
item The item in the heap to change
newval The new value assigned to the item in the heap
Returns:
TRUE on success, FALSE on failure.
Note:
The heap does not free the old data since it must be passed in, so the caller can perform the free if desired.

EAPI void ecore_sheap_destroy ( Ecore_Sheap *  heap  ) 

Free up the memory used by the heap.

Frees the memory used by heap, calls the destroy function on each data item if necessary.

Parameters:
heap The heap to be freed

EAPI void* ecore_sheap_extract ( Ecore_Sheap *  heap  ) 

Extract the item at the top of the heap.

Parameters:
heap The heap to remove the top item
Returns:
The top item of the heap on success, NULL on failure.
Note:
The extract function maintains the heap properties after the extract.

EAPI void* ecore_sheap_extreme ( Ecore_Sheap *  heap  ) 

Examine the item at the top of the heap.

Parameters:
heap The heap to examine the top item
Returns:
The top item of the heap on success, NULL on failure.
Note:
The function does not alter the heap.

EAPI int ecore_sheap_init ( Ecore_Sheap *  heap,
Ecore_Compare_Cb  compare,
int  size 
)

Initialize a binary heap to default values.

Parameters:
heap The heap to initialize
compare The function for comparing keys, NULL for direct comparison
size The number of elements to allow in the heap
Returns:
TRUE on success, FALSE on failure

EAPI int ecore_sheap_insert ( Ecore_Sheap *  heap,
void *  data 
)

Insert new data into the heap.

Parameters:
heap The heap to insert data.
data The data to add to heap.
Returns:
TRUE on success, NULL on failure. Increases the size of the heap if it becomes larger than available space.

EAPI Ecore_Sheap* ecore_sheap_new ( Ecore_Compare_Cb  compare,
int  size 
)

Allocate and initialize a new binary heap.

Parameters:
compare The function for comparing keys, NULL for direct comparison
size The number of elements to allow in the heap
Returns:
A pointer to the newly allocated binary heap on success, NULL on failure.

EAPI int ecore_sheap_set_compare ( Ecore_Sheap *  heap,
Ecore_Compare_Cb  compare 
)

Change the comparison function for the heap.

Parameters:
heap The heap to change comparison function
compare The new function for comparing nodes
Returns:
TRUE on success, FALSE on failure.
The comparison function is changed to and the heap is heapified by the new comparison.

EAPI int ecore_sheap_set_free_cb ( Ecore_Sheap *  heap,
Ecore_Free_Cb  free_func 
)

Set the function for freeing data.

Parameters:
heap The heap that will use this function when nodes are destroyed.
free_func The function that will free the key data.
Returns:
TRUE on successful set, FALSE otherwise.

EAPI void ecore_sheap_set_order ( Ecore_Sheap *  heap,
char  order 
)

Change the order of the heap.

Parameters:
heap The heap to change the order
order The new order of the heap
Changes the heap order of and re-heapifies the data to this new order. The default order is a min heap.

EAPI void ecore_sheap_sort ( Ecore_Sheap *  heap  ) 

Sort the data in the heap.

Parameters:
heap The heap to be sorted
Sorts the data in the heap into the order that is used for the heap's data.

EAPI int ecore_str_compare ( const void *  key1,
const void *  key2 
)

Perform a string comparison of two keys values.

Parameters:
key1 The first key to compare
key2 The second key to compare
Returns:
A strcmp style value to indicate the larger key

EAPI unsigned int ecore_str_hash ( const void *  key  ) 

Compute the hash value of a string.

Parameters:
key A pointer to the string to compute a hash value
Returns:
A computed hash value for key.

EAPI void ecore_strbuf_append ( Ecore_Strbuf *  buf,
const char *  str 
)

Append a string to a buffer, reallocating as necessary.

Parameters:
buf the Ecore_Strbuf to append to
str the string to append

EAPI void ecore_strbuf_append_char ( Ecore_Strbuf *  buf,
char  c 
)

Append a character to a string buffer, reallocating as necessary.

Parameters:
buf the Ecore_Strbuf to append to
c the char to append

EAPI void ecore_strbuf_free ( Ecore_Strbuf *  buf  ) 

Free a string buffer.

Parameters:
buf the buffer to free

EAPI void ecore_strbuf_insert ( Ecore_Strbuf *  buf,
const char *  str,
size_t  pos 
)

Insert a string to a buffer, reallocating as necessary.

Parameters:
buf the Ecore_Strbuf to insert
str the string to insert
pos the position to insert the string

EAPI size_t ecore_strbuf_length_get ( Ecore_Strbuf *  buf  ) 

Retrieve the length of the string buffer content.

Parameters:
buf the buffer

EAPI int ecore_strbuf_replace ( Ecore_Strbuf *  buf,
const char *  str,
const char *  with,
unsigned int  n 
)

Replace the n-th string with an other string.

Parameters:
buf the Ecore_Strbuf to work with
str the string to replace
with the replaceing string
n the number of the fitting string
Returns:
true on success

EAPI int ecore_strbuf_replace_all ( Ecore_Strbuf *  buf,
const char *  str,
const char *  with 
)

Replace all strings with an other string.

Parameters:
buf the Ecore_Strbuf to work with
str the string to replace
with the replaceing string
Returns:
how often the string was replaced

EAPI const char* ecore_strbuf_string_get ( Ecore_Strbuf *  buf  ) 

Retrieve a pointer to the contents of a string buffer.

Parameters:
buf the buffer
This pointer must not be modified, and will no longer be valid if the Ecore_Strbuf is modified.

EAPI int ecore_string_init ( void   ) 

Initialize the ecore string internal structure.

Returns:
Zero on failure, non-zero on successful initialization.

EAPI int ecore_tree_add_node ( Ecore_Tree *  tree,
Ecore_Tree_Node *  node 
)

Place a node in the tree.

Parameters:
tree The tree to add node.
node The node to add to tree.
Returns:
TRUE on a successful add, FALSE otherwise.

EAPI int ecore_tree_destroy ( Ecore_Tree *  tree  ) 

Free the tree and it's stored data.

Parameters:
tree,: the tree to destroy
Returns:
Returns TRUE if tree destroyed successfully, FALSE if not.

EAPI int ecore_tree_for_each_node ( Ecore_Tree *  tree,
Ecore_For_Each  for_each_func,
void *  user_data 
)

Execute the function for each node in the tree.

Parameters:
tree,: the tree to traverse
for_each_func,: the function to execute for each node
user_data,: data passed to each for_each_func call
Returns:
Returns TRUE on success, FALSE on failure.

EAPI int ecore_tree_for_each_node_value ( Ecore_Tree *  tree,
Ecore_For_Each  for_each_func,
void *  user_data 
)

Execute function for each value in the tree.

Parameters:
tree,: the tree to traverse
for_each_func,: the function to execute for each value in the tree
user_data,: data passed to each for_each_func call
Returns:
Returns TRUE on success, FALSE on failure.

EAPI void* ecore_tree_get ( Ecore_Tree *  tree,
void *  key 
)

Return the value corresponding to key.

Parameters:
tree,: the tree to search
key,: the key to search for in tree
Returns:
Returns the value corresponding to the key if found, otherwise NULL.

EAPI void* ecore_tree_get_closest_larger ( Ecore_Tree *  tree,
void *  key 
)

Find the closest value greater than or equal to the key.

Parameters:
tree The tree to search.
key The key to search for in tree.
Returns:
NULL if no valid nodes, otherwise the node greater than or equal to the key

EAPI void* ecore_tree_get_closest_smaller ( Ecore_Tree *  tree,
void *  key 
)

Find the closest value <= key.

Parameters:
tree the tree to search
key the key to search for in tree
Returns:
Returns NULL if no valid nodes, otherwise the node <= key

EAPI Ecore_Tree_Node* ecore_tree_get_node ( Ecore_Tree *  tree,
void *  key 
)

Return the node corresponding to key.

Parameters:
tree,: the tree to search
key,: the key to search for in the tree
Returns:
Returns the node corresponding to the key if found, otherwise NULL.

EAPI int ecore_tree_init ( Ecore_Tree *  new_tree,
Ecore_Compare_Cb  compare_func 
)

Initialize a tree structure to some sane initial values.

Parameters:
new_tree,: the new tree structure to be initialized
compare_func,: the function used to compare node keys
Returns:
Returns TRUE on successful initialization, FALSE on an error

EAPI int ecore_tree_is_empty ( Ecore_Tree *  tree  ) 

Test to see if the tree has any nodes.

Parameters:
tree,: the tree to check for nodes
Returns:
Returns TRUE if no nodes exist, FALSE otherwise

EAPI Ecore_Tree* ecore_tree_new ( Ecore_Compare_Cb  compare_func  ) 

Allocate a new tree structure.

Parameters:
compare_func,: function used to compare the two values
Returns:
Returns NULL if the operation fails, otherwise the new tree

EAPI int ecore_tree_remove ( Ecore_Tree *  tree,
void *  key 
)

Remove the key from the tree.

Parameters:
tree The tree to remove key.
key The key to remove from tree.
Returns:
TRUE on a successful remove, FALSE otherwise.

EAPI int ecore_tree_remove_node ( Ecore_Tree *  tree,
Ecore_Tree_Node *  node 
)

Remove the node from the tree.

Parameters:
tree The tree to remove node from.
node The node to remove from tree.
Returns:
TRUE on a successful remove, FALSE otherwise.

EAPI int ecore_tree_set ( Ecore_Tree *  tree,
void *  key,
void *  value 
)

Set the value associated with key to value.

Parameters:
tree The tree that contains the key/value pair.
key The key to identify which node to set a value.
value Value to set the found node.
Returns:
TRUE if successful, FALSE if not.