ran ecrustify on eet. this seems to do a good job of eet. comments?

SVN revision: 64237
This commit is contained in:
Carsten Haitzler 2011-10-21 05:40:01 +00:00
parent a331fe3bca
commit 8893a9ff35
21 changed files with 3908 additions and 3748 deletions

View File

@ -112,7 +112,8 @@ do_eet_extract(const char * file,
} /* do_eet_extract */
static void
do_eet_decode_dump(void * data, const char * str)
do_eet_decode_dump(void *data,
const char *str)
{
fputs(str, (FILE *)data);
} /* do_eet_decode_dump */
@ -259,7 +260,8 @@ do_eet_encode(const char * file,
} /* do_eet_encode */
static void
do_eet_remove(const char * file, const char * key)
do_eet_remove(const char *file,
const char *key)
{
Eet_File *ef;
@ -301,7 +303,9 @@ do_eet_check(const char * file)
} /* do_eet_check */
static void
do_eet_sign(const char * file, const char * private_key, const char * public_key)
do_eet_sign(const char *file,
const char *private_key,
const char *public_key)
{
Eet_File *ef;
Eet_Key *key;
@ -329,7 +333,8 @@ do_eet_sign(const char * file, const char * private_key, const char * public_key
} /* do_eet_sign */
int
main(int argc, char ** argv)
main(int argc,
char **argv)
{
if (!eet_init())
return -1;
@ -339,7 +344,7 @@ main(int argc, char ** argv)
{
EINA_LOG_ERR("Impossible to create a log domain for eet_main.");
eet_shutdown();
return(-1);
return -1;
}
if (argc < 2)

View File

@ -37,3 +37,4 @@ main(void)
eet_shutdown();
}

View File

@ -173,7 +173,8 @@ _my_message_free(My_Message * msg)
} /* _my_message_free */
static Eina_Bool
_my_post_add(My_Account *acc, const char * message)
_my_post_add(My_Account *acc,
const char *message)
{
int new_count = acc->posts_count + 1;
My_Post *post = realloc(acc->posts, new_count * sizeof(My_Post));
@ -187,7 +188,7 @@ _my_post_add(My_Account *acc, const char * message)
post[acc->posts_count].dm_to = NULL;
acc->posts_count = new_count;
acc->posts = post;
return EINA_TRUE;;
return EINA_TRUE;
} /* _my_post_new */
static void
@ -246,7 +247,10 @@ _my_cache_new(void)
} /* _my_cache_new */
static Eina_Bool
_my_cache_account_free_cb(const Eina_Hash *hash, const void *key, void *data, void *fdata)
_my_cache_account_free_cb(const Eina_Hash *hash,
const void *key,
void *data,
void *fdata)
{
_my_account_free(data);
return EINA_TRUE;
@ -262,7 +266,8 @@ _my_cache_free(My_Cache * my_cache)
} /* _my_cache_free */
static My_Account *
_my_cache_account_find(My_Cache * my_cache, const char * name)
_my_cache_account_find(My_Cache *my_cache,
const char *name)
{
return eina_hash_find(my_cache->accounts, name);
} /* _my_cache_account_find */
@ -304,7 +309,8 @@ _my_cache_load(const char * filename)
} /* _my_cache_load */
static Eina_Bool
_my_cache_save(const My_Cache * my_cache, const char * filename)
_my_cache_save(const My_Cache *my_cache,
const char *filename)
{
char tmp[PATH_MAX];
Eet_File *ef;
@ -356,7 +362,9 @@ _my_cache_save(const My_Cache * my_cache, const char * filename)
return ret;
} /* _my_cache_save */
int main(int argc, char * argv[])
int
main(int argc,
char *argv[])
{
My_Cache *my_cache;
const Eina_List *l_acc;

View File

@ -115,7 +115,9 @@ _st3_set(Example_Struct3 *st3,
st3->body = v1;
} /* _st3_set */
static const char * /* union type_get() */
static const char *
/* union
type_get() */
_union_type_get(const void *data,
Eina_Bool *unknow)
{
@ -259,7 +261,8 @@ static Eet_Data_Descriptor *_variant_unified_descriptor;
static Eet_File *_cache_file = NULL;
static Eet_Dictionary *_cache_dict = NULL;
static void /* declaring types */
static void
/* declaring types */
_data_descriptors_init(void)
{
Eet_Data_Descriptor_Class eddc;

View File

@ -166,7 +166,8 @@ end:
} /* _my_conf_load */
static Eina_Bool
_my_conf_save(const My_Conf_Type * my_conf, const char * filename)
_my_conf_save(const My_Conf_Type *my_conf,
const char *filename)
{
char tmp[PATH_MAX];
Eet_File *ef;
@ -209,7 +210,9 @@ _my_conf_save(const My_Conf_Type * my_conf, const char * filename)
return ret;
} /* _my_conf_save */
int main(int argc, char * argv[])
int
main(int argc,
char *argv[])
{
My_Conf_Type *my_conf;
const My_Conf_Subtype *sub;

View File

@ -126,7 +126,8 @@ end:
} /* _my_conf_load */
static Eina_Bool
_my_conf_save(const My_Conf_Type * my_conf, const char * filename)
_my_conf_save(const My_Conf_Type *my_conf,
const char *filename)
{
char tmp[PATH_MAX];
Eet_File *ef;
@ -169,7 +170,9 @@ _my_conf_save(const My_Conf_Type * my_conf, const char * filename)
return ret;
} /* _my_conf_save */
int main(int argc, char * argv[])
int
main(int argc,
char *argv[])
{
My_Conf_Type *my_conf;
int ret = 0;

View File

@ -60,7 +60,7 @@ create_eet_file(void)
eet_delete(ef, "/several/strings");
return (eet_close(ef) == EET_ERROR_NONE);
return eet_close(ef) == EET_ERROR_NONE;
}
int
@ -124,3 +124,4 @@ main(void)
return 0;
}

View File

@ -43,7 +43,8 @@ architecture.
@section example A simple example on using Eet
Here is a simple example on how to use Eet to save a series of strings to a
file and load them again. The advantage of using Eet over just fprintf() and
file and load them again. The advantage of using Eet over just
fprintf() and
fscanf() is that not only can these entries be strings, they need no special
parsing to handle delimiter characters or escaping, they can be binary data,
image data, data structures containing integers, strings, other data
@ -2389,7 +2390,8 @@ struct _Eet_Data_Descriptor_Class
int version; /**< ABI version. Should always be set to #EET_DATA_DESCRIPTOR_CLASS_VERSION */
const char *name; /**< Name of the user data type to be serialized */
int size; /**< Size in bytes of the user data type to be serialized */
struct {
struct
{
Eet_Descriptor_Mem_Alloc_Callback mem_alloc; /**< how to allocate memory (usually malloc()) */
Eet_Descriptor_Mem_Free_Callback mem_free; /**< how to free memory (usually free()) */
Eet_Descriptor_Str_Alloc_Callback str_alloc; /**< how to allocate a string */
@ -2414,7 +2416,6 @@ struct _Eet_Data_Descriptor_Class
* @}
*/
/**
* Create a new empty data structure descriptor.
* @param name The string name of this data structure (most be a

View File

@ -101,29 +101,40 @@ extern int _eet_log_dom_global;
#endif /* ifdef CRIT */
#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,
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
eet_dictionary_string_get_size(const Eet_Dictionary *ed,
int index);
const char * eet_dictionary_string_get_char(const Eet_Dictionary *ed,
const char *
eet_dictionary_string_get_char(const Eet_Dictionary *ed,
int index);
Eina_Bool eet_dictionary_string_get_float(const Eet_Dictionary *ed,
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,
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,
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
eet_dictionary_string_get_hash(const Eet_Dictionary *ed,
int index);
int _eet_hash_gen(const char *key, int hash_size);
int _eet_hash_gen(const char *key,
int hash_size);
const void * eet_identity_check(const void *data_base,
const void *
eet_identity_check(const void *data_base,
unsigned int data_length,
void **sha1,
int *sha1_length,
@ -132,30 +143,40 @@ const void * eet_identity_check(const void *data_base,
const void **raw_signature_base,
unsigned int *raw_signature_length,
int *x509_length);
void * eet_identity_compute_sha1(const void *data_base,
void *
eet_identity_compute_sha1(const void *data_base,
unsigned int data_length,
int *sha1_length);
Eet_Error eet_cipher(const void *data,
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,
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_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_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_shutdown(void);
int
eet_node_init(void);
Eet_Node *
eet_node_new(void);
void
eet_node_free(Eet_Node *node);
#ifndef PATH_MAX
# define PATH_MAX 4096

View File

@ -80,13 +80,15 @@ void * alloca (size_t);
#ifdef HAVE_CIPHER
# ifdef HAVE_GNUTLS
static Eet_Error eet_hmac_sha1(const void *key,
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,
static Eet_Error
eet_pbkdf2_sha1(const char *key,
int key_len,
const unsigned char *salt,
unsigned int salt_len,
@ -149,7 +151,7 @@ eet_identity_open(const char *certificate_file,
/* Import the certificate in Eet_Key structure */
load_file.data = data;
load_file.size = eina_file_size_get(f);;
load_file.size = eina_file_size_get(f);
if (gnutls_x509_crt_import(key->certificate, &load_file,
GNUTLS_X509_FMT_PEM) < 0)
goto on_error;
@ -177,7 +179,7 @@ eet_identity_open(const char *certificate_file,
/* Import the private key in Eet_Key structure */
load_file.data = data;
load_file.size = eina_file_size_get(f);;
load_file.size = eina_file_size_get(f);
/* Try to directly import the PEM encoded private key */
if (gnutls_x509_privkey_import(key->private_key, &load_file,
GNUTLS_X509_FMT_PEM) < 0)

View File

@ -94,14 +94,30 @@ 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);
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
@ -145,11 +161,18 @@ struct _Eet_Data_Descriptor
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_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);
Eina_Bool (*type_set)(const char *type,
void *data,
Eina_Bool unknow);
void * (*array_alloc)(size_t size);
void (*array_free)(void *mem);
} func;
@ -216,109 +239,139 @@ struct _Eet_Variant_Unknow
/*---*/
static void eet_free_context_init(Eet_Free_Context *context);
static void eet_free_context_shutdown(Eet_Free_Context *context);
static void
eet_free_context_init(Eet_Free_Context *context);
static void
eet_free_context_shutdown(Eet_Free_Context *context);
static int eet_data_get_char(const 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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
static int
eet_data_get_unknown(Eet_Free_Context *context,
const Eet_Dictionary *ed,
Eet_Data_Descriptor *edd,
Eet_Data_Element *ede,
@ -328,17 +381,20 @@ static int eet_data_get_unknown(Eet_Free_Context *context,
void *data_in,
char **p,
int *size);
static void eet_data_put_unknown(Eet_Dictionary *ed,
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 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,
static int
eet_data_get_array(Eet_Free_Context *context,
const Eet_Dictionary *ed,
Eet_Data_Descriptor *edd,
Eet_Data_Element *ede,
@ -348,7 +404,8 @@ static int eet_data_get_array(Eet_Free_Context *context,
void *data,
char **p,
int *size);
static int eet_data_get_list(Eet_Free_Context *context,
static int
eet_data_get_list(Eet_Free_Context *context,
const Eet_Dictionary *ed,
Eet_Data_Descriptor *edd,
Eet_Data_Element *ede,
@ -358,17 +415,20 @@ static int eet_data_get_list(Eet_Free_Context *context,
void *data_in,
char **p,
int *size);
static void eet_data_put_list(Eet_Dictionary *ed,
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,
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,
static int
eet_data_get_hash(Eet_Free_Context *context,
const Eet_Dictionary *ed,
Eet_Data_Descriptor *edd,
Eet_Data_Element *ede,
@ -378,12 +438,14 @@ static int eet_data_get_hash(Eet_Free_Context *context,
void *data,
char **p,
int *size);
static void eet_data_put_union(Eet_Dictionary *ed,
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,
static int
eet_data_get_union(Eet_Free_Context *context,
const Eet_Dictionary *ed,
Eet_Data_Descriptor *edd,
Eet_Data_Element *ede,
@ -393,12 +455,14 @@ static int eet_data_get_union(Eet_Free_Context *context,
void *data,
char **p,
int *size);
static void eet_data_put_variant(Eet_Dictionary *ed,
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,
static int
eet_data_get_variant(Eet_Free_Context *context,
const Eet_Dictionary *ed,
Eet_Data_Descriptor *edd,
Eet_Data_Element *ede,
@ -409,28 +473,36 @@ static int eet_data_get_variant(Eet_Free_Context *context,
char **p,
int *size);
static void eet_data_chunk_get(const Eet_Dictionary *ed,
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,
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 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,
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_stream_free(Eet_Data_Stream *ds);
static void eet_data_chunk_put(Eet_Dictionary *ed,
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,
static int
eet_data_descriptor_encode_hash_cb(void *hash,
const char *key,
void *hdata,
void *fdata);
@ -2189,6 +2261,7 @@ _eet_free_del(Eet_Free *ef,
return;
}
}
#endif
static void
@ -2315,7 +2388,8 @@ _eet_freelist_list_free(Eet_Free_Context *context,
#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)
{
void *track;
Eina_Array_Iterator it;
@ -3775,7 +3849,6 @@ eet_data_put_union(Eet_Dictionary *ed,
break;
}
} /* eet_data_put_union */
static int
@ -3859,7 +3932,6 @@ eet_data_get_union(Eet_Free_Context *context,
break;
}
}
else
{
@ -3986,7 +4058,6 @@ eet_data_put_variant(Eet_Dictionary *ed,
break;
}
} /* eet_data_put_variant */
static int
@ -4145,7 +4216,9 @@ on_error:
} /* 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

View File

@ -232,11 +232,13 @@ static void _JPEGErrorHandler(j_common_ptr cinfo);
static void _JPEGErrorHandler2(j_common_ptr cinfo,
int msg_level);
static int eet_data_image_jpeg_header_decode(const void *data,
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,
static int
eet_data_image_jpeg_rgb_decode(const void *data,
int size,
unsigned int src_x,
unsigned int src_y,
@ -244,7 +246,8 @@ static int eet_data_image_jpeg_rgb_decode(const void *data,
unsigned int w,
unsigned int h,
unsigned int row_stride);
static void * eet_data_image_jpeg_alpha_decode(const void *data,
static void *
eet_data_image_jpeg_alpha_decode(const void *data,
int size,
unsigned int src_x,
unsigned int src_y,
@ -252,24 +255,28 @@ static void * eet_data_image_jpeg_alpha_decode(const void *data,
unsigned int w,
unsigned int h,
unsigned int row_stride);
static void * eet_data_image_lossless_convert(int *size,
static void *
eet_data_image_lossless_convert(int *size,
const void *data,
unsigned int w,
unsigned int h,
int alpha);
static void * eet_data_image_lossless_compressed_convert(int *size,
static void *
eet_data_image_lossless_compressed_convert(int *size,
const void *data,
unsigned int w,
unsigned int h,
int alpha,
int compression);
static void * eet_data_image_jpeg_convert(int *size,
static void *
eet_data_image_jpeg_convert(int *size,
const void *data,
unsigned int w,
unsigned int h,
int alpha,
int quality);
static void * eet_data_image_jpeg_alpha_convert(int *size,
static void *
eet_data_image_jpeg_alpha_convert(int *size,
const void *data,
unsigned int w,
unsigned int h,

View File

@ -66,7 +66,6 @@ GCRY_THREAD_OPTION_PTHREAD_IMPL;
#include "Eet.h"
#include "Eet_private.h"
#ifndef O_BINARY
# define O_BINARY 0
#endif
@ -215,29 +214,41 @@ char x509[x509_length]; /* The public certificate. */
EET_FILE2_DICTIONARY_ENTRY_COUNT)
/* prototypes of internal calls */
static Eet_File * eet_cache_find(const char *path,
static Eet_File *
eet_cache_find(const char *path,
Eet_File **cache,
int cache_num);
static void eet_cache_add(Eet_File *ef,
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,
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 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,
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);
static Eina_Lock eet_cache_lock;
@ -311,7 +322,6 @@ eet_cache_find(const char *path,
if (eet_string_match(cache[i]->path, path))
if (!cache[i]->delete_me_now)
return cache[i];
}
/* not found */
@ -441,7 +451,7 @@ eet_string_match(const char *s1,
if (s1 == s2)
return 1;
return (!strcmp(s1, s2));
return !strcmp(s1, s2);
} /* eet_string_match */
/* flush out writes to a v2 eet file */

View File

@ -52,7 +52,8 @@ _eet_node_new(const char *name,
} /* _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;
@ -357,7 +358,6 @@ eet_node_hash_add(Eet_Node *parent,
parent->values = nn;
} /* eet_node_hash_add */
int
eet_node_type_get(Eet_Node *node)
{
@ -517,7 +517,8 @@ eet_node_dump_string_escape(void *dumpdata,
} /* eet_node_dump_string_escape */
static void
eet_node_dump_simple_type(Eet_Node *n, int level,
eet_node_dump_simple_type(Eet_Node *n,
int level,
Eet_Dump_Callback dumpfunc,
void *dumpdata)
{

View File

@ -19,7 +19,9 @@ _eet_str_direct_free(const char * str)
} /* _eet_str_direct_free */
static void
_eet_eina_hash_foreach(void * hash, Eina_Hash_Foreach cb, void * fdata)
_eet_eina_hash_foreach(void *hash,
Eina_Hash_Foreach cb,
void *fdata)
{
if (hash)
eina_hash_foreach(hash, cb, fdata);
@ -27,7 +29,9 @@ _eet_eina_hash_foreach(void * hash, Eina_Hash_Foreach cb, void * fdata)
/* Internal wrapper for eina_hash */
static Eina_Hash *
_eet_eina_hash_add(Eina_Hash * hash, const char * key, const void * data)
_eet_eina_hash_add(Eina_Hash *hash,
const char *key,
const void *data)
{
if (!hash)
hash = eina_hash_string_superfast_new(NULL);

View File

@ -128,7 +128,8 @@ static const Eet_Test_Image test_alpha = {
};
static void
_eet_test_basic_set(Eet_Test_Basic_Type * res, int i)
_eet_test_basic_set(Eet_Test_Basic_Type *res,
int i)
{
res->c = EET_TEST_CHAR;
res->s = EET_TEST_SHORT;
@ -173,7 +174,8 @@ _eet_test_basic_set(Eet_Test_Basic_Type * res, int i)
} /* _eet_test_basic_set */
static void
_eet_test_basic_check(Eet_Test_Basic_Type * result, int i)
_eet_test_basic_check(Eet_Test_Basic_Type *result,
int i)
{
float tmp;
@ -525,7 +527,8 @@ _eet_build_ex_descriptor(Eet_Data_Descriptor * edd)
} /* _eet_build_ex_descriptor */
static Eet_Test_Ex_Type *
_eet_test_ex_set(Eet_Test_Ex_Type * res, int offset)
_eet_test_ex_set(Eet_Test_Ex_Type *res,
int offset)
{
unsigned int i;
@ -583,7 +586,8 @@ _eet_test_ex_set(Eet_Test_Ex_Type * res, int offset)
} /* _eet_test_ex_set */
static int
_eet_test_ex_check(Eet_Test_Ex_Type * stuff, int offset)
_eet_test_ex_check(Eet_Test_Ex_Type *stuff,
int offset)
{
double tmp;
unsigned int i;
@ -673,7 +677,10 @@ _eet_test_ex_check(Eet_Test_Ex_Type * stuff, int offset)
} /* _eet_test_ex_check */
static Eina_Bool
func(__UNUSED__ const Eina_Hash * hash, const void * key, void * data, void * fdata)
func(__UNUSED__ const Eina_Hash *hash,
const void *key,
void *data,
void *fdata)
{
int *res = fdata;
@ -773,7 +780,8 @@ START_TEST(eet_test_data_type_encoding_decoding)
END_TEST
static void
append_string(void * data, const char * str)
append_string(void *data,
const char *str)
{
char **string = data;
int length;
@ -874,7 +882,6 @@ START_TEST(eet_test_data_type_dump_undump)
eet_shutdown();
}
END_TEST
START_TEST(eet_file_simple_write)
{
const char *buffer = "Here is a string of data to save !";
@ -942,7 +949,6 @@ START_TEST(eet_file_simple_write)
} /* START_TEST */
END_TEST
START_TEST(eet_file_data_test)
{
Eet_Data_Descriptor *edd;
@ -1099,7 +1105,6 @@ START_TEST(eet_file_data_test)
} /* START_TEST */
END_TEST
START_TEST(eet_file_data_dump_test)
{
Eet_Data_Descriptor *edd;
@ -1196,7 +1201,6 @@ START_TEST(eet_file_data_dump_test)
} /* START_TEST */
END_TEST
START_TEST(eet_image)
{
Eet_File *ef;
@ -1621,7 +1625,6 @@ START_TEST(eet_small_image)
} /* START_TEST */
END_TEST
START_TEST(eet_identity_simple)
{
const char *buffer = "Here is a string of data to save !";
@ -1698,7 +1701,6 @@ START_TEST(eet_identity_simple)
} /* START_TEST */
END_TEST
START_TEST(eet_identity_open_simple)
{
Eet_Key *k = NULL;
@ -1717,7 +1719,6 @@ START_TEST(eet_identity_open_simple)
} /* START_TEST */
END_TEST
START_TEST(eet_identity_open_pkcs8)
{
Eet_Key *k = NULL;
@ -1737,7 +1738,8 @@ START_TEST(eet_identity_open_pkcs8)
END_TEST
static int pass_get(char * pass,
static int
pass_get(char *pass,
int size,
__UNUSED__ int rwflags,
__UNUSED__ void *u)
@ -1751,7 +1753,8 @@ static int pass_get(char * pass,
return strlen(pass);
} /* pass_get */
static int badpass_get(char * pass,
static int
badpass_get(char *pass,
int size,
__UNUSED__ int rwflags,
__UNUSED__ void *u)
@ -1794,7 +1797,6 @@ START_TEST(eet_identity_open_pkcs8_enc)
eet_shutdown();
}
END_TEST
START_TEST(eet_cipher_decipher_simple)
{
const char *buffer = "Here is a string of data to save !";
@ -1964,7 +1966,9 @@ struct _Eet_Connection_Data
};
static Eina_Bool
_eet_connection_read(const void * eet_data, size_t size, void * user_data)
_eet_connection_read(const void *eet_data,
size_t size,
void *user_data)
{
Eet_Connection_Data *dt = user_data;
Eet_Test_Ex_Type *result;
@ -2006,7 +2010,9 @@ _eet_connection_read(const void * eet_data, size_t size, void * user_data)
} /* _eet_connection_read */
static Eina_Bool
_eet_connection_write(const void * data, size_t size, void * user_data)
_eet_connection_write(const void *data,
size_t size,
void *user_data)
{
Eet_Connection_Data *dt = user_data;
int still;
@ -2168,7 +2174,6 @@ START_TEST(eet_fp)
eet_shutdown();
}
END_TEST
START_TEST(eet_file_fp)
{
char *file = strdup("/tmp/eet_suite_testXXXXXX");
@ -2335,7 +2340,8 @@ struct _Eet_List
};
static const char *
_eet_union_type_get(const void * data, Eina_Bool * unknow)
_eet_union_type_get(const void *data,
Eina_Bool *unknow)
{
const Eet_Union *u = data;
int i;
@ -2354,7 +2360,9 @@ _eet_union_type_get(const void * data, Eina_Bool * unknow)
} /* _eet_union_type_get */
static Eina_Bool
_eet_union_type_set(const char * type, void * data, Eina_Bool unknow)
_eet_union_type_set(const char *type,
void *data,
Eina_Bool unknow)
{
Eet_Union *u = data;
int i;
@ -2373,7 +2381,8 @@ _eet_union_type_set(const char * type, void * data, Eina_Bool unknow)
} /* _eet_union_type_set */
static const char *
_eet_variant_type_get(const void * data, Eina_Bool * unknow)
_eet_variant_type_get(const void *data,
Eina_Bool *unknow)
{
const Eet_Variant_Type *type = data;
int i;
@ -2392,7 +2401,9 @@ _eet_variant_type_get(const void * data, Eina_Bool * unknow)
} /* _eet_variant_type_get */
static Eina_Bool
_eet_variant_type_set(const char * type, void * data, Eina_Bool unknow)
_eet_variant_type_set(const char *type,
void *data,
Eina_Bool unknow)
{
Eet_Variant_Type *vt = data;
@ -2417,7 +2428,8 @@ _eet_st1_dd(void)
} /* _eet_st1_dd */
static void
_eet_st1_set(Eet_St1 * st1, int i)
_eet_st1_set(Eet_St1 *st1,
int i)
{
st1->val1 = EET_TEST_DOUBLE;
st1->stuff = EET_TEST_INT + i;
@ -2425,7 +2437,8 @@ _eet_st1_set(Eet_St1 * st1, int i)
} /* _eet_st1_set */
static void
_eet_st1_cmp(Eet_St1 * st1, int i)
_eet_st1_cmp(Eet_St1 *st1,
int i)
{
double tmp;
@ -2455,14 +2468,16 @@ _eet_st2_dd(void)
} /* _eet_st2_dd */
static void
_eet_st2_set(Eet_St2 * st2, int i)
_eet_st2_set(Eet_St2 *st2,
int i)
{
st2->b1 = EINA_TRUE;
st2->v1 = EET_TEST_LONG_LONG + i;
} /* _eet_st2_set */
static void
_eet_st2_cmp(Eet_St2 * st2, int i)
_eet_st2_cmp(Eet_St2 *st2,
int i)
{
fail_if(!st2->b1);
fail_if(st2->v1 != EET_TEST_LONG_LONG + i);
@ -2482,13 +2497,15 @@ _eet_st3_dd(void)
} /* _eet_st3_dd */
static void
_eet_st3_set(Eet_St3 * st3, int i)
_eet_st3_set(Eet_St3 *st3,
int i)
{
st3->boby = EET_TEST_INT + i;
} /* _eet_st3_set */
static void
_eet_st3_cmp(Eet_St3 * st3, int i)
_eet_st3_cmp(Eet_St3 *st3,
int i)
{
fail_if(st3->boby != EET_TEST_INT + i);
} /* _eet_st3_cmp */
@ -2570,7 +2587,6 @@ START_TEST(eet_test_union)
eina_shutdown();
}
END_TEST
START_TEST(eet_test_variant)
{
Eet_Variant_Test *evt;

View File

@ -3,6 +3,7 @@
#include "Eet.h"
void eet_test_setup_eddc(Eet_Data_Descriptor_Class * eddc);
void
eet_test_setup_eddc(Eet_Data_Descriptor_Class *eddc);
#endif /* _EET_SUITE_H */