diff options
author | Yeongil Jang <yg0577.jang@samsung.com> | 2012-09-21 00:18:57 +0900 |
---|---|---|
committer | Yeongil Jang <yg0577.jang@samsung.com> | 2012-09-21 00:18:57 +0900 |
commit | b163391a122d812058dc9ab211b81e60204fffc7 (patch) | |
tree | 0fdf86bf4dc67b14c8913f8fa01d4e6270b1ea39 /email-ipc/email-ipc-api | |
parent | 4a95e692f2a57a0c273b2ce1f255be9a7ba1d2e3 (diff) | |
download | email-service-master.tar.gz email-service-master.tar.bz2 email-service-master.zip |
2.0_alpha release commitHEADsubmit/master/20120920.1528362.0_alphamaster2.0alpha
Diffstat (limited to 'email-ipc/email-ipc-api')
-rwxr-xr-x | email-ipc/email-ipc-api/email-ipc-api-info.c | 140 | ||||
-rwxr-xr-x | email-ipc/email-ipc-api/email-ipc-param-list.c | 173 | ||||
-rwxr-xr-x | email-ipc/email-ipc-api/email-ipc-param.c | 19 | ||||
-rwxr-xr-x | email-ipc/email-ipc-api/include/email-ipc-api-info.h | 38 | ||||
-rwxr-xr-x | email-ipc/email-ipc-api/include/email-ipc-param-list.h | 14 | ||||
-rwxr-xr-x | email-ipc/email-ipc-api/include/email-ipc-param.h | 4 |
6 files changed, 215 insertions, 173 deletions
diff --git a/email-ipc/email-ipc-api/email-ipc-api-info.c b/email-ipc/email-ipc-api/email-ipc-api-info.c index c4e2cba..23dc135 100755 --- a/email-ipc/email-ipc-api/email-ipc-api-info.c +++ b/email-ipc/email-ipc-api/email-ipc-api-info.c @@ -30,126 +30,98 @@ #include "email-debug-log.h" -static long emipc_parse_api_id_of_api_info(emipc_email_api_info *api_info, void *stream); -static long emipc_parse_response_id_of_api_info(emipc_email_api_info *api_info, void* stream); -static long emipc_parse_app_id_of_api_info(emipc_email_api_info *api_info, void* stream); -EXPORT_API bool emipc_set_api_id_of_api_info(emipc_email_api_info *api_info, long api_id) +/* deserializing data from stream */ +EXPORT_API bool emipc_deserialize_api_info(emipc_email_api_info *api_info, EPARAMETER_DIRECTION direction, void *stream) { - api_info->api_id = api_id; - return true; -} - -EXPORT_API long emipc_get_api_id_of_api_info(emipc_email_api_info *api_info) -{ - return api_info->api_id; -} - -EXPORT_API bool emipc_set_app_id_of_api_info(emipc_email_api_info *api_info, long app_id) -{ - api_info->app_id = app_id; - return true; -} - -EXPORT_API long emipc_get_app_id_of_api_info(emipc_email_api_info *api_info) -{ - return api_info->app_id; -} - -EXPORT_API bool emipc_set_response_id_of_api_info(emipc_email_api_info *api_info, long response_id) -{ - api_info->response_id = response_id; - return true; -} - -EXPORT_API long emipc_get_response_id_of_api_info(emipc_email_api_info *api_info) -{ - return api_info->response_id; -} - -EXPORT_API bool emipc_parse_stream_of_api_info(emipc_email_api_info *api_info, EPARAMETER_DIRECTION direction, void *stream) -{ - emipc_param_list *new_param_list = NULL; + EM_DEBUG_FUNC_BEGIN("emipc_email_api_info : [%p], direction : [%d]", api_info, direction); + + if (!api_info || !stream) { + EM_DEBUG_EXCEPTION("Invalid parameter."); + return false; + } if (api_info->params[direction] == NULL) { - new_param_list = (emipc_param_list *)malloc(sizeof(emipc_param_list)); - if (new_param_list == NULL) { - EM_DEBUG_EXCEPTION("Memory allocation failed."); + api_info->params[direction] = emipc_create_param_list(); + if (api_info->params[direction] == NULL) { + EM_DEBUG_EXCEPTION("Malloc failed"); return false; } - memset(new_param_list, 0x00, sizeof(emipc_param_list)); - api_info->params[direction] = new_param_list; } - emipc_parse_api_id_of_api_info(api_info, stream); - emipc_parse_app_id_of_api_info(api_info, stream); - emipc_parse_response_id_of_api_info(api_info, stream); + api_info->api_id = *((long *)stream + eSTREAM_APIID); + api_info->app_id = *((long*)stream + eSTREAM_APPID); + api_info->response_id = *((long*)stream + eSTREAM_RESID); + return emipc_parse_stream_of_param_list(api_info->params[direction], stream); } -EXPORT_API unsigned char *emipc_get_stream_of_api_info(emipc_email_api_info *api_info, EPARAMETER_DIRECTION direction) +EXPORT_API unsigned char *emipc_serialize_api_info(emipc_email_api_info *api_info, EPARAMETER_DIRECTION direction, int *stream_len) { - emipc_param_list *new_param_list = NULL; + EM_DEBUG_FUNC_BEGIN(); unsigned char *stream = NULL; + + if (!api_info) { + EM_DEBUG_EXCEPTION("Invalid parameter."); + return stream; + } if (api_info->params[direction] == NULL) { - new_param_list = (emipc_param_list *)malloc(sizeof(emipc_param_list)); - if (new_param_list == NULL) { - EM_DEBUG_EXCEPTION("Memory allocation failed."); - return false; + api_info->params[direction] = emipc_create_param_list(); + if (api_info->params[direction] == NULL) { + EM_DEBUG_EXCEPTION("Malloc failed"); + return NULL; } - memset(new_param_list, 0x00, sizeof(emipc_param_list)); - api_info->params[direction] = new_param_list; } - stream = emipc_get_stream_of_param_list(api_info->params[direction]); + stream = emipc_serialize_param_list(api_info->params[direction], stream_len); if (stream != NULL) { memcpy(stream, &(api_info->api_id), sizeof(api_info->api_id)); memcpy(stream+(sizeof(long)*eSTREAM_RESID), &(api_info->response_id), sizeof(api_info->response_id)); memcpy(stream+(sizeof(long)*eSTREAM_APPID), &(api_info->app_id), sizeof(api_info->app_id)); } + EM_DEBUG_FUNC_END(); return stream; } -EXPORT_API int emipc_get_stream_length_of_api_info(emipc_email_api_info *api_info, EPARAMETER_DIRECTION direction) -{ - if (api_info->params[direction] == NULL) - return 0; - - return emipc_get_stream_length_of_param_list(api_info->params[direction]); -} - EXPORT_API void *emipc_get_parameters_of_api_info(emipc_email_api_info *api_info, EPARAMETER_DIRECTION direction) { - emipc_param_list *new_param_list = NULL; - + EM_DEBUG_FUNC_BEGIN("emipc_email_api_info : [%p], direction : [%d]", api_info, direction); + + if (!api_info) { + EM_DEBUG_EXCEPTION("INVALID_PARAM"); + return NULL; + } + if (api_info->params[direction] == NULL) { - new_param_list = (emipc_param_list *)malloc(sizeof(emipc_param_list)); - if (new_param_list == NULL) { - EM_DEBUG_EXCEPTION("Memory allocation failed."); - return false; + api_info->params[direction] = emipc_create_param_list(); + if (api_info->params[direction] == NULL) { + EM_DEBUG_EXCEPTION("emipc_create_param_list failed"); + return NULL; } - memset(new_param_list, 0x00, sizeof(emipc_param_list)); - api_info->params[direction] = new_param_list; } + return api_info->params[direction]; } -static long emipc_parse_api_id_of_api_info(emipc_email_api_info *api_info, void *stream) +EXPORT_API bool emipc_free_api_info(emipc_email_api_info *api_info) { - api_info->api_id = *((long *)stream + eSTREAM_APIID); - return api_info->api_id; -} + if (!api_info) { + EM_DEBUG_EXCEPTION("Invalid parameter"); + return false; + } -static long emipc_parse_response_id_of_api_info(emipc_email_api_info *api_info, void* stream) -{ - api_info->response_id = *((long*)stream + eSTREAM_RESID); - return api_info->response_id; -} + if (!emipc_destroy_param_list(api_info->params[ePARAMETER_IN])) { + EM_DEBUG_EXCEPTION("emipc_destroy_param_list failed : ePARAMETER[%d]", ePARAMETER_IN); + return false; + } -static long emipc_parse_app_id_of_api_info(emipc_email_api_info *api_info, void* stream) -{ - api_info->app_id = *((long*)stream + eSTREAM_APPID); - return api_info->app_id; + if (!emipc_destroy_param_list(api_info->params[ePARAMETER_OUT])) { + EM_DEBUG_EXCEPTION("emipc_destroy_param_list failed : ePARAMETER[%d]", ePARAMETER_OUT); + return false; + } + return true; } + + diff --git a/email-ipc/email-ipc-api/email-ipc-param-list.c b/email-ipc/email-ipc-api/email-ipc-param-list.c index d899743..1a80bad 100755 --- a/email-ipc/email-ipc-api/email-ipc-param-list.c +++ b/email-ipc/email-ipc-api/email-ipc-param-list.c @@ -4,7 +4,7 @@ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com> -* +* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -27,100 +27,145 @@ #include "email-ipc-param-list.h" #include "email-debug-log.h" +#include "email-utilities.h" /* stream */ /* +----------------------------------------------------------------------------------------------------------+ */ /* | API ID(4B) | Resp. ID (4B) | Param Count(4B) | Param1 Len | Param1 Data | ... | ParamN Len | ParamN data | */ /* +----------------------------------------------------------------------------------------------------------+ */ -static long emipc_parse_parameter_count(void *stream); -EXPORT_API bool emipc_parse_stream_of_param_list(emipc_param_list *param_list, void *stream_data) +EXPORT_API emipc_param_list *emipc_create_param_list() +{ + emipc_param_list *new_param_list = NULL; + + new_param_list = (emipc_param_list *) em_malloc (sizeof(emipc_param_list)); + if (new_param_list == NULL) { + EM_DEBUG_EXCEPTION("em_malloc failed."); + return NULL; + } + memset(new_param_list, 0x00, sizeof(emipc_param_list)); + + return new_param_list; +} + +EXPORT_API bool emipc_destroy_param_list(emipc_param_list *param_list) +{ + int count = 10; + int index = 0; + + if (!param_list) { + EM_DEBUG_EXCEPTION("Invalid parameter."); + return false; + } + + for (index = 0; index < count; index++) { + emipc_free_param(param_list->params[index]); + } + EM_SAFE_FREE(param_list->byte_stream); + EM_SAFE_FREE(param_list); + return true; +} + +/* making stream into param length and param data */ +EXPORT_API bool emipc_parse_stream_of_param_list(emipc_param_list *param_list, void *stream) { EM_DEBUG_FUNC_BEGIN(); - long parameter_count = emipc_parse_parameter_count(stream_data); + long parameter_count = *((long *)stream + eSTREAM_COUNT); if(parameter_count <= 0) { - EM_DEBUG_EXCEPTION("There is no parameter. "); + EM_DEBUG_EXCEPTION("INVALID_PARAM : count %d", parameter_count); return false; } - unsigned char* stream = (unsigned char*)stream_data; - long index, param_len, pos = sizeof(long)*eSTREAM_DATA; + unsigned char* cur = ((unsigned char*)stream) + sizeof(int)*eSTREAM_DATA; - for(index = 0; index < parameter_count; index++) { - long len =0; - memcpy(&len, stream+pos, sizeof(long)); - param_len = len; - EM_DEBUG_LOG("Parameter Length [%d] : %d ", index, param_len); - pos += sizeof(long); /* Move from length position to data position */ + int i = 0; + /* stream is composed of data type which is encoded into length and data field */ + int len = 0; + for(i = 0; i < parameter_count; i++) { + /* reading length */ + memcpy(&len, cur, sizeof(int)); - emipc_add_param_of_param_list(param_list, (void*)(stream+pos), param_len); - pos += param_len; /* move to next parameter */ + /* moving from length field to data field */ + cur += sizeof(int); + emipc_add_param_to_param_list(param_list, (void*)cur, len); + + EM_DEBUG_LOG("Parsing stream : element %d is %dbyte long ", i, len); + + /* move to next parameter */ + cur += len; } - + + EM_DEBUG_FUNC_END(); return true; } -EXPORT_API unsigned char *emipc_get_stream_of_param_list(emipc_param_list *param_list) +EXPORT_API unsigned char *emipc_serialize_param_list(emipc_param_list *param_list, int *stream_length) { EM_DEBUG_FUNC_BEGIN(); if(param_list->byte_stream) return param_list->byte_stream; - - int stream_len = emipc_get_stream_length_of_param_list(param_list); - - if (stream_len > 0) { + + int stream_len = emipc_sum_param_list_length (param_list); + + if (stream_len <= 0) { + EM_DEBUG_EXCEPTION("stream_len error %d", stream_len); + EM_SAFE_FREE(param_list->byte_stream); + return NULL; + } + param_list->byte_stream = (unsigned char*)calloc(1, stream_len); int pos = sizeof(long)*eSTREAM_COUNT; if (pos + (int)sizeof(param_list->param_count) > stream_len ) { - EM_DEBUG_EXCEPTION("%d > stream_len", pos + sizeof(param_list->param_count)); + EM_DEBUG_EXCEPTION("%d > stream_len", pos + sizeof(param_list->param_count)); EM_SAFE_FREE(param_list->byte_stream); return NULL; } - + memcpy((param_list->byte_stream + pos), ¶m_list->param_count, sizeof(param_list->param_count)); - + pos += sizeof(long); int index = 0, length = 0; - /* check memory overflow */ - for(index=0; index<param_list->param_count; index++) { - length = emipc_get_length(param_list->params[index]); - if (length <= 0) { - EM_DEBUG_EXCEPTION("index = %d, length = %d", index, length); - EM_SAFE_FREE(param_list->byte_stream); - return NULL; - } - - if (pos + (int)sizeof(long) > stream_len) { - EM_DEBUG_EXCEPTION("%d > stream_len", pos + sizeof(long)); - EM_SAFE_FREE(param_list->byte_stream); - return NULL; - } - memcpy((param_list->byte_stream+pos), &length, sizeof(long)); - pos += sizeof(long); - - if (pos + length > stream_len) { - EM_DEBUG_EXCEPTION("%d > stream_len", pos + length); - EM_SAFE_FREE(param_list->byte_stream); - return NULL; - } - + /* stream format */ + /* | param1 length | (param1 data) | param2 length | (param2 data) | ... |*/ + /* if param is 0 long, the param data is omitted */ + for(index=0; index<param_list->param_count; index++) { + length = emipc_get_length(param_list->params[index]); + if (length < 0) { + EM_DEBUG_EXCEPTION("index = %d, length = %d", index, length); + EM_SAFE_FREE(param_list->byte_stream); + return NULL; + } + + if (pos + (int)sizeof(long) > stream_len) { + EM_DEBUG_EXCEPTION("%d > stream_len", pos + sizeof(long)); + EM_SAFE_FREE(param_list->byte_stream); + return NULL; + } + /* write param i length */ + memcpy((param_list->byte_stream+pos), &length, sizeof(long)); + pos += sizeof(long); + + if (pos + length > stream_len) { + EM_DEBUG_EXCEPTION("%d > stream_len", pos + length); + EM_SAFE_FREE(param_list->byte_stream); + return NULL; + } + /* write param i data if length is greater than 0 */ + if( length > 0 ) { memcpy((param_list->byte_stream+pos), emipc_get_data(param_list->params[index]), length); pos += length; } - return param_list->byte_stream; } - - EM_DEBUG_EXCEPTION("failed."); - EM_SAFE_FREE(param_list->byte_stream); + *stream_length = stream_len; EM_DEBUG_FUNC_END(); - return NULL; + return param_list->byte_stream; } -EXPORT_API int emipc_get_stream_length_of_param_list(emipc_param_list *param_list) +EXPORT_API int emipc_sum_param_list_length(emipc_param_list *param_list) { int length = sizeof(long) * eSTREAM_DATA; int index; @@ -131,7 +176,7 @@ EXPORT_API int emipc_get_stream_length_of_param_list(emipc_param_list *param_lis return length; } -EXPORT_API bool emipc_add_param_of_param_list(emipc_param_list *param_list, void *data, int len) +EXPORT_API bool emipc_add_param_to_param_list(emipc_param_list *param_list, void *data, int len) { EM_DEBUG_FUNC_BEGIN(); if (emipc_set_param(&(param_list->params[param_list->param_count]), data, len)) { @@ -142,6 +187,14 @@ EXPORT_API bool emipc_add_param_of_param_list(emipc_param_list *param_list, void return false; } +EXPORT_API void emipc_add_dynamic_param_to_param_list(emipc_param_list *param_list, void *data, int len) +{ + EM_DEBUG_FUNC_BEGIN(); + emipc_set_dynamic_param(&(param_list->params[param_list->param_count]), data, len); + param_list->param_count++; + EM_SAFE_FREE(param_list->byte_stream); +} + EXPORT_API void *emipc_get_param_of_param_list(emipc_param_list *param_list, int index) { EM_DEBUG_FUNC_BEGIN("index [%d]", index); @@ -162,16 +215,4 @@ EXPORT_API int emipc_get_param_len_of_param_list(emipc_param_list *param_list, i return emipc_get_length(param_list->params[index]); } -EXPORT_API int emipc_get_param_count_of_param_list(emipc_param_list *param_list) -{ - EM_DEBUG_FUNC_BEGIN("Parameter count [%d]", param_list->param_count); - return param_list->param_count; -} -static long emipc_parse_parameter_count(void *stream) -{ - EM_DEBUG_FUNC_BEGIN(); - long *parameter_count_position = (long *)stream + eSTREAM_COUNT; - - return *parameter_count_position; -} diff --git a/email-ipc/email-ipc-api/email-ipc-param.c b/email-ipc/email-ipc-api/email-ipc-param.c index 57db8c3..b66d32a 100755 --- a/email-ipc/email-ipc-api/email-ipc-param.c +++ b/email-ipc/email-ipc-api/email-ipc-param.c @@ -48,6 +48,25 @@ EXPORT_API bool emipc_set_param(emipc_param *param, void *data, int len) return true; } +EXPORT_API void emipc_set_dynamic_param(emipc_param *param, void *data, int len) +{ + EM_DEBUG_FUNC_BEGIN(); + + if (!param) { + EM_DEBUG_EXCEPTION("Invalid paramter"); + return; + } + + /* even take care of null data */ + param->data = data; + param->length = len; +} + +EXPORT_API void emipc_free_param(emipc_param param) +{ + EM_SAFE_FREE(param.data); +} + EXPORT_API int emipc_get_length(emipc_param param) { return param.length; diff --git a/email-ipc/email-ipc-api/include/email-ipc-api-info.h b/email-ipc/email-ipc-api/include/email-ipc-api-info.h index 705b97d..a860b5e 100755 --- a/email-ipc/email-ipc-api/include/email-ipc-api-info.h +++ b/email-ipc/email-ipc-api/include/email-ipc-api-info.h @@ -36,27 +36,17 @@ typedef struct { emipc_param_list *params[2]; } emipc_email_api_info; -EXPORT_API bool emipc_set_api_id_of_api_info(emipc_email_api_info *api_info, long api_id); +/*EXPORT_API bool emipc_set_app_id_of_api_info(emipc_email_api_info *api_info, long app_id); */ -EXPORT_API long emipc_get_api_id_of_api_info(emipc_email_api_info *api_info); +EXPORT_API bool emipc_deserialize_api_info(emipc_email_api_info *api_info, EPARAMETER_DIRECTION direction, void *stream); -EXPORT_API bool emipc_set_app_id_of_api_info(emipc_email_api_info *api_info, long app_id); +EXPORT_API unsigned char *emipc_serialize_api_info(emipc_email_api_info *api_info, EPARAMETER_DIRECTION direction, int *stream_len); -EXPORT_API long emipc_get_app_id_of_api_info(emipc_email_api_info *api_info); - -EXPORT_API bool emipc_set_response_id_of_api_info(emipc_email_api_info *api_info, long response_id); - -EXPORT_API long emipc_get_response_id_of_api_info(emipc_email_api_info *api_info); - -EXPORT_API bool emipc_parse_stream_of_api_info(emipc_email_api_info *api_info, EPARAMETER_DIRECTION direction, void *stream); - -EXPORT_API unsigned char *emipc_get_stream_of_api_info(emipc_email_api_info *api_info, EPARAMETER_DIRECTION direction); - -EXPORT_API int emipc_get_stream_length_of_api_info(emipc_email_api_info *api_info, EPARAMETER_DIRECTION direction); +/*EXPORT_API int emipc_get_stream_length_of_api_info(emipc_email_api_info *api_info, EPARAMETER_DIRECTION direction); */ EXPORT_API void *emipc_get_parameters_of_api_info(emipc_email_api_info *api_info, EPARAMETER_DIRECTION direction); - +EXPORT_API bool emipc_free_api_info(emipc_email_api_info *api_info); /* don't insert empty line */ #define EM_APIID_TO_STR(nAPIID) \ @@ -67,6 +57,12 @@ EXPORT_API void *emipc_get_parameters_of_api_info(emipc_email_api_info *api_info case _EMAIL_API_ADD_ACCOUNT:\ s = "_EMAIL_API_ADD_ACCOUNT";\ break;\ + case _EMAIL_API_DELETE_ACCOUNT:\ + s = "_EMAIL_API_DELETE_ACCOUNT";\ + break;\ + case _EMAIL_API_UPDATE_ACCOUNT:\ + s = "_EMAIL_API_UPDATE_ACCOUNT";\ + break;\ case _EMAIL_API_ADD_MAILBOX:\ s = "_EMAIL_API_ADD_MAILBOX";\ break;\ @@ -76,6 +72,12 @@ EXPORT_API void *emipc_get_parameters_of_api_info(emipc_email_api_info *api_info case _EMAIL_API_UPDATE_MAILBOX:\ s = "_EMAIL_API_UPDATE_MAILBOX";\ break;\ + case _EMAIL_API_RENAME_MAILBOX:\ + s = "_EMAIL_API_RENAME_MAILBOX";\ + break;\ + case _EMAIL_API_SET_MAILBOX_TYPE:\ + s = "_EMAIL_API_SET_MAILBOX_TYPE";\ + break;\ case _EMAIL_API_SET_MAIL_SLOT_SIZE:\ s = "_EMAIL_API_SET_MAIL_SLOT_SIZE";\ break;\ @@ -154,9 +156,6 @@ EXPORT_API void *emipc_get_parameters_of_api_info(emipc_email_api_info *api_info case _EMAIL_API_MODIFY_SEEN_FLAG_OF_THREAD:\ s = "_EMAIL_API_MODIFY_SEEN_FLAG_OF_THREAD";\ break;\ - case _EMAIL_API_UPDATE_ACCOUNT:\ - s = "_EMAIL_API_UPDATE_ACCOUNT";\ - break;\ case _EMAIL_API_ADD_ATTACHMENT:\ s = "_EMAIL_API_ADD_ATTACHMENT";\ break;\ @@ -220,6 +219,9 @@ EXPORT_API void *emipc_get_parameters_of_api_info(emipc_email_api_info *api_info case _EMAIL_API_GET_PASSWORD_LENGTH_OF_ACCOUNT:\ s = "_EMAIL_API_GET_PASSWORD_LENGTH_OF_ACCOUNT";\ break;\ + case _EMAIL_API_SHOW_USER_MESSAGE:\ + s = "_EMAIL_API_SHOW_USER_MESSAGE";\ + break;\ default : \ s = "UNKNOWN_APIID";\ }\ diff --git a/email-ipc/email-ipc-api/include/email-ipc-param-list.h b/email-ipc/email-ipc-api/include/email-ipc-param-list.h index c7d71ba..5e7be71 100755 --- a/email-ipc/email-ipc-api/include/email-ipc-param-list.h +++ b/email-ipc/email-ipc-api/include/email-ipc-param-list.h @@ -41,20 +41,24 @@ typedef struct { unsigned char *byte_stream; } emipc_param_list; +EXPORT_API emipc_param_list *emipc_create_param_list(); + +EXPORT_API bool emipc_destroy_param_list(emipc_param_list *param_list); + EXPORT_API bool emipc_parse_stream_of_param_list(emipc_param_list *param_list, void *stream_data); -EXPORT_API unsigned char *emipc_get_stream_of_param_list(emipc_param_list *param_list); +EXPORT_API unsigned char *emipc_serialize_param_list(emipc_param_list *param_list, int *stream_length); + +EXPORT_API int emipc_sum_param_list_length (emipc_param_list *param_list); -EXPORT_API int emipc_get_stream_length_of_param_list(emipc_param_list *param_list); +EXPORT_API bool emipc_add_param_to_param_list(emipc_param_list *param_list, void *data, int len); -EXPORT_API bool emipc_add_param_of_param_list(emipc_param_list *param_list, void *data, int len); +EXPORT_API void emipc_add_dynamic_param_to_param_list(emipc_param_list *param_list, void *data, int len); EXPORT_API void *emipc_get_param_of_param_list(emipc_param_list *param_list, int index); EXPORT_API int emipc_get_param_len_of_param_list(emipc_param_list *param_list, int index); -EXPORT_API int emipc_get_param_count_of_param_list(emipc_param_list *param_list); - #endif /* _IPC_PARAMLIST_H_ */ diff --git a/email-ipc/email-ipc-api/include/email-ipc-param.h b/email-ipc/email-ipc-api/include/email-ipc-param.h index 361927b..e80425a 100755 --- a/email-ipc/email-ipc-api/include/email-ipc-param.h +++ b/email-ipc/email-ipc-api/include/email-ipc-param.h @@ -32,6 +32,10 @@ typedef struct { EXPORT_API bool emipc_set_param(emipc_param *param, void *data, int len); +EXPORT_API void emipc_set_dynamic_param(emipc_param *param, void *data, int len); + +EXPORT_API void emipc_free_param(emipc_param param); + EXPORT_API int emipc_get_length(emipc_param param); EXPORT_API void *emipc_get_data(emipc_param param); |