Poster of Linux kernelThe best gift for a Linux geek
Eet.h

Eet.h

Section: C Library Functions (3) Updated: Wed Dec 8 2010
Local index Up
 

NAME

Eet.h -

The file that provides the eet functions.

 

SYNOPSIS


 

Data Structures


struct _Eet_Data_Descriptor_Class
Instructs Eet about memory management for different needs under serialization and parse process.
struct _Eet_Node_Data
Contains an union that can fit any kind of node.
struct _Eet_Node_Walk
Describes how to walk trees of Eet_Node.  

Defines


#define EET_T_UNKNOW 0
Unknown data encoding type.
#define EET_T_CHAR 1
Data type: char.
#define EET_T_SHORT 2
Data type: short.
#define EET_T_INT 3
Data type: int.
#define EET_T_LONG_LONG 4
Data type: long long.
#define EET_T_FLOAT 5
Data type: float.
#define EET_T_DOUBLE 6
Data type: double.
#define EET_T_UCHAR 7
Data type: unsigned char.
#define EET_T_USHORT 8
Data type: unsigned short.
#define EET_T_UINT 9
Data type: unsigned int.
#define EET_T_ULONG_LONG 10
Data type: unsigned long long.
#define EET_T_STRING 11
Data type: char *.
#define EET_T_INLINED_STRING 12
Data type: char * (but compressed inside the resulting eet)
#define EET_T_NULL 13
Data type: (void *) (only use it if you know why)
#define EET_T_F32P32 14
Data type: fixed point 32.32.
#define EET_T_F16P16 15
Data type: fixed point 16.16.
#define EET_T_F8P24 16
Data type: fixed point 8.24.
#define EET_T_LAST 18
Last data type.
#define EET_G_UNKNOWN 100
Unknown group data encoding type.
#define EET_G_ARRAY 101
Fixed size array group type.
#define EET_G_VAR_ARRAY 102
Variable size array group type.
#define EET_G_LIST 103
Linked list group type.
#define EET_G_HASH 104
Hash table group type.
#define EET_G_UNION 105
Union group type.
#define EET_G_VARIANT 106
Selectable subtype group.
#define EET_G_LAST 107
Last group type.
#define EET_I_LIMIT 128
Other type exist but are reserved for internal purpose.
#define EET_DATA_DESCRIPTOR_CLASS_VERSION 3
The version of Eet_Data_Descriptor_Class at the time of the distribution of the sources.
#define EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(Clas, Type) (eet_eina_stream_data_descriptor_class_set(Clas, #Type , sizeof (Type)))
This macro is an helper that set all the parameter of an Eet_Data_Descriptor_Class correctly when you use Eina data type with stream.
#define EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(Clas, Type) (eet_eina_file_data_descriptor_class_set(Clas, #Type , sizeof (Type)))
This macro is an helper that set all the parameter of an Eet_Data_Descriptor_Class correctly when you use Eina data type with file.
#define EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct_type, name, member, type)
Add a basic data element to a data descriptor.
#define EET_DATA_DESCRIPTOR_ADD_SUB(edd, struct_type, name, member, subtype)
Add a sub-element type to a data descriptor.
#define EET_DATA_DESCRIPTOR_ADD_LIST(edd, struct_type, name, member, subtype)
Add a linked list type to a data descriptor.
#define EET_DATA_DESCRIPTOR_ADD_HASH(edd, struct_type, name, member, subtype)
Add a hash type to a data descriptor.
#define EET_DATA_DESCRIPTOR_ADD_ARRAY(edd, struct_type, name, member, subtype)
Add a fixed size array type to a data descriptor.
#define EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY(edd, struct_type, name, member, subtype)
Add a variable size array type to a data descriptor.
#define EET_DATA_DESCRIPTOR_ADD_UNION(edd, struct_type, name, member, type_member, unified_type)
Add an union type to a data descriptor.
#define EET_DATA_DESCRIPTOR_ADD_VARIANT(edd, struct_type, name, member, type_member, unified_type)
Add a automatically selectable type to a data descriptor.
#define EET_DATA_DESCRIPTOR_ADD_MAPPING(unified_type, name, subtype) eet_data_descriptor_element_add(unified_type, name, EET_T_UNKNOW, EET_G_UNKNOWN, 0, 0, NULL, subtype);
Add a mapping to a data descriptor that will be used by union, variant or inherited type.  

