int revision; /** < svn revision (0 if a proper rlease or the svn revsion number Eet is built from) */
} Eet_Version;
-EAPI extern Eet_Version * eet_version;
+EAPI extern Eet_Version *eet_version;
/**
* @defgroup Eet_Group Top level functions
* @since 1.1.0
* @ingroup Eet_File_Group
*/
-EAPI Eet_File * eet_memopen_read(const void * data,
- size_t size);
+EAPI Eet_File * eet_memopen_read(const void *data,
+ size_t size);
/**
* Get the mode an Eet_File was opened with.
* @since 1.0.0
* @ingroup Eet_File_Group
*/
-EAPI Eet_File_Mode eet_mode_get(Eet_File * ef);
+EAPI Eet_File_Mode eet_mode_get(Eet_File *ef);
/**
* Close an eet file handle and flush and writes pending.
* @since 1.0.0
* @ingroup Eet_File_Group
*/
-EAPI Eet_Error eet_close(Eet_File * ef);
+EAPI Eet_Error eet_close(Eet_File *ef);
/**
* Sync content of an eet file handle, flushing pending writes.
* @since 1.2.4
* @ingroup Eet_File_Group
*/
-EAPI Eet_Error eet_sync(Eet_File * ef);
+EAPI Eet_Error eet_sync(Eet_File *ef);
/**
* Return a handle to the shared string dictionary of the Eet file
* @since 1.0.0
* @ingroup Eet_File_Group
*/
-EAPI Eet_Dictionary * eet_dictionary_get(Eet_File * ef);
+EAPI Eet_Dictionary * eet_dictionary_get(Eet_File *ef);
/**
* Check if a given string comes from a given dictionary
* @since 1.0.0
* @ingroup Eet_File_Group
*/
-EAPI int eet_dictionary_string_check(Eet_Dictionary * ed,
- const char * string);
+EAPI int eet_dictionary_string_check(Eet_Dictionary *ed,
+ const char * string);
/**
* Read a specified entry from an eet file and return data
* @since 1.0.0
* @ingroup Eet_File_Group
*/
-EAPI void * eet_read(Eet_File * ef,
- const char * name,
- int * size_ret);
+EAPI void * eet_read(Eet_File * ef,
+ const char *name,
+ int * size_ret);
/**
* Read a specified entry from an eet file and return data
* @since 1.0.0
* @ingroup Eet_File_Group
*/
-EAPI const void * eet_read_direct(Eet_File * ef,
- const char * name,
- int * size_ret);
+EAPI const void * eet_read_direct(Eet_File * ef,
+ const char *name,
+ int * size_ret);
/**
* Write a specified entry to an eet file handle
* @since 1.0.0
* @ingroup Eet_File_Group
*/
-EAPI int eet_write(Eet_File * ef,
- const char * name,
- const void * data,
- int size,
- int compress);
+EAPI int eet_write(Eet_File * ef,
+ const char *name,
+ const void *data,
+ int size,
+ int compress);
/**
* Delete a specified entry from an Eet file being written or re-written
* @since 1.0.0
* @ingroup Eet_File_Group
*/
-EAPI int eet_delete(Eet_File * ef,
- const char * name);
+EAPI int eet_delete(Eet_File * ef,
+ const char *name);
/**
* Alias a specific section to another one. Destination may exist or not,
* @since 1.3.3
* @ingroup Eet_File_Group
*/
-EAPI Eina_Bool eet_alias(Eet_File * ef,
- const char * name,
- const char * destination,
- int compress);
+EAPI Eina_Bool eet_alias(Eet_File * ef,
+ const char *name,
+ const char *destination,
+ int compress);
/**
* List all entries in eet file matching shell glob.
* @since 1.0.0
* @ingroup Eet_File_Group
*/
-EAPI char ** eet_list(Eet_File * ef,
- const char * glob,
- int * count_ret);
+EAPI char ** eet_list(Eet_File * ef,
+ const char *glob,
+ int * count_ret);
/**
* Return the number of entries in the specified eet file.
* @since 1.0.0
* @ingroup Eet_File_Group
*/
-EAPI int eet_num_entries(Eet_File * ef);
+EAPI int eet_num_entries(Eet_File *ef);
/**
* @defgroup Eet_File_Cipher_Group Eet File Ciphered Main Functions
* @since 1.0.0
* @ingroup Eet_File_Cipher_Group
*/
-EAPI void * eet_read_cipher(Eet_File * ef,
- const char * name,
- int * size_ret,
- const char * cipher_key);
+EAPI void * eet_read_cipher(Eet_File * ef,
+ const char *name,
+ int * size_ret,
+ const char *cipher_key);
/**
* Write a specified entry to an eet file handle using a cipher.
* @since 1.0.0
* @ingroup Eet_File_Cipher_Group
*/
-EAPI int eet_write_cipher(Eet_File * ef,
- const char * name,
- const void * data,
- int size,
- int compress,
- const char * cipher_key);
+EAPI int eet_write_cipher(Eet_File * ef,
+ const char *name,
+ const void *data,
+ int size,
+ int compress,
+ const char *cipher_key);
/**
* @defgroup Eet_File_Image_Group Image Store and Load
* @since 1.0.0
* @ingroup Eet_File_Image_Group
*/
-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);
+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);
/**
* Read image data from the named key in the eet file.
* @since 1.0.0
* @ingroup Eet_File_Image_Group
*/
-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);
+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);
/**
* Read image data from the named key in the eet file.
* @since 1.0.2
* @ingroup Eet_File_Image_Group
*/
-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);
+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);
/**
* Write image data to the named key in an eet file.
* @since 1.0.0
* @ingroup Eet_File_Image_Group
*/
-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);
+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);
/**
* Decode Image data into pixel data.
* @since 1.0.0
* @ingroup Eet_File_Image_Group
*/
-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);
+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);
/**
* Decode Image data into pixel data.
* @since 1.0.2
* @ingroup Eet_File_Image_Group
*/
-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);
+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);
/**
* Encode image data for storage or transmission.
* @since 1.0.0
* @ingroup Eet_File_Image_Cipher_Group
*/
-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);
+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);
/**
* Read image data from the named key in the eet file using a cipher.
* @since 1.0.0
* @ingroup Eet_File_Image_Cipher_Group
*/
-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);
+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);
/**
* Read image data from the named key in the eet file using a cipher.
* @since 1.0.2
* @ingroup Eet_File_Image_Cipher_Group
*/
-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);
+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);
/**
* Write image data to the named key in an eet file using a cipher.
* @since 1.0.0
* @ingroup Eet_File_Image_Cipher_Group
*/
-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);
+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);
/**
* Decode Image data into pixel data using a cipher.
* @since 1.0.0
* @ingroup Eet_File_Image_Cipher_Group
*/
-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);
+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);
/**
* Decode Image data into pixel data using a cipher.
* @since 1.0.2
* @ingroup Eet_File_Image_Cipher_Group
*/
-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);
+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);
/**
* Encode image data for storage or transmission using a cipher.
* @since 1.2.0
* @ingroup Eet_Cipher_Group
*/
-typedef int (* Eet_Key_Password_Callback)(char * buffer, int size, int rwflag, void * data);
+typedef int (* Eet_Key_Password_Callback)(char *buffer, int size, int rwflag, void *data);
/**
* Create an Eet_Key needed for signing an eet file.
* @since 1.2.0
* @ingroup Eet_Cipher_Group
*/
-EAPI void eet_identity_close(Eet_Key * key);
+EAPI void eet_identity_close(Eet_Key *key);
/**
* Set a key to sign a file
* @since 1.2.0
* @ingroup Eet_Cipher_Group
*/
-EAPI Eet_Error eet_identity_set(Eet_File * ef,
- Eet_Key * key);
+EAPI Eet_Error eet_identity_set(Eet_File *ef,
+ Eet_Key * key);
/**
* Display both private and public key of an Eet_Key.
* @since 1.2.0
* @ingroup Eet_Cipher_Group
*/
-EAPI void eet_identity_print(Eet_Key * key,
- FILE * out);
+EAPI void eet_identity_print(Eet_Key *key,
+ FILE * out);
/**
* Get the x509 der certificate associated with an Eet_File. Will return NULL
* @since 1.2.0
* @ingroup Eet_Cipher_Group
*/
-EAPI const void * eet_identity_x509(Eet_File * ef,
- int * der_length);
+EAPI const void * eet_identity_x509(Eet_File *ef,
+ int * der_length);
/**
* Get the raw signature associated with an Eet_File. Will return NULL
*
* @ingroup Eet_Cipher_Group
*/
-EAPI const void * eet_identity_signature(Eet_File * ef,
- int * signature_length);
+EAPI const void * eet_identity_signature(Eet_File *ef,
+ int * signature_length);
/**
* Get the SHA1 associated with a file. Could be the one used to
* @since 1.2.0
* @ingroup Eet_Cipher_Group
*/
-EAPI const void * eet_identity_sha1(Eet_File * ef,
- int * sha1_length);
+EAPI const void * eet_identity_sha1(Eet_File *ef,
+ int * sha1_length);
/**
* Display the x509 der certificate to out.
* @since 1.2.0
* @ingroup Eet_Cipher_Group
*/
-EAPI void eet_identity_certificate_print(const unsigned char * certificate,
- int der_length,
- FILE * out);
+EAPI void eet_identity_certificate_print(const unsigned char *certificate,
+ int der_length,
+ FILE * out);
/**
* @defgroup Eet_Data_Group Eet Data Serialization
*/
struct _Eet_Data_Descriptor_Class
{
- int version; /**< ABI version as #EET_DATA_DESCRIPTOR_CLASS_VERSION */
- const char * name; /**< Name of data type to be serialized */
- int size; /**< Size in bytes of data type to be serialized */
+ int version; /**< ABI version as #EET_DATA_DESCRIPTOR_CLASS_VERSION */
+ const char *name; /**< Name of data type to be serialized */
+ int size; /**< Size in bytes of data type to be serialized */
struct
{
- void * (* mem_alloc)(size_t size); /**< how to allocate memory (usually malloc()) */
- void (* mem_free)(void * mem); /**< how to free memory (usually free()) */
- char * (* str_alloc)(const char * str); /**< how to allocate a string */
- void (* str_free)(const char * str); /**< how to free a string */
- void * (* list_next)(void * l); /**< how to iterate to the next element of a list. Receives and should return the list node. */
- void * (* list_append)(void * l, void * d); /**< how to append data @p d to list which head node is @p l */
- void * (* list_data)(void * l); /**< retrieves the data from node @p l */
- void * (* list_free)(void * l); /**< free all the nodes from the list which head node is @p l */
- void (* hash_foreach)(void * h, int (* func)(void * h, const char * k, void * dt, void * fdt), void * fdt); /**< iterates over all elements in the hash @p h in no specific order */
- void * (* hash_add)(void * h, const char * k, void * d); /**< add a new data @p d as key @p k in hash @p h */
- void (* hash_free)(void * h); /**< free all entries from the hash @p h */
- char * (* str_direct_alloc)(const char * str); /**< how to allocate a string directly from file backed/mmaped region pointed by @p str */
- void (* str_direct_free)(const char * str); /**< how to free a string returned by str_direct_alloc */
- const char *(* type_get)(const void * data, Eina_Bool * unknow); /**< convert any kind of data type to a name that define an Eet_Data_Element. */
- Eina_Bool (* type_set)(const char * type, void * data, Eina_Bool unknow); /**< set the type at a particular adress */
+ void * (*mem_alloc)(size_t size); /**< how to allocate memory (usually malloc()) */
+ void (*mem_free)(void *mem); /**< how to free memory (usually free()) */
+ char * (*str_alloc)(const char *str); /**< how to allocate a string */
+ void (*str_free)(const char *str); /**< how to free a string */
+ void * (*list_next)(void *l); /**< how to iterate to the next element of a list. Receives and should return the list node. */
+ void * (*list_append)(void *l, void *d); /**< how to append data @p d to list which head node is @p l */
+ void * (*list_data)(void *l); /**< retrieves the data from node @p l */
+ void * (*list_free)(void *l); /**< free all the nodes from the list which head node is @p l */
+ void (*hash_foreach)(void *h, int (*func)(void *h, const char *k, void *dt, void *fdt), void *fdt); /**< iterates over all elements in the hash @p h in no specific order */
+ void * (*hash_add)(void *h, const char *k, void *d); /**< add a new data @p d as key @p k in hash @p h */
+ void (*hash_free)(void *h); /**< free all entries from the hash @p h */
+ char * (*str_direct_alloc)(const char *str); /**< how to allocate a string directly from file backed/mmaped region pointed by @p str */
+ void (*str_direct_free)(const char *str); /**< how to free a string returned by str_direct_alloc */
+ const char *(*type_get)(const void *data, Eina_Bool *unknow); /**< convert any kind of data type to a name that define an Eet_Data_Element. */
+ Eina_Bool (*type_set)(const char *type, void *data, Eina_Bool unknow); /**< set the type at a particular adress */
} func;
};
* @deprecated use eet_data_descriptor_stream_new() or
* eet_data_descriptor_file_new()
*/
-EINA_DEPRECATED EAPI Eet_Data_Descriptor * eet_data_descriptor_new(const char * name,
+EINA_DEPRECATED 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)(void * l),
- void (* func_hash_foreach)(void * h, int (* func)(void * h,
- const char * k,
- void * dt,
- void * fdt), void * fdt),
- void *(*func_hash_add)(void * h, const char * k, void * d),
- void (* func_hash_free)(void * h));
+ void *(*func_list_next)(void *l),
+ void *(*func_list_append)(void *l, void *d),
+ void *(*func_list_data)(void *l),
+ void *(*func_list_free)(void *l),
+ void (*func_hash_foreach)(void *h, int (*func)(void * h,
+ const char *k,
+ void * dt,
+ void * fdt), void *fdt),
+ void *(*func_hash_add)(void *h, const char *k, void *d),
+ void (*func_hash_free)(void *h));
/*
* FIXME:
*
* moving to this api from the old above. this will break things when the
* move happens - but be warned
*/
-EINA_DEPRECATED EAPI Eet_Data_Descriptor * eet_data_descriptor2_new(const Eet_Data_Descriptor_Class * eddc);
-EINA_DEPRECATED EAPI Eet_Data_Descriptor * eet_data_descriptor3_new(const Eet_Data_Descriptor_Class * eddc);
+EINA_DEPRECATED EAPI Eet_Data_Descriptor * eet_data_descriptor2_new(const Eet_Data_Descriptor_Class *eddc);
+EINA_DEPRECATED EAPI Eet_Data_Descriptor * eet_data_descriptor3_new(const Eet_Data_Descriptor_Class *eddc);
/**
* This function creates a new data descriptore and returns a handle to the
* @since 1.2.3
* @ingroup Eet_Data_Group
*/
-EAPI Eet_Data_Descriptor * eet_data_descriptor_stream_new(const Eet_Data_Descriptor_Class * eddc);
+EAPI Eet_Data_Descriptor * eet_data_descriptor_stream_new(const Eet_Data_Descriptor_Class *eddc);
/**
* This function creates a new data descriptore and returns a handle to the
* @since 1.2.3
* @ingroup Eet_Data_Group
*/
-EAPI Eet_Data_Descriptor * eet_data_descriptor_file_new(const Eet_Data_Descriptor_Class * eddc);
+EAPI Eet_Data_Descriptor * eet_data_descriptor_file_new(const Eet_Data_Descriptor_Class *eddc);
/**
* This function is an helper that set all the parameter of an
* @since 1.2.3
* @ingroup Eet_Data_Group
*/
-EAPI Eina_Bool eet_eina_stream_data_descriptor_class_set(Eet_Data_Descriptor_Class * eddc,
- const char * name,
- int size);
+EAPI Eina_Bool eet_eina_stream_data_descriptor_class_set(Eet_Data_Descriptor_Class *eddc,
+ const char * name,
+ int size);
/**
* This macro is an helper that set all the parameter of an
* @since 1.2.3
* @ingroup Eet_Data_Group
*/
-EAPI Eina_Bool eet_eina_file_data_descriptor_class_set(Eet_Data_Descriptor_Class * eddc,
- const char * name,
- int size);
+EAPI Eina_Bool eet_eina_file_data_descriptor_class_set(Eet_Data_Descriptor_Class *eddc,
+ const char * name,
+ int size);
/**
* This macro is an helper that set all the parameter of an
* @since 1.0.0
* @ingroup Eet_Data_Group
*/
-EAPI void eet_data_descriptor_free(Eet_Data_Descriptor * edd);
+EAPI void eet_data_descriptor_free(Eet_Data_Descriptor *edd);
/**
* This function is an internal used by macros.
* @since 1.0.0
* @ingroup Eet_Data_Group
*/
-EAPI void eet_data_descriptor_element_add(Eet_Data_Descriptor * edd,
- const char * name,
- int type,
- int group_type,
- int offset,
+EAPI void eet_data_descriptor_element_add(Eet_Data_Descriptor *edd,
+ const char * name,
+ int type,
+ int group_type,
+ int offset,
/* int count_offset, */
- int count,
- const char * counter_name,
- Eet_Data_Descriptor * subtype);
+ int count,
+ const char * counter_name,
+ Eet_Data_Descriptor *subtype);
/**
* Read a data structure from an eet file and decodes it.
* @since 1.0.0
* @ingroup Eet_Data_Group
*/
-EAPI void * eet_data_read(Eet_File * ef,
- Eet_Data_Descriptor * edd,
- const char * name);
+EAPI void * eet_data_read(Eet_File * ef,
+ Eet_Data_Descriptor *edd,
+ const char * name);
/**
* Write a data structure from memory and store in an eet file.
* @since 1.0.0
* @ingroup Eet_Data_Group
*/
-EAPI int eet_data_write(Eet_File * ef,
- Eet_Data_Descriptor * edd,
- const char * name,
- const void * data,
- int compress);
+EAPI int eet_data_write(Eet_File * ef,
+ Eet_Data_Descriptor *edd,
+ const char * name,
+ const void * data,
+ int compress);
/**
* Dump an eet encoded data structure into ascii text
* @since 1.0.0
* @ingroup Eet_Data_Group
*/
-EAPI int eet_data_text_dump(const void * data_in,
+EAPI int eet_data_text_dump(const void *data_in,
int size_in,
- void (* dumpfunc)(void * data, const char * str),
- void * dumpdata);
+ void (*dumpfunc)(void *data, const char *str),
+ void *dumpdata);
/**
* Take an ascii encoding from eet_data_text_dump() and re-encode in binary.
* @since 1.0.0
* @ingroup Eet_Data_Group
*/
-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
* @since 1.0.0
* @ingroup Eet_Data_Group
*/
-EAPI int eet_data_dump(Eet_File * ef,
- const char * name,
- void (* dumpfunc)(void * data, const char * str),
- void * dumpdata);
+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.
* @since 1.0.0
* @ingroup Eet_Data_Group
*/
-EAPI int eet_data_undump(Eet_File * ef,
- const char * name,
- const char * text,
- int textlen,
- int compress);
+EAPI int eet_data_undump(Eet_File * ef,
+ const char *name,
+ const char *text,
+ int textlen,
+ int compress);
/**
* Decode a data structure from an arbitary location in memory.
* @since 1.0.0
* @ingroup Eet_Data_Group
*/
-EAPI void * eet_data_descriptor_decode(Eet_Data_Descriptor * edd,
- const void * data_in,
- int size_in);
+EAPI void * eet_data_descriptor_decode(Eet_Data_Descriptor *edd,
+ const void * data_in,
+ int size_in);
/**
* Encode a dsata struct to memory and return that encoded data.
* @since 1.0.0
* @ingroup Eet_Data_Group
*/
-EAPI void * eet_data_descriptor_encode(Eet_Data_Descriptor * edd,
- const void * data_in,
- int * size_ret);
+EAPI void * eet_data_descriptor_encode(Eet_Data_Descriptor *edd,
+ const void * data_in,
+ int * size_ret);
/**
* Add a basic data element to a data descriptor.
* @since 1.0.0
* @ingroup Eet_Data_Cipher_Group
*/
-EAPI void * eet_data_read_cipher(Eet_File * ef,
- Eet_Data_Descriptor * edd,
- const char * name,
- const char * cipher_key);
+EAPI void * eet_data_read_cipher(Eet_File * ef,
+ Eet_Data_Descriptor *edd,
+ const char * name,
+ const char * cipher_key);
/**
* Write a data structure from memory and store in an eet file
* @since 1.0.0
* @ingroup Eet_Data_Cipher_Group
*/
-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);
+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);
/**
* Dump an eet encoded data structure into ascii text using a cipher.
* @since 1.0.0
* @ingroup Eet_Data_Cipher_Group
*/
-EAPI int eet_data_text_dump_cipher(const void * data_in,
- const char * cipher_key,
+EAPI int eet_data_text_dump_cipher(const void *data_in,
+ const char *cipher_key,
int size_in,
- void (* dumpfunc)(void * data, const char * str),
- void * dumpdata);
+ void (*dumpfunc)(void *data, const char *str),
+ void *dumpdata);
/**
* Take an ascii encoding from eet_data_text_dump() and re-encode
* @since 1.0.0
* @ingroup Eet_Data_Cipher_Group
*/
-EAPI void * eet_data_text_undump_cipher(const char * text,
- const char * cipher_key,
- int textlen,
- int * size_ret);
+EAPI void * eet_data_text_undump_cipher(const char *text,
+ const char *cipher_key,
+ int textlen,
+ int * size_ret);
/**
* Dump an eet encoded data structure from an eet file into ascii
* @since 1.0.0
* @ingroup Eet_Data_Cipher_Group
*/
-EAPI int eet_data_dump_cipher(Eet_File * ef,
- const char * name,
- const char * cipher_key,
- void (* dumpfunc)(void * data, const char * str),
- void * dumpdata);
+EAPI int eet_data_dump_cipher(Eet_File *ef,
+ const char *name,
+ const char *cipher_key,
+ void (*dumpfunc)(void *data, const char *str),
+ void *dumpdata);
/**
* Take an ascii encoding from eet_data_dump() and re-encode in
* @since 1.0.0
* @ingroup Eet_Data_Cipher_Group
*/
-EAPI int eet_data_undump_cipher(Eet_File * ef,
- const char * name,
- const char * cipher_key,
- const char * text,
- int textlen,
- int compress);
+EAPI int eet_data_undump_cipher(Eet_File * ef,
+ const char *name,
+ const char *cipher_key,
+ const char *text,
+ int textlen,
+ int compress);
/**
* Decode a data structure from an arbitary location in memory
* @since 1.0.0
* @ingroup Eet_Data_Cipher_Group
*/
-EAPI void * eet_data_descriptor_decode_cipher(Eet_Data_Descriptor * edd,
- const void * data_in,
- const char * cipher_key,
- int size_in);
+EAPI void * eet_data_descriptor_decode_cipher(Eet_Data_Descriptor *edd,
+ const void * data_in,
+ const char * cipher_key,
+ int size_in);
/**
* Encode a data struct to memory and return that encoded data
* @since 1.0.0
* @ingroup Eet_Data_Cipher_Group
*/
-EAPI void * eet_data_descriptor_encode_cipher(Eet_Data_Descriptor * edd,
- const void * data_in,
- const char * cipher_key,
- int * size_ret);
+EAPI void * eet_data_descriptor_encode_cipher(Eet_Data_Descriptor *edd,
+ const void * data_in,
+ const char * cipher_key,
+ int * size_ret);
/**
* @defgroup Eet_Node_Group Low-level Serialization Structures.
* TODO FIX ME
* @ingroup Eet_Node_Group
*/
-EAPI Eet_Node * eet_node_char_new(const char * name,
- char c);
+EAPI Eet_Node * eet_node_char_new(const char *name,
+ char c);
/**
* TODO FIX ME
* @ingroup Eet_Node_Group
*/
-EAPI Eet_Node * eet_node_short_new(const char * name,
- short s);
+EAPI Eet_Node * eet_node_short_new(const char *name,
+ short s);
/**
* TODO FIX ME
* @ingroup Eet_Node_Group
*/
-EAPI Eet_Node * eet_node_int_new(const char * name,
- int i);
+EAPI Eet_Node * eet_node_int_new(const char *name,
+ int i);
/**
* TODO FIX ME
* @ingroup Eet_Node_Group
*/
-EAPI Eet_Node * eet_node_long_long_new(const char * name,
- long long l);
+EAPI Eet_Node * eet_node_long_long_new(const char *name,
+ long long l);
/**
* TODO FIX ME
* @ingroup Eet_Node_Group
*/
-EAPI Eet_Node * eet_node_float_new(const char * name,
- float f);
+EAPI Eet_Node * eet_node_float_new(const char *name,
+ float f);
/**
* TODO FIX ME
* @ingroup Eet_Node_Group
*/
-EAPI Eet_Node * eet_node_double_new(const char * name,
- double d);
+EAPI Eet_Node * eet_node_double_new(const char *name,
+ double d);
/**
* TODO FIX ME
* TODO FIX ME
* @ingroup Eet_Node_Group
*/
-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);
/**
* TODO FIX ME
* @ingroup Eet_Node_Group
*/
-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);
/**
* TODO FIX ME
* @ingroup Eet_Node_Group
*/
-EAPI Eet_Node * eet_node_null_new(const char * name);
+EAPI Eet_Node * eet_node_null_new(const char *name);
/**
* TODO FIX ME
* @ingroup Eet_Node_Group
*/
-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);
/**
* TODO FIX ME
* @ingroup Eet_Node_Group
*/
-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);
/**
* TODO FIX ME
* @ingroup Eet_Node_Group
*/
-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);
/**
* TODO FIX ME
* @ingroup Eet_Node_Group
*/
-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);
/**
* TODO FIX ME
* @ingroup Eet_Node_Group
*/
-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);
/**
* TODO FIX ME
* @ingroup Eet_Node_Group
*/
-EAPI Eet_Node * eet_node_struct_child_new(const char * parent,
- Eet_Node * child);
+EAPI Eet_Node * eet_node_struct_child_new(const char *parent,
+ Eet_Node * child);
/**
* TODO FIX ME
* @ingroup Eet_Node_Group
*/
-EAPI void eet_node_list_append(Eet_Node * parent,
- const char * name,
- Eet_Node * child);
+EAPI void eet_node_list_append(Eet_Node * parent,
+ const char *name,
+ Eet_Node * child);
/**
* TODO FIX ME
* @ingroup Eet_Node_Group
*/
-EAPI void eet_node_struct_append(Eet_Node * parent,
- const char * name,
- Eet_Node * child);
+EAPI void eet_node_struct_append(Eet_Node * parent,
+ const char *name,
+ Eet_Node * child);
/**
* TODO FIX ME
* @ingroup Eet_Node_Group
*/
-EAPI void eet_node_hash_add(Eet_Node * parent,
- const char * name,
- const char * key,
- Eet_Node * child);
+EAPI void eet_node_hash_add(Eet_Node * parent,
+ const char *name,
+ const char *key,
+ Eet_Node * child);
/**
* TODO FIX ME
* @ingroup Eet_Node_Group
*/
-EAPI void eet_node_dump(Eet_Node * n,
+EAPI void eet_node_dump(Eet_Node *n,
int dumplevel,
- void (* dumpfunc)(void * data, const char * str),
- void * dumpdata);
+ void (*dumpfunc)(void *data, const char *str),
+ void *dumpdata);
/**
* TODO FIX ME
* @ingroup Eet_Node_Group
*/
-EAPI void eet_node_del(Eet_Node * n);
+EAPI void eet_node_del(Eet_Node *n);
/**
* TODO FIX ME
* @ingroup Eet_Node_Group
*/
-EAPI void * eet_data_node_encode_cipher(Eet_Node * node,
- const char * cipher_key,
- int * size_ret);
+EAPI void * eet_data_node_encode_cipher(Eet_Node * node,
+ const char *cipher_key,
+ int * size_ret);
/**
* TODO FIX ME
* @ingroup Eet_Node_Group
*/
-EAPI Eet_Node * eet_data_node_decode_cipher(const void * data_in,
- const char * cipher_key,
- int size_in);
+EAPI Eet_Node * eet_data_node_decode_cipher(const void *data_in,
+ const char *cipher_key,
+ int size_in);
/**
* TODO FIX ME
* @ingroup Eet_Node_Group
*/
-EAPI Eet_Node * eet_data_node_read_cipher(Eet_File * ef,
- const char * name,
- const char * cipher_key);
+EAPI Eet_Node * eet_data_node_read_cipher(Eet_File * ef,
+ const char *name,
+ const char *cipher_key);
/**
* TODO FIX ME
* @ingroup Eet_Node_Group
*/
-EAPI int eet_data_node_write_cipher(Eet_File * ef,
- const char * name,
- const char * cipher_key,
- Eet_Node * node,
- int compress);
+EAPI int eet_data_node_write_cipher(Eet_File * ef,
+ const char *name,
+ const char *cipher_key,
+ Eet_Node * node,
+ int compress);
/* EXPERIMENTAL: THIS API MAY CHANGE IN THE FUTURE, USE IT ONLY IF YOU KNOW WHAT YOU ARE DOING. */
*/
struct _Eet_Node_Walk
{
- void *(* struct_alloc)(const char * type, void * user_data);
- void (* struct_add)(void * parent, const char * name, void * child, void * user_data);
- void *(* array)(Eina_Bool variable, const char * name, int count, void * user_data);
- void (* insert)(void * array, int index, void * child, void * user_data);
- void *(* list)(const char * name, void * user_data);
- void (* append)(void * list, void * child, void * user_data);
- void *(* hash)(void * parent, const char * name, const char * key, void * value, void * user_data);
- void *(* simple)(int type, Eet_Node_Data * data, void * user_data);
+ void *(*struct_alloc)(const char *type, void *user_data);
+ void (*struct_add)(void *parent, const char *name, void *child, void *user_data);
+ void *(*array)(Eina_Bool variable, const char *name, int count, void *user_data);
+ void (*insert)(void *array, int index, void *child, void *user_data);
+ void *(*list)(const char *name, void *user_data);
+ void (*append)(void *list, void *child, void *user_data);
+ void *(*hash)(void *parent, const char *name, const char *key, void *value, void *user_data);
+ void *(*simple)(int type, Eet_Node_Data *data, void *user_data);
};
-EAPI void * eet_node_walk(void * parent,
- const char * name,
- Eet_Node * root,
- Eet_Node_Walk * cb,
- void * user_data);
+EAPI void * eet_node_walk(void * parent,
+ const char * name,
+ Eet_Node * root,
+ Eet_Node_Walk *cb,
+ void * user_data);
/*******/
*
* @ingroup Eet_Connection_Group
*/
-typedef Eina_Bool Eet_Read_Cb (const void * eet_data, size_t size, void * user_data);
+typedef Eina_Bool Eet_Read_Cb (const void *eet_data, size_t size, void *user_data);
/**
* @typedef Eet_Write_Cb
*
* @ingroup Eet_Connection_Group
*/
-typedef Eina_Bool Eet_Write_Cb (const void * data, size_t size, void * user_data);
+typedef Eina_Bool Eet_Write_Cb (const void *data, size_t size, void *user_data);
/**
* Instanciate a new connection to track.
* @since 1.2.4
* @ingroup Eet_Connection_Group
*/
-EAPI Eet_Connection * eet_connection_new(Eet_Read_Cb * eet_read_cb,
- Eet_Write_Cb * eet_write_cb,
- const void * user_data);
+EAPI Eet_Connection * eet_connection_new(Eet_Read_Cb * eet_read_cb,
+ Eet_Write_Cb *eet_write_cb,
+ const void * user_data);
/**
* Process a raw packet received over the link
* @since 1.2.4
* @ingroup Eet_Connection_Group
*/
-EAPI int eet_connection_received(Eet_Connection * conn,
- const void * data,
- size_t size);
+EAPI int eet_connection_received(Eet_Connection *conn,
+ const void * data,
+ size_t size);
/**
* Convert a complex structure and prepare it to be send.
* @since 1.2.4
* @ingroup Eet_Connection_Group
*/
-EAPI Eina_Bool eet_connection_send(Eet_Connection * conn,
- Eet_Data_Descriptor * edd,
- const void * data_in,
- const char * cipher_key);
+EAPI Eina_Bool eet_connection_send(Eet_Connection * conn,
+ Eet_Data_Descriptor *edd,
+ const void * data_in,
+ const char * cipher_key);
/**
* Convert a Eet_Node tree and prepare it to be send.
* @since 1.2.4
* @ingroup Eet_Connection_Group
*/
-EAPI Eina_Bool eet_connection_node_send(Eet_Connection * conn,
- Eet_Node * node,
- const char * cipher_key);
+EAPI Eina_Bool eet_connection_node_send(Eet_Connection *conn,
+ Eet_Node * node,
+ const char * cipher_key);
/**
* Close a connection and lost its track.
* @since 1.2.4
* @ingroup Eet_Connection_Group
*/
-EAPI void * eet_connection_close(Eet_Connection * conn,
- Eina_Bool * on_going);
+EAPI void * eet_connection_close(Eet_Connection *conn,
+ Eina_Bool * on_going);
/***************************************************************************/
};
struct _Eet_Dictionary
{
- Eet_String * all;
+ Eet_String *all;
- int size;
- int offset;
+ int size;
+ int offset;
- int hash[256];
+ int hash[256];
- int count;
- int total;
+ int count;
+ int total;
- const char * start;
- const char * end;
+ const char *start;
+ const char *end;
};
struct _Eet_Node
#define CRIT(...) EINA_LOG_DOM_CRIT(_eet_log_dom_global, __VA_ARGS__)
Eet_Dictionary * eet_dictionary_add(void);
-void eet_dictionary_free(Eet_Dictionary * ed);
-int eet_dictionary_string_add(Eet_Dictionary * ed,
- const char * string);
-int eet_dictionary_string_get_size(const Eet_Dictionary * ed,
- int index);
-const char * eet_dictionary_string_get_char(const Eet_Dictionary * ed,
- int index);
-Eina_Bool eet_dictionary_string_get_float(const Eet_Dictionary * ed,
- int index,
- float * result);
-Eina_Bool eet_dictionary_string_get_double(const Eet_Dictionary * ed,
- int index,
- double * result);
-Eina_Bool eet_dictionary_string_get_fp(const Eet_Dictionary * ed,
- int index,
- Eina_F32p32 * result);
-int eet_dictionary_string_get_hash(const Eet_Dictionary * ed,
- int index);
-
-int _eet_hash_gen(const char * key, int hash_size);
-
-const void * eet_identity_check(const void * data_base,
- unsigned int data_length,
- void ** sha1,
- int * sha1_length,
- const void * signature_base,
- unsigned int signature_length,
- const void ** raw_signature_base,
- unsigned int * raw_signature_length,
- int * x509_length);
+void eet_dictionary_free(Eet_Dictionary *ed);
+int eet_dictionary_string_add(Eet_Dictionary *ed,
+ const char * string);
+int eet_dictionary_string_get_size(const Eet_Dictionary *ed,
+ int index);
+const char * eet_dictionary_string_get_char(const Eet_Dictionary *ed,
+ int index);
+Eina_Bool eet_dictionary_string_get_float(const Eet_Dictionary *ed,
+ int index,
+ float * result);
+Eina_Bool eet_dictionary_string_get_double(const Eet_Dictionary *ed,
+ int index,
+ double * result);
+Eina_Bool eet_dictionary_string_get_fp(const Eet_Dictionary *ed,
+ int index,
+ Eina_F32p32 * result);
+int eet_dictionary_string_get_hash(const Eet_Dictionary *ed,
+ int index);
+
+int _eet_hash_gen(const char *key, int hash_size);
+
+const void * eet_identity_check(const void * data_base,
+ unsigned int data_length,
+ void ** sha1,
+ int * sha1_length,
+ const void * signature_base,
+ unsigned int signature_length,
+ const void ** raw_signature_base,
+ unsigned int *raw_signature_length,
+ int * x509_length);
void * eet_identity_compute_sha1(const void * data_base,
unsigned int data_length,
int * sha1_length);
-Eet_Error eet_cipher(const void * data,
- unsigned int size,
- const char * key,
- unsigned int length,
- void ** result,
- unsigned int * result_length);
-Eet_Error eet_decipher(const void * data,
- unsigned int size,
- const char * key,
- unsigned int length,
- void ** result,
- unsigned int * result_length);
-Eet_Error eet_identity_sign(FILE * fp,
- Eet_Key * key);
-void eet_identity_unref(Eet_Key * key);
-void eet_identity_ref(Eet_Key * key);
+Eet_Error eet_cipher(const void * data,
+ unsigned int size,
+ const char * key,
+ unsigned int length,
+ void ** result,
+ unsigned int *result_length);
+Eet_Error eet_decipher(const void * data,
+ unsigned int size,
+ const char * key,
+ unsigned int length,
+ void ** result,
+ unsigned int *result_length);
+Eet_Error eet_identity_sign(FILE * fp,
+ Eet_Key *key);
+void eet_identity_unref(Eet_Key *key);
+void eet_identity_ref(Eet_Key *key);
void eet_node_shutdown(void);
int eet_node_init(void);
Eet_Node * eet_node_new(void);
-void eet_node_free(Eet_Node * node);
+void eet_node_free(Eet_Node *node);
#ifndef PATH_MAX
# define PATH_MAX 4096
#ifdef HAVE_CIPHER
# ifdef HAVE_GNUTLS
-static Eet_Error eet_hmac_sha1(const void * key,
- size_t key_len,
- const void * data,
- size_t data_len,
- unsigned char * res);
+static Eet_Error eet_hmac_sha1(const void * key,
+ size_t key_len,
+ const void * data,
+ size_t data_len,
+ unsigned char *res);
# endif /* ifdef HAVE_GNUTLS */
-static Eet_Error eet_pbkdf2_sha1(const char * key,
- int key_len,
- const unsigned char * salt,
- unsigned int salt_len,
- int iter,
- unsigned char * res,
- int res_len);
+static Eet_Error eet_pbkdf2_sha1(const char * key,
+ int key_len,
+ const unsigned char *salt,
+ unsigned int salt_len,
+ int iter,
+ unsigned char * res,
+ int res_len);
#endif /* ifdef HAVE_CIPHER */
struct _Eet_Key
{
#ifdef HAVE_SIGNATURE
/* Signature declarations */
- Eet_Key * key = NULL;
- FILE * fp = NULL;
+ Eet_Key *key = NULL;
+ FILE *fp = NULL;
# ifdef HAVE_GNUTLS
/* Gnutls private declarations */
int fd = -1;
struct stat st;
- void * data = NULL;
+ void *data = NULL;
gnutls_datum_t load_file = { NULL, 0 };
char pass[1024];
# else /* ifdef HAVE_GNUTLS */
/* Openssl private declarations */
- EVP_PKEY * pkey = NULL;
- X509 * cert = NULL;
+ EVP_PKEY *pkey = NULL;
+ X509 *cert = NULL;
/* Load the X509 certificate in memory. */
fp = fopen(certificate_file, "r");
} /* eet_identity_open */
EAPI void
-eet_identity_close(Eet_Key * key)
+eet_identity_close(Eet_Key *key)
{
#ifdef HAVE_SIGNATURE
if (!key || (key->references > 0))
} /* eet_identity_close */
EAPI void
-eet_identity_print(Eet_Key * key,
- FILE * out)
+eet_identity_print(Eet_Key *key,
+ FILE * out)
{
#ifdef HAVE_SIGNATURE
# ifdef HAVE_GNUTLS
- const char * names[6] = {
+ const char *names[6] = {
"Modulus",
"Public exponent",
"Private exponent",
gnutls_datum_t data = { NULL, 0 };
gnutls_datum_t rsa_raw[6];
size_t size = 128;
- char * res = NULL;
+ char *res = NULL;
char buf[33];
unsigned int i, j;
return;
# else /* ifdef HAVE_GNUTLS */
- RSA * rsa;
- DSA * dsa;
- DH * dh;
+ RSA *rsa;
+ DSA *dsa;
+ DH *dh;
if (!key)
return;
} /* eet_identity_print */
void
-eet_identity_ref(Eet_Key * key)
+eet_identity_ref(Eet_Key *key)
{
if (key == NULL)
return;
} /* eet_identity_ref */
void
-eet_identity_unref(Eet_Key * key)
+eet_identity_unref(Eet_Key *key)
{
if (key == NULL)
return;
unsigned int data_length,
int * sha1_length)
{
- void * result;
+ void *result;
#ifdef HAVE_SIGNATURE
# ifdef HAVE_GNUTLS
} /* eet_identity_compute_sha1 */
Eet_Error
-eet_identity_sign(FILE * fp,
- Eet_Key * key)
+eet_identity_sign(FILE * fp,
+ Eet_Key *key)
{
#ifdef HAVE_SIGNATURE
Eet_Error err = EET_ERROR_NONE;
struct stat st_buf;
- void * data;
+ void *data;
int fd;
int head[3];
- unsigned char * sign = NULL;
- unsigned char * cert = NULL;
+ unsigned char *sign = NULL;
+ unsigned char *cert = NULL;
# ifdef HAVE_GNUTLS
gnutls_datum_t datum = { NULL, 0 };
size_t sign_len = 0;
} /* eet_identity_sign */
const void *
-eet_identity_check(const void * data_base,
- unsigned int data_length,
- void ** sha1,
- int * sha1_length,
- const void * signature_base,
- unsigned int signature_length,
- const void ** raw_signature_base,
- unsigned int * raw_signature_length,
- int * x509_length)
+eet_identity_check(const void * data_base,
+ unsigned int data_length,
+ void ** sha1,
+ int * sha1_length,
+ const void * signature_base,
+ unsigned int signature_length,
+ const void ** raw_signature_base,
+ unsigned int *raw_signature_length,
+ int * x509_length)
{
#ifdef HAVE_SIGNATURE
- const int * header = signature_base;
- const unsigned char * sign;
- const unsigned char * cert_der;
+ const int *header = signature_base;
+ const unsigned char *sign;
+ const unsigned char *cert_der;
int sign_len;
int cert_len;
int magic;
gnutls_datum_t datum;
gnutls_datum_t signature;
# if EET_USE_NEW_GNUTLS_API
- unsigned char * hash;
+ unsigned char *hash;
gcry_md_hd_t md;
int err;
# endif /* if EET_USE_NEW_GNUTLS_API */
gnutls_x509_crt_deinit(cert);
# else /* ifdef HAVE_GNUTLS */
- const unsigned char * tmp;
- EVP_PKEY * pkey;
- X509 * x509;
+ const unsigned char *tmp;
+ EVP_PKEY *pkey;
+ X509 *x509;
EVP_MD_CTX md_ctx;
int err;
} /* eet_identity_check */
EAPI void
-eet_identity_certificate_print(const unsigned char * certificate,
- int der_length,
- FILE * out)
+eet_identity_certificate_print(const unsigned char *certificate,
+ int der_length,
+ FILE * out)
{
#ifdef HAVE_SIGNATURE
if (!certificate || !out || der_length <= 0)
gnutls_x509_crt_deinit(cert);
# else /* ifdef HAVE_GNUTLS */
- const unsigned char * tmp;
- X509 * x509;
+ const unsigned char *tmp;
+ X509 *x509;
/* Strange but d2i_X509 seems to put 0 all over the place. */
tmp = alloca(der_length);
} /* eet_identity_certificate_print */
Eet_Error
-eet_cipher(const void * data,
- unsigned int size,
- const char * key,
- unsigned int length,
- void ** result,
- unsigned int * result_length)
+eet_cipher(const void * data,
+ unsigned int size,
+ const char * key,
+ unsigned int length,
+ void ** result,
+ unsigned int *result_length)
{
#ifdef HAVE_CIPHER
/* Cipher declarations */
- unsigned int * ret = NULL;
+ unsigned int *ret = NULL;
unsigned char iv[MAX_IV_LEN];
unsigned char ik[MAX_KEY_LEN];
unsigned char key_material[MAX_IV_LEN + MAX_KEY_LEN];
# else /* ifdef HAVE_GNUTLS */
/* Openssl declarations*/
EVP_CIPHER_CTX ctx;
- unsigned int * buffer;
+ unsigned int *buffer;
int tmp_len;
# endif /* ifdef HAVE_GNUTLS */
} /* eet_cipher */
Eet_Error
-eet_decipher(const void * data,
- unsigned int size,
- const char * key,
- unsigned int length,
- void ** result,
- unsigned int * result_length)
+eet_decipher(const void * data,
+ unsigned int size,
+ const char * key,
+ unsigned int length,
+ void ** result,
+ unsigned int *result_length)
{
#ifdef HAVE_CIPHER
- const unsigned int * over = data;
- unsigned int * ret = NULL;
+ const unsigned int *over = data;
+ unsigned int *ret = NULL;
unsigned char ik[MAX_KEY_LEN];
unsigned char iv[MAX_IV_LEN];
unsigned char key_material[MAX_KEY_LEN + MAX_IV_LEN];
#ifdef HAVE_CIPHER
# ifdef HAVE_GNUTLS
static Eet_Error
-eet_hmac_sha1(const void * key,
- size_t key_len,
- const void * data,
- size_t data_len,
- unsigned char * res)
+eet_hmac_sha1(const void * key,
+ size_t key_len,
+ const void * data,
+ size_t data_len,
+ unsigned char *res)
{
size_t hlen = gcry_md_get_algo_dlen (GCRY_MD_SHA1);
gcry_md_hd_t mdh;
- unsigned char * hash;
+ unsigned char *hash;
gpg_error_t err;
err = gcry_md_open(&mdh, GCRY_MD_SHA1, GCRY_MD_FLAG_HMAC);
# endif /* ifdef HAVE_GNUTLS */
static Eet_Error
-eet_pbkdf2_sha1(const char * key,
- int key_len,
- const unsigned char * salt,
- unsigned int salt_len,
- int iter,
- unsigned char * res,
- int res_len)
+eet_pbkdf2_sha1(const char * key,
+ int key_len,
+ const unsigned char *salt,
+ unsigned int salt_len,
+ int iter,
+ unsigned char * res,
+ int res_len)
{
unsigned char digest[20];
unsigned char tab[4];
- unsigned char * p = res;
- unsigned char * buf;
+ unsigned char *p = res;
+ unsigned char *buf;
unsigned long i;
int digest_len = 20;
int len = res_len;
struct _Eet_Connection
{
- Eet_Read_Cb * eet_read_cb;
- Eet_Write_Cb * eet_write_cb;
- void * user_data;
+ Eet_Read_Cb * eet_read_cb;
+ Eet_Write_Cb *eet_write_cb;
+ void * user_data;
- size_t allocated;
- size_t size;
- size_t received;
+ size_t allocated;
+ size_t size;
+ size_t received;
- void * buffer;
+ void * buffer;
};
EAPI Eet_Connection *
-eet_connection_new(Eet_Read_Cb * eet_read_cb,
- Eet_Write_Cb * eet_write_cb,
- const void * user_data)
+eet_connection_new(Eet_Read_Cb * eet_read_cb,
+ Eet_Write_Cb *eet_write_cb,
+ const void * user_data)
{
- Eet_Connection * conn;
+ Eet_Connection *conn;
if (!eet_read_cb || !eet_write_cb)
return NULL;
} /* eet_connection_new */
EAPI int
-eet_connection_received(Eet_Connection * conn,
- const void * data,
- size_t size)
+eet_connection_received(Eet_Connection *conn,
+ const void * data,
+ size_t size)
{
if ((!conn) || (!data) || (!size))
return size;
if (conn->size == 0)
{
- const Eet_Message * msg;
+ const Eet_Message *msg;
size_t packet_size;
if (size < sizeof (Eet_Message))
conn->size = packet_size;
if (conn->allocated < conn->size)
{
- void * tmp;
+ void *tmp;
tmp = realloc(conn->buffer, conn->size);
if (!tmp)
} /* eet_connection_received */
static Eina_Bool
-_eet_connection_raw_send(Eet_Connection * conn,
- void * data,
- int data_size)
+_eet_connection_raw_send(Eet_Connection *conn,
+ void * data,
+ int data_size)
{
- Eet_Message * message;
+ Eet_Message *message;
/* Message should never be above 64K */
if (data_size > 64 * 1024)
} /* _eet_connection_raw_send */
EAPI Eina_Bool
-eet_connection_send(Eet_Connection * conn,
- Eet_Data_Descriptor * edd,
- const void * data_in,
- const char * cipher_key)
+eet_connection_send(Eet_Connection * conn,
+ Eet_Data_Descriptor *edd,
+ const void * data_in,
+ const char * cipher_key)
{
- void * flat_data;
+ void *flat_data;
int data_size;
Eina_Bool ret = EINA_FALSE;
} /* eet_connection_send */
EAPI Eina_Bool
-eet_connection_node_send(Eet_Connection * conn,
- Eet_Node * node,
- const char * cipher_key)
+eet_connection_node_send(Eet_Connection *conn,
+ Eet_Node * node,
+ const char * cipher_key)
{
- void * data;
+ void *data;
int data_size;
Eina_Bool ret = EINA_FALSE;
} /* eet_connection_node_send */
EAPI void *
-eet_connection_close(Eet_Connection * conn,
- Eina_Bool * on_going)
+eet_connection_close(Eet_Connection *conn,
+ Eina_Bool * on_going)
{
- void * user_data;
+ void *user_data;
if (!conn)
return NULL;
*/
struct _Eet_Data_Basic_Type_Codec
{
- int size;
- const char * name;
- int (* get)(const Eet_Dictionary * ed, const void * src, const void * src_end, void * dest);
- void * (* put)(Eet_Dictionary * ed, const void * src, int * size_ret);
+ int size;
+ const char *name;
+ int (*get)(const Eet_Dictionary *ed, const void *src, const void *src_end, void *dest);
+ void * (*put)(Eet_Dictionary *ed, const void *src, int *size_ret);
};
struct _Eet_Data_Group_Type_Codec
{
- int (* get)(Eet_Free_Context * context, const Eet_Dictionary * ed, Eet_Data_Descriptor * edd, Eet_Data_Element * ede, Eet_Data_Chunk * echnk, int type, int group_type, void * data_in, char ** p, int * size);
- void (* put)(Eet_Dictionary * ed, Eet_Data_Descriptor * edd, Eet_Data_Element * ede, Eet_Data_Stream * ds, void * data_in);
+ int (*get)(Eet_Free_Context *context, const Eet_Dictionary *ed, Eet_Data_Descriptor *edd, Eet_Data_Element *ede, Eet_Data_Chunk *echnk, int type, int group_type, void *data_in, char **p, int *size);
+ void (*put)(Eet_Dictionary *ed, Eet_Data_Descriptor *edd, Eet_Data_Element *ede, Eet_Data_Stream *ds, void *data_in);
};
struct _Eet_Data_Chunk
struct _Eet_Data_Stream
{
- void * data;
- int size;
- int pos;
+ void *data;
+ int size;
+ int pos;
};
struct _Eet_Data_Descriptor_Hash
{
- Eet_Data_Element * element;
- Eet_Data_Descriptor_Hash * next;
+ Eet_Data_Element * element;
+ Eet_Data_Descriptor_Hash *next;
};
struct _Eet_Data_Descriptor
{
- const char * name;
- const Eet_Dictionary * ed;
- int size;
+ const char * name;
+ const Eet_Dictionary *ed;
+ int size;
struct
{
- void * (* mem_alloc)(size_t size);
- void (* mem_free)(void * mem);
- char * (* str_alloc)(const char * str);
- char * (* str_direct_alloc)(const char * str);
- void (* str_free)(const char * str);
- void (* str_direct_free)(const char * str);
- void * (* list_next)(void * l);
- void * (* list_append)(void * l, void * d);
- void * (* list_data)(void * l);
- void * (* list_free)(void * l);
- void (* hash_foreach)(void * h, int (* func)(void * h, const char * k, void * dt, void * fdt), void * fdt);
- void * (* hash_add)(void * h, const char * k, void * d);
- void (* hash_free)(void * h);
- const char *(* type_get)(const void * data, Eina_Bool * unknow);
- Eina_Bool (* type_set)(const char * type, void * data, Eina_Bool unknow);
+ void * (*mem_alloc)(size_t size);
+ void (*mem_free)(void *mem);
+ char * (*str_alloc)(const char *str);
+ char * (*str_direct_alloc)(const char *str);
+ void (*str_free)(const char *str);
+ void (*str_direct_free)(const char *str);
+ void * (*list_next)(void *l);
+ void * (*list_append)(void *l, void *d);
+ void * (*list_data)(void *l);
+ void * (*list_free)(void *l);
+ void (*hash_foreach)(void *h, int (*func)(void *h, const char *k, void *dt, void *fdt), void *fdt);
+ void * (*hash_add)(void *h, const char *k, void *d);
+ void (*hash_free)(void *h);
+ const char *(*type_get)(const void *data, Eina_Bool *unknow);
+ Eina_Bool (*type_set)(const char *type, void *data, Eina_Bool unknow);
} func;
struct
{
- int num;
- Eet_Data_Element * set;
+ int num;
+ Eet_Data_Element *set;
struct
{
- int size;
- Eet_Data_Descriptor_Hash * buckets;
+ int size;
+ Eet_Data_Descriptor_Hash *buckets;
} hash;
} elements;
struct _Eet_Data_Element
{
- const char * name;
- const char * counter_name;
- const char * directory_name_ptr;
- Eet_Data_Descriptor * subtype;
- int offset; /* offset in bytes from the base element */
- int count; /* number of elements for a fixed array */
- int counter_offset; /* for a variable array we need the offset of the count variable */
- unsigned char type; /* EET_T_XXX */
- unsigned char group_type; /* EET_G_XXX */
+ const char * name;
+ const char * counter_name;
+ const char * directory_name_ptr;
+ Eet_Data_Descriptor *subtype;
+ int offset; /* offset in bytes from the base element */
+ int count; /* number of elements for a fixed array */
+ int counter_offset; /* for a variable array we need the offset of the count variable */
+ unsigned char type; /* EET_T_XXX */
+ unsigned char group_type; /* EET_G_XXX */
};
struct _Eet_Data_Encode_Hash_Info
{
- Eet_Data_Stream * ds;
- Eet_Data_Element * ede;
- Eet_Dictionary * ed;
+ Eet_Data_Stream * ds;
+ Eet_Data_Element *ede;
+ Eet_Dictionary * ed;
};
struct _Eet_Free
{
- int ref;
- int len[256];
- int num[256];
- void ** list[256];
+ int ref;
+ int len[256];
+ int num[256];
+ void **list[256];
};
struct _Eet_Free_Context
/*---*/
-static int eet_data_get_char(const Eet_Dictionary * ed,
- const void * src,
- const void * src_end,
- void * dest);
-static void * eet_data_put_char(Eet_Dictionary * ed,
- const void * src,
- int * size_ret);
-static int eet_data_get_short(const Eet_Dictionary * ed,
- const void * src,
- const void * src_end,
- void * dest);
-static void * eet_data_put_short(Eet_Dictionary * ed,
- const void * src,
- int * size_ret);
-static inline int eet_data_get_int(const Eet_Dictionary * ed,
- const void * src,
- const void * src_end,
- void * dest);
-static void * eet_data_put_int(Eet_Dictionary * ed,
- const void * src,
- int * size_ret);
-static int eet_data_get_long_long(const Eet_Dictionary * ed,
- const void * src,
- const void * src_end,
- void * dest);
-static void * eet_data_put_long_long(Eet_Dictionary * ed,
- const void * src,
- int * size_ret);
-static int eet_data_get_float(const Eet_Dictionary * ed,
- const void * src,
- const void * src_end,
- void * dest);
-static void * eet_data_put_float(Eet_Dictionary * ed,
- const void * src,
- int * size_ret);
-static int eet_data_get_double(const Eet_Dictionary * ed,
- const void * src,
- const void * src_end,
- void * dest);
-static void * eet_data_put_double(Eet_Dictionary * ed,
- const void * src,
- int * size_ret);
-static int eet_data_get_f32p32(const Eet_Dictionary * ed,
- const void * src,
- const void * src_end,
- void * dest);
-static void * eet_data_put_f32p32(Eet_Dictionary * ed,
- const void * src,
- int * size_ret);
-static int eet_data_get_f16p16(const Eet_Dictionary * ed,
- const void * src,
- const void * src_end,
- void * dest);
-static void * eet_data_put_f16p16(Eet_Dictionary * ed,
- const void * src,
- int * size_ret);
-static int eet_data_get_f8p24(const Eet_Dictionary * ed,
- const void * src,
- const void * src_end,
- void * dest);
-static void * eet_data_put_f8p24(Eet_Dictionary * ed,
- const void * src,
- int * size_ret);
-static inline int eet_data_get_string(const Eet_Dictionary * ed,
- const void * src,
- const void * src_end,
- void * dest);
-static void * eet_data_put_string(Eet_Dictionary * ed,
- const void * src,
- int * size_ret);
-static int eet_data_get_istring(const Eet_Dictionary * ed,
- const void * src,
- const void * src_end,
- void * dest);
-static void * eet_data_put_istring(Eet_Dictionary * ed,
- const void * src,
- int * size_ret);
-static int eet_data_get_null(const Eet_Dictionary * ed,
- const void * src,
- const void * src_end,
- void * dest);
-static void * eet_data_put_null(Eet_Dictionary * ed,
- const void * src,
- int * size_ret);
-
-static int eet_data_get_type(const Eet_Dictionary * ed,
- int type,
- const void * src,
- const void * src_end,
- void * dest);
-static void * eet_data_put_type(Eet_Dictionary * ed,
- int type,
- const void * src,
- int * size_ret);
-
-static Eet_Node * eet_data_node_simple_type(int type,
- const char * name,
- void * dd);
-
-static int eet_data_get_unknown(Eet_Free_Context * context,
- const Eet_Dictionary * ed,
- Eet_Data_Descriptor * edd,
- Eet_Data_Element * ede,
- Eet_Data_Chunk * echnk,
- int type,
- int group_type,
- void * data_in,
- char ** p,
- int * size);
-static void eet_data_put_unknown(Eet_Dictionary * ed,
- Eet_Data_Descriptor * edd,
- Eet_Data_Element * ede,
- Eet_Data_Stream * ds,
- void * data_in);
-static void eet_data_put_array(Eet_Dictionary * ed,
+static int eet_data_get_char(const Eet_Dictionary *ed,
+ const void * src,
+ const void * src_end,
+ void * dest);
+static void * eet_data_put_char(Eet_Dictionary *ed,
+ const void * src,
+ int * size_ret);
+static int eet_data_get_short(const Eet_Dictionary *ed,
+ const void * src,
+ const void * src_end,
+ void * dest);
+static void * eet_data_put_short(Eet_Dictionary *ed,
+ const void * src,
+ int * size_ret);
+static inline int eet_data_get_int(const Eet_Dictionary *ed,
+ const void * src,
+ const void * src_end,
+ void * dest);
+static void * eet_data_put_int(Eet_Dictionary *ed,
+ const void * src,
+ int * size_ret);
+static int eet_data_get_long_long(const Eet_Dictionary *ed,
+ const void * src,
+ const void * src_end,
+ void * dest);
+static void * eet_data_put_long_long(Eet_Dictionary *ed,
+ const void * src,
+ int * size_ret);
+static int eet_data_get_float(const Eet_Dictionary *ed,
+ const void * src,
+ const void * src_end,
+ void * dest);
+static void * eet_data_put_float(Eet_Dictionary *ed,
+ const void * src,
+ int * size_ret);
+static int eet_data_get_double(const Eet_Dictionary *ed,
+ const void * src,
+ const void * src_end,
+ void * dest);
+static void * eet_data_put_double(Eet_Dictionary *ed,
+ const void * src,
+ int * size_ret);
+static int eet_data_get_f32p32(const Eet_Dictionary *ed,
+ const void * src,
+ const void * src_end,
+ void * dest);
+static void * eet_data_put_f32p32(Eet_Dictionary *ed,
+ const void * src,
+ int * size_ret);
+static int eet_data_get_f16p16(const Eet_Dictionary *ed,
+ const void * src,
+ const void * src_end,
+ void * dest);
+static void * eet_data_put_f16p16(Eet_Dictionary *ed,
+ const void * src,
+ int * size_ret);
+static int eet_data_get_f8p24(const Eet_Dictionary *ed,
+ const void * src,
+ const void * src_end,
+ void * dest);
+static void * eet_data_put_f8p24(Eet_Dictionary *ed,
+ const void * src,
+ int * size_ret);
+static inline int eet_data_get_string(const Eet_Dictionary *ed,
+ const void * src,
+ const void * src_end,
+ void * dest);
+static void * eet_data_put_string(Eet_Dictionary *ed,
+ const void * src,
+ int * size_ret);
+static int eet_data_get_istring(const Eet_Dictionary *ed,
+ const void * src,
+ const void * src_end,
+ void * dest);
+static void * eet_data_put_istring(Eet_Dictionary *ed,
+ const void * src,
+ int * size_ret);
+static int eet_data_get_null(const Eet_Dictionary *ed,
+ const void * src,
+ const void * src_end,
+ void * dest);
+static void * eet_data_put_null(Eet_Dictionary *ed,
+ const void * src,
+ int * size_ret);
+
+static int eet_data_get_type(const Eet_Dictionary *ed,
+ int type,
+ const void * src,
+ const void * src_end,
+ void * dest);
+static void * eet_data_put_type(Eet_Dictionary *ed,
+ int type,
+ const void * src,
+ int * size_ret);
+
+static Eet_Node * eet_data_node_simple_type(int type,
+ const char *name,
+ void * dd);
+
+static int eet_data_get_unknown(Eet_Free_Context * context,
+ const Eet_Dictionary *ed,
+ Eet_Data_Descriptor * edd,
+ Eet_Data_Element * ede,
+ Eet_Data_Chunk * echnk,
+ int type,
+ int group_type,
+ void * data_in,
+ char ** p,
+ int * size);
+static void eet_data_put_unknown(Eet_Dictionary * ed,
+ Eet_Data_Descriptor *edd,
+ Eet_Data_Element * ede,
+ Eet_Data_Stream * ds,
+ void * data_in);
+static void eet_data_put_array(Eet_Dictionary * ed,
+ Eet_Data_Descriptor *edd,
+ Eet_Data_Element * ede,
+ Eet_Data_Stream * ds,
+ void * data_in);
+static int eet_data_get_array(Eet_Free_Context * context,
+ const Eet_Dictionary *ed,
Eet_Data_Descriptor * edd,
Eet_Data_Element * ede,
- Eet_Data_Stream * ds,
- void * data_in);
-static int eet_data_get_array(Eet_Free_Context * context,
- const Eet_Dictionary * ed,
- Eet_Data_Descriptor * edd,
- Eet_Data_Element * ede,
- Eet_Data_Chunk * echnk,
- int type,
- int group_type,
- void * data,
- char ** p,
- int * size);
-static int eet_data_get_list(Eet_Free_Context * context,
- const Eet_Dictionary * ed,
- Eet_Data_Descriptor * edd,
- Eet_Data_Element * ede,
- Eet_Data_Chunk * echnk,
- int type,
- int group_type,
- void * data_in,
- char ** p,
- int * size);
-static void eet_data_put_list(Eet_Dictionary * ed,
- Eet_Data_Descriptor * edd,
- Eet_Data_Element * ede,
- Eet_Data_Stream * ds,
- void * data_in);
-static void eet_data_put_hash(Eet_Dictionary * ed,
+ Eet_Data_Chunk * echnk,
+ int type,
+ int group_type,
+ void * data,
+ char ** p,
+ int * size);
+static int eet_data_get_list(Eet_Free_Context * context,
+ const Eet_Dictionary *ed,
+ Eet_Data_Descriptor * edd,
+ Eet_Data_Element * ede,
+ Eet_Data_Chunk * echnk,
+ int type,
+ int group_type,
+ void * data_in,
+ char ** p,
+ int * size);
+static void eet_data_put_list(Eet_Dictionary * ed,
+ Eet_Data_Descriptor *edd,
+ Eet_Data_Element * ede,
+ Eet_Data_Stream * ds,
+ void * data_in);
+static void eet_data_put_hash(Eet_Dictionary * ed,
+ Eet_Data_Descriptor *edd,
+ Eet_Data_Element * ede,
+ Eet_Data_Stream * ds,
+ void * data_in);
+static int eet_data_get_hash(Eet_Free_Context * context,
+ const Eet_Dictionary *ed,
Eet_Data_Descriptor * edd,
Eet_Data_Element * ede,
- Eet_Data_Stream * ds,
- void * data_in);
-static int eet_data_get_hash(Eet_Free_Context * context,
- const Eet_Dictionary * ed,
- Eet_Data_Descriptor * edd,
- Eet_Data_Element * ede,
- Eet_Data_Chunk * echnk,
- int type,
- int group_type,
- void * data,
- char ** p,
- int * size);
-static void eet_data_put_union(Eet_Dictionary * ed,
+ Eet_Data_Chunk * echnk,
+ int type,
+ int group_type,
+ void * data,
+ char ** p,
+ int * size);
+static void eet_data_put_union(Eet_Dictionary * ed,
+ Eet_Data_Descriptor *edd,
+ Eet_Data_Element * ede,
+ Eet_Data_Stream * ds,
+ void * data_in);
+static int eet_data_get_union(Eet_Free_Context * context,
+ const Eet_Dictionary *ed,
Eet_Data_Descriptor * edd,
Eet_Data_Element * ede,
- Eet_Data_Stream * ds,
- void * data_in);
-static int eet_data_get_union(Eet_Free_Context * context,
- const Eet_Dictionary * ed,
- Eet_Data_Descriptor * edd,
- Eet_Data_Element * ede,
- Eet_Data_Chunk * echnk,
- int type,
- int group_type,
- void * data,
- char ** p,
- int * size);
-static void eet_data_put_variant(Eet_Dictionary * ed,
+ Eet_Data_Chunk * echnk,
+ int type,
+ int group_type,
+ void * data,
+ char ** p,
+ int * size);
+static void eet_data_put_variant(Eet_Dictionary * ed,
+ Eet_Data_Descriptor *edd,
+ Eet_Data_Element * ede,
+ Eet_Data_Stream * ds,
+ void * data_in);
+static int eet_data_get_variant(Eet_Free_Context * context,
+ const Eet_Dictionary *ed,
Eet_Data_Descriptor * edd,
Eet_Data_Element * ede,
- Eet_Data_Stream * ds,
- void * data_in);
-static int eet_data_get_variant(Eet_Free_Context * context,
- const Eet_Dictionary * ed,
- Eet_Data_Descriptor * edd,
- Eet_Data_Element * ede,
- Eet_Data_Chunk * echnk,
- int type,
- int group_type,
- void * data,
- char ** p,
- int * size);
-
-static void eet_data_chunk_get(const Eet_Dictionary * ed,
- Eet_Data_Chunk * chnk,
- const void * src,
- int size);
-static Eet_Data_Chunk * eet_data_chunk_new(void * data,
- int size,
- const char * name,
- int type,
- int group_type);
-static void eet_data_chunk_free(Eet_Data_Chunk * chnk);
+ Eet_Data_Chunk * echnk,
+ int type,
+ int group_type,
+ void * data,
+ char ** p,
+ int * size);
+
+static void eet_data_chunk_get(const Eet_Dictionary *ed,
+ Eet_Data_Chunk * chnk,
+ const void * src,
+ int size);
+static Eet_Data_Chunk * eet_data_chunk_new(void * data,
+ int size,
+ const char *name,
+ int type,
+ int group_type);
+static void eet_data_chunk_free(Eet_Data_Chunk *chnk);
static Eet_Data_Stream * eet_data_stream_new(void);
-static void eet_data_stream_write(Eet_Data_Stream * ds,
- const void * data,
- int size);
-static void eet_data_stream_free(Eet_Data_Stream * ds);
-
-static void eet_data_chunk_put(Eet_Dictionary * ed,
- Eet_Data_Chunk * chnk,
- Eet_Data_Stream * ds);
-
-static int eet_data_descriptor_encode_hash_cb(void * hash,
- const char * key,
- void * hdata,
- void * fdata);
-static void * _eet_data_descriptor_encode(Eet_Dictionary * ed,
+static void eet_data_stream_write(Eet_Data_Stream *ds,
+ const void * data,
+ int size);
+static void eet_data_stream_free(Eet_Data_Stream *ds);
+
+static void eet_data_chunk_put(Eet_Dictionary * ed,
+ Eet_Data_Chunk * chnk,
+ Eet_Data_Stream *ds);
+
+static int eet_data_descriptor_encode_hash_cb(void * hash,
+ const char *key,
+ void * hdata,
+ void * fdata);
+static void * _eet_data_descriptor_encode(Eet_Dictionary * ed,
+ Eet_Data_Descriptor *edd,
+ const void * data_in,
+ int * size_ret);
+static void * _eet_data_descriptor_decode(Eet_Free_Context * context,
+ const Eet_Dictionary *ed,
Eet_Data_Descriptor * edd,
const void * data_in,
- int * size_ret);
-static void * _eet_data_descriptor_decode(Eet_Free_Context * context,
- const Eet_Dictionary * ed,
- Eet_Data_Descriptor * edd,
- const void * data_in,
- int size_in);
+ int size_in);
/*---*/
/* CHAR TYPE */
static int
-eet_data_get_char(const Eet_Dictionary * ed __UNUSED__,
- const void * src,
- const void * src_end,
- void * dst)
+eet_data_get_char(const Eet_Dictionary *ed __UNUSED__,
+ const void * src,
+ const void * src_end,
+ void * dst)
{
- char * s, * d;
+ char *s, *d;
if (((char *)src + sizeof(char)) > (char *)src_end)
return -1;
} /* eet_data_get_char */
static void *
-eet_data_put_char(Eet_Dictionary * ed __UNUSED__,
- const void * src,
- int * size_ret)
+eet_data_put_char(Eet_Dictionary *ed __UNUSED__,
+ const void * src,
+ int * size_ret)
{
- char * s, * d;
+ char *s, *d;
d = (char *)malloc(sizeof(char));
if (!d)
/* SHORT TYPE */
static int
-eet_data_get_short(const Eet_Dictionary * ed __UNUSED__,
- const void * src,
- const void * src_end,
- void * dst)
+eet_data_get_short(const Eet_Dictionary *ed __UNUSED__,
+ const void * src,
+ const void * src_end,
+ void * dst)
{
- short * d;
+ short *d;
if (((char *)src + sizeof(short)) > (char *)src_end)
return -1;
} /* eet_data_get_short */
static void *
-eet_data_put_short(Eet_Dictionary * ed __UNUSED__,
- const void * src,
- int * size_ret)
+eet_data_put_short(Eet_Dictionary *ed __UNUSED__,
+ const void * src,
+ int * size_ret)
{
- short * s, * d;
+ short *s, *d;
d = (short *)malloc(sizeof(short));
if (!d)
/* INT TYPE */
static inline int
-eet_data_get_int(const Eet_Dictionary * ed __UNUSED__,
- const void * src,
- const void * src_end,
- void * dst)
+eet_data_get_int(const Eet_Dictionary *ed __UNUSED__,
+ const void * src,
+ const void * src_end,
+ void * dst)
{
- int * d;
+ int *d;
if (((char *)src + sizeof(int)) > (char *)src_end)
return -1;
} /* eet_data_get_int */
static void *
-eet_data_put_int(Eet_Dictionary * ed __UNUSED__,
- const void * src,
- int * size_ret)
+eet_data_put_int(Eet_Dictionary *ed __UNUSED__,
+ const void * src,
+ int * size_ret)
{
- int * s, * d;
+ int *s, *d;
d = (int *)malloc(sizeof(int));
if (!d)
/* LONG LONG TYPE */
static int
-eet_data_get_long_long(const Eet_Dictionary * ed __UNUSED__,
- const void * src,
- const void * src_end,
- void * dst)
+eet_data_get_long_long(const Eet_Dictionary *ed __UNUSED__,
+ const void * src,
+ const void * src_end,
+ void * dst)
{
- unsigned long long * d;
+ unsigned long long *d;
if (((char *)src + sizeof(unsigned long long)) > (char *)src_end)
return -1;
} /* eet_data_get_long_long */
static void *
-eet_data_put_long_long(Eet_Dictionary * ed __UNUSED__,
- const void * src,
- int * size_ret)
+eet_data_put_long_long(Eet_Dictionary *ed __UNUSED__,
+ const void * src,
+ int * size_ret)
{
- unsigned long long * s, * d;
+ unsigned long long *s, *d;
d = (unsigned long long *)malloc(sizeof(unsigned long long));
if (!d)
/* STRING TYPE */
static inline int
-eet_data_get_string_hash(const Eet_Dictionary * ed,
- const void * src,
- const void * src_end)
+eet_data_get_string_hash(const Eet_Dictionary *ed,
+ const void * src,
+ const void * src_end)
{
if (ed)
{
} /* eet_data_get_string_hash */
static inline int
-eet_data_get_string(const Eet_Dictionary * ed,
- const void * src,
- const void * src_end,
- void * dst)
+eet_data_get_string(const Eet_Dictionary *ed,
+ const void * src,
+ const void * src_end,
+ void * dst)
{
- char * s, ** d;
+ char *s, **d;
d = (char **)dst;
if (ed)
{
- const char * str;
+ const char *str;
int idx;
if (eet_data_get_int(ed, src, src_end, &idx) < 0)
} /* eet_data_get_string */
static void *
-eet_data_put_string(Eet_Dictionary * ed,
- const void * src,
- int * size_ret)
+eet_data_put_string(Eet_Dictionary *ed,
+ const void * src,
+ int * size_ret)
{
- char * s, * d;
+ char *s, *d;
int len;
if (ed)
{
- const char * str;
+ const char *str;
int idx;
str = *((const char **)src);
/* ALWAYS INLINED STRING TYPE */
static int
-eet_data_get_istring(const Eet_Dictionary * ed __UNUSED__,
- const void * src,
- const void * src_end,
- void * dst)
+eet_data_get_istring(const Eet_Dictionary *ed __UNUSED__,
+ const void * src,
+ const void * src_end,
+ void * dst)
{
return eet_data_get_string(NULL, src, src_end, dst);
} /* eet_data_get_istring */
static void *
-eet_data_put_istring(Eet_Dictionary * ed __UNUSED__,
- const void * src,
- int * size_ret)
+eet_data_put_istring(Eet_Dictionary *ed __UNUSED__,
+ const void * src,
+ int * size_ret)
{
return eet_data_put_string(NULL, src, size_ret);
} /* eet_data_put_istring */
/* ALWAYS NULL TYPE */
static int
-eet_data_get_null(const Eet_Dictionary * ed __UNUSED__,
- const void * src __UNUSED__,
- const void * src_end __UNUSED__,
- void * dst)
+eet_data_get_null(const Eet_Dictionary *ed __UNUSED__,
+ const void *src __UNUSED__,
+ const void *src_end __UNUSED__,
+ void * dst)
{
- char ** d;
+ char **d;
d = (char **)dst;
} /* eet_data_get_null */
static void *
-eet_data_put_null(Eet_Dictionary * ed __UNUSED__,
- const void * src __UNUSED__,
- int * size_ret)
+eet_data_put_null(Eet_Dictionary *ed __UNUSED__,
+ const void *src __UNUSED__,
+ int * size_ret)
{
*size_ret = 0;
return NULL;
* values, but have a so simple math that is almost as fast.
*/
static inline int
-_eet_data_float_cache_get(const char * s,
- int len,
- float * d)
+_eet_data_float_cache_get(const char *s,
+ int len,
+ float * d)
{
/* fast handle of simple case 0xMp+E*/
if ((len == 6) && (s[0] == '0') && (s[1] == 'x') && (s[3] == 'p'))
} /* _eet_data_float_cache_get */
static inline int
-_eet_data_double_cache_get(const char * s,
- int len,
- double * d)
+_eet_data_double_cache_get(const char *s,
+ int len,
+ double * d)
{
/* fast handle of simple case 0xMp+E*/
if ((len == 6) && (s[0] == '0') && (s[1] == 'x') && (s[3] == 'p'))
/* FLOAT TYPE */
static int
-eet_data_get_float(const Eet_Dictionary * ed,
- const void * src,
- const void * src_end,
- void * dst)
+eet_data_get_float(const Eet_Dictionary *ed,
+ const void * src,
+ const void * src_end,
+ void * dst)
{
- float * d;
+ float *d;
int idx;
d = (float *)dst;
if (!ed)
{
- const char * s, * p;
+ const char *s, *p;
long long mantisse;
long exponent;
int len;
} /* eet_data_get_float */
static void *
-eet_data_put_float(Eet_Dictionary * ed,
- const void * src,
- int * size_ret)
+eet_data_put_float(Eet_Dictionary *ed,
+ const void * src,
+ int * size_ret)
{
char buf[128];
int idx;
if (!ed)
{
- char * d;
+ char *d;
int len;
len = strlen(buf);
/* DOUBLE TYPE */
static int
-eet_data_get_double(const Eet_Dictionary * ed,
- const void * src,
- const void * src_end,
- void * dst)
+eet_data_get_double(const Eet_Dictionary *ed,
+ const void * src,
+ const void * src_end,
+ void * dst)
{
- double * d;
+ double *d;
int idx;
d = (double *)dst;
if (!ed)
{
- const char * s, * p;
+ const char *s, *p;
long long mantisse = 0;
long exponent = 0;
int len;
} /* eet_data_get_double */
static void *
-eet_data_put_double(Eet_Dictionary * ed,
- const void * src,
- int * size_ret)
+eet_data_put_double(Eet_Dictionary *ed,
+ const void * src,
+ int * size_ret)
{
char buf[128];
int idx;
if (!ed)
{
- char * d;
+ char *d;
int len;
len = strlen(buf);
} /* eet_data_put_double */
static int
-eet_data_get_f32p32(const Eet_Dictionary * ed,
- const void * src,
- const void * src_end,
- void * dst)
+eet_data_get_f32p32(const Eet_Dictionary *ed,
+ const void * src,
+ const void * src_end,
+ void * dst)
{
- Eina_F32p32 * fp;
+ Eina_F32p32 *fp;
int idx;
fp = (Eina_F32p32 *)dst;
if (!ed)
{
- const char * s, * p;
+ const char *s, *p;
int len;
s = (const char *)src;
} /* eet_data_get_f32p32 */
static void *
-eet_data_put_f32p32(Eet_Dictionary * ed,
- const void * src,
- int * size_ret)
+eet_data_put_f32p32(Eet_Dictionary *ed,
+ const void * src,
+ int * size_ret)
{
char buf[128];
int idx;
if (!ed)
{
- char * d;
+ char *d;
int len;
len = strlen(buf);
} /* eet_data_put_f32p32 */
static int
-eet_data_get_f16p16(const Eet_Dictionary * ed,
- const void * src,
- const void * src_end,
- void * dst)
+eet_data_get_f16p16(const Eet_Dictionary *ed,
+ const void * src,
+ const void * src_end,
+ void * dst)
{
Eina_F32p32 tmp;
- Eina_F16p16 * fp;
+ Eina_F16p16 *fp;
fp = (Eina_F16p16 *)dst;
} /* eet_data_get_f16p16 */
static void *
-eet_data_put_f16p16(Eet_Dictionary * ed,
- const void * src,
- int * size_ret)
+eet_data_put_f16p16(Eet_Dictionary *ed,
+ const void * src,
+ int * size_ret)
{
Eina_F32p32 tmp;
} /* eet_data_put_f16p16 */
static int
-eet_data_get_f8p24(const Eet_Dictionary * ed,
- const void * src,
- const void * src_end,
- void * dst)
+eet_data_get_f8p24(const Eet_Dictionary *ed,
+ const void * src,
+ const void * src_end,
+ void * dst)
{
Eina_F32p32 tmp;
- Eina_F8p24 * fp;
+ Eina_F8p24 *fp;
fp = (Eina_F8p24 *)dst;
} /* eet_data_get_f8p24 */
static void *
-eet_data_put_f8p24(Eet_Dictionary * ed,
- const void * src,
- int * size_ret)
+eet_data_put_f8p24(Eet_Dictionary *ed,
+ const void * src,
+ int * size_ret)
{
Eina_F32p32 tmp;
} /* eet_data_put_f8p24 */
static inline int
-eet_data_get_type(const Eet_Dictionary * ed,
- int type,
- const void * src,
- const void * src_end,
- void * dest)
+eet_data_get_type(const Eet_Dictionary *ed,
+ int type,
+ const void * src,
+ const void * src_end,
+ void * dest)
{
int ret;
} /* eet_data_get_type */
static inline void *
-eet_data_put_type(Eet_Dictionary * ed,
- int type,
- const void * src,
- int * size_ret)
+eet_data_put_type(Eet_Dictionary *ed,
+ int type,
+ const void * src,
+ int * size_ret)
{
- void * ret;
+ void *ret;
ret = eet_basic_codec[type - 1].put(ed, src, size_ret);
return ret;
*/
static inline void
-eet_data_chunk_get(const Eet_Dictionary * ed,
- Eet_Data_Chunk * chnk,
- const void * src,
- int size)
+eet_data_chunk_get(const Eet_Dictionary *ed,
+ Eet_Data_Chunk * chnk,
+ const void * src,
+ int size)
{
- const char * s;
+ const char *s;
int ret1, ret2;
if (!src)
} /* eet_data_chunk_get */
static inline Eet_Data_Chunk *
-eet_data_chunk_new(void * data,
- int size,
- const char * name,
- int type,
- int group_type)
+eet_data_chunk_new(void * data,
+ int size,
+ const char *name,
+ int type,
+ int group_type)
{
- Eet_Data_Chunk * chnk;
+ Eet_Data_Chunk *chnk;
if (!name)
return NULL;
} /* eet_data_chunk_new */
static inline void
-eet_data_chunk_free(Eet_Data_Chunk * chnk)
+eet_data_chunk_free(Eet_Data_Chunk *chnk)
{
if (chnk->name)
free(chnk->name);
static inline Eet_Data_Stream *
eet_data_stream_new(void)
{
- Eet_Data_Stream * ds;
+ Eet_Data_Stream *ds;
ds = calloc(1, sizeof(Eet_Data_Stream));
if (!ds)
} /* eet_data_stream_new */
static inline void
-eet_data_stream_free(Eet_Data_Stream * ds)
+eet_data_stream_free(Eet_Data_Stream *ds)
{
if (ds->data)
free(ds->data);
} /* eet_data_stream_free */
static inline void
-eet_data_stream_flush(Eet_Data_Stream * ds)
+eet_data_stream_flush(Eet_Data_Stream *ds)
{
free(ds);
} /* eet_data_stream_flush */
static inline void
-eet_data_stream_write(Eet_Data_Stream * ds,
- const void * data,
- int size)
+eet_data_stream_write(Eet_Data_Stream *ds,
+ const void * data,
+ int size)
{
- char * p;
+ char *p;
if ((ds->pos + size) > ds->size)
{
} /* eet_data_stream_write */
static void
-eet_data_chunk_put(Eet_Dictionary * ed,
- Eet_Data_Chunk * chnk,
- Eet_Data_Stream * ds)
+eet_data_chunk_put(Eet_Dictionary * ed,
+ Eet_Data_Chunk * chnk,
+ Eet_Data_Stream *ds)
{
- int * size;
- void * string;
+ int *size;
+ void *string;
int s;
int size_ret = 0;
int string_ret = 0;
/*---*/
static void
-_eet_descriptor_hash_new(Eet_Data_Descriptor * edd)
+_eet_descriptor_hash_new(Eet_Data_Descriptor *edd)
{
int i;
edd->elements.hash.size);
for (i = 0; i < edd->elements.num; i++)
{
- Eet_Data_Element * ede;
+ Eet_Data_Element *ede;
int hash;
ede = &(edd->elements.set[i]);
edd->elements.hash.buckets[hash].element = ede;
else
{
- Eet_Data_Descriptor_Hash * bucket;
+ Eet_Data_Descriptor_Hash *bucket;
bucket = calloc(1, sizeof(Eet_Data_Descriptor_Hash));
bucket->element = ede;
} /* _eet_descriptor_hash_new */
static void
-_eet_descriptor_hash_free(Eet_Data_Descriptor * edd)
+_eet_descriptor_hash_free(Eet_Data_Descriptor *edd)
{
int i;
for (i = 0; i < edd->elements.hash.size; i++)
{
- Eet_Data_Descriptor_Hash * bucket, * pbucket;
+ Eet_Data_Descriptor_Hash *bucket, *pbucket;
bucket = edd->elements.hash.buckets[i].next;
while (bucket)
} /* _eet_descriptor_hash_free */
static Eet_Data_Element *
-_eet_descriptor_hash_find(Eet_Data_Descriptor * edd,
- char * name,
- int hash)
+_eet_descriptor_hash_find(Eet_Data_Descriptor *edd,
+ char * name,
+ int hash)
{
- Eet_Data_Descriptor_Hash * bucket;
+ Eet_Data_Descriptor_Hash *bucket;
if (hash < 0)
hash = _eet_hash_gen(name, 6);
} /* _eet_mem_alloc */
static void
-_eet_mem_free(void * mem)
+_eet_mem_free(void *mem)
{
free(mem);
} /* _eet_mem_free */
static char *
-_eet_str_alloc(const char * str)
+_eet_str_alloc(const char *str)
{
return strdup(str);
} /* _eet_str_alloc */
static void
-_eet_str_free(const char * str)
+_eet_str_free(const char *str)
{
free((char *)str);
} /* _eet_str_free */
static Eina_Hash *
-_eet_eina_hash_add_alloc(Eina_Hash * hash,
- const char * key,
- void * data)
+_eet_eina_hash_add_alloc(Eina_Hash * hash,
+ const char *key,
+ void * data)
{
if (!hash)
hash = eina_hash_string_small_new(NULL);
} /* _eet_eina_hash_add_alloc */
static Eina_Hash *
-_eet_eina_hash_direct_add_alloc(Eina_Hash * hash,
- const char * key,
- void * data)
+_eet_eina_hash_direct_add_alloc(Eina_Hash * hash,
+ const char *key,
+ void * data)
{
if (!hash)
hash = eina_hash_string_small_new(NULL);
} /* _eet_eina_hash_direct_add_alloc */
static char *
-_eet_str_direct_alloc(const char * str)
+_eet_str_direct_alloc(const char *str)
{
return (char *)str;
} /* _eet_str_direct_alloc */
static void
-_eet_str_direct_free(const char * str __UNUSED__)
+_eet_str_direct_free(const char *str __UNUSED__)
{
} /* _eet_str_direct_free */
} /* _eet_eina_hash_foreach */
static void
-_eet_eina_hash_free(void * hash)
+_eet_eina_hash_free(void *hash)
{
if (hash)
eina_hash_free(hash);
/*---*/
EAPI Eina_Bool
-eet_eina_stream_data_descriptor_class_set(Eet_Data_Descriptor_Class * eddc,
- const char * name,
- int size)
+eet_eina_stream_data_descriptor_class_set(Eet_Data_Descriptor_Class *eddc,
+ const char * name,
+ int size)
{
if (!eddc || !name)
return EINA_FALSE;
} /* eet_eina_stream_data_descriptor_class_set */
EAPI Eina_Bool
-eet_eina_file_data_descriptor_class_set(Eet_Data_Descriptor_Class * eddc,
- const char * name,
- int size)
+eet_eina_file_data_descriptor_class_set(Eet_Data_Descriptor_Class *eddc,
+ const char * name,
+ int size)
{
if (!eet_eina_stream_data_descriptor_class_set(eddc, name, size))
return EINA_FALSE;
} /* eet_eina_file_data_descriptor_class_set */
static Eet_Data_Descriptor *
-_eet_data_descriptor_new(const Eet_Data_Descriptor_Class * eddc,
- int version)
+_eet_data_descriptor_new(const Eet_Data_Descriptor_Class *eddc,
+ int version)
{
- Eet_Data_Descriptor * edd;
+ Eet_Data_Descriptor *edd;
if (!eddc)
return NULL;
} /* _eet_data_descriptor_new */
EAPI Eet_Data_Descriptor *
-eet_data_descriptor_new(const char * name,
+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)(void * l),
- void (* func_hash_foreach)(void * h, int (* func)(void * h, const char * k, void * dt, void * fdt), void * fdt),
- void *(*func_hash_add)(void * h, const char * k, void * d),
- void (* func_hash_free)(void * h))
+ void *(*func_list_next)(void *l),
+ void *(*func_list_append)(void *l, void *d),
+ void *(*func_list_data)(void *l),
+ void *(*func_list_free)(void *l),
+ void (*func_hash_foreach)(void *h, int (*func)(void *h, const char *k, void *dt, void *fdt), void *fdt),
+ void *(*func_hash_add)(void *h, const char *k, void *d),
+ void (*func_hash_free)(void *h))
{
Eet_Data_Descriptor_Class eddc;
} /* eet_data_descriptor_new */
EAPI Eet_Data_Descriptor *
-eet_data_descriptor2_new(const Eet_Data_Descriptor_Class * eddc)
+eet_data_descriptor2_new(const Eet_Data_Descriptor_Class *eddc)
{
return _eet_data_descriptor_new(eddc, 1);
} /* eet_data_descriptor2_new */
EAPI Eet_Data_Descriptor *
-eet_data_descriptor3_new(const Eet_Data_Descriptor_Class * eddc)
+eet_data_descriptor3_new(const Eet_Data_Descriptor_Class *eddc)
{
return _eet_data_descriptor_new(eddc, 2);
} /* eet_data_descriptor3_new */
EAPI Eet_Data_Descriptor *
-eet_data_descriptor_stream_new(const Eet_Data_Descriptor_Class * eddc)
+eet_data_descriptor_stream_new(const Eet_Data_Descriptor_Class *eddc)
{
return _eet_data_descriptor_new(eddc, 1);
} /* eet_data_descriptor_stream_new */
EAPI Eet_Data_Descriptor *
-eet_data_descriptor_file_new(const Eet_Data_Descriptor_Class * eddc)
+eet_data_descriptor_file_new(const Eet_Data_Descriptor_Class *eddc)
{
return _eet_data_descriptor_new(eddc, 2);
} /* eet_data_descriptor_file_new */
EAPI void
-eet_data_descriptor_free(Eet_Data_Descriptor * edd)
+eet_data_descriptor_free(Eet_Data_Descriptor *edd)
{
if (!edd)
return;
} /* eet_data_descriptor_free */
EAPI void
-eet_data_descriptor_element_add(Eet_Data_Descriptor * edd,
- const char * name,
- int type,
- int group_type,
- int offset,
- int count,
+eet_data_descriptor_element_add(Eet_Data_Descriptor *edd,
+ const char * name,
+ int type,
+ int group_type,
+ int offset,
+ int count,
/* int counter_offset, */
- const char * counter_name /* FIXME: Useless should go on a major release */,
- Eet_Data_Descriptor * subtype)
+ const char * counter_name /* FIXME: Useless should go on a major release */,
+ Eet_Data_Descriptor *subtype)
{
- Eet_Data_Element * ede;
- Eet_Data_Element * tmp;
+ Eet_Data_Element *ede;
+ Eet_Data_Element *tmp;
/* UNION, VARIANT type would not work with simple type, we need a way to map the type. */
if ((group_type == EET_G_UNION
} /* eet_data_descriptor_element_add */
EAPI void *
-eet_data_read_cipher(Eet_File * ef,
- Eet_Data_Descriptor * edd,
- const char * name,
- const char * cipher_key)
+eet_data_read_cipher(Eet_File * ef,
+ Eet_Data_Descriptor *edd,
+ const char * name,
+ const char * cipher_key)
{
- const Eet_Dictionary * ed = NULL;
- const void * data = NULL;
- void * data_dec;
+ const Eet_Dictionary *ed = NULL;
+ const void *data = NULL;
+ void *data_dec;
Eet_Free_Context context;
int required_free = 0;
int size;
} /* eet_data_read_cipher */
EAPI Eet_Node *
-eet_data_node_read_cipher(Eet_File * ef,
- const char * name,
- const char * cipher_key)
+eet_data_node_read_cipher(Eet_File * ef,
+ const char *name,
+ const char *cipher_key)
{
- const Eet_Dictionary * ed = NULL;
- const void * data = NULL;
- Eet_Node * result;
+ const Eet_Dictionary *ed = NULL;
+ const void *data = NULL;
+ Eet_Node *result;
Eet_Free_Context context;
int required_free = 0;
int size;
} /* eet_data_node_read_cipher */
EAPI void *
-eet_data_read(Eet_File * ef,
- Eet_Data_Descriptor * edd,
- const char * name)
+eet_data_read(Eet_File * ef,
+ Eet_Data_Descriptor *edd,
+ const char * name)
{
return eet_data_read_cipher(ef, edd, name, NULL);
} /* eet_data_read */
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)
+eet_data_write_cipher(Eet_File * ef,
+ Eet_Data_Descriptor *edd,
+ const char * name,
+ const char * cipher_key,
+ const void * data,
+ int compress)
{
- Eet_Dictionary * ed;
- void * data_enc;
+ Eet_Dictionary *ed;
+ void *data_enc;
int size;
int val;
} /* eet_data_write_cipher */
EAPI int
-eet_data_write(Eet_File * ef,
- Eet_Data_Descriptor * edd,
- const char * name,
- const void * data,
- int compress)
+eet_data_write(Eet_File * ef,
+ Eet_Data_Descriptor *edd,
+ const char * name,
+ const void * data,
+ int compress)
{
return eet_data_write_cipher(ef, edd, name, NULL, data, compress);
} /* eet_data_write */
static int
-_eet_free_hash(void * data)
+_eet_free_hash(void *data)
{
#ifdef _WIN64
__int64 ptr = (UINT_PTR)data;
} /* _eet_free_hash */
static void
-_eet_free_add(Eet_Free * ef,
- void * data)
+_eet_free_add(Eet_Free *ef,
+ void * data)
{
int hash;
int i;
ef->num[hash]++;
if (ef->num[hash] > ef->len[hash])
{
- void ** tmp;
+ void **tmp;
tmp = realloc(ef->list[hash], (ef->len[hash] + 16) * sizeof(void *));
if (!tmp)
} /* _eet_free_add */
static void
-_eet_free_reset(Eet_Free * ef)
+_eet_free_reset(Eet_Free *ef)
{
int i;
} /* _eet_free_reset */
static void
-_eet_free_ref(Eet_Free * ef)
+_eet_free_ref(Eet_Free *ef)
{
ef->ref++;
} /* _eet_free_ref */
static void
-_eet_free_unref(Eet_Free * ef)
+_eet_free_unref(Eet_Free *ef)
{
ef->ref--;
} /* _eet_free_unref */
#define _eet_freelist_unref(Ctx) _eet_free_unref(&Ctx->freelist);
static void
-_eet_freelist_free(Eet_Free_Context * context,
- Eet_Data_Descriptor * edd)
+_eet_freelist_free(Eet_Free_Context * context,
+ Eet_Data_Descriptor *edd)
{
int j;
int i;
#define _eet_freelist_list_unref(Ctx) _eet_free_unref(&Ctx->freelist_list);
static void
-_eet_freelist_list_free(Eet_Free_Context * context,
- Eet_Data_Descriptor * edd)
+_eet_freelist_list_free(Eet_Free_Context * context,
+ Eet_Data_Descriptor *edd)
{
int j;
int i;
#define _eet_freelist_str_unref(Ctx) _eet_free_unref(&Ctx->freelist_str);
static void
-_eet_freelist_str_free(Eet_Free_Context * context, Eet_Data_Descriptor * edd)
+_eet_freelist_str_free(Eet_Free_Context *context, Eet_Data_Descriptor *edd)
{
int j;
int i;
#define _eet_freelist_direct_str_unref(Ctx) _eet_free_unref(&Ctx->freelist_direct_str);
static void
-_eet_freelist_direct_str_free(Eet_Free_Context * context,
- Eet_Data_Descriptor * edd)
+_eet_freelist_direct_str_free(Eet_Free_Context * context,
+ Eet_Data_Descriptor *edd)
{
int j;
int i;
#define _eet_freelist_hash_unref(Ctx) _eet_free_unref(&Ctx->freelist_hash);
static void
-_eet_freelist_hash_free(Eet_Free_Context * context,
- Eet_Data_Descriptor * edd)
+_eet_freelist_hash_free(Eet_Free_Context * context,
+ Eet_Data_Descriptor *edd)
{
int j;
int i;
} /* _eet_freelist_hash_free */
static void
-_eet_freelist_all_ref(Eet_Free_Context * freelist_context)
+_eet_freelist_all_ref(Eet_Free_Context *freelist_context)
{
_eet_freelist_ref(freelist_context);
_eet_freelist_str_ref(freelist_context);
} /* _eet_freelist_all_ref */
static void
-_eet_freelist_all_unref(Eet_Free_Context * freelist_context)
+_eet_freelist_all_unref(Eet_Free_Context *freelist_context)
{
_eet_freelist_unref(freelist_context);
_eet_freelist_str_unref(freelist_context);
} /* _eet_freelist_all_unref */
static int
-eet_data_descriptor_encode_hash_cb(void * hash __UNUSED__,
- const char * cipher_key,
- void * hdata,
- void * fdata)
+eet_data_descriptor_encode_hash_cb(void *hash __UNUSED__,
+ const char *cipher_key,
+ void * hdata,
+ void * fdata)
{
- Eet_Dictionary * ed;
- Eet_Data_Encode_Hash_Info * edehi;
- Eet_Data_Stream * ds;
- Eet_Data_Element * ede;
- Eet_Data_Chunk * echnk;
- void * data = NULL;
+ Eet_Dictionary *ed;
+ Eet_Data_Encode_Hash_Info *edehi;
+ Eet_Data_Stream *ds;
+ Eet_Data_Element *ede;
+ Eet_Data_Chunk *echnk;
+ void *data = NULL;
int size;
edehi = fdata;
} /* eet_data_descriptor_encode_hash_cb */
static char *
-_eet_data_dump_token_get(const char * src,
- int * len)
+_eet_data_dump_token_get(const char *src,
+ int * len)
{
- const char * p;
- char * tok = NULL;
+ const char *p;
+ char *tok = NULL;
int in_token = 0;
int in_quote = 0;
int tlen = 0, tsize = 0;
} /* _eet_data_dump_token_get */
static void
-eet_data_encode(Eet_Dictionary * ed,
- Eet_Data_Stream * ds,
- void * data,
- const char * name,
- int size,
- int type,
- int group_type)
+eet_data_encode(Eet_Dictionary * ed,
+ Eet_Data_Stream *ds,
+ void * data,
+ const char * name,
+ int size,
+ int type,
+ int group_type)
{
- Eet_Data_Chunk * echnk;
+ Eet_Data_Chunk *echnk;
if (!data)
type = EET_T_NULL;
} /* eet_data_encode */
static void *
-_eet_data_dump_encode(int parent_type,
- Eet_Dictionary * ed,
- Eet_Node * node,
- int * size_ret)
+_eet_data_dump_encode(int parent_type,
+ Eet_Dictionary *ed,
+ Eet_Node * node,
+ int * size_ret)
{
- Eet_Data_Chunk * chnk = NULL;
- Eet_Data_Stream * ds;
- void * cdata, * data;
+ Eet_Data_Chunk *chnk = NULL;
+ Eet_Data_Stream *ds;
+ void *cdata, *data;
int csize, size;
int count;
int child_type;
- Eet_Node * n;
+ Eet_Node *n;
if (_eet_data_words_bigendian == -1)
{
} /* _eet_data_dump_encode */
static void *
-_eet_data_dump_parse(Eet_Dictionary * ed,
- int * size_ret,
- const char * src,
- int size)
+_eet_data_dump_parse(Eet_Dictionary *ed,
+ int * size_ret,
+ const char * src,
+ int size)
{
- void * cdata = NULL;
- const char * p = NULL;
+ void *cdata = NULL;
+ const char *p = NULL;
#define M_NONE 0
#define M_STRUCT 1
#define M_ 2
int left, jump;
- Eet_Node * node_base = NULL;
- Eet_Node * node = NULL;
- Eet_Node * n = NULL, * nn = NULL;
+ Eet_Node *node_base = NULL;
+ Eet_Node *node = NULL;
+ Eet_Node *n = NULL, *nn = NULL;
/* FIXME; handle parse errors */
#define TOK_GET(t)\
left = size;
for (p = src; p < (src + size); )
{
- char * tok1, * tok2, * tok3, * tok4;
+ char *tok1, *tok2, *tok3, *tok4;
TOK_GET(tok1);
if (tok1)
}
static void *
-_eet_data_descriptor_decode(Eet_Free_Context * context,
- const Eet_Dictionary * ed,
- Eet_Data_Descriptor * edd,
- const void * data_in,
- int size_in)
+_eet_data_descriptor_decode(Eet_Free_Context * context,
+ const Eet_Dictionary *ed,
+ Eet_Data_Descriptor * edd,
+ const void * data_in,
+ int size_in)
{
- Eet_Node * result = NULL;
- void * data = NULL;
- char * p;
+ Eet_Node *result = NULL;
+ void *data = NULL;
+ char *p;
int size, i;
Eet_Data_Chunk chnk;
while (size > 0)
{
Eet_Data_Chunk echnk;
- Eet_Data_Element * ede = NULL;
- Eet_Node * child = NULL;
+ Eet_Data_Element *ede = NULL;
+ Eet_Node *child = NULL;
int group_type = EET_G_UNKNOWN, type = EET_T_UNKNOW;
int ret = 0;
} /* _eet_data_descriptor_decode */
static int
-eet_data_get_list(Eet_Free_Context * context,
- const Eet_Dictionary * ed,
- Eet_Data_Descriptor * edd,
- Eet_Data_Element * ede,
- Eet_Data_Chunk * echnk,
- int type,
- int group_type __UNUSED__,
- void * data,
- char ** p,
- int * size)
+eet_data_get_list(Eet_Free_Context * context,
+ const Eet_Dictionary *ed,
+ Eet_Data_Descriptor * edd,
+ Eet_Data_Element * ede,
+ Eet_Data_Chunk * echnk,
+ int type,
+ int group_type __UNUSED__,
+ void * data,
+ char ** p,
+ int * size)
{
- Eet_Data_Descriptor * subtype = NULL;
- void * list = NULL;
- void ** ptr;
- void * data_ret;
+ Eet_Data_Descriptor *subtype = NULL;
+ void *list = NULL;
+ void **ptr;
+ void *data_ret;
EET_ASSERT(!((type > EET_T_UNKNOW) && (type < EET_T_STRING)), return 0);
} /* eet_data_get_list */
static int
-eet_data_get_hash(Eet_Free_Context * context,
- const Eet_Dictionary * ed,
- Eet_Data_Descriptor * edd,
- Eet_Data_Element * ede,
- Eet_Data_Chunk * echnk,
- int type,
- int group_type __UNUSED__,
- void * data,
- char ** p,
- int * size)
+eet_data_get_hash(Eet_Free_Context * context,
+ const Eet_Dictionary *ed,
+ Eet_Data_Descriptor * edd,
+ Eet_Data_Element * ede,
+ Eet_Data_Chunk * echnk,
+ int type,
+ int group_type __UNUSED__,
+ void * data,
+ char ** p,
+ int * size)
{
- void ** ptr;
- void * hash = NULL;
- char * key = NULL;
- void * data_ret = NULL;
+ void **ptr;
+ void *hash = NULL;
+ char *key = NULL;
+ void *data_ret = NULL;
int ret = 0;
EET_ASSERT(!((type > EET_T_UNKNOW) && (type < EET_T_STRING)), return 0);
* each chunk is pointless.
*/
static int
-eet_data_get_array(Eet_Free_Context * context,
- const Eet_Dictionary * ed,
- Eet_Data_Descriptor * edd,
- Eet_Data_Element * ede,
- Eet_Data_Chunk * echnk,
- int type,
- int group_type,
- void * data,
- char ** p,
- int * size)
+eet_data_get_array(Eet_Free_Context * context,
+ const Eet_Dictionary *ed,
+ Eet_Data_Descriptor * edd,
+ Eet_Data_Element * ede,
+ Eet_Data_Chunk * echnk,
+ int type,
+ int group_type,
+ void * data,
+ char ** p,
+ int * size)
{
- Eina_List * childs = NULL;
- const char * name;
- Eet_Node * tmp;
- void * ptr;
+ Eina_List *childs = NULL;
+ const char *name;
+ Eet_Node *tmp;
+ void *ptr;
int count;
int ret;
int subsize = 0;
/* get all array elements */
for (i = 0; i < count; i++)
{
- void * dst = NULL;
- void * data_ret = NULL;
+ void *dst = NULL;
+ void *data_ret = NULL;
/* Advance to next chunk */
NEXT_CHUNK((*p), (*size), (*echnk), ed);
if (!edd)
{
- Eet_Node * parent = *((Eet_Node **)data);
- Eet_Node * array;
+ Eet_Node *parent = *((Eet_Node **)data);
+ Eet_Node *array;
if (group_type == EET_G_ARRAY)
array = eet_node_array_new(name, count, childs);
} /* eet_data_get_array */
static void
-eet_data_put_union(Eet_Dictionary * ed,
- Eet_Data_Descriptor * edd __UNUSED__,
- Eet_Data_Element * ede,
- Eet_Data_Stream * ds,
- void * data_in)
+eet_data_put_union(Eet_Dictionary * ed,
+ Eet_Data_Descriptor *edd __UNUSED__,
+ Eet_Data_Element * ede,
+ Eet_Data_Stream * ds,
+ void * data_in)
{
- const char * union_type;
+ const char *union_type;
int i;
EET_ASSERT(!((ede->type != EET_T_UNKNOW) || (!ede->subtype)), return );
for (i = 0; i < ede->subtype->elements.num; ++i)
if (strcmp(ede->subtype->elements.set[i].name, union_type) == 0)
{
- Eet_Data_Element * sede;
- void * data;
+ Eet_Data_Element *sede;
+ void *data;
int size;
/* Yeah we found it ! */
} /* eet_data_put_union */
static int
-eet_data_get_union(Eet_Free_Context * context,
- const Eet_Dictionary * ed,
- Eet_Data_Descriptor * edd __UNUSED__,
- Eet_Data_Element * ede,
- Eet_Data_Chunk * echnk,
- int type,
- int group_type,
- void * data,
- char ** p,
- int * size)
+eet_data_get_union(Eet_Free_Context * context,
+ const Eet_Dictionary * ed,
+ Eet_Data_Descriptor *edd __UNUSED__,
+ Eet_Data_Element * ede,
+ Eet_Data_Chunk * echnk,
+ int type,
+ int group_type,
+ void * data,
+ char ** p,
+ int * size)
{
- const char * union_type;
- void * data_ret = NULL;
+ const char *union_type;
+ void *data_ret = NULL;
int ret = 0;
int i;
for (i = 0; i < ede->subtype->elements.num; ++i)
if (strcmp(ede->subtype->elements.set[i].name, union_type) == 0)
{
- Eet_Data_Element * sede;
- char * ut;
+ Eet_Data_Element *sede;
+ char *ut;
/* Yeah we found it ! */
sede = &(ede->subtype->elements.set[i]);
} /* eet_data_get_union */
static void
-eet_data_put_variant(Eet_Dictionary * ed,
- Eet_Data_Descriptor * edd __UNUSED__,
- Eet_Data_Element * ede,
- Eet_Data_Stream * ds,
- void * data_in)
+eet_data_put_variant(Eet_Dictionary * ed,
+ Eet_Data_Descriptor *edd __UNUSED__,
+ Eet_Data_Element * ede,
+ Eet_Data_Stream * ds,
+ void * data_in)
{
- const char * union_type;
- void * data;
+ const char *union_type;
+ void *data;
Eina_Bool unknow = EINA_FALSE;
int size;
int i;
if (unknow)
{
/* Handle opaque internal representation */
- Eet_Variant_Unknow * evu;
+ Eet_Variant_Unknow *evu;
data = eet_data_put_type(ed, EET_T_STRING, &union_type, &size);
if (data)
for (i = 0; i < ede->subtype->elements.num; ++i)
if (strcmp(ede->subtype->elements.set[i].name, union_type) == 0)
{
- Eet_Data_Element * sede;
+ Eet_Data_Element *sede;
/* Yeah we found it ! */
data = eet_data_put_type(ed, EET_T_STRING, &union_type, &size);
if (sede->group_type != EET_G_UNKNOWN)
{
- Eet_Data_Stream * lds;
+ Eet_Data_Stream *lds;
lds = eet_data_stream_new();
eet_group_codec[sede->group_type - 100].put(ed,
} /* eet_data_put_variant */
static int
-eet_data_get_variant(Eet_Free_Context * context,
- const Eet_Dictionary * ed,
- Eet_Data_Descriptor * edd __UNUSED__,
- Eet_Data_Element * ede,
- Eet_Data_Chunk * echnk,
- int type __UNUSED__,
- int group_type __UNUSED__,
- void * data,
- char ** p,
- int * size)
+eet_data_get_variant(Eet_Free_Context * context,
+ const Eet_Dictionary * ed,
+ Eet_Data_Descriptor *edd __UNUSED__,
+ Eet_Data_Element * ede,
+ Eet_Data_Chunk * echnk,
+ int type __UNUSED__,
+ int group_type __UNUSED__,
+ void * data,
+ char ** p,
+ int * size)
{
- const char * union_type;
- void * data_ret = NULL;
+ const char *union_type;
+ void *data_ret = NULL;
int ret = 0;
int i;
if (ede)
{
- char * ut;
+ char *ut;
EET_ASSERT(ede->subtype, goto on_error);
for (i = 0; i < ede->subtype->elements.num; ++i)
if (strcmp(ede->subtype->elements.set[i].name, union_type) == 0)
{
- Eet_Data_Element * sede;
+ Eet_Data_Element *sede;
/* Yeah we found it ! */
sede = &(ede->subtype->elements.set[i]);
if (sede->group_type != EET_G_UNKNOWN)
{
Eet_Data_Chunk chnk;
- char * p2;
+ char *p2;
int size2;
int ret;
if (!data_ret)
{
- Eet_Variant_Unknow * evu;
+ Eet_Variant_Unknow *evu;
evu = calloc(1, sizeof (Eet_Variant_Unknow) + echnk->size - 1);
if (!evu)
} /* eet_data_get_variant */
static Eet_Node *
-eet_data_node_simple_type(int type, const char * name, void * dd)
+eet_data_node_simple_type(int type, const char *name, void *dd)
{
#ifdef EET_T_TYPE
# undef EET_T_TYPE
} /* eet_data_node_simple_type */
static int
-eet_data_get_unknown(Eet_Free_Context * context,
- const Eet_Dictionary * ed,
- Eet_Data_Descriptor * edd,
- Eet_Data_Element * ede,
- Eet_Data_Chunk * echnk,
- int type,
- int group_type __UNUSED__,
- void * data,
- char ** p __UNUSED__,
- int * size __UNUSED__)
+eet_data_get_unknown(Eet_Free_Context * context,
+ const Eet_Dictionary *ed,
+ Eet_Data_Descriptor * edd,
+ Eet_Data_Element * ede,
+ Eet_Data_Chunk * echnk,
+ int type,
+ int group_type __UNUSED__,
+ void * data,
+ char **p __UNUSED__,
+ int *size __UNUSED__)
{
int ret;
- void * data_ret;
+ void *data_ret;
if (IS_SIMPLE_TYPE(type))
{
if (!edd)
{
- Eet_Node ** parent = data;
- Eet_Node * node;
+ Eet_Node **parent = data;
+ Eet_Node *node;
node = eet_data_node_simple_type(type, echnk->name, dd);
{
if (type == EET_T_STRING)
{
- char ** str;
+ char **str;
str = (char **)(((char *)data));
if (*str)
}
else if (edd && type == EET_T_INLINED_STRING)
{
- char ** str;
+ char **str;
str = (char **)(((char *)data));
if (*str)
}
else
{
- Eet_Data_Descriptor * subtype;
+ Eet_Data_Descriptor *subtype;
subtype = ede ? ede->subtype : NULL;
if (subtype || !edd)
{
- Eet_Node ** parent = data;
- void ** ptr;
+ Eet_Node **parent = data;
+ void **ptr;
data_ret = _eet_data_descriptor_decode(context,
ed,
}
else
{
- Eet_Node * node = data_ret;
+ Eet_Node *node = data_ret;
if (*parent)
{
} /* eet_data_get_unknown */
static void
-eet_data_put_array(Eet_Dictionary * ed,
- Eet_Data_Descriptor * edd __UNUSED__,
- Eet_Data_Element * ede,
- Eet_Data_Stream * ds,
- void * data_in)
+eet_data_put_array(Eet_Dictionary * ed,
+ Eet_Data_Descriptor *edd __UNUSED__,
+ Eet_Data_Element * ede,
+ Eet_Data_Stream * ds,
+ void * data_in)
{
- void * data;
+ void *data;
int offset = 0;
int subsize;
int count;
for (j = 0; j < count; j++)
{
- void * d;
+ void *d;
int pos = ds->pos;
if (ede->group_type == EET_G_ARRAY)
} /* eet_data_put_array */
static void
-eet_data_put_unknown(Eet_Dictionary * ed,
- Eet_Data_Descriptor * edd __UNUSED__,
- Eet_Data_Element * ede,
- Eet_Data_Stream * ds,
- void * data_in)
+eet_data_put_unknown(Eet_Dictionary * ed,
+ Eet_Data_Descriptor *edd __UNUSED__,
+ Eet_Data_Element * ede,
+ Eet_Data_Stream * ds,
+ void * data_in)
{
- void * data = NULL;
+ void *data = NULL;
int size;
if (IS_SIMPLE_TYPE(ede->type))
} /* eet_data_put_unknown */
static void
-eet_data_put_list(Eet_Dictionary * ed,
- Eet_Data_Descriptor * edd,
- Eet_Data_Element * ede,
- Eet_Data_Stream * ds,
- void * data_in)
+eet_data_put_list(Eet_Dictionary * ed,
+ Eet_Data_Descriptor *edd,
+ Eet_Data_Element * ede,
+ Eet_Data_Stream * ds,
+ void * data_in)
{
- void * data;
- void * l;
+ void *data;
+ void *l;
int size;
EET_ASSERT(!(((ede->type > EET_T_UNKNOW) && (ede->type < EET_T_STRING))
{
if (IS_POINTER_TYPE(ede->type))
{
- const void * str = edd->func.list_data(l);
+ const void *str = edd->func.list_data(l);
eet_data_put_unknown(ed, NULL, ede, ds, &str);
}
else
} /* eet_data_put_list */
static void
-eet_data_put_hash(Eet_Dictionary * ed,
- Eet_Data_Descriptor * edd,
- Eet_Data_Element * ede,
- Eet_Data_Stream * ds,
- void * data_in)
+eet_data_put_hash(Eet_Dictionary * ed,
+ Eet_Data_Descriptor *edd,
+ Eet_Data_Element * ede,
+ Eet_Data_Stream * ds,
+ void * data_in)
{
Eet_Data_Encode_Hash_Info fdata;
- void * l;
+ void *l;
l = *((void **)(((char *)data_in)));
fdata.ds = ds;
} /* eet_data_put_hash */
EAPI int
-eet_data_dump_cipher(Eet_File * ef,
- const char * name,
- const char * cipher_key,
- void (* dumpfunc)(void * data, const char * str),
- void * dumpdata)
+eet_data_dump_cipher(Eet_File *ef,
+ const char *name,
+ const char *cipher_key,
+ void (*dumpfunc)(void *data, const char *str),
+ void *dumpdata)
{
- const Eet_Dictionary * ed = NULL;
- const void * data = NULL;
- Eet_Node * result;
+ const Eet_Dictionary *ed = NULL;
+ const void *data = NULL;
+ Eet_Node *result;
Eet_Free_Context context;
int required_free = 0;
int size;
} /* eet_data_dump_cipher */
EAPI int
-eet_data_dump(Eet_File * ef,
- const char * name,
- void (* dumpfunc)(void * data, const char * str),
- void * dumpdata)
+eet_data_dump(Eet_File *ef,
+ const char *name,
+ void (*dumpfunc)(void *data, const char *str),
+ void *dumpdata)
{
return eet_data_dump_cipher(ef, name, NULL, dumpfunc, dumpdata);
} /* eet_data_dump */
EAPI int
-eet_data_text_dump_cipher(const void * data_in,
- const char * cipher_key,
+eet_data_text_dump_cipher(const void *data_in,
+ const char *cipher_key,
int size_in,
- void (* dumpfunc)(void * data, const char * str),
- void * dumpdata)
+ void (*dumpfunc)(void *data, const char *str),
+ void *dumpdata)
{
- void * ret = NULL;
- Eet_Node * result;
+ void *ret = NULL;
+ Eet_Node *result;
Eet_Free_Context context;
unsigned int ret_len = 0;
} /* eet_data_text_dump_cipher */
EAPI int
-eet_data_text_dump(const void * data_in,
+eet_data_text_dump(const void *data_in,
int size_in,
- void (* dumpfunc)(void * data, const char * str),
- void * dumpdata)
+ void (*dumpfunc)(void *data, const char *str),
+ void *dumpdata)
{
return eet_data_text_dump_cipher(data_in, NULL, size_in, dumpfunc, dumpdata);
} /* eet_data_text_dump */
EAPI void *
-eet_data_text_undump_cipher(const char * text,
- const char * cipher_key,
- int textlen,
- int * size_ret)
+eet_data_text_undump_cipher(const char *text,
+ const char *cipher_key,
+ int textlen,
+ int * size_ret)
{
- void * ret = NULL;
+ void *ret = NULL;
ret = _eet_data_dump_parse(NULL, size_ret, text, textlen);
if (ret && cipher_key)
{
- void * ciphered = NULL;
+ void *ciphered = NULL;
unsigned int ciphered_len;
if (eet_cipher(ret, *size_ret, cipher_key,
} /* eet_data_text_undump_cipher */
EAPI void *
-eet_data_text_undump(const char * text,
- int textlen,
- int * size_ret)
+eet_data_text_undump(const char *text,
+ int textlen,
+ int * size_ret)
{
return eet_data_text_undump_cipher(text, NULL, textlen, size_ret);
} /* eet_data_text_undump */
EAPI int
-eet_data_undump_cipher(Eet_File * ef,
- const char * name,
- const char * cipher_key,
- const char * text,
- int textlen,
- int compress)
+eet_data_undump_cipher(Eet_File * ef,
+ const char *name,
+ const char *cipher_key,
+ const char *text,
+ int textlen,
+ int compress)
{
- Eet_Dictionary * ed;
- void * data_enc;
+ Eet_Dictionary *ed;
+ void *data_enc;
int size;
int val;
} /* eet_data_undump_cipher */
EAPI int
-eet_data_undump(Eet_File * ef,
- const char * name,
- const char * text,
- int textlen,
- int compress)
+eet_data_undump(Eet_File * ef,
+ const char *name,
+ const char *text,
+ int textlen,
+ int compress)
{
return eet_data_undump_cipher(ef, name, NULL, text, textlen, compress);
} /* eet_data_undump */
EAPI void *
-eet_data_descriptor_decode_cipher(Eet_Data_Descriptor * edd,
- const void * data_in,
- const char * cipher_key,
- int size_in)
+eet_data_descriptor_decode_cipher(Eet_Data_Descriptor *edd,
+ const void * data_in,
+ const char * cipher_key,
+ int size_in)
{
- void * deciphered = (void *)data_in;
- void * ret;
+ void *deciphered = (void *)data_in;
+ void *ret;
Eet_Free_Context context;
unsigned int deciphered_len = size_in;
} /* eet_data_descriptor_decode_cipher */
EAPI void *
-eet_data_descriptor_decode(Eet_Data_Descriptor * edd,
- const void * data_in,
- int size_in)
+eet_data_descriptor_decode(Eet_Data_Descriptor *edd,
+ const void * data_in,
+ int size_in)
{
return eet_data_descriptor_decode_cipher(edd, data_in, NULL, size_in);
} /* eet_data_descriptor_decode */
EAPI Eet_Node *
-eet_data_node_decode_cipher(const void * data_in,
- const char * cipher_key,
- int size_in)
+eet_data_node_decode_cipher(const void *data_in,
+ const char *cipher_key,
+ int size_in)
{
- void * deciphered = (void *)data_in;
- Eet_Node * ret;
+ void *deciphered = (void *)data_in;
+ Eet_Node *ret;
Eet_Free_Context context;
unsigned int deciphered_len = size_in;
} /* eet_data_node_decode_cipher */
static void *
-_eet_data_descriptor_encode(Eet_Dictionary * ed,
- Eet_Data_Descriptor * edd,
- const void * data_in,
- int * size_ret)
+_eet_data_descriptor_encode(Eet_Dictionary * ed,
+ Eet_Data_Descriptor *edd,
+ const void * data_in,
+ int * size_ret)
{
- Eet_Data_Stream * ds;
- Eet_Data_Chunk * chnk;
- void * cdata;
+ Eet_Data_Stream *ds;
+ Eet_Data_Chunk *chnk;
+ void *cdata;
int csize;
int i;
ds = eet_data_stream_new();
for (i = 0; i < edd->elements.num; i++)
{
- Eet_Data_Element * ede;
+ Eet_Data_Element *ede;
ede = &(edd->elements.set[i]);
eet_group_codec[ede->group_type - 100].put(
} /* _eet_data_descriptor_encode */
EAPI int
-eet_data_node_write_cipher(Eet_File * ef,
- const char * name,
- const char * cipher_key,
- Eet_Node * node,
- int compress)
+eet_data_node_write_cipher(Eet_File * ef,
+ const char *name,
+ const char *cipher_key,
+ Eet_Node * node,
+ int compress)
{
- Eet_Dictionary * ed;
- void * data_enc;
+ Eet_Dictionary *ed;
+ void *data_enc;
int size;
int val;
} /* eet_data_node_write_cipher */
EAPI void *
-eet_data_node_encode_cipher(Eet_Node * node,
- const char * cipher_key,
- int * size_ret)
+eet_data_node_encode_cipher(Eet_Node * node,
+ const char *cipher_key,
+ int * size_ret)
{
- void * ret = NULL;
- void * ciphered = NULL;
+ void *ret = NULL;
+ void *ciphered = NULL;
unsigned int ciphered_len = 0;
int size;
} /* eet_data_node_encode_cipher */
EAPI void *
-eet_data_descriptor_encode_cipher(Eet_Data_Descriptor * edd,
- const void * data_in,
- const char * cipher_key,
- int * size_ret)
+eet_data_descriptor_encode_cipher(Eet_Data_Descriptor *edd,
+ const void * data_in,
+ const char * cipher_key,
+ int * size_ret)
{
- void * ret = NULL;
- void * ciphered = NULL;
+ void *ret = NULL;
+ void *ciphered = NULL;
unsigned int ciphered_len = 0;
int size;
} /* eet_data_descriptor_encode_cipher */
EAPI void *
-eet_data_descriptor_encode(Eet_Data_Descriptor * edd,
- const void * data_in,
- int * size_ret)
+eet_data_descriptor_encode(Eet_Data_Descriptor *edd,
+ const void * data_in,
+ int * size_ret)
{
return eet_data_descriptor_encode_cipher(edd, data_in, NULL, size_ret);
} /* eet_data_descriptor_encode */
Eet_Dictionary *
eet_dictionary_add(void)
{
- Eet_Dictionary * new;
+ Eet_Dictionary *new;
new = calloc(1, sizeof (Eet_Dictionary));
if (!new)
} /* eet_dictionary_add */
void
-eet_dictionary_free(Eet_Dictionary * ed)
+eet_dictionary_free(Eet_Dictionary *ed)
{
if (ed)
{
} /* eet_dictionary_free */
static int
-_eet_dictionary_lookup(Eet_Dictionary * ed,
- const char * string,
- int hash)
+_eet_dictionary_lookup(Eet_Dictionary *ed,
+ const char * string,
+ int hash)
{
int prev = -1;
int current;
} /* _eet_dictionary_lookup */
int
-eet_dictionary_string_add(Eet_Dictionary * ed,
- const char * string)
+eet_dictionary_string_add(Eet_Dictionary *ed,
+ const char * string)
{
- Eet_String * current;
- char * str;
+ Eet_String *current;
+ char *str;
int hash;
int idx;
int len;
if (ed->total == ed->count)
{
- Eet_String * new;
+ Eet_String *new;
int total;
total = ed->total + 8;
} /* eet_dictionary_string_add */
int
-eet_dictionary_string_get_size(const Eet_Dictionary * ed,
- int idx)
+eet_dictionary_string_get_size(const Eet_Dictionary *ed,
+ int idx)
{
if (!ed)
return 0;
} /* eet_dictionary_string_get_size */
int
-eet_dictionary_string_get_hash(const Eet_Dictionary * ed,
- int idx)
+eet_dictionary_string_get_hash(const Eet_Dictionary *ed,
+ int idx)
{
if (!ed)
return -1;
} /* eet_dictionary_string_get_hash */
const char *
-eet_dictionary_string_get_char(const Eet_Dictionary * ed,
- int idx)
+eet_dictionary_string_get_char(const Eet_Dictionary *ed,
+ int idx)
{
if (!ed)
return NULL;
} /* eet_dictionary_string_get_char */
static inline Eina_Bool
-_eet_dictionary_string_get_me_cache(const char * s,
- int len,
- int * mantisse,
- int * exponent)
+_eet_dictionary_string_get_me_cache(const char *s,
+ int len,
+ int * mantisse,
+ int * exponent)
{
if ((len == 6) && (s[0] == '0') && (s[1] == 'x') && (s[3] == 'p'))
{
} /* _eet_dictionary_string_get_me_cache */
static inline Eina_Bool
-_eet_dictionary_string_get_float_cache(const char * s,
- int len,
- float * result)
+_eet_dictionary_string_get_float_cache(const char *s,
+ int len,
+ float * result)
{
int mantisse;
int exponent;
} /* _eet_dictionary_string_get_float_cache */
static inline Eina_Bool
-_eet_dictionary_string_get_double_cache(const char * s,
- int len,
- double * result)
+_eet_dictionary_string_get_double_cache(const char *s,
+ int len,
+ double * result)
{
int mantisse;
int exponent;
} /* _eet_dictionary_string_get_double_cache */
static inline Eina_Bool
-_eet_dictionary_test(const Eet_Dictionary * ed,
- int idx,
- void * result)
+_eet_dictionary_test(const Eet_Dictionary *ed,
+ int idx,
+ void * result)
{
if (!result)
return EINA_FALSE;
} /* _eet_dictionary_test */
Eina_Bool
-eet_dictionary_string_get_float(const Eet_Dictionary * ed,
- int idx,
- float * result)
+eet_dictionary_string_get_float(const Eet_Dictionary *ed,
+ int idx,
+ float * result)
{
if (!_eet_dictionary_test(ed, idx, result))
return EINA_FALSE;
if (!(ed->all[idx].type & EET_D_FLOAT))
{
- const char * str;
+ const char *str;
str = ed->all[idx].str ? ed->all[idx].str : ed->all[idx].mmap;
} /* eet_dictionary_string_get_float */
Eina_Bool
-eet_dictionary_string_get_double(const Eet_Dictionary * ed,
- int idx,
- double * result)
+eet_dictionary_string_get_double(const Eet_Dictionary *ed,
+ int idx,
+ double * result)
{
if (!_eet_dictionary_test(ed, idx, result))
return EINA_FALSE;
if (!(ed->all[idx].type & EET_D_DOUBLE))
{
- const char * str;
+ const char *str;
str = ed->all[idx].str ? ed->all[idx].str : ed->all[idx].mmap;
} /* eet_dictionary_string_get_double */
Eina_Bool
-eet_dictionary_string_get_fp(const Eet_Dictionary * ed,
- int idx,
- Eina_F32p32 * result)
+eet_dictionary_string_get_fp(const Eet_Dictionary *ed,
+ int idx,
+ Eina_F32p32 * result)
{
if (!_eet_dictionary_test(ed, idx, result))
return EINA_FALSE;
if (!(ed->all[idx].type & EET_D_FIXED_POINT))
{
- const char * str;
+ const char *str;
Eina_F32p32 fp;
str = ed->all[idx].str ? ed->all[idx].str : ed->all[idx].mmap;
} /* eet_dictionary_string_get_fp */
EAPI int
-eet_dictionary_string_check(Eet_Dictionary * ed,
- const char * string)
+eet_dictionary_string_check(Eet_Dictionary *ed,
+ const char * string)
{
int i;
_eet_jpeg_membuf_src_fill(j_decompress_ptr cinfo)
{
static const JOCTET jpeg_eoi[2] = { 0xFF, JPEG_EOI };
- struct jpeg_membuf_src * src = (struct jpeg_membuf_src *)cinfo->src;
+ struct jpeg_membuf_src *src = (struct jpeg_membuf_src *)cinfo->src;
src->pub.bytes_in_buffer = sizeof(jpeg_eoi);
src->pub.next_input_byte = jpeg_eoi;
_eet_jpeg_membuf_src_skip(j_decompress_ptr cinfo,
long num_bytes)
{
- struct jpeg_membuf_src * src = (struct jpeg_membuf_src *)cinfo->src;
+ struct jpeg_membuf_src *src = (struct jpeg_membuf_src *)cinfo->src;
src->pub.bytes_in_buffer -= num_bytes;
src->pub.next_input_byte += num_bytes;
const void * buf,
size_t len)
{
- struct jpeg_membuf_src * src;
+ struct jpeg_membuf_src *src;
src = malloc(sizeof(*src));
if (!src)
static boolean
_eet_jpeg_membuf_dst_flush(j_compress_ptr cinfo)
{
- struct jpeg_membuf_dst * dst = (struct jpeg_membuf_dst *)cinfo->dest;
- unsigned char * buf;
+ struct jpeg_membuf_dst *dst = (struct jpeg_membuf_dst *)cinfo->dest;
+ unsigned char *buf;
if (dst->len >= 0x40000000 ||
(buf = realloc(dst->buf, dst->len * 2)) == NULL)
static void
_eet_jpeg_membuf_dst_term(j_compress_ptr cinfo)
{
- struct jpeg_membuf_dst * dst = (struct jpeg_membuf_dst *)cinfo->dest;
+ struct jpeg_membuf_dst *dst = (struct jpeg_membuf_dst *)cinfo->dest;
if (dst->failed)
{
void ** buf,
size_t * len)
{
- struct jpeg_membuf_dst * dst;
+ struct jpeg_membuf_dst *dst;
dst = malloc(sizeof(*dst));
if (!dst)
static void _JPEGErrorHandler2(j_common_ptr cinfo,
int msg_level);
-static int eet_data_image_jpeg_header_decode(const void * data,
- int size,
- unsigned int * w,
- unsigned int * h);
-static int eet_data_image_jpeg_rgb_decode(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);
-static void * eet_data_image_jpeg_alpha_decode(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);
+static int eet_data_image_jpeg_header_decode(const void * data,
+ int size,
+ unsigned int *w,
+ unsigned int *h);
+static int eet_data_image_jpeg_rgb_decode(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);
+static void * eet_data_image_jpeg_alpha_decode(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);
static void * eet_data_image_lossless_convert(int * size,
const void * data,
unsigned int w,
} /* _JPEGErrorHandler2 */
static int
-eet_data_image_jpeg_header_decode(const void * data,
- int size,
- unsigned int * w,
- unsigned int * h)
+eet_data_image_jpeg_header_decode(const void * data,
+ int size,
+ unsigned int *w,
+ unsigned int *h)
{
struct jpeg_decompress_struct cinfo;
struct _JPEG_error_mgr jerr;
} /* eet_data_image_jpeg_header_decode */
static int
-eet_data_image_jpeg_rgb_decode(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)
+eet_data_image_jpeg_rgb_decode(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)
{
struct jpeg_decompress_struct cinfo;
struct _JPEG_error_mgr jerr;
- unsigned char * ptr, * line[16], * tdata = NULL;
- unsigned int * ptr2, * tmp;
+ unsigned char *ptr, *line[16], *tdata = NULL;
+ unsigned int *ptr2, *tmp;
unsigned int iw, ih;
unsigned int x, y, l, scans;
unsigned int i;
} /* eet_data_image_jpeg_rgb_decode */
static void *
-eet_data_image_jpeg_alpha_decode(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)
+eet_data_image_jpeg_alpha_decode(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)
{
struct jpeg_decompress_struct cinfo;
struct _JPEG_error_mgr jerr;
- unsigned char * ptr, * line[16], * tdata = NULL;
- unsigned int * ptr2, * tmp;
+ unsigned char *ptr, *line[16], *tdata = NULL;
+ unsigned int *ptr2, *tmp;
unsigned int x, y, l, scans;
unsigned int i, iw;
}
{
- unsigned char * d;
- int * header;
+ unsigned char *d;
+ int *header;
d = malloc((w * h * 4) + (8 * 4));
if (!d)
}
{
- unsigned char * d;
- unsigned char * comp;
- int * header;
+ unsigned char *d;
+ unsigned char *comp;
+ int *header;
int ret;
uLongf buflen;
{
struct jpeg_compress_struct cinfo;
struct _JPEG_error_mgr jerr;
- const int * ptr;
- void * d = NULL;
+ const int *ptr;
+ void *d = NULL;
size_t sz = 0;
- JSAMPROW * jbuf;
- unsigned char * buf;
+ JSAMPROW *jbuf;
+ unsigned char *buf;
(void)alpha; /* unused */
int alpha,
int quality)
{
- unsigned char * d1, * d2;
- unsigned char * d;
- int * header;
+ unsigned char *d1, *d2;
+ unsigned char *d;
+ int *header;
int sz1, sz2;
(void)alpha; /* unused */
}
{
- const int * ptr;
- void * dst = NULL;
+ const int *ptr;
+ void *dst = NULL;
size_t sz = 0;
struct _JPEG_error_mgr jerr;
- JSAMPROW * jbuf;
+ JSAMPROW *jbuf;
struct jpeg_compress_struct cinfo;
- unsigned char * buf;
+ unsigned char *buf;
buf = alloca(3 * w);
sz1 = sz;
}
{
- const int * ptr;
- void * dst = NULL;
+ const int *ptr;
+ void *dst = NULL;
size_t sz = 0;
struct _JPEG_error_mgr jerr;
- JSAMPROW * jbuf;
+ JSAMPROW *jbuf;
struct jpeg_compress_struct cinfo;
- unsigned char * buf;
+ unsigned char *buf;
buf = alloca(3 * w);
int quality,
int lossy)
{
- void * d = NULL;
+ void *d = NULL;
int size = 0;
d = eet_data_image_encode(data, &size, w, h, alpha, comp, quality, lossy);
} /* eet_data_image_write */
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 * comp,
- int * quality,
- int * lossy)
+eet_data_image_read_cipher(Eet_File * ef,
+ const char * name,
+ const char * cipher_key,
+ unsigned int *w,
+ unsigned int *h,
+ int * alpha,
+ int * comp,
+ int * quality,
+ int * lossy)
{
- unsigned int * d = NULL;
- void * data = NULL;
+ unsigned int *d = NULL;
+ void *data = NULL;
int free_data = 0;
int size;
} /* eet_data_image_read_cipher */
EAPI void *
-eet_data_image_read(Eet_File * ef,
- const char * name,
- unsigned int * w,
- unsigned int * h,
- int * alpha,
- int * comp,
- int * quality,
- int * lossy)
+eet_data_image_read(Eet_File * ef,
+ const char * name,
+ unsigned int *w,
+ unsigned int *h,
+ int * alpha,
+ int * comp,
+ int * quality,
+ int * lossy)
{
return eet_data_image_read_cipher(ef, name, NULL, w, h, alpha,
comp, quality, lossy);
} /* eet_data_image_read */
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 * comp,
- int * quality,
- int * lossy)
+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 * comp,
+ int * quality,
+ int * lossy)
{
- void * data = NULL;
+ void *data = NULL;
int free_data = 0;
int res = 1;
int size;
} /* eet_data_image_read_to_surface_cipher */
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 * comp,
- int * quality,
- int * lossy)
+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 * comp,
+ int * quality,
+ int * lossy)
{
return eet_data_image_read_to_surface_cipher(ef, name, NULL,
src_x, src_y, d,
} /* eet_data_image_read_to_surface */
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 * comp,
- int * quality,
- int * lossy)
+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 * comp,
+ int * quality,
+ int * lossy)
{
- void * data = NULL;
+ void *data = NULL;
int size = 0;
int free_data = 0;
int d;
} /* eet_data_image_header_read_cipher */
EAPI int
-eet_data_image_header_read(Eet_File * ef,
- const char * name,
- unsigned int * w,
- unsigned int * h,
- int * alpha,
- int * comp,
- int * quality,
- int * lossy)
+eet_data_image_header_read(Eet_File * ef,
+ const char * name,
+ unsigned int *w,
+ unsigned int *h,
+ int * alpha,
+ int * comp,
+ int * quality,
+ int * lossy)
{
return eet_data_image_header_read_cipher(ef, name, NULL,
w, h, alpha,
int lossy,
int * size_ret)
{
- void * d = NULL;
- void * ciphered_d = NULL;
+ void *d = NULL;
+ void *ciphered_d = NULL;
unsigned int ciphered_sz = 0;
int size = 0;
} /* eet_data_image_encode */
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 * comp,
- int * quality,
- int * lossy)
+eet_data_image_header_decode_cipher(const void * data,
+ const char * cipher_key,
+ int size,
+ unsigned int *w,
+ unsigned int *h,
+ int * alpha,
+ int * comp,
+ int * quality,
+ int * lossy)
{
int header[8];
- void * deciphered_d = NULL;
+ void *deciphered_d = NULL;
unsigned int deciphered_sz = 0;
if (cipher_key)
else if ((unsigned)header[0] == 0xbeeff00d)
{
unsigned int iw = 0, ih = 0;
- unsigned const char * dt;
+ unsigned const char *dt;
int sz1;
int ok;
} /* eet_data_image_header_decode_cipher */
EAPI int
-eet_data_image_header_decode(const void * data,
- int size,
- unsigned int * w,
- unsigned int * h,
- int * alpha,
- int * comp,
- int * quality,
- int * lossy)
+eet_data_image_header_decode(const void * data,
+ int size,
+ unsigned int *w,
+ unsigned int *h,
+ int * alpha,
+ int * comp,
+ int * quality,
+ int * lossy)
{
return eet_data_image_header_decode_cipher(data,
NULL,
} /* eet_data_image_header_decode */
static void
-_eet_data_image_copy_buffer(const unsigned int * src,
- unsigned int src_x,
- unsigned int src_y,
- unsigned int src_w,
- unsigned int * dst,
- unsigned int w,
- unsigned int h,
- unsigned int row_stride)
+_eet_data_image_copy_buffer(const unsigned int *src,
+ unsigned int src_x,
+ unsigned int src_y,
+ unsigned int src_w,
+ unsigned int * dst,
+ unsigned int w,
+ unsigned int h,
+ unsigned int row_stride)
{
src += src_x + src_y * src_w;
memcpy(dst, src, row_stride * h);
else
{
- unsigned int * over = dst;
+ unsigned int *over = dst;
unsigned int y;
for (y = 0; y < h; ++y, src += src_w, over += row_stride)
} /* _eet_data_image_copy_buffer */
static int
-_eet_data_image_decode_inside(const void * data,
- int size,
- unsigned int src_x,
- unsigned int src_y,
- unsigned int src_w,
- unsigned int src_h,
- unsigned int * d,
- unsigned int w,
- unsigned int h,
- unsigned int row_stride,
- int alpha,
- int comp,
- int quality,
- int lossy)
+_eet_data_image_decode_inside(const void * data,
+ int size,
+ unsigned int src_x,
+ unsigned int src_y,
+ unsigned int src_w,
+ unsigned int src_h,
+ unsigned int *d,
+ unsigned int w,
+ unsigned int h,
+ unsigned int row_stride,
+ int alpha,
+ int comp,
+ int quality,
+ int lossy)
{
if (lossy == 0 && quality == 100)
{
- unsigned int * body;
+ unsigned int *body;
body = ((unsigned int *)data) + 8;
if (!comp)
}
else
{
- Bytef * dtmp;
+ Bytef *dtmp;
uLongf dlen = src_w * src_h * 4;
/* FIXME: This could create a huge alloc. So compressed data and tile could not always work. */
{
if (alpha)
{
- unsigned const char * dt;
+ unsigned const char *dt;
int header[8];
int sz1, sz2;
} /* _eet_data_image_decode_inside */
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 * comp,
- int * quality,
- int * lossy)
+eet_data_image_decode_cipher(const void * data,
+ const char * cipher_key,
+ int size,
+ unsigned int *w,
+ unsigned int *h,
+ int * alpha,
+ int * comp,
+ int * quality,
+ int * lossy)
{
- unsigned int * d = NULL;
+ unsigned int *d = NULL;
unsigned int iw, ih;
int ialpha, icompress, iquality, ilossy;
- void * deciphered_d = NULL;
+ void *deciphered_d = NULL;
unsigned int deciphered_sz = 0;
if (cipher_key)
} /* eet_data_image_decode_cipher */
EAPI void *
-eet_data_image_decode(const void * data,
- int size,
- unsigned int * w,
- unsigned int * h,
- int * alpha,
- int * comp,
- int * quality,
- int * lossy)
+eet_data_image_decode(const void * data,
+ int size,
+ unsigned int *w,
+ unsigned int *h,
+ int * alpha,
+ int * comp,
+ int * quality,
+ int * lossy)
{
return eet_data_image_decode_cipher(data, NULL, size, w, h,
alpha, comp, quality, lossy);
} /* eet_data_image_decode */
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 * comp,
- int * quality,
- int * lossy)
+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 * comp,
+ int * quality,
+ int * lossy)
{
unsigned int iw, ih;
int ialpha, icompress, iquality, ilossy;
- void * deciphered_d = NULL;
+ void *deciphered_d = NULL;
unsigned int deciphered_sz = 0;
if (cipher_key)
} /* eet_data_image_decode_to_surface_cipher */
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 * comp,
- int * quality,
- int * lossy)
+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 * comp,
+ int * quality,
+ int * lossy)
{
return eet_data_image_decode_to_surface_cipher(data, NULL, size,
src_x, src_y, d,
#include "Eet_private.h"
static Eet_Version _version = { VMAJ, VMIN, VMIC, VREV };
-EAPI Eet_Version * eet_version = &_version;
+EAPI Eet_Version *eet_version = &_version;
#ifdef HAVE_REALPATH
# undef HAVE_REALPATH
struct _Eet_File
{
- char * path;
- FILE * readfp;
- Eet_File_Header * header;
- Eet_Dictionary * ed;
- Eet_Key * key;
- const unsigned char * data;
- const void * x509_der;
- const void * signature;
- void * sha1;
+ char * path;
+ FILE * readfp;
+ Eet_File_Header * header;
+ Eet_Dictionary * ed;
+ Eet_Key * key;
+ const unsigned char *data;
+ const void * x509_der;
+ const void * signature;
+ void * sha1;
+
+ Eet_File_Mode mode;
- Eet_File_Mode mode;
-
- int magic;
- int references;
+ int magic;
+ int references;
- int data_size;
- int x509_length;
- unsigned int signature_length;
- int sha1_length;
+ int data_size;
+ int x509_length;
+ unsigned int signature_length;
+ int sha1_length;
- time_t mtime;
+ time_t mtime;
#ifdef EFL_HAVE_THREADS
# ifdef EFL_HAVE_POSIX_THREADS
- pthread_mutex_t file_lock;
+ pthread_mutex_t file_lock;
# else /* ifdef EFL_HAVE_POSIX_THREADS */
- HANDLE file_lock;
+ HANDLE file_lock;
# endif /* ifdef EFL_HAVE_POSIX_THREADS */
#endif /* ifdef EFL_HAVE_THREADS */
- unsigned char writes_pending : 1;
- unsigned char delete_me_now : 1;
+ unsigned char writes_pending : 1;
+ unsigned char delete_me_now : 1;
};
struct _Eet_File_Header
{
- int magic;
- Eet_File_Directory * directory;
+ int magic;
+ Eet_File_Directory *directory;
};
struct _Eet_File_Directory
{
- int size;
- Eet_File_Node ** nodes;
+ int size;
+ Eet_File_Node **nodes;
};
struct _Eet_File_Node
{
- char * name;
- void * data;
- Eet_File_Node * next; /* FIXME: make buckets linked lists */
-
- int offset;
- int dictionary_offset;
- int name_offset;
-
- int name_size;
- int size;
- int data_size;
-
- unsigned char free_name : 1;
- unsigned char compression : 1;
- unsigned char ciphered : 1;
- unsigned char alias : 1;
+ char * name;
+ void * data;
+ Eet_File_Node *next; /* FIXME: make buckets linked lists */
+
+ int offset;
+ int dictionary_offset;
+ int name_offset;
+
+ int name_size;
+ int size;
+ int data_size;
+
+ unsigned char free_name : 1;
+ unsigned char compression : 1;
+ unsigned char ciphered : 1;
+ unsigned char alias : 1;
};
#if 0
EET_FILE2_DICTIONARY_ENTRY_COUNT)
/* prototypes of internal calls */
-static Eet_File * eet_cache_find(const char * path,
- Eet_File ** cache,
- int cache_num);
-static void eet_cache_add(Eet_File * ef,
- Eet_File *** cache,
- int * cache_num,
- int * cache_alloc);
-static void eet_cache_del(Eet_File * ef,
- Eet_File *** cache,
- int * cache_num,
- int * cache_alloc);
-static int eet_string_match(const char * s1, const char * s2);
+static Eet_File * eet_cache_find(const char *path,
+ Eet_File ** cache,
+ int cache_num);
+static void eet_cache_add(Eet_File * ef,
+ Eet_File ***cache,
+ int * cache_num,
+ int * cache_alloc);
+static void eet_cache_del(Eet_File * ef,
+ Eet_File ***cache,
+ int * cache_num,
+ int * cache_alloc);
+static int eet_string_match(const char *s1, const char *s2);
#if 0 /* Unused */
-static Eet_Error eet_flush(Eet_File * ef);
+static Eet_Error eet_flush(Eet_File *ef);
#endif /* if 0 */
-static Eet_Error eet_flush2(Eet_File * ef);
-static Eet_File_Node * find_node_by_name(Eet_File * ef, const char * name);
-static int read_data_from_disk(Eet_File * ef,
- Eet_File_Node * efn,
- void * buf,
- int len);
+static Eet_Error eet_flush2(Eet_File *ef);
+static Eet_File_Node * find_node_by_name(Eet_File *ef, const char *name);
+static int read_data_from_disk(Eet_File * ef,
+ Eet_File_Node *efn,
+ void * buf,
+ int len);
-static Eet_Error eet_internal_close(Eet_File * ef, Eina_Bool locked);
+static Eet_Error eet_internal_close(Eet_File *ef, Eina_Bool locked);
#ifdef EFL_HAVE_THREADS
/* cache. i don't expect this to ever be large, so arrays will do */
static int eet_writers_num = 0;
static int eet_writers_alloc = 0;
-static Eet_File ** eet_writers = NULL;
+static Eet_File **eet_writers = NULL;
static int eet_readers_num = 0;
static int eet_readers_alloc = 0;
-static Eet_File ** eet_readers = NULL;
+static Eet_File **eet_readers = NULL;
static int eet_init_count = 0;
/* log domain variable */
/* Check to see its' an eet file pointer */
static inline int
-eet_check_pointer(const Eet_File * ef)
+eet_check_pointer(const Eet_File *ef)
{
if ((!ef) || (ef->magic != EET_MAGIC_FILE))
return 1;
} /* eet_check_pointer */
static inline int
-eet_check_header(const Eet_File * ef)
+eet_check_header(const Eet_File *ef)
{
if (!ef->header)
return 1;
} /* eet_check_header */
static inline int
-eet_test_close(int test,
- Eet_File * ef)
+eet_test_close(int test,
+ Eet_File *ef)
{
if (test)
{
/* find an eet file in the currently in use cache */
static Eet_File *
-eet_cache_find(const char * path,
- Eet_File ** cache,
- int cache_num)
+eet_cache_find(const char *path,
+ Eet_File ** cache,
+ int cache_num)
{
int i;
/* add to end of cache */
/* this should only be called when the cache lock is already held */
static void
-eet_cache_add(Eet_File * ef,
- Eet_File *** cache,
- int * cache_num,
- int * cache_alloc)
+eet_cache_add(Eet_File * ef,
+ Eet_File ***cache,
+ int * cache_num,
+ int * cache_alloc)
{
- Eet_File ** new_cache;
+ Eet_File **new_cache;
int new_cache_num;
int new_cache_alloc;
new_cache_num = *cache_num;
if (new_cache_num >= 64) /* avoid fd overruns - limit to 128 (most recent) in the cache */
{
- Eet_File * del_ef = NULL;
+ Eet_File *del_ef = NULL;
int i;
new_cache = *cache;
/* delete from cache */
/* this should only be called when the cache lock is already held */
static void
-eet_cache_del(Eet_File * ef,
- Eet_File *** cache,
- int * cache_num,
- int * cache_alloc)
+eet_cache_del(Eet_File * ef,
+ Eet_File ***cache,
+ int * cache_num,
+ int * cache_alloc)
{
- Eet_File ** new_cache;
+ Eet_File **new_cache;
int new_cache_num, new_cache_alloc;
int i, j;
/* internal string match. null friendly, catches same ptr */
static int
-eet_string_match(const char * s1,
- const char * s2)
+eet_string_match(const char *s1,
+ const char *s2)
{
/* both null- no match */
if ((!s1) || (!s2))
/* flush out writes to a v2 eet file */
static Eet_Error
-eet_flush2(Eet_File * ef)
+eet_flush2(Eet_File *ef)
{
- Eet_File_Node * efn;
- FILE * fp;
+ Eet_File_Node *efn;
+ FILE *fp;
Eet_Error error = EET_ERROR_NONE;
int head[EET_FILE2_HEADER_COUNT];
int num_directory_entries = 0;
} /* eet_shutdown */
EAPI Eet_Error
-eet_sync(Eet_File * ef)
+eet_sync(Eet_File *ef)
{
Eet_Error ret;
if (num > 0)
{
- Eet_File ** closelist = NULL;
+ Eet_File **closelist = NULL;
closelist = alloca(num * sizeof(Eet_File *));
num = 0;
/* FIXME: MMAP race condition in READ_WRITE_MODE */
static Eet_File *
-eet_internal_read2(Eet_File * ef)
+eet_internal_read2(Eet_File *ef)
{
- const int * data = (const int *)ef->data;
- const char * start = (const char *)ef->data;
+ const int *data = (const int *)ef->data;
+ const char *start = (const char *)ef->data;
int idx = 0;
int num_directory_entries;
int bytes_directory_entries;
/* actually read the directory block - all of it, into ram */
for (i = 0; i < num_directory_entries; ++i)
{
- const char * name;
- Eet_File_Node * efn;
+ const char *name;
+ Eet_File_Node *efn;
int name_offset;
int name_size;
int hash;
if (num_dictionary_entries)
{
- const int * dico = (const int *)ef->data +
+ const int *dico = (const int *)ef->data +
EET_FILE2_DIRECTORY_ENTRY_COUNT * num_directory_entries +
EET_FILE2_HEADER_COUNT;
int j;
if (signature_base_offset < ef->data_size)
{
#ifdef HAVE_SIGNATURE
- const unsigned char * buffer = ((const unsigned char *)ef->data) +
+ const unsigned char *buffer = ((const unsigned char *)ef->data) +
signature_base_offset;
ef->x509_der = eet_identity_check(ef->data,
signature_base_offset,
#if EET_OLD_EET_FILE_FORMAT
static Eet_File *
-eet_internal_read1(Eet_File * ef)
+eet_internal_read1(Eet_File *ef)
{
- const unsigned char * dyn_buf = NULL;
- const unsigned char * p = NULL;
+ const unsigned char *dyn_buf = NULL;
+ const unsigned char *p = NULL;
int idx = 0;
int num_entries;
int byte_entries;
for (i = 0; i < num_entries; i++)
{
- Eet_File_Node * efn;
- void * data = NULL;
+ Eet_File_Node *efn;
+ void *data = NULL;
int indexn = 0;
int name_size;
int hash;
* to just require that it is always held.)
*/
static Eet_File *
-eet_internal_read(Eet_File * ef)
+eet_internal_read(Eet_File *ef)
{
- const int * data = (const int *)ef->data;
+ const int *data = (const int *)ef->data;
if (eet_test_close((ef->data == (void *)-1) || (ef->data == NULL), ef))
return NULL;
} /* eet_internal_read */
static Eet_Error
-eet_internal_close(Eet_File * ef,
- Eina_Bool locked)
+eet_internal_close(Eet_File *ef,
+ Eina_Bool locked)
{
Eet_Error err;
num = (1 << ef->header->directory->size);
for (i = 0; i < num; i++)
{
- Eet_File_Node * efn;
+ Eet_File_Node *efn;
while ((efn = ef->header->directory->nodes[i]))
{
} /* eet_internal_close */
EAPI Eet_File *
-eet_memopen_read(const void * data,
- size_t size)
+eet_memopen_read(const void *data,
+ size_t size)
{
- Eet_File * ef;
+ Eet_File *ef;
if (data == NULL || size == 0)
return NULL;
eet_open(const char * file,
Eet_File_Mode mode)
{
- FILE * fp;
- Eet_File * ef;
+ FILE *fp;
+ Eet_File *ef;
int file_len;
struct stat file_stat;
} /* eet_open */
EAPI Eet_File_Mode
-eet_mode_get(Eet_File * ef)
+eet_mode_get(Eet_File *ef)
{
/* check to see its' an eet file pointer */
if ((!ef) || (ef->magic != EET_MAGIC_FILE))
} /* eet_mode_get */
EAPI const void *
-eet_identity_x509(Eet_File * ef,
- int * der_length)
+eet_identity_x509(Eet_File *ef,
+ int * der_length)
{
if (!ef->x509_der)
return NULL;
} /* eet_identity_x509 */
EAPI const void *
-eet_identity_signature(Eet_File * ef,
- int * signature_length)
+eet_identity_signature(Eet_File *ef,
+ int * signature_length)
{
if (!ef->signature)
return NULL;
} /* eet_identity_signature */
EAPI const void *
-eet_identity_sha1(Eet_File * ef,
- int * sha1_length)
+eet_identity_sha1(Eet_File *ef,
+ int * sha1_length)
{
if (!ef->sha1)
ef->sha1 = eet_identity_compute_sha1(ef->data,
} /* eet_identity_sha1 */
EAPI Eet_Error
-eet_identity_set(Eet_File * ef,
- Eet_Key * key)
+eet_identity_set(Eet_File *ef,
+ Eet_Key * key)
{
- Eet_Key * tmp = ef->key;
+ Eet_Key *tmp = ef->key;
if (!ef)
return EET_ERROR_BAD_OBJECT;
} /* eet_identity_set */
EAPI Eet_Error
-eet_close(Eet_File * ef)
+eet_close(Eet_File *ef)
{
return eet_internal_close(ef, EINA_FALSE);
} /* eet_close */
EAPI void *
-eet_read_cipher(Eet_File * ef,
- const char * name,
- int * size_ret,
- const char * cipher_key)
+eet_read_cipher(Eet_File * ef,
+ const char *name,
+ int * size_ret,
+ const char *cipher_key)
{
- Eet_File_Node * efn;
- char * data = NULL;
+ Eet_File_Node *efn;
+ char *data = NULL;
int size = 0;
if (size_ret)
/* uncompressed data */
if (efn->compression == 0)
{
- void * data_deciphered = NULL;
+ void *data_deciphered = NULL;
unsigned int data_deciphered_sz = 0;
/* if we alreayd have the data in ram... copy that */
/* compressed data */
else
{
- void * tmp_data;
- void * data_deciphered = NULL;
+ void *tmp_data;
+ void *data_deciphered = NULL;
unsigned int data_deciphered_sz = 0;
int free_tmp = 0;
int compr_size = efn->size;
/* handle alias */
if (efn->alias)
{
- void * tmp;
+ void *tmp;
if (data[size - 1] != '\0')
goto on_error;
} /* eet_read_cipher */
EAPI void *
-eet_read(Eet_File * ef,
- const char * name,
- int * size_ret)
+eet_read(Eet_File * ef,
+ const char *name,
+ int * size_ret)
{
return eet_read_cipher(ef, name, size_ret, NULL);
} /* eet_read */
EAPI const void *
-eet_read_direct(Eet_File * ef,
- const char * name,
- int * size_ret)
+eet_read_direct(Eet_File * ef,
+ const char *name,
+ int * size_ret)
{
- Eet_File_Node * efn;
- const char * data = NULL;
+ Eet_File_Node *efn;
+ const char *data = NULL;
int size = 0;
if (size_ret)
/* handle alias case */
if (efn->compression)
{
- char * tmp;
+ char *tmp;
int compr_size = efn->size;
uLongf dlen;
} /* eet_read_direct */
EAPI Eina_Bool
-eet_alias(Eet_File * ef,
- const char * name,
- const char * destination,
- int comp)
+eet_alias(Eet_File * ef,
+ const char *name,
+ const char *destination,
+ int comp)
{
- Eet_File_Node * efn;
- void * data2;
+ Eet_File_Node *efn;
+ void *data2;
Eina_Bool exists_already = EINA_FALSE;
int data_size;
int hash;
}
else
{
- void * data3;
+ void *data3;
data3 = realloc(data2, data_size);
if (data3)
} /* eet_alias */
EAPI int
-eet_write_cipher(Eet_File * ef,
- const char * name,
- const void * data,
- int size,
- int comp,
- const char * cipher_key)
+eet_write_cipher(Eet_File * ef,
+ const char *name,
+ const void *data,
+ int size,
+ int comp,
+ const char *cipher_key)
{
- Eet_File_Node * efn;
- void * data2 = NULL;
+ Eet_File_Node *efn;
+ void *data2 = NULL;
int exists_already = 0;
int data_size;
int hash;
}
else
{
- void * data3;
+ void *data3;
data3 = realloc(data2, data_size);
if (data3)
if (cipher_key)
{
- void * data_ciphered = NULL;
+ void *data_ciphered = NULL;
unsigned int data_ciphered_sz = 0;
- const void * tmp;
+ const void *tmp;
tmp = data2 ? data2 : data;
if (!eet_cipher(tmp, data_size, cipher_key, strlen(cipher_key),
} /* eet_write_cipher */
EAPI int
-eet_write(Eet_File * ef,
- const char * name,
- const void * data,
- int size,
- int comp)
+eet_write(Eet_File * ef,
+ const char *name,
+ const void *data,
+ int size,
+ int comp)
{
return eet_write_cipher(ef, name, data, size, comp, NULL);
} /* eet_write */
EAPI int
-eet_delete(Eet_File * ef,
- const char * name)
+eet_delete(Eet_File * ef,
+ const char *name)
{
- Eet_File_Node * efn;
- Eet_File_Node * pefn;
+ Eet_File_Node *efn;
+ Eet_File_Node *pefn;
int hash;
int exists_already = 0;
} /* eet_delete */
EAPI Eet_Dictionary *
-eet_dictionary_get(Eet_File * ef)
+eet_dictionary_get(Eet_File *ef)
{
if (eet_check_pointer(ef))
return NULL;
} /* eet_dictionary_get */
EAPI char **
-eet_list(Eet_File * ef,
- const char * glob,
- int * count_ret)
+eet_list(Eet_File * ef,
+ const char *glob,
+ int * count_ret)
{
- Eet_File_Node * efn;
- char ** list_ret = NULL;
+ Eet_File_Node *efn;
+ char **list_ret = NULL;
int list_count = 0;
int list_count_alloc = 0;
int i, num;
/* only realloc in 32 entry chunks */
if (list_count > list_count_alloc)
{
- char ** new_list = NULL;
+ char **new_list = NULL;
list_count_alloc += 64;
new_list =
} /* eet_list */
EAPI int
-eet_num_entries(Eet_File * ef)
+eet_num_entries(Eet_File *ef)
{
int i, num, ret = 0;
- Eet_File_Node * efn;
+ Eet_File_Node *efn;
/* check to see its' an eet file pointer */
if (eet_check_pointer(ef) || eet_check_header(ef) ||
} /* eet_num_entries */
static Eet_File_Node *
-find_node_by_name(Eet_File * ef,
- const char * name)
+find_node_by_name(Eet_File * ef,
+ const char *name)
{
- Eet_File_Node * efn;
+ Eet_File_Node *efn;
int hash;
/* get hash bucket this should be in */
} /* find_node_by_name */
static int
-read_data_from_disk(Eet_File * ef,
- Eet_File_Node * efn,
- void * buf,
- int len)
+read_data_from_disk(Eet_File * ef,
+ Eet_File_Node *efn,
+ void * buf,
+ int len)
{
if (efn->offset < 0)
return 0;
#include "Eet.h"
#include "Eet_private.h"
-static Eina_Mempool * _eet_node_mp = NULL;
+static Eina_Mempool *_eet_node_mp = NULL;
Eet_Node *
eet_node_new(void)
{
- Eet_Node * result;
+ Eet_Node *result;
result = eina_mempool_malloc(_eet_node_mp, sizeof (Eet_Node));
if (!result)
} /* eet_node_new */
void
-eet_node_free(Eet_Node * node)
+eet_node_free(Eet_Node *node)
{
eina_mempool_free(_eet_node_mp, node);
} /* eet_node_free */
static Eet_Node *
-_eet_node_new(const char * name,
- int type)
+_eet_node_new(const char *name,
+ int type)
{
- Eet_Node * n;
+ Eet_Node *n;
n = eet_node_new();
if (!n)
} /* _eet_node_new */
static void
-_eet_node_append(Eet_Node * n, Eina_List * nodes)
+_eet_node_append(Eet_Node *n, Eina_List *nodes)
{
- Eet_Node * value;
- Eina_List * l;
+ Eet_Node *value;
+ Eina_List *l;
EINA_LIST_REVERSE_FOREACH(nodes, l, value)
{
#define EET_NODE_NEW(Eet_type, Name, Value, Type)\
EAPI Eet_Node *\
- eet_node_ ## Name ## _new(const char * name, Type Value)\
+ eet_node_ ## Name ## _new(const char *name, Type Value)\
{\
- Eet_Node * n;\
+ Eet_Node *n;\
\
n = _eet_node_new(name, Eet_type);\
if (!n) { return NULL; }\
#define EET_NODE_STR_NEW(Eet_type, Name, Value, Type)\
EAPI Eet_Node *\
- eet_node_ ## Name ## _new(const char * name, Type Value)\
+ eet_node_ ## Name ## _new(const char *name, Type Value)\
{\
- Eet_Node * n;\
+ Eet_Node *n;\
\
n = _eet_node_new(name, Eet_type);\
if (!n) { return NULL; }\
EET_NODE_STR_NEW(EET_T_INLINED_STRING, inlined_string, str, const char *)
Eet_Node *
-eet_node_null_new(const char * name)
+eet_node_null_new(const char *name)
{
- Eet_Node * n;
+ Eet_Node *n;
n = _eet_node_new(name, EET_T_NULL);
if (!n)
}
Eet_Node *
-eet_node_list_new(const char * name,
- Eina_List * nodes)
+eet_node_list_new(const char *name,
+ Eina_List * nodes)
{
- Eet_Node * n;
+ Eet_Node *n;
n = _eet_node_new(name, EET_G_LIST);
if (!n)
} /* eet_node_list_new */
Eet_Node *
-eet_node_array_new(const char * name,
- int count,
- Eina_List * nodes)
+eet_node_array_new(const char *name,
+ int count,
+ Eina_List * nodes)
{
- Eet_Node * n;
+ Eet_Node *n;
n = _eet_node_new(name, EET_G_ARRAY);
if (!n)
} /* eet_node_array_new */
Eet_Node *
-eet_node_var_array_new(const char * name,
- Eina_List * nodes)
+eet_node_var_array_new(const char *name,
+ Eina_List * nodes)
{
- Eet_Node * n;
+ Eet_Node *n;
n = _eet_node_new(name, EET_G_VAR_ARRAY);
if (!n)
} /* eet_node_var_array_new */
Eet_Node *
-eet_node_hash_new(const char * name,
- const char * key,
- Eet_Node * node)
+eet_node_hash_new(const char *name,
+ const char *key,
+ Eet_Node * node)
{
- Eina_List * nodes;
- Eet_Node * n;
+ Eina_List *nodes;
+ Eet_Node *n;
if (!node)
return NULL;
} /* eet_node_hash_new */
Eet_Node *
-eet_node_struct_new(const char * name,
- Eina_List * nodes)
+eet_node_struct_new(const char *name,
+ Eina_List * nodes)
{
- Eet_Node * n;
+ Eet_Node *n;
n = _eet_node_new(name, EET_G_UNKNOWN);
if (!n)
} /* eet_node_struct_new */
Eet_Node *
-eet_node_struct_child_new(const char * parent,
- Eet_Node * child)
+eet_node_struct_child_new(const char *parent,
+ Eet_Node * child)
{
- Eet_Node * n;
+ Eet_Node *n;
if (child->type != EET_G_UNKNOWN)
return child;
} /* eet_node_struct_child_new */
void
-eet_node_list_append(Eet_Node * parent,
- const char * name,
- Eet_Node * child)
+eet_node_list_append(Eet_Node * parent,
+ const char *name,
+ Eet_Node * child)
{
- const char * tmp;
- Eet_Node * nn;
+ const char *tmp;
+ Eet_Node *nn;
tmp = eina_stringshare_add(name);
for (nn = parent->values; nn; nn = nn->next)
if (nn->name == tmp && nn->type == EET_G_LIST)
{
- Eet_Node * n;
+ Eet_Node *n;
if (!nn->values)
nn->values = child;
} /* eet_node_list_append */
void
-eet_node_struct_append(Eet_Node * parent,
- const char * name,
- Eet_Node * child)
+eet_node_struct_append(Eet_Node * parent,
+ const char *name,
+ Eet_Node * child)
{
- const char * tmp;
- Eet_Node * prev;
- Eet_Node * nn;
+ const char *tmp;
+ Eet_Node *prev;
+ Eet_Node *nn;
if (parent->type != EET_G_UNKNOWN)
{
} /* eet_node_struct_append */
void
-eet_node_hash_add(Eet_Node * parent,
- const char * name,
- const char * key,
- Eet_Node * child)
+eet_node_hash_add(Eet_Node * parent,
+ const char *name,
+ const char *key,
+ Eet_Node * child)
{
- Eet_Node * nn;
+ Eet_Node *nn;
/* No list found, so create it. */
nn = eet_node_hash_new(name, key, child);
} /* eet_node_hash_add */
void
-eet_node_del(Eet_Node * n)
+eet_node_del(Eet_Node *n)
{
- Eet_Node * nn;
- Eet_Node * tmp;
+ Eet_Node *nn;
+ Eet_Node *tmp;
if (!n)
return;
eet_node_free(n);
} /* eet_node_del */
-static const char * eet_node_dump_g_name[6] = {
+static const char *eet_node_dump_g_name[6] = {
"struct",
"array",
"var_array",
"???"
};
-static const char * eet_node_dump_t_name[14][2] = {
+static const char *eet_node_dump_t_name[14][2] = {
{ "???: ", "???" },
{ "char: ", "%hhi" },
{ "short: ", "%hi" },
static void
eet_node_dump_level(int level,
- void (* dumpfunc)(void * data, const char * str),
- void * dumpdata)
+ void (*dumpfunc)(void *data, const char *str),
+ void *dumpdata)
{
int i;
} /* eet_node_dump_level */
static char *
-eet_node_string_escape(const char * str)
+eet_node_string_escape(const char *str)
{
- char * s, * sp;
- const char * strp;
+ char *s, *sp;
+ const char *strp;
int sz = 0;
for (strp = str; *strp; strp++)
} /* eet_node_string_escape */
static void
-eet_node_dump_string_escape(void * dumpdata,
- void dumpfunc(void * data, const char * str),
- const char * str)
+eet_node_dump_string_escape(void *dumpdata,
+ void dumpfunc(void *data, const char *str),
+ const char *str)
{
- char * s;
+ char *s;
s = eet_node_string_escape(str);
if (!s)
} /* eet_node_dump_string_escape */
static void
-eet_node_dump_simple_type(Eet_Node * n, int level,
- void (* dumpfunc)(void * data, const char * str),
- void * dumpdata)
+eet_node_dump_simple_type(Eet_Node *n, int level,
+ void (*dumpfunc)(void *data, const char *str),
+ void *dumpdata)
{
- const char * type_name = NULL;
+ const char *type_name = NULL;
char tbuf[256];
eet_node_dump_level(level, dumpfunc, dumpdata);
static void
eet_node_dump_group_start(int level,
- void (* dumpfunc)(void * data, const char * str),
- void * dumpdata,
+ void (*dumpfunc)(void *data, const char *str),
+ void *dumpdata,
int group_type,
- const char * name)
+ const char *name)
{
int chnk_type;
static void
eet_node_dump_group_end(int level,
- void (* dumpfunc)(void * data, const char * str),
- void * dumpdata)
+ void (*dumpfunc)(void *data, const char *str),
+ void *dumpdata)
{
eet_node_dump_level(level, dumpfunc, dumpdata);
dumpfunc(dumpdata, "}\n");
} /* eet_node_dump_group_end */
void
-eet_node_dump(Eet_Node * n,
+eet_node_dump(Eet_Node *n,
int dumplevel,
- void (* dumpfunc)(void * data, const char * str),
- void * dumpdata)
+ void (*dumpfunc)(void *data, const char *str),
+ void *dumpdata)
{
- Eet_Node * it;
+ Eet_Node *it;
if (!n)
return;
} /* eet_node_dump */
void *
-eet_node_walk(void * parent,
- const char * name,
- Eet_Node * root,
- Eet_Node_Walk * cb,
- void * user_data)
+eet_node_walk(void * parent,
+ const char * name,
+ Eet_Node * root,
+ Eet_Node_Walk *cb,
+ void * user_data)
{
- Eet_Node * it;
- void * me = NULL;
+ Eet_Node *it;
+ void *me = NULL;
int i;
if (!root)
int
eet_node_init(void)
{
- const char * choice;
- const char * tmp;
+ const char *choice;
+ const char *tmp;
choice = "chained_mempool";
tmp = getenv("EET_MEMPOOL");
#include "Eet_private.h"
int
-_eet_hash_gen(const char * key,
- int hash_size)
+_eet_hash_gen(const char *key,
+ int hash_size)
{
int hash_num = 0;
int value, i;
int mask;
- unsigned char * ptr;
+ unsigned char *ptr;
/* no string - index 0 */
if (!key)