/* FIXME: gerer la priorite */
- if (!CreateProcess(NULL, exe->cmd, NULL, NULL, TRUE,
+ if (!CreateProcess(NULL, exe->cmd, NULL, NULL, EINA_TRUE,
run_pri | CREATE_SUSPENDED, NULL, NULL, &si, &pi))
goto free_exe_cmd;
exe->data = (void *)data;
if (!(exe->process2 = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_SUSPEND_RESUME | PROCESS_TERMINATE | SYNCHRONIZE,
- FALSE, pi.dwProcessId)))
+ EINA_FALSE, pi.dwProcessId)))
goto close_thread;
if (ResumeThread(exe->thread) == ((DWORD)-1))
HANDLE child_pipe_x;
sa.nLength = sizeof(SECURITY_ATTRIBUTES);
- sa.bInheritHandle = TRUE;
+ sa.bInheritHandle = EINA_TRUE;
sa.lpSecurityDescriptor = NULL;
if (!CreatePipe(&child_pipe, &child_pipe_x, &sa, 0))
0, NULL))
{
printf ("remote thread\n");
- return FALSE;
+ return EINA_FALSE;
}
if ((exe->sig == ECORE_EXE_WIN32_SIGINT) ||
(exe->sig == ECORE_EXE_WIN32_SIGQUIT))
{
printf ("int or quit\n");
- return FALSE;
+ return EINA_FALSE;
}
/* WM_CLOSE message */
if (WaitForSingleObject(exe->process, ECORE_EXE_WIN32_TIMEOUT) == WAIT_OBJECT_0)
{
printf ("CLOSE\n");
- return FALSE;
+ return EINA_FALSE;
}
/* WM_QUIT message */
if (WaitForSingleObject(exe->process, ECORE_EXE_WIN32_TIMEOUT) == WAIT_OBJECT_0)
{
printf ("QUIT\n");
- return FALSE;
+ return EINA_FALSE;
}
/* Exit process */
0, NULL))
{
printf ("remote thread 2\n");
- return FALSE;
+ return EINA_FALSE;
}
if (exe->sig == ECORE_EXE_WIN32_SIGTERM)
{
printf ("term\n");
- return FALSE;
+ return EINA_FALSE;
}
TerminateProcess(exe->process, 0);
- return FALSE;
+ return EINA_FALSE;
}
- return TRUE;
+ return EINA_TRUE;
}
static void
* @param p The Ecore_Pipe object.
* @param buffer The data to write into the pipe.
* @param nbytes The size of the @p buffer in bytes
- * @return Returns TRUE on a successful write, FALSE on an error
+ * @return Returns EINA_TRUE on a successful write, EINA_FALSE on an error
* @ingroup Ecore_Pipe_Group
*/
EAPI int
if (!ECORE_MAGIC_CHECK(p, ECORE_MAGIC_PIPE))
{
ECORE_MAGIC_FAIL(p, ECORE_MAGIC_PIPE, "ecore_pipe_write");
- return FALSE;
+ return EINA_FALSE;
}
- if (p->fd_write == PIPE_FD_INVALID) return FALSE;
+ if (p->fd_write == PIPE_FD_INVALID) return EINA_FALSE;
/* First write the len into the pipe */
do
/* XXX What should we do here? */
ERR("The length of the data was not written complete"
" to the pipe");
- return FALSE;
+ return EINA_FALSE;
}
else if (ret == PIPE_FD_ERROR && errno == EPIPE)
{
pipe_close(p->fd_write);
p->fd_write = PIPE_FD_INVALID;
- return FALSE;
+ return EINA_FALSE;
}
else if (ret == PIPE_FD_ERROR && errno == EINTR)
/* try it again */
}
while (retry--);
- if (retry != ECORE_PIPE_WRITE_RETRY) return FALSE;
+ if (retry != ECORE_PIPE_WRITE_RETRY) return EINA_FALSE;
/* and now pass the data to the pipe */
do
nbytes - already_written);
if (ret == (ssize_t)(nbytes - already_written))
- return TRUE;
+ return EINA_TRUE;
else if (ret >= 0)
{
already_written -= ret;
{
pipe_close(p->fd_write);
p->fd_write = PIPE_FD_INVALID;
- return FALSE;
+ return EINA_FALSE;
}
else if (ret == PIPE_FD_ERROR && errno == EINTR)
/* try it again */
}
while (retry--);
- return FALSE;
+ return EINA_FALSE;
}
/* Private function */
curl_easy_setopt(url_con->curl_easy, CURLOPT_PROGRESSFUNCTION,
_ecore_con_url_progress_cb);
curl_easy_setopt(url_con->curl_easy, CURLOPT_PROGRESSDATA, url_con);
- curl_easy_setopt(url_con->curl_easy, CURLOPT_NOPROGRESS, FALSE);
+ curl_easy_setopt(url_con->curl_easy, CURLOPT_NOPROGRESS, EINA_FALSE);
curl_easy_setopt(url_con->curl_easy, CURLOPT_HEADERFUNCTION, _ecore_con_url_header_cb);
curl_easy_setopt(url_con->curl_easy, CURLOPT_HEADERDATA, url_con);
if (url_con->active) return;
if (!url_con->url) return;
- if (verbose == TRUE)
+ if (verbose == EINA_TRUE)
curl_easy_setopt(url_con->curl_easy, CURLOPT_VERBOSE, 1);
else
curl_easy_setopt(url_con->curl_easy, CURLOPT_VERBOSE, 0);
if (url_con->active) return;
if (!url_con->url) return;
- if (use_epsv == TRUE)
+ if (use_epsv == EINA_TRUE)
curl_easy_setopt(url_con->curl_easy, CURLOPT_FTP_USE_EPSV, 1);
else
curl_easy_setopt(url_con->curl_easy, CURLOPT_FTP_USE_EPSV, 0);
#define ECORE_HASH_INCREASE(hash) ((hash && ecore_prime_table[hash->size] < PRIME_MAX) ? \
(hash->nodes / ecore_prime_table[hash->size]) > \
- ECORE_HASH_CHAIN_MAX : FALSE)
+ ECORE_HASH_CHAIN_MAX : EINA_FALSE)
#define ECORE_HASH_REDUCE(hash) ((hash && ecore_prime_table[hash->size] > PRIME_MIN) ? \
(double)hash->nodes / (double)ecore_prime_table[hash->size-1] \
- < ((double)ECORE_HASH_CHAIN_MAX * 0.375) : FALSE)
+ < ((double)ECORE_HASH_CHAIN_MAX * 0.375) : EINA_FALSE)
/* Private hash manipulation functions */
static int _ecore_hash_node_add(Ecore_Hash *hash, Ecore_Hash_Node *node);
* @param hash The given hash.
* @param hash_func The function used for hashing node keys.
* @param compare The function used for comparing node keys.
- * @return @c TRUE on success, @c FALSE on an error.
+ * @return @c EINA_TRUE on success, @c EINA_FALSE on an error.
* @ingroup Ecore_Data_Hash_ADT_Creation_Group
*/
EAPI int
ecore_hash_init(Ecore_Hash *hash, Ecore_Hash_Cb hash_func, Ecore_Compare_Cb compare)
{
- CHECK_PARAM_POINTER_RETURN("hash", hash, FALSE);
+ CHECK_PARAM_POINTER_RETURN("hash", hash, EINA_FALSE);
memset(hash, 0, sizeof(Ecore_Hash));
hash->buckets = (Ecore_Hash_Node **)calloc(ecore_prime_table[0],
sizeof(Ecore_Hash_Node *));
- return TRUE;
+ return EINA_TRUE;
}
/**
* @param hash The given hash.
* @param function The function used to free the node keys. NULL is a
* valid value and means that no function will be called.
- * @return @c TRUE on success, @c FALSE on error.
+ * @return @c EINA_TRUE on success, @c EINA_FALSE on error.
* @ingroup Ecore_Data_Hash_ADT_Destruction_Group
*/
EAPI int
ecore_hash_free_key_cb_set(Ecore_Hash *hash, Ecore_Free_Cb function)
{
- CHECK_PARAM_POINTER_RETURN("hash", hash, FALSE);
+ CHECK_PARAM_POINTER_RETURN("hash", hash, EINA_FALSE);
hash->free_key = function;
- return TRUE;
+ return EINA_TRUE;
}
/**
* @param hash The given hash.
* @param function The function that will free the node values. NULL is a
* valid value and means that no function will be called.
- * @return @c TRUE on success, @c FALSE on error
+ * @return @c EINA_TRUE on success, @c EINA_FALSE on error
* @ingroup Ecore_Data_Hash_ADT_Destruction_Group
*/
EAPI int
ecore_hash_free_value_cb_set(Ecore_Hash *hash, Ecore_Free_Cb function)
{
- CHECK_PARAM_POINTER_RETURN("hash", hash, FALSE);
+ CHECK_PARAM_POINTER_RETURN("hash", hash, EINA_FALSE);
hash->free_value = function;
- return TRUE;
+ return EINA_TRUE;
}
/**
* @param hash The given hash table.
* @param key The key.
* @param value The value.
- * @return @c TRUE if successful, @c FALSE if not.
+ * @return @c EINA_TRUE if successful, @c EINA_FALSE if not.
* @ingroup Ecore_Data_Hash_ADT_Data_Group
*/
EAPI int
ecore_hash_set(Ecore_Hash *hash, void *key, void *value)
{
- int ret = FALSE;
+ int ret = EINA_FALSE;
Ecore_Hash_Node *node;
- CHECK_PARAM_POINTER_RETURN("hash", hash, FALSE);
+ CHECK_PARAM_POINTER_RETURN("hash", hash, EINA_FALSE);
node = _ecore_hash_node_get(hash, key);
if (node)
if (hash->free_key) hash->free_key(key);
if (node->value && hash->free_value) hash->free_value(node->value);
node->value = value;
- ret = TRUE;
+ ret = EINA_TRUE;
}
else
{
* Sets all key-value pairs from set in the given hash table.
* @param hash The given hash table.
* @param set The hash table to import.
- * @return @c TRUE if successful, @c FALSE if not.
+ * @return @c EINA_TRUE if successful, @c EINA_FALSE if not.
* @ingroup Ecore_Data_Hash_ADT_Data_Group
*/
EAPI int
unsigned int i;
Ecore_Hash_Node *node, *old;
- CHECK_PARAM_POINTER_RETURN("hash", hash, FALSE);
- CHECK_PARAM_POINTER_RETURN("set", set, FALSE);
+ CHECK_PARAM_POINTER_RETURN("hash", hash, EINA_FALSE);
+ CHECK_PARAM_POINTER_RETURN("set", set, EINA_FALSE);
for (i = 0; i < ecore_prime_table[set->size]; i++)
{
}
FREE(set->buckets);
ecore_hash_init(set, set->hash_func, set->compare);
- return TRUE;
+ return EINA_TRUE;
}
/**
* Frees the hash table and the data contained inside it.
* @param hash The hash table to destroy.
- * @return @c TRUE on success, @c FALSE on error.
+ * @return @c EINA_TRUE on success, @c EINA_FALSE on error.
* @ingroup Ecore_Data_Hash_ADT_Destruction_Group
*/
EAPI void
* @param hash The given hash.
* @param for_each_func The function that each entry is passed to.
* @param user_data a pointer passed to calls of for_each_func
- * @return TRUE on success, FALSE otherwise.
+ * @return EINA_TRUE on success, EINA_FALSE otherwise.
* @ingroup Ecore_Data_Hash_ADT_Traverse_Group
*/
EAPI int
{
unsigned int i = 0;
- CHECK_PARAM_POINTER_RETURN("hash", hash, FALSE);
- CHECK_PARAM_POINTER_RETURN("for_each_func", for_each_func, FALSE);
+ CHECK_PARAM_POINTER_RETURN("hash", hash, EINA_FALSE);
+ CHECK_PARAM_POINTER_RETURN("for_each_func", for_each_func, EINA_FALSE);
while (i < ecore_prime_table[hash->size])
{
i++;
}
- return TRUE;
+ return EINA_TRUE;
}
/**
{
Ecore_Hash_Node *node;
- CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+ CHECK_PARAM_POINTER_RETURN("list", list, EINA_FALSE);
for (node = list; node; node = list)
{
_ecore_hash_node_destroy(node, keyd, valued);
}
- return TRUE;
+ return EINA_TRUE;
}
/*
* @brief Add the node to the hash table
* @param hash: the hash table to add the key
* @param node: the node to add to the hash table
- * @return Returns FALSE on error, TRUE on success
+ * @return Returns EINA_FALSE on error, EINA_TRUE on success
*/
static int
_ecore_hash_node_add(Ecore_Hash *hash, Ecore_Hash_Node *node)
{
unsigned long hash_val;
- CHECK_PARAM_POINTER_RETURN("hash", hash, FALSE);
- CHECK_PARAM_POINTER_RETURN("node", node, FALSE);
+ CHECK_PARAM_POINTER_RETURN("hash", hash, EINA_FALSE);
+ CHECK_PARAM_POINTER_RETURN("node", node, EINA_FALSE);
/* Check to see if the hash needs to be resized */
if (ECORE_HASH_INCREASE(hash))
hash->buckets[hash_val] = node;
hash->nodes++;
- return TRUE;
+ return EINA_TRUE;
}
/**
/*
* @brief Increase the size of the hash table by approx. 2 * current size
* @param hash: the hash table to increase the size of
- * @return Returns TRUE on success, FALSE on error
+ * @return Returns EINA_TRUE on success, EINA_FALSE on error
*/
static int
_ecore_hash_increase(Ecore_Hash *hash)
{
void *old;
- CHECK_PARAM_POINTER_RETURN("hash", hash, FALSE);
+ CHECK_PARAM_POINTER_RETURN("hash", hash, EINA_FALSE);
- /* Max size reached so return FALSE */
+ /* Max size reached so return EINA_FALSE */
if ((ecore_prime_table[hash->size] == PRIME_MAX) || (hash->size == PRIME_TABLE_MAX))
- return FALSE;
+ return EINA_FALSE;
/*
* Increase the size of the hash and save a pointer to the old data
{
hash->buckets = old;
hash->size--;
- return FALSE;
+ return EINA_FALSE;
}
hash->nodes = 0;
if (_ecore_hash_rehash(hash, old, hash->size - 1))
{
FREE(old);
- return TRUE;
+ return EINA_TRUE;
}
/*
*/
FREE(old);
- return FALSE;
+ return EINA_FALSE;
}
/*
* @brief Decrease the size of the hash table by < 1/2 * current size
* @param hash: the hash table to decrease the size of
- * @return Returns TRUE on success, FALSE on error
+ * @return Returns EINA_TRUE on success, EINA_FALSE on error
*/
static int
_ecore_hash_decrease(Ecore_Hash *hash)
{
Ecore_Hash_Node **old;
- CHECK_PARAM_POINTER_RETURN("hash", hash, FALSE);
+ CHECK_PARAM_POINTER_RETURN("hash", hash, EINA_FALSE);
if (ecore_prime_table[hash->size] == PRIME_MIN)
- return FALSE;
+ return EINA_FALSE;
/*
* Decrease the hash size and store a pointer to the old data
{
hash->buckets = old;
hash->size++;
- return FALSE;
+ return EINA_FALSE;
}
hash->nodes = 0;
if (_ecore_hash_rehash(hash, old, hash->size + 1))
{
FREE(old);
- return TRUE;
+ return EINA_TRUE;
}
- return FALSE;
+ return EINA_FALSE;
}
/*
* @brief Rehash the nodes of a table into the hash table
* @param hash: the hash to place the nodes of the table
* @param table: the table to remove the nodes from and place in hash
- * @return Returns TRUE on success, FALSE on error
+ * @return Returns EINA_TRUE on success, EINA_FALSE on error
*/
static inline int
_ecore_hash_rehash(Ecore_Hash *hash, Ecore_Hash_Node **old_table, int old_size)
unsigned int i;
Ecore_Hash_Node *old;
- CHECK_PARAM_POINTER_RETURN("hash", hash, FALSE);
- CHECK_PARAM_POINTER_RETURN("old_table", old_table, FALSE);
+ CHECK_PARAM_POINTER_RETURN("hash", hash, EINA_FALSE);
+ CHECK_PARAM_POINTER_RETURN("old_table", old_table, EINA_FALSE);
for (i = 0; i < ecore_prime_table[old_size]; i++)
{
}
}
- return TRUE;
+ return EINA_TRUE;
}
/*
* @param node: the node to set the values
* @param key: the key to reference this node
* @param value: the value that key refers to
- * @return Returns TRUE on success, FALSE on error
+ * @return Returns EINA_TRUE on success, EINA_FALSE on error
*/
static int
_ecore_hash_node_init(Ecore_Hash_Node *node, void *key, void *value)
{
- CHECK_PARAM_POINTER_RETURN("node", node, FALSE);
+ CHECK_PARAM_POINTER_RETURN("node", node, EINA_FALSE);
node->key = key;
node->value = value;
- return TRUE;
+ return EINA_TRUE;
}
/*
* @param node: the node to be destroyed
* @param keyd: the function to free the key
* @param valued: the function to free the value
- * @return Returns TRUE on success, FALSE on error
+ * @return Returns EINA_TRUE on success, EINA_FALSE on error
*/
static int
_ecore_hash_node_destroy(Ecore_Hash_Node *node, Ecore_Free_Cb keyd, Ecore_Free_Cb valued)
{
- CHECK_PARAM_POINTER_RETURN("node", node, FALSE);
+ CHECK_PARAM_POINTER_RETURN("node", node, EINA_FALSE);
if (keyd)
keyd(node->key);
FREE(node);
- return TRUE;
+ return EINA_TRUE;
}
/**
* Initialize a list to some sane starting values.
* @param list The list to initialize.
- * @return @c TRUE if successful, @c FALSE if an error occurs.
+ * @return @c EINA_TRUE if successful, @c EINA_FALSE if an error occurs.
* @ingroup Ecore_Data_List_Creation_Group
*/
EAPI int
ecore_list_init(Ecore_List *list)
{
- CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+ CHECK_PARAM_POINTER_RETURN("list", list, EINA_FALSE);
memset(list, 0, sizeof(Ecore_List));
- return TRUE;
+ return EINA_TRUE;
}
/**
* @param list The list that will use this function when nodes are
* destroyed.
* @param free_func The function that will free the key data.
- * @return @c TRUE on successful set, @c FALSE otherwise.
+ * @return @c EINA_TRUE on successful set, @c EINA_FALSE otherwise.
*/
EAPI int
ecore_list_free_cb_set(Ecore_List *list, Ecore_Free_Cb free_func)
{
- CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+ CHECK_PARAM_POINTER_RETURN("list", list, EINA_FALSE);
list->free_func = free_func;
- return TRUE;
+ return EINA_TRUE;
}
/**
* Checks the list for any nodes.
* @param list The list to check for nodes
- * @return @c TRUE if no nodes in list, @c FALSE if the list contains nodes
+ * @return @c EINA_TRUE if no nodes in list, @c EINA_FALSE if the list contains nodes
*/
EAPI int
ecore_list_empty_is(Ecore_List *list)
{
- int ret = TRUE;
+ int ret = EINA_TRUE;
- CHECK_PARAM_POINTER_RETURN("list", list, TRUE);
+ CHECK_PARAM_POINTER_RETURN("list", list, EINA_TRUE);
if (list->nodes)
- ret = FALSE;
+ ret = EINA_FALSE;
return ret;
}
{
int ret;
- CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+ CHECK_PARAM_POINTER_RETURN("list", list, EINA_FALSE);
ret = list->index;
{
int ret = 0;
- CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+ CHECK_PARAM_POINTER_RETURN("list", list, EINA_FALSE);
ret = list->nodes;
* Append data to the list.
* @param list The list.
* @param data The data to append.
- * @return @c FALSE if an error occurs, @c TRUE if appended successfully
+ * @return @c EINA_FALSE if an error occurs, @c EINA_TRUE if appended successfully
* @ingroup Ecore_Data_List_Add_Item_Group
*/
EAPI inline int
int ret;
Ecore_List_Node *node;
- CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+ CHECK_PARAM_POINTER_RETURN("list", list, EINA_FALSE);
node = ecore_list_node_new();
node->data = data;
list->nodes++;
- return TRUE;
+ return EINA_TRUE;
}
/**
* Prepend data to the beginning of the list.
* @param list The list.
* @param data The data to prepend.
- * @return @c FALSE if an error occurs, @c TRUE if prepended successfully.
+ * @return @c EINA_FALSE if an error occurs, @c EINA_TRUE if prepended successfully.
* @ingroup Ecore_Data_List_Add_Item_Group
*/
EAPI inline int
int ret;
Ecore_List_Node *node;
- CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+ CHECK_PARAM_POINTER_RETURN("list", list, EINA_FALSE);
node = ecore_list_node_new();
node->data = data;
list->nodes++;
list->index++;
- return TRUE;
+ return EINA_TRUE;
}
/**
* Insert data in front of the current point in the list.
* @param list The list to hold the inserted @p data.
* @param data The data to insert into @p list.
- * @return @c FALSE if there is an error, @c TRUE on success
+ * @return @c EINA_FALSE if there is an error, @c EINA_TRUE on success
* @ingroup Ecore_Data_List_Add_Item_Group
*/
EAPI inline int
int ret;
Ecore_List_Node *node;
- CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+ CHECK_PARAM_POINTER_RETURN("list", list, EINA_FALSE);
node = ecore_list_node_new();
node->data = data;
list->current = new_node;
list->nodes++;
- return TRUE;
+ return EINA_TRUE;
}
/**
* Append a list to the list.
* @param list The list.
* @param append The list to append.
- * @return @c FALSE if an error occurs, @c TRUE if appended successfully
+ * @return @c EINA_FALSE if an error occurs, @c EINA_TRUE if appended successfully
* @ingroup Ecore_Data_List_Add_Item_Group
*/
EAPI int
ecore_list_append_list(Ecore_List *list, Ecore_List *append)
{
- CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
- CHECK_PARAM_POINTER_RETURN("append", append, FALSE);
+ CHECK_PARAM_POINTER_RETURN("list", list, EINA_FALSE);
+ CHECK_PARAM_POINTER_RETURN("append", append, EINA_FALSE);
- if (ecore_list_empty_is(append)) return TRUE;
+ if (ecore_list_empty_is(append)) return EINA_TRUE;
if (ecore_list_empty_is(list))
{
list->nodes += append->nodes;
}
ecore_list_init(append);
- return TRUE;
+ return EINA_TRUE;
}
/**
* Prepend a list to the beginning of the list.
* @param list The list.
* @param prepend The list to prepend.
- * @return @c FALSE if an error occurs, @c TRUE if prepended successfully.
+ * @return @c EINA_FALSE if an error occurs, @c EINA_TRUE if prepended successfully.
* @ingroup Ecore_Data_List_Add_Item_Group
*/
EAPI int
ecore_list_prepend_list(Ecore_List *list, Ecore_List *prepend)
{
- CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
- CHECK_PARAM_POINTER_RETURN("prepend", prepend, FALSE);
+ CHECK_PARAM_POINTER_RETURN("list", list, EINA_FALSE);
+ CHECK_PARAM_POINTER_RETURN("prepend", prepend, EINA_FALSE);
- if (ecore_list_empty_is(prepend)) return TRUE;
+ if (ecore_list_empty_is(prepend)) return EINA_TRUE;
if (ecore_list_empty_is(list))
{
list->index += prepend->nodes;
}
ecore_list_init(prepend);
- return TRUE;
+ return EINA_TRUE;
}
/**
/**
* Remove and free the data in lists current position.
* @param list The list to remove and free the current item.
- * @return @c TRUE on success, @c FALSE on error
+ * @return @c EINA_TRUE on success, @c EINA_FALSE on error
* @ingroup Ecore_Data_List_Remove_Item_Group
*/
EAPI int
{
void *data;
- CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+ CHECK_PARAM_POINTER_RETURN("list", list, EINA_FALSE);
data = _ecore_list_remove_0(list);
if (list->free_func)
list->free_func(data);
- return TRUE;
+ return EINA_TRUE;
}
/**
/**
* Remove all nodes from @p list.
* @param list The list.
- * @return Returns @c TRUE on success, @c FALSE on error.
+ * @return Returns @c EINA_TRUE on success, @c EINA_FALSE on error.
* @note The data for each item on the list is not freed by
* @c ecore_list_clear().
*/
EAPI int
ecore_list_clear(Ecore_List *list)
{
- CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+ CHECK_PARAM_POINTER_RETURN("list", list, EINA_FALSE);
while (!ecore_list_empty_is(list))
_ecore_list_first_remove(list);
- return TRUE;
+ return EINA_TRUE;
}
/**
* Execute function for each node in @p list.
* @param list The list.
* @param function The function to pass each node from @p list to.
- * @return Returns @c TRUE on success, @c FALSE on failure.
+ * @return Returns @c EINA_TRUE on success, @c EINA_FALSE on failure.
* @ingroup Ecore_Data_List_Traverse_Group
*/
EAPI int
{
int ret;
- CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+ CHECK_PARAM_POINTER_RETURN("list", list, EINA_FALSE);
ret = _ecore_list_for_each(list, function, user_data);
void *value;
if (!list || !function)
- return FALSE;
+ return EINA_FALSE;
_ecore_list_first_goto(list);
while ((value = _ecore_list_next(list)) != NULL)
function(value, user_data);
- return TRUE;
+ return EINA_TRUE;
}
/**
EAPI int
ecore_list_node_init(Ecore_List_Node *node)
{
- CHECK_PARAM_POINTER_RETURN("node", node, FALSE);
+ CHECK_PARAM_POINTER_RETURN("node", node, EINA_FALSE);
node->next = NULL;
node->data = NULL;
- return TRUE;
+ return EINA_TRUE;
}
/**
* Calls the function to free the data and the node.
* @param node Node to destroy.
* @param free_func Function to call if @p node points to data to free.
- * @return @c TRUE.
+ * @return @c EINA_TRUE.
* @ingroup Ecore_Data_List_Node_Group
*/
EAPI int
ecore_list_node_destroy(Ecore_List_Node *node, Ecore_Free_Cb free_func)
{
- CHECK_PARAM_POINTER_RETURN("node", node, FALSE);
+ CHECK_PARAM_POINTER_RETURN("node", node, EINA_FALSE);
if (free_func && node->data)
free_func(node->data);
FREE(node);
- return TRUE;
+ return EINA_TRUE;
}
/**
/**
* Initialises a list to some sane starting values.
* @param list The doubly linked list to initialise.
- * @return @c TRUE if successful, @c FALSE if an error occurs.
+ * @return @c EINA_TRUE if successful, @c EINA_FALSE if an error occurs.
* @ingroup Ecore_Data_DList_Creation_Group
*/
EAPI int
ecore_dlist_init(Ecore_DList *list)
{
- CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+ CHECK_PARAM_POINTER_RETURN("list", list, EINA_FALSE);
memset(list, 0, sizeof(Ecore_DList));
- return TRUE;
+ return EINA_TRUE;
}
/**
* @param list The doubly linked list that will use this function when
* nodes are destroyed.
* @param free_func The function that will free the key data
- * @return @c TRUE on success, @c FALSE on failure.
+ * @return @c EINA_TRUE on success, @c EINA_FALSE on failure.
* @ingroup Ecore_Data_DList_Creation_Group
*/
EAPI int
ecore_dlist_free_cb_set(Ecore_DList *list, Ecore_Free_Cb free_func)
{
- CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+ CHECK_PARAM_POINTER_RETURN("list", list, EINA_FALSE);
return ecore_list_free_cb_set(ECORE_LIST(list), free_func);
}
/**
* Returns whether there is anything in the given doubly linked list.
* @param list The given doubly linked list.
- * @return @c TRUE if there are nodes, @c FALSE otherwise.
+ * @return @c EINA_TRUE if there are nodes, @c EINA_FALSE otherwise.
*/
EAPI int
ecore_dlist_empty_is(Ecore_DList *list)
{
- CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+ CHECK_PARAM_POINTER_RETURN("list", list, EINA_FALSE);
return ecore_list_empty_is(ECORE_LIST(list));
}
EAPI inline int
ecore_dlist_index(Ecore_DList *list)
{
- CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+ CHECK_PARAM_POINTER_RETURN("list", list, EINA_FALSE);
return ecore_list_index(ECORE_LIST(list));
}
* Appends data to the given doubly linked list.
* @param list The given doubly linked list.
* @param data The data to append.
- * @return @c TRUE if the data is successfully appended, @c FALSE otherwise.
+ * @return @c EINA_TRUE if the data is successfully appended, @c EINA_FALSE otherwise.
* @ingroup Ecore_Data_DList_Add_Item_Group
*/
EAPI int
Ecore_DList_Node *prev;
Ecore_DList_Node *node;
- CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+ CHECK_PARAM_POINTER_RETURN("list", list, EINA_FALSE);
node = ecore_dlist_node_new();
ECORE_LIST_NODE(node)->data = data;
* Adds data to the very beginning of the given doubly linked list.
* @param list The given doubly linked list.
* @param data The data to prepend.
- * @return @c TRUE if the data is successfully prepended, @c FALSE otherwise.
+ * @return @c EINA_TRUE if the data is successfully prepended, @c EINA_FALSE otherwise.
* @ingroup Ecore_Data_DList_Add_Item_Group
*/
EAPI int
Ecore_DList_Node *prev;
Ecore_DList_Node *node;
- CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+ CHECK_PARAM_POINTER_RETURN("list", list, EINA_FALSE);
node = ecore_dlist_node_new();
ECORE_LIST_NODE(node)->data = data;
* Inserts data at the current point in the given doubly linked list.
* @param list The given doubly linked list.
* @param data The data to be inserted.
- * @return @c TRUE on success, @c FALSE otherwise.
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
* @ingroup Ecore_Data_DList_Add_Item_Group
*/
EAPI int
ecore_dlist_insert(Ecore_DList *list, void *data)
{
- int ret = TRUE;
+ int ret = EINA_TRUE;
Ecore_DList_Node *prev;
Ecore_DList_Node *node;
- CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+ CHECK_PARAM_POINTER_RETURN("list", list, EINA_FALSE);
/*
* Identify and shortcut the end cases.
* Appends a list to the given doubly linked list.
* @param list The given doubly linked list.
* @param append The list to append.
- * @return @c TRUE if the data is successfully appended, @c FALSE otherwise.
+ * @return @c EINA_TRUE if the data is successfully appended, @c EINA_FALSE otherwise.
* @ingroup Ecore_Data_DList_Add_Item_Group
*/
EAPI int
ecore_dlist_append_list(Ecore_DList *list, Ecore_DList *append)
{
- CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
- CHECK_PARAM_POINTER_RETURN("append", append, FALSE);
+ CHECK_PARAM_POINTER_RETURN("list", list, EINA_FALSE);
+ CHECK_PARAM_POINTER_RETURN("append", append, EINA_FALSE);
- if (ecore_dlist_empty_is(append)) return TRUE;
+ if (ecore_dlist_empty_is(append)) return EINA_TRUE;
if (ecore_dlist_empty_is(list))
{
list->nodes += append->nodes;
}
ecore_dlist_init(append);
- return TRUE;
+ return EINA_TRUE;
}
/**
* Adds a list to the very beginning of the given doubly linked list.
* @param list The given doubly linked list.
* @param prepend The list to prepend.
- * @return @c TRUE if the data is successfully prepended, @c FALSE otherwise.
+ * @return @c EINA_TRUE if the data is successfully prepended, @c EINA_FALSE otherwise.
* @ingroup Ecore_Data_DList_Add_Item_Group
*/
EAPI int
ecore_dlist_prepend_list(Ecore_DList *list, Ecore_DList *prepend)
{
- CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
- CHECK_PARAM_POINTER_RETURN("prepend", prepend, FALSE);
+ CHECK_PARAM_POINTER_RETURN("list", list, EINA_FALSE);
+ CHECK_PARAM_POINTER_RETURN("prepend", prepend, EINA_FALSE);
- if (ecore_dlist_empty_is(prepend)) return TRUE;
+ if (ecore_dlist_empty_is(prepend)) return EINA_TRUE;
if (ecore_dlist_empty_is(list))
{
list->index += prepend->nodes;
}
ecore_dlist_init(prepend);
- return TRUE;
+ return EINA_TRUE;
}
/**
* Removes and frees the data at the current position in the given doubly
* linked list.
* @param list The given doubly linked list.
- * @return @c TRUE on success, @c FALSE otherwise.
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
* @ingroup Ecore_Data_DList_Remove_Item_Group
*/
EAPI int
{
void *data;
- CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+ CHECK_PARAM_POINTER_RETURN("list", list, EINA_FALSE);
data = ecore_dlist_remove(list);
if (!data)
- return FALSE;
+ return EINA_FALSE;
if (list->free_func)
list->free_func(data);
- return TRUE;
+ return EINA_TRUE;
}
static void *
* @brief Remove all nodes from the list.
* @param list: the list to remove all nodes from
*
- * @return Returns TRUE on success, FALSE on errors
+ * @return Returns EINA_TRUE on success, EINA_FALSE on errors
*/
EAPI int
ecore_dlist_clear(Ecore_DList *list)
{
- CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+ CHECK_PARAM_POINTER_RETURN("list", list, EINA_FALSE);
ecore_list_clear(ECORE_LIST(list));
- return TRUE;
+ return EINA_TRUE;
}
/**
/*
* @brief Initialize a node to sane starting values
* @param node: the node to initialize
- * @return Returns TRUE on success, FALSE on errors
+ * @return Returns EINA_TRUE on success, EINA_FALSE on errors
*/
EAPI int
ecore_dlist_node_init(Ecore_DList_Node *node)
{
int ret;
- CHECK_PARAM_POINTER_RETURN("node", node, FALSE);
+ CHECK_PARAM_POINTER_RETURN("node", node, EINA_FALSE);
ret = ecore_list_node_init(ECORE_LIST_NODE(node));
if (ret)
* @brief Call the data's free callback function, then free the node
* @param node: the node to be freed
* @param free_func: the callback function to execute on the data
- * @return Returns TRUE on success, FALSE on error
+ * @return Returns EINA_TRUE on success, EINA_FALSE on error
*/
EAPI int
ecore_dlist_node_destroy(Ecore_DList_Node * node, Ecore_Free_Cb free_func)
{
- CHECK_PARAM_POINTER_RETURN("node", node, FALSE);
+ CHECK_PARAM_POINTER_RETURN("node", node, EINA_FALSE);
return ecore_list_node_destroy(ECORE_LIST_NODE(node), free_func);
}
* @param heap The heap to initialize
* @param compare The function for comparing keys, NULL for direct comparison
* @param size The number of elements to allow in the heap
- * @return TRUE on success, FALSE on failure
+ * @return EINA_TRUE on success, EINA_FALSE on failure
*/
EAPI int
ecore_sheap_init(Ecore_Sheap *heap, Ecore_Compare_Cb compare, int size)
{
- CHECK_PARAM_POINTER_RETURN("heap", heap, FALSE);
+ CHECK_PARAM_POINTER_RETURN("heap", heap, EINA_FALSE);
heap->space = size;
if (!compare)
heap->data = (void **)malloc(heap->space * sizeof(void *));
if (!heap->data)
- return FALSE;
+ return EINA_FALSE;
memset(heap->data, 0, heap->space * sizeof(void *));
- return TRUE;
+ return EINA_TRUE;
}
/**
* @param heap The heap that will use this function when nodes are
* destroyed.
* @param free_func The function that will free the key data.
- * @return @c TRUE on successful set, @c FALSE otherwise.
+ * @return @c EINA_TRUE on successful set, @c EINA_FALSE otherwise.
*/
EAPI int
ecore_sheap_free_cb_set(Ecore_Sheap *heap, Ecore_Free_Cb free_func)
{
- CHECK_PARAM_POINTER_RETURN("heap", heap, FALSE);
+ CHECK_PARAM_POINTER_RETURN("heap", heap, EINA_FALSE);
heap->free_func = free_func;
- return TRUE;
+ return EINA_TRUE;
}
/**
* Insert new data into the heap.
* @param heap The heap to insert @a data.
* @param data The data to add to @a heap.
- * @return TRUE on success, NULL on failure. Increases the size of the heap if
+ * @return EINA_TRUE on success, NULL on failure. Increases the size of the heap if
* it becomes larger than available space.
*/
EAPI int
int parent;
int position;
- CHECK_PARAM_POINTER_RETURN("heap", heap, FALSE);
+ CHECK_PARAM_POINTER_RETURN("heap", heap, EINA_FALSE);
/*
* Increase the size of the allocated data area if there isn't enough
* space available to add this data
*/
if (heap->size >= heap->space)
- return FALSE;
+ return EINA_FALSE;
- heap->sorted = FALSE;
+ heap->sorted = EINA_FALSE;
/*
* Place the data at the end of the heap initially. Then determine the
}
}
- return TRUE;
+ return EINA_TRUE;
}
/**
if (heap->size < 1)
return NULL;
- heap->sorted = FALSE;
+ heap->sorted = EINA_FALSE;
extreme = heap->data[0];
heap->size--;
* @param heap The heap to search for the item to change
* @param item The item in the heap to change
* @param newval The new value assigned to the item in the heap
- * @return TRUE on success, FALSE on failure.
+ * @return EINA_TRUE on success, EINA_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.
*/
{
int i;
- CHECK_PARAM_POINTER_RETURN("heap", heap, FALSE);
+ CHECK_PARAM_POINTER_RETURN("heap", heap, EINA_FALSE);
for (i = 0; i < heap->size && heap->compare(heap->data[i], item); i++);
if (i < heap->size)
heap->data[i] = newval;
else
- return FALSE;
+ return EINA_FALSE;
/*
* FIXME: This is not the correct procedure when a change occurs.
*/
_ecore_sheap_heapify(heap, 1);
- return TRUE;
+ return EINA_TRUE;
}
/**
* Change the comparison function for the heap
* @param heap The heap to change comparison function
* @param compare The new function for comparing nodes
- * @return TRUE on success, FALSE on failure.
+ * @return EINA_TRUE on success, EINA_FALSE on failure.
*
* The comparison function is changed to @compare and the heap is heapified
* by the new comparison.
EAPI int
ecore_sheap_compare_set(Ecore_Sheap *heap, Ecore_Compare_Cb compare)
{
- CHECK_PARAM_POINTER_RETURN("heap", heap, FALSE);
+ CHECK_PARAM_POINTER_RETURN("heap", heap, EINA_FALSE);
if (!compare)
heap->compare = ecore_direct_compare;
_ecore_sheap_update_data(heap);
- return TRUE;
+ return EINA_TRUE;
}
/**
FREE(heap->data);
heap->data = new_data;
heap->size = i;
- heap->sorted = TRUE;
+ heap->sorted = EINA_TRUE;
}
/*
* @brief Initialize a tree structure to some sane initial values
* @param new_tree: the new tree structure to be initialized
* @param compare_func: the function used to compare node keys
- * @return Returns TRUE on successful initialization, FALSE on an error
+ * @return Returns EINA_TRUE on successful initialization, EINA_FALSE on an error
*/
EAPI int
ecore_tree_init(Ecore_Tree *new_tree, Ecore_Compare_Cb compare_func)
{
- CHECK_PARAM_POINTER_RETURN("new_tree", new_tree, FALSE);
+ CHECK_PARAM_POINTER_RETURN("new_tree", new_tree, EINA_FALSE);
memset(new_tree, 0, sizeof(Ecore_Tree));
else
new_tree->compare_func = compare_func;
- return TRUE;
+ return EINA_TRUE;
}
/*
* @brief Add a function to be called at node destroy time
* @param tree: the tree that will use this function when nodes are destroyed
* @param free_func: the function that will be passed the node being freed
- * @return Returns TRUE on successful set, FALSE otherwise.
+ * @return Returns EINA_TRUE on successful set, EINA_FALSE otherwise.
*/
EAPI int
ecore_tree_free_value_cb_set(Ecore_Tree *tree, Ecore_Free_Cb free_value)
{
- CHECK_PARAM_POINTER_RETURN("tree", tree, FALSE);
+ CHECK_PARAM_POINTER_RETURN("tree", tree, EINA_FALSE);
tree->free_value = free_value;
- return TRUE;
+ return EINA_TRUE;
}
/*
* @brief Add a function to be called at node destroy time
* @param tree: the tree that will use this function when nodes are destroyed
* @param free_key: the function that will be passed the node being freed
- * @return Returns TRUE on successful set, FALSE otherwise.
+ * @return Returns EINA_TRUE on successful set, EINA_FALSE otherwise.
*/
EAPI int
ecore_tree_free_key_cb_set(Ecore_Tree *tree, Ecore_Free_Cb free_key)
{
- CHECK_PARAM_POINTER_RETURN("tree", tree, FALSE);
+ CHECK_PARAM_POINTER_RETURN("tree", tree, EINA_FALSE);
tree->free_key = free_key;
- return TRUE;
+ return EINA_TRUE;
}
/*
* @brief Initialize a new tree node
- * @return Returns FALSE if the operation fails, otherwise TRUE
+ * @return Returns EINA_FALSE if the operation fails, otherwise EINA_TRUE
*/
EAPI int
ecore_tree_node_init(Ecore_Tree_Node *new_node)
{
- CHECK_PARAM_POINTER_RETURN("new_node", new_node, FALSE);
+ CHECK_PARAM_POINTER_RETURN("new_node", new_node, EINA_FALSE);
new_node->key = NULL;
new_node->value = NULL;
new_node->max_left = new_node->max_right = 0;
- return TRUE;
+ return EINA_TRUE;
}
/*
* @brief Free a tree node and it's children.
* @param node: tree node to be free()'d
* @param data_free: callback for destroying the data held in node
- * @return Returns TRUE if the node is destroyed successfully, FALSE if not.
+ * @return Returns EINA_TRUE if the node is destroyed successfully, EINA_FALSE if not.
*
* If you don't want the children free'd then you need to remove the node first.
*/
EAPI int
ecore_tree_node_destroy(Ecore_Tree_Node *node, Ecore_Free_Cb value_free, Ecore_Free_Cb key_free)
{
- CHECK_PARAM_POINTER_RETURN("node", node, FALSE);
+ CHECK_PARAM_POINTER_RETURN("node", node, EINA_FALSE);
if (key_free)
key_free(node->key);
FREE(node);
- return TRUE;
+ return EINA_TRUE;
}
/*
* @brief Set the value of the node to value
* @param node: the node to be set
* @param value: the value to set the node to.
- * @return Returns TRUE if the node is set successfully, FALSE if not.
+ * @return Returns EINA_TRUE if the node is set successfully, EINA_FALSE if not.
*/
EAPI int
ecore_tree_node_value_set(Ecore_Tree_Node *node, void *value)
{
- CHECK_PARAM_POINTER_RETURN("node", node, FALSE);
+ CHECK_PARAM_POINTER_RETURN("node", node, EINA_FALSE);
node->value = value;
- return TRUE;
+ return EINA_TRUE;
}
/*
* @brief Set the value of the node's key to key
* @param node: the node to be set
* @param key: the value to set it's key to.
- * @return Returns TRUE if the node is set successfully, FALSE if not.
+ * @return Returns EINA_TRUE if the node is set successfully, EINA_FALSE if not.
*/
EAPI int
ecore_tree_node_key_set(Ecore_Tree_Node *node, void *key)
{
- CHECK_PARAM_POINTER_RETURN("node", node, FALSE);
+ CHECK_PARAM_POINTER_RETURN("node", node, EINA_FALSE);
node->key = key;
- return TRUE;
+ return EINA_TRUE;
}
/*
* @brief Free the tree and it's stored data
* @param tree: the tree to destroy
*
- * @return Returns TRUE if tree destroyed successfully, FALSE if not.
+ * @return Returns EINA_TRUE if tree destroyed successfully, EINA_FALSE if not.
*/
EAPI int
ecore_tree_destroy(Ecore_Tree *tree)
{
Ecore_Tree_Node *node;
- CHECK_PARAM_POINTER_RETURN("tree", tree, FALSE);
+ CHECK_PARAM_POINTER_RETURN("tree", tree, EINA_FALSE);
while ((node = tree->tree))
{
FREE(tree);
- return TRUE;
+ return EINA_TRUE;
}
/**
* @param tree The tree that contains the key/value pair.
* @param key The key to identify which node to set a value.
* @param value Value to set the found node.
- * @return TRUE if successful, FALSE if not.
+ * @return EINA_TRUE if successful, EINA_FALSE if not.
*/
EAPI int
ecore_tree_set(Ecore_Tree *tree, void *key, void *value)
{
Ecore_Tree_Node *node = NULL;
- CHECK_PARAM_POINTER_RETURN("tree", tree, FALSE);
+ CHECK_PARAM_POINTER_RETURN("tree", tree, EINA_FALSE);
node = tree_node_find(tree, key);
if (!node)
node = ecore_tree_node_new();
ecore_tree_node_key_set(node, key);
if (!ecore_tree_node_add(tree, node))
- return FALSE;
+ return EINA_FALSE;
}
else
{
for (; node; node = node->parent)
tree_node_balance(tree, node);
- return TRUE;
+ return EINA_TRUE;
}
/**
* Place a node in the tree.
* @param tree The tree to add @a node.
* @param node The node to add to @a tree.
- * @return TRUE on a successful add, FALSE otherwise.
+ * @return EINA_TRUE on a successful add, EINA_FALSE otherwise.
*/
EAPI int
ecore_tree_node_add(Ecore_Tree *tree, Ecore_Tree_Node *node)
{
Ecore_Tree_Node *travel = NULL;
- CHECK_PARAM_POINTER_RETURN("tree", tree, FALSE);
- CHECK_PARAM_POINTER_RETURN("node", node, FALSE);
+ CHECK_PARAM_POINTER_RETURN("tree", tree, EINA_FALSE);
+ CHECK_PARAM_POINTER_RETURN("node", node, EINA_FALSE);
/* Find where to put this new node. */
if (!tree->tree)
}
}
- return TRUE;
+ return EINA_TRUE;
}
/**
* Remove the node from the tree.
* @param tree The tree to remove @a node from.
* @param node The node to remove from @a tree.
- * @return TRUE on a successful remove, FALSE otherwise.
+ * @return EINA_TRUE on a successful remove, EINA_FALSE otherwise.
*/
EAPI int
ecore_tree_node_remove(Ecore_Tree *tree, Ecore_Tree_Node *node)
{
Ecore_Tree_Node *traverse;
- CHECK_PARAM_POINTER_RETURN("tree", tree, FALSE);
- CHECK_PARAM_POINTER_RETURN("node", node, FALSE);
+ CHECK_PARAM_POINTER_RETURN("tree", tree, EINA_FALSE);
+ CHECK_PARAM_POINTER_RETURN("node", node, EINA_FALSE);
/*
* Find the nearest value to the balanced one.
traverse = traverse->parent;
}
- return TRUE;
+ return EINA_TRUE;
}
/**
* Remove the key from the tree.
* @param tree The tree to remove @a key.
* @param key The key to remove from @a tree.
- * @return TRUE on a successful remove, FALSE otherwise.
+ * @return EINA_TRUE on a successful remove, EINA_FALSE otherwise.
*/
EAPI int
ecore_tree_remove(Ecore_Tree *tree, const void *key)
{
Ecore_Tree_Node *node;
- CHECK_PARAM_POINTER_RETURN("tree", tree, FALSE);
+ CHECK_PARAM_POINTER_RETURN("tree", tree, EINA_FALSE);
if (!tree->tree)
- return FALSE;
+ return EINA_FALSE;
/* Find the node we need to remove */
node = tree_node_find(tree, key);
if (!node)
- return FALSE;
+ return EINA_FALSE;
if (!ecore_tree_node_remove(tree, node))
- return FALSE;
+ return EINA_FALSE;
ecore_tree_node_destroy(node, tree->free_value, tree->free_key);
- return TRUE;
+ return EINA_TRUE;
}
/**
* @brief Test to see if the tree has any nodes
* @param tree: the tree to check for nodes
- * @return Returns TRUE if no nodes exist, FALSE otherwise
+ * @return Returns EINA_TRUE if no nodes exist, EINA_FALSE otherwise
*/
EAPI int
ecore_tree_empty_is(Ecore_Tree *tree)
{
- CHECK_PARAM_POINTER_RETURN("tree", tree, FALSE);
+ CHECK_PARAM_POINTER_RETURN("tree", tree, EINA_FALSE);
if (!tree->tree)
- return TRUE;
+ return EINA_TRUE;
- return FALSE;
+ return EINA_FALSE;
}
/**
* @param tree: the tree to traverse
* @param for_each_func: the function to execute for each value in the tree
* @param user_data: data passed to each for_each_func call
- * @return Returns TRUE on success, FALSE on failure.
+ * @return Returns EINA_TRUE on success, EINA_FALSE on failure.
*/
EAPI int
ecore_tree_for_each_node_value(Ecore_Tree *tree, Ecore_For_Each for_each_func, void *user_data)
{
- CHECK_PARAM_POINTER_RETURN("tree", tree, FALSE);
- CHECK_PARAM_POINTER_RETURN("for_each_func", for_each_func, FALSE);
+ CHECK_PARAM_POINTER_RETURN("tree", tree, EINA_FALSE);
+ CHECK_PARAM_POINTER_RETURN("for_each_func", for_each_func, EINA_FALSE);
if (!tree->tree)
- return FALSE;
+ return EINA_FALSE;
return tree_for_each_node_value(tree->tree, for_each_func, user_data);
}
* @param tree: the tree to traverse
* @param for_each_func: the function to execute for each node
* @param user_data: data passed to each for_each_func call
- * @return Returns TRUE on success, FALSE on failure.
+ * @return Returns EINA_TRUE on success, EINA_FALSE on failure.
*/
EAPI int
ecore_tree_for_each_node(Ecore_Tree *tree, Ecore_For_Each for_each_func, void *user_data)
{
- CHECK_PARAM_POINTER_RETURN("tree", tree, FALSE);
- CHECK_PARAM_POINTER_RETURN("for_each_func", for_each_func, FALSE);
+ CHECK_PARAM_POINTER_RETURN("tree", tree, EINA_FALSE);
+ CHECK_PARAM_POINTER_RETURN("for_each_func", for_each_func, EINA_FALSE);
if (!tree->tree)
- return FALSE;
+ return EINA_FALSE;
return tree_for_each_node(tree->tree, for_each_func, user_data);
}
{
int balance;
- CHECK_PARAM_POINTER_RETURN("top_node", top_node, FALSE);
+ CHECK_PARAM_POINTER_RETURN("top_node", top_node, EINA_FALSE);
/* Get the height of the left branch. */
if (top_node->right_child)
else if (balance > 1)
tree_node_rotate_left(tree, top_node);
- return TRUE;
+ return EINA_TRUE;
}
/* Tree is overbalanced to the left, so rotate nodes to the right. */
{
Ecore_Tree_Node *temp;
- CHECK_PARAM_POINTER_RETURN("top_node", top_node, FALSE);
+ CHECK_PARAM_POINTER_RETURN("top_node", top_node, EINA_FALSE);
/* The left branch's right branch becomes the nodes left branch,
* the left branch becomes the top node, and the node becomes the
tree_node_balance(tree, top_node);
tree_node_balance(tree, temp);
- return TRUE;
+ return EINA_TRUE;
}
/* The tree is overbalanced to the right, so we rotate nodes to the left */
{
Ecore_Tree_Node *temp;
- CHECK_PARAM_POINTER_RETURN("top_node", top_node, FALSE);
+ CHECK_PARAM_POINTER_RETURN("top_node", top_node, EINA_FALSE);
/*
* The right branch's left branch becomes the nodes right branch,
tree_node_balance(tree, top_node);
tree_node_balance(tree, temp);
- return TRUE;
+ return EINA_TRUE;
}
/*
* @param node: the highest node in the tree the function will be executed for
* @param for_each_func: the function to pass the nodes as data into
* @param user_data: data passed to each for_each_func call
- * @return Returns FALSE if an error condition occurs, otherwise TRUE
+ * @return Returns EINA_FALSE if an error condition occurs, otherwise EINA_TRUE
*/
static int
tree_for_each_node(Ecore_Tree_Node * node, Ecore_For_Each for_each_func, void *user_data)
{
- CHECK_PARAM_POINTER_RETURN("node", node, FALSE);
+ CHECK_PARAM_POINTER_RETURN("node", node, EINA_FALSE);
if (node->right_child)
tree_for_each_node(node->right_child, for_each_func, user_data);
for_each_func(node, user_data);
- return TRUE;
+ return EINA_TRUE;
}
/*
* @brief Execute a function for each node below this point in the tree.
* @param node: the highest node in the tree the function will be executed for
* @param for_each_func: the function to pass the nodes values as data
- * @return Returns FALSE if an error condition occurs, otherwise TRUE
+ * @return Returns EINA_FALSE if an error condition occurs, otherwise EINA_TRUE
*/
static int
tree_for_each_node_value(Ecore_Tree_Node *node, Ecore_For_Each for_each_func, void *user_data)
{
- CHECK_PARAM_POINTER_RETURN("node", node, FALSE);
+ CHECK_PARAM_POINTER_RETURN("node", node, EINA_FALSE);
if (node->right_child)
tree_for_each_node_value(node->right_child, for_each_func, user_data);
for_each_func(node->value, user_data);
- return TRUE;
+ return EINA_TRUE;
}