Cleanup Doxygens Warnings - eina

Warnings resolved for:
eina_clist.h
eina_file.h
eina_hash.h
eina_inlist.h
eina_lalloc.h
eina_lock.h

SVN revision: 70156
This commit is contained in:
Jonas M. Gastal 2012-04-12 17:44:45 +00:00
parent 2aeedca6c1
commit 6122b8a8de
10 changed files with 289 additions and 28 deletions

View File

@ -303,24 +303,48 @@ static inline void eina_clist_move_tail(Eina_Clist *dst, Eina_Clist *src);
static inline void eina_clist_move_head(Eina_Clist *dst, Eina_Clist *src);
/**
* iterate through the list
* @def EINA_CLIST_FOR_EACH
* @brief Iterate through the list.
* @param cursor The pointer to be used during the interation.
* @param list The list to be interated.
*/
#define EINA_CLIST_FOR_EACH(cursor,list) \
for ((cursor) = (list)->next; (cursor) != (list); (cursor) = (cursor)->next)
/* iterate through the list, with safety against removal */
/**
* @def EINA_CLIST_FOR_EACH_SAFE
* @brief Iterate through the list, with safety against removal.
* @param cursor The pointer to be used during the interation.
* @param cursor2 The auxiliar pointer to be used during the interation.
* @param list The list to be interated.
*/
#define EINA_CLIST_FOR_EACH_SAFE(cursor, cursor2, list) \
for ((cursor) = (list)->next, (cursor2) = (cursor)->next; \
(cursor) != (list); \
(cursor) = (cursor2), (cursor2) = (cursor)->next)
/* iterate through the list using a list entry */
/**
* @def EINA_CLIST_FOR_EACH_ENTRY
* @brief Iterate through the list using a list entry.
* @param elem The element to be used.
* @param list The list to be iterated.
* @param type The type of the list.
* @param field The field of the element.
*/
#define EINA_CLIST_FOR_EACH_ENTRY(elem, list, type, field) \
for ((elem) = EINA_CLIST_ENTRY((list)->next, type, field); \
&(elem)->field != (list); \
(elem) = EINA_CLIST_ENTRY((elem)->field.next, type, field))
/* iterate through the list using a list entry, with safety against removal */
/**
* @def EINA_CLIST_FOR_EACH_ENTRY_SAFE
* @brief Iterate through the list using a list entry, with safety against removal.
* @param cursor The pointer to be used during the interation.
* @param cursor2 The auxiliar pointer to be used during the interation.
* @param list The list to be interated.
* @param type The type of the list.
* @param field The field of the element.
*/
#define EINA_CLIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field) \
for ((cursor) = EINA_CLIST_ENTRY((list)->next, type, field), \
(cursor2) = EINA_CLIST_ENTRY((cursor)->field.next, type, field); \
@ -328,23 +352,50 @@ static inline void eina_clist_move_head(Eina_Clist *dst, Eina_Clist *src);
(cursor) = (cursor2), \
(cursor2) = EINA_CLIST_ENTRY((cursor)->field.next, type, field))
/* iterate through the list in reverse order */
/**
* @def EINA_CLIST_FOR_EACH_REV
* @brief Iterate through the list in reverse order.
* @param cursor The pointer to be used during the interation.
* @param list The list to be interated.
*/
#define EINA_CLIST_FOR_EACH_REV(cursor,list) \
for ((cursor) = (list)->prev; (cursor) != (list); (cursor) = (cursor)->prev)
/* iterate through the list in reverse order, with safety against removal */
/**
* @def EINA_CLIST_FOR_EACH_SAFE_REV
* @brief Iterate through the list in reverse order, with safety against removal.
* @param cursor The pointer to be used during the interation.
* @param cursor2 The auxiliar pointer to be used during the interation.
* @param list The list to be interated.
*/
#define EINA_CLIST_FOR_EACH_SAFE_REV(cursor, cursor2, list) \
for ((cursor) = (list)->prev, (cursor2) = (cursor)->prev; \
(cursor) != (list); \
(cursor) = (cursor2), (cursor2) = (cursor)->prev)
/* iterate through the list in reverse order using a list entry */
/**
* @def EINA_CLIST_FOR_EACH_ENTRY_REV
* @brief Iterate through the list in reverse order using a list entry.
* @param elem The element to be used.
* @param list The list to be iterated.
* @param type The type of the list.
* @param field The field of the element.
*/
#define EINA_CLIST_FOR_EACH_ENTRY_REV(elem, list, type, field) \
for ((elem) = EINA_CLIST_ENTRY((list)->prev, type, field); \
&(elem)->field != (list); \
(elem) = EINA_CLIST_ENTRY((elem)->field.prev, type, field))
/* iterate through the list in reverse order using a list entry, with safety against removal */
/**
* @def EINA_CLIST_FOR_EACH_ENTRY_SAFE_REV
* @brief Iterate through the list in reverse order using a list entry, with safety against
* removal.
* @param cursor The pointer to be used during the interation.
* @param cursor2 The auxiliar pointer to be used during the interation.
* @param list The list to be interated.
* @param type The type of the list.
* @param field The field of the element.
*/
#define EINA_CLIST_FOR_EACH_ENTRY_SAFE_REV(cursor, cursor2, list, type, field) \
for ((cursor) = EINA_CLIST_ENTRY((list)->prev, type, field), \
(cursor2) = EINA_CLIST_ENTRY((cursor)->field.prev, type, field); \
@ -352,11 +403,21 @@ static inline void eina_clist_move_head(Eina_Clist *dst, Eina_Clist *src);
(cursor) = (cursor2), \
(cursor2) = EINA_CLIST_ENTRY((cursor)->field.prev, type, field))
/* macros for statically initialized lists */
/**
* @def EINA_CLIST_INIT
* @brief Macros for statically initialized lists.
* @param list The list to be used.
*/
#undef EINA_CLIST_INIT
#define EINA_CLIST_INIT(list) { &(list), &(list) }
/* get pointer to object containing list element */
/**
* @def EINA_CLIST_ENTRY
* @brief Get pointer to object containing list element.
* @param elem The element to be used.
* @param type The type of the element.
* @param field The field of the element.
*/
#undef EINA_CLIST_ENTRY
#define EINA_CLIST_ENTRY(elem, type, field) \
((type *)((char *)(elem) - (unsigned long)(&((type *)0)->field)))

