ecrustify testing: looked good so I'm committing for other people to review as well
SVN revision: 53800
This commit is contained in:
parent
8074415ffc
commit
0c27fd1a29
|
@ -42,44 +42,44 @@
|
|||
*/
|
||||
typedef struct _Eina_Accessor Eina_Accessor;
|
||||
|
||||
typedef Eina_Bool (*Eina_Accessor_Get_At_Callback)(Eina_Accessor *it,
|
||||
unsigned int index,
|
||||
void **data);
|
||||
typedef void *(*Eina_Accessor_Get_Container_Callback)(Eina_Accessor *it);
|
||||
typedef void (*Eina_Accessor_Free_Callback)(Eina_Accessor *it);
|
||||
typedef Eina_Bool (*Eina_Accessor_Get_At_Callback)(Eina_Accessor *it,
|
||||
unsigned int index,
|
||||
void **data);
|
||||
typedef void * (*Eina_Accessor_Get_Container_Callback)(Eina_Accessor *it);
|
||||
typedef void (*Eina_Accessor_Free_Callback)(Eina_Accessor *it);
|
||||
typedef Eina_Bool (*Eina_Accessor_Lock_Callback)(Eina_Accessor *it);
|
||||
|
||||
struct _Eina_Accessor
|
||||
{
|
||||
#define EINA_ACCESSOR_VERSION 1
|
||||
int version;
|
||||
int version;
|
||||
|
||||
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;
|
||||
Eina_Accessor_Lock_Callback unlock EINA_WARN_UNUSED_RESULT;
|
||||
Eina_Accessor_Lock_Callback lock EINA_WARN_UNUSED_RESULT;
|
||||
Eina_Accessor_Lock_Callback unlock EINA_WARN_UNUSED_RESULT;
|
||||
|
||||
#define EINA_MAGIC_ACCESSOR 0x98761232
|
||||
EINA_MAGIC
|
||||
};
|
||||
|
||||
#define FUNC_ACCESSOR_GET_AT(Function) ((Eina_Accessor_Get_At_Callback)Function)
|
||||
#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_FREE(Function) ((Eina_Accessor_Free_Callback)Function)
|
||||
#define FUNC_ACCESSOR_LOCK(Function) ((Eina_Accessor_Lock_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 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);
|
||||
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 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);
|
||||
|
||||
|
@ -132,8 +132,8 @@ EAPI Eina_Bool eina_accessor_unlock(Eina_Accessor *accessor) EINA_ARG_NONNULL(1)
|
|||
* rather in the accessors implementations to keep them as simple
|
||||
* and fast as possible.
|
||||
*/
|
||||
#define EINA_ACCESSOR_FOREACH(accessor, counter, data) \
|
||||
for ((counter) = 0; \
|
||||
#define EINA_ACCESSOR_FOREACH(accessor, counter, data) \
|
||||
for ((counter) = 0; \
|
||||
eina_accessor_data_get((accessor), (counter), (void **)&(data)); \
|
||||
(counter)++)
|
||||
|
||||
|
|
|
@ -66,39 +66,39 @@ typedef void **Eina_Array_Iterator;
|
|||
struct _Eina_Array
|
||||
{
|
||||
#define EINA_ARRAY_VERSION 1
|
||||
int version; /**< Should match EINA_ARRAY_VERSION used when compiled your apps, provided for ABI compatibility */
|
||||
int version; /**< Should match EINA_ARRAY_VERSION used when compiled your apps, provided for ABI compatibility */
|
||||
|
||||
void **data; /**< Pointer to a vector of pointer to payload */
|
||||
void **data; /**< Pointer to a vector of pointer to payload */
|
||||
unsigned int total; /**< Total number of slots in the vector */
|
||||
unsigned int count; /**< Number of active slots in the vector */
|
||||
unsigned int step; /**< How much must we grow the vector when it is full */
|
||||
EINA_MAGIC
|
||||
};
|
||||
|
||||
EAPI Eina_Array * eina_array_new(unsigned int step) EINA_WARN_UNUSED_RESULT EINA_MALLOC EINA_WARN_UNUSED_RESULT;
|
||||
EAPI void eina_array_free(Eina_Array *array) EINA_ARG_NONNULL(1);
|
||||
EAPI void eina_array_step_set(Eina_Array *array,
|
||||
unsigned int sizeof_eina_array,
|
||||
unsigned int step) EINA_ARG_NONNULL(1);
|
||||
EAPI void eina_array_clean(Eina_Array *array) EINA_ARG_NONNULL(1);
|
||||
EAPI void eina_array_flush(Eina_Array *array) EINA_ARG_NONNULL(1);
|
||||
EAPI Eina_Bool eina_array_remove(Eina_Array *array,
|
||||
Eina_Bool(*keep)(void *data, void *gdata),
|
||||
void *gdata) EINA_ARG_NONNULL(1, 2);
|
||||
static inline Eina_Bool eina_array_push(Eina_Array *array,
|
||||
const void *data) EINA_ARG_NONNULL(1, 2);
|
||||
static inline void * eina_array_pop(Eina_Array *array) EINA_ARG_NONNULL(1);
|
||||
static inline void * eina_array_data_get(const Eina_Array *array,
|
||||
unsigned int idx) EINA_ARG_NONNULL(1);
|
||||
static inline void eina_array_data_set(const Eina_Array *array,
|
||||
unsigned int idx,
|
||||
const void *data) EINA_ARG_NONNULL(1, 3);
|
||||
static inline unsigned int eina_array_count_get(const Eina_Array *array) EINA_ARG_NONNULL(1);
|
||||
EAPI Eina_Iterator * eina_array_iterator_new(const Eina_Array *array) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
|
||||
EAPI Eina_Accessor * eina_array_accessor_new(const Eina_Array *array) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
|
||||
static inline Eina_Bool eina_array_foreach(Eina_Array *array,
|
||||
Eina_Each_Cb cb,
|
||||
void *data);
|
||||
EAPI Eina_Array *eina_array_new(unsigned int step) EINA_WARN_UNUSED_RESULT EINA_MALLOC EINA_WARN_UNUSED_RESULT;
|
||||
EAPI void eina_array_free(Eina_Array *array) EINA_ARG_NONNULL(1);
|
||||
EAPI void eina_array_step_set(Eina_Array *array,
|
||||
unsigned int sizeof_eina_array,
|
||||
unsigned int step) EINA_ARG_NONNULL(1);
|
||||
EAPI void eina_array_clean(Eina_Array *array) EINA_ARG_NONNULL(1);
|
||||
EAPI void eina_array_flush(Eina_Array *array) EINA_ARG_NONNULL(1);
|
||||
EAPI Eina_Bool eina_array_remove(Eina_Array * array,
|
||||
Eina_Bool (*keep)(void *data, void *gdata),
|
||||
void *gdata) EINA_ARG_NONNULL(1, 2);
|
||||
static inline Eina_Bool eina_array_push(Eina_Array *array,
|
||||
const void *data) EINA_ARG_NONNULL(1, 2);
|
||||
static inline void *eina_array_pop(Eina_Array *array) EINA_ARG_NONNULL(1);
|
||||
static inline void *eina_array_data_get(const Eina_Array *array,
|
||||
unsigned int idx) EINA_ARG_NONNULL(1);
|
||||
static inline void eina_array_data_set(const Eina_Array *array,
|
||||
unsigned int idx,
|
||||
const void *data) EINA_ARG_NONNULL(1, 3);
|
||||
static inline unsigned int eina_array_count_get(const Eina_Array *array) EINA_ARG_NONNULL(1);
|
||||
EAPI Eina_Iterator *eina_array_iterator_new(const Eina_Array *array) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
|
||||
EAPI Eina_Accessor *eina_array_accessor_new(const Eina_Array *array) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
|
||||
static inline Eina_Bool eina_array_foreach(Eina_Array *array,
|
||||
Eina_Each_Cb cb,
|
||||
void *data);
|
||||
/**
|
||||
* @def EINA_ARRAY_ITER_NEXT
|
||||
* @brief Macro to iterate over an array easily.
|
||||
|
@ -131,10 +131,10 @@ static inline Eina_Bool eina_array_foreach(Eina_Array *array,
|
|||
* free(item);
|
||||
* @endcode
|
||||
*/
|
||||
#define EINA_ARRAY_ITER_NEXT(array, index, item, iterator) \
|
||||
for (index = 0, iterator = (array)->data; \
|
||||
#define EINA_ARRAY_ITER_NEXT(array, index, item, iterator) \
|
||||
for (index = 0, iterator = (array)->data; \
|
||||
(index < eina_array_count_get(array)) && ((item = *((iterator)++))); \
|
||||
++(index))
|
||||
++(index))
|
||||
|
||||
#include "eina_inline_array.x"
|
||||
|
||||
|
|
|
@ -55,16 +55,16 @@ typedef void (*Eina_Benchmark_Specimens)(int request);
|
|||
*/
|
||||
#define EINA_BENCHMARK(function) ((Eina_Benchmark_Specimens)function)
|
||||
|
||||
EAPI Eina_Benchmark * eina_benchmark_new(const char *name,
|
||||
const char *run);
|
||||
EAPI void eina_benchmark_free(Eina_Benchmark *bench);
|
||||
EAPI Eina_Bool eina_benchmark_register(Eina_Benchmark *bench,
|
||||
const char *name,
|
||||
Eina_Benchmark_Specimens bench_cb,
|
||||
int count_start,
|
||||
int count_end,
|
||||
int count_set);
|
||||
EAPI Eina_Array * eina_benchmark_run(Eina_Benchmark *bench);
|
||||
EAPI Eina_Benchmark *eina_benchmark_new(const char *name,
|
||||
const char *run);
|
||||
EAPI void eina_benchmark_free(Eina_Benchmark *bench);
|
||||
EAPI Eina_Bool eina_benchmark_register(Eina_Benchmark *bench,
|
||||
const char *name,
|
||||
Eina_Benchmark_Specimens bench_cb,
|
||||
int count_start,
|
||||
int count_end,
|
||||
int count_set);
|
||||
EAPI Eina_Array *eina_benchmark_run(Eina_Benchmark *bench);
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
|
|
@ -65,14 +65,14 @@
|
|||
* @{
|
||||
*/
|
||||
|
||||
EAPI Eina_Bool eina_binshare_init(void);
|
||||
EAPI Eina_Bool eina_binshare_shutdown(void);
|
||||
EAPI const void * eina_binshare_add_length(const void *obj,
|
||||
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_PURE 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_WARN_UNUSED_RESULT;
|
||||
EAPI void eina_binshare_dump(void);
|
||||
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_WARN_UNUSED_RESULT;
|
||||
EAPI void eina_binshare_dump(void);
|
||||
|
||||
/**
|
||||
* @brief Retrieve an instance of a blob for use in a program.
|
||||
|
|
|
@ -59,15 +59,15 @@ EAPI int eina_convert_xtoa(unsigned int n, char *s) EINA_ARG_NONNULL(2);
|
|||
|
||||
EAPI int eina_convert_dtoa(double d, char *des) EINA_ARG_NONNULL(2);
|
||||
EAPI Eina_Bool eina_convert_atod(const char *src,
|
||||
int length,
|
||||
long long *m,
|
||||
long *e) EINA_ARG_NONNULL(1,3,4);
|
||||
int length,
|
||||
long long *m,
|
||||
long *e) EINA_ARG_NONNULL(1, 3, 4);
|
||||
|
||||
EAPI int eina_convert_fptoa(Eina_F32p32 fp,
|
||||
char *des) EINA_ARG_NONNULL(2);
|
||||
EAPI Eina_Bool eina_convert_atofp(const char *src,
|
||||
int length,
|
||||
Eina_F32p32 *fp) EINA_ARG_NONNULL(1,3);
|
||||
char *des) EINA_ARG_NONNULL(2);
|
||||
EAPI Eina_Bool eina_convert_atofp(const char *src,
|
||||
int length,
|
||||
Eina_F32p32 *fp) EINA_ARG_NONNULL(1, 3);
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
|
|
@ -39,12 +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 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 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);
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
|
|
@ -47,13 +47,13 @@ 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_Bool eina_error_msg_modify(Eina_Error error,
|
||||
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(2);
|
||||
EAPI Eina_Error eina_error_get(void);
|
||||
EAPI void eina_error_set(Eina_Error err);
|
||||
EAPI const char * eina_error_msg_get(Eina_Error error) EINA_PURE;
|
||||
EAPI Eina_Error eina_error_get(void);
|
||||
EAPI void eina_error_set(Eina_Error err);
|
||||
EAPI const char *eina_error_msg_get(Eina_Error error) EINA_PURE;
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
|
|
@ -56,10 +56,10 @@ typedef void (*Eina_File_Dir_List_Cb)(const char *name, const char *path, void *
|
|||
*/
|
||||
struct _Eina_File_Direct_Info
|
||||
{
|
||||
size_t path_length; /**< size of the whole path */
|
||||
size_t name_length; /**< size of the filename/basename component */
|
||||
size_t name_start; /**< where the filename/basename component starts */
|
||||
char path[PATH_MAX]; /**< the path */
|
||||
size_t path_length; /**< size of the whole path */
|
||||
size_t name_length; /**< size of the filename/basename component */
|
||||
size_t name_start; /**< where the filename/basename component starts */
|
||||
char path[PATH_MAX]; /**< the path */
|
||||
const struct dirent *dirent; /**< the dirent structure of the path */
|
||||
};
|
||||
|
||||
|
@ -73,13 +73,13 @@ struct _Eina_File_Direct_Info
|
|||
*/
|
||||
#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);
|
||||
EAPI Eina_Array * 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;
|
||||
EAPI Eina_Iterator * eina_file_direct_ls(const char *dir) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
|
||||
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);
|
||||
EAPI Eina_Array *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;
|
||||
EAPI Eina_Iterator *eina_file_direct_ls(const char *dir) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
|
||||
#ifdef _MSC_VER
|
||||
typedef unsigned __int64 uint64_t;
|
||||
typedef signed __int64 int64_t;
|
||||
typedef signed int int32_t;
|
||||
typedef signed __int64 int64_t;
|
||||
typedef signed int int32_t;
|
||||
#else
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
|
@ -48,7 +48,7 @@ static inline Eina_F32p32 eina_f32p32_sub(Eina_F32p32 a,
|
|||
static inline Eina_F32p32 eina_f32p32_mul(Eina_F32p32 a,
|
||||
Eina_F32p32 b);
|
||||
static inline Eina_F32p32 eina_f32p32_scale(Eina_F32p32 a,
|
||||
int b);
|
||||
int b);
|
||||
static inline Eina_F32p32 eina_f32p32_div(Eina_F32p32 a,
|
||||
Eina_F32p32 b);
|
||||
static inline Eina_F32p32 eina_f32p32_sqrt(Eina_F32p32 a);
|
||||
|
@ -72,7 +72,7 @@ static inline Eina_F16p16 eina_f16p16_sub(Eina_F16p16 a,
|
|||
static inline Eina_F16p16 eina_f16p16_mul(Eina_F16p16 a,
|
||||
Eina_F16p16 b);
|
||||
static inline Eina_F16p16 eina_f16p16_scale(Eina_F16p16 a,
|
||||
int b);
|
||||
int b);
|
||||
static inline Eina_F16p16 eina_f16p16_div(Eina_F16p16 a,
|
||||
Eina_F16p16 b);
|
||||
static inline Eina_F16p16 eina_f16p16_sqrt(Eina_F16p16 a);
|
||||
|
@ -90,7 +90,7 @@ static inline Eina_F8p24 eina_f8p24_sub(Eina_F8p24 a,
|
|||
static inline Eina_F8p24 eina_f8p24_mul(Eina_F8p24 a,
|
||||
Eina_F8p24 b);
|
||||
static inline Eina_F8p24 eina_f8p24_scale(Eina_F8p24 a,
|
||||
int b);
|
||||
int b);
|
||||
static inline Eina_F8p24 eina_f8p24_div(Eina_F8p24 a,
|
||||
Eina_F8p24 b);
|
||||
static inline Eina_F8p24 eina_f8p24_sqrt(Eina_F8p24 a);
|
||||
|
|
|
@ -45,111 +45,111 @@
|
|||
* @typedef Eina_Hash
|
||||
* Type for a generic hash table.
|
||||
*/
|
||||
typedef struct _Eina_Hash Eina_Hash;
|
||||
typedef struct _Eina_Hash Eina_Hash;
|
||||
|
||||
typedef struct _Eina_Hash_Tuple Eina_Hash_Tuple;
|
||||
|
||||
struct _Eina_Hash_Tuple
|
||||
{
|
||||
const void *key; /**< The key */
|
||||
void *data; /**< The data associated to the key */
|
||||
const void *key; /**< The key */
|
||||
void *data; /**< The data associated to the key */
|
||||
unsigned int key_length; /**< The length of the key */
|
||||
};
|
||||
|
||||
typedef unsigned int (*Eina_Key_Length)(const void *key);
|
||||
#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);
|
||||
#define EINA_KEY_CMP(Function) ((Eina_Key_Cmp)Function)
|
||||
typedef int (*Eina_Key_Hash)(const void *key, int key_length);
|
||||
#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);
|
||||
typedef int (*Eina_Key_Cmp)(const void *key1, int key1_length, const void *key2, int key2_length);
|
||||
#define EINA_KEY_CMP(Function) ((Eina_Key_Cmp)Function)
|
||||
typedef int (*Eina_Key_Hash)(const void *key, int key_length);
|
||||
#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);
|
||||
|
||||
EAPI Eina_Hash * eina_hash_new(Eina_Key_Length key_length_cb,
|
||||
Eina_Key_Cmp key_cmp_cb,
|
||||
Eina_Key_Hash key_hash_cb,
|
||||
Eina_Free_Cb data_free_cb,
|
||||
int buckets_power_size) EINA_MALLOC EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(2, 3);
|
||||
EAPI Eina_Hash * eina_hash_string_djb2_new(Eina_Free_Cb data_free_cb);
|
||||
EAPI Eina_Hash * eina_hash_string_superfast_new(Eina_Free_Cb data_free_cb);
|
||||
EAPI Eina_Hash * eina_hash_string_small_new(Eina_Free_Cb data_free_cb);
|
||||
EAPI Eina_Hash * eina_hash_int32_new(Eina_Free_Cb data_free_cb);
|
||||
EAPI Eina_Hash * eina_hash_int64_new(Eina_Free_Cb data_free_cb);
|
||||
EAPI Eina_Hash * eina_hash_pointer_new(Eina_Free_Cb data_free_cb);
|
||||
EAPI Eina_Hash * eina_hash_stringshared_new(Eina_Free_Cb data_free_cb);
|
||||
EAPI Eina_Bool eina_hash_add(Eina_Hash *hash,
|
||||
const void *key,
|
||||
const void *data) EINA_ARG_NONNULL(1, 2, 3);
|
||||
EAPI Eina_Bool eina_hash_direct_add(Eina_Hash *hash,
|
||||
const void *key,
|
||||
const void *data) EINA_ARG_NONNULL(1, 2, 3);
|
||||
EAPI Eina_Bool eina_hash_del(Eina_Hash *hash,
|
||||
const void *key,
|
||||
const void *data) EINA_ARG_NONNULL(1);
|
||||
EAPI void * eina_hash_find(const Eina_Hash *hash,
|
||||
const void *key) EINA_ARG_NONNULL(1, 2);
|
||||
EAPI void * eina_hash_modify(Eina_Hash *hash,
|
||||
const void *key,
|
||||
const void *data) EINA_ARG_NONNULL(1, 2, 3);
|
||||
EAPI void * eina_hash_set(Eina_Hash *hash,
|
||||
const void *key,
|
||||
const void *data) EINA_ARG_NONNULL(1, 2, 3);
|
||||
EAPI Eina_Bool eina_hash_move(Eina_Hash *hash,
|
||||
const void *old_key,
|
||||
const void *new_key) EINA_ARG_NONNULL(1, 2, 3);
|
||||
EAPI void eina_hash_free(Eina_Hash *hash) EINA_ARG_NONNULL(1);
|
||||
EAPI void eina_hash_free_buckets(Eina_Hash *hash) EINA_ARG_NONNULL(1);
|
||||
EAPI int eina_hash_population(const Eina_Hash *hash) EINA_ARG_NONNULL(1);
|
||||
EAPI Eina_Bool eina_hash_add_by_hash(Eina_Hash *hash,
|
||||
const void *key,
|
||||
int key_length,
|
||||
int key_hash,
|
||||
const void *data) EINA_ARG_NONNULL(1, 2, 5);
|
||||
EAPI Eina_Bool eina_hash_direct_add_by_hash(Eina_Hash *hash,
|
||||
const void *key,
|
||||
int key_length,
|
||||
int key_hash,
|
||||
const void *data) EINA_ARG_NONNULL(1, 2, 5);
|
||||
EAPI Eina_Bool eina_hash_del_by_key_hash(Eina_Hash *hash,
|
||||
const void *key,
|
||||
int key_length,
|
||||
int key_hash) EINA_ARG_NONNULL(1, 2);
|
||||
EAPI Eina_Bool eina_hash_del_by_key(Eina_Hash *hash,
|
||||
const void *key) EINA_ARG_NONNULL(1, 2);
|
||||
EAPI Eina_Bool eina_hash_del_by_data(Eina_Hash *hash,
|
||||
const void *data) EINA_ARG_NONNULL(1, 2);
|
||||
EAPI Eina_Bool eina_hash_del_by_hash(Eina_Hash *hash,
|
||||
const void *key,
|
||||
int key_length,
|
||||
int key_hash,
|
||||
const void *data) EINA_ARG_NONNULL(1);
|
||||
EAPI void * eina_hash_find_by_hash(const Eina_Hash *hash,
|
||||
EAPI Eina_Hash *eina_hash_new(Eina_Key_Length key_length_cb,
|
||||
Eina_Key_Cmp key_cmp_cb,
|
||||
Eina_Key_Hash key_hash_cb,
|
||||
Eina_Free_Cb data_free_cb,
|
||||
int buckets_power_size) EINA_MALLOC EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(2, 3);
|
||||
EAPI Eina_Hash *eina_hash_string_djb2_new(Eina_Free_Cb data_free_cb);
|
||||
EAPI Eina_Hash *eina_hash_string_superfast_new(Eina_Free_Cb data_free_cb);
|
||||
EAPI Eina_Hash *eina_hash_string_small_new(Eina_Free_Cb data_free_cb);
|
||||
EAPI Eina_Hash *eina_hash_int32_new(Eina_Free_Cb data_free_cb);
|
||||
EAPI Eina_Hash *eina_hash_int64_new(Eina_Free_Cb data_free_cb);
|
||||
EAPI Eina_Hash *eina_hash_pointer_new(Eina_Free_Cb data_free_cb);
|
||||
EAPI Eina_Hash *eina_hash_stringshared_new(Eina_Free_Cb data_free_cb);
|
||||
EAPI Eina_Bool eina_hash_add(Eina_Hash *hash,
|
||||
const void *key,
|
||||
const void *data) EINA_ARG_NONNULL(1, 2, 3);
|
||||
EAPI Eina_Bool eina_hash_direct_add(Eina_Hash *hash,
|
||||
const void *key,
|
||||
const void *data) EINA_ARG_NONNULL(1, 2, 3);
|
||||
EAPI Eina_Bool eina_hash_del(Eina_Hash *hash,
|
||||
const void *key,
|
||||
const void *data) EINA_ARG_NONNULL(1);
|
||||
EAPI void *eina_hash_find(const Eina_Hash *hash,
|
||||
const void *key) EINA_ARG_NONNULL(1, 2);
|
||||
EAPI void *eina_hash_modify(Eina_Hash *hash,
|
||||
const void *key,
|
||||
const void *data) EINA_ARG_NONNULL(1, 2, 3);
|
||||
EAPI void *eina_hash_set(Eina_Hash *hash,
|
||||
const void *key,
|
||||
const void *data) EINA_ARG_NONNULL(1, 2, 3);
|
||||
EAPI Eina_Bool eina_hash_move(Eina_Hash *hash,
|
||||
const void *old_key,
|
||||
const void *new_key) EINA_ARG_NONNULL(1, 2, 3);
|
||||
EAPI void eina_hash_free(Eina_Hash *hash) EINA_ARG_NONNULL(1);
|
||||
EAPI void eina_hash_free_buckets(Eina_Hash *hash) EINA_ARG_NONNULL(1);
|
||||
EAPI int eina_hash_population(const Eina_Hash *hash) EINA_ARG_NONNULL(1);
|
||||
EAPI Eina_Bool eina_hash_add_by_hash(Eina_Hash *hash,
|
||||
const void *key,
|
||||
int key_length,
|
||||
int key_hash,
|
||||
const void *data) EINA_ARG_NONNULL(1, 2, 5);
|
||||
EAPI Eina_Bool eina_hash_direct_add_by_hash(Eina_Hash *hash,
|
||||
const void *key,
|
||||
int key_length,
|
||||
int key_hash) EINA_ARG_NONNULL(1, 2);
|
||||
EAPI void * eina_hash_modify_by_hash(Eina_Hash *hash,
|
||||
const void *key,
|
||||
int key_length,
|
||||
int key_hash,
|
||||
const void *data) EINA_ARG_NONNULL(1, 2, 5);
|
||||
EAPI Eina_Iterator * eina_hash_iterator_key_new(const Eina_Hash *hash) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
|
||||
EAPI Eina_Iterator * eina_hash_iterator_data_new(const Eina_Hash *hash) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
|
||||
EAPI Eina_Iterator * eina_hash_iterator_tuple_new(const Eina_Hash *hash) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
|
||||
EAPI void eina_hash_foreach(const Eina_Hash *hash,
|
||||
Eina_Hash_Foreach cb,
|
||||
const void *fdata) EINA_ARG_NONNULL(1, 2);
|
||||
int key_length,
|
||||
int key_hash,
|
||||
const void *data) EINA_ARG_NONNULL(1, 2, 5);
|
||||
EAPI Eina_Bool eina_hash_del_by_key_hash(Eina_Hash *hash,
|
||||
const void *key,
|
||||
int key_length,
|
||||
int key_hash) EINA_ARG_NONNULL(1, 2);
|
||||
EAPI Eina_Bool eina_hash_del_by_key(Eina_Hash *hash,
|
||||
const void *key) EINA_ARG_NONNULL(1, 2);
|
||||
EAPI Eina_Bool eina_hash_del_by_data(Eina_Hash *hash,
|
||||
const void *data) EINA_ARG_NONNULL(1, 2);
|
||||
EAPI Eina_Bool eina_hash_del_by_hash(Eina_Hash *hash,
|
||||
const void *key,
|
||||
int key_length,
|
||||
int key_hash,
|
||||
const void *data) EINA_ARG_NONNULL(1);
|
||||
EAPI void *eina_hash_find_by_hash(const Eina_Hash *hash,
|
||||
const void *key,
|
||||
int key_length,
|
||||
int key_hash) EINA_ARG_NONNULL(1, 2);
|
||||
EAPI void *eina_hash_modify_by_hash(Eina_Hash *hash,
|
||||
const void *key,
|
||||
int key_length,
|
||||
int key_hash,
|
||||
const void *data) EINA_ARG_NONNULL(1, 2, 5);
|
||||
EAPI Eina_Iterator *eina_hash_iterator_key_new(const Eina_Hash *hash) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
|
||||
EAPI Eina_Iterator *eina_hash_iterator_data_new(const Eina_Hash *hash) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
|
||||
EAPI Eina_Iterator *eina_hash_iterator_tuple_new(const Eina_Hash *hash) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
|
||||
EAPI void eina_hash_foreach(const Eina_Hash *hash,
|
||||
Eina_Hash_Foreach cb,
|
||||
const void *fdata) EINA_ARG_NONNULL(1, 2);
|
||||
/* Paul Hsieh (http://www.azillionmonkeys.com/qed/hash.html) hash function used by WebCore (http://webkit.org/blog/8/hashtables-part-2/) */
|
||||
EAPI int eina_hash_superfast(const char *key,
|
||||
int len) EINA_ARG_NONNULL(1);
|
||||
EAPI int eina_hash_superfast(const char *key,
|
||||
int len) EINA_ARG_NONNULL(1);
|
||||
/* Hash function first reported by dan bernstein many years ago in comp.lang.c */
|
||||
static inline int eina_hash_djb2(const char *key,
|
||||
int len) EINA_ARG_NONNULL(1);
|
||||
static inline int eina_hash_djb2_len(const char *key,
|
||||
int *plen) EINA_ARG_NONNULL(1, 2);
|
||||
static inline int eina_hash_djb2(const char *key,
|
||||
int len) EINA_ARG_NONNULL(1);
|
||||
static inline int eina_hash_djb2_len(const char *key,
|
||||
int *plen) EINA_ARG_NONNULL(1, 2);
|
||||
/* Hash function from http://www.concentric.net/~Ttwang/tech/inthash.htm */
|
||||
static inline int eina_hash_int32(const unsigned int *pkey,
|
||||
int len) EINA_ARG_NONNULL(1);
|
||||
static inline int eina_hash_int64(const unsigned long int *pkey,
|
||||
int len) EINA_ARG_NONNULL(1);
|
||||
static inline int eina_hash_int32(const unsigned int *pkey,
|
||||
int len) EINA_ARG_NONNULL(1);
|
||||
static inline int eina_hash_int64(const unsigned long int *pkey,
|
||||
int len) EINA_ARG_NONNULL(1);
|
||||
|
||||
#include "eina_inline_hash.x"
|
||||
|
||||
|
|
|
@ -60,28 +60,28 @@ struct _Eina_Inlist
|
|||
};
|
||||
|
||||
#define EINA_INLIST Eina_Inlist __in_list
|
||||
#define EINA_INLIST_GET(Inlist) (& ((Inlist)->__in_list))
|
||||
#define EINA_INLIST_CONTAINER_GET(ptr, \
|
||||
#define EINA_INLIST_GET(Inlist) (& ((Inlist)->__in_list))
|
||||
#define EINA_INLIST_CONTAINER_GET(ptr, \
|
||||
type) ((type *)((char *)ptr - \
|
||||
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;
|
||||
EAPI Eina_Inlist * eina_inlist_prepend(Eina_Inlist *in_list,
|
||||
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;
|
||||
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;
|
||||
EAPI Eina_Inlist * eina_inlist_remove(Eina_Inlist *in_list,
|
||||
Eina_Inlist *in_item) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
|
||||
EAPI Eina_Inlist * eina_inlist_find(Eina_Inlist *in_list,
|
||||
EAPI Eina_Inlist *eina_inlist_append(Eina_Inlist *in_list,
|
||||
Eina_Inlist *in_item) EINA_ARG_NONNULL(2) EINA_WARN_UNUSED_RESULT;
|
||||
EAPI Eina_Inlist * eina_inlist_promote(Eina_Inlist *list,
|
||||
EAPI Eina_Inlist *eina_inlist_prepend(Eina_Inlist *in_list,
|
||||
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;
|
||||
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;
|
||||
EAPI Eina_Inlist *eina_inlist_remove(Eina_Inlist *in_list,
|
||||
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;
|
||||
EAPI Eina_Inlist *eina_inlist_promote(Eina_Inlist *list,
|
||||
Eina_Inlist *item) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
|
||||
EAPI Eina_Inlist * eina_inlist_demote(Eina_Inlist *list,
|
||||
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;
|
||||
|
||||
|
@ -89,16 +89,16 @@ EAPI Eina_Iterator *eina_inlist_iterator_new(const Eina_Inlist *in_list) EINA_MA
|
|||
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))
|
||||
#define _EINA_INLIST_OFFSET(ref) ((char *)&(ref)->__in_list - (char *)(ref))
|
||||
#define _EINA_INLIST_CONTAINER(ref, ptr) (void *)((char *)(ptr) - \
|
||||
_EINA_INLIST_OFFSET(ref))
|
||||
|
||||
#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))
|
||||
#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))
|
||||
#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))
|
||||
#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))
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
|
|
@ -42,44 +42,43 @@
|
|||
*/
|
||||
typedef struct _Eina_Iterator Eina_Iterator;
|
||||
|
||||
typedef Eina_Bool (*Eina_Iterator_Next_Callback)(Eina_Iterator *it, void **data);
|
||||
typedef void *(*Eina_Iterator_Get_Container_Callback)(Eina_Iterator *it);
|
||||
typedef void (*Eina_Iterator_Free_Callback)(Eina_Iterator *it);
|
||||
typedef Eina_Bool (*Eina_Iterator_Lock_Callback)(Eina_Iterator *it);
|
||||
typedef Eina_Bool (*Eina_Iterator_Next_Callback)(Eina_Iterator *it, void **data);
|
||||
typedef void * (*Eina_Iterator_Get_Container_Callback)(Eina_Iterator *it);
|
||||
typedef void (*Eina_Iterator_Free_Callback)(Eina_Iterator *it);
|
||||
typedef Eina_Bool (*Eina_Iterator_Lock_Callback)(Eina_Iterator *it);
|
||||
|
||||
struct _Eina_Iterator
|
||||
{
|
||||
#define EINA_ITERATOR_VERSION 1
|
||||
int version;
|
||||
int version;
|
||||
|
||||
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;
|
||||
Eina_Iterator_Lock_Callback unlock EINA_WARN_UNUSED_RESULT;
|
||||
Eina_Iterator_Lock_Callback lock EINA_WARN_UNUSED_RESULT;
|
||||
Eina_Iterator_Lock_Callback unlock EINA_WARN_UNUSED_RESULT;
|
||||
|
||||
#define EINA_MAGIC_ITERATOR 0x98761233
|
||||
EINA_MAGIC
|
||||
};
|
||||
|
||||
|
||||
#define FUNC_ITERATOR_NEXT(Function) ((Eina_Iterator_Next_Callback)Function)
|
||||
#define FUNC_ITERATOR_GET_CONTAINER(Function) (( \
|
||||
Eina_Iterator_Get_Container_Callback) \
|
||||
#define FUNC_ITERATOR_NEXT(Function) ((Eina_Iterator_Next_Callback)Function)
|
||||
#define FUNC_ITERATOR_GET_CONTAINER(Function) (( \
|
||||
Eina_Iterator_Get_Container_Callback) \
|
||||
Function)
|
||||
#define FUNC_ITERATOR_FREE(Function) ((Eina_Iterator_Free_Callback)Function)
|
||||
#define FUNC_ITERATOR_LOCK(Function) ((Eina_Iterator_Lock_Callback)Function)
|
||||
#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 Eina_Bool eina_iterator_next (Eina_Iterator *iterator,
|
||||
void **data) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
|
||||
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;
|
||||
|
||||
EAPI void eina_iterator_foreach (Eina_Iterator *iterator,
|
||||
Eina_Each_Cb callback,
|
||||
const void *fdata) EINA_ARG_NONNULL(1, 2);
|
||||
EAPI void eina_iterator_foreach(Eina_Iterator *iterator,
|
||||
Eina_Each_Cb callback,
|
||||
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);
|
||||
|
@ -126,7 +125,7 @@ EAPI Eina_Bool eina_iterator_unlock(Eina_Iterator *iterator) EINA_ARG_NONNULL(1)
|
|||
* rather in the iterators implementations to keep them as simple
|
||||
* and fast as possible.
|
||||
*/
|
||||
#define EINA_ITERATOR_FOREACH(itr, \
|
||||
#define EINA_ITERATOR_FOREACH(itr, \
|
||||
data) while (eina_iterator_next((itr), \
|
||||
(void **)&(data)))
|
||||
|
||||
|
|
|
@ -35,19 +35,19 @@
|
|||
|
||||
typedef Eina_Bool (*Eina_Lalloc_Alloc)(void *user_data, int num);
|
||||
#define EINA_LALLOC_ALLOC(function) ((Eina_Lalloc_Alloc)function)
|
||||
typedef void (*Eina_Lalloc_Free)(void *user_data);
|
||||
#define EINA_LALLOC_FREE(function) ((Eina_Lalloc_Free)function)
|
||||
typedef void (*Eina_Lalloc_Free)(void *user_data);
|
||||
#define EINA_LALLOC_FREE(function) ((Eina_Lalloc_Free)function)
|
||||
|
||||
typedef struct _Eina_Lalloc Eina_Lalloc;
|
||||
|
||||
EAPI Eina_Lalloc *eina_lalloc_new(void *data,
|
||||
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);
|
||||
EAPI void eina_lalloc_free(Eina_Lalloc *a) EINA_ARG_NONNULL(1);
|
||||
EAPI Eina_Bool eina_lalloc_elements_add(Eina_Lalloc *a,
|
||||
int num) EINA_ARG_NONNULL(1);
|
||||
EAPI Eina_Bool eina_lalloc_element_add(Eina_Lalloc *a) EINA_ARG_NONNULL(1);
|
||||
Eina_Lalloc_Free free_cb,
|
||||
int num_init) EINA_ARG_NONNULL(2, 3);
|
||||
EAPI void eina_lalloc_free(Eina_Lalloc *a) EINA_ARG_NONNULL(1);
|
||||
EAPI Eina_Bool eina_lalloc_elements_add(Eina_Lalloc *a,
|
||||
int num) EINA_ARG_NONNULL(1);
|
||||
EAPI Eina_Bool eina_lalloc_element_add(Eina_Lalloc *a) EINA_ARG_NONNULL(1);
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
|
|
@ -108,7 +108,6 @@ EAPI extern int EINA_LOG_DOMAIN_GLOBAL;
|
|||
|
||||
#endif /* EINA_LOG_DOMAIN_DEFAULT */
|
||||
|
||||
|
||||
/**
|
||||
* @def EINA_LOG(DOM, LEVEL, fmt, ...)
|
||||
* Logs a message on the specified domain, level and format.
|
||||
|
@ -124,21 +123,21 @@ EAPI extern int EINA_LOG_DOMAIN_GLOBAL;
|
|||
* header files.
|
||||
*/
|
||||
#ifdef EINA_LOG_LEVEL_MAXIMUM
|
||||
#define EINA_LOG(DOM, LEVEL, fmt, ...) \
|
||||
do { \
|
||||
if (LEVEL <= EINA_LOG_LEVEL_MAXIMUM) { \
|
||||
eina_log_print(DOM, LEVEL, __FILE__, __FUNCTION__, __LINE__, \
|
||||
fmt, ## __VA_ARGS__); } \
|
||||
} while (0)
|
||||
#define EINA_LOG(DOM, LEVEL, fmt, ...) \
|
||||
do { \
|
||||
if (LEVEL <= EINA_LOG_LEVEL_MAXIMUM) { \
|
||||
eina_log_print(DOM, LEVEL, __FILE__, __FUNCTION__, __LINE__, \
|
||||
fmt, ## __VA_ARGS__); } \
|
||||
} while (0)
|
||||
#else
|
||||
#define EINA_LOG(DOM, LEVEL, fmt, ...) \
|
||||
eina_log_print(DOM, \
|
||||
LEVEL, \
|
||||
__FILE__, \
|
||||
__FUNCTION__, \
|
||||
__LINE__, \
|
||||
fmt, \
|
||||
## __VA_ARGS__)
|
||||
#define EINA_LOG(DOM, LEVEL, fmt, ...) \
|
||||
eina_log_print(DOM, \
|
||||
LEVEL, \
|
||||
__FILE__, \
|
||||
__FUNCTION__, \
|
||||
__LINE__, \
|
||||
fmt, \
|
||||
## __VA_ARGS__)
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -146,46 +145,46 @@ EAPI extern int EINA_LOG_DOMAIN_GLOBAL;
|
|||
* Logs a message with level CRITICAL on the specified domain and format.
|
||||
*/
|
||||
#define EINA_LOG_DOM_CRIT(DOM, fmt, ...) \
|
||||
EINA_LOG(DOM, EINA_LOG_LEVEL_CRITICAL, fmt, ## __VA_ARGS__)
|
||||
EINA_LOG(DOM, EINA_LOG_LEVEL_CRITICAL, fmt, ## __VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @def EINA_LOG_DOM_ERR(DOM, fmt, ...)
|
||||
* Logs a message with level ERROR on the specified domain and format.
|
||||
*/
|
||||
#define EINA_LOG_DOM_ERR(DOM, fmt, ...) \
|
||||
EINA_LOG(DOM, EINA_LOG_LEVEL_ERR, fmt, ## __VA_ARGS__)
|
||||
EINA_LOG(DOM, EINA_LOG_LEVEL_ERR, fmt, ## __VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @def EINA_LOG_DOM_INFO(DOM, fmt, ...)
|
||||
* Logs a message with level INFO on the specified domain and format.
|
||||
*/
|
||||
#define EINA_LOG_DOM_INFO(DOM, fmt, ...) \
|
||||
EINA_LOG(DOM, EINA_LOG_LEVEL_INFO, fmt, ## __VA_ARGS__)
|
||||
EINA_LOG(DOM, EINA_LOG_LEVEL_INFO, fmt, ## __VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @def EINA_LOG_DOM_DBG(DOM, fmt, ...)
|
||||
* Logs a message with level DEBUG on the specified domain and format.
|
||||
*/
|
||||
#define EINA_LOG_DOM_DBG(DOM, fmt, ...) \
|
||||
EINA_LOG(DOM, EINA_LOG_LEVEL_DBG, fmt, ## __VA_ARGS__)
|
||||
EINA_LOG(DOM, EINA_LOG_LEVEL_DBG, fmt, ## __VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @def EINA_LOG_DOM_WARN(DOM, fmt, ...)
|
||||
* Logs a message with level WARN on the specified domain and format.
|
||||
*/
|
||||
#define EINA_LOG_DOM_WARN(DOM, fmt, ...) \
|
||||
EINA_LOG(DOM, EINA_LOG_LEVEL_WARN, fmt, ## __VA_ARGS__)
|
||||
EINA_LOG(DOM, EINA_LOG_LEVEL_WARN, fmt, ## __VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @def EINA_LOG_CRIT(fmt, ...)
|
||||
* Logs a message with level CRITICAL on the default domain with the specified
|
||||
* format.
|
||||
*/
|
||||
#define EINA_LOG_CRIT(fmt, ...) \
|
||||
EINA_LOG(EINA_LOG_DOMAIN_DEFAULT, \
|
||||
EINA_LOG_LEVEL_CRITICAL, \
|
||||
fmt, \
|
||||
## __VA_ARGS__)
|
||||
#define EINA_LOG_CRIT(fmt, ...) \
|
||||
EINA_LOG(EINA_LOG_DOMAIN_DEFAULT, \
|
||||
EINA_LOG_LEVEL_CRITICAL, \
|
||||
fmt, \
|
||||
## __VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @def EINA_LOG_ERR(fmt, ...)
|
||||
|
@ -193,7 +192,7 @@ EAPI extern int EINA_LOG_DOMAIN_GLOBAL;
|
|||
* format.
|
||||
*/
|
||||
#define EINA_LOG_ERR(fmt, ...) \
|
||||
EINA_LOG(EINA_LOG_DOMAIN_DEFAULT, EINA_LOG_LEVEL_ERR, fmt, ## __VA_ARGS__)
|
||||
EINA_LOG(EINA_LOG_DOMAIN_DEFAULT, EINA_LOG_LEVEL_ERR, fmt, ## __VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @def EINA_LOG_INFO(fmt, ...)
|
||||
|
@ -201,7 +200,7 @@ EAPI extern int EINA_LOG_DOMAIN_GLOBAL;
|
|||
* format.
|
||||
*/
|
||||
#define EINA_LOG_INFO(fmt, ...) \
|
||||
EINA_LOG(EINA_LOG_DOMAIN_DEFAULT, EINA_LOG_LEVEL_INFO, fmt, ## __VA_ARGS__)
|
||||
EINA_LOG(EINA_LOG_DOMAIN_DEFAULT, EINA_LOG_LEVEL_INFO, fmt, ## __VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @def EINA_LOG_WARN(fmt, ...)
|
||||
|
@ -209,7 +208,7 @@ EAPI extern int EINA_LOG_DOMAIN_GLOBAL;
|
|||
* format.
|
||||
*/
|
||||
#define EINA_LOG_WARN(fmt, ...) \
|
||||
EINA_LOG(EINA_LOG_DOMAIN_DEFAULT, EINA_LOG_LEVEL_WARN, fmt, ## __VA_ARGS__)
|
||||
EINA_LOG(EINA_LOG_DOMAIN_DEFAULT, EINA_LOG_LEVEL_WARN, fmt, ## __VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @def EINA_LOG_DBG(fmt, ...)
|
||||
|
@ -217,7 +216,7 @@ EAPI extern int EINA_LOG_DOMAIN_GLOBAL;
|
|||
* format.
|
||||
*/
|
||||
#define EINA_LOG_DBG(fmt, ...) \
|
||||
EINA_LOG(EINA_LOG_DOMAIN_DEFAULT, EINA_LOG_LEVEL_DBG, fmt, ## __VA_ARGS__)
|
||||
EINA_LOG(EINA_LOG_DOMAIN_DEFAULT, EINA_LOG_LEVEL_DBG, fmt, ## __VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @typedef Eina_Log_Domain
|
||||
|
@ -231,13 +230,13 @@ typedef struct _Eina_Log_Domain Eina_Log_Domain;
|
|||
*/
|
||||
struct _Eina_Log_Domain
|
||||
{
|
||||
int level; /**< Max level to log */
|
||||
int level; /**< Max level to log */
|
||||
const char *domain_str; /**< Formatted string with color to print */
|
||||
const char *name; /**< Domain name */
|
||||
size_t namelen; /**< strlen(name) */
|
||||
size_t namelen; /**< strlen(name) */
|
||||
|
||||
/* Private */
|
||||
Eina_Bool deleted : 1; /**< Flags deletion of domain, a free slot */
|
||||
Eina_Bool deleted : 1; /**< Flags deletion of domain, a free slot */
|
||||
};
|
||||
|
||||
EAPI void eina_log_threads_enable(void);
|
||||
|
@ -269,110 +268,83 @@ typedef void (*Eina_Log_Print_Cb)(const Eina_Log_Domain *d,
|
|||
/*
|
||||
* Customization
|
||||
*/
|
||||
EAPI void
|
||||
eina_log_print_cb_set(Eina_Log_Print_Cb cb, void *data) EINA_ARG_NONNULL(1);
|
||||
EAPI void eina_log_print_cb_set(Eina_Log_Print_Cb cb, void *data) EINA_ARG_NONNULL(1);
|
||||
|
||||
EAPI void
|
||||
eina_log_level_set(int level);
|
||||
EAPI int
|
||||
eina_log_level_get(void) EINA_WARN_UNUSED_RESULT;
|
||||
EAPI void eina_log_level_set(int level);
|
||||
EAPI int eina_log_level_get(void) EINA_WARN_UNUSED_RESULT;
|
||||
|
||||
static inline Eina_Bool
|
||||
eina_log_level_check(int level);
|
||||
eina_log_level_check(int level);
|
||||
|
||||
EAPI Eina_Bool
|
||||
eina_log_main_thread_check(void) EINA_CONST EINA_WARN_UNUSED_RESULT;
|
||||
EAPI Eina_Bool eina_log_main_thread_check(void) EINA_CONST EINA_WARN_UNUSED_RESULT;
|
||||
|
||||
EAPI void
|
||||
eina_log_color_disable_set(Eina_Bool disabled);
|
||||
EAPI Eina_Bool
|
||||
eina_log_color_disable_get(void) EINA_WARN_UNUSED_RESULT;
|
||||
EAPI void
|
||||
eina_log_file_disable_set(Eina_Bool disabled);
|
||||
EAPI Eina_Bool
|
||||
eina_log_file_disable_get(void) EINA_WARN_UNUSED_RESULT;
|
||||
EAPI void
|
||||
eina_log_function_disable_set(Eina_Bool disabled);
|
||||
EAPI Eina_Bool
|
||||
eina_log_function_disable_get(void) EINA_WARN_UNUSED_RESULT;
|
||||
EAPI void
|
||||
eina_log_abort_on_critical_set(Eina_Bool abort_on_critical);
|
||||
EAPI Eina_Bool
|
||||
eina_log_abort_on_critical_get(void) EINA_WARN_UNUSED_RESULT;
|
||||
EAPI void
|
||||
eina_log_abort_on_critical_level_set(int critical_level);
|
||||
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);
|
||||
EAPI int
|
||||
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
|
||||
eina_log_domain_level_check(int domain, int level);
|
||||
EAPI void eina_log_color_disable_set(Eina_Bool disabled);
|
||||
EAPI Eina_Bool eina_log_color_disable_get(void) EINA_WARN_UNUSED_RESULT;
|
||||
EAPI void eina_log_file_disable_set(Eina_Bool disabled);
|
||||
EAPI Eina_Bool eina_log_file_disable_get(void) EINA_WARN_UNUSED_RESULT;
|
||||
EAPI void eina_log_function_disable_set(Eina_Bool disabled);
|
||||
EAPI Eina_Bool eina_log_function_disable_get(void) EINA_WARN_UNUSED_RESULT;
|
||||
EAPI void eina_log_abort_on_critical_set(Eina_Bool abort_on_critical);
|
||||
EAPI Eina_Bool eina_log_abort_on_critical_get(void) EINA_WARN_UNUSED_RESULT;
|
||||
EAPI void eina_log_abort_on_critical_level_set(int critical_level);
|
||||
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);
|
||||
EAPI int 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 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);
|
||||
EAPI void
|
||||
eina_log_domain_unregister(int domain);
|
||||
EAPI int eina_log_domain_register(const char *name, const char *color) EINA_ARG_NONNULL(1);
|
||||
EAPI void eina_log_domain_unregister(int domain);
|
||||
|
||||
/*
|
||||
* Logging functions.
|
||||
*/
|
||||
EAPI void
|
||||
eina_log_print(int domain,
|
||||
Eina_Log_Level level,
|
||||
const char *file,
|
||||
const char *function,
|
||||
int line,
|
||||
const char *fmt,
|
||||
...) EINA_ARG_NONNULL(3, 4, 6) EINA_PRINTF(6, 7) EINA_NOINSTRUMENT;
|
||||
EAPI void
|
||||
eina_log_vprint(int domain,
|
||||
Eina_Log_Level level,
|
||||
const char *file,
|
||||
const char *fnc,
|
||||
int line,
|
||||
const char *fmt,
|
||||
va_list args) EINA_ARG_NONNULL(3, 4, 6) EINA_NOINSTRUMENT;
|
||||
|
||||
EAPI void eina_log_print(int domain,
|
||||
Eina_Log_Level level,
|
||||
const char *file,
|
||||
const char *function,
|
||||
int line,
|
||||
const char *fmt,
|
||||
...) EINA_ARG_NONNULL(3, 4, 6) EINA_PRINTF(6, 7) EINA_NOINSTRUMENT;
|
||||
EAPI void eina_log_vprint(int domain,
|
||||
Eina_Log_Level level,
|
||||
const char *file,
|
||||
const char *fnc,
|
||||
int line,
|
||||
const char *fmt,
|
||||
va_list args) EINA_ARG_NONNULL(3, 4, 6) EINA_NOINSTRUMENT;
|
||||
|
||||
/*
|
||||
* Logging methods (change how logging is done).
|
||||
*/
|
||||
EAPI void
|
||||
eina_log_print_cb_stdout(const Eina_Log_Domain *d,
|
||||
Eina_Log_Level level,
|
||||
const char *file,
|
||||
const char *fnc,
|
||||
int line,
|
||||
const char *fmt,
|
||||
void *data,
|
||||
va_list args);
|
||||
EAPI void
|
||||
eina_log_print_cb_stderr(const Eina_Log_Domain *d,
|
||||
Eina_Log_Level level,
|
||||
const char *file,
|
||||
const char *fnc,
|
||||
int line,
|
||||
const char *fmt,
|
||||
void *data,
|
||||
va_list args);
|
||||
EAPI void
|
||||
eina_log_print_cb_file(const Eina_Log_Domain *d,
|
||||
Eina_Log_Level level,
|
||||
const char *file,
|
||||
const char *fnc,
|
||||
int line,
|
||||
const char *fmt,
|
||||
void *data,
|
||||
va_list args);
|
||||
EAPI void eina_log_print_cb_stdout(const Eina_Log_Domain *d,
|
||||
Eina_Log_Level level,
|
||||
const char *file,
|
||||
const char *fnc,
|
||||
int line,
|
||||
const char *fmt,
|
||||
void *data,
|
||||
va_list args);
|
||||
EAPI void eina_log_print_cb_stderr(const Eina_Log_Domain *d,
|
||||
Eina_Log_Level level,
|
||||
const char *file,
|
||||
const char *fnc,
|
||||
int line,
|
||||
const char *fmt,
|
||||
void *data,
|
||||
va_list args);
|
||||
EAPI void eina_log_print_cb_file(const Eina_Log_Domain *d,
|
||||
Eina_Log_Level level,
|
||||
const char *file,
|
||||
const char *fnc,
|
||||
int line,
|
||||
const char *fmt,
|
||||
void *data,
|
||||
va_list args);
|
||||
|
||||
#include "eina_inline_log.x"
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#ifndef EINA_MAGIC_H_
|
||||
#define EINA_MAGIC_H_
|
||||
|
||||
|
||||
#include "eina_config.h"
|
||||
#include "eina_types.h"
|
||||
|
||||
|
@ -42,9 +41,9 @@ typedef unsigned int 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 Eina_Bool eina_magic_string_set(Eina_Magic magic,
|
||||
EAPI Eina_Bool eina_magic_string_set(Eina_Magic magic,
|
||||
const char *magic_name) EINA_ARG_NONNULL(2);
|
||||
EAPI Eina_Bool eina_magic_string_static_set(Eina_Magic magic,
|
||||
EAPI Eina_Bool eina_magic_string_static_set(Eina_Magic magic,
|
||||
const char *magic_name) EINA_ARG_NONNULL(2);
|
||||
|
||||
/**
|
||||
|
@ -55,7 +54,7 @@ EAPI Eina_Bool eina_magic_string_static_set(Eina_Magic magic,
|
|||
* If the magic feature of Eina is disabled, #EINA_MAGIC_NONE is just
|
||||
* @c 0.
|
||||
*/
|
||||
#define EINA_MAGIC_NONE 0x1234fedc
|
||||
#define EINA_MAGIC_NONE 0x1234fedc
|
||||
|
||||
#ifdef EINA_MAGIC_DEBUG
|
||||
|
||||
|
@ -76,7 +75,7 @@ EAPI Eina_Bool eina_magic_string_static_set(Eina_Magic magic,
|
|||
*
|
||||
* If the magic feature of Eina is disabled, #EINA_MAGIC does nothing.
|
||||
*/
|
||||
#define EINA_MAGIC Eina_Magic __magic;
|
||||
#define EINA_MAGIC Eina_Magic __magic;
|
||||
|
||||
/**
|
||||
* @def EINA_MAGIC_SET(d, m)
|
||||
|
@ -87,7 +86,7 @@ EAPI Eina_Bool eina_magic_string_static_set(Eina_Magic magic,
|
|||
* If the magic feature of Eina is disabled, #EINA_MAGIC_CHECK is just
|
||||
* the value @c 0.
|
||||
*/
|
||||
#define EINA_MAGIC_SET(d, m) (d)->__magic = (m)
|
||||
#define EINA_MAGIC_SET(d, m) (d)->__magic = (m)
|
||||
|
||||
/**
|
||||
* @def EINA_MAGIC_CHECK(d, m)
|
||||
|
@ -99,7 +98,7 @@ EAPI Eina_Bool eina_magic_string_static_set(Eina_Magic magic,
|
|||
* If the magic feature of Eina is disabled, #EINA_MAGIC_CHECK is just
|
||||
* the value @c 1.
|
||||
*/
|
||||
#define EINA_MAGIC_CHECK(d, m) ((d) && ((d)->__magic == (m)))
|
||||
#define EINA_MAGIC_CHECK(d, m) ((d) && ((d)->__magic == (m)))
|
||||
|
||||
/**
|
||||
* @def EINA_MAGIC_FAIL(d, m)
|
||||
|
@ -111,13 +110,13 @@ EAPI Eina_Bool eina_magic_string_static_set(Eina_Magic magic,
|
|||
* If the magic feature of Eina is disabled, #EINA_MAGIC_FAIL does
|
||||
* nothing.
|
||||
*/
|
||||
#define EINA_MAGIC_FAIL(d, m) \
|
||||
eina_magic_fail((void *)(d), \
|
||||
(d) ? (d)->__magic : 0, \
|
||||
(m), \
|
||||
__FILE__, \
|
||||
__FUNCTION__, \
|
||||
__LINE__);
|
||||
#define EINA_MAGIC_FAIL(d, m) \
|
||||
eina_magic_fail((void *)(d), \
|
||||
(d) ? (d)->__magic : 0, \
|
||||
(m), \
|
||||
__FILE__, \
|
||||
__FUNCTION__, \
|
||||
__LINE__);
|
||||
|
||||
EAPI void eina_magic_fail(void *d, Eina_Magic m, Eina_Magic req_m,
|
||||
const char *file, const char *fnc,
|
||||
|
@ -130,9 +129,9 @@ EAPI void eina_magic_fail(void *d, Eina_Magic m, Eina_Magic req_m,
|
|||
*/
|
||||
|
||||
#define EINA_MAGIC
|
||||
#define EINA_MAGIC_SET(d, m) ((void)0)
|
||||
#define EINA_MAGIC_CHECK(d, m) (1)
|
||||
#define EINA_MAGIC_FAIL(d, m) ((void)0)
|
||||
#define EINA_MAGIC_SET(d, m) ((void)0)
|
||||
#define EINA_MAGIC_CHECK(d, m) (1)
|
||||
#define EINA_MAGIC_FAIL(d, m) ((void)0)
|
||||
|
||||
#define eina_magic_fail(d, m, req_m, file, fnx, line) ((void)0)
|
||||
|
||||
|
|
|
@ -61,11 +61,10 @@ typedef struct _Eina_Matrixsparse_Row Eina_Matrixsparse_Row;
|
|||
* @typedef Eina_Matrixsparse_Cell
|
||||
* Type for a generic sparse matrix cell, opaque for users.
|
||||
*/
|
||||
typedef struct _Eina_Matrixsparse_Cell Eina_Matrixsparse_Cell;
|
||||
typedef struct _Eina_Matrixsparse_Cell Eina_Matrixsparse_Cell;
|
||||
|
||||
typedef struct _Eina_Matrixsparse_Item_Cell Eina_Matrixsparse_Item_Cell;
|
||||
typedef struct _Eina_Matrixsparse_Item_Row Eina_Matrixsparse_Item_Row;
|
||||
|
||||
typedef struct _Eina_Matrixsparse_Item_Row Eina_Matrixsparse_Item_Row;
|
||||
|
||||
/* constructors and destructors */
|
||||
EAPI Eina_Matrixsparse *eina_matrixsparse_new(unsigned long rows,
|
||||
|
@ -73,21 +72,21 @@ EAPI Eina_Matrixsparse *eina_matrixsparse_new(unsigned long rows,
|
|||
void (*free_func)(void *user_data,
|
||||
void *cell_data),
|
||||
const void *user_data);
|
||||
EAPI void eina_matrixsparse_free(Eina_Matrixsparse *m);
|
||||
EAPI void eina_matrixsparse_free(Eina_Matrixsparse *m);
|
||||
|
||||
/* size manipulation */
|
||||
EAPI void eina_matrixsparse_size_get(const Eina_Matrixsparse *m,
|
||||
unsigned long *rows,
|
||||
unsigned long *cols);
|
||||
EAPI Eina_Bool eina_matrixsparse_size_set(Eina_Matrixsparse *m,
|
||||
unsigned long rows,
|
||||
unsigned long cols);
|
||||
EAPI void eina_matrixsparse_size_get(const Eina_Matrixsparse *m,
|
||||
unsigned long *rows,
|
||||
unsigned long *cols);
|
||||
EAPI Eina_Bool eina_matrixsparse_size_set(Eina_Matrixsparse *m,
|
||||
unsigned long rows,
|
||||
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);
|
||||
|
@ -96,10 +95,10 @@ EAPI Eina_Bool eina_matrixsparse_data_idx_replace(Eina_Matrixsparse *m, unsigned
|
|||
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);
|
||||
|
|
|
@ -49,20 +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"
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
*/
|
||||
typedef struct _Eina_Module Eina_Module;
|
||||
|
||||
typedef Eina_Bool (*Eina_Module_Cb)(Eina_Module *m, void *data);
|
||||
typedef Eina_Bool (*Eina_Module_Cb)(Eina_Module *m, void *data);
|
||||
|
||||
/**
|
||||
* @typedef Eina_Module_Init
|
||||
|
@ -86,7 +86,7 @@ typedef void (*Eina_Module_Shutdown)(void);
|
|||
* declares the given function as the module initializer (__eina_module_init).
|
||||
* It must be of signature #Eina_Module_Init
|
||||
*/
|
||||
#define EINA_MODULE_INIT(f) EAPI Eina_Module_Init __eina_module_init = &f
|
||||
#define EINA_MODULE_INIT(f) EAPI Eina_Module_Init __eina_module_init = &f
|
||||
|
||||
/**
|
||||
* @def EINA_MODULE_SHUTDOWN
|
||||
|
@ -109,35 +109,35 @@ 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, Eina_Bool recursive, Eina_Module_Cb cb, void *data) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
|
||||
eina_module_list_get(Eina_Array *array, const char *path, Eina_Bool 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);
|
||||
eina_module_list_load(Eina_Array *list) EINA_ARG_NONNULL(1);
|
||||
EAPI void
|
||||
eina_module_list_unload(Eina_Array *list) EINA_ARG_NONNULL(1);
|
||||
eina_module_list_unload(Eina_Array *list) EINA_ARG_NONNULL(1);
|
||||
EAPI void
|
||||
eina_module_list_free(Eina_Array *list) EINA_ARG_NONNULL(1);
|
||||
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);
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#include "eina_inlist.h"
|
||||
|
||||
typedef struct _Eina_QuadTree Eina_QuadTree;
|
||||
typedef struct _Eina_QuadTree Eina_QuadTree;
|
||||
typedef struct _Eina_QuadTree_Item Eina_QuadTree_Item;
|
||||
|
||||
typedef enum {
|
||||
|
@ -34,7 +34,7 @@ typedef enum {
|
|||
|
||||
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);
|
||||
|
||||
|
@ -47,7 +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 void * eina_quadtree_object(Eina_Inlist *list);
|
||||
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
|
||||
|
|
|
@ -68,7 +68,7 @@ typedef enum {
|
|||
typedef struct _Eina_Rbtree Eina_Rbtree;
|
||||
struct _Eina_Rbtree
|
||||
{
|
||||
Eina_Rbtree *son[2];
|
||||
Eina_Rbtree *son[2];
|
||||
|
||||
Eina_Rbtree_Color color : 1;
|
||||
};
|
||||
|
@ -129,19 +129,18 @@ 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"
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
|
@ -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.
|
||||
|
@ -39,10 +39,10 @@
|
|||
*/
|
||||
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;
|
||||
|
||||
/**
|
||||
|
@ -51,27 +51,27 @@ typedef struct _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
|
||||
|
@ -88,10 +88,10 @@ EAPI void eina_rectangle_pool_release(Eina_Rectangle *rect) EINA_ARG_NONNULL(1);
|
|||
* 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);
|
||||
|
|
|
@ -64,7 +64,6 @@
|
|||
* @{
|
||||
*/
|
||||
|
||||
|
||||
#include "eina_config.h"
|
||||
#include "eina_error.h"
|
||||
|
||||
|
@ -78,112 +77,112 @@ EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED;
|
|||
|
||||
#include "eina_log.h"
|
||||
|
||||
#define EINA_SAFETY_ON_NULL_RETURN(exp) \
|
||||
do \
|
||||
{ \
|
||||
if (EINA_UNLIKELY((exp) == NULL)) \
|
||||
{ \
|
||||
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
|
||||
EINA_LOG_ERR("%s", "safety check failed: " # exp " == NULL"); \
|
||||
return; \
|
||||
} \
|
||||
} \
|
||||
#define EINA_SAFETY_ON_NULL_RETURN(exp) \
|
||||
do \
|
||||
{ \
|
||||
if (EINA_UNLIKELY((exp) == NULL)) \
|
||||
{ \
|
||||
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
|
||||
EINA_LOG_ERR("%s", "safety check failed: " # exp " == NULL"); \
|
||||
return; \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#define EINA_SAFETY_ON_NULL_RETURN_VAL(exp, val) \
|
||||
do \
|
||||
{ \
|
||||
if (EINA_UNLIKELY((exp) == NULL)) \
|
||||
{ \
|
||||
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
|
||||
EINA_LOG_ERR("%s", "safety check failed: " # exp " == NULL"); \
|
||||
return (val); \
|
||||
} \
|
||||
} \
|
||||
#define EINA_SAFETY_ON_NULL_RETURN_VAL(exp, val) \
|
||||
do \
|
||||
{ \
|
||||
if (EINA_UNLIKELY((exp) == NULL)) \
|
||||
{ \
|
||||
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
|
||||
EINA_LOG_ERR("%s", "safety check failed: " # exp " == NULL"); \
|
||||
return (val); \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#define EINA_SAFETY_ON_NULL_GOTO(exp, label) \
|
||||
do \
|
||||
{ \
|
||||
if (EINA_UNLIKELY((exp) == NULL)) \
|
||||
{ \
|
||||
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
|
||||
EINA_LOG_ERR("%s", "safety check failed: " # exp " == NULL"); \
|
||||
goto label; \
|
||||
} \
|
||||
} \
|
||||
#define EINA_SAFETY_ON_NULL_GOTO(exp, label) \
|
||||
do \
|
||||
{ \
|
||||
if (EINA_UNLIKELY((exp) == NULL)) \
|
||||
{ \
|
||||
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
|
||||
EINA_LOG_ERR("%s", "safety check failed: " # exp " == NULL"); \
|
||||
goto label; \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#define EINA_SAFETY_ON_TRUE_RETURN(exp) \
|
||||
do \
|
||||
{ \
|
||||
if (EINA_UNLIKELY(exp)) \
|
||||
{ \
|
||||
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
|
||||
EINA_LOG_ERR("%s", "safety check failed: " # exp " is true"); \
|
||||
return; \
|
||||
} \
|
||||
} \
|
||||
#define EINA_SAFETY_ON_TRUE_RETURN(exp) \
|
||||
do \
|
||||
{ \
|
||||
if (EINA_UNLIKELY(exp)) \
|
||||
{ \
|
||||
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
|
||||
EINA_LOG_ERR("%s", "safety check failed: " # exp " is true"); \
|
||||
return; \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#define EINA_SAFETY_ON_TRUE_RETURN_VAL(exp, val) \
|
||||
do \
|
||||
{ \
|
||||
if (EINA_UNLIKELY(exp)) \
|
||||
{ \
|
||||
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
|
||||
EINA_LOG_ERR("%s", "safety check failed: " # exp " is true"); \
|
||||
return val; \
|
||||
} \
|
||||
} \
|
||||
#define EINA_SAFETY_ON_TRUE_RETURN_VAL(exp, val) \
|
||||
do \
|
||||
{ \
|
||||
if (EINA_UNLIKELY(exp)) \
|
||||
{ \
|
||||
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
|
||||
EINA_LOG_ERR("%s", "safety check failed: " # exp " is true"); \
|
||||
return val; \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#define EINA_SAFETY_ON_TRUE_GOTO(exp, label) \
|
||||
do \
|
||||
{ \
|
||||
if (EINA_UNLIKELY(exp)) \
|
||||
{ \
|
||||
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
|
||||
EINA_LOG_ERR("%s", "safety check failed: " # exp " is true"); \
|
||||
goto label; \
|
||||
} \
|
||||
} \
|
||||
#define EINA_SAFETY_ON_TRUE_GOTO(exp, label) \
|
||||
do \
|
||||
{ \
|
||||
if (EINA_UNLIKELY(exp)) \
|
||||
{ \
|
||||
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
|
||||
EINA_LOG_ERR("%s", "safety check failed: " # exp " is true"); \
|
||||
goto label; \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#define EINA_SAFETY_ON_FALSE_RETURN(exp) \
|
||||
do \
|
||||
{ \
|
||||
if (EINA_UNLIKELY(!(exp))) \
|
||||
{ \
|
||||
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
|
||||
EINA_LOG_ERR("%s", "safety check failed: " # exp " is false"); \
|
||||
return; \
|
||||
} \
|
||||
} \
|
||||
#define EINA_SAFETY_ON_FALSE_RETURN(exp) \
|
||||
do \
|
||||
{ \
|
||||
if (EINA_UNLIKELY(!(exp))) \
|
||||
{ \
|
||||
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
|
||||
EINA_LOG_ERR("%s", "safety check failed: " # exp " is false"); \
|
||||
return; \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#define EINA_SAFETY_ON_FALSE_RETURN_VAL(exp, val) \
|
||||
do \
|
||||
{ \
|
||||
if (EINA_UNLIKELY(!(exp))) \
|
||||
{ \
|
||||
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
|
||||
EINA_LOG_ERR("%s", "safety check failed: " # exp " is false"); \
|
||||
return val; \
|
||||
} \
|
||||
} \
|
||||
#define EINA_SAFETY_ON_FALSE_RETURN_VAL(exp, val) \
|
||||
do \
|
||||
{ \
|
||||
if (EINA_UNLIKELY(!(exp))) \
|
||||
{ \
|
||||
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
|
||||
EINA_LOG_ERR("%s", "safety check failed: " # exp " is false"); \
|
||||
return val; \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#define EINA_SAFETY_ON_FALSE_GOTO(exp, label) \
|
||||
do \
|
||||
{ \
|
||||
if (EINA_UNLIKELY(!(exp))) \
|
||||
{ \
|
||||
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
|
||||
EINA_LOG_ERR("%s", "safety check failed: " # exp " is false"); \
|
||||
goto label; \
|
||||
} \
|
||||
} \
|
||||
#define EINA_SAFETY_ON_FALSE_GOTO(exp, label) \
|
||||
do \
|
||||
{ \
|
||||
if (EINA_UNLIKELY(!(exp))) \
|
||||
{ \
|
||||
eina_error_set(EINA_ERROR_SAFETY_FAILED); \
|
||||
EINA_LOG_ERR("%s", "safety check failed: " # exp " is false"); \
|
||||
goto label; \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#ifdef EINA_ARG_NONNULL
|
||||
|
@ -192,34 +191,33 @@ EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED;
|
|||
#define EINA_ARG_NONNULL(idx, ...)
|
||||
#endif
|
||||
|
||||
|
||||
#else /* no safety checks */
|
||||
|
||||
#define EINA_SAFETY_ON_NULL_RETURN(exp) \
|
||||
#define EINA_SAFETY_ON_NULL_RETURN(exp) \
|
||||
do { (void)(!(exp)); } while (0)
|
||||
|
||||
#define EINA_SAFETY_ON_NULL_RETURN_VAL(exp, val) \
|
||||
#define EINA_SAFETY_ON_NULL_RETURN_VAL(exp, val) \
|
||||
do { if (0 && !(exp)) { (void)val; } } while (0)
|
||||
|
||||
#define EINA_SAFETY_ON_NULL_GOTO(exp, label) \
|
||||
#define EINA_SAFETY_ON_NULL_GOTO(exp, label) \
|
||||
do { if (0 && (exp) == NULL) { goto label; } } while (0)
|
||||
|
||||
#define EINA_SAFETY_ON_TRUE_RETURN(exp) \
|
||||
#define EINA_SAFETY_ON_TRUE_RETURN(exp) \
|
||||
do { (void)(exp); } while (0)
|
||||
|
||||
#define EINA_SAFETY_ON_TRUE_RETURN_VAL(exp, val) \
|
||||
#define EINA_SAFETY_ON_TRUE_RETURN_VAL(exp, val) \
|
||||
do { if (0 && (exp)) { (void)val; } } while (0)
|
||||
|
||||
#define EINA_SAFETY_ON_TRUE_GOTO(exp, label) \
|
||||
#define EINA_SAFETY_ON_TRUE_GOTO(exp, label) \
|
||||
do { if (0 && (exp)) { goto label; } } while (0)
|
||||
|
||||
#define EINA_SAFETY_ON_FALSE_RETURN(exp) \
|
||||
#define EINA_SAFETY_ON_FALSE_RETURN(exp) \
|
||||
do { (void)(!(exp)); } while (0)
|
||||
|
||||
#define EINA_SAFETY_ON_FALSE_RETURN_VAL(exp, val) \
|
||||
#define EINA_SAFETY_ON_FALSE_RETURN_VAL(exp, val) \
|
||||
do { if (0 && !(exp)) { (void)val; } } while (0)
|
||||
|
||||
#define EINA_SAFETY_ON_FALSE_GOTO(exp, label) \
|
||||
#define EINA_SAFETY_ON_FALSE_GOTO(exp, label) \
|
||||
do { if (0 && !(exp)) { goto label; } } while (0)
|
||||
|
||||
#endif /* safety checks macros */
|
||||
|
|
|
@ -19,24 +19,24 @@
|
|||
*/
|
||||
|
||||
/* 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);
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ EAPI Eina_Strbuf *eina_strbuf_new(void) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
|
|||
* This function frees the memory of @p buf. @p buf must have been
|
||||
* created by eina_strbuf_new().
|
||||
*/
|
||||
EAPI void eina_strbuf_free(Eina_Strbuf *buf) EINA_ARG_NONNULL(1);
|
||||
EAPI void eina_strbuf_free(Eina_Strbuf *buf) EINA_ARG_NONNULL(1);
|
||||
|
||||
/**
|
||||
* @brief Reset a string buffer.
|
||||
|
@ -57,7 +57,7 @@ EAPI void eina_strbuf_free(Eina_Strbuf *buf) EINA_ARG_NONNULL(1);
|
|||
* This function reset @p buf: the buffer len is set to 0, and the
|
||||
* string is set to '\\0'. No memory is free'd.
|
||||
*/
|
||||
EAPI void eina_strbuf_reset(Eina_Strbuf *buf) EINA_ARG_NONNULL(1);
|
||||
EAPI void eina_strbuf_reset(Eina_Strbuf *buf) EINA_ARG_NONNULL(1);
|
||||
|
||||
/**
|
||||
* @brief Append a string to a buffer, reallocating as necessary.
|
||||
|
@ -75,7 +75,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.
|
||||
|
@ -88,7 +88,7 @@ EAPI Eina_Bool eina_strbuf_append(Eina_Strbuf *buf, const char *str) EINA_ARG
|
|||
* 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,
|
||||
|
@ -111,7 +111,7 @@ EAPI Eina_Bool eina_strbuf_append_escaped(Eina_Strbuf *buf, const char *str)
|
|||
* @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.
|
||||
|
@ -132,7 +132,7 @@ EAPI Eina_Bool eina_strbuf_append_n(Eina_Strbuf *buf, const char *str, size_t
|
|||
* @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
|
||||
|
@ -145,7 +145,7 @@ EAPI Eina_Bool eina_strbuf_append_length(Eina_Strbuf *buf, const char *str, s
|
|||
* 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.
|
||||
|
@ -156,7 +156,7 @@ EAPI Eina_Bool eina_strbuf_append_char(Eina_Strbuf *buf, char c) EINA_ARG_NON
|
|||
*
|
||||
* @see eina_strbuf_append()
|
||||
*/
|
||||
EAPI Eina_Bool eina_strbuf_append_printf(Eina_Strbuf *buf, const char *fmt, ...) EINA_ARG_NONNULL(1, 2) EINA_PRINTF(2, 3);
|
||||
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.
|
||||
|
@ -168,7 +168,7 @@ EAPI Eina_Bool eina_strbuf_append_printf(Eina_Strbuf *buf, const char *fmt, .
|
|||
*
|
||||
* @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.
|
||||
|
@ -184,7 +184,7 @@ EAPI Eina_Bool eina_strbuf_append_vprintf(Eina_Strbuf *buf, const char *fmt,
|
|||
* 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
|
||||
|
@ -199,7 +199,7 @@ EAPI Eina_Bool eina_strbuf_insert(Eina_Strbuf *buf, const char *str, size_t p
|
|||
* 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.
|
||||
|
@ -219,7 +219,7 @@ EAPI Eina_Bool eina_strbuf_insert_escaped(Eina_Strbuf *buf, const char *str,
|
|||
* @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.
|
||||
|
@ -241,7 +241,7 @@ EAPI Eina_Bool eina_strbuf_insert_n(Eina_Strbuf *buf, const char *str, size_t
|
|||
* @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
|
||||
|
@ -256,7 +256,7 @@ EAPI Eina_Bool eina_strbuf_insert_length(Eina_Strbuf *buf, const char *str, s
|
|||
* 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.
|
||||
|
@ -266,7 +266,7 @@ EAPI Eina_Bool eina_strbuf_insert_char(Eina_Strbuf *buf, char c, size_t pos)
|
|||
* @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.
|
||||
|
@ -277,7 +277,7 @@ EAPI Eina_Bool eina_strbuf_insert_printf(Eina_Strbuf *buf, const char *fmt, s
|
|||
* @param args The variable arguments.
|
||||
* @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)
|
||||
|
@ -291,7 +291,7 @@ EAPI Eina_Bool eina_strbuf_insert_vprintf(Eina_Strbuf *buf, const char *fmt,
|
|||
* can't prepend it, #EINA_FALSE is returned, otherwise #EINA_TRUE is
|
||||
* returned.
|
||||
*/
|
||||
#define eina_strbuf_prepend(buf, str) eina_strbuf_insert(buf, str, 0)
|
||||
#define eina_strbuf_prepend(buf, str) eina_strbuf_insert(buf, str, 0)
|
||||
|
||||
/**
|
||||
* @def eina_strbuf_prepend_escaped(buf, str)
|
||||
|
@ -305,7 +305,7 @@ EAPI Eina_Bool eina_strbuf_insert_vprintf(Eina_Strbuf *buf, const char *fmt,
|
|||
* @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)
|
||||
|
@ -320,7 +320,7 @@ EAPI Eina_Bool eina_strbuf_insert_vprintf(Eina_Strbuf *buf, const char *fmt,
|
|||
* @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)
|
||||
|
@ -335,7 +335,7 @@ EAPI Eina_Bool eina_strbuf_insert_vprintf(Eina_Strbuf *buf, const char *fmt,
|
|||
* @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)
|
||||
|
@ -349,7 +349,7 @@ EAPI Eina_Bool eina_strbuf_insert_vprintf(Eina_Strbuf *buf, const char *fmt,
|
|||
* @p buf can't prepend it, #EINA_FALSE is returned, otherwise
|
||||
* #EINA_TRUE is returned.
|
||||
*/
|
||||
#define eina_strbuf_prepend_char(buf, c) eina_strbuf_insert_char(buf, c, 0)
|
||||
#define eina_strbuf_prepend_char(buf, c) eina_strbuf_insert_char(buf, c, 0)
|
||||
|
||||
/**
|
||||
* @def eina_strbuf_prepend_printf(buf, fmt, ...)
|
||||
|
@ -363,7 +363,7 @@ EAPI Eina_Bool eina_strbuf_insert_vprintf(Eina_Strbuf *buf, const char *fmt,
|
|||
* 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)
|
||||
|
@ -378,7 +378,7 @@ EAPI Eina_Bool eina_strbuf_insert_vprintf(Eina_Strbuf *buf, const char *fmt,
|
|||
* 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.
|
||||
|
@ -445,7 +445,7 @@ EAPI void 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) EINA_WARN_UNUSED_RESULT;
|
||||
EAPI size_t eina_strbuf_length_get(const Eina_Strbuf *buf) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
|
||||
|
||||
EAPI Eina_Bool eina_strbuf_replace(Eina_Strbuf *buf, const char *str, const char *with, unsigned int n) EINA_ARG_NONNULL(1, 2, 3);
|
||||
|
||||
|
|
|
@ -67,12 +67,12 @@
|
|||
* @{
|
||||
*/
|
||||
|
||||
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 EINA_PRINTF(1, 2);
|
||||
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 EINA_PRINTF(2, 3);
|
||||
EAPI const char * eina_stringshare_ref(const char *str);
|
||||
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 EINA_PRINTF(1, 2);
|
||||
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 EINA_PRINTF(2, 3);
|
||||
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_PURE EINA_WARN_UNUSED_RESULT;
|
||||
EAPI void eina_stringshare_dump(void);
|
||||
|
|
|
@ -53,28 +53,27 @@ typedef struct Eina_Tile_Grid_Info Eina_Tile_Grid_Info;
|
|||
*/
|
||||
struct Eina_Tile_Grid_Info
|
||||
{
|
||||
unsigned long col; /**< column of the tiler grid */
|
||||
unsigned long row; /**< row of the tiler grid*/
|
||||
unsigned long col; /**< column of the tiler grid */
|
||||
unsigned long row; /**< row of the tiler grid*/
|
||||
Eina_Rectangle rect; /**< rectangle of the tiler grid*/
|
||||
Eina_Bool full; /**< whether the grid is full or not */
|
||||
Eina_Bool full; /**< whether the grid is full or not */
|
||||
};
|
||||
|
||||
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 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);
|
||||
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 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);
|
||||
|
||||
#include "eina_inline_tiler.x"
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
|
@ -96,7 +96,6 @@
|
|||
# undef EINA_LIKELY
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __GNUC__
|
||||
# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
|
||||
# define EINA_WARN_UNUSED_RESULT __attribute__ ((warn_unused_result))
|
||||
|
@ -118,20 +117,20 @@
|
|||
|
||||
# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
|
||||
# define EINA_MALLOC __attribute__ ((malloc))
|
||||
# define EINA_PURE __attribute__ ((pure))
|
||||
# define EINA_PURE __attribute__ ((pure))
|
||||
# else
|
||||
# define EINA_MALLOC
|
||||
# define EINA_PURE
|
||||
# endif
|
||||
|
||||
# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
|
||||
# define EINA_PRINTF(fmt, arg) __attribute__((format (printf, fmt, arg)))
|
||||
# define EINA_PRINTF(fmt, arg) __attribute__((format (printf, fmt, arg)))
|
||||
# define EINA_SCANF(fmt, arg) __attribute__((format (scanf, fmt, arg)))
|
||||
# define EINA_FORMAT(fmt) __attribute__((format_arg(fmt)))
|
||||
# define EINA_CONST __attribute__((const))
|
||||
# define EINA_FORMAT(fmt) __attribute__((format_arg(fmt)))
|
||||
# define EINA_CONST __attribute__((const))
|
||||
# define EINA_NOINSTRUMENT __attribute__((no_instrument_function))
|
||||
# define EINA_UNLIKELY(exp) __builtin_expect((exp), 0)
|
||||
# define EINA_LIKELY(exp) __builtin_expect((exp), 1)
|
||||
# define EINA_UNLIKELY(exp) __builtin_expect((exp), 0)
|
||||
# define EINA_LIKELY(exp) __builtin_expect((exp), 1)
|
||||
# else
|
||||
# define EINA_PRINTF(fmt, arg)
|
||||
# define EINA_SCANF(fmt, arg)
|
||||
|
@ -139,7 +138,7 @@
|
|||
# define EINA_CONST
|
||||
# define EINA_NOINSTRUMENT
|
||||
# define EINA_UNLIKELY(exp) exp
|
||||
# define EINA_LIKELY(exp) exp
|
||||
# define EINA_LIKELY(exp) exp
|
||||
# endif
|
||||
|
||||
#elif defined(_WIN32)
|
||||
|
@ -158,7 +157,7 @@
|
|||
# define EINA_CONST
|
||||
# define EINA_NOINSTRUMENT
|
||||
# define EINA_UNLIKELY(exp) exp
|
||||
# define EINA_LIKELY(exp) exp
|
||||
# define EINA_LIKELY(exp) exp
|
||||
|
||||
#elif defined(__SUNPRO_C)
|
||||
# define EINA_WARN_UNUSED_RESULT
|
||||
|
@ -166,7 +165,7 @@
|
|||
# define EINA_DEPRECATED
|
||||
# if __SUNPRO_C >= 0x590
|
||||
# define EINA_MALLOC __attribute__ ((malloc))
|
||||
# define EINA_PURE __attribute__ ((pure))
|
||||
# define EINA_PURE __attribute__ ((pure))
|
||||
# else
|
||||
# define EINA_MALLOC
|
||||
# define EINA_PURE
|
||||
|
@ -181,7 +180,7 @@
|
|||
# endif
|
||||
# define EINA_NOINSTRUMENT
|
||||
# define EINA_UNLIKELY(exp) exp
|
||||
# define EINA_LIKELY(exp) exp
|
||||
# define EINA_LIKELY(exp) exp
|
||||
|
||||
#else /* ! __GNUC__ && ! _WIN32 && ! __SUNPRO_C */
|
||||
|
||||
|
@ -210,10 +209,9 @@
|
|||
# define EINA_CONST
|
||||
# define EINA_NOINSTRUMENT
|
||||
# define EINA_UNLIKELY(exp) exp
|
||||
# define EINA_LIKELY(exp) exp
|
||||
# define EINA_LIKELY(exp) exp
|
||||
#endif /* ! __GNUC__ && ! _WIN32 && ! __SUNPRO_C */
|
||||
|
||||
|
||||
/**
|
||||
* @typedef Eina_Bool
|
||||
* Type to mimic a boolean.
|
||||
|
@ -234,7 +232,7 @@ typedef unsigned char Eina_Bool;
|
|||
* @def EINA_TRUE
|
||||
* boolean value TRUE (numerical value 1)
|
||||
*/
|
||||
#define EINA_TRUE ((Eina_Bool)1)
|
||||
#define EINA_TRUE ((Eina_Bool)1)
|
||||
|
||||
EAPI extern const unsigned int eina_prime_table[];
|
||||
|
||||
|
|
|
@ -41,9 +41,8 @@ typedef unsigned int Eina_Unicode;
|
|||
|
||||
EAPI extern const Eina_Unicode *EINA_UNICODE_EMPTY_STRING;
|
||||
|
||||
EAPI size_t eina_unicode_strlen(const Eina_Unicode *ustr) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT EINA_PURE;
|
||||
EAPI size_t eina_unicode_strnlen(const Eina_Unicode *ustr, int n) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT EINA_PURE;
|
||||
|
||||
EAPI size_t eina_unicode_strlen(const Eina_Unicode *ustr) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT EINA_PURE;
|
||||
EAPI size_t eina_unicode_strnlen(const Eina_Unicode *ustr, int n) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT EINA_PURE;
|
||||
|
||||
EAPI Eina_Unicode *eina_unicode_strdup(const Eina_Unicode *text) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ EAPI Eina_UStrbuf *eina_ustrbuf_new(void) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
|
|||
* This function frees the memory of @p buf. @p buf must have been
|
||||
* created by eina_ustrbuf_new().
|
||||
*/
|
||||
EAPI void eina_ustrbuf_free(Eina_UStrbuf *buf) EINA_ARG_NONNULL(1);
|
||||
EAPI void eina_ustrbuf_free(Eina_UStrbuf *buf) EINA_ARG_NONNULL(1);
|
||||
|
||||
/**
|
||||
* @brief Reset a string buffer.
|
||||
|
@ -57,7 +57,7 @@ EAPI void eina_ustrbuf_free(Eina_UStrbuf *buf) EINA_ARG_NONNULL(1);
|
|||
* This function reset @p buf: the buffer len is set to 0, and the
|
||||
* string is set to '\\0'. No memory is free'd.
|
||||
*/
|
||||
EAPI void eina_ustrbuf_reset(Eina_UStrbuf *buf) EINA_ARG_NONNULL(1);
|
||||
EAPI void eina_ustrbuf_reset(Eina_UStrbuf *buf) EINA_ARG_NONNULL(1);
|
||||
|
||||
/**
|
||||
* @brief Append a string to a buffer, reallocating as necessary.
|
||||
|
@ -75,7 +75,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.
|
||||
|
@ -88,7 +88,7 @@ EAPI Eina_Bool eina_ustrbuf_append(Eina_UStrbuf *buf, const Eina_Unicode *st
|
|||
* 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,
|
||||
|
@ -111,7 +111,7 @@ EAPI Eina_Bool eina_ustrbuf_append_escaped(Eina_UStrbuf *buf, const Eina_Uni
|
|||
* @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.
|
||||
|
@ -132,7 +132,7 @@ EAPI Eina_Bool eina_ustrbuf_append_n(Eina_UStrbuf *buf, const Eina_Unicode *
|
|||
* @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
|
||||
|
@ -145,7 +145,7 @@ EAPI Eina_Bool eina_ustrbuf_append_length(Eina_UStrbuf *buf, const Eina_Unic
|
|||
* 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.
|
||||
|
@ -161,7 +161,7 @@ EAPI Eina_Bool eina_ustrbuf_append_char(Eina_UStrbuf *buf, Eina_Unicode c) E
|
|||
* 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
|
||||
|
@ -176,7 +176,7 @@ EAPI Eina_Bool eina_ustrbuf_insert(Eina_UStrbuf *buf, const Eina_Unicode *st
|
|||
* 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.
|
||||
|
@ -196,7 +196,7 @@ EAPI Eina_Bool eina_ustrbuf_insert_escaped(Eina_UStrbuf *buf, const Eina_Uni
|
|||
* @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.
|
||||
|
@ -218,7 +218,7 @@ EAPI Eina_Bool eina_ustrbuf_insert_n(Eina_UStrbuf *buf, const Eina_Unicode *
|
|||
* @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
|
||||
|
@ -233,7 +233,7 @@ EAPI Eina_Bool eina_ustrbuf_insert_length(Eina_UStrbuf *buf, const Eina_Unic
|
|||
* 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)
|
||||
|
@ -247,7 +247,7 @@ EAPI Eina_Bool eina_ustrbuf_insert_char(Eina_UStrbuf *buf, Eina_Unicode c, s
|
|||
* can't prepend it, #EINA_FALSE is returned, otherwise #EINA_TRUE is
|
||||
* returned.
|
||||
*/
|
||||
#define eina_ustrbuf_prepend(buf, str) eina_ustrbuf_insert(buf, str, 0)
|
||||
#define eina_ustrbuf_prepend(buf, str) eina_ustrbuf_insert(buf, str, 0)
|
||||
|
||||
/**
|
||||
* @def eina_ustrbuf_prepend_escaped(buf, str)
|
||||
|
@ -261,7 +261,7 @@ EAPI Eina_Bool eina_ustrbuf_insert_char(Eina_UStrbuf *buf, Eina_Unicode c, s
|
|||
* @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)
|
||||
|
@ -276,7 +276,7 @@ EAPI Eina_Bool eina_ustrbuf_insert_char(Eina_UStrbuf *buf, Eina_Unicode c, s
|
|||
* @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)
|
||||
|
@ -319,7 +319,7 @@ EAPI Eina_Bool eina_ustrbuf_insert_char(Eina_UStrbuf *buf, Eina_Unicode c, s
|
|||
* 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)
|
||||
|
|
Loading…
Reference in New Issue