BOW DOWN BEFORE ME, FOR I HAVE MADE THESE HEADERS READABLE ONCE MORE!

SVN revision: 51065
This commit is contained in:
Mike Blumenkrantz 2010-08-13 06:36:33 +00:00
parent 3618cf1227
commit 44eeac0e1e
25 changed files with 223 additions and 746 deletions

View File

@ -51,11 +51,8 @@ typedef Eina_Bool (*Eina_Accessor_Lock_Callback)(Eina_Accessor *it);
struct _Eina_Accessor
{
Eina_Accessor_Get_At_Callback get_at EINA_ARG_NONNULL(1,
3)
EINA_WARN_UNUSED_RESULT;
Eina_Accessor_Get_Container_Callback get_container EINA_ARG_NONNULL(1)
EINA_WARN_UNUSED_RESULT;
Eina_Accessor_Get_At_Callback get_at EINA_ARG_NONNULL(1, 3) EINA_WARN_UNUSED_RESULT;
Eina_Accessor_Get_Container_Callback get_container EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
Eina_Accessor_Free_Callback free EINA_ARG_NONNULL(1);
Eina_Accessor_Lock_Callback lock EINA_WARN_UNUSED_RESULT;
@ -66,27 +63,22 @@ struct _Eina_Accessor
};
#define FUNC_ACCESSOR_GET_AT(Function) ((Eina_Accessor_Get_At_Callback)Function)
#define FUNC_ACCESSOR_GET_CONTAINER(Function) (( \
Eina_Accessor_Get_Container_Callback) \
Function)
#define FUNC_ACCESSOR_GET_CONTAINER(Function) ((Eina_Accessor_Get_Container_Callback)Function)
#define FUNC_ACCESSOR_FREE(Function) ((Eina_Accessor_Free_Callback)Function)
#define FUNC_ACCESSOR_LOCK(Function) ((Eina_Accessor_Lock_Callback)Function)
EAPI void eina_accessor_free (Eina_Accessor *accessor)
EINA_ARG_NONNULL(1);
EAPI void eina_accessor_free(Eina_Accessor *accessor) EINA_ARG_NONNULL(1);
EAPI Eina_Bool eina_accessor_data_get (Eina_Accessor *accessor,
unsigned int position,
void **data) EINA_ARG_NONNULL(1);
EAPI void * eina_accessor_container_get (Eina_Accessor *accessor)
EINA_ARG_NONNULL(1) EINA_PURE;
EAPI Eina_Bool eina_accessor_data_get(Eina_Accessor *accessor,
unsigned int position,
void **data) EINA_ARG_NONNULL(1);
EAPI void * eina_accessor_container_get(Eina_Accessor *accessor) EINA_ARG_NONNULL(1) EINA_PURE;
EAPI void eina_accessor_over (Eina_Accessor *accessor,
Eina_Each_Cb cb,
unsigned int start,
unsigned int end,
const void *fdata)
EINA_ARG_NONNULL(1, 2);
EAPI void eina_accessor_over(Eina_Accessor *accessor,
Eina_Each_Cb cb,
unsigned int start,
unsigned int end,
const void *fdata) EINA_ARG_NONNULL(1, 2);
EAPI Eina_Bool eina_accessor_lock(Eina_Accessor *accessor) EINA_ARG_NONNULL(1);
EAPI Eina_Bool eina_accessor_unlock(Eina_Accessor *accessor) EINA_ARG_NONNULL(1);

View File

@ -68,12 +68,10 @@
EAPI Eina_Bool eina_binshare_init(void);
EAPI Eina_Bool eina_binshare_shutdown(void);
EAPI const void *eina_binshare_add_length(const void *obj,
unsigned int olen)
EINA_WARN_UNUSED_RESULT;
unsigned int olen) EINA_WARN_UNUSED_RESULT;
EAPI const void *eina_binshare_ref(const void *obj);
EAPI void eina_binshare_del(const void *obj);
EAPI int eina_binshare_length(const void *obj) EINA_CONST
EINA_WARN_UNUSED_RESULT;
EAPI int eina_binshare_length(const void *obj) EINA_CONST EINA_WARN_UNUSED_RESULT;
EAPI void eina_binshare_dump(void);
/**

View File

@ -39,23 +39,12 @@
*/
typedef struct _Eina_Counter Eina_Counter;
EAPI Eina_Counter *
eina_counter_new(
const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
EAPI void
eina_counter_free(
Eina_Counter *counter) EINA_ARG_NONNULL(1);
EAPI Eina_Counter * eina_counter_new( const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
EAPI void eina_counter_free( Eina_Counter *counter) EINA_ARG_NONNULL(1);
EAPI void
eina_counter_start(
Eina_Counter *counter) EINA_ARG_NONNULL(1);
EAPI void
eina_counter_stop(
Eina_Counter *counter,
int specimen) EINA_ARG_NONNULL(1);
EAPI char *
eina_counter_dump(
Eina_Counter *counter) EINA_ARG_NONNULL(1);
EAPI void eina_counter_start( Eina_Counter *counter) EINA_ARG_NONNULL(1);
EAPI void eina_counter_stop( Eina_Counter *counter, int specimen) EINA_ARG_NONNULL(1);
EAPI char * eina_counter_dump( Eina_Counter *counter) EINA_ARG_NONNULL(1);
/**
* @}

View File

@ -47,10 +47,8 @@ typedef int Eina_Error;
*/
EAPI extern Eina_Error EINA_ERROR_OUT_OF_MEMORY;
EAPI Eina_Error eina_error_msg_register(const char *msg) EINA_ARG_NONNULL(1)
EINA_WARN_UNUSED_RESULT;
EAPI Eina_Error eina_error_msg_static_register(const char *msg)
EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
EAPI Eina_Error eina_error_msg_register(const char *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
EAPI Eina_Error eina_error_msg_static_register(const char *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
EAPI Eina_Bool eina_error_msg_modify(Eina_Error error,
const char *msg) EINA_ARG_NONNULL(1, 2);
EAPI Eina_Error eina_error_get(void);

View File

@ -58,19 +58,11 @@ typedef void (*Eina_File_Dir_List_Cb)(const char *name, const char *path,
#define EINA_FILE_DIR_LIST_CB(function) ((Eina_File_Dir_List_Cb)function)
EAPI Eina_Bool
eina_file_dir_list(
const char *dir,
Eina_Bool recursive,
Eina_File_Dir_List_Cb cb,
void *data) EINA_ARG_NONNULL(1, 3);
eina_file_dir_list(const char *dir, Eina_Bool recursive, Eina_File_Dir_List_Cb cb, void *data) EINA_ARG_NONNULL(1, 3);
EAPI Eina_Array *
eina_file_split(
char *path) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1)
EINA_MALLOC;
eina_file_split(char *path) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
EAPI Eina_Iterator *
eina_file_ls(
const char *dir) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1)
EINA_MALLOC;
eina_file_ls(const char *dir) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
typedef struct _Eina_File_Direct_Info Eina_File_Direct_Info;
@ -83,10 +75,7 @@ struct _Eina_File_Direct_Info
const struct dirent *dirent;
};
EAPI Eina_Iterator *
eina_file_direct_ls(
const char *dir) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1)
EINA_MALLOC;
EAPI Eina_Iterator *eina_file_direct_ls(const char *dir) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
/**
* @}

View File

@ -26,10 +26,10 @@ eina_rbtree_inline_lookup(const Eina_Rbtree *root, const void *key, int length,
while (root)
{
result = cmp(root, key, length, (void*) data);
if (result == 0) return (Eina_Rbtree*) root;
result = cmp(root, key, length, (void*) data);
if (result == 0) return (Eina_Rbtree*) root;
root = root->son[result < 0 ? 0 : 1];
root = root->son[result < 0 ? 0 : 1];
}
return NULL;

View File

@ -66,41 +66,27 @@ struct _Eina_Inlist
offsetof(type, __in_list)))
EAPI Eina_Inlist * eina_inlist_append(Eina_Inlist *in_list,
Eina_Inlist *in_item) EINA_ARG_NONNULL(2)
EINA_WARN_UNUSED_RESULT;
Eina_Inlist *in_item) EINA_ARG_NONNULL(2) EINA_WARN_UNUSED_RESULT;
EAPI Eina_Inlist * eina_inlist_prepend(Eina_Inlist *in_list,
Eina_Inlist *in_item) EINA_ARG_NONNULL(
2) EINA_WARN_UNUSED_RESULT;
Eina_Inlist *in_item) EINA_ARG_NONNULL(2) EINA_WARN_UNUSED_RESULT;
EAPI Eina_Inlist * eina_inlist_append_relative(Eina_Inlist *in_list,
Eina_Inlist *in_item,
Eina_Inlist *in_relative)
EINA_ARG_NONNULL(2) EINA_WARN_UNUSED_RESULT;
Eina_Inlist *in_relative) EINA_ARG_NONNULL(2) EINA_WARN_UNUSED_RESULT;
EAPI Eina_Inlist * eina_inlist_prepend_relative(Eina_Inlist *in_list,
Eina_Inlist *in_item,
Eina_Inlist *in_relative)
EINA_ARG_NONNULL(2) EINA_WARN_UNUSED_RESULT;
Eina_Inlist *in_relative) EINA_ARG_NONNULL(2) EINA_WARN_UNUSED_RESULT;
EAPI Eina_Inlist * eina_inlist_remove(Eina_Inlist *in_list,
Eina_Inlist *in_item) EINA_ARG_NONNULL(1,
2)
EINA_WARN_UNUSED_RESULT;
Eina_Inlist *in_item) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
EAPI Eina_Inlist * eina_inlist_find(Eina_Inlist *in_list,
Eina_Inlist *in_item) EINA_ARG_NONNULL(2)
EINA_WARN_UNUSED_RESULT;
Eina_Inlist *in_item) EINA_ARG_NONNULL(2) EINA_WARN_UNUSED_RESULT;
EAPI Eina_Inlist * eina_inlist_promote(Eina_Inlist *list,
Eina_Inlist *item) EINA_ARG_NONNULL(1,
2)
EINA_WARN_UNUSED_RESULT;
Eina_Inlist *item) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
EAPI Eina_Inlist * eina_inlist_demote(Eina_Inlist *list,
Eina_Inlist *item) EINA_ARG_NONNULL(1,
2)
EINA_WARN_UNUSED_RESULT;
EAPI unsigned int eina_inlist_count(const Eina_Inlist *list)
EINA_WARN_UNUSED_RESULT;
Eina_Inlist *item) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
EAPI unsigned int eina_inlist_count(const Eina_Inlist *list) EINA_WARN_UNUSED_RESULT;
EAPI Eina_Iterator *eina_inlist_iterator_new(const Eina_Inlist *in_list)
EINA_MALLOC EINA_WARN_UNUSED_RESULT;
EAPI Eina_Accessor *eina_inlist_accessor_new(const Eina_Inlist *in_list)
EINA_MALLOC EINA_WARN_UNUSED_RESULT;
EAPI Eina_Iterator *eina_inlist_iterator_new(const Eina_Inlist *in_list) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
EAPI Eina_Accessor *eina_inlist_accessor_new(const Eina_Inlist *in_list) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
/* This two macros are helpers for the _FOREACH ones, don't use them */
#define _EINA_INLIST_OFFSET(ref) ((char *)&(ref)->__in_list - (char *)(ref))

View File

@ -49,11 +49,8 @@ typedef Eina_Bool (*Eina_Iterator_Lock_Callback)(Eina_Iterator *it);
struct _Eina_Iterator
{
Eina_Iterator_Next_Callback next EINA_ARG_NONNULL(1,
2)
EINA_WARN_UNUSED_RESULT;
Eina_Iterator_Get_Container_Callback get_container EINA_ARG_NONNULL(1)
EINA_WARN_UNUSED_RESULT;
Eina_Iterator_Next_Callback next EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
Eina_Iterator_Get_Container_Callback get_container EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
Eina_Iterator_Free_Callback free EINA_ARG_NONNULL(1);
Eina_Iterator_Lock_Callback lock EINA_WARN_UNUSED_RESULT;
@ -71,20 +68,15 @@ struct _Eina_Iterator
#define FUNC_ITERATOR_FREE(Function) ((Eina_Iterator_Free_Callback)Function)
#define FUNC_ITERATOR_LOCK(Function) ((Eina_Iterator_Lock_Callback)Function)
EAPI void eina_iterator_free (Eina_Iterator *iterator)
EINA_ARG_NONNULL(1);
EAPI void eina_iterator_free (Eina_Iterator *iterator) EINA_ARG_NONNULL(1);
EAPI void * eina_iterator_container_get (Eina_Iterator *iterator)
EINA_ARG_NONNULL(1) EINA_PURE;
EAPI void * eina_iterator_container_get (Eina_Iterator *iterator) EINA_ARG_NONNULL(1) EINA_PURE;
EAPI Eina_Bool eina_iterator_next (Eina_Iterator *iterator,
void **data) EINA_ARG_NONNULL(1,
2)
EINA_WARN_UNUSED_RESULT;
void **data) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
EAPI void eina_iterator_foreach (Eina_Iterator *iterator,
Eina_Each_Cb callback,
const void *fdata)
EINA_ARG_NONNULL(1, 2);
const void *fdata) EINA_ARG_NONNULL(1, 2);
EAPI Eina_Bool eina_iterator_lock(Eina_Iterator *iterator) EINA_ARG_NONNULL(1);
EAPI Eina_Bool eina_iterator_unlock(Eina_Iterator *iterator) EINA_ARG_NONNULL(1);

