libgdbus: Move common gdbus interfaces to libsystem package
[platform/core/system/storaged.git] / apps / extended-sd / include / dbus-call.h
1 /*
2  * system-dbus
3  *
4  * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd.
5  *
6  * Licensed under the Apache License, Version 2.0 (the License);
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *     http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18
19
20 #ifndef __DBUS_H__
21 #define __DBUS_H__
22
23 #include <glib.h>
24 #include <gio/gio.h>
25 #include "extended-sd-main.h"
26
27 #define DBUS_REPLY_TIMEOUT      (-1)
28
29 #define STORAGED_BUS_NAME                    "org.tizen.system.storage"
30 #define STORAGED_OBJECT_PATH                 "/Org/Tizen/System/Storage"
31 #define STORAGED_INTERFACE_NAME              STORAGED_BUS_NAME
32
33 #define STORAGED_PATH_BLOCK                  STORAGED_OBJECT_PATH"/Block"
34 #define STORAGED_PATH_BLOCK_MANAGER          STORAGED_PATH_BLOCK"/Manager"
35 #define STORAGED_INTERFACE_BLOCK_MANAGER     STORAGED_INTERFACE_NAME".BlockManager"
36
37 #define VIEWTYPE_KEY                        "viewtype"
38 #define DEVPATH_KEY                         "dev_path"
39 #define MAPPING_NODE_KEY                    "mapping_node"
40 #define SDCARD_SETUP_TYPE                   "_SDCARD_SETUP_TYPE_"
41
42 struct dbus_int {
43         int *list;
44         int size;
45 };
46
47 int dbus_method_sync(const char *dest, const char *path,
48                 const char *interface, const char *method,
49                 const char *sig, char *param[]);
50 int dbus_method_sync_with_reply(const char *dest,
51                 const char *path, const char *interface,
52                 const char *method, const char *sig,
53                 char *param[], GVariant **info);
54
55 typedef void (*dbus_pending_cb)(void *data, GVariant *result, GError *err);
56
57 int dbus_method_async_with_reply(const char *dest, const char *path,
58                 const char *interface, const char *method,
59                 const char *sig, char *param[], dbus_pending_cb cb, int timeout, void *data);
60
61 /**
62  * If result is NULL, err is set.
63  * Do not invoke g_variant_unref() with result.
64  */
65
66 #endif