5fb3e3dcc96136a660ff71af57b35af736cf7788
[apps/core/preloaded/print-service.git] / include / pt_utils.h
1 /*
2 *       Printservice
3 *
4 * Copyright 2012  Samsung Electronics Co., Ltd
5
6 * Licensed under the Flora License, Version 1.1 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9
10 * http://floralicense.org/license/
11
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 */
19
20 #ifndef __PT_UTILS_H__
21 #define __PT_UTILS_H__
22 #include <Ecore.h>
23 #include <net/if.h>
24
25 #define MAX_SIZE        128
26 #define MAX_MSG_LEN 512
27
28 typedef enum {
29         COMMAND_HELP,
30         COMMAND_VERSION,
31         COMMAND_BROWSE_SERVICES,
32         COMMAND_BROWSE_ALL_SERVICES,
33         COMMAND_BROWSE_DOMAINS
34 #if defined(HAVE_GDBM) || defined(HAVE_DBM)
35         , COMMAND_DUMP_STDB
36 #endif
37 } Command;
38 typedef struct Config {
39         int verbose;
40         int terminate_on_all_for_now;
41         int terminate_on_cache_exhausted;
42         char *domain;
43         char *stype;
44         int ignore_local;
45         Command command;
46         int resolve;
47         int no_fail;
48         int parsable;
49 #if defined(HAVE_GDBM) || defined(HAVE_DBM)
50         int no_db_lookup;
51 #endif
52 } Config;
53
54 /*********** search *****************/
55
56 /**
57  *      This function let the app clear the list of previous searching
58  *      @return    void
59  *      @param[in] list the pointer to the printers list
60  */
61 void pt_utils_free_search_list(Eina_List *list);
62
63 /**
64  *      This function let the app clear the list of previous searching
65  *      @return    void
66  *      @param[in] list the pointer to the printers list
67  */
68 void pt_utils_free_local_printer_list(Eina_List *list);
69
70 void pt_utils_free_printing_thd_list(Eina_List *list);
71
72 /*********** print *****************/
73
74 char *pt_utils_filename_from_URI(const char *uri);
75
76 int __standardization(char *name);
77
78 int pt_utils_get_mfg_mdl(const char *printer, char **mfg, char **mdl);
79
80 int _pt_filecopy(const char *org_file_path, const char *dest_file_path);
81
82 void pt_utils_remove_files_in(const char *path);
83
84 #endif /* __PT_UTILS_H__ */