1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
|
#ifndef _EVAS_DATA_H
#define _EVAS_DATA_H
#ifdef EAPI
# undef EAPI
#endif
#ifdef _WIN32
# ifdef EFL_EVAS_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
# endif /* ! DLL_EXPORT */
# else
# define EAPI __declspec(dllimport)
# endif /* ! EFL_EVAS_BUILD */
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
# define EAPI __attribute__ ((visibility("default")))
# else
# define EAPI
# endif
# else
# define EAPI
# endif
#endif /* ! _WIN32 */
/**
* @file
* @brief These routines are used for Evas data types.
*/
typedef unsigned char Evas_Bool;
typedef struct _Evas_Array_Hash Evas_Array_Hash;
typedef struct _Evas_Hash Evas_Hash; /**< A Hash table handle */
typedef struct _Evas_List Evas_List; /**< A generic linked list node handle */
typedef struct _Evas_Object_List Evas_Object_List;
struct _Evas_Hash
{
int population;
Evas_Object_List *buckets[256];
};
struct _Evas_List /** A linked list node */
{
void *data; /**< Pointer to list element payload */
Evas_List *next; /**< Next member in the list */
Evas_List *prev; /**< Previous member in the list */
struct _Evas_List_Accounting *accounting; /**< Private list accounting info - don't touch */
};
struct _Evas_Object_List
{
Evas_Object_List *next, *prev;
Evas_Object_List *last;
};
#ifdef __cplusplus
extern "C" {
#endif
/*
* Evas Array Hash functions
*/
EAPI Evas_Array_Hash *evas_array_hash_new (void);
EAPI void evas_array_hash_free (Evas_Array_Hash *hash);
EAPI void evas_array_hash_add (Evas_Array_Hash *hash,
int key,
int data);
EAPI int evas_array_hash_search (Evas_Array_Hash *hash,
int key);
/*
* Evas Hash functions
*/
/* FIXME: add:
* api to add find, del members by data, size not just string and also
* provide hash generation functions settable by the app
*
* do we really need this? hmmm - let me think... there may be a better way
*/
EAPI Evas_Hash *evas_hash_add (Evas_Hash *hash,
const char *key,
const void *data);
EAPI Evas_Hash *evas_hash_direct_add (Evas_Hash *hash,
const char *key,
const void *data);
EAPI Evas_Hash *evas_hash_del (Evas_Hash *hash,
const char *key,
const void *data);
EAPI void * evas_hash_find (const Evas_Hash *hash,
const char *key);
EAPI void * evas_hash_modify (Evas_Hash *hash,
const char *key,
const void *data);
EAPI int evas_hash_size (const Evas_Hash *hash);
EAPI void evas_hash_free (Evas_Hash *hash);
EAPI void evas_hash_foreach (const Evas_Hash *hash,
Evas_Bool (*func)(
const Evas_Hash *hash,
const char *
key,
void *data,
void *fdata),
const void *fdata);
EAPI int evas_hash_alloc_error (void);
/*
* Evas List functions
*/
EAPI Evas_List *evas_list_append (Evas_List *list,
const void *data);
EAPI Evas_List *evas_list_prepend (Evas_List *list,
const void *data);
EAPI Evas_List *evas_list_append_relative (Evas_List *list,
const void *data,
const void *relative);
EAPI Evas_List *evas_list_append_relative_list (Evas_List *list,
const void *data,
Evas_List *relative);
EAPI Evas_List *evas_list_prepend_relative (Evas_List *list,
const void *data,
const void *relative);
EAPI Evas_List *evas_list_prepend_relative_list (Evas_List *list,
const void *data,
Evas_List *relative);
EAPI Evas_List *evas_list_remove (Evas_List *list,
const void *data);
EAPI Evas_List *evas_list_remove_list (Evas_List *list,
Evas_List *remove_list);
EAPI Evas_List *evas_list_promote_list (Evas_List *list,
Evas_List *move_list);
EAPI void * evas_list_find (const Evas_List *list,
const void *data);
EAPI Evas_List *evas_list_find_list (const Evas_List *list,
const void *data);
EAPI Evas_List *evas_list_free (Evas_List *list);
EAPI Evas_List *evas_list_last (const Evas_List *list);
EAPI Evas_List *evas_list_next (const Evas_List *list);
EAPI Evas_List *evas_list_prev (const Evas_List *list);
EAPI void * evas_list_data (const Evas_List *list);
EAPI int evas_list_count (const Evas_List *list);
EAPI void * evas_list_nth (const Evas_List *list, int n);
EAPI Evas_List *evas_list_nth_list (const Evas_List *list, int n);
EAPI Evas_List *evas_list_reverse (Evas_List *list);
EAPI Evas_List *evas_list_sort (Evas_List *list,
int size,
int (*func)(void *,void *));
EAPI int evas_list_alloc_error (void);
/*
* Evas Object List functions
*/
EAPI void * evas_object_list_append (void *in_list,
void *in_item);
EAPI void * evas_object_list_prepend (void *in_list,
void *in_item);
EAPI void * evas_object_list_append_relative (void *in_list,
void *in_item,
void *in_relative);
EAPI void * evas_object_list_prepend_relative (void *in_list,
void *in_item,
void *in_relative);
EAPI void * evas_object_list_remove (void *in_list,
void *in_item);
EAPI void * evas_object_list_find (void *in_list,
void *in_item);
/*
* Evas Stringshare functions
*/
EAPI void evas_stringshare_init (void); /* not implemented */
EAPI void evas_stringshare_shutdown (void); /* not implemented */
EAPI const char *evas_stringshare_add (const char *str);
EAPI void evas_stringshare_del (const char *str);
#ifdef __cplusplus
}
#endif
#endif /* _EVAS_DATA_H */
|