View File

@ -303,11 +303,9 @@ EAPI int
eina_log_abort_on_critical_level_get(void) EINA_WARN_UNUSED_RESULT;
EAPI void
eina_log_domain_level_set(const char *domain_name, int level) EINA_ARG_NONNULL(
1);
eina_log_domain_level_set(const char *domain_name, int level) EINA_ARG_NONNULL(1);
EAPI int
eina_log_domain_level_get(const char *domain_name) EINA_WARN_UNUSED_RESULT
EINA_ARG_NONNULL(1);
eina_log_domain_level_get(const char *domain_name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
EAPI int
eina_log_domain_registered_level_get(int domain) EINA_WARN_UNUSED_RESULT;
static inline Eina_Bool
@ -318,8 +316,7 @@ eina_log_domain_level_check(int domain, int level);
* Logging domains
*/
EAPI int
eina_log_domain_register(const char *name, const char *color) EINA_ARG_NONNULL(
1);
eina_log_domain_register(const char *name, const char *color) EINA_ARG_NONNULL(1);
EAPI void
eina_log_domain_unregister(int domain);
@ -333,8 +330,7 @@ eina_log_print(int domain,
const char *function,
int line,
const char *fmt,
...) EINA_ARG_NONNULL(3, 4, 6) EINA_PRINTF(6,
7) EINA_NOINSTRUMENT;
...) EINA_ARG_NONNULL(3, 4, 6) EINA_PRINTF(6, 7) EINA_NOINSTRUMENT;
EAPI void
eina_log_vprint(int domain,
Eina_Log_Level level,

View File

@ -41,14 +41,11 @@ typedef unsigned int Eina_Magic;
* @typedef Eina_Magic
* An abstract type for a magic number.
*/
EAPI const char *eina_magic_string_get(Eina_Magic magic) EINA_PURE
EINA_WARN_UNUSED_RESULT;
EAPI const char *eina_magic_string_get(Eina_Magic magic) EINA_PURE EINA_WARN_UNUSED_RESULT;
EAPI Eina_Bool eina_magic_string_set(Eina_Magic magic,
const char *magic_name) EINA_ARG_NONNULL(
2);
const char *magic_name) EINA_ARG_NONNULL(2);
EAPI Eina_Bool eina_magic_string_static_set(Eina_Magic magic,
const char *magic_name)
EINA_ARG_NONNULL(2);
const char *magic_name) EINA_ARG_NONNULL(2);
/**
* @def EINA_MAGIC_NONE

View File

@ -84,56 +84,26 @@ EAPI Eina_Bool eina_matrixsparse_size_set(Eina_Matrixsparse *m,
unsigned long cols);
/* data getting */
EAPI Eina_Bool eina_matrixsparse_cell_idx_get(
const Eina_Matrixsparse *m,
unsigned long row,
unsigned long col,
Eina_Matrixsparse_Cell **cell);
EAPI void * eina_matrixsparse_cell_data_get(
const Eina_Matrixsparse_Cell *cell);
EAPI void * eina_matrixsparse_data_idx_get(
const Eina_Matrixsparse *m,
unsigned long row,
unsigned long col);
EAPI Eina_Bool eina_matrixsparse_cell_position_get(
const Eina_Matrixsparse_Cell *cell,
unsigned long *row,
unsigned long *col);
EAPI Eina_Bool eina_matrixsparse_cell_idx_get(const Eina_Matrixsparse *m, unsigned long row, unsigned long col, Eina_Matrixsparse_Cell **cell);
EAPI void * eina_matrixsparse_cell_data_get(const Eina_Matrixsparse_Cell *cell);
EAPI void * eina_matrixsparse_data_idx_get(const Eina_Matrixsparse *m, unsigned long row, unsigned long col);
EAPI Eina_Bool eina_matrixsparse_cell_position_get(const Eina_Matrixsparse_Cell *cell, unsigned long *row, unsigned long *col);
/* data setting */
EAPI Eina_Bool eina_matrixsparse_cell_data_replace(
Eina_Matrixsparse_Cell *cell,
const void *data,
void **p_old);
EAPI Eina_Bool eina_matrixsparse_cell_data_set(
Eina_Matrixsparse_Cell *cell,
const void *data);
EAPI Eina_Bool eina_matrixsparse_data_idx_replace(Eina_Matrixsparse *m,
unsigned long row,
unsigned long col,
const void *data,
void **p_old);
EAPI Eina_Bool eina_matrixsparse_data_idx_set(Eina_Matrixsparse *m,
unsigned long row,
unsigned long col,
const void *data);
EAPI Eina_Bool eina_matrixsparse_cell_data_replace(Eina_Matrixsparse_Cell *cell, const void *data, void **p_old);
EAPI Eina_Bool eina_matrixsparse_cell_data_set(Eina_Matrixsparse_Cell *cell, const void *data);
EAPI Eina_Bool eina_matrixsparse_data_idx_replace(Eina_Matrixsparse *m, unsigned long row, unsigned long col, const void *data, void **p_old);
EAPI Eina_Bool eina_matrixsparse_data_idx_set(Eina_Matrixsparse *m, unsigned long row, unsigned long col, const void *data);
/* data deleting */
EAPI Eina_Bool eina_matrixsparse_row_idx_clear(Eina_Matrixsparse *m,
unsigned long row);
EAPI Eina_Bool eina_matrixsparse_column_idx_clear(Eina_Matrixsparse *m,
unsigned long col);
EAPI Eina_Bool eina_matrixsparse_cell_idx_clear(Eina_Matrixsparse *m,
unsigned long row,
unsigned long col);
EAPI Eina_Bool eina_matrixsparse_cell_clear(
Eina_Matrixsparse_Cell *cell);
EAPI Eina_Bool eina_matrixsparse_row_idx_clear(Eina_Matrixsparse *m, unsigned long row);
EAPI Eina_Bool eina_matrixsparse_column_idx_clear(Eina_Matrixsparse *m, unsigned long col);
EAPI Eina_Bool eina_matrixsparse_cell_idx_clear(Eina_Matrixsparse *m, unsigned long row, unsigned long col);
EAPI Eina_Bool eina_matrixsparse_cell_clear(Eina_Matrixsparse_Cell *cell);
/* iterators */
EAPI Eina_Iterator *eina_matrixsparse_iterator_new(
const Eina_Matrixsparse *m);
EAPI Eina_Iterator *eina_matrixsparse_iterator_complete_new(
const Eina_Matrixsparse *m);
EAPI Eina_Iterator *eina_matrixsparse_iterator_new(const Eina_Matrixsparse *m);
EAPI Eina_Iterator *eina_matrixsparse_iterator_complete_new(const Eina_Matrixsparse *m);
/**
* @}

View File

@ -49,49 +49,20 @@ typedef struct _Eina_Mempool_Backend Eina_Mempool_Backend;
EAPI extern Eina_Error EINA_ERROR_NOT_MEMPOOL_MODULE;
EAPI Eina_Mempool *
eina_mempool_add(
const char *module,
const char *context,
const char *options,
...) EINA_MALLOC EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
EAPI void
eina_mempool_del(
Eina_Mempool *mp) EINA_ARG_NONNULL(1);
EAPI Eina_Mempool * eina_mempool_add(const char *module,const char *context,const char *options,...) EINA_MALLOC EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
EAPI void eina_mempool_del(Eina_Mempool *mp) EINA_ARG_NONNULL(1);
static inline void *
eina_mempool_realloc(
Eina_Mempool *mp,
void *element,
unsigned int size) EINA_ARG_NONNULL(1)
EINA_WARN_UNUSED_RESULT;
static inline void *
eina_mempool_malloc(
Eina_Mempool *mp,
unsigned int size) EINA_MALLOC EINA_ARG_NONNULL(1)
EINA_WARN_UNUSED_RESULT;
static inline void
eina_mempool_free(
Eina_Mempool *mp,
void *element) EINA_ARG_NONNULL(1);
static inline void * eina_mempool_realloc(Eina_Mempool *mp,void *element,unsigned int size) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
static inline void * eina_mempool_malloc(Eina_Mempool *mp,unsigned int size) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
static inline void eina_mempool_free(Eina_Mempool *mp,void *element) EINA_ARG_NONNULL(1);
EAPI void
eina_mempool_gc(
Eina_Mempool *mp) EINA_ARG_NONNULL(1);
EAPI void
eina_mempool_statistics(
Eina_Mempool *mp) EINA_ARG_NONNULL(1);
EAPI void eina_mempool_gc(Eina_Mempool *mp) EINA_ARG_NONNULL(1);
EAPI void eina_mempool_statistics(Eina_Mempool *mp) EINA_ARG_NONNULL(1);
EAPI Eina_Bool
eina_mempool_register(
Eina_Mempool_Backend *be) EINA_ARG_NONNULL(1);
EAPI void
eina_mempool_unregister(
Eina_Mempool_Backend *be) EINA_ARG_NONNULL(1);
EAPI Eina_Bool eina_mempool_register(Eina_Mempool_Backend *be) EINA_ARG_NONNULL(1);
EAPI void eina_mempool_unregister(Eina_Mempool_Backend *be) EINA_ARG_NONNULL(1);
EAPI unsigned int
eina_mempool_alignof(
unsigned int size);
EAPI unsigned int eina_mempool_alignof(unsigned int size);
#include "eina_inline_mempool.x"

View File

@ -94,8 +94,7 @@ typedef void (*Eina_Module_Shutdown)(void);
* (__eina_module_shutdown). It must be of signature
* #Eina_Module_Shutdown
*/
#define EINA_MODULE_SHUTDOWN(f) EAPI Eina_Module_Shutdown \
__eina_module_shutdown = &f
#define EINA_MODULE_SHUTDOWN(f) EAPI Eina_Module_Shutdown __eina_module_shutdown = &f
/**
* @var EINA_ERROR_WRONG_MODULE
@ -110,53 +109,27 @@ extern EAPI Eina_Error EINA_ERROR_WRONG_MODULE;
extern EAPI Eina_Error EINA_ERROR_MODULE_INIT_FAILED;
EAPI Eina_Module *
eina_module_new(
const char *file) EINA_MALLOC EINA_WARN_UNUSED_RESULT
EINA_ARG_NONNULL(
1);
eina_module_new(const char *file) EINA_MALLOC EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
EAPI Eina_Bool
eina_module_free(
Eina_Module *m) EINA_ARG_NONNULL(1);
eina_module_free(Eina_Module *m) EINA_ARG_NONNULL(1);
EAPI Eina_Bool
eina_module_load(
Eina_Module *module) EINA_ARG_NONNULL(1);
eina_module_load(Eina_Module *module) EINA_ARG_NONNULL(1);
EAPI Eina_Bool
eina_module_unload(
Eina_Module *m) EINA_ARG_NONNULL(1);
eina_module_unload(Eina_Module *m) EINA_ARG_NONNULL(1);
EAPI void *
eina_module_symbol_get(
const Eina_Module *module,
const char *symbol) EINA_PURE
EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
eina_module_symbol_get(const Eina_Module *module, const char *symbol) EINA_PURE EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
EAPI const char *
eina_module_file_get(
const Eina_Module *m) EINA_PURE EINA_WARN_UNUSED_RESULT
EINA_ARG_NONNULL(
1);
eina_module_file_get(const Eina_Module *m) EINA_PURE EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
EAPI char *
eina_module_symbol_path_get(
const void *symbol,
const char *sub_dir) EINA_PURE EINA_MALLOC
EINA_ARG_NONNULL(1, 2);
eina_module_symbol_path_get(const void *symbol, const char *sub_dir) EINA_PURE EINA_MALLOC EINA_ARG_NONNULL(1, 2);
EAPI char *
eina_module_environment_path_get(
const char *env,
const char *sub_dir) EINA_PURE EINA_MALLOC
EINA_ARG_NONNULL(1, 2);
eina_module_environment_path_get(const char *env, const char *sub_dir) EINA_PURE EINA_MALLOC EINA_ARG_NONNULL(1, 2);
EAPI Eina_Array *
eina_module_arch_list_get(
Eina_Array *array,
const char *path,
const char *arch);
eina_module_arch_list_get(Eina_Array *array, const char *path, const char *arch);
EAPI Eina_Array *
eina_module_list_get(
Eina_Array *array,
const char *path,
unsigned int recursive,
Eina_Module_Cb cb,
void *data) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
eina_module_list_get(Eina_Array *array, const char *path, unsigned int recursive, Eina_Module_Cb cb, void *data) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
EAPI void
eina_module_list_load(Eina_Array *list) EINA_ARG_NONNULL(1);
EAPI void
@ -164,9 +137,7 @@ eina_module_list_unload(Eina_Array *list) EINA_ARG_NONNULL(1);
EAPI void
eina_module_list_free(Eina_Array *list) EINA_ARG_NONNULL(1);
EAPI Eina_Module *
eina_module_find(const Eina_Array *array, const char *module) EINA_ARG_NONNULL(
1,
2);
eina_module_find(const Eina_Array *array, const char *module) EINA_ARG_NONNULL(1, 2);
/**
* @}

View File

@ -32,16 +32,11 @@ typedef enum {
EINA_QUAD_BOTH
} Eina_Quad_Direction;
typedef Eina_Quad_Direction (*Eina_Quad_Callback)(const void *object,
size_t middle);
typedef Eina_Quad_Direction (*Eina_Quad_Callback)(const void *object, size_t middle);
EAPI Eina_QuadTree * eina_quadtree_new(size_t w, size_t h,
Eina_Quad_Callback vertical,
Eina_Quad_Callback horizontal);
EAPI Eina_QuadTree * eina_quadtree_new(size_t w, size_t h, Eina_Quad_Callback vertical, Eina_Quad_Callback horizontal);
EAPI void eina_quadtree_free(Eina_QuadTree *q);
EAPI void eina_quadtree_resize(Eina_QuadTree *q,
size_t w,
size_t h);
EAPI void eina_quadtree_resize(Eina_QuadTree *q, size_t w, size_t h);
EAPI void eina_quadtree_cycle(Eina_QuadTree *q);
EAPI void eina_quadtree_increase(Eina_QuadTree_Item *object);
@ -52,8 +47,7 @@ EAPI Eina_Bool eina_quadtree_change(Eina_QuadTree_Item *object);
EAPI Eina_Bool eina_quadtree_hide(Eina_QuadTree_Item *object);
EAPI Eina_Bool eina_quadtree_show(Eina_QuadTree_Item *object);
EAPI Eina_Inlist * eina_quadtree_collide(Eina_QuadTree *q,
int x, int y, int w, int h);
EAPI Eina_Inlist * eina_quadtree_collide(Eina_QuadTree *q, int x, int y, int w, int h);
EAPI void * eina_quadtree_object(Eina_Inlist *list);
#endif

View File

@ -99,10 +99,7 @@ struct _Eina_Rbtree
* @typedef Eina_Rbtree_Cmp_Node_Cb
* Function used compare two nodes and see which direction to navigate.
*/
typedef Eina_Rbtree_Direction (*Eina_Rbtree_Cmp_Node_Cb)(const Eina_Rbtree *
left,
const Eina_Rbtree *
right, void *data);
typedef Eina_Rbtree_Direction (*Eina_Rbtree_Cmp_Node_Cb)(const Eina_Rbtree *left, const Eina_Rbtree *right, void *data);
/**
* @def EINA_RBTREE_CMP_NODE_CB
@ -114,8 +111,7 @@ typedef Eina_Rbtree_Direction (*Eina_Rbtree_Cmp_Node_Cb)(const Eina_Rbtree *
* @typedef Eina_Rbtree_Cmp_Key_Cb
* Function used compare node with a given key of specified length.
*/
typedef int (*Eina_Rbtree_Cmp_Key_Cb)(const Eina_Rbtree *node, const void *key,
int length, void *data);
typedef int (*Eina_Rbtree_Cmp_Key_Cb)(const Eina_Rbtree *node, const void *key, int length, void *data);
/**
* @def EINA_RBTREE_CMP_KEY_CB
* Cast using #Eina_Rbtree_Cmp_Key_Cb
@ -133,47 +129,15 @@ typedef void (*Eina_Rbtree_Free_Cb)(Eina_Rbtree *node, void *data);
*/
#define EINA_RBTREE_FREE_CB(Function) ((Eina_Rbtree_Free_Cb)Function)
EAPI Eina_Rbtree *
eina_rbtree_inline_insert(
Eina_Rbtree *root,
Eina_Rbtree *node,
Eina_Rbtree_Cmp_Node_Cb cmp,
const void *data) EINA_ARG_NONNULL(2,
3) EINA_WARN_UNUSED_RESULT;
EAPI Eina_Rbtree *
eina_rbtree_inline_remove(
Eina_Rbtree *root,
Eina_Rbtree *node,
Eina_Rbtree_Cmp_Node_Cb cmp,
const void *data) EINA_ARG_NONNULL(2,
3) EINA_WARN_UNUSED_RESULT;
EAPI void
eina_rbtree_delete(
Eina_Rbtree *root,
Eina_Rbtree_Free_Cb func,
void *data) EINA_ARG_NONNULL(2);
EAPI Eina_Rbtree * eina_rbtree_inline_insert(Eina_Rbtree *root,Eina_Rbtree *node,Eina_Rbtree_Cmp_Node_Cb cmp,const void *data) EINA_ARG_NONNULL(2, 3) EINA_WARN_UNUSED_RESULT;
EAPI Eina_Rbtree * eina_rbtree_inline_remove(Eina_Rbtree *root,Eina_Rbtree *node,Eina_Rbtree_Cmp_Node_Cb cmp,const void *data) EINA_ARG_NONNULL(2, 3) EINA_WARN_UNUSED_RESULT;
EAPI void eina_rbtree_delete(Eina_Rbtree *root,Eina_Rbtree_Free_Cb func,void *data) EINA_ARG_NONNULL(2);
static inline Eina_Rbtree *
eina_rbtree_inline_lookup(
const Eina_Rbtree *root,
const void *key,
int length,
Eina_Rbtree_Cmp_Key_Cb cmp,
const void *data) EINA_PURE EINA_ARG_NONNULL(2,
4) EINA_WARN_UNUSED_RESULT;
static inline Eina_Rbtree * eina_rbtree_inline_lookup(const Eina_Rbtree *root,const void *key,int length,Eina_Rbtree_Cmp_Key_Cb cmp,const void *data) EINA_PURE EINA_ARG_NONNULL(2, 4) EINA_WARN_UNUSED_RESULT;
EAPI Eina_Iterator *
eina_rbtree_iterator_prefix(
const Eina_Rbtree *root) EINA_MALLOC
EINA_WARN_UNUSED_RESULT;
EAPI Eina_Iterator *
eina_rbtree_iterator_infix(
const Eina_Rbtree *root) EINA_MALLOC
EINA_WARN_UNUSED_RESULT;
EAPI Eina_Iterator *
eina_rbtree_iterator_postfix(
const Eina_Rbtree *root) EINA_MALLOC
EINA_WARN_UNUSED_RESULT;
EAPI Eina_Iterator * eina_rbtree_iterator_prefix(const Eina_Rbtree *root) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
EAPI Eina_Iterator * eina_rbtree_iterator_infix(const Eina_Rbtree *root) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
EAPI Eina_Iterator * eina_rbtree_iterator_postfix(const Eina_Rbtree *root) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
#include "eina_inline_rbtree.x"