View File

@ -125,7 +125,10 @@ typedef enum {
} Eina_File_Type;
typedef struct _Eina_File Eina_File;
/**
* @typedef Eina_File_Populate
* File access type used in Eina_File_Direct_info.
*/
typedef enum {
EINA_FILE_RANDOM, /**< Advise random memory access to the mapped memory. */
EINA_FILE_SEQUENTIAL, /**< Advise sequential memory access to the mapped memory. */
@ -142,6 +145,10 @@ typedef enum {
* is a possibility that PATH_MAX could be more than 8192. if anyone spots
* a path_max that is bigger - let us know, but, for now we will assume
* it never happens */
/**
* @def EINA_PATH_MAX
* @brief The constant defined as the highest value for PATH_MAX.
*/
#define EINA_PATH_MAX 8192
/**
* @struct _Eina_File_Direct_Info

View File

@ -296,10 +296,22 @@ struct _Eina_Hash_Tuple
};
typedef unsigned int (*Eina_Key_Length)(const void *key);
/**
* @def EINA_KEY_LENGTH
* @param Function The function used to hash calculation.
*/
#define EINA_KEY_LENGTH(Function) ((Eina_Key_Length)Function)
typedef int (*Eina_Key_Cmp)(const void *key1, int key1_length, const void *key2, int key2_length);
/**
* @def EINA_KEY_CMP
* @param Function The function used to hash calculation.
*/
#define EINA_KEY_CMP(Function) ((Eina_Key_Cmp)Function)
typedef int (*Eina_Key_Hash)(const void *key, int key_length);
/**
* @def EINA_KEY_HASH
* @param Function The function used to hash calculation.
*/
#define EINA_KEY_HASH(Function) ((Eina_Key_Hash)Function)
typedef Eina_Bool (*Eina_Hash_Foreach)(const Eina_Hash *hash, const void *key, void *data, void *fdata);

View File

@ -773,9 +773,18 @@ EAPI Eina_Inlist *eina_inlist_sorted_state_insert(Eina_Inlist *list,
EAPI Eina_Inlist *eina_inlist_sort(Eina_Inlist *head, Eina_Compare_Cb func);
/* This two macros are helpers for the _FOREACH ones, don't use them */
/**
* @def _EINA_INLIST_OFFSET
* @param ref The reference to be used.
*/
#define _EINA_INLIST_OFFSET(ref) ((char *)&(ref)->__in_list - (char *)(ref))
#if !defined(__cplusplus)
/**
* @def _EINA_INLIST_CONTAINER
* @param ref The reference to be used.
* @param ptr The pointer to be used.
*/
#define _EINA_INLIST_CONTAINER(ref, ptr) (void *)((char *)(ptr) - \
_EINA_INLIST_OFFSET(ref))
#else
@ -791,10 +800,21 @@ EAPI Eina_Inlist *eina_inlist_sort(Eina_Inlist *head, Eina_Compare_Cb func);
#define EINA_INLIST_FOREACH(list, l) \
for (l = NULL, l = (list ? _EINA_INLIST_CONTAINER(l, list) : NULL); l; \
l = (EINA_INLIST_GET(l)->next ? _EINA_INLIST_CONTAINER(l, EINA_INLIST_GET(l)->next) : NULL))
/**
* @def EINA_INLIST_FOREACH_SAFE
* @param list The first list to be used.
* @param list2 The second list to be used.
* @param l The auxiliar variable to be used.
*/
#define EINA_INLIST_FOREACH_SAFE(list, list2, l) \
for (l = (list ? _EINA_INLIST_CONTAINER(l, list) : NULL), list2 = l ? ((EINA_INLIST_GET(l) ? EINA_INLIST_GET(l)->next : NULL)) : NULL; \
l; \
l = _EINA_INLIST_CONTAINER(l, list2), list2 = list2 ? list2->next : NULL)
/**
* @def EINA_INLIST_REVERSE_FOREACH
* @param list The list to be reversed.
* @param l The auxiliar variable to be used.
*/
#define EINA_INLIST_REVERSE_FOREACH(list, l) \
for (l = NULL, l = (list ? _EINA_INLIST_CONTAINER(l, list->last) : NULL); \
l; l = (EINA_INLIST_GET(l)->prev ? _EINA_INLIST_CONTAINER(l, EINA_INLIST_GET(l)->prev) : NULL))

View File

@ -34,8 +34,16 @@
*/
typedef Eina_Bool (*Eina_Lalloc_Alloc)(void *user_data, int num);
/**
* @def EINA_LALLOC_ALLOC
* @param function The function to allocate.
*/
#define EINA_LALLOC_ALLOC(function) ((Eina_Lalloc_Alloc)function)
typedef void (*Eina_Lalloc_Free)(void *user_data);
/**
* @def EINA_LALLOC_FREE
* @param function The function to free.
*/
#define EINA_LALLOC_FREE(function) ((Eina_Lalloc_Free)function)
typedef struct _Eina_Lalloc Eina_Lalloc;

View File

@ -138,7 +138,16 @@ static inline Eina_Bool eina_semaphore_release(Eina_Semaphore *sem, int count_re
} \
} while (0)
#else
/**
* @def EINA_MAIN_LOOP_CHECK_RETURN_VAL
* @brief The macro doesn't do anything unless EINA_HAVE_DEBUG_THREADS is defined.
* @param val The value to be returned.
*/
# define EINA_MAIN_LOOP_CHECK_RETURN_VAL(val)
/**
* @def EINA_MAIN_LOOP_CHECK_RETURN
* @brief The macro doesn't do anything unless EINA_HAVE_DEBUG_THREADS is defined.
*/
# define EINA_MAIN_LOOP_CHECK_RETURN
#endif

View File

@ -1403,6 +1403,15 @@ struct _Eina_Model_Type
void *__extension_ptr3; /**< not to be used */
};
/**
* @def EINA_MODEL_TYPE_INIT
* @param name The name of the model to be used.
* @param type The type of the model to be used.
* @param private_type The private type to be used.
* @param parent The parent of the model to be used.
* @param interfaces The interfaces to be used.
* @param events The events that the model will support.
*/
#define EINA_MODEL_TYPE_INIT(name, type, private_type, parent, interfaces, events) \
{EINA_MODEL_TYPE_VERSION, \
sizeof(private_type), \
@ -1442,7 +1451,14 @@ struct _Eina_Model_Type
NULL, \
NULL \
}
/**
* @def EINA_MODEL_TYPE_INIT_NOPRIVATE
* @param name The name of the model to be used.
* @param type The type of the model to be used.
* @param parent The parent of the model to be used.
* @param interfaces The interfaces to be used.
* @param events The events that the model will support.
*/
#define EINA_MODEL_TYPE_INIT_NOPRIVATE(name, type, parent, interfaces, events) \
{EINA_MODEL_TYPE_VERSION, \
0, \
@ -1482,7 +1498,10 @@ struct _Eina_Model_Type
NULL, \
NULL \
}
/**
* @def EINA_MODEL_TYPE_INIT_NULL
* @brief NULL value eina model type.
*/
#define EINA_MODEL_TYPE_INIT_NULL \
{0, \
0, \
@ -2041,9 +2060,20 @@ EAPI const void *eina_model_method_offset_resolve(const Eina_Model *model, unsig
* @since 1.2
*/
EAPI const void *eina_model_type_method_offset_resolve(const Eina_Model_Type *type, const Eina_Model *model, unsigned int offset) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT EINA_PURE;
/**
* @def eina_model_method_resolve
* @param model The model to be resolved.
* @param struct_type The struct of the element to be resolved.
* @param method The method to be resolved.
*/
#define eina_model_method_resolve(model, struct_type, method) eina_model_method_offset_resolve((model), offsetof(struct_type, method))
/**
* @def eina_model_type_method_resolve
* @param type The type of the model to be resolved.
* @param model The model to be resolved.
* @param struct_type The struct of the element to be resolved.
* @param method The method to be resolved.
*/
#define eina_model_type_method_resolve(type, model, struct_type, method) eina_model_type_method_offset_resolve((type), (model), offsetof(struct_type, method))
/**
@ -2104,7 +2134,14 @@ struct _Eina_Model_Interface
void *__extension_ptr2; /**< not to be used @internal */
void *__extension_ptr3; /**< not to be used @internal */
};
/**
* @def EINA_MODEL_INTERFACE_INIT
* @param name The name of the interface to be created.
* @param iface The interface to be used.
* @param private_type The private type to be used.
* @param parent The parent of the interface to be created.
* @param events The events that the interface will support.
*/
#define EINA_MODEL_INTERFACE_INIT(name, iface, private_type, parent, events) \
{EINA_MODEL_INTERFACE_VERSION, \
sizeof(private_type), \
@ -2123,7 +2160,13 @@ struct _Eina_Model_Interface
NULL, \
NULL \
}
/**
* @def EINA_MODEL_INTERFACE_INIT_NOPRIVATE
* @param name The name of the interface to be created.
* @param iface The interface to be used.
* @param parent The parent of the interface to be created.
* @param events The events that the interface will support.
*/
#define EINA_MODEL_INTERFACE_INIT_NOPRIVATE(name, iface, parent, events) \
{EINA_MODEL_INTERFACE_VERSION, \
0, \
@ -2142,7 +2185,10 @@ struct _Eina_Model_Interface
NULL, \
NULL \
}
/**
* @def EINA_MODEL_INTERFACE_INIT_NULL
* @brief NULL value eina model interface.
*/
#define EINA_MODEL_INTERFACE_INIT_NULL \
{0, \
0, \
@ -2226,7 +2272,13 @@ EAPI Eina_Bool eina_model_interface_copy(const Eina_Model_Interface *iface,
EAPI Eina_Bool eina_model_interface_deep_copy(const Eina_Model_Interface *iface,
const Eina_Model *src,
Eina_Model *dst) EINA_ARG_NONNULL(1, 2, 3);
/**
* @def eina_model_interface_method_resolve
* @param iface The interface to be resolved.
* @param model The model of the interface to be resolved.
* @param struct_type The struct of the element to be resolved.
* @param method The method of the interface to be resolved.
*/
#define eina_model_interface_method_resolve(iface, model, struct_type, method) eina_model_interface_method_offset_resolve((iface), (model), offsetof(struct_type, method))
/**

View File

@ -215,30 +215,73 @@ EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED;
#else /* no safety checks */
/**
* @def EINA_SAFETY_ON_NULL_RETURN
* @brief The macro doesn't do anything unless EINA_SAFETY_CHECKS is defined.
* @param exp The expression to be evaluated.
*/
#define EINA_SAFETY_ON_NULL_RETURN(exp) \
do { (void)(!(exp)); } while (0)
/**
* @def EINA_SAFETY_ON_NULL_RETURN_VAL
* @brief The macro doesn't do anything unless EINA_SAFETY_CHECKS is defined.
* @param exp The expression to be evaluated.
* @param val The value to be returned.
*/
#define EINA_SAFETY_ON_NULL_RETURN_VAL(exp, val) \
do { if (0 && !(exp)) { (void)val; } } while (0)
/**
* @def EINA_SAFETY_ON_NULL_GOTO
* @brief The macro doesn't do anything unless EINA_SAFETY_CHECKS is defined.
* @param exp The expression to be evaluated.
* @param label The label to jump to.
*/
#define EINA_SAFETY_ON_NULL_GOTO(exp, label) \
do { if (0 && (exp) == NULL) { goto label; } } while (0)
/**
* @def EINA_SAFETY_ON_TRUE_RETURN
* @brief The macro doesn't do anything unless EINA_SAFETY_CHECKS is defined.
* @param exp The expression to be evaluated.
*/
#define EINA_SAFETY_ON_TRUE_RETURN(exp) \
do { (void)(exp); } while (0)
/**
* @def EINA_SAFETY_ON_TRUE_RETURN_VAL
* @brief The macro doesn't do anything unless EINA_SAFETY_CHECKS is defined.
* @param exp The expression to be evaluated.
* @param val The value to be returned.
*/
#define EINA_SAFETY_ON_TRUE_RETURN_VAL(exp, val) \
do { if (0 && (exp)) { (void)val; } } while (0)
/**
* @def EINA_SAFETY_ON_TRUE_GOTO
* @brief The macro doesn't do anything unless EINA_SAFETY_CHECKS is defined.
* @param exp The expression to be evaluated.
* @param label The label to jump to.
*/
#define EINA_SAFETY_ON_TRUE_GOTO(exp, label) \
do { if (0 && (exp)) { goto label; } } while (0)
/**
* @def EINA_SAFETY_ON_FALSE_RETURN
* @brief The macro doesn't do anything unless EINA_SAFETY_CHECKS is defined.
* @param exp The expression to be evaluated.
*/
#define EINA_SAFETY_ON_FALSE_RETURN(exp) \
do { (void)(!(exp)); } while (0)
/**
* @def EINA_SAFETY_ON_FALSE_RETURN_VAL
* @brief The macro doesn't do anything unless EINA_SAFETY_CHECKS is defined.
* @param exp The expression to be evaluated.
* @param val The value to be returned.
*/
#define EINA_SAFETY_ON_FALSE_RETURN_VAL(exp, val) \
do { if (0 && !(exp)) { (void)val; } } while (0)
/**
* @def EINA_SAFETY_ON_FALSE_GOTO
* @brief The macro doesn't do anything unless EINA_SAFETY_CHECKS is defined.
* @param exp The expression to be evaluated.
* @param label The label to jump to.
*/
#define EINA_SAFETY_ON_FALSE_GOTO(exp, label) \
do { if (0 && !(exp)) { goto label; } } while (0)

View File

@ -116,7 +116,10 @@ struct _Eina_Simple_XML_Node_Data
size_t length;
char data[];
};
/**
* @typedef _Eina_Simple_XML_Type
* a simple XML type.
*/
typedef enum _Eina_Simple_XML_Type
{
EINA_SIMPLE_XML_OPEN = 0, /*!< \<tag attribute="value"\> */

View File

@ -53,6 +53,10 @@
# define EAPI
# endif
# else
/**
* @def EAPI
* @brief Used to export functions(by changing visibility).
*/
# define EAPI
# endif
#endif
@ -205,14 +209,56 @@
* Used to warn when the function is considered as deprecated.
*/
# define EINA_DEPRECATED
/**
* @def EINA_MALLOC
* @brief EINA_MALLOC is used to tell the compiler that a function may be treated
* as if any non-NULL pointer it returns cannot alias any other pointer valid when
* the function returns and that the memory has undefined content.
*/
# define EINA_MALLOC
/**
* @def EINA_PURE
* @brief EINA_PURE is used to tell the compiler this functions has no effects
* except the return value and their return value depends only on the parameters
* and/or global variables.
*/
# define EINA_PURE
/**
* @def EINA_PRINTF
* @param fmt The format to be used.
* @param arg The argument to be used.
*/
# define EINA_PRINTF(fmt, arg)
/**
* @def EINA_SCANF
* @param fmt The format to be used.
* @param arg The argument to be used.
*/
# define EINA_SCANF(fmt, arg)
/**
* @def EINA_FORMAT
* @param fmt The format to be used.
*/
# define EINA_FORMAT(fmt)
/**
* @def EINA_CONST
* @brief Attribute from gcc to prevent the function to read/modify any global memory.
*/
# define EINA_CONST
/**
* @def EINA_NOINSTRUMENT
* @brief Attribute from gcc to disable instrumentation for a specific function.
*/
# define EINA_NOINSTRUMENT
/**
* @def EINA_UNLIKELY
* @param exp The expression to be used.
*/
# define EINA_UNLIKELY(exp) exp
/**
* @def EINA_LIKELY
* @param exp The expression to be used.
*/
# define EINA_LIKELY(exp) exp
#endif /* ! __GNUC__ && ! _WIN32 && ! __SUNPRO_C */