Tizen 2.1 base
[apps/home/ug-myfile-efl.git] / src / include / mf-ug-search-internal.h
1 /*
2  * Copyright 2012          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
22 #ifndef _MF_SEARCH_INTERNAL_H_
23 #define _MF_SEARCH_INTERNAL_H_
24
25 #include "mf-ug-search.h"
26
27 #ifdef MS_USE_DEF_LOG
28
29 #include "mf-ug-dlog.h"
30
31 #define ms_debug(fmt , args...)  ug_debug
32 #define ms_info(fmt , args...)  ug_debug
33 #define ms_warn(fmt , args...)  ug_debug
34 #define ms_error(fmt , args...)  ug_debug
35 #define ms_assert(fmt , args...)  ug_debug
36
37 #else
38
39
40 #ifdef DEBUG_ON
41 #define ms_debug(fmt , args...)  do { printf("[%10s:%4d][D] "fmt"\n", __func__, __LINE__, ##args); } while (0)
42 #define ms_info(fmt , args...)  do { printf("[%10s:%4d][I] "fmt"\n", __func__, __LINE__, ##args); } while (0)
43 #define ms_warn(fmt , args...)  do { printf("[%10s:%4d][W] "fmt"\n", __func__, __LINE__, ##args); } while (0)
44 #define ms_error(fmt , args...)  do { printf("[%10s:%4d][E] "fmt"\n", __func__, __LINE__, ##args); } while (0)
45 #define ms_assert(fmt , args...)  do { printf("[%10s:%4d][A] "fmt"\n", __func__, __LINE__, ##args); } while (0)
46 #else
47 #define ms_debug(fmt , args...)  do { (void)0; } while (0)
48 #define ms_info(fmt , args...)  do { (void)0; } while (0)
49 #define ms_warn(fmt , args...)  do { (void)0; } while (0)
50 #define ms_error(fmt , args...)  do { (void)0; } while (0)
51 #define ms_assert(fmt , args...)  do { (void)0; } while (0)
52 #endif
53 #endif
54
55 /**
56  * Enumerations of search state
57  **/
58
59 int _mf_ug_search_init(ms_handle_t **handle);
60 int _mf_ug_search_start(ms_handle_t *handle, const char **root_path, unsigned int path_num, const char *needle, mf_search_option option,
61                      void *user_data);
62 int _mf_ug_search_stop(ms_handle_t *handle);
63 void _mf_ug_search_finalize(ms_handle_t **handle);
64
65 /*+++++++++++++++++++++++++ UTIL APIs ++++++++++++++++++++++++++++++ */
66
67 gchar *_mf_ug_search_result_dir_get(mf_search_result_t *result);
68 gchar *_mf_ug_search_result_file_get(mf_search_result_t *result);
69 gboolean _mf_ug_search_result_is_end(mf_search_result_t *result);
70 gchar *_mf_ug_search_result_current_dir_get(mf_search_result_t *result);
71 guint _mf_ug_search_result_total_count_get(mf_search_result_t *result);
72
73 #endif