Tizen 2.1 base
[platform/upstream/hplip.git] / prnt / hpijs / ijs_client.h
1 /**
2  * Copyright (c) 2001-2002 artofcode LLC.
3  *
4  * Permission is hereby granted, free of charge, to any person
5  * obtaining a copy of this software and associated documentation
6  * files (the "Software"), to deal in the Software without
7  * restriction, including without limitation the rights to use, copy,
8  * modify, merge, publish, distribute, sublicense, and/or sell copies
9  * of the Software, and to permit persons to whom the Software is
10  * furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be
13  * included in all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23 **/
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 typedef struct _IjsClientCtx IjsClientCtx;
30
31 IjsClientCtx *
32 ijs_invoke_server (const char *server_cmd);
33
34 int 
35 ijs_exec_server (const char *server_cmd, int *pfd_to, int *pfd_from, 
36     int *pchild_pid);
37
38 int
39 ijs_client_begin_cmd (IjsClientCtx *ctx, IjsCommand cmd);
40
41 int
42 ijs_client_send_int (IjsClientCtx *ctx, int val);
43
44 int
45 ijs_client_send_cmd (IjsClientCtx *ctx);
46
47 int
48 ijs_client_send_cmd_wait (IjsClientCtx *ctx);
49
50 int
51 ijs_client_send_data_wait (IjsClientCtx *ctx, IjsJobId job_id,
52                            const char *buf, int size);
53
54 int
55 ijs_client_open (IjsClientCtx *ctx);
56
57 int
58 ijs_client_close (IjsClientCtx *ctx);
59
60 int
61 ijs_client_begin_job (IjsClientCtx *ctx, IjsJobId job_id);
62
63 int
64 ijs_client_end_job (IjsClientCtx *ctx, IjsJobId job_id);
65
66 int
67 ijs_client_list_params (IjsClientCtx *ctx, IjsJobId job_id,
68                        char *value, int value_size);
69
70 int
71 ijs_client_enum_param (IjsClientCtx *ctx, IjsJobId job_id,
72                        const char *key, char *value,
73                        int value_size);
74
75 int
76 ijs_client_set_param (IjsClientCtx *ctx, IjsJobId job_id,
77                       const char *key, const char *value,
78                       int value_size);
79
80 int
81 ijs_client_get_param (IjsClientCtx *ctx, IjsJobId job_id,
82                       const char *key, char *value,
83                       int value_size);
84
85 int
86 ijs_client_begin_page (IjsClientCtx *ctx, IjsJobId job_id);
87
88 int
89 ijs_client_end_page (IjsClientCtx *ctx, IjsJobId job_id);
90
91 int
92 ijs_client_get_version (IjsClientCtx *ctx);
93
94 #ifdef __cplusplus
95 }
96 #endif