View File

@ -6,7 +6,7 @@
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
@ -38,109 +38,35 @@
*/
typedef struct _Eina_Rectangle
{
int x; /**< top-left x co-ordinate of rectangle */
int y; /**< top-left y co-ordinate of rectangle */
int w; /**< width of rectangle */
int h; /**< height of rectangle */
int x; /**< top-left x co-ordinate of rectangle */
int y; /**< top-left y co-ordinate of rectangle */
int w; /**< width of rectangle */
int h; /**< height of rectangle */
} Eina_Rectangle;
typedef struct _Eina_Rectangle_Pool Eina_Rectangle_Pool;
static inline int
eina_spans_intersect(
int c1,
int l1,
int c2,
int l2) EINA_WARN_UNUSED_RESULT;
static inline Eina_Bool
eina_rectangle_is_empty(
const Eina_Rectangle *r) EINA_ARG_NONNULL(1)
EINA_WARN_UNUSED_RESULT;
static inline void
eina_rectangle_coords_from(
Eina_Rectangle *r,
int x,
int y,
int w,
int h) EINA_ARG_NONNULL(1);
static inline Eina_Bool
eina_rectangles_intersect(
const Eina_Rectangle *r1,
const Eina_Rectangle *r2) EINA_ARG_NONNULL(1,
2) EINA_WARN_UNUSED_RESULT;
static inline Eina_Bool
eina_rectangle_xcoord_inside(
const Eina_Rectangle *r,
int x) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
static inline Eina_Bool
eina_rectangle_ycoord_inside(
const Eina_Rectangle *r,
int y) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
static inline Eina_Bool
eina_rectangle_coords_inside(
const Eina_Rectangle *r,
int x,
int y) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
static inline void
eina_rectangle_union(
Eina_Rectangle *dst,
const Eina_Rectangle *src) EINA_ARG_NONNULL(1, 2);
static inline Eina_Bool
eina_rectangle_intersection(
Eina_Rectangle *dst,
const Eina_Rectangle *src) EINA_ARG_NONNULL(1,
2) EINA_WARN_UNUSED_RESULT;
static inline void
eina_rectangle_rescale_in(
const Eina_Rectangle *out,
const Eina_Rectangle *in,
Eina_Rectangle *res) EINA_ARG_NONNULL(1, 2, 3);
static inline void
eina_rectangle_rescale_out(
const Eina_Rectangle *out,
const Eina_Rectangle *in,
Eina_Rectangle *res) EINA_ARG_NONNULL(1, 2, 3);
static inline int eina_spans_intersect(int c1, int l1, int c2, int l2) EINA_WARN_UNUSED_RESULT;
static inline Eina_Bool eina_rectangle_is_empty(const Eina_Rectangle *r) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
static inline void eina_rectangle_coords_from(Eina_Rectangle *r, int x, int y, int w, int h) EINA_ARG_NONNULL(1);
static inline Eina_Bool eina_rectangles_intersect(const Eina_Rectangle *r1, const Eina_Rectangle *r2) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
static inline Eina_Bool eina_rectangle_xcoord_inside(const Eina_Rectangle *r, int x) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
static inline Eina_Bool eina_rectangle_ycoord_inside(const Eina_Rectangle *r, int y) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
static inline Eina_Bool eina_rectangle_coords_inside(const Eina_Rectangle *r, int x, int y) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
static inline void eina_rectangle_union(Eina_Rectangle *dst, const Eina_Rectangle *src) EINA_ARG_NONNULL(1, 2);
static inline Eina_Bool eina_rectangle_intersection(Eina_Rectangle *dst, const Eina_Rectangle *src) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
static inline void eina_rectangle_rescale_in(const Eina_Rectangle *out, const Eina_Rectangle *in, Eina_Rectangle *res) EINA_ARG_NONNULL(1, 2, 3);
static inline void eina_rectangle_rescale_out(const Eina_Rectangle *out, const Eina_Rectangle *in, Eina_Rectangle *res) EINA_ARG_NONNULL(1, 2, 3);
EAPI Eina_Rectangle_Pool *
eina_rectangle_pool_new(
int w,
int h) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
EAPI Eina_Rectangle_Pool *
eina_rectangle_pool_get(
Eina_Rectangle *rect) EINA_WARN_UNUSED_RESULT
EINA_ARG_NONNULL(
1);
EAPI Eina_Bool
eina_rectangle_pool_geometry_get(
Eina_Rectangle_Pool *pool,
int *w,
int *h) EINA_WARN_UNUSED_RESULT
EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
EAPI void *
eina_rectangle_pool_data_get(
Eina_Rectangle_Pool *pool) EINA_WARN_UNUSED_RESULT
EINA_ARG_NONNULL(
1);
EAPI void
eina_rectangle_pool_data_set(
Eina_Rectangle_Pool *pool,
const void *data) EINA_ARG_NONNULL(1);
EAPI void
eina_rectangle_pool_free(
Eina_Rectangle_Pool *pool) EINA_ARG_NONNULL(1);
EAPI int
eina_rectangle_pool_count(
Eina_Rectangle_Pool *pool) EINA_ARG_NONNULL(1)
EINA_WARN_UNUSED_RESULT;
EAPI Eina_Rectangle *
eina_rectangle_pool_request(
Eina_Rectangle_Pool *pool,
int w,
int h) EINA_WARN_UNUSED_RESULT
EINA_ARG_NONNULL(1);
EAPI void
eina_rectangle_pool_release(
Eina_Rectangle *rect) EINA_ARG_NONNULL(1);
EAPI Eina_Rectangle_Pool * eina_rectangle_pool_new(int w, int h) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
EAPI Eina_Rectangle_Pool * eina_rectangle_pool_get(Eina_Rectangle *rect) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
EAPI Eina_Bool eina_rectangle_pool_geometry_get(Eina_Rectangle_Pool *pool, int *w, int *h) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
EAPI void * eina_rectangle_pool_data_get(Eina_Rectangle_Pool *pool) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
EAPI void eina_rectangle_pool_data_set(Eina_Rectangle_Pool *pool, const void *data) EINA_ARG_NONNULL(1);
EAPI void eina_rectangle_pool_free(Eina_Rectangle_Pool *pool) EINA_ARG_NONNULL(1);
EAPI int eina_rectangle_pool_count(Eina_Rectangle_Pool *pool) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
EAPI Eina_Rectangle * eina_rectangle_pool_request(Eina_Rectangle_Pool *pool, int w, int h) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
EAPI void eina_rectangle_pool_release(Eina_Rectangle *rect) EINA_ARG_NONNULL(1);
/**
* @def EINA_RECTANGLE_SET
@ -157,16 +83,13 @@ eina_rectangle_pool_release(
* width and @p H is its height.
*/
#define EINA_RECTANGLE_SET(Rectangle, X, Y, W, H) \
(Rectangle)->x = X; \
(Rectangle)->y = Y; \
(Rectangle)->w = W; \
(Rectangle)->h = H;
(Rectangle)->x = X; \
(Rectangle)->y = Y; \
(Rectangle)->w = W; \
(Rectangle)->h = H;
EAPI Eina_Rectangle *eina_rectangle_new(int x, int y, int w,
int h) EINA_MALLOC
EINA_WARN_UNUSED_RESULT;
EAPI void eina_rectangle_free(Eina_Rectangle *rect) EINA_ARG_NONNULL(
1);
EAPI Eina_Rectangle *eina_rectangle_new(int x, int y, int w, int h) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
EAPI void eina_rectangle_free(Eina_Rectangle *rect) EINA_ARG_NONNULL(1);
#include "eina_inline_rectangle.x"

