Patch from Brian Wang to fix the TRUE/FALSE --> EINA_TRUE/EINA_FALSE mess.

(NB: Win32/CE people may need to fix some TRUE/FALSE parts...couldn't test
those).

Thanks Brian :)



SVN revision: 46503
This commit is contained in:
Christopher Michael 2010-02-26 05:56:49 +00:00
parent e3c9d3f62a
commit 300d53a4f4
7 changed files with 245 additions and 245 deletions

View File

@ -235,7 +235,7 @@ ecore_exe_pipe_run(const char *exe_cmd, Ecore_Exe_Flags flags, const void *data)
/* 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;
@ -252,7 +252,7 @@ ecore_exe_pipe_run(const char *exe_cmd, Ecore_Exe_Flags flags, const void *data)
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))
@ -688,7 +688,7 @@ _ecore_exe_win32_pipes_set(Ecore_Exe *exe)
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))
@ -811,14 +811,14 @@ _ecore_exe_enum_windows_procedure(HWND window, LPARAM data)
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 */
@ -826,7 +826,7 @@ _ecore_exe_enum_windows_procedure(HWND window, LPARAM data)
if (WaitForSingleObject(exe->process, ECORE_EXE_WIN32_TIMEOUT) == WAIT_OBJECT_0)
{
printf ("CLOSE\n");
return FALSE;
return EINA_FALSE;
}
/* WM_QUIT message */
@ -834,7 +834,7 @@ _ecore_exe_enum_windows_procedure(HWND window, LPARAM data)
if (WaitForSingleObject(exe->process, ECORE_EXE_WIN32_TIMEOUT) == WAIT_OBJECT_0)
{
printf ("QUIT\n");
return FALSE;
return EINA_FALSE;
}
/* Exit process */
@ -843,21 +843,21 @@ _ecore_exe_enum_windows_procedure(HWND window, LPARAM data)
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

View File

@ -385,7 +385,7 @@ ecore_pipe_write_close(Ecore_Pipe *p)
* @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
@ -398,10 +398,10 @@ ecore_pipe_write(Ecore_Pipe *p, const void *buffer, unsigned int nbytes)
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
@ -417,13 +417,13 @@ ecore_pipe_write(Ecore_Pipe *p, const void *buffer, unsigned int nbytes)
/* 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 */
@ -437,7 +437,7 @@ ecore_pipe_write(Ecore_Pipe *p, const void *buffer, unsigned int nbytes)
}
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
@ -447,7 +447,7 @@ ecore_pipe_write(Ecore_Pipe *p, const void *buffer, unsigned int nbytes)
nbytes - already_written);
if (ret == (ssize_t)(nbytes - already_written))
return TRUE;
return EINA_TRUE;
else if (ret >= 0)
{
already_written -= ret;
@ -457,7 +457,7 @@ ecore_pipe_write(Ecore_Pipe *p, const void *buffer, unsigned int nbytes)
{
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 */
@ -471,7 +471,7 @@ ecore_pipe_write(Ecore_Pipe *p, const void *buffer, unsigned int nbytes)
}
while (retry--);
return FALSE;
return EINA_FALSE;
}
/* Private function */

View File

@ -263,7 +263,7 @@ ecore_con_url_new(const char *url)
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);
@ -837,7 +837,7 @@ ecore_con_url_verbose_set(Ecore_Con_Url *url_con, int verbose)
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);
@ -861,7 +861,7 @@ ecore_con_url_ftp_use_epsv_set(Ecore_Con_Url *url_con, int use_epsv)
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);

View File

