2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
27 #include <app_storage.h>
28 #include <app_storage_private.h>
34 #define LOG_TAG "CAPI_APPFW_APPLICATION_STORAGE"
36 #define INTERNAL_MEMORY_PATH "/opt/usr/media"
38 int storage_internal_get_state()
40 return STORAGE_STATE_MOUNTED;
43 static int storage_internal_set_state_cb(void *data)
48 static void storage_internal_unset_state_cb()
53 int storage_internal_get_space(unsigned long long *total, unsigned long long *available)
55 return storage_statfs(INTERNAL_MEMORY_PATH, total, available);
58 storage_device_h storage_internal_device()
60 storage_device_h device;
62 device = calloc(1, sizeof(struct storage_device_s));
66 LOGE("OUT_OF_MEMORY(0x%08x)", STORAGE_ERROR_OUT_OF_MEMORY);
70 device->type = STORAGE_TYPE_INTERNAL;
71 device->path = INTERNAL_MEMORY_PATH;
72 device->get_state = storage_internal_get_state;
73 device->set_state_cb = storage_internal_set_state_cb;
74 device->unset_state_cb = storage_internal_unset_state_cb;
75 device->get_space = storage_internal_get_space;