r25598: Add missing become_root/unbecome_root around calls of add_aliases.
[samba.git] / source / python / py_spoolss_jobs_conv.c
1 /* 
2    Python wrappers for DCERPC/SMB client routines.
3
4    Copyright (C) Tim Potter, 2002
5    
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 3 of the License, or
9    (at your option) any later version.
10    
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15    
16    You should have received a copy of the GNU General Public License
17    along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #include "python/py_spoolss.h"
21 #include "python/py_conv.h"
22
23 struct pyconv py_JOB_INFO_1[] = {
24         { "jobid", PY_UINT32, offsetof(JOB_INFO_1, jobid) },
25         { "printer_name", PY_UNISTR, offsetof(JOB_INFO_1, printername) },
26         { "server_name", PY_UNISTR, offsetof(JOB_INFO_1, machinename) },
27         { "user_name", PY_UNISTR, offsetof(JOB_INFO_1, username) },
28         { "document_name", PY_UNISTR, offsetof(JOB_INFO_1, document) },
29         { "data_type", PY_UNISTR, offsetof(JOB_INFO_1, datatype) },
30         { "text_status", PY_UNISTR, offsetof(JOB_INFO_1, text_status) },
31         { "status", PY_UINT32, offsetof(JOB_INFO_1, status) },
32         { "priority", PY_UINT32, offsetof(JOB_INFO_1, priority) },
33         { "position", PY_UINT32, offsetof(JOB_INFO_1, position) },
34         { "total_pages", PY_UINT32, offsetof(JOB_INFO_1, totalpages) },
35         { "pages_printed", PY_UINT32, offsetof(JOB_INFO_1, pagesprinted) },
36         { NULL }
37 };
38
39 struct pyconv py_JOB_INFO_2[] = {
40         { "jobid", PY_UINT32, offsetof(JOB_INFO_2, jobid) },
41         { "printer_name", PY_UNISTR, offsetof(JOB_INFO_2, printername) },
42         { "server_name", PY_UNISTR, offsetof(JOB_INFO_2, machinename) },
43         { "user_name", PY_UNISTR, offsetof(JOB_INFO_2, username) },
44         { "document_name", PY_UNISTR, offsetof(JOB_INFO_2, document) },
45         { "notify_name", PY_UNISTR, offsetof(JOB_INFO_2, notifyname) },
46         { "data_type", PY_UNISTR, offsetof(JOB_INFO_2, datatype) },
47         { "print_processor", PY_UNISTR, offsetof(JOB_INFO_2, printprocessor) },
48         { "parameters", PY_UNISTR, offsetof(JOB_INFO_2, parameters) },
49         { "driver_name", PY_UNISTR, offsetof(JOB_INFO_2, drivername) },
50         { "text_status", PY_UNISTR, offsetof(JOB_INFO_2, text_status) },
51         { "status", PY_UINT32, offsetof(JOB_INFO_2, status) },
52         { "priority", PY_UINT32, offsetof(JOB_INFO_2, priority) },
53         { "position", PY_UINT32, offsetof(JOB_INFO_2, position) },
54         { "start_time", PY_UINT32, offsetof(JOB_INFO_2, starttime) },
55         { "until_time", PY_UINT32, offsetof(JOB_INFO_2, untiltime) },
56         { "total_pages", PY_UINT32, offsetof(JOB_INFO_2, totalpages) },
57         { "size", PY_UINT32, offsetof(JOB_INFO_2, size) },
58         { "time_elapsed", PY_UINT32, offsetof(JOB_INFO_2, timeelapsed) },
59         { "pages_printed", PY_UINT32, offsetof(JOB_INFO_2, pagesprinted) },
60         { NULL }
61 };
62
63 struct pyconv py_DOC_INFO_1[] = {
64         { "document_name", PY_UNISTR, offsetof(DOC_INFO_1, docname) },
65         { "output_file", PY_UNISTR, offsetof(DOC_INFO_1, outputfile) },
66         { "data_type", PY_UNISTR, offsetof(DOC_INFO_1, datatype) },
67         { NULL }
68 };
69
70 BOOL py_from_JOB_INFO_1(PyObject **dict, JOB_INFO_1 *info)
71 {
72         *dict = from_struct(info, py_JOB_INFO_1);
73         return True;
74 }
75
76 BOOL py_to_JOB_INFO_1(JOB_INFO_1 *info, PyObject *dict)
77 {
78         return False;
79 }
80
81 BOOL py_from_JOB_INFO_2(PyObject **dict, JOB_INFO_2 *info)
82 {
83         *dict = from_struct(info, py_JOB_INFO_2);
84         return True;
85 }
86
87 BOOL py_to_JOB_INFO_2(JOB_INFO_2 *info, PyObject *dict)
88 {
89         return False;
90 }
91
92 BOOL py_from_DOC_INFO_1(PyObject **dict, DOC_INFO_1 *info)
93 {
94         *dict = from_struct(info, py_DOC_INFO_1);
95         return True;
96 }
97
98 BOOL py_to_DOC_INFO_1(DOC_INFO_1 *info, PyObject *dict)
99 {
100         return to_struct(info, dict, py_DOC_INFO_1);
101 }