View File

@ -19,82 +19,26 @@
*/
/* strlcpy implementation for libc's lacking it */
EAPI size_t
eina_strlcpy(char *dst,
const char *src,
size_t siz) EINA_ARG_NONNULL(1, 2);
EAPI size_t
eina_strlcat(char *dst,
const char *src,
size_t siz) EINA_ARG_NONNULL(1, 2);
EAPI size_t eina_strlcpy(char *dst, const char *src, size_t siz) EINA_ARG_NONNULL(1, 2);
EAPI size_t eina_strlcat(char *dst, const char *src, size_t siz) EINA_ARG_NONNULL(1, 2);
EAPI Eina_Bool
eina_str_has_prefix(
const char *str,
const char *prefix) EINA_PURE EINA_ARG_NONNULL(1,
2) EINA_WARN_UNUSED_RESULT;
EAPI Eina_Bool
eina_str_has_suffix(
const char *str,
const char *suffix) EINA_PURE EINA_ARG_NONNULL(1,
2) EINA_WARN_UNUSED_RESULT;
EAPI Eina_Bool
eina_str_has_extension(
const char *str,
const char *ext) EINA_PURE EINA_ARG_NONNULL(1,
2) EINA_WARN_UNUSED_RESULT;
EAPI Eina_Bool eina_str_has_prefix(const char *str, const char *prefix) EINA_PURE EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
EAPI Eina_Bool eina_str_has_suffix(const char *str, const char *suffix) EINA_PURE EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
EAPI Eina_Bool eina_str_has_extension(const char *str, const char *ext) EINA_PURE EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
EAPI char **
eina_str_split(
const char *string,
const char *delimiter,
int max_tokens) EINA_ARG_NONNULL(1,
2) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
EAPI char **
eina_str_split_full(
const char *string,
const char *delimiter,
int max_tokens,
unsigned int *elements) EINA_ARG_NONNULL(1, 2,
4) EINA_MALLOC
EINA_WARN_UNUSED_RESULT;
EAPI char ** eina_str_split(const char *string, const char *delimiter, int max_tokens) EINA_ARG_NONNULL(1, 2) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
EAPI char ** eina_str_split_full(const char *string, const char *delimiter, int max_tokens, unsigned int *elements) EINA_ARG_NONNULL(1, 2, 4) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
EAPI size_t
eina_str_join_len(char *dst,
size_t size,
char sep,
const char *a,
size_t a_len,
const char *b,
size_t b_len) EINA_ARG_NONNULL(1, 4, 6);
EAPI size_t eina_str_join_len(char *dst, size_t size, char sep, const char *a, size_t a_len, const char *b, size_t b_len) EINA_ARG_NONNULL(1, 4, 6);
EAPI char *
eina_str_convert(
const char *enc_from,
const char *enc_to,
const char *text) EINA_WARN_UNUSED_RESULT EINA_MALLOC
EINA_ARG_NONNULL(1, 2, 3);
EAPI char * eina_str_convert(const char *enc_from, const char *enc_to, const char *text) EINA_WARN_UNUSED_RESULT EINA_MALLOC EINA_ARG_NONNULL(1, 2, 3);
EAPI char *
eina_str_escape(
const char *str) EINA_WARN_UNUSED_RESULT EINA_MALLOC
EINA_ARG_NONNULL(
1);
EAPI char * eina_str_escape(const char *str) EINA_WARN_UNUSED_RESULT EINA_MALLOC EINA_ARG_NONNULL(1);
EAPI void
eina_str_tolower(
char **str);
EAPI void
eina_str_toupper(
char **str);
EAPI void eina_str_tolower(char **str);
EAPI void eina_str_toupper(char **str);
static inline size_t
eina_str_join(
char *dst,
size_t size,
char sep,
const char *a,
const char *b) EINA_ARG_NONNULL(1, 4, 5);
static inline size_t eina_str_join(char *dst, size_t size, char sep, const char *a, const char *b) EINA_ARG_NONNULL(1, 4, 5);
/**
* @brief Join two strings of known length.
@ -112,11 +56,7 @@ eina_str_join(
* @see eina_str_join_len()
* @see eina_str_join_static()
*/
static inline size_t eina_str_join(char *dst,
size_t size,
char sep,
const char *a,
const char *b)
static inline size_t eina_str_join(char *dst, size_t size, char sep, const char *a, const char *b)
{
return eina_str_join_len(dst, size, sep, a, strlen(a), b, strlen(b));
}
@ -137,24 +77,9 @@ static inline size_t eina_str_join(char *dst,
* @see eina_str_join()
* @see eina_str_join_static()
*/
#define eina_str_join_static(dst, sep, a, b) eina_str_join_len( \
dst, \
sizeof(dst), \
sep, \
a, \
(sizeof(a) > \
0) ? sizeof(a) \
- 1 : 0, \
b, \
(sizeof(b) > \
0) ? sizeof(b) \
- 1 : 0)
#define eina_str_join_static(dst, sep, a, b) eina_str_join_len(dst, sizeof(dst), sep, a, (sizeof(a) > 0) ? sizeof(a) - 1 : 0, b, (sizeof(b) > 0) ? sizeof(b) - 1 : 0)
static inline size_t
eina_strlen_bounded(
const char *str,
size_t maxlen) EINA_PURE EINA_WARN_UNUSED_RESULT
EINA_ARG_NONNULL(1);
static inline size_t eina_strlen_bounded(const char *str, size_t maxlen) EINA_PURE EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
#include "eina_inline_str.x"