Typedefs


typedef struct _Eet_Version Eet_Version
This is the Eet version information structure that can be used at runtiime to detect which version of eet is being used and adapt appropriately as follows for example:
typedef enum _Eet_Error Eet_Error
Eet error identifiers.
typedef enum _Eet_File_Mode Eet_File_Mode
Modes that a file can be opened.
typedef struct _Eet_File Eet_File
Opaque handle that defines an Eet file (or memory).
typedef struct _Eet_Dictionary Eet_Dictionary
Opaque handle that defines a file-backed (mmaped) dictionary of strings.
typedef struct _Eet_Key Eet_Key
Opaque handle that defines an identity (also known as key) in Eet's cipher system.
typedef int(* Eet_Key_Password_Callback )(char *buffer, int size, int rwflag, void *data)
Callback used to request if needed the password of a private key.
typedef struct _Eet_Data_Descriptor Eet_Data_Descriptor
Opaque handle that have information on a type members.
typedef struct _Eet_Data_Descriptor_Class Eet_Data_Descriptor_Class
Instructs Eet about memory management for different needs under serialization and parse process.
typedef struct _Eet_Node Eet_Node
Opaque handle to manage serialization node.
typedef struct _Eet_Node_Data Eet_Node_Data
Contains an union that can fit any kind of node.
typedef struct _Eet_Node_Walk Eet_Node_Walk
Describes how to walk trees of Eet_Node.
typedef struct _Eet_Connection Eet_Connection
Opaque handle to track paquet for a specific connection.
typedef Eina_Bool Eet_Read_Cb (const void *eet_data, size_t size, void *user_data)
Called back when an Eet Data Serialization has been received completly and could be used.
typedef Eina_Bool Eet_Write_Cb (const void *data, size_t size, void *user_data)
Called back when a packet containing Eet Data Serialization data is ready to be send.  

Enumerations


enum _Eet_Error { EET_ERROR_NONE, EET_ERROR_BAD_OBJECT, EET_ERROR_EMPTY, EET_ERROR_NOT_WRITABLE, EET_ERROR_OUT_OF_MEMORY, EET_ERROR_WRITE_ERROR, EET_ERROR_WRITE_ERROR_FILE_TOO_BIG, EET_ERROR_WRITE_ERROR_IO_ERROR, EET_ERROR_WRITE_ERROR_OUT_OF_SPACE, EET_ERROR_WRITE_ERROR_FILE_CLOSED, EET_ERROR_MMAP_FAILED, EET_ERROR_X509_ENCODING_FAILED, EET_ERROR_SIGNATURE_FAILED, EET_ERROR_INVALID_SIGNATURE, EET_ERROR_NOT_SIGNED, EET_ERROR_NOT_IMPLEMENTED, EET_ERROR_PRNG_NOT_SEEDED, EET_ERROR_ENCRYPT_FAILED, EET_ERROR_DECRYPT_FAILED }
All the error identifiers known by Eet.
enum _Eet_File_Mode { , EET_FILE_MODE_READ, EET_FILE_MODE_WRITE, EET_FILE_MODE_READ_WRITE }
Modes that a file can be opened.  

Functions


