Eet.h | Eet.h | |||
---|---|---|---|---|
skipping to change at line 639 | skipping to change at line 639 | |||
* You add structure members to the data descriptor using the macros | * You add structure members to the data descriptor using the macros | |||
* EET_DATA_DESCRIPTOR_ADD_BASIC(), EET_DATA_DESCRIPTOR_ADD_SUB() and | * EET_DATA_DESCRIPTOR_ADD_BASIC(), EET_DATA_DESCRIPTOR_ADD_SUB() and | |||
* EET_DATA_DESCRIPTOR_ADD_LIST(), depending on what type of member you are | * EET_DATA_DESCRIPTOR_ADD_LIST(), depending on what type of member you are | |||
* adding to the description. | * adding to the description. | |||
* | * | |||
* Once you have described all the members of a struct you want loaded, or | * Once you have described all the members of a struct you want loaded, or | |||
* saved eet can load and save those members for you, encode them into | * saved eet can load and save those members for you, encode them into | |||
* endian-independant serialised data chunks for transmission across a | * endian-independant serialised data chunks for transmission across a | |||
* a network or more. | * a network or more. | |||
* | * | |||
* The function pointers to the list and hash table functions are only | ||||
* needed if you use those data types, else you can pass NULL instead. | ||||
* | ||||
* Example: | * Example: | |||
* | * | |||
* @code | * @code | |||
* #include <Eet.h> | * #include <Eet.h> | |||
* #include <Evas.h> | * #include <Evas.h> | |||
* | * | |||
* typedef struct _blah2 | * typedef struct _blah2 | |||
* { | * { | |||
* char *string; | * char *string; | |||
* } | * } | |||
skipping to change at line 916 | skipping to change at line 919 | |||
* This function will parse the string pointed to by @p text and return | * This function will parse the string pointed to by @p text and return | |||
* an encoded data lump the same way eet_data_descriptor_encode() takes an | * an encoded data lump the same way eet_data_descriptor_encode() takes an | |||
* in-memory data struct and encodes into a binary blob. @p text is a no rmal | * in-memory data struct and encodes into a binary blob. @p text is a no rmal | |||
* C string. | * C string. | |||
* | * | |||
* @since 1.0.0 | * @since 1.0.0 | |||
*/ | */ | |||
EAPI void *eet_data_text_undump(const char *text, int textlen, int *size _ret); | EAPI void *eet_data_text_undump(const char *text, int textlen, int *size _ret); | |||
/** | /** | |||
* Dump an eet encoded data structure from an eet file into ascii text | ||||
* @param ef A valid eet file handle. | ||||
* @param name Name of the entry. eg: "/base/file_i_want". | ||||
* @param dumpfunc The function to call passed a string when new data is | ||||
converted to text | ||||
* @param dumpdata The data to pass to the @p dumpfunc callback. | ||||
* @return 1 on success, 0 on failure | ||||
* | ||||
* This function will take an open and valid eet file from eet_open() re | ||||
quest | ||||
* the data encoded by eet_data_descriptor_encode() corresponding to the | ||||
key @p name | ||||
* and convert it into human readable ascii text. It does this by callin | ||||
g the | ||||
* @p dumpfunc callback for all new text that is generated. This callbac | ||||
k should | ||||
* append to any existing text buffer and will be passed the pointer @p | ||||
dumpdata | ||||
* as a parameter as well as a string with new text to be appended. | ||||
* | ||||
* @since 1.0.0 | ||||
*/ | ||||
EAPI int eet_data_dump(Eet_File *ef, const char *name, void (*dumpfunc) | ||||
(void *data, const char *str), void *dumpdata); | ||||
/** | ||||
* Take an ascii encoding from eet_data_dump() and re-encode in binary. | ||||
* @param ef A valid eet file handle. | ||||
* @param name Name of the entry. eg: "/base/file_i_want". | ||||
* @param text The pointer to the string data to parse and encode. | ||||
* @param textlen The size of the string in bytes (not including 0 byte | ||||
terminator). | ||||
* @param compress Compression flags (1 == compress, 0 = don't compress) | ||||
. | ||||
* @return 1 on success, 0 on failure | ||||
* | ||||
* This function will parse the string pointed to by @p text, encode it | ||||
the same | ||||
* way eet_data_descriptor_encode() takes an in-memory data struct and e | ||||
ncodes into a | ||||
* binary blob. | ||||
* | ||||
* The data (optionally compressed) will be in ram, pending a flush to | ||||
* disk (it will stay in ram till the eet file handle is closed though). | ||||
* | ||||
* @since 1.0.0 | ||||
*/ | ||||
EAPI int eet_data_undump(Eet_File *ef, const char *name, const char *tex | ||||
t, int textlen, int compress); | ||||
/** | ||||
* Decode a data structure from an arbitary location in memory. | * Decode a data structure from an arbitary location in memory. | |||
* @param edd The data descriptor to use when decoding. | * @param edd The data descriptor to use when decoding. | |||
* @param data_in The pointer to the data to decode into a struct. | * @param data_in The pointer to the data to decode into a struct. | |||
* @param size_in The size of the data pointed to in bytes. | * @param size_in The size of the data pointed to in bytes. | |||
* @return NULL on failure, or a valid decoded struct pointer on success . | * @return NULL on failure, or a valid decoded struct pointer on success . | |||
* | * | |||
* This function will decode a data structure that has been encoded usin g | * This function will decode a data structure that has been encoded usin g | |||
* eet_data_descriptor_encode(), and return a data structure with all it s | * eet_data_descriptor_encode(), and return a data structure with all it s | |||
* elements filled out, if successful, or NULL on failure. | * elements filled out, if successful, or NULL on failure. | |||
* | * | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 54 lines changed or added | |||