Tizen 2.0 Release
[apps/core/preloaded/myfiles.git] / src / include / mf-search-internal.h
1 /*
2  * Copyright 2013         Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.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
7  *
8  *  http://floralicense.org/license/
9  *
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.
15  */
16
17
18
19
20
21 #ifndef _MF_SEARCH_INTERNAL_H_
22 #define _MF_SEARCH_INTERNAL_H_
23
24 #include "mf-search.h"
25
26 #ifdef MS_USE_DEF_LOG
27
28 #include "mf-dlog.h"
29
30 #define ms_debug(fmt , args...)  mf_debug
31 #define ms_info(fmt , args...)  mf_info
32 #define ms_warn(fmt , args...)  mf_warnig
33 #define ms_error(fmt , args...)  mf_error
34 #define ms_assert(fmt , args...)  mf_assert
35
36 #else
37
38
39 #ifdef DEBUG_ON
40 #define ms_debug(fmt , args...)  do { printf("[%10s:%4d][D] "fmt"\n", __func__, __LINE__, ##args); } while (0)
41 #define ms_info(fmt , args...)  do { printf("[%10s:%4d][I] "fmt"\n", __func__, __LINE__, ##args); } while (0)
42 #define ms_warn(fmt , args...)  do { printf("[%10s:%4d][W] "fmt"\n", __func__, __LINE__, ##args); } while (0)
43 #define ms_error(fmt , args...)  do { printf("[%10s:%4d][E] "fmt"\n", __func__, __LINE__, ##args); } while (0)
44 #define ms_assert(fmt , args...)  do { printf("[%10s:%4d][A] "fmt"\n", __func__, __LINE__, ##args); } while (0)
45 #else
46 #define ms_debug(fmt , args...)  do { (void)0; } while (0)
47 #define ms_info(fmt , args...)  do { (void)0; } while (0)
48 #define ms_warn(fmt , args...)  do { (void)0; } while (0)
49 #define ms_error(fmt , args...)  do { (void)0; } while (0)
50 #define ms_assert(fmt , args...)  do { (void)0; } while (0)
51 #endif
52 #endif
53
54 /**
55  * Enumerations of search state
56  **/
57
58 int _mf_search_init(ms_handle_t **handle);
59 int _mf_search_start(ms_handle_t *handle,
60         const char **root_path,
61         unsigned int path_num,
62         const char *needle,
63         mf_search_option option,
64         void *user_data,
65         mf_search_filter_cb func,
66         int category);
67 int _mf_search_stop(ms_handle_t *handle);
68 void _mf_search_finalize(ms_handle_t **handle);
69
70 /*+++++++++++++++++++++++++ UTIL APIs ++++++++++++++++++++++++++++++ */
71
72 gchar *_mf_search_result_dir_get(mf_search_result_t *result);
73 gchar *_mf_search_result_file_get(mf_search_result_t *result);
74 gboolean _mf_search_result_is_end(mf_search_result_t *result);
75 gchar *_mf_search_result_current_dir_get(mf_search_result_t *result);
76 guint _mf_search_result_total_count_get(mf_search_result_t *result);
77
78 #endif