EAPI int eet_init (void)
Initialize the EET library.
EAPI int eet_shutdown (void)
Shut down the EET library.
EAPI void eet_clearcache (void)
Clear eet cache.
EAPI Eet_File * eet_open (const char *file, Eet_File_Mode mode)
Open an eet file on disk, and returns a handle to it.
EAPI Eet_File * eet_memopen_read (const void *data, size_t size)
Open an eet file directly from a memory location.
EAPI Eet_File_Mode eet_mode_get (Eet_File *ef)
Get the mode an Eet_File was opened with.
EAPI Eet_Error eet_close (Eet_File *ef)
Close an eet file handle and flush and writes pending.
EAPI Eet_Error eet_sync (Eet_File *ef)
Sync content of an eet file handle, flushing pending writes.
EAPI Eet_Dictionary * eet_dictionary_get (Eet_File *ef)
Return a handle to the shared string dictionary of the Eet file.
EAPI int eet_dictionary_string_check (Eet_Dictionary *ed, const char *string)
Check if a given string comes from a given dictionary.
EAPI void * eet_read (Eet_File *ef, const char *name, int *size_ret)
Read a specified entry from an eet file and return data.
EAPI const void * eet_read_direct (Eet_File *ef, const char *name, int *size_ret)
Read a specified entry from an eet file and return data.
EAPI int eet_write (Eet_File *ef, const char *name, const void *data, int size, int compress)
Write a specified entry to an eet file handle.
EAPI int eet_delete (Eet_File *ef, const char *name)
Delete a specified entry from an Eet file being written or re-written.
EAPI char ** eet_list (Eet_File *ef, const char *glob, int *count_ret)
List all entries in eet file matching shell glob.
EAPI int eet_num_entries (Eet_File *ef)
Return the number of entries in the specified eet file.
EAPI void * eet_read_cipher (Eet_File *ef, const char *name, int *size_ret, const char *cipher_key)
Read a specified entry from an eet file and return data using a cipher.
EAPI int eet_write_cipher (Eet_File *ef, const char *name, const void *data, int size, int compress, const char *cipher_key)
Write a specified entry to an eet file handle using a cipher.
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 just the header data for an image and dont decode the pixels.
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.
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)
Read image data from the named key in the eet file.
EAPI int eet_data_image_write (Eet_File *ef, const char *name, const void *data, unsigned int w, unsigned int h, int alpha, int compress, int quality, int lossy)
Write image data to the named key in an eet file.
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 header only to get information.
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.
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)
Decode Image data into pixel data.
EAPI void * eet_data_image_encode (const void *data, int *size_ret, unsigned int w, unsigned int h, int alpha, int compress, int quality, int lossy)
Encode image data for storage or transmission.
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 just the header data for an image and dont decode the pixels using a cipher.
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.
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)
Read image data from the named key in the eet file using a cipher.
EAPI int eet_data_image_write_cipher (Eet_File *ef, const char *name, const char *cipher_key, const void *data, unsigned int w, unsigned int h, int alpha, int compress, int quality, int lossy)
Write image data to the named key in an eet file using a cipher.
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 header only to get information using a cipher.
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.
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)
Decode Image data into pixel data using a cipher.
EAPI void * eet_data_image_encode_cipher (const void *data, const char *cipher_key, unsigned int w, unsigned int h, int alpha, int compress, int quality, int lossy, int *size_ret)
Encode image data for storage or transmission using a cipher.
EAPI Eet_Key * eet_identity_open (const char *certificate_file, const char *private_key_file, Eet_Key_Password_Callback cb)
Create an Eet_Key needed for signing an eet file.
EAPI void eet_identity_close (Eet_Key *key)
Close and release all ressource used by an Eet_Key.
EAPI Eet_Error eet_identity_set (Eet_File *ef, Eet_Key *key)
Set a key to sign a file.
EAPI void eet_identity_print (Eet_Key *key, FILE *out)
Display both private and public key of an Eet_Key.
EAPI const void * eet_identity_x509 (Eet_File *ef, int *der_length)
Get the x509 der certificate associated with an Eet_File.
EAPI const void * eet_identity_signature (Eet_File *ef, int *signature_length)
Get the raw signature associated with an Eet_File.
EAPI const void * eet_identity_sha1 (Eet_File *ef, int *sha1_length)
Get the SHA1 associated with a file.
EAPI void eet_identity_certificate_print (const unsigned char *certificate, int der_length, FILE *out)
Display the x509 der certificate to out.
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))
Create a new empty data structure descriptor.
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 new data descriptor.
EAPI Eet_Data_Descriptor * eet_data_descriptor_file_new (const Eet_Data_Descriptor_Class *eddc)
This function creates a new data descriptore and returns a handle to the new data descriptor.
EAPI Eina_Bool eet_eina_stream_data_descriptor_class_set (Eet_Data_Descriptor_Class *eddc, const char *name, int size)
This function is an helper that set all the parameter of an Eet_Data_Descriptor_Class correctly when you use Eina data type with a stream.
EAPI Eina_Bool eet_eina_file_data_descriptor_class_set (Eet_Data_Descriptor_Class *eddc, const char *name, int size)
This function is an helper that set all the parameter of an Eet_Data_Descriptor_Class correctly when you use Eina data type with a file.
EAPI void eet_data_descriptor_free (Eet_Data_Descriptor *edd)
This function frees a data descriptor when it is not needed anymore.
EAPI void eet_data_descriptor_element_add (Eet_Data_Descriptor *edd, const char *name, int type, int group_type, int offset, int count, const char *counter_name, Eet_Data_Descriptor *subtype)
This function is an internal used by macros.
EAPI void * eet_data_read (Eet_File *ef, Eet_Data_Descriptor *edd, const char *name)
Read a data structure from an eet file and decodes it.
EAPI int eet_data_write (Eet_File *ef, Eet_Data_Descriptor *edd, const char *name, const void *data, int compress)
Write a data structure from memory and store in an eet file.
EAPI int eet_data_text_dump (const void *data_in, int size_in, void(*dumpfunc)(void *data, const char *str), void *dumpdata)
Dump an eet encoded data structure into ascii text.
EAPI void * eet_data_text_undump (const char *text, int textlen, int *size_ret)
Take an ascii encoding from eet_data_text_dump() and re-encode in binary.
EAPI int eet_data_dump (Eet_File *ef, const char *name, void(*dumpfunc)(void *data, const char *str), void *dumpdata)
Dump an eet encoded data structure from an eet file into ascii text.
EAPI int eet_data_undump (Eet_File *ef, const char *name, const char *text, int textlen, int compress)
Take an ascii encoding from eet_data_dump() and re-encode in binary.
EAPI void * eet_data_descriptor_decode (Eet_Data_Descriptor *edd, const void *data_in, int size_in)
Decode a data structure from an arbitary location in memory.
EAPI void * eet_data_descriptor_encode (Eet_Data_Descriptor *edd, const void *data_in, int *size_ret)
Encode a dsata struct to memory and return that encoded data.
EAPI void * eet_data_read_cipher (Eet_File *ef, Eet_Data_Descriptor *edd, const char *name, const char *cipher_key)
Read a data structure from an eet file and decodes it using a cipher.
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)
Write a data structure from memory and store in an eet file using a cipher.
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)
Dump an eet encoded data structure into ascii text using a cipher.
EAPI void * eet_data_text_undump_cipher (const char *text, const char *cipher_key, int textlen, int *size_ret)
Take an ascii encoding from eet_data_text_dump() and re-encode in binary using a cipher.
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)
Dump an eet encoded data structure from an eet file into ascii text using a cipher.
EAPI int eet_data_undump_cipher (Eet_File *ef, const char *name, const char *cipher_key, const char *text, int textlen, int compress)
Take an ascii encoding from eet_data_dump() and re-encode in binary using a cipher.
EAPI void * eet_data_descriptor_decode_cipher (Eet_Data_Descriptor *edd, const void *data_in, const char *cipher_key, int size_in)
Decode a data structure from an arbitary location in memory using a cipher.
EAPI void * eet_data_descriptor_encode_cipher (Eet_Data_Descriptor *edd, const void *data_in, const char *cipher_key, int *size_ret)
Encode a data struct to memory and return that encoded data using a cipher.
EAPI Eet_Node * eet_node_char_new (const char *name, char c)
TODO FIX ME.
EAPI Eet_Node * eet_node_short_new (const char *name, short s)
TODO FIX ME.
EAPI Eet_Node * eet_node_int_new (const char *name, int i)
TODO FIX ME.
EAPI Eet_Node * eet_node_long_long_new (const char *name, long long l)
TODO FIX ME.
EAPI Eet_Node * eet_node_float_new (const char *name, float f)
TODO FIX ME.
EAPI Eet_Node * eet_node_double_new (const char *name, double d)
TODO FIX ME.
EAPI Eet_Node * eet_node_unsigned_char_new (const char *name, unsigned char uc)
TODO FIX ME.
EAPI Eet_Node * eet_node_unsigned_short_new (const char *name, unsigned short us)
TODO FIX ME.
EAPI Eet_Node * eet_node_unsigned_int_new (const char *name, unsigned int ui)
TODO FIX ME.
EAPI Eet_Node * eet_node_unsigned_long_long_new (const char *name, unsigned long long l)
TODO FIX ME.
EAPI Eet_Node * eet_node_string_new (const char *name, const char *str)
TODO FIX ME.
EAPI Eet_Node * eet_node_inlined_string_new (const char *name, const char *str)
TODO FIX ME.
EAPI Eet_Node * eet_node_null_new (const char *name)
TODO FIX ME.
EAPI Eet_Node * eet_node_list_new (const char *name, Eina_List *nodes)
TODO FIX ME.
EAPI Eet_Node * eet_node_array_new (const char *name, int count, Eina_List *nodes)
TODO FIX ME.
EAPI Eet_Node * eet_node_var_array_new (const char *name, Eina_List *nodes)
TODO FIX ME.
EAPI Eet_Node * eet_node_hash_new (const char *name, const char *key, Eet_Node *node)
TODO FIX ME.
EAPI Eet_Node * eet_node_struct_new (const char *name, Eina_List *nodes)
TODO FIX ME.
EAPI Eet_Node * eet_node_struct_child_new (const char *parent, Eet_Node *child)
TODO FIX ME.
EAPI void eet_node_list_append (Eet_Node *parent, const char *name, Eet_Node *child)
TODO FIX ME.
EAPI void eet_node_struct_append (Eet_Node *parent, const char *name, Eet_Node *child)
TODO FIX ME.
EAPI void eet_node_hash_add (Eet_Node *parent, const char *name, const char *key, Eet_Node *child)
TODO FIX ME.
EAPI void eet_node_dump (Eet_Node *n, int dumplevel, void(*dumpfunc)(void *data, const char *str), void *dumpdata)
TODO FIX ME.
EAPI void eet_node_del (Eet_Node *n)
TODO FIX ME.
EAPI void * eet_data_node_encode_cipher (Eet_Node *node, const char *cipher_key, int *size_ret)
TODO FIX ME.
EAPI Eet_Node * eet_data_node_decode_cipher (const void *data_in, const char *cipher_key, int size_in)
TODO FIX ME.
EAPI Eet_Node * eet_data_node_read_cipher (Eet_File *ef, const char *name, const char *cipher_key)
TODO FIX ME.
EAPI int eet_data_node_write_cipher (Eet_File *ef, const char *name, const char *cipher_key, Eet_Node *node, int compress)
TODO FIX ME.
EAPI Eet_Connection * eet_connection_new (Eet_Read_Cb *eet_read_cb, Eet_Write_Cb *eet_write_cb, const void *user_data)
Instanciate a new connection to track.
EAPI int eet_connection_received (Eet_Connection *conn, const void *data, size_t size)
Process a raw packet received over the link conn Connection handler to track.
EAPI Eina_Bool eet_connection_send (Eet_Connection *conn, Eet_Data_Descriptor *edd, const void *data_in, const char *cipher_key)
Convert a complex structure and prepare it to be send.
EAPI Eina_Bool eet_connection_node_send (Eet_Connection *conn, Eet_Node *node, const char *cipher_key)
Convert a Eet_Node tree and prepare it to be send.
EAPI void * eet_connection_close (Eet_Connection *conn, Eina_Bool *on_going)
Close a connection and lost its track.  

Detailed Description

The file that provides the eet functions.

This header provides the Eet management functions.  

Typedef Documentation

 

Eet_Version

This is the Eet version information structure that can be used at runtiime to detect which version of eet is being used and adapt appropriately as follows for example: .PP

 #if defined(EET_VERSION_MAJOR) && (EET_VERSION_MAJOR >= 1) && defined(EET_VERSION_MINOR) && (EET_VERSION_MINOR > 2)
 printf('Eet version: %i.%i.%i, 
        eet_version->major, 
        eet_version->minor, 
        eet_version->micro);
 if (eet_version->revision > 0)
   {
     printf('  Built from SVN revision # %i, eet_version->revision);
   }
 #endif

Note the if check can be dropped if your program refuses to compile or work with an Eet version less than 1.3.0.  

Author

Generated automatically by Doxygen for Eet from the source code.


 

Index

NAME
SYNOPSIS
Data Structures
Defines
Typedefs
Enumerations
Functions
Detailed Description
Typedef Documentation
Eet_Version
Author

This document was created by man2html, using the manual pages.
Time: 21:45:24 GMT, April 16, 2011