View File

@ -76,8 +76,7 @@ EAPI void eina_strbuf_reset(Eina_Strbuf *buf) EINA_ARG_NONNULL(1);
* @see eina_strbuf_append()
* @see eina_strbuf_append_length()
*/
EAPI Eina_Bool eina_strbuf_append(Eina_Strbuf *buf,
const char *str) EINA_ARG_NONNULL(1, 2);
EAPI Eina_Bool eina_strbuf_append(Eina_Strbuf *buf, const char *str) EINA_ARG_NONNULL(1, 2);
/**
* @brief Append an escaped string to a buffer, reallocating as necessary.
*
@ -89,10 +88,7 @@ EAPI Eina_Bool eina_strbuf_append(Eina_Strbuf *buf,
* str can not be appended, #EINA_FALSE is returned, otherwise,
* #EINA_TRUE is returned.
*/
EAPI Eina_Bool eina_strbuf_append_escaped(Eina_Strbuf *buf,
const char *str) EINA_ARG_NONNULL(
1,
2);
EAPI Eina_Bool eina_strbuf_append_escaped(Eina_Strbuf *buf, const char *str) EINA_ARG_NONNULL(1, 2);
/**
* @brief Append a string to a buffer, reallocating as necessary,
* limited by the given length.
@ -114,9 +110,7 @@ EAPI Eina_Bool eina_strbuf_append_escaped(Eina_Strbuf *buf,
* @see eina_strbuf_append()
* @see eina_strbuf_append_length()
*/
EAPI Eina_Bool eina_strbuf_append_n(Eina_Strbuf *buf,
const char *str,
size_t maxlen) EINA_ARG_NONNULL(1, 2);
EAPI Eina_Bool eina_strbuf_append_n(Eina_Strbuf *buf, const char *str, size_t maxlen) EINA_ARG_NONNULL(1, 2);
/**
* @brief Append a string of exact length to a buffer, reallocating as necessary.
*
@ -136,10 +130,7 @@ EAPI Eina_Bool eina_strbuf_append_n(Eina_Strbuf *buf,
* @see eina_strbuf_append()
* @see eina_strbuf_append_n()
*/
EAPI Eina_Bool eina_strbuf_append_length(Eina_Strbuf *buf,
const char *str,
size_t length) EINA_ARG_NONNULL(1,
2);
EAPI Eina_Bool eina_strbuf_append_length(Eina_Strbuf *buf, const char *str, size_t length) EINA_ARG_NONNULL(1, 2);
/**
* @brief Append a character to a string buffer, reallocating as
* necessary.
@ -151,8 +142,7 @@ EAPI Eina_Bool eina_strbuf_append_length(Eina_Strbuf *buf,
* This function inserts @p c to @p buf. If it can not insert it,
* #EINA_FALSE is returned, otherwise #EINA_TRUE is returned.
*/
EAPI Eina_Bool eina_strbuf_append_char(Eina_Strbuf *buf,
char c) EINA_ARG_NONNULL(1);
EAPI Eina_Bool eina_strbuf_append_char(Eina_Strbuf *buf, char c) EINA_ARG_NONNULL(1);
/**
* @brief Append a string to a buffer, reallocating as necessary.
*
@ -162,10 +152,7 @@ EAPI Eina_Bool eina_strbuf_append_char(Eina_Strbuf *buf,
*
* @see eina_strbuf_append()
*/
EAPI Eina_Bool eina_strbuf_append_printf(Eina_Strbuf *buf,
const char *fmt,
...) EINA_ARG_NONNULL(1,
2)
EAPI Eina_Bool eina_strbuf_append_printf(Eina_Strbuf *buf, const char *fmt, ...) EINA_ARG_NONNULL(1, 2)
EINA_PRINTF(2, 3);
/**
* @brief Append a string to a buffer, reallocating as necessary.
@ -176,10 +163,7 @@ EINA_PRINTF(2, 3);
*
* @see eina_strbuf_append()
*/
EAPI Eina_Bool eina_strbuf_append_vprintf(Eina_Strbuf *buf,
const char *fmt,
va_list args) EINA_ARG_NONNULL(1,
2);
EAPI Eina_Bool eina_strbuf_append_vprintf(Eina_Strbuf *buf, const char *fmt, va_list args) EINA_ARG_NONNULL(1, 2);
/**
* @brief Insert a string to a buffer, reallocating as necessary.
*
@ -194,9 +178,7 @@ EAPI Eina_Bool eina_strbuf_append_vprintf(Eina_Strbuf *buf,
* consider using that variant. If @p buf can't insert it, #EINA_FALSE
* is returned, otherwise #EINA_TRUE is returned.
*/
EAPI Eina_Bool eina_strbuf_insert(Eina_Strbuf *buf,
const char *str,
size_t pos) EINA_ARG_NONNULL(1, 2);
EAPI Eina_Bool eina_strbuf_insert(Eina_Strbuf *buf, const char *str, size_t pos) EINA_ARG_NONNULL(1, 2);
/**
* @brief Insert an escaped string to a buffer, reallocating as
* necessary.
@ -210,9 +192,7 @@ EAPI Eina_Bool eina_strbuf_insert(Eina_Strbuf *buf,
* position @p pos. If @p buf can't insert @p str, #EINA_FALSE is
* returned, otherwise #EINA_TRUE is returned.
*/
EAPI Eina_Bool eina_strbuf_insert_escaped(Eina_Strbuf *buf,
const char *str,
size_t pos) EINA_ARG_NONNULL(1, 2);
EAPI Eina_Bool eina_strbuf_insert_escaped(Eina_Strbuf *buf, const char *str, size_t pos) EINA_ARG_NONNULL(1, 2);
/**
* @brief Insert a string to a buffer, reallocating as necessary. Limited by maxlen.
*
@ -231,10 +211,7 @@ EAPI Eina_Bool eina_strbuf_insert_escaped(Eina_Strbuf *buf,
* @p str). If @p str can not be inserted, #EINA_FALSE is returned,
* otherwise, #EINA_TRUE is returned.
*/
EAPI Eina_Bool eina_strbuf_insert_n(Eina_Strbuf *buf,
const char *str,
size_t maxlen,
size_t pos) EINA_ARG_NONNULL(1, 2);
EAPI Eina_Bool eina_strbuf_insert_n(Eina_Strbuf *buf, const char *str, size_t maxlen, size_t pos) EINA_ARG_NONNULL(1, 2);
/**
* @brief Insert a string of exact length to a buffer, reallocating as necessary.
*
@ -255,10 +232,7 @@ EAPI Eina_Bool eina_strbuf_insert_n(Eina_Strbuf *buf,
* @see eina_strbuf_insert()
* @see eina_strbuf_insert_n()
*/
EAPI Eina_Bool eina_strbuf_insert_length(Eina_Strbuf *buf,
const char *str,
size_t length,
size_t pos) EINA_ARG_NONNULL(1, 2);
EAPI Eina_Bool eina_strbuf_insert_length(Eina_Strbuf *buf, const char *str, size_t length, size_t pos) EINA_ARG_NONNULL(1, 2);
/**
* @brief Insert a character to a string buffer, reallocating as
* necessary.
@ -272,8 +246,7 @@ EAPI Eina_Bool eina_strbuf_insert_length(Eina_Strbuf *buf,
* can't append it, #EINA_FALSE is returned, otherwise #EINA_TRUE is
* returned.
*/
EAPI Eina_Bool eina_strbuf_insert_char(Eina_Strbuf *buf, char c,
size_t pos) EINA_ARG_NONNULL(1);
EAPI Eina_Bool eina_strbuf_insert_char(Eina_Strbuf *buf, char c, size_t pos) EINA_ARG_NONNULL(1);
/**
* @brief Insert a string to a buffer, reallocating as necessary.
*
@ -282,12 +255,7 @@ EAPI Eina_Bool eina_strbuf_insert_char(Eina_Strbuf *buf, char c,
* @param pos The position to insert the string.
* @return #EINA_TRUE on success, #EINA_FALSE on failure.
*/
EAPI Eina_Bool eina_strbuf_insert_printf(Eina_Strbuf *buf,
const char *fmt,
size_t pos,
...) EINA_ARG_NONNULL(1,
2)
EINA_PRINTF(2, 4);
EAPI Eina_Bool eina_strbuf_insert_printf(Eina_Strbuf *buf, const char *fmt, size_t pos, ...) EINA_ARG_NONNULL(1, 2) EINA_PRINTF(2, 4);
/**
* @brief Insert a string to a buffer, reallocating as necessary.
*
@ -296,11 +264,7 @@ EINA_PRINTF(2, 4);
* @param pos The position to insert the string.
* @return #EINA_TRUE on success, #EINA_FALSE on failure.
*/
EAPI Eina_Bool eina_strbuf_insert_vprintf(Eina_Strbuf *buf,
const char *fmt,
size_t pos,
va_list args) EINA_ARG_NONNULL(1,
2);
EAPI Eina_Bool eina_strbuf_insert_vprintf(Eina_Strbuf *buf, const char *fmt, size_t pos, va_list args) EINA_ARG_NONNULL(1, 2);
/**
* @def eina_strbuf_prepend(buf, str)
@ -328,9 +292,7 @@ EAPI Eina_Bool eina_strbuf_insert_vprintf(Eina_Strbuf *buf,
* @p buf can't prepend it, #EINA_FALSE is returned, otherwise
* #EINA_TRUE is returned.
*/
#define eina_strbuf_prepend_escaped(buf, str) eina_strbuf_insert_escaped(buf, \
str, \
0)
#define eina_strbuf_prepend_escaped(buf, str) eina_strbuf_insert_escaped(buf, str, 0)
/**
* @def eina_strbuf_prepend_n(buf, str)
@ -345,10 +307,7 @@ EAPI Eina_Bool eina_strbuf_insert_vprintf(Eina_Strbuf *buf,
* @p buf can't prepend it, #EINA_FALSE is returned, otherwise
* #EINA_TRUE is returned.
*/
#define eina_strbuf_prepend_n(buf, str, maxlen) eina_strbuf_insert_n(buf, \
str, \
maxlen, \
0)
#define eina_strbuf_prepend_n(buf, str, maxlen) eina_strbuf_insert_n(buf, str, maxlen, 0)
/**
* @def eina_strbuf_prepend_length(buf, str)
@ -363,11 +322,7 @@ EAPI Eina_Bool eina_strbuf_insert_vprintf(Eina_Strbuf *buf,
* @p buf can't prepend it, #EINA_FALSE is returned, otherwise
* #EINA_TRUE is returned.
*/
#define eina_strbuf_prepend_length(buf, str, length) eina_strbuf_insert_length( \
buf, \
str, \
length, \
0)
#define eina_strbuf_prepend_length(buf, str, length) eina_strbuf_insert_length( buf, str, length, 0)
/**
* @def eina_strbuf_prepend_char(buf, str)
@ -395,12 +350,7 @@ EAPI Eina_Bool eina_strbuf_insert_vprintf(Eina_Strbuf *buf,
* can't prepend it, #EINA_FALSE is returned, otherwise #EINA_TRUE is
* returned.
*/
#define eina_strbuf_prepend_printf(buf, fmt, ...) eina_strbuf_insert_printf( \
buf, \
fmt, \
0, \
## \
__VA_ARGS__)
#define eina_strbuf_prepend_printf(buf, fmt, ...) eina_strbuf_insert_printf(buf, fmt, 0, ## __VA_ARGS__)
/**
* @def eina_strbuf_prepend_vprintf(buf, fmt, args)
@ -414,11 +364,7 @@ EAPI Eina_Bool eina_strbuf_insert_vprintf(Eina_Strbuf *buf,
* can't prepend it, #EINA_FALSE is returned, otherwise #EINA_TRUE is
* returned.
*/
#define eina_strbuf_prepend_vprintf(buf, fmt, args) eina_strbuf_insert_vprintf( \
buf, \
fmt, \
0, \
args)
#define eina_strbuf_prepend_vprintf(buf, fmt, args) eina_strbuf_insert_vprintf(buf, fmt, 0, args)
/**
* @brief Remove a slice of the given string buffer.
@ -435,9 +381,7 @@ EAPI Eina_Bool eina_strbuf_insert_vprintf(Eina_Strbuf *buf,
* in bytes. It returns #EINA_FALSE on failure, #EINA_TRUE otherwise.
*/
EAPI Eina_Bool
eina_strbuf_remove(Eina_Strbuf *buf, size_t start, size_t end) EINA_ARG_NONNULL(
1);
EAPI Eina_Bool eina_strbuf_remove(Eina_Strbuf *buf, size_t start, size_t end) EINA_ARG_NONNULL(1);
/**
* @brief Retrieve a pointer to the contents of a string buffer
*
@ -451,8 +395,7 @@ eina_strbuf_remove(Eina_Strbuf *buf, size_t start, size_t end) EINA_ARG_NONNULL(
*
* @see eina_strbuf_string_steal()
*/
EAPI const char *
eina_strbuf_string_get(const Eina_Strbuf *buf) EINA_ARG_NONNULL(1);
EAPI const char * eina_strbuf_string_get(const Eina_Strbuf *buf) EINA_ARG_NONNULL(1);
/**
* @brief Steal the contents of a string buffer.
*
@ -466,9 +409,7 @@ eina_strbuf_string_get(const Eina_Strbuf *buf) EINA_ARG_NONNULL(1);
*
* @see eina_strbuf_string_get()
*/
EAPI char *
eina_strbuf_string_steal(Eina_Strbuf *buf) EINA_MALLOC EINA_WARN_UNUSED_RESULT
EINA_ARG_NONNULL(1);
EAPI char * eina_strbuf_string_steal(Eina_Strbuf *buf) EINA_MALLOC EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
/**
* @brief Free the contents of a string buffer but not the buffer.
*
@ -477,8 +418,7 @@ EINA_ARG_NONNULL(1);
* This function frees the string contained in @p buf without freeing
* @p buf.
*/
EAPI void
eina_strbuf_string_free(Eina_Strbuf *buf) EINA_ARG_NONNULL(1);
EAPI void eina_strbuf_string_free(Eina_Strbuf *buf) EINA_ARG_NONNULL(1);
/**
* @brief Retrieve the length of the string buffer content.
*
@ -487,13 +427,8 @@ eina_strbuf_string_free(Eina_Strbuf *buf) EINA_ARG_NONNULL(1);
*
* This function returns the length of @p buf.
*/
EAPI size_t
eina_strbuf_length_get(const Eina_Strbuf *buf) EINA_ARG_NONNULL(1);
EAPI Eina_Bool
eina_strbuf_replace(Eina_Strbuf *buf,
const char *str,
const char *with,
unsigned int n) EINA_ARG_NONNULL(1, 2, 3);
EAPI size_t eina_strbuf_length_get(const Eina_Strbuf *buf) EINA_ARG_NONNULL(1);
EAPI Eina_Bool eina_strbuf_replace(Eina_Strbuf *buf, const char *str, const char *with, unsigned int n) EINA_ARG_NONNULL(1, 2, 3);
/**
* @def eina_strbuf_replace_first(buf, str, with)
@ -508,14 +443,9 @@ eina_strbuf_replace(Eina_Strbuf *buf,
* equal to @c 1. If @p buf can't replace it, #EINA_FALSE is returned,
* otherwise #EINA_TRUE is returned.
*/
#define eina_strbuf_replace_first(buf, str, with) eina_strbuf_replace(buf, \
str, \
with, \
1)
#define eina_strbuf_replace_first(buf, str, with) eina_strbuf_replace(buf, str, with, 1)
EAPI int
eina_strbuf_replace_all(Eina_Strbuf *buf, const char *str,
const char *with) EINA_ARG_NONNULL(1, 2, 3);
EAPI int eina_strbuf_replace_all(Eina_Strbuf *buf, const char *str, const char *with) EINA_ARG_NONNULL(1, 2, 3);
/**
* @}

View File

@ -67,32 +67,18 @@
* @{
*/
EAPI const char * eina_stringshare_add_length(const char *str,
unsigned int slen)
EINA_WARN_UNUSED_RESULT;
EAPI const char * eina_stringshare_add(const char *str)
EINA_WARN_UNUSED_RESULT;
EAPI const char * eina_stringshare_printf(const char *fmt,
...) EINA_WARN_UNUSED_RESULT;
EAPI const char * eina_stringshare_vprintf(const char *fmt,
va_list args)
EINA_WARN_UNUSED_RESULT;
EAPI const char * eina_stringshare_nprintf(unsigned int len,
const char *fmt,
...) EINA_WARN_UNUSED_RESULT;
EAPI const char * eina_stringshare_add_length(const char *str, unsigned int slen) EINA_WARN_UNUSED_RESULT;
EAPI const char * eina_stringshare_add(const char *str) EINA_WARN_UNUSED_RESULT;
EAPI const char * eina_stringshare_printf(const char *fmt, ...) EINA_WARN_UNUSED_RESULT;
EAPI const char * eina_stringshare_vprintf(const char *fmt, va_list args) EINA_WARN_UNUSED_RESULT;
EAPI const char * eina_stringshare_nprintf(unsigned int len, const char *fmt, ...) EINA_WARN_UNUSED_RESULT;
EAPI const char * eina_stringshare_ref(const char *str);
EAPI void eina_stringshare_del(const char *str);
EAPI int eina_stringshare_strlen(const char *str) EINA_CONST
EINA_WARN_UNUSED_RESULT;
EAPI int eina_stringshare_strlen(const char *str) EINA_CONST EINA_WARN_UNUSED_RESULT;
EAPI void eina_stringshare_dump(void);
static inline Eina_Bool eina_stringshare_replace(const char **p_str,
const char *news)
EINA_ARG_NONNULL(1);
static inline Eina_Bool eina_stringshare_replace_length(const char **p_str,
const char *news,
unsigned int slen)
EINA_ARG_NONNULL(1);
static inline Eina_Bool eina_stringshare_replace(const char **p_str, const char *news) EINA_ARG_NONNULL(1);
static inline Eina_Bool eina_stringshare_replace_length(const char **p_str, const char *news, unsigned int slen) EINA_ARG_NONNULL(1);
#include "eina_inline_stringshare.x"

