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.
26 #include "storage-expand.h"
27 #include <sys/statvfs.h>
30 #define API __attribute__ ((visibility("default")))
34 #define __WEAK__ __attribute__ ((weak))
37 #ifndef __CONSTRUCTOR__
38 #define __CONSTRUCTOR__ __attribute__ ((constructor))
41 #ifndef __DESTRUCTOR__
42 #define __DESTRUCTOR__ __attribute__ ((destructor))
45 enum storage_cb_type {
46 STORAGE_CALLBACK_STATE,
50 struct storage_cb_info {
52 storage_state_changed_cb state_cb;
58 const char *(*root) (void);
59 int (*get_state) (void);
60 int (*get_space) (unsigned long long *total, unsigned long long *available);
61 int (*register_cb) (enum storage_cb_type type, struct storage_cb_info *info);
62 int (*unregister_cb) (enum storage_cb_type type, struct storage_cb_info *info);
66 #define STORAGE_OPS_REGISTER(st) \
67 static void __CONSTRUCTOR__ module_init(void) \
71 static void __DESTRUCTOR__ module_exit(void) \
76 void add_device(const struct storage_ops *st);
77 void remove_device(const struct storage_ops *st);
79 int storage_get_external_memory_size_with_path(char *path, struct statvfs *buf);
80 int storage_get_external_memory_size64_with_path(char *path, struct statvfs *buf);