Eet.h | Eet.h | |||
---|---|---|---|---|
skipping to change at line 190 | skipping to change at line 190 | |||
* writing or a memory error occurs, NULL is returned. | * writing or a memory error occurs, NULL is returned. | |||
* | * | |||
* You can also open the file for read/write. If you then write a key th at | * You can also open the file for read/write. If you then write a key th at | |||
* does not exist it will be created, if the key exists it will be repla ced | * does not exist it will be created, if the key exists it will be repla ced | |||
* by the new data. | * by the new data. | |||
* | * | |||
* Example: | * Example: | |||
* @code | * @code | |||
* #include <Eet.h> | * #include <Eet.h> | |||
* #include <stdio.h> | * #include <stdio.h> | |||
* #include <string.h> | ||||
* | * | |||
* int | * int | |||
* main(int argc, char **argv) | * main(int argc, char **argv) | |||
* { | * { | |||
* Eet_File *ef; | * Eet_File *ef; | |||
* char buf[1024], *ret, **list; | * char buf[1024], *ret, **list; | |||
* int size, num, i; | * int size, num, i; | |||
* | * | |||
* eet_init(); | ||||
* | ||||
* strcpy(buf, "Here is a string of data to save!"); | * strcpy(buf, "Here is a string of data to save!"); | |||
* | * | |||
* ef = eet_open("/tmp/my_file.eet", EET_FILE_MODE_WRITE); | * ef = eet_open("/tmp/my_file.eet", EET_FILE_MODE_WRITE); | |||
* if (!ef) return -1; | * if (!ef) return -1; | |||
* if (!eet_write(ef, "/key/to_store/at", buf, 1024, 1)) | * if (!eet_write(ef, "/key/to_store/at", buf, 1024, 1)) | |||
* fprintf(stderr, "Error writing data!\n"); | * fprintf(stderr, "Error writing data!\n"); | |||
* eet_close(ef); | * eet_close(ef); | |||
* | * | |||
* ef = eet_open("/tmp/my_file.eet", EET_FILE_MODE_READ); | * ef = eet_open("/tmp/my_file.eet", EET_FILE_MODE_READ); | |||
* if (!ef) return -1; | * if (!ef) return -1; | |||
skipping to change at line 223 | skipping to change at line 226 | |||
* free(list); | * free(list); | |||
* } | * } | |||
* ret = eet_read(ef, "/key/to_store/at", &size); | * ret = eet_read(ef, "/key/to_store/at", &size); | |||
* if (ret) | * if (ret) | |||
* { | * { | |||
* printf("Data read (%i bytes):\n%s\n", size, ret); | * printf("Data read (%i bytes):\n%s\n", size, ret); | |||
* free(ret); | * free(ret); | |||
* } | * } | |||
* eet_close(ef); | * eet_close(ef); | |||
* | * | |||
* eet_shutdown(); | ||||
* | ||||
* return 0; | * return 0; | |||
* } | * } | |||
* @endcode | * @endcode | |||
* | * | |||
* @since 1.0.0 | * @since 1.0.0 | |||
*/ | */ | |||
EAPI Eet_File *eet_open(const char *file, Eet_File_Mode mode); | EAPI Eet_File *eet_open(const char *file, Eet_File_Mode mode); | |||
/** | /** | |||
* Open an eet file directly from a memory location. The data are not co pied, | * Open an eet file directly from a memory location. The data are not co pied, | |||
skipping to change at line 877 | skipping to change at line 882 | |||
* { | * { | |||
* Blah blah; | * Blah blah; | |||
* Blah2 blah2; | * Blah2 blah2; | |||
* Blah3 blah3; | * Blah3 blah3; | |||
* Eet_Data_Descriptor *edd, *edd2, *edd3; | * Eet_Data_Descriptor *edd, *edd2, *edd3; | |||
* void *data; | * void *data; | |||
* int size; | * int size; | |||
* FILE *f; | * FILE *f; | |||
* Blah *blah_in; | * Blah *blah_in; | |||
* | * | |||
* eet_init(); | ||||
* | ||||
* edd3 = eet_data_descriptor_new("blah3", sizeof(Blah3), | * edd3 = eet_data_descriptor_new("blah3", sizeof(Blah3), | |||
* eina_list_next, | * eina_list_next, | |||
* eina_list_append, | * eina_list_append, | |||
* eina_list_data_get, | * eina_list_data_get, | |||
* eina_list_free, | * eina_list_free, | |||
* eina_hash_foreach, | * eina_hash_foreach, | |||
* eet_eina_hash_add, | * eet_eina_hash_add, | |||
* eina_hash_free); | * eina_hash_free); | |||
* EET_DATA_DESCRIPTOR_ADD_BASIC(edd3, Blah3, "string3", string, EET_ T_STRING); | * EET_DATA_DESCRIPTOR_ADD_BASIC(edd3, Blah3, "string3", string, EET_ T_STRING); | |||
* | * | |||
skipping to change at line 963 | skipping to change at line 970 | |||
* EINA_LIST_FOREACH(blah_in->blah3, l, blah3_in) | * EINA_LIST_FOREACH(blah_in->blah3, l, blah3_in) | |||
* { | * { | |||
* printf("%p\n", blah3_in); | * printf("%p\n", blah3_in); | |||
* printf(" %s\n", blah3_in->string); | * printf(" %s\n", blah3_in->string); | |||
* } | * } | |||
* } | * } | |||
* eet_data_descriptor_free(edd); | * eet_data_descriptor_free(edd); | |||
* eet_data_descriptor_free(edd2); | * eet_data_descriptor_free(edd2); | |||
* eet_data_descriptor_free(edd3); | * eet_data_descriptor_free(edd3); | |||
* | * | |||
* eet_shutdown(); | ||||
* | ||||
* return 0; | * return 0; | |||
* } | * } | |||
* | * | |||
* @endcode | * @endcode | |||
* | * | |||
* @since 1.0.0 | * @since 1.0.0 | |||
*/ | */ | |||
EAPI Eet_Data_Descriptor *eet_data_descriptor_new(const char *name, int size, void *(*func_list_next) (void *l), void *(*func_list_append) (void *l , void *d), void *(*func_list_data) (void *l), void *(*func_list_free) (voi d *l), void (*func_hash_foreach) (void *h, int (*func) (void *h, const cha r *k, void *dt, void *fdt), void *fdt), void *(*func_hash_add) (void *h, co nst char *k, void *d), void (*func_hash_free) (void *h)); | EAPI Eet_Data_Descriptor *eet_data_descriptor_new(const char *name, int size, void *(*func_list_next) (void *l), void *(*func_list_append) (void *l , void *d), void *(*func_list_data) (void *l), void *(*func_list_free) (voi d *l), void (*func_hash_foreach) (void *h, int (*func) (void *h, const cha r *k, void *dt, void *fdt), void *fdt), void *(*func_hash_add) (void *h, co nst char *k, void *d), void (*func_hash_free) (void *h)); | |||
/* | /* | |||
* FIXME: | * FIXME: | |||
skipping to change at line 1379 | skipping to change at line 1388 | |||
EAPI Eet_Node *eet_node_unsigned_int_new(const char *name, unsigned int ui); | EAPI Eet_Node *eet_node_unsigned_int_new(const char *name, unsigned int ui); | |||
EAPI Eet_Node *eet_node_unsigned_long_long_new(const char *name, unsigne d long long l); | EAPI Eet_Node *eet_node_unsigned_long_long_new(const char *name, unsigne d long long l); | |||
EAPI Eet_Node *eet_node_string_new(const char *name, const char *str); | EAPI Eet_Node *eet_node_string_new(const char *name, const char *str); | |||
EAPI Eet_Node *eet_node_inlined_string_new(const char *name, const char *str); | EAPI Eet_Node *eet_node_inlined_string_new(const char *name, const char *str); | |||
EAPI Eet_Node *eet_node_null_new(const char *name); | EAPI Eet_Node *eet_node_null_new(const char *name); | |||
EAPI Eet_Node *eet_node_list_new(const char *name, Eina_List *nodes); | EAPI Eet_Node *eet_node_list_new(const char *name, Eina_List *nodes); | |||
EAPI Eet_Node *eet_node_array_new(const char *name, int count, Eina_List *nodes); | EAPI Eet_Node *eet_node_array_new(const char *name, int count, Eina_List *nodes); | |||
EAPI Eet_Node *eet_node_var_array_new(const char *name, Eina_List *nodes ); | EAPI Eet_Node *eet_node_var_array_new(const char *name, Eina_List *nodes ); | |||
EAPI Eet_Node *eet_node_hash_new(const char *name, const char *key, Eet_ Node *node); | EAPI Eet_Node *eet_node_hash_new(const char *name, const char *key, Eet_ Node *node); | |||
EAPI Eet_Node *eet_node_struct_new(const char *name, Eina_List *nodes); | EAPI Eet_Node *eet_node_struct_new(const char *name, Eina_List *nodes); | |||
EAPI Eet_Node *eet_node_struct_child_new(const char *parent, Eet_Node *c hild); | ||||
EAPI void eet_node_del(Eet_Node *n); | EAPI void eet_node_del(Eet_Node *n); | |||
EAPI void *eet_data_node_encode_cipher(Eet_Node *node, const char *key, int *size_ret); | EAPI void *eet_data_node_encode_cipher(Eet_Node *node, const char *key, int *size_ret); | |||
EAPI int eet_data_node_write_cipher(Eet_File *ef, const char *name, cons t char *key, Eet_Node *node, int compress); | EAPI int eet_data_node_write_cipher(Eet_File *ef, const char *name, cons t char *key, Eet_Node *node, int compress); | |||
/************************************************************************** */ | /************************************************************************** */ | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
} | } | |||
#endif | #endif | |||
End of changes. 6 change blocks. | ||||
0 lines changed or deleted | 10 lines changed or added | |||