4 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
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
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
20 #ifndef __STORAGE_EXTERNAL_DBUS_H__
21 #define __STORAGE_EXTERNAL_DBUS_H__
26 #include <tzplatform_config.h>
29 #define STORAGE_EXT_BUS_NAME "org.tizen.system.storage"
30 #define STORAGE_EXT_PATH_MANAGER "/Org/Tizen/System/Storage/Block/Manager"
31 #define STORAGE_EXT_IFACE_MANAGER STORAGE_EXT_BUS_NAME".BlockManager"
32 #define STORAGE_EXT_PATH_STORAGE "/Org/Tizen/System/Storage/Storage"
33 #define STORAGE_EXT_IFACE_STORAGE STORAGE_EXT_BUS_NAME".storage"
36 STORAGE_EXT_UNMOUNTED,
40 enum storage_ext_state {
47 enum storage_ext_type {
50 STORAGE_EXT_MMC_EXTENDED_INTERNAL,
53 enum storage_ext_flags {
55 UNMOUNT_UNSAFE = 1 << 0,
58 FS_NOT_SUPPORTED = 1 << 3,
59 MOUNT_READONLY = 1 << 4,
62 typedef struct _storage_ext_device {
63 enum storage_ext_type type;
72 enum mount_state state;
73 bool primary; /* the first partition */
78 /* it's for 32bit file offset */
80 unsigned long int f_bsize;
81 unsigned long int f_frsize;
82 unsigned long int f_blocks;
83 unsigned long int f_bfree;
84 unsigned long int f_bavail;
85 unsigned long int f_files;
86 unsigned long int f_ffree;
87 unsigned long int f_favail;
88 unsigned long int f_fsid;
89 #ifdef _STATVFSBUF_F_UNUSED
92 unsigned long int f_flag;
93 unsigned long int f_namemax;
97 typedef int (*storage_ext_changed_cb)(storage_ext_device *dev, enum storage_ext_state state, void *data);
99 int storage_ext_is_supported(void);
100 void storage_ext_release_device(storage_ext_device **dev);
101 void storage_ext_release_list(dd_list **list);
102 int storage_ext_get_list(dd_list **list);
103 int storage_ext_get_statvfs(char *path, struct statvfs_32 *buf);
104 int storage_ext_get_statvfs_size64(char *path, struct statvfs *buf);
106 int storage_ext_register_device_change(storage_ext_changed_cb func, void *data);
107 void storage_ext_unregister_device_change(storage_ext_changed_cb func);
109 int storage_ext_get_device_info(int storage_id, storage_ext_device *info);
110 int storage_ext_get_storage_level(enum tzplatform_variable id, char **level);
112 /* storage-internal.c */
113 GVariant *dbus_method_call_sync(const gchar *dest, const gchar *path,
114 const gchar *iface, const gchar *method, GVariant *param);
116 #endif /* __STORAGE_EXTERNAL_DBUS_H__ */