|
|
|
@ -8,6 +8,8 @@ |
|
|
|
|
static Eet_Data_Descriptor *_e_ipc_int_edd = NULL; |
|
|
|
|
static Eet_Data_Descriptor *_e_ipc_double_edd = NULL; |
|
|
|
|
static Eet_Data_Descriptor *_e_ipc_2int_edd = NULL; |
|
|
|
|
static Eet_Data_Descriptor *_e_ipc_str_edd = NULL; |
|
|
|
|
static Eet_Data_Descriptor *_e_ipc_str_list_edd = NULL; |
|
|
|
|
|
|
|
|
|
/* externally accessible functions */ |
|
|
|
|
int |
|
|
|
@ -22,6 +24,12 @@ e_ipc_codec_init(void) |
|
|
|
|
_e_ipc_2int_edd = E_CONFIG_DD_NEW("2int", E_Ipc_2Int); |
|
|
|
|
E_CONFIG_VAL(_e_ipc_2int_edd, E_Ipc_2Int, val1, INT); |
|
|
|
|
E_CONFIG_VAL(_e_ipc_2int_edd, E_Ipc_2Int, val2, INT); |
|
|
|
|
|
|
|
|
|
_e_ipc_str_edd = E_CONFIG_DD_NEW("str", E_Ipc_Str); |
|
|
|
|
E_CONFIG_VAL(_e_ipc_str_edd, E_Ipc_Str, str, STR); |
|
|
|
|
|
|
|
|
|
_e_ipc_str_list_edd = E_CONFIG_DD_NEW("str_list", E_Ipc_Str_List); |
|
|
|
|
E_CONFIG_LIST(_e_ipc_str_list_edd, E_Ipc_Str_List, list, _e_ipc_str_list_edd); |
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -31,6 +39,8 @@ e_ipc_codec_shutdown(void) |
|
|
|
|
E_CONFIG_DD_FREE(_e_ipc_int_edd); |
|
|
|
|
E_CONFIG_DD_FREE(_e_ipc_double_edd); |
|
|
|
|
E_CONFIG_DD_FREE(_e_ipc_2int_edd); |
|
|
|
|
E_CONFIG_DD_FREE(_e_ipc_str_edd); |
|
|
|
|
E_CONFIG_DD_FREE(_e_ipc_str_list_edd); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int |
|
|
|
@ -101,5 +111,78 @@ e_ipc_codec_2int_enc(int val1, int val2, int *size_ret) |
|
|
|
|
return eet_data_descriptor_encode(_e_ipc_2int_edd, &dat, size_ret); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int |
|
|
|
|
e_ipc_codec_str_dec(char *data, int bytes, char **dest) |
|
|
|
|
{ |
|
|
|
|
E_Ipc_Str *dat; |
|
|
|
|
|
|
|
|
|
if (!data) return 0; |
|
|
|
|
dat = eet_data_descriptor_decode(_e_ipc_str_edd, data, bytes); |
|
|
|
|
if (!dat) return 0; |
|
|
|
|
if (dest) *dest = dat->str; |
|
|
|
|
free(dat); |
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void * |
|
|
|
|
e_ipc_codec_str_enc(char *str, int *size_ret) |
|
|
|
|
{ |
|
|
|
|
E_Ipc_Str dat; |
|
|
|
|
|
|
|
|
|
dat.str = str; |
|
|
|
|
return eet_data_descriptor_encode(_e_ipc_str_edd, &dat, size_ret); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int |
|
|
|
|
e_ipc_codec_str_list_dec(char *data, int bytes, Evas_List **dest) |
|
|
|
|
{ |
|
|
|
|
E_Ipc_Str_List *dat; |
|
|
|
|
Evas_List *list = NULL, *l; |
|
|
|
|
|
|
|
|
|
if (!data) return 0; |
|
|
|
|
dat = eet_data_descriptor_decode(_e_ipc_str_list_edd, data, bytes); |
|
|
|
|
if (!dat) return 0; |
|
|
|
|
for (l = dat->list; l; l = l->next) |
|
|
|
|
{ |
|
|
|
|
E_Ipc_Str *str_node; |
|
|
|
|
|
|
|
|
|
str_node->str = l->data; |
|
|
|
|
list = evas_list_append(list, str_node->str); |
|
|
|
|
} |
|
|
|
|
if (dest) *dest = list; |
|
|
|
|
while (dat->list) |
|
|
|
|
{ |
|
|
|
|
free(dat->list->data); |
|
|
|
|
dat->list = evas_list_remove_list(dat->list, dat->list); |
|
|
|
|
} |
|
|
|
|
free(dat); |
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void * |
|
|
|
|
e_ipc_codec_str_list_enc(Evas_List *list, int *size_ret) |
|
|
|
|
{ |
|
|
|
|
E_Ipc_Str_List dat; |
|
|
|
|
Evas_List *l; |
|
|
|
|
void *data; |
|
|
|
|
|
|
|
|
|
dat.list = NULL; |
|
|
|
|
for (l = list; l; l = l->next) |
|
|
|
|
{ |
|
|
|
|
E_Ipc_Str *str_node; |
|
|
|
|
|
|
|
|
|
str_node = malloc(sizeof(E_Ipc_Str)); |
|
|
|
|
str_node->str = l->data; |
|
|
|
|
dat.list = evas_list_append(dat.list, str_node); |
|
|
|
|
} |
|
|
|
|
data = eet_data_descriptor_encode(_e_ipc_str_list_edd, &dat, size_ret); |
|
|
|
|
while (dat.list) |
|
|
|
|
{ |
|
|
|
|
free(dat.list->data); |
|
|
|
|
dat.list = evas_list_remove_list(dat.list, dat.list); |
|
|
|
|
} |
|
|
|
|
return data; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* local subsystem globals */ |
|
|
|
|
|
|
|
|
|