forked from enlightenment/efl
Delete whitespaces for header and eo files
Summary: Fix whitespaces, indentation, wrap in eina headers. Reviewers: cedric, jeffrey.w.grimshaw, Hermet Reviewed By: Hermet Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2303 Conflicts: src/lib/eina/eina_thread_queue.h
This commit is contained in:
parent
81628abe9f
commit
dbf56936dc
|
@ -40,7 +40,7 @@
|
|||
extern "C"
|
||||
# endif
|
||||
/**
|
||||
* Allocates memory in the stack frame of the caller, so it's automatically
|
||||
* Allocates memory in the stack frame of the caller, so it's automatically
|
||||
* freed when the caller returns. See alloca(3) for detials.
|
||||
*/
|
||||
void *alloca (long);
|
||||
|
|
|
@ -36,34 +36,34 @@
|
|||
*
|
||||
* @brief Functions to handle files and directories.
|
||||
*
|
||||
* This module performs internal housekeeping and utility tasks for Eina_File.
|
||||
* This module performs internal housekeeping and utility tasks for Eina_File.
|
||||
* It also provides the underlying data types for things like file handles, file
|
||||
* maps and file iterators.
|
||||
* maps and file iterators.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
/**
|
||||
* @typedef Eina_File_Map
|
||||
*
|
||||
*
|
||||
* Type definition for an Eina File Map.
|
||||
*
|
||||
*/
|
||||
*
|
||||
*/
|
||||
typedef struct _Eina_File_Map Eina_File_Map;
|
||||
|
||||
/**
|
||||
* @typedef Eina_Lines_Iterator
|
||||
*
|
||||
*
|
||||
* Type definition for an Eina Lines Iterator.
|
||||
*
|
||||
*
|
||||
*/
|
||||
typedef struct _Eina_Lines_Iterator Eina_Lines_Iterator;
|
||||
|
||||
/**
|
||||
* @struct _Eina_File
|
||||
*
|
||||
*
|
||||
* This is the underlying data structure that represents a file in Eina.
|
||||
*
|
||||
*
|
||||
*/
|
||||
struct _Eina_File
|
||||
{
|
||||
|
@ -106,9 +106,9 @@ struct _Eina_File
|
|||
|
||||
/**
|
||||
* @struct _Eina_File_Map
|
||||
*
|
||||
*
|
||||
* This represents a memory mapped region of a file.
|
||||
*
|
||||
*
|
||||
*/
|
||||
struct _Eina_File_Map
|
||||
{
|
||||
|
@ -125,13 +125,13 @@ struct _Eina_File_Map
|
|||
|
||||
/**
|
||||
* @struct _Eina_Lines_Iterator
|
||||
*
|
||||
*
|
||||
* This represents a line iterator a file.
|
||||
*
|
||||
*
|
||||
*/
|
||||
struct _Eina_Lines_Iterator
|
||||
{
|
||||
Eina_Iterator iterator; /**< The iterator itself */
|
||||
Eina_Iterator iterator; /**< The iterator itself */
|
||||
|
||||
Eina_File *fp; /**< The file this iterator is associated with */
|
||||
const char *map; /**< A pointer to the head of the file that has been mapped with mmap(2). */
|
||||
|
@ -174,8 +174,8 @@ struct _Eina_Lines_Iterator
|
|||
|
||||
/**
|
||||
* @brief Determines if a path is relative or absolute.
|
||||
* The implementation simply chekcs if the fist char in the path is '/'. If it
|
||||
* is not, the path is considered relative.
|
||||
* The implementation simply chekcs if the fist char in the path is '/'. If it
|
||||
* is not, the path is considered relative.
|
||||
*
|
||||
* @param path The path to check.
|
||||
|
||||
|
@ -185,16 +185,16 @@ struct _Eina_Lines_Iterator
|
|||
Eina_Bool eina_file_path_relative(const char *path);
|
||||
|
||||
/**
|
||||
* @brief Gets the current directory and optionally appends a path to it.
|
||||
* If a string was passed in via the @p path parameter, it will
|
||||
* be appended to the current working directory. Presumably, this will be a
|
||||
* @brief Gets the current directory and optionally appends a path to it.
|
||||
* If a string was passed in via the @p path parameter, it will
|
||||
* be appended to the current working directory. Presumably, this will be a
|
||||
* relative path.
|
||||
*
|
||||
* @param path The path to append to the current directory.
|
||||
* @param len The length of @p path.
|
||||
*
|
||||
*
|
||||
* @return A pointer to a string that contains the absolute path to the current
|
||||
* working directory plus any path you send in.
|
||||
* working directory plus any path you send in.
|
||||
*
|
||||
*/
|
||||
Eina_Tmpstr *eina_file_current_directory_get(const char *path, size_t len);
|
||||
|
@ -203,18 +203,17 @@ Eina_Tmpstr *eina_file_current_directory_get(const char *path, size_t len);
|
|||
* @brief Cleans up Eina after a file is no longer needed.
|
||||
*
|
||||
* @param path The path of the file.
|
||||
*
|
||||
* @return On success, it will return the @p path string. If @p path is @c NULL,
|
||||
*
|
||||
* @return On success, it will return the @p path string. If @p path is @c NULL,
|
||||
* it will return and empty string.
|
||||
*
|
||||
*/
|
||||
char *eina_file_cleanup(Eina_Tmpstr *path);
|
||||
|
||||
/**
|
||||
* @brief Closes and cleans up after an Eina file.
|
||||
* @brief Closes and cleans up after an Eina file.
|
||||
*
|
||||
* @param file The path of the file.
|
||||
*
|
||||
*
|
||||
*/
|
||||
void eina_file_clean_close(Eina_File *file);
|
||||
|
@ -223,7 +222,6 @@ void eina_file_clean_close(Eina_File *file);
|
|||
* @brief Closes a file from the OS perspective.
|
||||
*
|
||||
* @param file The path of the file.
|
||||
*
|
||||
*
|
||||
*/
|
||||
void eina_file_real_close(Eina_File *file);
|
||||
|
@ -231,28 +229,26 @@ void eina_file_real_close(Eina_File *file);
|
|||
/**
|
||||
* @brief Resets the internal housekeeping structures after a file has changed.
|
||||
* Despite the name, this routine does not write anything to disk. It invalidates
|
||||
* the memory maps for the file. If the file has shrunk, it also adds any mapped
|
||||
* the memory maps for the file. If the file has shrunk, it also adds any mapped
|
||||
* regions past the end of the file to the dead_map.
|
||||
*
|
||||
* @param file The file.
|
||||
* @param length The current length of the file after the change.
|
||||
*
|
||||
*
|
||||
*/
|
||||
*/
|
||||
void eina_file_flush(Eina_File *file, unsigned long int length);
|
||||
|
||||
/**
|
||||
* @brief Removes a mapped region from the file and frees the resources.
|
||||
* This routine will remove a previously mapped region from the internal Eina File
|
||||
* housekeeping and free the resources associated with it. In the case where
|
||||
* housekeeping and free the resources associated with it. In the case where
|
||||
* the map is part of the dead_map, @p free_func will be called to handle the actual
|
||||
* deallocation.
|
||||
*
|
||||
* @param file The file.
|
||||
* @param map The memory mapped region that is to be freed.
|
||||
* @param free_func A pointer to a function that will be called to free up the
|
||||
* resources used by the map.
|
||||
*
|
||||
* @param free_func A pointer to a function that will be called to free up the
|
||||
* resources used by the map.
|
||||
*
|
||||
*/
|
||||
void eina_file_common_map_free(Eina_File *file, void *map,
|
||||
|
@ -299,11 +295,11 @@ void eina_file_virtual_map_free(Eina_File *file, void *map);
|
|||
// Common hash function
|
||||
/**
|
||||
* @brief Get the length of a map key.
|
||||
* @warning This function is not yet implemented. At present it ony returns
|
||||
* @warning This function is not yet implemented. At present it ony returns
|
||||
* @code sizeof (unsigned long int) * 2 @endcode
|
||||
*
|
||||
* @param key The key for which length will be calcualted.
|
||||
*
|
||||
* @param key The key for which length will be calcualted.
|
||||
*
|
||||
* @return The length of the key.
|
||||
*
|
||||
*/
|
||||
|
@ -311,14 +307,14 @@ unsigned int eina_file_map_key_length(const void *key);
|
|||
|
||||
/**
|
||||
* @brief Compares two map keys.
|
||||
* The implementation assumes that @p key1 and @p key2 are both pointers to an
|
||||
* array with 2 elements, as is the case with the Eina file map keys.
|
||||
* The implementation assumes that @p key1 and @p key2 are both pointers to an
|
||||
* array with 2 elements, as is the case with the Eina file map keys.
|
||||
*
|
||||
* @param key1 The first key.
|
||||
* @param key1_length The length of the first key.
|
||||
* @param key1_length The length of the first key.
|
||||
* @param key2 The second key.
|
||||
* @param key2_length The length of the second key.
|
||||
*
|
||||
* @param key2_length The length of the second key.
|
||||
*
|
||||
* @return Positive number if Key1 > Key2, else a negative number. Will return
|
||||
* zero if both elements of the key are exactly the same.
|
||||
*
|
||||
|
@ -330,8 +326,8 @@ int eina_file_map_key_cmp(const unsigned long long int *key1, int key1_length,
|
|||
* @brief Creates a hash from a map key.
|
||||
*
|
||||
* @param key A pointer to the key.
|
||||
* @param key_length The length of the key.
|
||||
*
|
||||
* @param key_length The length of the key.
|
||||
*
|
||||
* @return A key hash.
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -1090,11 +1090,11 @@ EAPI void eina_hash_list_prepend(Eina_Hash *hash, const void *key, const void *d
|
|||
* @since 1.10
|
||||
*/
|
||||
EAPI void eina_hash_list_remove(Eina_Hash *hash, const void *key, const void *data) EINA_ARG_NONNULL(1, 2, 3);
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* Paul Hsieh (http://www.azillionmonkeys.com/qed/hash.html) hash function used by WebCore (http://webkit.org/blog/8/hashtables-part-2/)
|
||||
*
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* Paul Hsieh (http://www.azillionmonkeys.com/qed/hash.html) hash function used by WebCore (http://webkit.org/blog/8/hashtables-part-2/)
|
||||
*
|
||||
* @param key The key to hash
|
||||
* @param len The length of the key
|
||||
* @return The hash value
|
||||
|
@ -1102,20 +1102,21 @@ EAPI void eina_hash_list_remove(Eina_Hash *hash, const void *key, const void *da
|
|||
EAPI int eina_hash_superfast(const char *key,
|
||||
int len) EINA_ARG_NONNULL(1);
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* Hash function first reported by Dan Bernstein many years ago in comp.lang.c
|
||||
*
|
||||
/**
|
||||
* @brief
|
||||
* Hash function first reported by Dan Bernstein many years ago in comp.lang.c
|
||||
*
|
||||
* @param key The key to hash
|
||||
* @param len The length of the key
|
||||
* @return The hash value
|
||||
*/
|
||||
static inline int eina_hash_djb2(const char *key,
|
||||
int len) EINA_ARG_NONNULL(1);
|
||||
/**
|
||||
* @brief
|
||||
* Hash function first reported by Dan Bernstein many years ago in comp.lang.c
|
||||
*
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* Hash function first reported by Dan Bernstein many years ago in comp.lang.c
|
||||
*
|
||||
* @param key The key to hash
|
||||
* @param plen The length of the key
|
||||
* @return The hash value
|
||||
|
@ -1123,20 +1124,21 @@ static inline int eina_hash_djb2(const char *key,
|
|||
static inline int eina_hash_djb2_len(const char *key,
|
||||
int *plen) EINA_ARG_NONNULL(1, 2);
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* Hash function from http://www.concentric.net/~Ttwang/tech/inthash.htm
|
||||
*
|
||||
/**
|
||||
* @brief
|
||||
* Hash function from http://www.concentric.net/~Ttwang/tech/inthash.htm
|
||||
*
|
||||
* @param pkey The key to hash
|
||||
* @param len The length of the key
|
||||
* @return The hash value
|
||||
*/
|
||||
static inline int eina_hash_int32(const unsigned int *pkey,
|
||||
int len) EINA_ARG_NONNULL(1);
|
||||
/**
|
||||
* @brief
|
||||
* Hash function from http://www.concentric.net/~Ttwang/tech/inthash.htm
|
||||
*
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* Hash function from http://www.concentric.net/~Ttwang/tech/inthash.htm
|
||||
*
|
||||
* @param pkey The key to hash
|
||||
* @param len The length of the key
|
||||
* @return The hash value
|
||||
|
@ -1144,10 +1146,10 @@ static inline int eina_hash_int32(const unsigned int *pkey,
|
|||
static inline int eina_hash_int64(const unsigned long long int *pkey,
|
||||
int len) EINA_ARG_NONNULL(1);
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* Hash function from http://sites.google.com/site/murmurhash/
|
||||
*
|
||||
/**
|
||||
* @brief
|
||||
* Hash function from http://sites.google.com/site/murmurhash/
|
||||
*
|
||||
* @param key The key to hash
|
||||
* @param len The length of the key
|
||||
* @return The hash value
|
||||
|
|
|
@ -70,5 +70,5 @@ eina_list_last_data_get(const Eina_List *list)
|
|||
if (!list) return NULL;
|
||||
return eina_list_data_get(eina_list_last(list));
|
||||
}
|
||||
|
||||
|
||||
#endif /* EINA_LIST_INLINE_H_ */
|
||||
|
|
|
@ -3,7 +3,7 @@ typedef struct _Eina_Barrier Eina_Barrier;
|
|||
/** @private */
|
||||
struct _Eina_Barrier
|
||||
{
|
||||
int needed; /**< The number of waiting threads that will cause the barrier to signal and reset. */
|
||||
int needed; /**< The number of waiting threads that will cause the barrier to signal and reset. */
|
||||
int called; /**< The number of threads that are waiting on this barrier. */
|
||||
Eina_Lock cond_lock; /**< The lock for the barrier */
|
||||
Eina_Condition cond; /**< The condition variable for the barrier */
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
# define EINA_INLINE_UNICODE_
|
||||
|
||||
EAPI Eina_Unicode _eina_unicode_utf8_next_get(int ind,
|
||||
unsigned char d,
|
||||
const char *buf,
|
||||
int *iindex);
|
||||
unsigned char d,
|
||||
const char *buf,
|
||||
int *iindex);
|
||||
|
||||
#define ERROR_REPLACEMENT_BASE 0xDC80
|
||||
#define EINA_IS_INVALID_BYTE(x) ((x == 192) || (x == 193) || (x >= 245))
|
||||
|
@ -47,7 +47,7 @@ eina_unicode_utf8_next_get(const char *buf, int *iindex)
|
|||
*iindex = ind;
|
||||
return d;
|
||||
}
|
||||
|
||||
|
||||
if ((d & 0xe0) == 0xc0)
|
||||
{ // 2 byte (11bit) - 110xxxxx 10xxxxxx
|
||||
r = (d & 0x1f) << 6;
|
||||
|
|
|
@ -103,7 +103,7 @@
|
|||
*
|
||||
* To get the data and iterate, use eina_iterator_next(). To call a function on
|
||||
* all the elements of a container, use eina_iterator_foreach().
|
||||
*
|
||||
*
|
||||
* Here an @ref eina_iterator_example_page "example"
|
||||
*/
|
||||
|
||||
|
|
|
@ -33,10 +33,10 @@
|
|||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
/**
|
||||
* @typedef Eina_Lalloc_Alloc
|
||||
* Type definition for the callback used to allocate new items in a lazy allocator.
|
||||
*
|
||||
*
|
||||
*/
|
||||
typedef Eina_Bool (*Eina_Lalloc_Alloc)(void *user_data, int num);
|
||||
/**
|
||||
|
@ -45,10 +45,10 @@ typedef Eina_Bool (*Eina_Lalloc_Alloc)(void *user_data, int num);
|
|||
*/
|
||||
#define EINA_LALLOC_ALLOC(function) ((Eina_Lalloc_Alloc)function)
|
||||
|
||||
/**
|
||||
/**
|
||||
* @typedef Eina_Lalloc_Free
|
||||
* Type definition for the callback used to allocate new items in a lazy allocator.
|
||||
*
|
||||
*
|
||||
*/
|
||||
typedef void (*Eina_Lalloc_Free)(void *user_data);
|
||||
/**
|
||||
|
@ -57,10 +57,10 @@ typedef void (*Eina_Lalloc_Free)(void *user_data);
|
|||
*/
|
||||
#define EINA_LALLOC_FREE(function) ((Eina_Lalloc_Free)function)
|
||||
|
||||
/**
|
||||
/**
|
||||
* @typedef Eina_Lalloc
|
||||
* Public type definition for a lazy allocator.
|
||||
*
|
||||
*
|
||||
*/
|
||||
typedef struct _Eina_Lalloc Eina_Lalloc;
|
||||
|
||||
|
@ -69,9 +69,9 @@ typedef struct _Eina_Lalloc Eina_Lalloc;
|
|||
*
|
||||
* @param data The data for which memory will be allocated.
|
||||
* @param alloc_cb The callback to allocate memory for @p data items.
|
||||
* @param free_cb The callback to free memory for @p data items.
|
||||
* @param free_cb The callback to free memory for @p data items.
|
||||
* @param num_init The number of @p data items to initally allocate space for.
|
||||
*
|
||||
*
|
||||
* @return A new lazy allocator.
|
||||
*
|
||||
*/
|
||||
|
@ -79,7 +79,7 @@ EAPI Eina_Lalloc *eina_lalloc_new(void *data,
|
|||
Eina_Lalloc_Alloc alloc_cb,
|
||||
Eina_Lalloc_Free free_cb,
|
||||
int num_init) EINA_ARG_NONNULL(2, 3);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Free the resources for a lazy allocator.
|
||||
*
|
||||
|
@ -93,18 +93,18 @@ EAPI void eina_lalloc_free(Eina_Lalloc *a) EINA_ARG_NONNULL(1);
|
|||
*
|
||||
* @param a The lazy allocater to add items to.
|
||||
* @param num The number of elements to add.
|
||||
*
|
||||
*
|
||||
* @return EINA_TRUE on success, else EINA_FALSE.
|
||||
*
|
||||
*/
|
||||
EAPI Eina_Bool eina_lalloc_elements_add(Eina_Lalloc *a,
|
||||
int num) EINA_ARG_NONNULL(1);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Allocate one more of whatever the lazy allocator is allocating.
|
||||
*
|
||||
* @param a The lazy allocator to add an item to.
|
||||
*
|
||||
*
|
||||
* @return EINA_TRUE on success, else EINA_FALSE.
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
* include stdio.h so we can use printf.
|
||||
* @skip #include
|
||||
* @until Eina.h
|
||||
*
|
||||
*
|
||||
* Just some boilerplate code, declaring some variable and initializing eina.
|
||||
* @until eina_init
|
||||
* Here we add a sequence of elements to our list. By using append we add
|
||||
|
@ -55,15 +55,15 @@
|
|||
* is done a list is created. The other @b very important detail to notice is
|
||||
* that the return value is attributed to the @a list variable, this needs to
|
||||
* be done every time we use a a function that alters the contents of the list.
|
||||
*
|
||||
*
|
||||
* Now that we have a list with some elements in it we can look at its contents.
|
||||
* @until printf
|
||||
*
|
||||
*
|
||||
* There are many ways of accessing elements in the list, including by its
|
||||
* index:
|
||||
* @until nth
|
||||
* @note It should be noted that the index starts at 0.
|
||||
*
|
||||
*
|
||||
* @ref eina_list_append() is not the only way to add elements to a a list. A
|
||||
* common requirement is to add an element in a specific position this can be
|
||||
* accomplished using @ref eina_list_append_relative() and
|
||||
|
@ -71,7 +71,7 @@
|
|||
* @until zarek
|
||||
* First @a "cain" is added after the second element(remember that indexes are
|
||||
* 0 based) and then we add @a "zarek" after @a "cain".
|
||||
*
|
||||
*
|
||||
* @ref Eina_List also has prepend analogs to append functions we have used so
|
||||
* far:
|
||||
* @until lampkin
|
||||
|
@ -82,11 +82,11 @@
|
|||
* @endhtmlonly
|
||||
* @image rtf eina_list_example_01_b.png
|
||||
* @image latex eina_list_example_01_b.eps "" width=\textwidth
|
||||
*
|
||||
*
|
||||
* Once done using the list it needs to be freed, and since we are done with
|
||||
* eina that also need to be shutdown:
|
||||
* @until }
|
||||
*
|
||||
*
|
||||
* The full source code can be found on the examples folder
|
||||
* on the @ref eina_list_01_c "eina_list_01.c" file.
|
||||
*/
|
||||
|
@ -101,25 +101,25 @@
|
|||
/**
|
||||
* @page eina_list_02_example_page Sorting Eina_List elements
|
||||
* @dontinclude eina_list_02.c
|
||||
*
|
||||
*
|
||||
* If you don't know how to create lists see
|
||||
* @ref eina_list_01_example_page.
|
||||
*
|
||||
*
|
||||
* @skip #include
|
||||
* @until boomer
|
||||
* This is the code we have already seen to create a list. Now if we need to
|
||||
* search the list we can do it like this:
|
||||
* @until return
|
||||
*
|
||||
*
|
||||
* However if searching the list multiple times it probably is better to sort
|
||||
* the list since the sorted_search functions are much faster:
|
||||
* @until return
|
||||
*
|
||||
*
|
||||
* Once the list is sorted it's not a good idea to use append/prepend functions
|
||||
* since that would add the element in the wrong place, instead elements should
|
||||
* be added with @ref eina_list_sorted_insert():
|
||||
* @until sorted_insert
|
||||
*
|
||||
*
|
||||
* A noteworthy use case is adding an element to a list only if it doesn't exist
|
||||
* already, this can accomplished by searching for the element that is closest
|
||||
* to what is being added, and if that doesn't match add:
|
||||
|
@ -127,18 +127,18 @@
|
|||
* @note @ref eina_list_search_sorted_near_list() will tell you not only the
|
||||
* nearest node to what was searched for but how it compares to your term, this
|
||||
* way it is easy to know if you have to add before or after that node.
|
||||
*
|
||||
*
|
||||
* It is sometimes useful to get a portion of the list as another list, here we
|
||||
* take every element that comes after "boomer" and split it into "other_list":
|
||||
* @until split_list
|
||||
*
|
||||
*
|
||||
* It is also possible to add entire lists of elements using
|
||||
* @ref eina_list_sorted_merge():
|
||||
* @until sorted_merge
|
||||
*
|
||||
*
|
||||
* And as always release memory and shutdown eina before ending:
|
||||
* @until }
|
||||
*
|
||||
*
|
||||
* The full source code can be found on the examples folder
|
||||
* on the @ref eina_list_02_c "eina_list_02.c" file.
|
||||
*/
|
||||
|
@ -153,22 +153,22 @@
|
|||
/**
|
||||
* @page eina_list_03_example_page Reordering Eina_List elements
|
||||
* @dontinclude eina_list_03.c
|
||||
*
|
||||
*
|
||||
* If you don't know how to create lists see
|
||||
* @ref eina_list_01_example_page.
|
||||
*
|
||||
*
|
||||
* We start out with code that should be familiar by now:
|
||||
* @skip #include
|
||||
* @until gemenon
|
||||
*
|
||||
*
|
||||
* You can move elements around in a list using @ref eina_list_move() or using
|
||||
* @ref eina_list_promote_list() and @ref eina_list_demote_list() which move a
|
||||
* list node to the head and end of the list respectevely:
|
||||
* @until demote
|
||||
*
|
||||
*
|
||||
* Removing elements from a list can be done with ease:
|
||||
* @until sagitarius
|
||||
*
|
||||
*
|
||||
* To replace an element in the list it is not necessary to remove it and then
|
||||
* add with the new value, it is possible to just change the value of a node:
|
||||
* @until aquarius
|
||||
|
@ -181,10 +181,10 @@
|
|||
* reverse order and print every element to see if worked as expected:
|
||||
* @until iterator_free
|
||||
* @note Always remember to free your iterators when done using them.
|
||||
*
|
||||
*
|
||||
* And as always release memory and shutdown eina before ending:
|
||||
* @until }
|
||||
*
|
||||
*
|
||||
* The full source code can be found on the examples folder
|
||||
* on the @ref eina_list_03_c "eina_list_03.c" file.
|
||||
*/
|
||||
|
@ -223,7 +223,7 @@
|
|||
*
|
||||
* And shut everything down:
|
||||
* @until }
|
||||
*
|
||||
*
|
||||
* The full source code can be found on the examples folder
|
||||
* on the @ref eina_list_04_c "eina_list_04.c" file.
|
||||
*/
|
||||
|
@ -239,13 +239,13 @@
|
|||
* @addtogroup Eina_List_Group List
|
||||
*
|
||||
* @brief These functions provide double linked list management.
|
||||
*
|
||||
*
|
||||
* Eina_List is a doubly linked list. It can store data of any type in the
|
||||
* form of void pointers. It has convenience functions to do all the common
|
||||
* operations which means it should rarely if ever be necessary to directly
|
||||
* access the struct's fields. Nevertheless it can be useful to understand the
|
||||
* inner workings of the data structure being used.
|
||||
*
|
||||
*
|
||||
* @ref Eina_List nodes keep references to the previous node, the next node, its
|
||||
* data and to an accounting structure.
|
||||
*
|
||||
|
@ -259,13 +259,13 @@
|
|||
* @ref Eina_List_Accounting is used to improve the performance of some
|
||||
* functions. It is private and <b>should not</b> be modified. It contains a
|
||||
* reference to the end of the list and the number of elements in the list.
|
||||
*
|
||||
*
|
||||
* @note Every function that modifies the contents of the list returns a pointer
|
||||
* to the head of the list and it is essential that this be pointer be used in
|
||||
* any future references to the list.
|
||||
*
|
||||
*
|
||||
* Most functions have two versions that have the same effect but operate on
|
||||
* different arguments, the @a plain functions operate over data(eg.:
|
||||
* different arguments, the @a plain functions operate over data(eg.:
|
||||
* @ref eina_list_append_relative, @ref eina_list_remove,
|
||||
* @ref eina_list_data_find), the @a list versions of these functions operate
|
||||
* on @ref Eina_List nodes.
|
||||
|
|
|
@ -558,10 +558,10 @@ static inline Eina_Bool eina_barrier_wait(Eina_Barrier *barrier);
|
|||
* @details This function initializes a new #Eina_Spinlock, if spinlocks are available. If
|
||||
* spinlocks are not avialable, it creates a new #Eina_Lock.
|
||||
*
|
||||
*@note Spinlocks are only implemented on the POSIX platform and are only available
|
||||
* @note Spinlocks are only implemented on the POSIX platform and are only available
|
||||
* if #EINA_HAVE_POSIX_SPINLOCK is defined. you get a new #Eina_Lock on All other platforms.
|
||||
*
|
||||
* see eina_spinlock_free()
|
||||
* @see eina_spinlock_free()
|
||||
*/
|
||||
static inline Eina_Bool eina_spinlock_new(Eina_Spinlock *spinlock);
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@
|
|||
*
|
||||
* C is a weak statically typed language, in other words, it just checks for
|
||||
* types during compile time and any cast that makes the compiler believe the
|
||||
* type is correct.
|
||||
* type is correct.
|
||||
*
|
||||
* In the real world code, we often need to deal with casts, either explicit or
|
||||
* implicit, by means of @c void*. We also need to resort to casts when doing
|
||||
|
|
|
@ -47,16 +47,16 @@ typedef struct _Eina_Class Eina_Class;
|
|||
typedef struct _Eina_Object Eina_Object;
|
||||
|
||||
typedef void (*Eina_Class_Callback)(Eina_Class *c,
|
||||
void *object,
|
||||
void *data);
|
||||
void *object,
|
||||
void *data);
|
||||
|
||||
Eina_Class *eina_class_new(const char *name,
|
||||
unsigned int class_size,
|
||||
unsigned int pool_size,
|
||||
Eina_Class_Callback constructor,
|
||||
Eina_Class_Callback destructor,
|
||||
Eina_Class *parent,
|
||||
void *data);
|
||||
unsigned int class_size,
|
||||
unsigned int pool_size,
|
||||
Eina_Class_Callback constructor,
|
||||
Eina_Class_Callback destructor,
|
||||
Eina_Class *parent,
|
||||
void *data);
|
||||
const char *eina_class_name_get(Eina_Class *c);
|
||||
unsigned int eina_class_size_get(Eina_Class *c);
|
||||
unsigned int eina_class_object_size_get(Eina_Class *c);
|
||||
|
@ -65,16 +65,16 @@ void eina_class_repack(Eina_Class *c);
|
|||
|
||||
Eina_Object *eina_object_add(Eina_Class *c);
|
||||
void *eina_object_pointer_get(Eina_Class *c,
|
||||
Eina_Object *object);
|
||||
void eina_object_del(Eina_Class *c,
|
||||
Eina_Object *object);
|
||||
Eina_Object *object);
|
||||
void eina_object_del(Eina_Class *c,
|
||||
Eina_Object *object);
|
||||
|
||||
Eina_Bool eina_object_parent_set(Eina_Class *parent_class, Eina_Object *parent,
|
||||
Eina_Class *object_class, Eina_Object *object);
|
||||
Eina_Class *object_class, Eina_Object *object);
|
||||
Eina_Object *eina_object_parent_get(Eina_Class *c, Eina_Object *object);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
*
|
||||
* Whenever these macros capture an error, EINA_LOG_ERR() will be
|
||||
* called.
|
||||
*
|
||||
*
|
||||
* @see EINA_SAFETY_ON_NULL_RETURN(), EINA_SAFETY_ON_NULL_RETURN_VAL()
|
||||
* and other macros.
|
||||
*
|
||||
|
|
|
@ -233,15 +233,15 @@ typedef Eina_Bool (*Eina_Simple_XML_Attribute_Cb)(void *data, const char *key, c
|
|||
* content is located inside @a buf (does not include tag
|
||||
* start, for instance "<!DOCTYPE value>" the offset points at
|
||||
* "value"), the fifth is the size of the content. Whenever this
|
||||
* function return #EINA_FALSE the parser will abort. @param
|
||||
* data what to give as context to @a func.
|
||||
* function return #EINA_FALSE the parser will abort.
|
||||
* @param data what to give as context to @a func.
|
||||
*
|
||||
* @return #EINA_TRUE on success or #EINA_FALSE if it was aborted by user or
|
||||
* parsing error.
|
||||
*/
|
||||
EAPI Eina_Bool eina_simple_xml_parse(const char *buf, unsigned buflen,
|
||||
Eina_Bool strip,
|
||||
Eina_Simple_XML_Cb func, const void *data);
|
||||
Eina_Bool strip,
|
||||
Eina_Simple_XML_Cb func, const void *data);
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
* parent message queue to 1 or more queues, then this parent will wake up
|
||||
* with a sub queue message, indicating which child queue woke up. This can
|
||||
* be used to implement the ability to listen to multiple queues at once.
|
||||
*
|
||||
*
|
||||
* @since 1.11
|
||||
*/
|
||||
typedef struct _Eina_Thread_Queue Eina_Thread_Queue;
|
||||
|
@ -37,7 +37,7 @@ typedef struct _Eina_Thread_Queue Eina_Thread_Queue;
|
|||
* the first struct member of every message type you have, like
|
||||
* Eina_Thread_Queue_Msg_Sub does. Messages are always 8 byte aligned within
|
||||
* message memory to ensure alignment of all types.
|
||||
*
|
||||
*
|
||||
* @since 1.11
|
||||
*/
|
||||
typedef struct _Eina_Thread_Queue_Msg Eina_Thread_Queue_Msg;
|
||||
|
@ -69,7 +69,7 @@ struct _Eina_Thread_Queue_Msg_Sub
|
|||
* @brief Create a new thread queue
|
||||
*
|
||||
* @return A valid new thread queue, or NULL on failure
|
||||
*
|
||||
*
|
||||
* @since 1.11
|
||||
*/
|
||||
EAPI Eina_Thread_Queue *
|
||||
|
@ -81,9 +81,9 @@ eina_thread_queue_new(void);
|
|||
* This frees a thread queue. It must no longer be in use by anything waiting
|
||||
* on messages or sending them. Any pending messages will be freed without
|
||||
* being processed by a listener.
|
||||
*
|
||||
*
|
||||
* @param thq The thread queue to free
|
||||
*
|
||||
*
|
||||
* @since 1.11
|
||||
*/
|
||||
EAPI void
|
||||
|
@ -102,7 +102,7 @@ eina_thread_queue_free(Eina_Thread_Queue *thq) EINA_ARG_NONNULL(1);
|
|||
* eina_thread_queue_send_done() to complete the send and trigger the other
|
||||
* side. Every message must at least be a Eina_Thread_Queue_Msg in size and
|
||||
* have this structure as the first member (first N bytes) of the message.
|
||||
*
|
||||
*
|
||||
* @since 1.11
|
||||
*/
|
||||
EAPI void *
|
||||
|
@ -116,7 +116,7 @@ eina_thread_queue_send(Eina_Thread_Queue *thq, int size, void **allocref) EINA_A
|
|||
*
|
||||
* This completes the send and triggers the thread queue to wake up any
|
||||
* listeners.
|
||||
*
|
||||
*
|
||||
* @since 1.11
|
||||
*/
|
||||
EAPI void
|
||||
|
@ -136,7 +136,7 @@ eina_thread_queue_send_done(Eina_Thread_Queue *thq, void *allocref) EINA_ARG_NON
|
|||
* and block until a new message comes in, then return. When the message is
|
||||
* finished with, the caller must use eina_thread_queue_wait_done() to indicate
|
||||
* they are done.
|
||||
*
|
||||
*
|
||||
* @since 1.11
|
||||
*/
|
||||
EAPI void *
|
||||
|
@ -150,7 +150,7 @@ eina_thread_queue_wait(Eina_Thread_Queue *thq, void **allocref) EINA_ARG_NONNULL
|
|||
*
|
||||
* This should be used after eina_thread_queue_wait() or
|
||||
* eina_thread_queue_poll() to indicate the caller is done with the message.
|
||||
*
|
||||
*
|
||||
* @since 1.11
|
||||
*/
|
||||
EAPI void
|
||||
|
@ -166,9 +166,9 @@ eina_thread_queue_wait_done(Eina_Thread_Queue *thq, void *allocref) EINA_ARG_NON
|
|||
* This is the same as eina_thread_queue_wait(), but if no messages are
|
||||
* available for reading, it immediately returns NULL tot he caller, without
|
||||
* waiting for a new message to arrive.
|
||||
*
|
||||
*
|
||||
* @see eina_thread_queue_wait()
|
||||
*
|
||||
*
|
||||
* @since 1.11
|
||||
*/
|
||||
EAPI void *
|
||||
|
@ -182,7 +182,7 @@ eina_thread_queue_poll(Eina_Thread_Queue *thq, void **allocref) EINA_ARG_NONNULL
|
|||
*
|
||||
* This returns the number of messages waiting to be fetched with
|
||||
* eina_thread_queue_wait() or eina_thread_queue_poll().
|
||||
*
|
||||
*
|
||||
* @since 1.11
|
||||
*/
|
||||
EAPI int
|
||||
|
@ -199,7 +199,7 @@ eina_thread_queue_pending_get(const Eina_Thread_Queue *thq) EINA_ARG_NONNULL(1);
|
|||
* have the same parent and then just wait on that one parent. This should
|
||||
* be done before any messages are read from or written to the queue. To unset
|
||||
* a parent, just set the parent to NULL.
|
||||
*
|
||||
*
|
||||
* @since 1.11
|
||||
*/
|
||||
EAPI void
|
||||
|
@ -213,7 +213,7 @@ eina_thread_queue_parent_set(Eina_Thread_Queue *thq, Eina_Thread_Queue *thq_pare
|
|||
*
|
||||
* This gets the paren set by eina_thread_queue_parent_get(). If no parent
|
||||
* is set, NULL is returned.
|
||||
*
|
||||
*
|
||||
* @see eina_thread_queue_parent_set()
|
||||
*
|
||||
* @since 1.11
|
||||
|
@ -235,7 +235,7 @@ eina_thread_queue_parent_get(const Eina_Thread_Queue *thq) EINA_ARG_NONNULL(1);
|
|||
*
|
||||
* You should set this up before anything writes to or reads from this
|
||||
* thread queue.
|
||||
*
|
||||
*
|
||||
* @since 1.11
|
||||
*/
|
||||
EAPI void
|
||||
|
@ -251,7 +251,7 @@ eina_thread_queue_fd_set(Eina_Thread_Queue *thq, int fd) EINA_ARG_NONNULL(1);
|
|||
* by default returns -1 (no fd set).
|
||||
*
|
||||
* @see eina_thread_queue_fd_set()
|
||||
*
|
||||
*
|
||||
* @since 1.11
|
||||
*/
|
||||
EAPI int
|
||||
|
|
|
@ -55,33 +55,33 @@
|
|||
|
||||
/**
|
||||
* @page eina_tmpstr_ppage
|
||||
*
|
||||
*
|
||||
* Eina tmpstr is intended for being able to conveniently pass strings back
|
||||
* to a calling parent without having to use single static buffers (which
|
||||
* don't work with multiple threads or when returning multilpe times as
|
||||
* parameters to a single function.
|
||||
*
|
||||
*
|
||||
* The traditional way to "return" a string in C is either to provide a buffer
|
||||
* as a paramater to return it in, return a pointer to a single static buffer,
|
||||
* which has issues, or return a duplicated string. All cases are inconvenient
|
||||
* and return special handling. This is intended to make this easier. Now you
|
||||
* can do something like this:
|
||||
*
|
||||
*
|
||||
* @code
|
||||
* Eina_Tmpstr *my_homedir(void) {
|
||||
* return eina_tmpstr_add(getenv("HOME"));
|
||||
* }
|
||||
*
|
||||
*
|
||||
* Eina_Tmpstr *my_tmpdir(void) {
|
||||
* return eina_tmpstr_add(getenv("TMP"));
|
||||
* }
|
||||
*
|
||||
*
|
||||
* void my_movefile(Eina_Tmpstr *src, Eina_Tmpstr *dst) {
|
||||
* rename(src, dst);
|
||||
* eina_tmpstr_del(src);
|
||||
* eina_tmpstr_del(dst);
|
||||
* }
|
||||
*
|
||||
*
|
||||
* char buf[500];
|
||||
* my_movefile(my_homedir(), my_tmpdir());
|
||||
* my_movefile("/tmp/file", "/tmp/newname");
|
||||
|
@ -89,7 +89,7 @@
|
|||
* snprintf(buf, sizeof(buf), "/tmp/%i.file", rand());
|
||||
* my_movefile("/tmp.file", buf);
|
||||
* @endcode
|
||||
*
|
||||
*
|
||||
* Notice that you can interchange standard C strings (static ones or even
|
||||
* generated buffers) with tmpstrings. The Eina_Tmpstr type is merely a
|
||||
* type marker letting you know that the function will clean up those
|
||||
|
@ -122,62 +122,62 @@ typedef const char Eina_Tmpstr;
|
|||
|
||||
/**
|
||||
* @brief Add a new temporary string based on the input string.
|
||||
*
|
||||
*
|
||||
* @param str This is the input stringthat is copied into the temp string.
|
||||
* @return A pointer to the tmp string that is a standard C string.
|
||||
*
|
||||
*
|
||||
* When you add a temporary string (tmpstr) it is expected to have a very
|
||||
* short lifespan, and at any one time only a few of these are intended to
|
||||
* exist. This is not intended for longer term storage of strings. The
|
||||
* intended use is the ability to safely pass strings as return values from
|
||||
* functions directly into parameters of new functions and then have the
|
||||
* string be cleaned up automatically by the caller.
|
||||
*
|
||||
*
|
||||
* If @p str is NULL, or no memory space exists to store the tmpstr, then
|
||||
* NULL will be returned, otherwise a valid string pointer will be returned
|
||||
* that you can treat as any other C string (eg strdup(tmpstr) or
|
||||
* printf("%s\n", tmpstr) etc.). This string should be considered read-only
|
||||
* and immutable, and when youa re done with the string yo should delete it
|
||||
* with eina_tmpstr_del().
|
||||
*
|
||||
*
|
||||
* Example usage:
|
||||
*
|
||||
*
|
||||
* @code
|
||||
* Eina_Tmpstr *my_homedir(void) {
|
||||
* return eina_tmpstr_add(getenv("HOME"));
|
||||
* }
|
||||
*
|
||||
*
|
||||
* void my_rmfile(Eina_Tmpstr *str) {
|
||||
* if (!str) return;
|
||||
* unlink(str);
|
||||
* eina_tmpstr_del(str);
|
||||
* }
|
||||
*
|
||||
*
|
||||
* my_rmfile(my_homedir());
|
||||
* my_rmfile("/tmp/file");
|
||||
* @endcode
|
||||
*
|
||||
*
|
||||
* @see eina_tmpstr_del()
|
||||
* @see eina_tmpstr_add_length()
|
||||
*
|
||||
*
|
||||
* @since 1.8.0
|
||||
*/
|
||||
EAPI Eina_Tmpstr *eina_tmpstr_add(const char *str) EINA_WARN_UNUSED_RESULT;
|
||||
|
||||
/**
|
||||
* @brief Add a new temporary string based on the input string and length.
|
||||
*
|
||||
*
|
||||
* @param str This is the input stringthat is copied into the temp string.
|
||||
* @param length This is the maximum length and the allocated length of the temp string.
|
||||
* @return A pointer to the tmp string that is a standard C string.
|
||||
*
|
||||
*
|
||||
* When you add a temporary string (tmpstr) it is expected to have a very
|
||||
* short lifespan, and at any one time only a few of these are intended to
|
||||
* exist. This is not intended for longer term storage of strings. The
|
||||
* intended use is the ability to safely pass strings as return values from
|
||||
* functions directly into parameters of new functions and then have the
|
||||
* string be cleaned up automatically by the caller.
|
||||
*
|
||||
*
|
||||
* If @p str is NULL, or no memory space exists to store the tmpstr, then
|
||||
* NULL will be returned, otherwise a valid string pointer will be returned
|
||||
* that you can treat as any other C string (eg strdup(tmpstr) or
|
||||
|
@ -192,7 +192,7 @@ EAPI Eina_Tmpstr *eina_tmpstr_add(const char *str) EINA_WARN_UNUSED_RESULT;
|
|||
* with length == strlen(str).
|
||||
* @see eina_tmpstr_del()
|
||||
* @see eina_tmpstr_add()
|
||||
*
|
||||
*
|
||||
* @since 1.8.0
|
||||
*/
|
||||
EAPI Eina_Tmpstr *eina_tmpstr_add_length(const char *str, size_t length);
|
||||
|
@ -223,16 +223,16 @@ EAPI size_t eina_tmpstr_len(Eina_Tmpstr *tmpstr);
|
|||
|
||||
/**
|
||||
* @brief Delete the temporary string if it is one, or ignore it if it is not.
|
||||
*
|
||||
*
|
||||
* @param tmpstr This is any C string pointer, but if it is a tmp string
|
||||
* it is freed.
|
||||
*
|
||||
*
|
||||
* This will delete the given temporary string @p tmpstr if it is a valid
|
||||
* temporary string, or otherwise it will ignore it and do nothing so this
|
||||
* can be used safely with non-temporary strings.
|
||||
*
|
||||
*
|
||||
* @see eina_tmpstr_add()
|
||||
*
|
||||
*
|
||||
* @since 1.8.0
|
||||
*/
|
||||
EAPI void eina_tmpstr_del(Eina_Tmpstr *tmpstr) EINA_ARG_NONNULL(1);
|
||||
|
|
|
@ -226,11 +226,11 @@
|
|||
/**
|
||||
* @def EINA_ARG_NONNULL
|
||||
* Used to warn when the specified arguments of the function are @c NULL.
|
||||
*
|
||||
*
|
||||
* @param ... Oridnals of the parameters to check for nullity (1..n)
|
||||
*
|
||||
*
|
||||
* @returns Nothing, but Doxygen will complain if it's not documented :-P
|
||||
*
|
||||
*
|
||||
*/
|
||||
# define EINA_ARG_NONNULL(...)
|
||||
|
||||
|
|
Loading…
Reference in New Issue