View File

@ -64,29 +64,13 @@ typedef struct _Eina_Tile_Grid_Slicer Eina_Tile_Grid_Slicer;
EAPI Eina_Tiler * eina_tiler_new(int w, int h);
EAPI void eina_tiler_free(Eina_Tiler *t);
EAPI void eina_tiler_tile_size_set(Eina_Tiler *t, int w, int h);
EAPI Eina_Bool eina_tiler_rect_add(Eina_Tiler *t,
const Eina_Rectangle *r);
EAPI void eina_tiler_rect_del(Eina_Tiler *t,
const Eina_Rectangle *r);
EAPI Eina_Bool eina_tiler_rect_add(Eina_Tiler *t, const Eina_Rectangle *r);
EAPI void eina_tiler_rect_del(Eina_Tiler *t, const Eina_Rectangle *r);
EAPI void eina_tiler_clear(Eina_Tiler *t);
EAPI Eina_Iterator *eina_tiler_iterator_new(const Eina_Tiler *t);
EAPI Eina_Iterator *eina_tile_grid_slicer_iterator_new(int x,
int y,
int w,
int h,
int tile_w,
int tile_h);
static inline Eina_Bool eina_tile_grid_slicer_next(
Eina_Tile_Grid_Slicer *slc,
const Eina_Tile_Grid_Info **
rect);
static inline Eina_Bool eina_tile_grid_slicer_setup(Eina_Tile_Grid_Slicer *slc,
int x,
int y,
int w,
int h,
int tile_w,
int tile_h);
EAPI Eina_Iterator *eina_tile_grid_slicer_iterator_new(int x, int y, int w, int h, int tile_w, int tile_h);
static inline Eina_Bool eina_tile_grid_slicer_next(Eina_Tile_Grid_Slicer *slc, const Eina_Tile_Grid_Info **rect);
static inline Eina_Bool eina_tile_grid_slicer_setup(Eina_Tile_Grid_Slicer *slc, int x, int y, int w, int h, int tile_w, int tile_h);
#include "eina_inline_tiler.x"

