3 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * Licensed under the Apache License, Version 2.0 (the License);
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
21 #include "utility/sync_util.h"
22 #include "engine-controller/param_value.h"
23 #include "engine-controller/param_value_internal.h"
26 #define EXPORT_API __attribute__ ((visibility("default")))
29 #ifndef SYNC_AGENT_LOG
31 #define LOG_TAG "AF_EC"
34 EXPORT_API void sync_agent_set_param_value(sync_agent_ec_param_value_u * param_value, sync_agent_ec_value_type_e value_type, sync_agent_ec_constpointer pValue)
38 retm_if(param_value == NULL, "sync_agent_ec_param_value_u is NULL !!");
42 case SYNC_AGENT_EC_VALUE_TYPE_BOOLEAN:
43 param_value->boolean_value = *(sync_agent_ec_boolean *) pValue;
45 case SYNC_AGENT_EC_VALUE_TYPE_CHAR:
46 param_value->char_value = *(sync_agent_ec_char *) pValue;
48 case SYNC_AGENT_EC_VALUE_TYPE_UCHAR:
49 param_value->uchar_value = *(sync_agent_ec_uchar *) pValue;
51 case SYNC_AGENT_EC_VALUE_TYPE_INT:
52 param_value->int_value = *(sync_agent_ec_int *) pValue;
54 case SYNC_AGENT_EC_VALUE_TYPE_UINT:
55 param_value->uint_value = *(sync_agent_ec_uint *) pValue;
57 case SYNC_AGENT_EC_VALUE_TYPE_FLOAT:
58 param_value->float_value = *(sync_agent_ec_float *) pValue;
60 case SYNC_AGENT_EC_VALUE_TYPE_DOUBLE:
61 param_value->double_value = *(sync_agent_ec_double *) pValue;
63 case SYNC_AGENT_EC_VALUE_TYPE_STRUCT:
64 param_value->pointer_value = *(sync_agent_ec_pointer *) pValue;
74 void ec_set_param_value_with_other_param_value(sync_agent_ec_param_value_u * dest_param_value, sync_agent_ec_param_value_u * src_param_value)
78 retm_if(dest_param_value == NULL, "sync_agent_ec_param_value_u is NULL !!");
80 memcpy(dest_param_value, src_param_value, sizeof(sync_agent_ec_param_value_u));
85 EXPORT_API void sync_agent_get_param_value(sync_agent_ec_param_value_u * param_value, sync_agent_ec_value_type_e value_type, sync_agent_ec_pointer value)
89 retm_if(param_value == NULL, "sync_agent_ec_param_value_u is NULL !!");
93 case SYNC_AGENT_EC_VALUE_TYPE_BOOLEAN:
94 *(sync_agent_ec_boolean *) value = param_value->boolean_value;
96 case SYNC_AGENT_EC_VALUE_TYPE_CHAR:
97 *(sync_agent_ec_char *) value = param_value->char_value;
99 case SYNC_AGENT_EC_VALUE_TYPE_UCHAR:
100 *(sync_agent_ec_uchar *) value = param_value->uchar_value;
102 case SYNC_AGENT_EC_VALUE_TYPE_INT:
103 *(sync_agent_ec_int *) value = param_value->int_value;
105 case SYNC_AGENT_EC_VALUE_TYPE_UINT:
106 *(sync_agent_ec_uint *) value = param_value->uint_value;
108 case SYNC_AGENT_EC_VALUE_TYPE_FLOAT:
109 *(sync_agent_ec_float *) value = param_value->float_value;
111 case SYNC_AGENT_EC_VALUE_TYPE_DOUBLE:
112 *(sync_agent_ec_double *) value = param_value->double_value;
114 case SYNC_AGENT_EC_VALUE_TYPE_STRUCT:
115 *(sync_agent_ec_pointer *) value = param_value->pointer_value;