4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Yong Yeon Kim <yy9875.kim@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
23 * This file defines api utilities of contents manager engines.
25 * @file media-server-db-svc.h
26 * @author Yong Yeon Kim(yy9875.kim@samsung.com)
30 #ifndef _MEDIA_SERVER_DB_SVC_H_
31 #define _MEDIA_SERVER_DB_SVC_H_
33 #include "media-server-types.h"
35 typedef int (*CHECK_ITEM)(const char*, const char*, char **);
36 typedef int (*CONNECT)(void**, char **);
37 typedef int (*DISCONNECT)(void*, char **);
38 typedef int (*CHECK_ITEM_EXIST)(void*, const char*, int, char **);
39 typedef int (*INSERT_ITEM_BEGIN)(void*, int, char **);
40 typedef int (*INSERT_ITEM_END)(void*, char **);
41 typedef int (*INSERT_ITEM)(void*, const char*, int, const char*, char **);
42 typedef int (*INSERT_ITEM_IMMEDIATELY)(void*, const char*, int, const char*, char **);
43 typedef int (*MOVE_ITEM_BEGIN)(void*, int, char **);
44 typedef int (*MOVE_ITEM_END)(void*, char **);
45 typedef int (*MOVE_ITEM)(void*, const char*, int, const char*, int, const char*, char **);
46 typedef int (*SET_ALL_STORAGE_ITEMS_VALIDITY)(void*, int, int, char **);
47 typedef int (*SET_ITEM_VALIDITY_BEGIN)(void*, int, char **);
48 typedef int (*SET_ITEM_VALIDITY_END)(void*, char **);
49 typedef int (*SET_ITEM_VALIDITY)(void*, const char*, int, const char*, int, char **);
50 typedef int (*DELETE_ITEM)(void*, const char*, int, char **);
51 typedef int (*DELETE_ALL_ITEMS_IN_STORAGE)(void*, int, char **);
52 typedef int (*DELETE_ALL_INVALID_ITMES_IN_STORAGE)(void*, int, char **);
53 typedef int (*UPDATE_BEGIN)(char **);
54 typedef int (*UPDATE_END)(char **);
55 typedef int (*REFRESH_ITEM)(void*, const char *, int, const char*, char**);
58 ms_load_functions(void);
61 ms_unload_functions(void);
64 ms_connect_db(void ***handle);
67 ms_disconnect_db(void ***handle);
70 ms_validate_item(void **handle, char *path);
73 ms_register_file(void **handle, const char *path, GAsyncQueue* queue);
76 ms_insert_item_batch(void **handle, const char *path);
79 ms_insert_item(void **handle, const char *path);
82 ms_delete_item(void **handle, const char *full_file_path);
85 ms_move_item(void **handle,
86 ms_storage_type_t src_store_type,
87 ms_storage_type_t dest_store_type,
88 const char *src_file_full_path,
89 const char *dest_file_full_path);
92 ms_delete_all_items(void **handle, ms_storage_type_t store_type);
95 ms_invalidate_all_items(void **handle, ms_storage_type_t store_type);
98 ms_delete_invalid_items(void **handle, ms_storage_type_t store_type);
101 ms_refresh_item(void **handle, const char *path);
104 ms_check_exist(void **handle, const char *path);
106 /****************************************************************************************************
108 *****************************************************************************************************/
111 ms_register_start(void **handle);
114 ms_register_end(void **handle);
117 ms_move_start(void **handle);
120 ms_move_end(void **handle);
123 ms_validate_start(void **handle);
126 ms_validate_end(void **handle);
128 typedef int (*CHECK_ITEM)(const char*, const char*, char **);
129 typedef int (*CONNECT)(void**, char **);
130 typedef int (*DISCONNECT)(void*, char **);
131 typedef int (*CHECK_ITEM_EXIST)(void*, const char*, int, char **);
132 typedef int (*INSERT_ITEM_IMMEDIATELY)(void*, const char*, int, const char*, char **);
133 typedef int (*SET_ALL_STORAGE_ITEMS_VALIDITY)(void*, int, int, char **);
136 ms_load_functions(void);
139 ms_unload_functions(void);
142 ms_connect_db(void ***handle);
145 ms_disconnect_db(void ***handle);
148 ms_insert_item(void **handle, const char *path);
151 ms_register_file(void **handle, const char *path);
154 ms_check_exist(void **handle, const char *path);
157 ms_invalidate_all_items(void **handle, ms_storage_type_t store_type);
160 #endif /*_MEDIA_SERVER_DB_SVC_H_*/