40e56b54c754ebb913e1bd8e9ae448cd61446f5c
[apps/core/preloaded/print-service.git] / TC / getppd.h
1 /*
2 *       Printservice
3 *
4 * Copyright 2013  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 __PRINT_GETPPD_H__
21 #define __PRINT_GETPPD_H__
22
23 #include <stdio.h>
24 #include <stdbool.h>
25 #include <pt_db.h>
26
27 typedef enum {
28         PT_FORCE_CLEAN = 0,
29         PT_SOFT_CLEAN       // Don't fail if file doesn't exist
30 } pt_clean_file;
31
32 struct _config {
33         const char *drvstr;
34         const char *product;
35         const char *model;
36         bool find_product;
37         bool find_model;
38 };
39
40 typedef struct _config config;
41
42 struct _resource {
43         config *cfg;
44         drvm *drv;
45         char *buffer;
46         char *tempfile;
47 };
48
49 typedef struct _resource resource;
50
51 /* Base initialization function */
52 config *initialization(int argc, char **argv);
53
54 /* Free all resources which was allocated/opened*/
55 void clean_all_resources(void);
56
57 /* Free memory allocated by drvm structure */
58 bool clean_drvm(drvm *drv);
59
60 /* Clean buffer which is allocated for */
61 /* file operations bufferization (I/O) */
62 void clean_buffer(char *buffer);
63
64 /* Delete temporary files */
65 bool clean_tmp_file(const char *file, pt_clean_file type);
66
67 /* Output help strings */
68 void help(void);
69
70 #endif /* __PRINT_GETPPD_H__ */