@ -24,10 +24,10 @@
#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);
@ -79,13 +79,13 @@ ecore_hash_new(Ecore_Hash_Cb hash_func, Ecore_Compare_Cb compare)
* @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));
@ -95,7 +95,7 @@ ecore_hash_init(Ecore_Hash *hash, Ecore_Hash_Cb hash_func, Ecore_Compare_Cb comp
hash->buckets = (Ecore_Hash_Node **)calloc(ecore_prime_table[0],
sizeof(Ecore_Hash_Node *));
return TRUE;
return EINA_TRUE;
}
/**
@ -109,17 +109,17 @@ ecore_hash_init(Ecore_Hash *hash, Ecore_Hash_Cb hash_func, Ecore_Compare_Cb comp
* @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;
}
/**
@ -127,17 +127,17 @@ ecore_hash_free_key_cb_set(Ecore_Hash *hash, Ecore_Free_Cb function)
* @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;
}
/**
@ -151,16 +151,16 @@ ecore_hash_free_value_cb_set(Ecore_Hash *hash, Ecore_Free_Cb function)
* @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)
@ -168,7 +168,7 @@ ecore_hash_set(Ecore_Hash *hash, void *key, void *value)
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
{
@ -184,7 +184,7 @@ ecore_hash_set(Ecore_Hash *hash, void *key, void *value)
* 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
@ -193,8 +193,8 @@ ecore_hash_hash_set(Ecore_Hash *hash, Ecore_Hash *set)
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++)
{
@ -220,13 +220,13 @@ ecore_hash_hash_set(Ecore_Hash *hash, Ecore_Hash *set)
}
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
@ -289,7 +289,7 @@ ecore_hash_count(Ecore_Hash *hash)
* @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
@ -297,8 +297,8 @@ ecore_hash_for_each_node(Ecore_Hash *hash, Ecore_For_Each for_each_func, void *u
{
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])
{
@ -314,7 +314,7 @@ ecore_hash_for_each_node(Ecore_Hash *hash, Ecore_For_Each for_each_func, void *u
i++;
}
return TRUE;
return EINA_TRUE;
}
/**
@ -404,7 +404,7 @@ _ecore_hash_bucket_destroy(Ecore_Hash_Node *list, Ecore_Free_Cb keyd, Ecore_Free
{
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)
{
@ -412,22 +412,22 @@ _ecore_hash_bucket_destroy(Ecore_Hash_Node *list, Ecore_Free_Cb keyd, Ecore_Free
_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))
@ -444,7 +444,7 @@ _ecore_hash_node_add(Ecore_Hash *hash, Ecore_Hash_Node *node)
hash->buckets[hash_val] = node;
hash->nodes++;
return TRUE;
return EINA_TRUE;
}
/**
@ -676,18 +676,18 @@ _ecore_hash_bucket_get(Ecore_Hash *hash, Ecore_Hash_Node *bucket, const void *ke
/*
* @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
@ -708,7 +708,7 @@ _ecore_hash_increase(Ecore_Hash *hash)
{
hash->buckets = old;
hash->size--;
return FALSE;
return EINA_FALSE;
}
hash->nodes = 0;
@ -718,7 +718,7 @@ _ecore_hash_increase(Ecore_Hash *hash)
if (_ecore_hash_rehash(hash, old, hash->size - 1))
{
FREE(old);
return TRUE;
return EINA_TRUE;
}
/*
@ -726,23 +726,23 @@ _ecore_hash_increase(Ecore_Hash *hash)
*/
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
@ -764,7 +764,7 @@ _ecore_hash_decrease(Ecore_Hash *hash)
{
hash->buckets = old;
hash->size++;
return FALSE;
return EINA_FALSE;
}
hash->nodes = 0;
@ -772,17 +772,17 @@ _ecore_hash_decrease(Ecore_Hash *hash)
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)
@ -790,8 +790,8 @@ _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++)
{
@ -804,7 +804,7 @@ _ecore_hash_rehash(Ecore_Hash *hash, Ecore_Hash_Node **old_table, int old_size)
}
}
return TRUE;
return EINA_TRUE;
}
/*
@ -836,17 +836,17 @@ _ecore_hash_node_new(void *key, void *value)
* @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;
}
/*
@ -854,12 +854,12 @@ _ecore_hash_node_init(Ecore_Hash_Node *node, void *key, void *value)
* @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);
@ -869,5 +869,5 @@ _ecore_hash_node_destroy(Ecore_Hash_Node *node, Ecore_Free_Cb keyd, Ecore_Free_C
FREE(node);
return TRUE;
return EINA_TRUE;
}

View File

@ -95,17 +95,17 @@ ecore_list_new(void)
/**
* 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;
}
/**
@ -135,32 +135,32 @@ ecore_list_destroy(Ecore_List *list)
* @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;
}
@ -175,7 +175,7 @@ ecore_list_index(Ecore_List *list)
{
int ret;
CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
CHECK_PARAM_POINTER_RETURN("list", list, EINA_FALSE);
ret = list->index;
@ -192,7 +192,7 @@ ecore_list_count(Ecore_List *list)
{
int ret = 0;
CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
CHECK_PARAM_POINTER_RETURN("list", list, EINA_FALSE);
ret = list->nodes;
@ -209,7 +209,7 @@ Functions that are used to add nodes to an Ecore_List.
* 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
@ -218,7 +218,7 @@ ecore_list_append(Ecore_List *list, void *data)
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;
@ -249,14 +249,14 @@ _ecore_list_append_0(Ecore_List *list, Ecore_List_Node *end)
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
@ -265,7 +265,7 @@ ecore_list_prepend(Ecore_List *list, void *data)
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;
@ -291,14 +291,14 @@ _ecore_list_prepend_0(Ecore_List *list, Ecore_List_Node *start)
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
@ -307,7 +307,7 @@ ecore_list_insert(Ecore_List *list, void *data)
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;
@ -350,23 +350,23 @@ _ecore_list_insert(Ecore_List *list, Ecore_List_Node *new_node)
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))
{
@ -382,23 +382,23 @@ ecore_list_append_list(Ecore_List *list, Ecore_List *append)
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))
{
@ -415,7 +415,7 @@ ecore_list_prepend_list(Ecore_List *list, Ecore_List *prepend)
list->index += prepend->nodes;
}
ecore_list_init(prepend);
return TRUE;
return EINA_TRUE;
}
/**
@ -484,7 +484,7 @@ _ecore_list_remove_0(Ecore_List *list)
/**
* 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
@ -492,13 +492,13 @@ ecore_list_remove_destroy(Ecore_List *list)
{
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;
}
/**
@ -888,26 +888,26 @@ _ecore_list_next(Ecore_List *list)
/**
* 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
@ -915,7 +915,7 @@ ecore_list_for_each(Ecore_List *list, Ecore_For_Each function, void *user_data)
{
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);
@ -929,13 +929,13 @@ _ecore_list_for_each(Ecore_List *list, Ecore_For_Each function, void *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;
}
/**
@ -1213,12 +1213,12 @@ ecore_list_heapsort(Ecore_List *list, Ecore_Compare_Cb compare, char order)
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;
}
/**
@ -1253,20 +1253,20 @@ ecore_list_node_new()
* 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;
}
/**
@ -1302,17 +1302,17 @@ ecore_dlist_new()
/**
* 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;
}
/**
@ -1341,13 +1341,13 @@ ecore_dlist_destroy(Ecore_DList *list)
* @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);
}
@ -1355,12 +1355,12 @@ ecore_dlist_free_cb_set(Ecore_DList *list, Ecore_Free_Cb 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));
}
@ -1373,7 +1373,7 @@ ecore_dlist_empty_is(Ecore_DList *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));
}
@ -1388,7 +1388,7 @@ ecore_dlist_index(Ecore_DList *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
@ -1398,7 +1398,7 @@ ecore_dlist_append(Ecore_DList *list, void *data)
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;
@ -1415,7 +1415,7 @@ ecore_dlist_append(Ecore_DList *list, void *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
@ -1425,7 +1425,7 @@ ecore_dlist_prepend(Ecore_DList *list, void *data)
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;
@ -1442,17 +1442,17 @@ ecore_dlist_prepend(Ecore_DList *list, void *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.
@ -1485,16 +1485,16 @@ ecore_dlist_insert(Ecore_DList *list, void *data)
* 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))
{
@ -1511,23 +1511,23 @@ ecore_dlist_append_list(Ecore_DList *list, Ecore_DList *append)
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))
{
@ -1545,7 +1545,7 @@ ecore_dlist_prepend_list(Ecore_DList *list, Ecore_DList *prepend)
list->index += prepend->nodes;
}
ecore_dlist_init(prepend);
return TRUE;
return EINA_TRUE;
}
/**
@ -1602,7 +1602,7 @@ ecore_dlist_first_remove(Ecore_DList *list)
* 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
@ -1610,16 +1610,16 @@ ecore_dlist_remove_destroy(Ecore_DList *list)
{
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 *
@ -1850,16 +1850,16 @@ _ecore_dlist_previous(Ecore_DList *list)
* @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;
}
/**
@ -2064,14 +2064,14 @@ _ecore_dlist_node_merge(Ecore_List_Node *first, Ecore_List_Node *second,
/*
* @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)
@ -2107,12 +2107,12 @@ ecore_dlist_node_new()
* @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);
}

View File

@ -53,12 +53,12 @@ ecore_sheap_new(Ecore_Compare_Cb compare, int size)
* @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)
@ -69,10 +69,10 @@ ecore_sheap_init(Ecore_Sheap *heap, Ecore_Compare_Cb compare, int size)
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;
}
/**
@ -107,23 +107,23 @@ ecore_sheap_destroy(Ecore_Sheap *heap)
* @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
@ -134,16 +134,16 @@ ecore_sheap_insert(Ecore_Sheap *heap, void *data)
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
@ -209,7 +209,7 @@ ecore_sheap_insert(Ecore_Sheap *heap, void *data)
}
}
return TRUE;
return EINA_TRUE;
}
/**
@ -227,7 +227,7 @@ ecore_sheap_extract(Ecore_Sheap *heap)
if (heap->size < 1)
return NULL;
heap->sorted = FALSE;
heap->sorted = EINA_FALSE;
extreme = heap->data[0];
heap->size--;
@ -258,7 +258,7 @@ ecore_sheap_extreme(Ecore_Sheap *heap)
* @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.
*/
@ -267,28 +267,28 @@ ecore_sheap_change(Ecore_Sheap *heap, void *item, void *newval)
{
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.
@ -296,7 +296,7 @@ ecore_sheap_change(Ecore_Sheap *heap, void *item, void *newval)
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;
@ -305,7 +305,7 @@ ecore_sheap_compare_set(Ecore_Sheap *heap, Ecore_Compare_Cb compare)
_ecore_sheap_update_data(heap);
return TRUE;
return EINA_TRUE;
}
/**
@ -356,7 +356,7 @@ ecore_sheap_sort(Ecore_Sheap *heap)
FREE(heap->data);
heap->data = new_data;
heap->size = i;
heap->sorted = TRUE;
heap->sorted = EINA_TRUE;
}
/*

View File

@ -59,12 +59,12 @@ ecore_tree_new(Ecore_Compare_Cb compare_func)
* @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));
@ -73,49 +73,49 @@ ecore_tree_init(Ecore_Tree *new_tree, Ecore_Compare_Cb compare_func)
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;
@ -126,7 +126,7 @@ ecore_tree_node_init(Ecore_Tree_Node *new_node)
new_node->max_left = new_node->max_right = 0;
return TRUE;
return EINA_TRUE;
}
/*
@ -155,14 +155,14 @@ ecore_tree_node_new()
* @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);
@ -171,23 +171,23 @@ ecore_tree_node_destroy(Ecore_Tree_Node *node, Ecore_Free_Cb value_free, Ecore_F
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;
}
/*
@ -210,16 +210,16 @@ ecore_tree_node_value_get(Ecore_Tree_Node *node)
* @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;
}
/*
@ -243,14 +243,14 @@ ecore_tree_node_key_get(Ecore_Tree_Node *node)
* @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))
{
@ -260,7 +260,7 @@ ecore_tree_destroy(Ecore_Tree *tree)
FREE(tree);
return TRUE;
return EINA_TRUE;
}
/**
@ -359,14 +359,14 @@ ecore_tree_closest_smaller_get(Ecore_Tree *tree, const void *key)
* @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)
@ -374,7 +374,7 @@ ecore_tree_set(Ecore_Tree *tree, void *key, void *value)
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
{
@ -389,22 +389,22 @@ ecore_tree_set(Ecore_Tree *tree, void *key, void *value)
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)
@ -428,22 +428,22 @@ ecore_tree_node_add(Ecore_Tree *tree, Ecore_Tree_Node *node)
}
}
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.
@ -547,51 +547,51 @@ ecore_tree_node_remove(Ecore_Tree *tree, Ecore_Tree_Node *node)
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;
}
/**
@ -599,16 +599,16 @@ ecore_tree_empty_is(Ecore_Tree *tree)
* @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);
}
@ -618,16 +618,16 @@ ecore_tree_for_each_node_value(Ecore_Tree *tree, Ecore_For_Each for_each_func, v
* @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);
}
@ -705,7 +705,7 @@ tree_node_balance(Ecore_Tree *tree, Ecore_Tree_Node *top_node)
{
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)
@ -729,7 +729,7 @@ tree_node_balance(Ecore_Tree *tree, Ecore_Tree_Node *top_node)
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. */
@ -738,7 +738,7 @@ tree_node_rotate_right(Ecore_Tree *tree, Ecore_Tree_Node *top_node)
{
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
@ -765,7 +765,7 @@ tree_node_rotate_right(Ecore_Tree *tree, Ecore_Tree_Node *top_node)
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 */
@ -774,7 +774,7 @@ tree_node_rotate_left(Ecore_Tree *tree, Ecore_Tree_Node *top_node)
{
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,
@ -802,7 +802,7 @@ tree_node_rotate_left(Ecore_Tree *tree, Ecore_Tree_Node *top_node)
tree_node_balance(tree, top_node);
tree_node_balance(tree, temp);
return TRUE;
return EINA_TRUE;
}
/*
@ -810,12 +810,12 @@ tree_node_rotate_left(Ecore_Tree *tree, Ecore_Tree_Node *top_node)
* @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);
@ -825,19 +825,19 @@ tree_for_each_node(Ecore_Tree_Node * node, Ecore_For_Each for_each_func, void *u
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);
@ -847,5 +847,5 @@ tree_for_each_node_value(Ecore_Tree_Node *node, Ecore_For_Each for_each_func, vo
for_each_func(node->value, user_data);
return TRUE;
return EINA_TRUE;
}