ffi-efl 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,333 @@
1
+ #! /usr/bin/env ruby
2
+ # -*- coding: UTF-8 -*-
3
+ #
4
+ require 'efl/ffi'
5
+ #
6
+ module Efl
7
+ #
8
+ module Eet
9
+ def self.method_missing m, *args, &block
10
+ return Efl::API.send 'eet_'+m.to_s, *args, &block
11
+ end
12
+ end
13
+ #
14
+ module API
15
+ #
16
+ #
17
+ ffi_lib 'eet'
18
+ #
19
+ # ENUMS
20
+ # typedef enum _Eet_Error {...} Eet_Error;
21
+ enum :eet_error, [ :eet_error_none, :eet_error_bad_object, :eet_error_empty, :eet_error_not_writable, :eet_error_out_of_memory,
22
+ :eet_error_write_error, :eet_error_write_error_file_too_big, :eet_error_write_error_io_error, :eet_error_write_error_out_of_space,
23
+ :eet_error_write_error_file_closed, :eet_error_mmap_failed, :eet_error_x509_encoding_failed, :eet_error_signature_failed,
24
+ :eet_error_invalid_signature, :eet_error_not_signed, :eet_error_not_implemented, :eet_error_prng_not_seeded, :eet_error_encrypt_failed,
25
+ :eet_error_decrypt_failed ]
26
+ # typedef enum _Eet_File_Mode {...} Eet_File_Mode;
27
+ enum :eet_file_mode, [ :eet_file_mode_invalid, -1, :eet_file_mode_read, :eet_file_mode_write, :eet_file_mode_read_write ]
28
+ #
29
+ # TYPEDEFS
30
+ # typedef struct _Eet_Version Eet_Version;
31
+ typedef :pointer, :eet_version
32
+ # typedef struct _Eet_File Eet_File;
33
+ typedef :pointer, :eet_file
34
+ typedef :pointer, :eet_file_p
35
+ # typedef struct _Eet_Dictionary Eet_Dictionary;
36
+ typedef :pointer, :eet_dictionary
37
+ typedef :pointer, :eet_dictionary_p
38
+ # typedef struct _Eet_Key Eet_Key;
39
+ typedef :pointer, :eet_key
40
+ typedef :pointer, :eet_key_p
41
+ # typedef struct _Eet_Data_Descriptor Eet_Data_Descriptor;
42
+ typedef :pointer, :eet_data_descriptor
43
+ typedef :pointer, :eet_data_descriptor_p
44
+ # typedef struct _Eet_Data_Descriptor_Class Eet_Data_Descriptor_Class;
45
+ typedef :pointer, :eet_data_descriptor_class
46
+ typedef :pointer, :eet_data_descriptor_class_p
47
+ # typedef struct _Eet_Node Eet_Node;
48
+ typedef :pointer, :eet_node
49
+ typedef :pointer, :eet_node_p
50
+ # typedef struct _Eet_Node_Data Eet_Node_Data;
51
+ typedef :pointer, :eet_node_data
52
+ typedef :pointer, :eet_node_data_p
53
+ # typedef struct _Eet_Node_Walk Eet_Node_Walk;
54
+ typedef :pointer, :eet_node_walk
55
+ typedef :pointer, :eet_node_walk_p
56
+ # typedef struct _Eet_Connection Eet_Connection;
57
+ typedef :pointer, :eet_connection
58
+ typedef :pointer, :eet_connection_p
59
+ #
60
+ # CALLBACKS
61
+ # typedef int (*Eet_Key_Password_Callback) (char *buffer, int size, int rwflag, void *data);
62
+ callback :eet_key_password_callback, [ :string, :int, :int, :void_p ], :int
63
+ # typedef int (*Eet_Descriptor_Hash_Foreach_Callback_Callback) (void *h, const char *k, void *dt, void *fdt);
64
+ callback :eet_descriptor_hash_foreach_callback_callback, [ :void_p, :string, :void_p, :void_p ], :int
65
+ # typedef void *(*Eet_Descriptor_Mem_Alloc_Callback) (size_t size);
66
+ callback :eet_descriptor_mem_alloc_callback, [ :ulong ], :void_p
67
+ # typedef void (*Eet_Descriptor_Mem_Free_Callback) (void *mem);
68
+ callback :eet_descriptor_mem_free_callback, [ :void_p ], :void
69
+ # typedef char *(*Eet_Descriptor_Str_Alloc_Callback) (const char *str);
70
+ callback :eet_descriptor_str_alloc_callback, [ :string ], :string
71
+ # typedef void (*Eet_Descriptor_Str_Free_Callback) (const char *str);
72
+ callback :eet_descriptor_str_free_callback, [ :string ], :void
73
+ # typedef void *(*Eet_Descriptor_List_Next_Callback) (void *l);
74
+ callback :eet_descriptor_list_next_callback, [ :void_p ], :void_p
75
+ # typedef void *(*Eet_Descriptor_List_Append_Callback) (void *l, void *d);
76
+ callback :eet_descriptor_list_append_callback, [ :void_p, :void_p ], :void_p
77
+ # typedef void *(*Eet_Descriptor_List_Data_Callback) (void *l);
78
+ callback :eet_descriptor_list_data_callback, [ :void_p ], :void_p
79
+ # typedef void *(*Eet_Descriptor_List_Free_Callback) (void *l);
80
+ callback :eet_descriptor_list_free_callback, [ :void_p ], :void_p
81
+ # typedef void (*Eet_Descriptor_Hash_Foreach_Callback) (void *h, Eet_Descriptor_Hash_Foreach_Callback_Callback func, void *fdt);
82
+ callback :eet_descriptor_hash_foreach_callback, [ :void_p, :eet_descriptor_hash_foreach_callback_callback, :void_p ], :void
83
+ # typedef void *(*Eet_Descriptor_Hash_Add_Callback) (void *h, const char *k, void *d);
84
+ callback :eet_descriptor_hash_add_callback, [ :void_p, :string, :void_p ], :void_p
85
+ # typedef void (*Eet_Descriptor_Hash_Free_Callback) (void *h);
86
+ callback :eet_descriptor_hash_free_callback, [ :void_p ], :void
87
+ # typedef char *(*Eet_Descriptor_Str_Direct_Alloc_Callback) (const char *str);
88
+ callback :eet_descriptor_str_direct_alloc_callback, [ :string ], :string
89
+ # typedef void (*Eet_Descriptor_Str_Direct_Free_Callback) (const char *str);
90
+ callback :eet_descriptor_str_direct_free_callback, [ :string ], :void
91
+ # typedef const char *(*Eet_Descriptor_Type_Get_Callback) (const void *data, Eina_Bool *unknow);
92
+ callback :eet_descriptor_type_get_callback, [ :void_p, :eina_bool_p ], :string
93
+ # typedef Eina_Bool (*Eet_Descriptor_Type_Set_Callback) (const char *type, void *data, Eina_Bool unknow);
94
+ callback :eet_descriptor_type_set_callback, [ :string, :void_p, :eina_bool ], :eina_bool
95
+ # typedef void *(*Eet_Descriptor_Array_Alloc_Callback) (size_t size);
96
+ callback :eet_descriptor_array_alloc_callback, [ :ulong ], :void_p
97
+ # typedef void (*Eet_Descriptor_Array_Free_Callback) (void *mem);
98
+ callback :eet_descriptor_array_free_callback, [ :void_p ], :void
99
+ # typedef void (*Eet_Dump_Callback) (void *data, const char *str);
100
+ callback :eet_dump_callback, [ :void_p, :string ], :void
101
+ # typedef void *(*Eet_Node_Walk_Struct_Alloc_Callback) (const char *type, void *user_data);
102
+ callback :eet_node_walk_struct_alloc_callback, [ :string, :void_p ], :void_p
103
+ # typedef void (*Eet_Node_Walk_Struct_Add_Callback) (void *parent, const char *name, void *child, void *user_data);
104
+ callback :eet_node_walk_struct_add_callback, [ :void_p, :string, :void_p, :void_p ], :void
105
+ # typedef void *(*Eet_Node_Walk_Array_Callback) (Eina_Bool variable, const char *name, int count, void *user_data);
106
+ callback :eet_node_walk_array_callback, [ :eina_bool, :string, :int, :void_p ], :void_p
107
+ # typedef void (*Eet_Node_Walk_Insert_Callback) (void *array, int index, void *child, void *user_data);
108
+ callback :eet_node_walk_insert_callback, [ :void_p, :int, :void_p, :void_p ], :void
109
+ # typedef void *(*Eet_Node_Walk_List_Callback) (const char *name, void *user_data);
110
+ callback :eet_node_walk_list_callback, [ :string, :void_p ], :void_p
111
+ # typedef void (*Eet_Node_Walk_Append_Callback) (void *list, void *child, void *user_data);
112
+ callback :eet_node_walk_append_callback, [ :void_p, :void_p, :void_p ], :void
113
+ # typedef void *(*Eet_Node_Walk_Hash_Callback) (void *parent, const char *name, const char *key, void *value, void *user_data);
114
+ callback :eet_node_walk_hash_callback, [ :void_p, :string, :string, :void_p, :void_p ], :void_p
115
+ # typedef void *(*Eet_Node_Walk_Simple_Callback) (int type, Eet_Node_Data *data, void *user_data);
116
+ callback :eet_node_walk_simple_callback, [ :int, :eet_node_data_p, :void_p ], :void_p
117
+ # typedef Eina_Bool Eet_Read_Cb (const void *eet_data, size_t size, void *user_data);
118
+ callback :eet_read_cb, [ :void_p, :ulong, :void_p ], :eina_bool
119
+ # typedef Eina_Bool Eet_Write_Cb (const void *data, size_t size, void *user_data);
120
+ callback :eet_write_cb, [ :void_p, :ulong, :void_p ], :eina_bool
121
+ #
122
+ # FUNCTIONS
123
+ fcts = [
124
+ # EAPI extern Eet_Version *eet_version;
125
+ # FIXME
126
+ # EAPI int eet_init(void);
127
+ [ :eet_init, [ ], :int ],
128
+ # EAPI int eet_shutdown(void);
129
+ [ :eet_shutdown, [ ], :int ],
130
+ # EAPI void eet_clearcache(void);
131
+ [ :eet_clearcache, [ ], :void ],
132
+ # EAPI Eet_File * eet_open(const char *file, Eet_File_Mode mode);
133
+ [ :eet_open, [ :string, :eet_file_mode ], :eet_file_p ],
134
+ # EAPI Eet_File * eet_memopen_read(const void *data, size_t size);
135
+ [ :eet_memopen_read, [ :void_p, :ulong ], :eet_file_p ],
136
+ # EAPI Eet_File_Mode eet_mode_get(Eet_File *ef);
137
+ [ :eet_mode_get, [ :eet_file_p ], :eet_file_mode ],
138
+ # EAPI Eet_Error eet_close(Eet_File *ef);
139
+ [ :eet_close, [ :eet_file_p ], :eet_error ],
140
+ # EAPI Eet_Error eet_sync(Eet_File *ef);
141
+ [ :eet_sync, [ :eet_file_p ], :eet_error ],
142
+ # EAPI Eet_Dictionary * eet_dictionary_get(Eet_File *ef);
143
+ [ :eet_dictionary_get, [ :eet_file_p ], :eet_dictionary_p ],
144
+ # EAPI int eet_dictionary_string_check(Eet_Dictionary *ed, const char *string);
145
+ [ :eet_dictionary_string_check, [ :eet_dictionary_p, :string ], :int ],
146
+ # EAPI void * eet_read(Eet_File *ef, const char *name, int *size_ret);
147
+ [ :eet_read, [ :eet_file_p, :string, :int_p ], :void_p ],
148
+ # EAPI const void * eet_read_direct(Eet_File *ef, const char *name, int *size_ret);
149
+ [ :eet_read_direct, [ :eet_file_p, :string, :int_p ], :void_p ],
150
+ # EAPI int eet_write(Eet_File *ef, const char *name, const void *data, int size, int compress);
151
+ [ :eet_write, [ :eet_file_p, :string, :void_p, :int, :int ], :int ],
152
+ # EAPI int eet_delete(Eet_File *ef, const char *name);
153
+ [ :eet_delete, [ :eet_file_p, :string ], :int ],
154
+ # EAPI Eina_Bool eet_alias(Eet_File *ef, const char *name, const char *destination, int compress);
155
+ [ :eet_alias, [ :eet_file_p, :string, :string, :int ], :eina_bool ],
156
+ # EAPI char ** eet_list(Eet_File *ef, const char *glob, int *count_ret);
157
+ [ :eet_list, [ :eet_file_p, :string, :int_p ], :string_array ],
158
+ # EAPI int eet_num_entries(Eet_File *ef);
159
+ [ :eet_num_entries, [ :eet_file_p ], :int ],
160
+ # EAPI void * eet_read_cipher(Eet_File *ef, const char *name, int *size_ret, const char *cipher_key);
161
+ [ :eet_read_cipher, [ :eet_file_p, :string, :int_p, :string ], :void_p ],
162
+ # EAPI int eet_write_cipher(Eet_File *ef, const char *name, const void *data, int size, int compress, const char *cipher_key);
163
+ [ :eet_write_cipher, [ :eet_file_p, :string, :void_p, :int, :int, :string ], :int ],
164
+ # EAPI int eet_data_image_header_read(Eet_File *ef, const char *name, unsigned int *w, unsigned int *h, int *alpha, int *compress, int *quality, int *lossy);
165
+ [ :eet_data_image_header_read, [ :eet_file_p, :string, :uint_p, :uint_p, :int_p, :int_p, :int_p, :int_p ], :int ],
166
+ # EAPI void * eet_data_image_read(Eet_File *ef, const char *name, unsigned int *w, unsigned int *h, int *alpha, int *compress, int *quality, int *lossy);
167
+ [ :eet_data_image_read, [ :eet_file_p, :string, :uint_p, :uint_p, :int_p, :int_p, :int_p, :int_p ], :void_p ],
168
+ # EAPI int eet_data_image_read_to_surface(Eet_File *ef, const char *name, unsigned int src_x, unsigned int src_y, unsigned int *d, unsigned int w, unsigned int h, unsigned int row_stride, int *alpha, int *compress, int *quality, int *lossy);
169
+ [ :eet_data_image_read_to_surface, [ :eet_file_p, :string, :uint, :uint, :uint_p, :uint, :uint, :uint, :int_p, :int_p, :int_p, :int_p ], :int
170
+ ],
171
+ # EAPI int eet_data_image_write(Eet_File *ef, const char *name, const void *data, unsigned int w, unsigned int h, int alpha, int compress, int quality, int lossy);
172
+ [ :eet_data_image_write, [ :eet_file_p, :string, :void_p, :uint, :uint, :int, :int, :int, :int ], :int ],
173
+ # EAPI int eet_data_image_header_decode(const void *data, int size, unsigned int *w, unsigned int *h, int *alpha, int *compress, int *quality, int *lossy);
174
+ [ :eet_data_image_header_decode, [ :void_p, :int, :uint_p, :uint_p, :int_p, :int_p, :int_p, :int_p ], :int ],
175
+ # EAPI void * eet_data_image_decode(const void *data, int size, unsigned int *w, unsigned int *h, int *alpha, int *compress, int *quality, int *lossy);
176
+ [ :eet_data_image_decode, [ :void_p, :int, :uint_p, :uint_p, :int_p, :int_p, :int_p, :int_p ], :void_p ],
177
+ # EAPI int eet_data_image_decode_to_surface(const void *data, int size, unsigned int src_x, unsigned int src_y, unsigned int *d, unsigned int w, unsigned int h, unsigned int row_stride, int *alpha, int *compress, int *quality, int *lossy);
178
+ [ :eet_data_image_decode_to_surface, [ :void_p, :int, :uint, :uint, :uint_p, :uint, :uint, :uint, :int_p, :int_p, :int_p, :int_p ], :int ],
179
+ # EAPI void * eet_data_image_encode(const void *data, int *size_ret, unsigned int w, unsigned int h, int alpha, int compress, int quality, int lossy);
180
+ [ :eet_data_image_encode, [ :void_p, :int_p, :uint, :uint, :int, :int, :int, :int ], :void_p ],
181
+ # EAPI int eet_data_image_header_read_cipher(Eet_File *ef, const char *name, const char *cipher_key, unsigned int *w, unsigned int *h, int *alpha, int *compress, int *quality, int *lossy);
182
+ [ :eet_data_image_header_read_cipher, [ :eet_file_p, :string, :string, :uint_p, :uint_p, :int_p, :int_p, :int_p, :int_p ], :int ],
183
+ # EAPI void * eet_data_image_read_cipher(Eet_File *ef, const char *name, const char *cipher_key, unsigned int *w, unsigned int *h, int *alpha, int *compress, int *quality, int *lossy);
184
+ [ :eet_data_image_read_cipher, [ :eet_file_p, :string, :string, :uint_p, :uint_p, :int_p, :int_p, :int_p, :int_p ], :void_p ],
185
+ # EAPI int eet_data_image_read_to_surface_cipher(Eet_File *ef, const char *name, const char *cipher_key, unsigned int src_x, unsigned int src_y, unsigned int *d, unsigned int w, unsigned int h, unsigned int row_stride, int *alpha, int *compress, int *quality, int *lossy);
186
+ [ :eet_data_image_read_to_surface_cipher, [ :eet_file_p, :string, :string, :uint, :uint, :uint_p, :uint, :uint, :uint, :int_p, :int_p, :int_p,
187
+ :int_p ], :int ],
188
+ # EAPI int eet_data_image_write_cipher(Eet_File *ef, const char *name, const char *cipher_key, const void *data, unsigned int w, unsigned int h, int alpha, int compress, int quality, int lossy);
189
+ [ :eet_data_image_write_cipher, [ :eet_file_p, :string, :string, :void_p, :uint, :uint, :int, :int, :int, :int ], :int ],
190
+ # EAPI int eet_data_image_header_decode_cipher(const void *data, const char *cipher_key, int size, unsigned int *w, unsigned int *h, int *alpha, int *compress, int *quality, int *lossy);
191
+ [ :eet_data_image_header_decode_cipher, [ :void_p, :string, :int, :uint_p, :uint_p, :int_p, :int_p, :int_p, :int_p ], :int ],
192
+ # EAPI void * eet_data_image_decode_cipher(const void *data, const char *cipher_key, int size, unsigned int *w, unsigned int *h, int *alpha, int *compress, int *quality, int *lossy);
193
+ [ :eet_data_image_decode_cipher, [ :void_p, :string, :int, :uint_p, :uint_p, :int_p, :int_p, :int_p, :int_p ], :void_p ],
194
+ # EAPI int eet_data_image_decode_to_surface_cipher(const void *data, const char *cipher_key, int size, unsigned int src_x, unsigned int src_y, unsigned int *d, unsigned int w, unsigned int h, unsigned int row_stride, int *alpha, int *compress, int *quality, int *lossy);
195
+ [ :eet_data_image_decode_to_surface_cipher, [ :void_p, :string, :int, :uint, :uint, :uint_p, :uint, :uint, :uint, :int_p, :int_p, :int_p,
196
+ :int_p ], :int ],
197
+ # EAPI void * eet_data_image_encode_cipher(const void *data, const char *cipher_key, unsigned int w, unsigned int h, int alpha, int compress, int quality, int lossy, int *size_ret);
198
+ [ :eet_data_image_encode_cipher, [ :void_p, :string, :uint, :uint, :int, :int, :int, :int, :int_p ], :void_p ],
199
+ # EAPI Eet_Key * eet_identity_open(const char *certificate_file, const char *private_key_file, Eet_Key_Password_Callback cb);
200
+ [ :eet_identity_open, [ :string, :string, :eet_key_password_callback ], :eet_key_p ],
201
+ # EAPI void eet_identity_close(Eet_Key *key);
202
+ [ :eet_identity_close, [ :eet_key_p ], :void ],
203
+ # EAPI Eet_Error eet_identity_set(Eet_File *ef, Eet_Key *key);
204
+ [ :eet_identity_set, [ :eet_file_p, :eet_key_p ], :eet_error ],
205
+ # EAPI void eet_identity_print(Eet_Key *key, FILE *out);
206
+ [ :eet_identity_print, [ :eet_key_p, :pointer ], :void ],
207
+ # EAPI const void * eet_identity_x509(Eet_File *ef, int *der_length);
208
+ [ :eet_identity_x509, [ :eet_file_p, :int_p ], :void_p ],
209
+ # EAPI const void * eet_identity_signature(Eet_File *ef, int *signature_length);
210
+ [ :eet_identity_signature, [ :eet_file_p, :int_p ], :void_p ],
211
+ # EAPI const void * eet_identity_sha1(Eet_File *ef, int *sha1_length);
212
+ [ :eet_identity_sha1, [ :eet_file_p, :int_p ], :void_p ],
213
+ # EAPI void eet_identity_certificate_print(const unsigned char *certificate, int der_length, FILE *out);
214
+ [ :eet_identity_certificate_print, [ :uchar_p, :int, :pointer ], :void ],
215
+ # EAPI Eet_Data_Descriptor * eet_data_descriptor_stream_new(const Eet_Data_Descriptor_Class *eddc);
216
+ [ :eet_data_descriptor_stream_new, [ :eet_data_descriptor_class_p ], :eet_data_descriptor_p ],
217
+ # EAPI Eet_Data_Descriptor * eet_data_descriptor_file_new(const Eet_Data_Descriptor_Class *eddc);
218
+ [ :eet_data_descriptor_file_new, [ :eet_data_descriptor_class_p ], :eet_data_descriptor_p ],
219
+ # EAPI Eina_Bool eet_eina_stream_data_descriptor_class_set(Eet_Data_Descriptor_Class *eddc, unsigned int eddc_size, const char *name, int size);
220
+ # FIXME
221
+ # EAPI Eina_Bool eet_eina_file_data_descriptor_class_set(Eet_Data_Descriptor_Class *eddc, unsigned int eddc_size, const char *name, int size);
222
+ [ :eet_eina_file_data_descriptor_class_set, [ :eet_data_descriptor_class_p, :uint, :string, :int ], :eina_bool ],
223
+ # EAPI void eet_data_descriptor_free(Eet_Data_Descriptor *edd);
224
+ [ :eet_data_descriptor_free, [ :eet_data_descriptor_p ], :void ],
225
+ # EAPI void eet_data_descriptor_element_add(Eet_Data_Descriptor *edd, const char *name, int type, int group_type, int offset, /* int count_offset, */
226
+ # FIXME
227
+ # EAPI void * eet_data_read(Eet_File *ef, Eet_Data_Descriptor *edd, const char *name);
228
+ [ :eet_data_read, [ :eet_file_p, :eet_data_descriptor_p, :string ], :void_p ],
229
+ # EAPI int eet_data_write(Eet_File *ef, Eet_Data_Descriptor *edd, const char *name, const void *data, int compress);
230
+ [ :eet_data_write, [ :eet_file_p, :eet_data_descriptor_p, :string, :void_p, :int ], :int ],
231
+ # EAPI int eet_data_text_dump(const void *data_in, int size_in, Eet_Dump_Callback dumpfunc, void *dumpdata);
232
+ [ :eet_data_text_dump, [ :void_p, :int, :eet_dump_callback, :void_p ], :int ],
233
+ # EAPI void * eet_data_text_undump(const char *text, int textlen, int *size_ret);
234
+ [ :eet_data_text_undump, [ :string, :int, :int_p ], :void_p ],
235
+ # EAPI int eet_data_dump(Eet_File *ef, const char *name, Eet_Dump_Callback dumpfunc, void *dumpdata);
236
+ [ :eet_data_dump, [ :eet_file_p, :string, :eet_dump_callback, :void_p ], :int ],
237
+ # EAPI int eet_data_undump(Eet_File *ef, const char *name, const char *text, int textlen, int compress);
238
+ [ :eet_data_undump, [ :eet_file_p, :string, :string, :int, :int ], :int ],
239
+ # EAPI void * eet_data_descriptor_decode(Eet_Data_Descriptor *edd, const void *data_in, int size_in);
240
+ [ :eet_data_descriptor_decode, [ :eet_data_descriptor_p, :void_p, :int ], :void_p ],
241
+ # EAPI void * eet_data_descriptor_encode(Eet_Data_Descriptor *edd, const void *data_in, int *size_ret);
242
+ [ :eet_data_descriptor_encode, [ :eet_data_descriptor_p, :void_p, :int_p ], :void_p ],
243
+ # EAPI void * eet_data_read_cipher(Eet_File *ef, Eet_Data_Descriptor *edd, const char *name, const char *cipher_key);
244
+ [ :eet_data_read_cipher, [ :eet_file_p, :eet_data_descriptor_p, :string, :string ], :void_p ],
245
+ # EAPI int eet_data_write_cipher(Eet_File *ef, Eet_Data_Descriptor *edd, const char *name, const char *cipher_key, const void *data, int compress);
246
+ [ :eet_data_write_cipher, [ :eet_file_p, :eet_data_descriptor_p, :string, :string, :void_p, :int ], :int ],
247
+ # EAPI int eet_data_text_dump_cipher(const void *data_in, const char *cipher_key, int size_in, Eet_Dump_Callback dumpfunc, void *dumpdata);
248
+ [ :eet_data_text_dump_cipher, [ :void_p, :string, :int, :eet_dump_callback, :void_p ], :int ],
249
+ # EAPI void * eet_data_text_undump_cipher(const char *text, const char *cipher_key, int textlen, int *size_ret);
250
+ [ :eet_data_text_undump_cipher, [ :string, :string, :int, :int_p ], :void_p ],
251
+ # EAPI int eet_data_dump_cipher(Eet_File *ef, const char *name, const char *cipher_key, Eet_Dump_Callback dumpfunc, void *dumpdata);
252
+ [ :eet_data_dump_cipher, [ :eet_file_p, :string, :string, :eet_dump_callback, :void_p ], :int ],
253
+ # EAPI int eet_data_undump_cipher(Eet_File *ef, const char *name, const char *cipher_key, const char *text, int textlen, int compress);
254
+ [ :eet_data_undump_cipher, [ :eet_file_p, :string, :string, :string, :int, :int ], :int ],
255
+ # EAPI void * eet_data_descriptor_decode_cipher(Eet_Data_Descriptor *edd, const void *data_in, const char *cipher_key, int size_in);
256
+ [ :eet_data_descriptor_decode_cipher, [ :eet_data_descriptor_p, :void_p, :string, :int ], :void_p ],
257
+ # EAPI void * eet_data_descriptor_encode_cipher(Eet_Data_Descriptor *edd, const void *data_in, const char *cipher_key, int *size_ret);
258
+ [ :eet_data_descriptor_encode_cipher, [ :eet_data_descriptor_p, :void_p, :string, :int_p ], :void_p ],
259
+ # EAPI Eet_Node * eet_node_char_new(const char *name, char c);
260
+ [ :eet_node_char_new, [ :string, :char ], :eet_node_p ],
261
+ # EAPI Eet_Node * eet_node_short_new(const char *name, short s);
262
+ [ :eet_node_short_new, [ :string, :short ], :eet_node_p ],
263
+ # EAPI Eet_Node * eet_node_int_new(const char *name, int i);
264
+ [ :eet_node_int_new, [ :string, :int ], :eet_node_p ],
265
+ # EAPI Eet_Node * eet_node_long_long_new(const char *name, long long l);
266
+ [ :eet_node_long_long_new, [ :string, :long_long ], :eet_node_p ],
267
+ # EAPI Eet_Node * eet_node_float_new(const char *name, float f);
268
+ [ :eet_node_float_new, [ :string, :float ], :eet_node_p ],
269
+ # EAPI Eet_Node * eet_node_double_new(const char *name, double d);
270
+ [ :eet_node_double_new, [ :string, :double ], :eet_node_p ],
271
+ # EAPI Eet_Node * eet_node_unsigned_char_new(const char *name, unsigned char uc);
272
+ [ :eet_node_unsigned_char_new, [ :string, :uchar ], :eet_node_p ],
273
+ # EAPI Eet_Node * eet_node_unsigned_short_new(const char *name, unsigned short us);
274
+ [ :eet_node_unsigned_short_new, [ :string, :ushort ], :eet_node_p ],
275
+ # EAPI Eet_Node * eet_node_unsigned_int_new(const char *name, unsigned int ui);
276
+ [ :eet_node_unsigned_int_new, [ :string, :uint ], :eet_node_p ],
277
+ # EAPI Eet_Node * eet_node_unsigned_long_long_new(const char *name, unsigned long long l);
278
+ [ :eet_node_unsigned_long_long_new, [ :string, :ulong_long ], :eet_node_p ],
279
+ # EAPI Eet_Node * eet_node_string_new(const char *name, const char *str);
280
+ [ :eet_node_string_new, [ :string, :string ], :eet_node_p ],
281
+ # EAPI Eet_Node * eet_node_inlined_string_new(const char *name, const char *str);
282
+ [ :eet_node_inlined_string_new, [ :string, :string ], :eet_node_p ],
283
+ # EAPI Eet_Node * eet_node_null_new(const char *name);
284
+ [ :eet_node_null_new, [ :string ], :eet_node_p ],
285
+ # EAPI Eet_Node * eet_node_list_new(const char *name, Eina_List *nodes);
286
+ [ :eet_node_list_new, [ :string, :eina_list_p ], :eet_node_p ],
287
+ # EAPI Eet_Node * eet_node_array_new(const char *name, int count, Eina_List *nodes);
288
+ [ :eet_node_array_new, [ :string, :int, :eina_list_p ], :eet_node_p ],
289
+ # EAPI Eet_Node * eet_node_var_array_new(const char *name, Eina_List *nodes);
290
+ [ :eet_node_var_array_new, [ :string, :eina_list_p ], :eet_node_p ],
291
+ # EAPI Eet_Node * eet_node_hash_new(const char *name, const char *key, Eet_Node *node);
292
+ [ :eet_node_hash_new, [ :string, :string, :eet_node_p ], :eet_node_p ],
293
+ # EAPI Eet_Node * eet_node_struct_new(const char *name, Eina_List *nodes);
294
+ [ :eet_node_struct_new, [ :string, :eina_list_p ], :eet_node_p ],
295
+ # EAPI Eet_Node * eet_node_struct_child_new(const char *parent, Eet_Node *child);
296
+ [ :eet_node_struct_child_new, [ :string, :eet_node_p ], :eet_node_p ],
297
+ # EAPI void eet_node_list_append(Eet_Node *parent, const char *name, Eet_Node *child);
298
+ [ :eet_node_list_append, [ :eet_node_p, :string, :eet_node_p ], :void ],
299
+ # EAPI void eet_node_struct_append(Eet_Node *parent, const char *name, Eet_Node *child);
300
+ [ :eet_node_struct_append, [ :eet_node_p, :string, :eet_node_p ], :void ],
301
+ # EAPI void eet_node_hash_add(Eet_Node *parent, const char *name, const char *key, Eet_Node *child);
302
+ [ :eet_node_hash_add, [ :eet_node_p, :string, :string, :eet_node_p ], :void ],
303
+ # EAPI void eet_node_dump(Eet_Node *n, int dumplevel, Eet_Dump_Callback dumpfunc, void *dumpdata);
304
+ [ :eet_node_dump, [ :eet_node_p, :int, :eet_dump_callback, :void_p ], :void ],
305
+ # EAPI void eet_node_del(Eet_Node *n);
306
+ [ :eet_node_del, [ :eet_node_p ], :void ],
307
+ # EAPI void * eet_data_node_encode_cipher(Eet_Node *node, const char *cipher_key, int *size_ret);
308
+ [ :eet_data_node_encode_cipher, [ :eet_node_p, :string, :int_p ], :void_p ],
309
+ # EAPI Eet_Node * eet_data_node_decode_cipher(const void *data_in, const char *cipher_key, int size_in);
310
+ [ :eet_data_node_decode_cipher, [ :void_p, :string, :int ], :eet_node_p ],
311
+ # EAPI Eet_Node * eet_data_node_read_cipher(Eet_File *ef, const char *name, const char *cipher_key);
312
+ [ :eet_data_node_read_cipher, [ :eet_file_p, :string, :string ], :eet_node_p ],
313
+ # EAPI int eet_data_node_write_cipher(Eet_File *ef, const char *name, const char *cipher_key, Eet_Node *node, int compress);
314
+ [ :eet_data_node_write_cipher, [ :eet_file_p, :string, :string, :eet_node_p, :int ], :int ],
315
+ # EAPI void * eet_node_walk(void *parent, const char *name, Eet_Node *root, Eet_Node_Walk *cb, void *user_data);
316
+ [ :eet_node_walk, [ :void_p, :string, :eet_node_p, :eet_node_walk_p, :void_p ], :void_p ],
317
+ # EAPI Eet_Connection * eet_connection_new(Eet_Read_Cb *eet_read_cb, Eet_Write_Cb *eet_write_cb, const void *user_data);
318
+ [ :eet_connection_new, [ :eet_read_cb, :eet_write_cb, :void_p ], :eet_connection_p ],
319
+ # EAPI int eet_connection_received(Eet_Connection *conn, const void *data, size_t size);
320
+ [ :eet_connection_received, [ :eet_connection_p, :void_p, :ulong ], :int ],
321
+ # EAPI Eina_Bool eet_connection_send(Eet_Connection *conn, Eet_Data_Descriptor *edd, const void *data_in, const char *cipher_key);
322
+ [ :eet_connection_send, [ :eet_connection_p, :eet_data_descriptor_p, :void_p, :string ], :eina_bool ],
323
+ # EAPI Eina_Bool eet_connection_node_send(Eet_Connection *conn, Eet_Node *node, const char *cipher_key);
324
+ [ :eet_connection_node_send, [ :eet_connection_p, :eet_node_p, :string ], :eina_bool ],
325
+ # EAPI void * eet_connection_close(Eet_Connection *conn, Eina_Bool *on_going);
326
+ [ :eet_connection_close, [ :eet_connection_p, :eina_bool_p ], :void_p ],
327
+ ]
328
+ #
329
+ attach_fcts fcts
330
+ end
331
+ end
332
+ #
333
+ # EOF
data/lib/efl/eet.rb ADDED
@@ -0,0 +1,58 @@
1
+ #! /usr/bin/env ruby
2
+ # -*- coding: UTF-8 -*-
3
+ #
4
+ require 'efl/eet/eet-ffi'
5
+ #
6
+ module Efl
7
+ module Eet
8
+ #
9
+ class << self
10
+ #
11
+ def open path, mode=FILE_MODE_READ, &blk
12
+ if blk
13
+ f = Efl::API.eet_open path, mode
14
+ raise Exception.new "Unable to open file #{path}" if f.nil?
15
+ yield EetFile.new f
16
+ Efl::API.eet_close f
17
+ else
18
+ f = Efl::API.eet_open path, mode
19
+ return EetFile.new f unless f.nil?
20
+ end
21
+ end
22
+ end
23
+ #
24
+ class EetFile
25
+ #
26
+ def initialize ptr
27
+ @ptr=ptr
28
+ end
29
+ private :initialize
30
+ #
31
+ def close
32
+ Efl::API.eet_close @ptr
33
+ @ptr=nil
34
+ end
35
+ #
36
+ def mode_get
37
+ Efl::API.eet_mode_get @ptr
38
+ end
39
+ #
40
+ def write key, data, compress=false
41
+ Efl::API.eet_write @ptr, key, FFI::MemoryPointer.from_string(data), data.bytesize, ( compress ? 1 : 0 )
42
+ end
43
+ #
44
+ def read key
45
+ ptr = FFI::MemoryPointer.new(:int)
46
+ data = Efl::API.eet_read @ptr, key, ptr
47
+ s = ptr.read_int
48
+ ptr.free
49
+ return nil if s==0
50
+ ( data.null? ? nil : data.read_string[0..s-1] )
51
+ end
52
+ #
53
+ end
54
+ #
55
+ end
56
+ end
57
+ #
58
+ # EOF
@@ -0,0 +1,44 @@
1
+ #! /usr/bin/env ruby
2
+ # -*- coding: UTF-8 -*-
3
+ #
4
+ require 'efl/ffi'
5
+ #
6
+ module Efl
7
+ #
8
+ module Eina
9
+ def self.method_missing m, *args, &block
10
+ return Efl::API.send 'eina_'+m.to_s, *args, &block
11
+ end
12
+ end
13
+ #
14
+ module API
15
+ #
16
+ #
17
+ ffi_lib 'eina'
18
+ #
19
+ # ENUMS
20
+ #
21
+ # TYPEDEFS
22
+ # typedef unsigned char Eina_Bool;
23
+ typedef :bool, :eina_bool
24
+ typedef :pointer, :eina_bool_p
25
+ #
26
+ # CALLBACKS
27
+ # typedef int (*Eina_Compare_Cb) (const void *data1, const void *data2);
28
+ callback :eina_compare_cb, [ :void_p, :void_p ], :int
29
+ # typedef Eina_Bool (*Eina_Each_Cb) (const void *container, void *data, void *fdata);
30
+ callback :eina_each_cb, [ :void_p, :void_p, :void_p ], :eina_bool
31
+ # typedef void (*Eina_Free_Cb) (void *data);
32
+ callback :eina_free_cb, [ :void_p ], :void
33
+ #
34
+ # FUNCTIONS
35
+ fcts = [
36
+ # EAPI extern const unsigned int eina_prime_table[];
37
+ # FIXME
38
+ ]
39
+ #
40
+ attach_fcts fcts
41
+ end
42
+ end
43
+ #
44
+ # EOF