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"
29 #define API __attribute__ ((visibility("default")))
33 #define __WEAK__ __attribute__ ((weak))
36 #ifndef __CONSTRUCTOR__
37 #define __CONSTRUCTOR__ __attribute__ ((constructor))
40 #ifndef __DESTRUCTOR__
41 #define __DESTRUCTOR__ __attribute__ ((destructor))
44 enum storage_cb_type {
45 STORAGE_CALLBACK_STATE,
49 struct storage_cb_info {
51 storage_state_changed_cb state_cb;
57 const char *(*root) (void);
58 int (*get_state) (void);
59 int (*get_space) (unsigned long long *total, unsigned long long *available);
60 int (*register_cb) (enum storage_cb_type type, struct storage_cb_info *info);
61 int (*unregister_cb) (enum storage_cb_type type, struct storage_cb_info *info);
65 #define STORAGE_OPS_REGISTER(st) \
66 static void __CONSTRUCTOR__ module_init(void) \
70 static void __DESTRUCTOR__ module_exit(void) \
75 void add_device(const struct storage_ops *st);
76 void remove_device(const struct storage_ops *st);