View File

@ -53,10 +53,8 @@ struct _Eina_Trash
};
static inline void eina_trash_init(Eina_Trash **trash) EINA_ARG_NONNULL(1);
static inline void eina_trash_push(Eina_Trash **trash,
void *data) EINA_ARG_NONNULL(1);
static inline void *eina_trash_pop(Eina_Trash **trash) EINA_ARG_NONNULL(1)
EINA_WARN_UNUSED_RESULT;
static inline void eina_trash_push(Eina_Trash **trash, void *data) EINA_ARG_NONNULL(1);
static inline void *eina_trash_pop(Eina_Trash **trash) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
/**
* @def EINA_TRASH_CLEAN

View File

@ -104,10 +104,8 @@
# define EINA_WARN_UNUSED_RESULT
# endif
# if (!defined(EINA_SAFETY_CHECKS)) && (__GNUC__ > 3 || (__GNUC__ == 3 && \
__GNUC_MINOR__ >= 3))
# define EINA_ARG_NONNULL(idx, \
...) __attribute__ ((nonnull(idx, ## __VA_ARGS__)))
# if (!defined(EINA_SAFETY_CHECKS)) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3))
# define EINA_ARG_NONNULL(idx, ...) __attribute__ ((nonnull(idx, ## __VA_ARGS__)))
# else
# define EINA_ARG_NONNULL(idx, ...)
# endif
@ -255,9 +253,7 @@ typedef int (*Eina_Compare_Cb)(const void *data1, const void *data2);
*/
#define EINA_COMPARE_CB(function) ((Eina_Compare_Cb)function)
typedef Eina_Bool (*Eina_Each_Cb)(const void *container,
void *data,
void *fdata);
typedef Eina_Bool (*Eina_Each_Cb)(const void *container, void *data, void *fdata);
/**
* @def EINA_EACH_CB

View File

@ -46,35 +46,17 @@ EAPI size_t eina_unicode_strlen(const Eina_Unicode *ustr) EINA_ARG_NONNULL(1) EI
EAPI size_t eina_unicode_strnlen(const Eina_Unicode *ustr, int n) EINA_ARG_NONNULL(1) EINA_PURE;
EAPI Eina_Unicode *
eina_unicode_strdup(
const Eina_Unicode *text) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1)
EINA_MALLOC;
EAPI Eina_Unicode *eina_unicode_strdup(const Eina_Unicode *text) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
EAPI int
eina_unicode_strcmp(
const Eina_Unicode *a,
const Eina_Unicode *b) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
EAPI int eina_unicode_strcmp(const Eina_Unicode *a, const Eina_Unicode *b) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
EAPI Eina_Unicode *
eina_unicode_strcpy(
Eina_Unicode *dest,
const Eina_Unicode *source);
EAPI Eina_Unicode *eina_unicode_strcpy(Eina_Unicode *dest, const Eina_Unicode *source);
EAPI Eina_Unicode *
eina_unicode_strstr(
const Eina_Unicode *haystack,
const Eina_Unicode *needle) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
EAPI Eina_Unicode *eina_unicode_strstr(const Eina_Unicode *haystack, const Eina_Unicode *needle) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
EAPI Eina_Unicode *
eina_unicode_strncpy(
Eina_Unicode *dest,
const Eina_Unicode *source,
size_t n);
EAPI Eina_Unicode *eina_unicode_strncpy(Eina_Unicode *dest, const Eina_Unicode *source, size_t n);
EAPI Eina_Unicode *
eina_unicode_escape(
const Eina_Unicode *str);
EAPI Eina_Unicode *eina_unicode_escape(const Eina_Unicode *str);
/**
* @}

View File

@ -78,9 +78,7 @@ EAPI void eina_ustrbuf_reset(Eina_UStrbuf *buf) EINA_ARG_NONNULL(1);
* @see eina_ustrbuf_append()
* @see eina_ustrbuf_append_length()
*/
EAPI Eina_Bool eina_ustrbuf_append(Eina_UStrbuf *buf,
const Eina_Unicode *str)
EINA_ARG_NONNULL(1, 2);
EAPI Eina_Bool eina_ustrbuf_append(Eina_UStrbuf *buf, const Eina_Unicode *str) EINA_ARG_NONNULL(1, 2);
/**
* @brief Append an escaped string to a buffer, reallocating as necessary.
*
@ -92,9 +90,7 @@ EINA_ARG_NONNULL(1, 2);
* str can not be appended, #EINA_FALSE is returned, otherwise,
* #EINA_TRUE is returned.
*/
EAPI Eina_Bool eina_ustrbuf_append_escaped(Eina_UStrbuf *buf,
const Eina_Unicode *str)
EINA_ARG_NONNULL(1, 2);
EAPI Eina_Bool eina_ustrbuf_append_escaped(Eina_UStrbuf *buf, const Eina_Unicode *str) EINA_ARG_NONNULL(1, 2);
/**
* @brief Append a string to a buffer, reallocating as necessary,
* limited by the given length.
@ -116,9 +112,7 @@ EINA_ARG_NONNULL(1, 2);
* @see eina_ustrbuf_append()
* @see eina_ustrbuf_append_length()
*/
EAPI Eina_Bool eina_ustrbuf_append_n(Eina_UStrbuf *buf,
const Eina_Unicode *str,
size_t maxlen) EINA_ARG_NONNULL(1, 2);
EAPI Eina_Bool eina_ustrbuf_append_n(Eina_UStrbuf *buf, const Eina_Unicode *str, size_t maxlen) EINA_ARG_NONNULL(1, 2);
/**
* @brief Append a string of exact length to a buffer, reallocating as necessary.
*
@ -138,10 +132,7 @@ EAPI Eina_Bool eina_ustrbuf_append_n(Eina_UStrbuf *buf,
* @see eina_ustrbuf_append()
* @see eina_ustrbuf_append_n()
*/
EAPI Eina_Bool eina_ustrbuf_append_length(Eina_UStrbuf *buf,
const Eina_Unicode *str,
size_t length) EINA_ARG_NONNULL(1,
2);
EAPI Eina_Bool eina_ustrbuf_append_length(Eina_UStrbuf *buf, const Eina_Unicode *str, size_t length) EINA_ARG_NONNULL(1, 2);
/**
* @brief Append a character to a string buffer, reallocating as
@ -154,8 +145,7 @@ EAPI Eina_Bool eina_ustrbuf_append_length(Eina_UStrbuf *buf,
* This function inserts @p c to @p buf. If it can not insert it,
* #EINA_FALSE is returned, otherwise #EINA_TRUE is returned.
*/
EAPI Eina_Bool eina_ustrbuf_append_char(Eina_UStrbuf *buf,
Eina_Unicode c) EINA_ARG_NONNULL(1);
EAPI Eina_Bool eina_ustrbuf_append_char(Eina_UStrbuf *buf, Eina_Unicode c) EINA_ARG_NONNULL(1);
/**
* @brief Insert a string to a buffer, reallocating as necessary.
@ -171,9 +161,7 @@ EAPI Eina_Bool eina_ustrbuf_append_char(Eina_UStrbuf *buf,
* consider using that variant. If @p buf can't insert it, #EINA_FALSE
* is returned, otherwise #EINA_TRUE is returned.
*/
EAPI Eina_Bool eina_ustrbuf_insert(Eina_UStrbuf *buf,
const Eina_Unicode *str,
size_t pos) EINA_ARG_NONNULL(1, 2);
EAPI Eina_Bool eina_ustrbuf_insert(Eina_UStrbuf *buf, const Eina_Unicode *str, size_t pos) EINA_ARG_NONNULL(1, 2);
/**
* @brief Insert an escaped string to a buffer, reallocating as
* necessary.
@ -187,10 +175,7 @@ EAPI Eina_Bool eina_ustrbuf_insert(Eina_UStrbuf *buf,
* position @p pos. If @p buf can't insert @p str, #EINA_FALSE is
* returned, otherwise #EINA_TRUE is returned.
*/
EAPI Eina_Bool eina_ustrbuf_insert_escaped(Eina_UStrbuf *buf,
const Eina_Unicode *str,
size_t pos) EINA_ARG_NONNULL(1,
2);
EAPI Eina_Bool eina_ustrbuf_insert_escaped(Eina_UStrbuf *buf, const Eina_Unicode *str, size_t pos) EINA_ARG_NONNULL(1, 2);
/**
* @brief Insert a string to a buffer, reallocating as necessary. Limited by maxlen.
*
@ -209,10 +194,7 @@ EAPI Eina_Bool eina_ustrbuf_insert_escaped(Eina_UStrbuf *buf,
* @p str). If @p str can not be inserted, #EINA_FALSE is returned,
* otherwise, #EINA_TRUE is returned.
*/
EAPI Eina_Bool eina_ustrbuf_insert_n(Eina_UStrbuf *buf,
const Eina_Unicode *str,
size_t maxlen,
size_t pos) EINA_ARG_NONNULL(1, 2);
EAPI Eina_Bool eina_ustrbuf_insert_n(Eina_UStrbuf *buf, const Eina_Unicode *str, size_t maxlen, size_t pos) EINA_ARG_NONNULL(1, 2);
/**
* @brief Insert a string of exact length to a buffer, reallocating as necessary.
*
@ -233,10 +215,7 @@ EAPI Eina_Bool eina_ustrbuf_insert_n(Eina_UStrbuf *buf,
* @see eina_ustrbuf_insert()
* @see eina_ustrbuf_insert_n()
*/
EAPI Eina_Bool eina_ustrbuf_insert_length(Eina_UStrbuf *buf,
const Eina_Unicode *str,
size_t length,
size_t pos) EINA_ARG_NONNULL(1, 2);
EAPI Eina_Bool eina_ustrbuf_insert_length(Eina_UStrbuf *buf, const Eina_Unicode *str, size_t length, size_t pos) EINA_ARG_NONNULL(1, 2);
/**
* @brief Insert a character to a string buffer, reallocating as
* necessary.
@ -250,9 +229,7 @@ EAPI Eina_Bool eina_ustrbuf_insert_length(Eina_UStrbuf *buf,
* can't append it, #EINA_FALSE is returned, otherwise #EINA_TRUE is
* returned.
*/
EAPI Eina_Bool eina_ustrbuf_insert_char(Eina_UStrbuf *buf,
Eina_Unicode c,
size_t pos) EINA_ARG_NONNULL(1);
EAPI Eina_Bool eina_ustrbuf_insert_char(Eina_UStrbuf *buf, Eina_Unicode c, size_t pos) EINA_ARG_NONNULL(1);
/**
* @def eina_ustrbuf_prepend(buf, str)
@ -280,9 +257,7 @@ EAPI Eina_Bool eina_ustrbuf_insert_char(Eina_UStrbuf *buf,
* @p buf can't prepend it, #EINA_FALSE is returned, otherwise
* #EINA_TRUE is returned.
*/
#define eina_ustrbuf_prepend_escaped(buf, str) eina_ustrbuf_insert_escaped(buf, \
str, \
0)
#define eina_ustrbuf_prepend_escaped(buf, str) eina_ustrbuf_insert_escaped(buf, str, 0)
/**
* @def eina_ustrbuf_prepend_n(buf, str)
@ -297,10 +272,7 @@ EAPI Eina_Bool eina_ustrbuf_insert_char(Eina_UStrbuf *buf,
* @p buf can't prepend it, #EINA_FALSE is returned, otherwise
* #EINA_TRUE is returned.
*/
#define eina_ustrbuf_prepend_n(buf, str, maxlen) eina_ustrbuf_insert_n(buf, \
str, \
maxlen, \
0)
#define eina_ustrbuf_prepend_n(buf, str, maxlen) eina_ustrbuf_insert_n(buf, str, maxlen, 0)
/**
* @def eina_ustrbuf_prepend_length(buf, str)
@ -315,11 +287,7 @@ EAPI Eina_Bool eina_ustrbuf_insert_char(Eina_UStrbuf *buf,
* @p buf can't prepend it, #EINA_FALSE is returned, otherwise
* #EINA_TRUE is returned.
*/
#define eina_ustrbuf_prepend_length(buf, str, \
length) eina_ustrbuf_insert_length(buf, \
str, \
length, \
0)
#define eina_ustrbuf_prepend_length(buf, str, length) eina_ustrbuf_insert_length(buf, str, length, 0)
/**
* @def eina_ustrbuf_prepend_Eina_Unicode *(buf, str)
@ -333,9 +301,7 @@ EAPI Eina_Bool eina_ustrbuf_insert_char(Eina_UStrbuf *buf,
* @p buf can't prepend it, #EINA_FALSE is returned, otherwise
* #EINA_TRUE is returned.
*/
#define eina_ustrbuf_prepend_Eina_Unicode *(buf, \
c)eina_ustrbuf_insert_Eina_Unicode \
* (buf, c, 0)
#define eina_ustrbuf_prepend_Eina_Unicode *(buf, c)eina_ustrbuf_insert_Eina_Unicode * (buf, c, 0)
/**
* @def eina_ustrbuf_prepend_printf(buf, fmt, ...)
@ -349,11 +315,7 @@ EAPI Eina_Bool eina_ustrbuf_insert_char(Eina_UStrbuf *buf,
* can't prepend it, #EINA_FALSE is returned, otherwise #EINA_TRUE is
* returned.
*/
#define eina_ustrbuf_prepend_printf(buf, fmt, ...) eina_ustrbuf_insert_printf( \
buf, \
fmt, \
0, \
## __VA_ARGS__)
#define eina_ustrbuf_prepend_printf(buf, fmt, ...) eina_ustrbuf_insert_printf(buf, fmt, 0, ## __VA_ARGS__)
/**
* @def eina_ustrbuf_prepend_vprintf(buf, fmt, args)
@ -367,11 +329,7 @@ EAPI Eina_Bool eina_ustrbuf_insert_char(Eina_UStrbuf *buf,
* can't prepend it, #EINA_FALSE is returned, otherwise #EINA_TRUE is
* returned.
*/
#define eina_ustrbuf_prepend_vprintf(buf, fmt, \
args) eina_ustrbuf_insert_vprintf(buf, \
fmt, \
0, \
args)
#define eina_ustrbuf_prepend_vprintf(buf, fmt, args) eina_ustrbuf_insert_vprintf(buf, fmt, 0, args)
/**
* @brief Remove a slice of the given string buffer.
@ -388,8 +346,7 @@ EAPI Eina_Bool eina_ustrbuf_insert_char(Eina_UStrbuf *buf,
* in bytes. It returns #EINA_FALSE on failure, #EINA_TRUE otherwise.
*/
EAPI Eina_Bool
eina_ustrbuf_remove(Eina_UStrbuf *buf, size_t start,
size_t end) EINA_ARG_NONNULL(1);
eina_ustrbuf_remove(Eina_UStrbuf *buf, size_t start, size_t end) EINA_ARG_NONNULL(1);
/**
* @brief Retrieve a pointer to the contents of a string buffer
*
@ -419,9 +376,7 @@ eina_ustrbuf_string_get(const Eina_UStrbuf *buf) EINA_ARG_NONNULL(1);
* @see eina_ustrbuf_string_get()
*/
EAPI Eina_Unicode *
eina_ustrbuf_string_steal(Eina_UStrbuf *buf) EINA_MALLOC
EINA_WARN_UNUSED_RESULT
EINA_ARG_NONNULL(1);
eina_ustrbuf_string_steal(Eina_UStrbuf *buf) EINA_MALLOC EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
/**
* @brief Free the contents of a string buffer but not the buffer.
*

View File

@ -66,24 +66,15 @@
* @{
*/
EAPI const Eina_Unicode *eina_ustringshare_add_length(const Eina_Unicode *str,
unsigned int slen)
EINA_WARN_UNUSED_RESULT;
EAPI const Eina_Unicode *eina_ustringshare_add(const Eina_Unicode *str)
EINA_WARN_UNUSED_RESULT;
EAPI const Eina_Unicode *eina_ustringshare_add_length(const Eina_Unicode *str, unsigned int slen) EINA_WARN_UNUSED_RESULT;
EAPI const Eina_Unicode *eina_ustringshare_add(const Eina_Unicode *str) EINA_WARN_UNUSED_RESULT;
EAPI const Eina_Unicode *eina_ustringshare_ref(const Eina_Unicode *str);
EAPI void eina_ustringshare_del(const Eina_Unicode *str);
EAPI int eina_ustringshare_strlen(const Eina_Unicode *str)
EINA_CONST EINA_WARN_UNUSED_RESULT;
EAPI int eina_ustringshare_strlen(const Eina_Unicode *str) EINA_CONST EINA_WARN_UNUSED_RESULT;
EAPI void eina_ustringshare_dump(void);
static inline Eina_Bool eina_ustringshare_replace(const Eina_Unicode **p_str,
const Eina_Unicode *news)
EINA_ARG_NONNULL(1);
static inline Eina_Bool eina_ustringshare_replace_length(
const Eina_Unicode **p_str,
const Eina_Unicode *news,
unsigned int slen) EINA_ARG_NONNULL(1);
static inline Eina_Bool eina_ustringshare_replace(const Eina_Unicode **p_str, const Eina_Unicode *news) EINA_ARG_NONNULL(1);
static inline Eina_Bool eina_ustringshare_replace_length(const Eina_Unicode **p_str, const Eina_Unicode *news, unsigned int slen) EINA_ARG_NONNULL(1);
#include "eina_inline_ustringshare.x"