Merge "Revert "Revert "Modify error type""" into tizen
[platform/core/multimedia/media-server.git] / src / common / include / media-common-utils.h
1 /*
2  *  Media Server
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Yong Yeon Kim <yy9875.kim@samsung.com>
7  *
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
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
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.
19  *
20  */
21
22 /**
23  * This file defines api utilities of contents manager engines.
24  *
25  * @file                media-common-utils.h
26  * @author      Yong Yeon Kim(yy9875.kim@samsung.com)
27  * @version     1.0
28  * @brief
29  */
30
31 #ifndef _MEDIA_SERVER_UTILS_H__
32 #define _MEDIA_SERVER_UTILS_H__
33
34 #include "media-common-types.h"
35
36 int
37 ms_db_init(bool need_db_create);
38
39 bool
40 ms_is_mmc_inserted(void);
41
42 void
43 ms_usb_vconf_cb(void *data);
44
45 int
46 ms_start(bool need_db_create);
47
48 void
49 ms_end(void);
50
51 ms_storage_type_t
52 ms_get_storage_type_by_full(const char *path, uid_t uid);
53
54 int
55 ms_strappend(char *res, const int size, const char *pattern,
56                  const char *str1, const char *str2);
57
58 int
59 ms_strcopy(char *res, const int size, const char *pattern,
60                const char *str1);
61
62 bool
63 ms_config_get_int(const char *key, int *value);
64
65 bool
66 ms_config_set_int(const char *key, int value);
67
68 bool
69 ms_config_get_str(const char *key, char *value);
70
71 bool
72 ms_config_set_str(const char *key, const char *value);
73
74 #ifdef FMS_PERF
75 void
76 ms_check_start_time(struct timeval *start_time);
77
78 void
79 ms_check_end_time(struct timeval *end_time);
80
81 void
82 ms_check_time_diff(struct timeval *start_time, struct timeval *end_time);
83 #endif/*FMS_PERF */
84
85
86 /**
87  * @}
88  */
89 #endif/*_MEDIA_SERVER_UTILS_H__*/
90