summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2010-08-16 06:14:19 +0000
committerCarsten Haitzler <raster@rasterman.com>2010-08-16 06:14:19 +0000
commitf4b68549cb235c84c453658c457fe57c9880b7fe (patch)
tree8c8a84c3181405c7e68914567f5ba3b04da460b3 /legacy
parentf6b902d4be2f7c00199effe2c71945686a8cf032 (diff)
formatting. ok - maybe we can have a debate on it, but its better than
it was before. debate up for grabs for now. wont touch other lib headers until resolved for eina. it's the worst anyway. SVN revision: 51156
Diffstat (limited to 'legacy')
-rw-r--r--legacy/eina/src/include/eina_accessor.h10
-rw-r--r--legacy/eina/src/include/eina_array.h27
-rw-r--r--legacy/eina/src/include/eina_benchmark.h10
-rw-r--r--legacy/eina/src/include/eina_binshare.h15
-rw-r--r--legacy/eina/src/include/eina_convert.h21
-rw-r--r--legacy/eina/src/include/eina_counter.h11
-rw-r--r--legacy/eina/src/include/eina_error.h13
-rw-r--r--legacy/eina/src/include/eina_file.h27
-rw-r--r--legacy/eina/src/include/eina_fp.h45
-rw-r--r--legacy/eina/src/include/eina_hash.h98
-rw-r--r--legacy/eina/src/include/eina_inlist.h36
11 files changed, 192 insertions, 121 deletions
diff --git a/legacy/eina/src/include/eina_accessor.h b/legacy/eina/src/include/eina_accessor.h
index 2761250510..3e715dbcbd 100644
--- a/legacy/eina/src/include/eina_accessor.h
+++ b/legacy/eina/src/include/eina_accessor.h
@@ -68,9 +68,15 @@ struct _Eina_Accessor
68#define FUNC_ACCESSOR_LOCK(Function) ((Eina_Accessor_Lock_Callback)Function) 68#define FUNC_ACCESSOR_LOCK(Function) ((Eina_Accessor_Lock_Callback)Function)
69 69
70EAPI void eina_accessor_free(Eina_Accessor *accessor) EINA_ARG_NONNULL(1); 70EAPI void eina_accessor_free(Eina_Accessor *accessor) EINA_ARG_NONNULL(1);
71EAPI Eina_Bool eina_accessor_data_get(Eina_Accessor *accessor, unsigned int position, void **data) EINA_ARG_NONNULL(1); 71EAPI Eina_Bool eina_accessor_data_get(Eina_Accessor *accessor,
72 unsigned int position,
73 void **data) EINA_ARG_NONNULL(1);
72EAPI void * eina_accessor_container_get(Eina_Accessor *accessor) EINA_ARG_NONNULL(1) EINA_PURE; 74EAPI void * eina_accessor_container_get(Eina_Accessor *accessor) EINA_ARG_NONNULL(1) EINA_PURE;
73EAPI 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); 75EAPI void eina_accessor_over(Eina_Accessor *accessor,
76 Eina_Each_Cb cb,
77 unsigned int start,
78 unsigned int end,
79 const void *fdata) EINA_ARG_NONNULL(1, 2);
74EAPI Eina_Bool eina_accessor_lock(Eina_Accessor *accessor) EINA_ARG_NONNULL(1); 80EAPI Eina_Bool eina_accessor_lock(Eina_Accessor *accessor) EINA_ARG_NONNULL(1);
75EAPI Eina_Bool eina_accessor_unlock(Eina_Accessor *accessor) EINA_ARG_NONNULL(1); 81EAPI Eina_Bool eina_accessor_unlock(Eina_Accessor *accessor) EINA_ARG_NONNULL(1);
76 82
diff --git a/legacy/eina/src/include/eina_array.h b/legacy/eina/src/include/eina_array.h
index 318b9f3c6a..6cdf738858 100644
--- a/legacy/eina/src/include/eina_array.h
+++ b/legacy/eina/src/include/eina_array.h
@@ -78,33 +78,36 @@ struct _Eina_Array
78 pthread_rwlock_t lock; 78 pthread_rwlock_t lock;
79 Eina_Bool threadsafe:1; 79 Eina_Bool threadsafe:1;
80#endif 80#endif
81
82 EINA_MAGIC 81 EINA_MAGIC
83}; 82};
84 83
85EAPI Eina_Array * eina_array_new(unsigned int step) EINA_WARN_UNUSED_RESULT EINA_MALLOC EINA_WARN_UNUSED_RESULT; 84EAPI Eina_Array * eina_array_new(unsigned int step) EINA_WARN_UNUSED_RESULT EINA_MALLOC EINA_WARN_UNUSED_RESULT;
86EAPI Eina_Array * eina_array_threadsafe_new(unsigned int step) EINA_WARN_UNUSED_RESULT EINA_MALLOC EINA_WARN_UNUSED_RESULT; 85EAPI Eina_Array * eina_array_threadsafe_new(unsigned int step) EINA_WARN_UNUSED_RESULT EINA_MALLOC EINA_WARN_UNUSED_RESULT;
87EAPI void eina_array_free(Eina_Array *array) EINA_ARG_NONNULL(1); 86EAPI void eina_array_free(Eina_Array *array) EINA_ARG_NONNULL(1);
88EAPI void eina_array_step_set(Eina_Array *array, unsigned int step) EINA_ARG_NONNULL(1); 87EAPI void eina_array_step_set(Eina_Array *array,
88 unsigned int step) EINA_ARG_NONNULL(1);
89EAPI void eina_array_clean(Eina_Array *array) EINA_ARG_NONNULL(1); 89EAPI void eina_array_clean(Eina_Array *array) EINA_ARG_NONNULL(1);
90EAPI void eina_array_flush(Eina_Array *array) EINA_ARG_NONNULL(1); 90EAPI void eina_array_flush(Eina_Array *array) EINA_ARG_NONNULL(1);
91EAPI Eina_Bool eina_array_remove(Eina_Array *array, Eina_Bool(*keep)(void *data, void *gdata), void *gdata) EINA_ARG_NONNULL(1, 2); 91EAPI Eina_Bool eina_array_remove(Eina_Array *array,
92 92 Eina_Bool(*keep)(void *data, void *gdata),
93static inline Eina_Bool eina_array_push(Eina_Array *array, const void *data) EINA_ARG_NONNULL(1, 2); 93 void *gdata) EINA_ARG_NONNULL(1, 2);
94static inline Eina_Bool eina_array_push(Eina_Array *array,
95 const void *data) EINA_ARG_NONNULL(1, 2);
94static inline void * eina_array_pop(Eina_Array *array) EINA_ARG_NONNULL(1); 96static inline void * eina_array_pop(Eina_Array *array) EINA_ARG_NONNULL(1);
95static inline void * eina_array_data_get(const Eina_Array *array, unsigned int idx) EINA_ARG_NONNULL(1); 97static inline void * eina_array_data_get(const Eina_Array *array,
96static inline void eina_array_data_set(const Eina_Array *array, unsigned int idx, const void *data) EINA_ARG_NONNULL(1, 3); 98 unsigned int idx) EINA_ARG_NONNULL(1);
99static inline void eina_array_data_set(const Eina_Array *array,
100 unsigned int idx,
101 const void *data) EINA_ARG_NONNULL(1, 3);
97static inline unsigned int eina_array_count_get(const Eina_Array *array) EINA_ARG_NONNULL(1); 102static inline unsigned int eina_array_count_get(const Eina_Array *array) EINA_ARG_NONNULL(1);
98
99EAPI Eina_Iterator * eina_array_iterator_new(const Eina_Array *array) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT; 103EAPI Eina_Iterator * eina_array_iterator_new(const Eina_Array *array) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
100EAPI Eina_Accessor * eina_array_accessor_new(const Eina_Array *array) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT; 104EAPI Eina_Accessor * eina_array_accessor_new(const Eina_Array *array) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
101
102static inline Eina_Bool eina_array_rdlock(const Eina_Array *array); 105static inline Eina_Bool eina_array_rdlock(const Eina_Array *array);
103static inline Eina_Bool eina_array_wrlock(Eina_Array *array); 106static inline Eina_Bool eina_array_wrlock(Eina_Array *array);
104static inline Eina_Bool eina_array_unlock(const Eina_Array *array); 107static inline Eina_Bool eina_array_unlock(const Eina_Array *array);
105 108static inline Eina_Bool eina_array_foreach(Eina_Array *array,
106static inline Eina_Bool eina_array_foreach(Eina_Array *array, Eina_Each_Cb cb, void *data); 109 Eina_Each_Cb cb,
107 110 void *data);
108/** 111/**
109 * @def EINA_ARRAY_ITER_NEXT 112 * @def EINA_ARRAY_ITER_NEXT
110 * @brief Macro to iterate over an array easily. 113 * @brief Macro to iterate over an array easily.
diff --git a/legacy/eina/src/include/eina_benchmark.h b/legacy/eina/src/include/eina_benchmark.h
index e876d601ca..e0faa722df 100644
--- a/legacy/eina/src/include/eina_benchmark.h
+++ b/legacy/eina/src/include/eina_benchmark.h
@@ -55,9 +55,15 @@ typedef void (*Eina_Benchmark_Specimens)(int request);
55 */ 55 */
56#define EINA_BENCHMARK(function) ((Eina_Benchmark_Specimens)function) 56#define EINA_BENCHMARK(function) ((Eina_Benchmark_Specimens)function)
57 57
58EAPI Eina_Benchmark * eina_benchmark_new(const char *name, const char *run); 58EAPI Eina_Benchmark * eina_benchmark_new(const char *name,
59 const char *run);
59EAPI void eina_benchmark_free(Eina_Benchmark *bench); 60EAPI void eina_benchmark_free(Eina_Benchmark *bench);
60EAPI 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); 61EAPI Eina_Bool eina_benchmark_register(Eina_Benchmark *bench,
62 const char *name,
63 Eina_Benchmark_Specimens bench_cb,
64 int count_start,
65 int count_end,
66 int count_set);
61EAPI Eina_Array * eina_benchmark_run(Eina_Benchmark *bench); 67EAPI Eina_Array * eina_benchmark_run(Eina_Benchmark *bench);
62 68
63/** 69/**
diff --git a/legacy/eina/src/include/eina_binshare.h b/legacy/eina/src/include/eina_binshare.h
index 7a19462d44..a2ea50198e 100644
--- a/legacy/eina/src/include/eina_binshare.h
+++ b/legacy/eina/src/include/eina_binshare.h
@@ -65,13 +65,14 @@
65 * @{ 65 * @{
66 */ 66 */
67 67
68EAPI Eina_Bool eina_binshare_init(void); 68EAPI Eina_Bool eina_binshare_init(void);
69EAPI Eina_Bool eina_binshare_shutdown(void); 69EAPI Eina_Bool eina_binshare_shutdown(void);
70EAPI const void *eina_binshare_add_length(const void *obj, unsigned int olen) EINA_PURE EINA_WARN_UNUSED_RESULT; 70EAPI const void * eina_binshare_add_length(const void *obj,
71EAPI const void *eina_binshare_ref(const void *obj); 71 unsigned int olen) EINA_PURE EINA_WARN_UNUSED_RESULT;
72EAPI void eina_binshare_del(const void *obj); 72EAPI const void * eina_binshare_ref(const void *obj);
73EAPI int eina_binshare_length(const void *obj) EINA_WARN_UNUSED_RESULT; 73EAPI void eina_binshare_del(const void *obj);
74EAPI void eina_binshare_dump(void); 74EAPI int eina_binshare_length(const void *obj) EINA_WARN_UNUSED_RESULT;
75EAPI void eina_binshare_dump(void);
75 76
76/** 77/**
77 * @brief Retrieve an instance of a blob for use in a program. 78 * @brief Retrieve an instance of a blob for use in a program.
diff --git a/legacy/eina/src/include/eina_convert.h b/legacy/eina/src/include/eina_convert.h
index 43e4244acd..d185ae1a3c 100644
--- a/legacy/eina/src/include/eina_convert.h
+++ b/legacy/eina/src/include/eina_convert.h
@@ -54,12 +54,21 @@ EAPI extern Eina_Error EINA_ERROR_CONVERT_0X_NOT_FOUND;
54 */ 54 */
55EAPI extern Eina_Error EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH; 55EAPI extern Eina_Error EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH;
56 56
57EAPI int eina_convert_itoa(int n, char *s) EINA_ARG_NONNULL(2); 57EAPI int eina_convert_itoa(int n,
58EAPI int eina_convert_xtoa(unsigned int n, char *s) EINA_ARG_NONNULL(2); 58 char *s) EINA_ARG_NONNULL(2);
59EAPI int eina_convert_dtoa(double d, char *des) EINA_ARG_NONNULL(2); 59EAPI int eina_convert_xtoa(unsigned int n,
60EAPI Eina_Bool eina_convert_atod(const char *src, int length, long long *m, long *e) EINA_ARG_NONNULL(1,3,4); 60 char *s) EINA_ARG_NONNULL(2);
61EAPI int eina_convert_fptoa(Eina_F32p32 fp, char *des) EINA_ARG_NONNULL(2); 61EAPI int eina_convert_dtoa(double d,
62EAPI Eina_Bool eina_convert_atofp(const char *src, int length, Eina_F32p32 *fp) EINA_ARG_NONNULL(1,3); 62 char *des) EINA_ARG_NONNULL(2);
63EAPI Eina_Bool eina_convert_atod(const char *src,
64 int length,
65 long long *m,
66 long *e) EINA_ARG_NONNULL(1,3,4);
67EAPI int eina_convert_fptoa(Eina_F32p32 fp,
68 char *des) EINA_ARG_NONNULL(2);
69EAPI Eina_Bool eina_convert_atofp(const char *src,
70 int length,
71 Eina_F32p32 *fp) EINA_ARG_NONNULL(1,3);
63 72
64/** 73/**
65 * @} 74 * @}
diff --git a/legacy/eina/src/include/eina_counter.h b/legacy/eina/src/include/eina_counter.h
index 7d0abbee40..fc7b23f533 100644
--- a/legacy/eina/src/include/eina_counter.h
+++ b/legacy/eina/src/include/eina_counter.h
@@ -39,11 +39,12 @@
39 */ 39 */
40typedef struct _Eina_Counter Eina_Counter; 40typedef struct _Eina_Counter Eina_Counter;
41 41
42EAPI Eina_Counter * eina_counter_new( const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1); 42EAPI Eina_Counter * eina_counter_new(const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
43EAPI void eina_counter_free( Eina_Counter *counter) EINA_ARG_NONNULL(1); 43EAPI void eina_counter_free(Eina_Counter *counter) EINA_ARG_NONNULL(1);
44EAPI void eina_counter_start( Eina_Counter *counter) EINA_ARG_NONNULL(1); 44EAPI void eina_counter_start(Eina_Counter *counter) EINA_ARG_NONNULL(1);
45EAPI void eina_counter_stop( Eina_Counter *counter, int specimen) EINA_ARG_NONNULL(1); 45EAPI void eina_counter_stop(Eina_Counter *counter,
46EAPI char * eina_counter_dump( Eina_Counter *counter) EINA_ARG_NONNULL(1); 46 int specimen) EINA_ARG_NONNULL(1);
47EAPI char * eina_counter_dump(Eina_Counter *counter) EINA_ARG_NONNULL(1);
47 48
48/** 49/**
49 * @} 50 * @}
diff --git a/legacy/eina/src/include/eina_error.h b/legacy/eina/src/include/eina_error.h
index 8ca76beb67..7b290de8bc 100644
--- a/legacy/eina/src/include/eina_error.h
+++ b/legacy/eina/src/include/eina_error.h
@@ -47,12 +47,13 @@ typedef int Eina_Error;
47 */ 47 */
48EAPI extern Eina_Error EINA_ERROR_OUT_OF_MEMORY; 48EAPI extern Eina_Error EINA_ERROR_OUT_OF_MEMORY;
49 49
50EAPI Eina_Error eina_error_msg_register(const char *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT; 50EAPI Eina_Error eina_error_msg_register(const char *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
51EAPI Eina_Error eina_error_msg_static_register(const char *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT; 51EAPI Eina_Error eina_error_msg_static_register(const char *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
52EAPI Eina_Bool eina_error_msg_modify(Eina_Error error, const char *msg) EINA_ARG_NONNULL(1, 2); 52EAPI Eina_Bool eina_error_msg_modify(Eina_Error error,
53EAPI Eina_Error eina_error_get(void); 53 const char *msg) EINA_ARG_NONNULL(1, 2);
54EAPI void eina_error_set(Eina_Error err); 54EAPI Eina_Error eina_error_get(void);
55EAPI const char *eina_error_msg_get(Eina_Error error) EINA_PURE; 55EAPI void eina_error_set(Eina_Error err);
56EAPI const char * eina_error_msg_get(Eina_Error error) EINA_PURE;
56 57
57/** 58/**
58 * @} 59 * @}
diff --git a/legacy/eina/src/include/eina_file.h b/legacy/eina/src/include/eina_file.h
index 53a7974ee8..b7a4ef63a6 100644
--- a/legacy/eina/src/include/eina_file.h
+++ b/legacy/eina/src/include/eina_file.h
@@ -44,8 +44,18 @@
44 * @typedef Eina_File_Dir_List_Cb 44 * @typedef Eina_File_Dir_List_Cb
45 * Type for a callback. 45 * Type for a callback.
46 */ 46 */
47typedef struct _Eina_File_Direct_Info Eina_File_Direct_Info;
47typedef void (*Eina_File_Dir_List_Cb)(const char *name, const char *path, void *data); 48typedef void (*Eina_File_Dir_List_Cb)(const char *name, const char *path, void *data);
48 49
50struct _Eina_File_Direct_Info
51{
52 size_t path_length; /* size of the whole path */
53 size_t name_length; /* size of the filename/basename component */
54 size_t name_start; /* where the filename/basename component starts */
55 char path[PATH_MAX];
56 const struct dirent *dirent;
57};
58
49/** 59/**
50 * @def EINA_FILE_DIR_LIST_CB 60 * @def EINA_FILE_DIR_LIST_CB
51 * @brief cast to an #Eina_File_Dir_List_Cb. 61 * @brief cast to an #Eina_File_Dir_List_Cb.
@@ -56,21 +66,12 @@ typedef void (*Eina_File_Dir_List_Cb)(const char *name, const char *path, void *
56 */ 66 */
57#define EINA_FILE_DIR_LIST_CB(function) ((Eina_File_Dir_List_Cb)function) 67#define EINA_FILE_DIR_LIST_CB(function) ((Eina_File_Dir_List_Cb)function)
58 68
59EAPI 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); 69EAPI Eina_Bool eina_file_dir_list(const char *dir,
70 Eina_Bool recursive,
71 Eina_File_Dir_List_Cb cb,
72 void *data) EINA_ARG_NONNULL(1, 3);
60EAPI Eina_Array * eina_file_split(char *path) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC; 73EAPI Eina_Array * eina_file_split(char *path) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
61EAPI Eina_Iterator * eina_file_ls(const char *dir) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC; 74EAPI Eina_Iterator * eina_file_ls(const char *dir) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
62
63
64typedef struct _Eina_File_Direct_Info Eina_File_Direct_Info;
65struct _Eina_File_Direct_Info
66{
67 size_t path_length; /* size of the whole path */
68 size_t name_length; /* size of the filename/basename component */
69 size_t name_start; /* where the filename/basename component starts */
70 char path[PATH_MAX];
71 const struct dirent *dirent;
72};
73
74EAPI Eina_Iterator * eina_file_direct_ls(const char *dir) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC; 75EAPI Eina_Iterator * eina_file_direct_ls(const char *dir) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
75 76
76/** 77/**
diff --git a/legacy/eina/src/include/eina_fp.h b/legacy/eina/src/include/eina_fp.h
index 140ad38f7c..47dbaa486d 100644
--- a/legacy/eina/src/include/eina_fp.h
+++ b/legacy/eina/src/include/eina_fp.h
@@ -41,11 +41,16 @@ static inline int32_t eina_f32p32_int_to(Eina_F32p32 v);
41static inline Eina_F32p32 eina_f32p32_double_from(double v); 41static inline Eina_F32p32 eina_f32p32_double_from(double v);
42static inline double eina_f32p32_double_to(Eina_F32p32 v); 42static inline double eina_f32p32_double_to(Eina_F32p32 v);
43 43
44static inline Eina_F32p32 eina_f32p32_add(Eina_F32p32 a, Eina_F32p32 b); 44static inline Eina_F32p32 eina_f32p32_add(Eina_F32p32 a,
45static inline Eina_F32p32 eina_f32p32_sub(Eina_F32p32 a, Eina_F32p32 b); 45 Eina_F32p32 b);
46static inline Eina_F32p32 eina_f32p32_mul(Eina_F32p32 a, Eina_F32p32 b); 46static inline Eina_F32p32 eina_f32p32_sub(Eina_F32p32 a,
47static inline Eina_F32p32 eina_f32p32_scale(Eina_F32p32 a, int b); 47 Eina_F32p32 b);
48static inline Eina_F32p32 eina_f32p32_div(Eina_F32p32 a, Eina_F32p32 b); 48static inline Eina_F32p32 eina_f32p32_mul(Eina_F32p32 a,
49 Eina_F32p32 b);
50static inline Eina_F32p32 eina_f32p32_scale(Eina_F32p32 a,
51 int b);
52static inline Eina_F32p32 eina_f32p32_div(Eina_F32p32 a,
53 Eina_F32p32 b);
49static inline Eina_F32p32 eina_f32p32_sqrt(Eina_F32p32 a); 54static inline Eina_F32p32 eina_f32p32_sqrt(Eina_F32p32 a);
50static inline unsigned int eina_f32p32_fracc_get(Eina_F32p32 v); 55static inline unsigned int eina_f32p32_fracc_get(Eina_F32p32 v);
51 56
@@ -60,11 +65,16 @@ static inline int32_t eina_f16p16_int_to(Eina_F16p16 v);
60static inline Eina_F16p16 eina_f16p16_float_from(float v); 65static inline Eina_F16p16 eina_f16p16_float_from(float v);
61static inline float eina_f16p16_float_to(Eina_F16p16 v); 66static inline float eina_f16p16_float_to(Eina_F16p16 v);
62 67
63static inline Eina_F16p16 eina_f16p16_add(Eina_F16p16 a, Eina_F16p16 b); 68static inline Eina_F16p16 eina_f16p16_add(Eina_F16p16 a,
64static inline Eina_F16p16 eina_f16p16_sub(Eina_F16p16 a, Eina_F16p16 b); 69 Eina_F16p16 b);
65static inline Eina_F16p16 eina_f16p16_mul(Eina_F16p16 a, Eina_F16p16 b); 70static inline Eina_F16p16 eina_f16p16_sub(Eina_F16p16 a,
66static inline Eina_F16p16 eina_f16p16_scale(Eina_F16p16 a, int b); 71 Eina_F16p16 b);
67static inline Eina_F16p16 eina_f16p16_div(Eina_F16p16 a, Eina_F16p16 b); 72static inline Eina_F16p16 eina_f16p16_mul(Eina_F16p16 a,
73 Eina_F16p16 b);
74static inline Eina_F16p16 eina_f16p16_scale(Eina_F16p16 a,
75 int b);
76static inline Eina_F16p16 eina_f16p16_div(Eina_F16p16 a,
77 Eina_F16p16 b);
68static inline Eina_F16p16 eina_f16p16_sqrt(Eina_F16p16 a); 78static inline Eina_F16p16 eina_f16p16_sqrt(Eina_F16p16 a);
69static inline unsigned int eina_f16p16_fracc_get(Eina_F16p16 v); 79static inline unsigned int eina_f16p16_fracc_get(Eina_F16p16 v);
70 80
@@ -73,11 +83,16 @@ static inline int32_t eina_f8p24_int_to(Eina_F8p24 v);
73static inline Eina_F8p24 eina_f8p24_float_from(float v); 83static inline Eina_F8p24 eina_f8p24_float_from(float v);
74static inline float eina_f8p24_float_to(Eina_F8p24 v); 84static inline float eina_f8p24_float_to(Eina_F8p24 v);
75 85
76static inline Eina_F8p24 eina_f8p24_add(Eina_F8p24 a, Eina_F8p24 b); 86static inline Eina_F8p24 eina_f8p24_add(Eina_F8p24 a,
77static inline Eina_F8p24 eina_f8p24_sub(Eina_F8p24 a, Eina_F8p24 b); 87 Eina_F8p24 b);
78static inline Eina_F8p24 eina_f8p24_mul(Eina_F8p24 a, Eina_F8p24 b); 88static inline Eina_F8p24 eina_f8p24_sub(Eina_F8p24 a,
79static inline Eina_F8p24 eina_f8p24_scale(Eina_F8p24 a, int b); 89 Eina_F8p24 b);
80static inline Eina_F8p24 eina_f8p24_div(Eina_F8p24 a, Eina_F8p24 b); 90static inline Eina_F8p24 eina_f8p24_mul(Eina_F8p24 a,
91 Eina_F8p24 b);
92static inline Eina_F8p24 eina_f8p24_scale(Eina_F8p24 a,
93 int b);
94static inline Eina_F8p24 eina_f8p24_div(Eina_F8p24 a,
95 Eina_F8p24 b);
81static inline Eina_F8p24 eina_f8p24_sqrt(Eina_F8p24 a); 96static inline Eina_F8p24 eina_f8p24_sqrt(Eina_F8p24 a);
82static inline unsigned int eina_f8p24_fracc_get(Eina_F8p24 v); 97static inline unsigned int eina_f8p24_fracc_get(Eina_F8p24 v);
83 98
diff --git a/legacy/eina/src/include/eina_hash.h b/legacy/eina/src/include/eina_hash.h
index 6a65b0aec9..efd134178b 100644
--- a/legacy/eina/src/include/eina_hash.h
+++ b/legacy/eina/src/include/eina_hash.h
@@ -62,7 +62,11 @@ typedef int (*Eina_Key_Hash)(const void *key, int key_length);
62#define EINA_KEY_HASH(Function) ((Eina_Key_Hash)Function) 62#define EINA_KEY_HASH(Function) ((Eina_Key_Hash)Function)
63typedef Eina_Bool (*Eina_Hash_Foreach)(const Eina_Hash *hash, const void *key, void *data, void *fdata); 63typedef Eina_Bool (*Eina_Hash_Foreach)(const Eina_Hash *hash, const void *key, void *data, void *fdata);
64 64
65EAPI 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); 65EAPI Eina_Hash * eina_hash_new(Eina_Key_Length key_length_cb,
66 Eina_Key_Cmp key_cmp_cb,
67 Eina_Key_Hash key_hash_cb,
68 Eina_Free_Cb data_free_cb,
69 int buckets_power_size) EINA_MALLOC EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(2, 3);
66EAPI Eina_Hash * eina_hash_string_djb2_new(Eina_Free_Cb data_free_cb); 70EAPI Eina_Hash * eina_hash_string_djb2_new(Eina_Free_Cb data_free_cb);
67EAPI Eina_Hash * eina_hash_string_superfast_new(Eina_Free_Cb data_free_cb); 71EAPI Eina_Hash * eina_hash_string_superfast_new(Eina_Free_Cb data_free_cb);
68EAPI Eina_Hash * eina_hash_string_small_new(Eina_Free_Cb data_free_cb); 72EAPI Eina_Hash * eina_hash_string_small_new(Eina_Free_Cb data_free_cb);
@@ -70,7 +74,11 @@ EAPI Eina_Hash * eina_hash_int32_new(Eina_Free_Cb data_free_cb);
70EAPI Eina_Hash * eina_hash_int64_new(Eina_Free_Cb data_free_cb); 74EAPI Eina_Hash * eina_hash_int64_new(Eina_Free_Cb data_free_cb);
71EAPI Eina_Hash * eina_hash_pointer_new(Eina_Free_Cb data_free_cb); 75EAPI Eina_Hash * eina_hash_pointer_new(Eina_Free_Cb data_free_cb);
72EAPI Eina_Hash * eina_hash_stringshared_new(Eina_Free_Cb data_free_cb); 76EAPI Eina_Hash * eina_hash_stringshared_new(Eina_Free_Cb data_free_cb);
73EAPI Eina_Hash * eina_hash_threadsafe_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); 77EAPI Eina_Hash * eina_hash_threadsafe_new(Eina_Key_Length key_length_cb,
78 Eina_Key_Cmp key_cmp_cb,
79 Eina_Key_Hash key_hash_cb,
80 Eina_Free_Cb data_free_cb,
81 int buckets_power_size) EINA_MALLOC EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(2, 3);
74EAPI Eina_Hash * eina_hash_threadsafe_string_djb2_new(Eina_Free_Cb data_free_cb); 82EAPI Eina_Hash * eina_hash_threadsafe_string_djb2_new(Eina_Free_Cb data_free_cb);
75EAPI Eina_Hash * eina_hash_threadsafe_string_superfast_new(Eina_Free_Cb data_free_cb); 83EAPI Eina_Hash * eina_hash_threadsafe_string_superfast_new(Eina_Free_Cb data_free_cb);
76EAPI Eina_Hash * eina_hash_threadsafe_string_small_new(Eina_Free_Cb data_free_cb); 84EAPI Eina_Hash * eina_hash_threadsafe_string_small_new(Eina_Free_Cb data_free_cb);
@@ -78,36 +86,80 @@ EAPI Eina_Hash * eina_hash_threadsafe_int32_new(Eina_Free_Cb data_free_cb);
78EAPI Eina_Hash * eina_hash_threadsafe_int64_new(Eina_Free_Cb data_free_cb); 86EAPI Eina_Hash * eina_hash_threadsafe_int64_new(Eina_Free_Cb data_free_cb);
79EAPI Eina_Hash * eina_hash_threadsafe_pointer_new(Eina_Free_Cb data_free_cb); 87EAPI Eina_Hash * eina_hash_threadsafe_pointer_new(Eina_Free_Cb data_free_cb);
80EAPI Eina_Hash * eina_hash_threadsafe_stringshared_new(Eina_Free_Cb data_free_cb); 88EAPI Eina_Hash * eina_hash_threadsafe_stringshared_new(Eina_Free_Cb data_free_cb);
81EAPI Eina_Bool eina_hash_add(Eina_Hash *hash, const void *key, const void *data) EINA_ARG_NONNULL(1, 2, 3); 89EAPI Eina_Bool eina_hash_add(Eina_Hash *hash,
82EAPI Eina_Bool eina_hash_direct_add(Eina_Hash *hash, const void *key, const void *data) EINA_ARG_NONNULL(1, 2, 3); 90 const void *key,
83EAPI Eina_Bool eina_hash_del(Eina_Hash *hash, const void *key, const void *data) EINA_ARG_NONNULL(1); 91 const void *data) EINA_ARG_NONNULL(1, 2, 3);
84EAPI void * eina_hash_find(const Eina_Hash *hash, const void *key) EINA_ARG_NONNULL(1, 2); 92EAPI Eina_Bool eina_hash_direct_add(Eina_Hash *hash,
85EAPI void * eina_hash_modify(Eina_Hash *hash, const void *key, const void *data) EINA_ARG_NONNULL(1, 2, 3); 93 const void *key,
86EAPI void * eina_hash_set(Eina_Hash *hash, const void *key, const void *data) EINA_ARG_NONNULL(1, 2, 3); 94 const void *data) EINA_ARG_NONNULL(1, 2, 3);
87EAPI Eina_Bool eina_hash_move(Eina_Hash *hash, const void *old_key, const void *new_key) EINA_ARG_NONNULL(1, 2, 3); 95EAPI Eina_Bool eina_hash_del(Eina_Hash *hash,
96 const void *key,
97 const void *data) EINA_ARG_NONNULL(1);
98EAPI void * eina_hash_find(const Eina_Hash *hash,
99 const void *key) EINA_ARG_NONNULL(1, 2);
100EAPI void * eina_hash_modify(Eina_Hash *hash,
101 const void *key,
102 const void *data) EINA_ARG_NONNULL(1, 2, 3);
103EAPI void * eina_hash_set(Eina_Hash *hash,
104 const void *key,
105 const void *data) EINA_ARG_NONNULL(1, 2, 3);
106EAPI Eina_Bool eina_hash_move(Eina_Hash *hash,
107 const void *old_key,
108 const void *new_key) EINA_ARG_NONNULL(1, 2, 3);
88EAPI void eina_hash_free(Eina_Hash *hash) EINA_ARG_NONNULL(1); 109EAPI void eina_hash_free(Eina_Hash *hash) EINA_ARG_NONNULL(1);
89EAPI void eina_hash_free_buckets(Eina_Hash *hash) EINA_ARG_NONNULL(1); 110EAPI void eina_hash_free_buckets(Eina_Hash *hash) EINA_ARG_NONNULL(1);
90EAPI int eina_hash_population(const Eina_Hash *hash) EINA_ARG_NONNULL(1); 111EAPI int eina_hash_population(const Eina_Hash *hash) EINA_ARG_NONNULL(1);
91EAPI 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); 112EAPI Eina_Bool eina_hash_add_by_hash(Eina_Hash *hash,
92EAPI 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); 113 const void *key,
93EAPI 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); 114 int key_length,
94EAPI Eina_Bool eina_hash_del_by_key(Eina_Hash *hash, const void *key) EINA_ARG_NONNULL(1, 2); 115 int key_hash,
95EAPI Eina_Bool eina_hash_del_by_data(Eina_Hash *hash, const void *data) EINA_ARG_NONNULL(1, 2); 116 const void *data) EINA_ARG_NONNULL(1, 2, 5);
96EAPI 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); 117EAPI Eina_Bool eina_hash_direct_add_by_hash(Eina_Hash *hash,
97EAPI void * eina_hash_find_by_hash(const Eina_Hash *hash, const void *key, int key_length, int key_hash) EINA_ARG_NONNULL(1, 2); 118 const void *key,
98EAPI 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); 119 int key_length,
120 int key_hash,
121 const void *data) EINA_ARG_NONNULL(1, 2, 5);
122EAPI Eina_Bool eina_hash_del_by_key_hash(Eina_Hash *hash,
123 const void *key,
124 int key_length,
125 int key_hash) EINA_ARG_NONNULL(1, 2);
126EAPI Eina_Bool eina_hash_del_by_key(Eina_Hash *hash,
127 const void *key) EINA_ARG_NONNULL(1, 2);
128EAPI Eina_Bool eina_hash_del_by_data(Eina_Hash *hash,
129 const void *data) EINA_ARG_NONNULL(1, 2);
130EAPI Eina_Bool eina_hash_del_by_hash(Eina_Hash *hash,
131 const void *key,
132 int key_length,
133 int key_hash,
134 const void *data) EINA_ARG_NONNULL(1);
135EAPI void * eina_hash_find_by_hash(const Eina_Hash *hash,
136 const void *key,
137 int key_length,
138 int key_hash) EINA_ARG_NONNULL(1, 2);
139EAPI void * eina_hash_modify_by_hash(Eina_Hash *hash,
140 const void *key,
141 int key_length,
142 int key_hash,
143 const void *data) EINA_ARG_NONNULL(1, 2, 5);
99EAPI Eina_Iterator * eina_hash_iterator_key_new(const Eina_Hash *hash) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT; 144EAPI Eina_Iterator * eina_hash_iterator_key_new(const Eina_Hash *hash) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
100EAPI Eina_Iterator * eina_hash_iterator_data_new(const Eina_Hash *hash) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT; 145EAPI Eina_Iterator * eina_hash_iterator_data_new(const Eina_Hash *hash) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
101EAPI Eina_Iterator * eina_hash_iterator_tuple_new(const Eina_Hash *hash) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT; 146EAPI Eina_Iterator * eina_hash_iterator_tuple_new(const Eina_Hash *hash) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
102EAPI void eina_hash_foreach(const Eina_Hash *hash, Eina_Hash_Foreach cb, const void *fdata) EINA_ARG_NONNULL(1, 2); 147EAPI void eina_hash_foreach(const Eina_Hash *hash,
148 Eina_Hash_Foreach cb,
149 const void *fdata) EINA_ARG_NONNULL(1, 2);
103/* Paul Hsieh (http://www.azillionmonkeys.com/qed/hash.html) hash function used by WebCore (http://webkit.org/blog/8/hashtables-part-2/) */ 150/* Paul Hsieh (http://www.azillionmonkeys.com/qed/hash.html) hash function used by WebCore (http://webkit.org/blog/8/hashtables-part-2/) */
104EAPI int eina_hash_superfast(const char *key, int len) EINA_ARG_NONNULL(1); 151EAPI int eina_hash_superfast(const char *key,
152 int len) EINA_ARG_NONNULL(1);
105/* Hash function first reported by dan bernstein many years ago in comp.lang.c */ 153/* Hash function first reported by dan bernstein many years ago in comp.lang.c */
106static inline int eina_hash_djb2(const char *key, int len) EINA_ARG_NONNULL(1); 154static inline int eina_hash_djb2(const char *key,
107static inline int eina_hash_djb2_len(const char *key, int *plen) EINA_ARG_NONNULL(1, 2); 155 int len) EINA_ARG_NONNULL(1);
156static inline int eina_hash_djb2_len(const char *key,
157 int *plen) EINA_ARG_NONNULL(1, 2);
108/* Hash function from http://www.concentric.net/~Ttwang/tech/inthash.htm */ 158/* Hash function from http://www.concentric.net/~Ttwang/tech/inthash.htm */
109static inline int eina_hash_int32(const unsigned int *pkey, int len) EINA_ARG_NONNULL(1); 159static inline int eina_hash_int32(const unsigned int *pkey,
110static inline int eina_hash_int64(const unsigned long int *pkey, int len) EINA_ARG_NONNULL(1); 160 int len) EINA_ARG_NONNULL(1);
161static inline int eina_hash_int64(const unsigned long int *pkey,
162 int len) EINA_ARG_NONNULL(1);
111 163
112#include "eina_inline_hash.x" 164#include "eina_inline_hash.x"
113 165
diff --git a/legacy/eina/src/include/eina_inlist.h b/legacy/eina/src/include/eina_inlist.h
index cefaf2aa4e..34ee0ed522 100644
--- a/legacy/eina/src/include/eina_inlist.h
+++ b/legacy/eina/src/include/eina_inlist.h
@@ -93,36 +93,12 @@ EAPI Eina_Accessor *eina_inlist_accessor_new(const Eina_Inlist *in_list) EINA_MA
93#define _EINA_INLIST_CONTAINER(ref, ptr) (void *)((char *)(ptr) - \ 93#define _EINA_INLIST_CONTAINER(ref, ptr) (void *)((char *)(ptr) - \
94 _EINA_INLIST_OFFSET(ref)) 94 _EINA_INLIST_OFFSET(ref))
95 95
96#define EINA_INLIST_FOREACH(list, l) for (l = NULL, \ 96#define EINA_INLIST_FOREACH(list, l) \
97 l = \ 97 for (l = NULL, l = (list ? _EINA_INLIST_CONTAINER(l, list) : NULL); l; \
98 (list ? _EINA_INLIST_CONTAINER(l, \ 98 l = (EINA_INLIST_GET(l)->next ? _EINA_INLIST_CONTAINER(l, EINA_INLIST_GET(l)->next) : NULL))
99 list) \ 99#define EINA_INLIST_REVERSE_FOREACH(list, l) \
100 : NULL); \ 100 for (l = NULL, l = (list ? _EINA_INLIST_CONTAINER(l, list->last) : NULL); \
101 l; \ 101 l; l = (EINA_INLIST_GET(l)->prev ? _EINA_INLIST_CONTAINER(l, EINA_INLIST_GET(l)->prev) : NULL))
102 l = \
103 (EINA_INLIST_GET(l)->next ? \
104 _EINA_INLIST_CONTAINER(l, \
105 EINA_INLIST_GET( \
106 l)-> \
107 next) : \
108 NULL))
109#define EINA_INLIST_REVERSE_FOREACH(list, l) for (l = NULL, \
110 l = \
111 (list ? \
112 _EINA_INLIST_CONTAINER(l, \
113 list \
114 -> \
115 last) \
116 : NULL); \
117 l; \
118 l = \
119 (EINA_INLIST_GET(l)->prev \
120 ? _EINA_INLIST_CONTAINER( \
121 l, \
122 EINA_INLIST_GET( \
123 l) \
124 ->prev) : NULL))
125
126 102
127/** 103/**
128 * @} 104 * @}