Ecore_Data (3) - Linux Manuals

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

NAME

Ecore_Data.h - Contains threading, list, hash, debugging and tree functions.

SYNOPSIS


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_first_remove (Ecore_List *list)
Remove the first item from the list.
EAPI void * ecore_list_last_remove (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_count (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_first_goto (Ecore_List *list)
Make the current item the first item in the list.
EAPI void * ecore_list_last_goto (Ecore_List *list)
Make the current item the last item in the list.
EAPI void * ecore_list_index_goto (Ecore_List *list, int index)
Make the current item the item with the given index number.
EAPI void * ecore_list_goto (Ecore_List *list, const 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 void ecore_list_merge (Ecore_List *list, Ecore_List *l2, Ecore_Compare_Cb, char order)
Merge the l2 into the list using the compare function compare.
EAPI int ecore_list_empty_is (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_free_cb_set (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_first_remove (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_last_remove (Ecore_DList *_e_dlist)
Removes the last item from the given doubly linked list.
EAPI void * ecore_dlist_first_goto (Ecore_DList *_e_dlist)
Move the current pointer to the first item in the list.
EAPI void * ecore_dlist_last_goto (Ecore_DList *_e_dlist)
Move the pointer to the current item to the last item.
EAPI void * ecore_dlist_index_goto (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 void ecore_dlist_merge (Ecore_DList *list, Ecore_DList *l2, Ecore_Compare_Cb, char order)
Merge the l2 into the list using the compare function compare.
EAPI int ecore_dlist_empty_is (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_free_cb_set (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_free_key_cb_set (Ecore_Hash *hash, Ecore_Free_Cb function)
Sets the function to destroy the keys of the given hash.
EAPI int ecore_hash_free_value_cb_set (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_hash_set (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 Ecore_Path_Group * ecore_path_group_new (void)
Creates a new path group.
EAPI void ecore_path_group_del (Ecore_Path_Group *group)
Destroys a previously created path group.
EAPI void ecore_path_group_add (Ecore_Path_Group *group, const char *path)
Adds a directory to be searched for files.
EAPI void ecore_path_group_remove (Ecore_Path_Group *group, const char *path)
Removes the given directory from the given group.
EAPI char * ecore_path_group_find (Ecore_Path_Group *group, const char *name)
Finds a file in a group of paths.
EAPI Ecore_List * ecore_path_group_available (Ecore_Path_Group *group)
Retrieves a list of all available files in the given path.
EAPI Ecore_Plugin * ecore_plugin_load (Ecore_Path_Group *group, const char *plugin, const char *version)
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_List * ecore_plugin_available_get (Ecore_Path_Group *group)
Retrieves a list of all available plugins in the given path.
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_free_cb_set (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_compare_set (Ecore_Sheap *heap, Ecore_Compare_Cb compare)
Change the comparison function for the heap.
EAPI void ecore_sheap_order_set (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_empty_is (Ecore_Tree *tree)
Test to see if the tree has any nodes.
EAPI void * ecore_tree_get (Ecore_Tree *tree, const void *key)
Return the value corresponding to key.
EAPI Ecore_Tree_Node * ecore_tree_get_node (Ecore_Tree *tree, const void *key)
Return the node corresponding to key.
EAPI void * ecore_tree_closest_larger_get (Ecore_Tree *tree, const void *key)
Find the closest value greater than or equal to the key.
EAPI void * ecore_tree_closest_smaller_get (Ecore_Tree *tree, const 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, const void *key)
Remove the key from the tree.
EAPI int ecore_tree_node_add (Ecore_Tree *tree, Ecore_Tree_Node *node)
Place a node in the tree.
EAPI int ecore_tree_node_remove (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

References ecore_direct_compare().

Referenced by ecore_con_url_destroy(), ecore_direct_compare(), ecore_sheap_compare_set(), ecore_sheap_init(), ecore_str_compare(), ecore_tree_init(), and ecore_x_netwm_init().

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.

References ecore_direct_hash().

Referenced by ecore_direct_hash(), and ecore_x_netwm_init().

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

References ecore_dlist_clear(), and ecore_list_clear().

Referenced by ecore_dlist_clear().

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

References ecore_dlist_current().

Referenced by ecore_dlist_current().

EAPI int ecore_dlist_empty_is (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.

References ecore_dlist_empty_is(), and ecore_list_empty_is().

Referenced by ecore_dlist_append_list(), ecore_dlist_empty_is(), ecore_dlist_merge(), and ecore_dlist_prepend_list().

EAPI void* ecore_dlist_first_goto (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.

References ecore_dlist_first_goto().

Referenced by ecore_dlist_first_goto().

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

References ecore_dlist_goto().

Referenced by ecore_dlist_goto().

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.

References ecore_dlist_index(), and ecore_list_index().

Referenced by ecore_dlist_index().

EAPI void* ecore_dlist_index_goto (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.

References ecore_dlist_index_goto().

Referenced by ecore_dlist_index_goto().

EAPI void* ecore_dlist_last_goto (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.

References ecore_dlist_last_goto().

Referenced by ecore_dlist_last_goto().

EAPI void ecore_dlist_merge (Ecore_DList * list, Ecore_DList * l2, Ecore_Compare_Cb compare, char order)

Merge the l2 into the list using the compare function compare.

Both lists need to be sorted else a corrupt list could be the result.

Parameters:

list The list.
l2 The second list, this list will be empty after the merge
compare The function to compare the data of list and l2
order The sort direction, possible values are ECORE_SORT_MIN and ECORE_SORT_MAX

References ecore_dlist_append_list(), ecore_dlist_empty_is(), ecore_dlist_init(), and ecore_dlist_merge().

Referenced by ecore_dlist_merge().

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, possible values are ECORE_SORT_MIN and ECORE_SORT_MAX

Returns:

true on success

Mergesort is a stable, in-place sorting algorithm

References ecore_dlist_mergesort().

Referenced by ecore_dlist_mergesort(), and ecore_dlist_sort().

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

References ecore_dlist_next().

Referenced by ecore_dlist_next().

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

References ecore_dlist_previous().

Referenced by ecore_dlist_previous().

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, possible values are ECORE_SORT_MIN and ECORE_SORT_MAX

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.

References ecore_dlist_mergesort(), and ecore_dlist_sort().

Referenced by ecore_dlist_sort().

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.

References ecore_hash_dump_graph().

Referenced by ecore_hash_dump_graph().

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.

References ecore_hash_dump_stats().

Referenced by ecore_hash_dump_stats().

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().

References ecore_list_clear(), and ecore_list_empty_is().

Referenced by ecore_dlist_clear(), and ecore_list_clear().

EAPI int ecore_list_count (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.

References ecore_list_count().

Referenced by ecore_list_count().

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.

References ecore_list_current().

Referenced by ecore_list_current(), and ecore_path_group_remove().

EAPI int ecore_list_empty_is (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

References ecore_list_empty_is().

Referenced by ecore_con_shutdown(), ecore_con_url_shutdown(), ecore_dlist_empty_is(), ecore_dlist_last_remove(), ecore_list_append_list(), ecore_list_clear(), ecore_list_empty_is(), ecore_list_merge(), ecore_list_prepend_list(), ecore_path_group_available(), ecore_plugin_available_get(), and ecore_plugin_unload().

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

References ecore_list_find().

Referenced by ecore_con_url_destroy(), and ecore_list_find().

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.

References ecore_list_first().

Referenced by ecore_con_url_shutdown(), and ecore_list_first().

EAPI int ecore_list_free_cb_set (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.

References ecore_list_free_cb_set().

Referenced by ecore_dlist_free_cb_set(), ecore_file_app_list(), ecore_file_ls(), ecore_list_free_cb_set(), ecore_path_group_add(), and ecore_plugin_available_get().

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, possible values are ECORE_SORT_MIN and ECORE_SORT_MAX

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

References ecore_list_heapsort(), ecore_sheap_destroy(), ecore_sheap_extract(), ecore_sheap_insert(), ecore_sheap_new(), and ecore_sheap_order_set().

Referenced by ecore_list_heapsort(), and ecore_list_sort().

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.

References ecore_list_index().

Referenced by ecore_dlist_index(), and ecore_list_index().

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.

References ecore_list_last().

Referenced by ecore_list_last().

EAPI void ecore_list_merge (Ecore_List * list, Ecore_List * l2, Ecore_Compare_Cb compare, char order)

Merge the l2 into the list using the compare function compare.

Both lists need to be sorted else a corrupt list could be the result.

Parameters:

list The list.
l2 The second list, this list will be empty after the merge
compare The function to compare the data of list and l2
order The sort direction, possible values are ECORE_SORT_MIN and ECORE_SORT_MAX

References ecore_list_append_list(), ecore_list_empty_is(), ecore_list_init(), and ecore_list_merge().

Referenced by ecore_list_merge().

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, possible values are ECORE_SORT_MIN and ECORE_SORT_MAX

Returns:

true on success

Mergesort is a stable, in-place sorting algorithm

References ecore_list_mergesort().

Referenced by ecore_list_mergesort(), and ecore_list_sort().

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.

References ecore_list_next().

Referenced by ecore_file_app_installed(), ecore_file_app_list(), ecore_file_path_dir_exists(), ecore_list_next(), ecore_path_group_available(), ecore_path_group_find(), ecore_path_group_remove(), and ecore_plugin_available_get().

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, possible values are ECORE_SORT_MIN and ECORE_SORT_MAX

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.

References ecore_list_heapsort(), ecore_list_mergesort(), and ecore_list_sort().

Referenced by ecore_file_ls(), and ecore_list_sort().

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.

References ecore_sheap_change().

Referenced by ecore_sheap_change().

EAPI int ecore_sheap_compare_set (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.

References ecore_direct_compare(), and ecore_sheap_compare_set().

Referenced by ecore_sheap_compare_set().

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

References ecore_sheap_destroy().

Referenced by ecore_list_heapsort(), and ecore_sheap_destroy().

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.

References ecore_sheap_extract().

Referenced by ecore_list_heapsort(), ecore_sheap_extract(), and ecore_sheap_sort().

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.

References ecore_sheap_extreme().

Referenced by ecore_sheap_extreme().

EAPI int ecore_sheap_free_cb_set (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.

References ecore_sheap_free_cb_set().

Referenced by ecore_sheap_free_cb_set().

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

References ecore_direct_compare(), and ecore_sheap_init().

Referenced by ecore_sheap_init(), and ecore_sheap_new().

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.

References ecore_sheap_insert().

Referenced by ecore_list_heapsort(), and ecore_sheap_insert().

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.

References ecore_sheap_init(), and ecore_sheap_new().

Referenced by ecore_list_heapsort(), and ecore_sheap_new().

EAPI void ecore_sheap_order_set (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.

References ecore_sheap_order_set().

Referenced by ecore_list_heapsort(), and ecore_sheap_order_set().

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.

References ecore_sheap_extract(), and ecore_sheap_sort().

Referenced by ecore_sheap_sort().

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

References ecore_direct_compare(), and ecore_str_compare().

Referenced by ecore_plugin_available_get(), ecore_str_compare(), and ecore_string_init().

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.

References ecore_str_hash().

Referenced by ecore_plugin_available_get(), ecore_str_hash(), and ecore_string_init().

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

References ecore_strbuf_append().

Referenced by ecore_strbuf_append(), and ecore_strbuf_insert().

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

References ecore_strbuf_append_char().

Referenced by ecore_strbuf_append_char().

EAPI void ecore_strbuf_free (Ecore_Strbuf * buf)

Free a string buffer.

Parameters:

buf the buffer to free

References ecore_strbuf_free().

Referenced by ecore_strbuf_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

References ecore_strbuf_append(), and ecore_strbuf_insert().

Referenced by ecore_strbuf_insert().

EAPI size_t ecore_strbuf_length_get (Ecore_Strbuf * buf)

Retrieve the length of the string buffer content.

Parameters:

buf the buffer

References ecore_strbuf_length_get().

Referenced by ecore_strbuf_length_get().

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

References ecore_strbuf_replace().

Referenced by ecore_strbuf_replace().

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

References ecore_strbuf_replace_all().

Referenced by ecore_strbuf_replace_all().

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.

References ecore_strbuf_string_get().

Referenced by ecore_strbuf_string_get().

EAPI int ecore_string_init (void)

Initialize the ecore string internal structure.

Returns:

Zero on failure, non-zero on successful initialization.

References ecore_hash_free_value_cb_set(), ecore_hash_new(), ecore_str_compare(), ecore_str_hash(), and ecore_string_init().

Referenced by ecore_string_init().

EAPI void* ecore_tree_closest_larger_get (Ecore_Tree * tree, const 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

References ecore_tree_closest_larger_get().

Referenced by ecore_tree_closest_larger_get().

EAPI void* ecore_tree_closest_smaller_get (Ecore_Tree * tree, const 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

References ecore_tree_closest_smaller_get().

Referenced by ecore_tree_closest_smaller_get().

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.

References ecore_tree_destroy(), and ecore_tree_node_remove().

Referenced by ecore_tree_destroy().

EAPI int ecore_tree_empty_is (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

References ecore_tree_empty_is().

Referenced by ecore_tree_empty_is().

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.

References ecore_tree_for_each_node().

Referenced by ecore_tree_for_each_node().

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.

References ecore_tree_for_each_node_value().

Referenced by ecore_tree_for_each_node_value().

EAPI void* ecore_tree_get (Ecore_Tree * tree, const 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.

References ecore_tree_get().

Referenced by ecore_tree_get().

EAPI Ecore_Tree_Node* ecore_tree_get_node (Ecore_Tree * tree, const 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.

References ecore_tree_get_node().

Referenced by ecore_tree_get_node().

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

References ecore_direct_compare(), and ecore_tree_init().

Referenced by ecore_tree_init(), and ecore_tree_new().

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

References ecore_tree_init(), and ecore_tree_new().

Referenced by ecore_tree_new().

EAPI int ecore_tree_node_add (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.

References ecore_tree_node_add().

Referenced by ecore_tree_node_add(), and ecore_tree_set().

EAPI int ecore_tree_node_remove (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.

References ecore_tree_node_remove().

Referenced by ecore_tree_destroy(), ecore_tree_node_remove(), and ecore_tree_remove().

EAPI int ecore_tree_remove (Ecore_Tree * tree, const 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.

References ecore_tree_node_remove(), and ecore_tree_remove().

Referenced by ecore_tree_remove().

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.

References ecore_tree_node_add(), and ecore_tree_set().

Referenced by ecore_tree_set().

Author

Generated automatically by Doxygen for Ecore from the source code.