4 * Copyright (c) 2014 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Yongjin Kim <youth.kim@samsung.com>
7 * Jinhyeong Ahn <jinh.ahn@samsung.com>
8 * Jiwon Kim <jiwon177.kim@samsung.com>
10 * Licensed under the Apache License, Version 2.0 (the "License");
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
14 * http://www.apache.org/licenses/LICENSE-2.0
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
24 #ifndef __TIZEN_CONVERGENCE_SAL_IPC_H__
25 #define __TIZEN_CONVERGENCE_SAL_IPC_H__
28 #define API __attribute__ ((visibility("default")))
39 #define SAL_IPC_STR(x) (x==NULL)?"":x
42 * Service Adaptor D-Bus server bus name.
44 #define SERVICE_ADAPTOR_BUS_NAME "org.tizen.serviceadaptor.client"
47 * Service Adaptor D-Bus server object path.
49 #define SERVICE_ADAPTOR_OBJECT_PATH "/org/tizen/serviceadaptor/client"
52 * Service Adaptor D-Bus interface.
54 #define SERVICE_ADAPTOR_INTERFACE "org.tizen.serviceadaptor.client.interface"
59 #define service_adaptor_connect_req_s_type_length 1
60 #define service_adaptor_connect_req_s_type \
65 #define service_adaptor_connect_res_s_type_length 1
66 #define service_adaptor_connect_res_s_type \
68 "a(s)" /* char **uri */ \
71 #define service_adaptor_disconnect_s_type_length 1
72 #define service_adaptor_disconnect_s_type \
77 #define service_plugin_create_s_type_length 1
78 #define service_plugin_create_s_type \
83 #define service_plugin_destroy_s_type_length 1
84 #define service_plugin_destroy_s_type \
89 #define service_auth_oauth1_s_type_length 2
90 #define service_auth_oauth1_s_type \
92 "s" /* char *access_token */ \
93 "s" /* char *operation */ \
96 #define service_auth_oauth1_req_s_type_length 2
97 #define service_auth_oauth1_req_s_type \
100 service_auth_oauth1_s_type /* service_auth_oauth1_s oauth1 */ \
103 #define service_auth_oauth1_res_s_type_length 1
104 #define service_auth_oauth1_res_s_type \
106 service_auth_oauth1_s_type /* service_auth_oauth1_s oauth1 */ \
109 #define service_storage_cloud_file_s_type_length 6
110 #define service_storage_cloud_file_s_type \
112 "b" /* bool is_dir */ \
113 "s" /* char *dir_path */ \
114 "s" /* char *local_path */ \
115 "s" /* char *cloud_path */ \
116 "t" /* uint64 size */ \
117 "s" /* char *operation */ \
120 #define service_storage_cloud_file_req_s_type_length 2
121 #define service_storage_cloud_file_req_s_type \
123 "s" /* char *uri */ \
124 service_storage_cloud_file_s_type /* service_storage_cloud_file_s file */ \
127 #define service_storage_cloud_file_res_s_type_length 2
128 #define service_storage_cloud_file_res_s_type \
130 service_storage_cloud_file_s_type /* service_storage_cloud_file_s file */ \
131 "a" service_storage_cloud_file_s_type /* GList *files */ \
135 * array of structures
137 #define plugin_list_type "a(s)"
138 #define file_list_type "a" service_storage_cloud_file_s_type
141 * append error code to the type
143 #define RETURN_LENGTH 2
148 #define DBUS_SERVICE_ADAPTOR "dbus_00"
149 #define DBUS_SERVICE_PLUGIN "dbus_01"
150 #define DBUS_SERVICE_AUTH "dbus_02"
151 #define DBUS_SERVICE_STORAGE "dbus_03"
152 #define DBUS_NAME_LENGTH 7
154 #define DBUS_SERVICE_ADAPTOR_CONNECT_METHOD DBUS_SERVICE_ADAPTOR "_service_adaptor_connect"
155 #define DBUS_SERVICE_ADAPTOR_DISCONNECT_METHOD DBUS_SERVICE_ADAPTOR "_service_adaptor_disconnect"
157 #define DBUS_SERVICE_PLUGIN_CREATE_METHOD DBUS_SERVICE_PLUGIN "_service_plugin_create"
158 #define DBUS_SERVICE_PLUGIN_DESTROY_METHOD DBUS_SERVICE_PLUGIN "_service_plugin_destroy"
160 #define DBUS_SERVICE_AUTH_OAUTH1_METHOD DBUS_SERVICE_AUTH "_service_auth_oauth1"
162 #define DBUS_SERVICE_STORAGE_CLOUD_FILE_METHOD DBUS_SERVICE_STORAGE "_service_storage_cloud_file"
164 #define DBUS_SERVICE_ADAPTOR_NOTIFY_SIGNAL DBUS_SERVICE_ADAPTOR "_service_adaptor_signal_notify"
166 typedef struct _ipc_reply_data_s
168 GDBusMethodInvocation *invocation;
171 typedef struct _ipc_reply_data_s *ipc_reply_data_h;
173 char *ipc_insure_g_variant_dup_string(GVariant *string);
174 void ipc_insure_g_variant_builder_add_array_string(GVariantBuilder *builder, const char *str);
175 char *ipc_make_return_type(const char *type);
176 void ipc_create_error_msg(int code, char **ipc_msg);
177 void ipc_create_variant_info(GVariant *parameters, int size, GVariant ***var_info);
178 void ipc_destroy_variant_info(GVariant **var_info, int size);
179 void ipc_free_reply_data(ipc_reply_data_h reply);
185 #endif /* __TIZEN_CONVERGENCE_SAL_IPC_H__ */