Samba 3: added Samba 3.0.24 sources
[tomato.git] / release / src / router / samba3 / source / python / py_spoolss_jobs_conv.c
blobcb04ec6713c2de99d53d612f8ea5776816ec2598
1 /*
2 Python wrappers for DCERPC/SMB client routines.
4 Copyright (C) Tim Potter, 2002
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 2 of the License, or
9 (at your option) any later version.
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.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include "python/py_spoolss.h"
22 #include "python/py_conv.h"
24 struct pyconv py_JOB_INFO_1[] = {
25 { "jobid", PY_UINT32, offsetof(JOB_INFO_1, jobid) },
26 { "printer_name", PY_UNISTR, offsetof(JOB_INFO_1, printername) },
27 { "server_name", PY_UNISTR, offsetof(JOB_INFO_1, machinename) },
28 { "user_name", PY_UNISTR, offsetof(JOB_INFO_1, username) },
29 { "document_name", PY_UNISTR, offsetof(JOB_INFO_1, document) },
30 { "data_type", PY_UNISTR, offsetof(JOB_INFO_1, datatype) },
31 { "text_status", PY_UNISTR, offsetof(JOB_INFO_1, text_status) },
32 { "status", PY_UINT32, offsetof(JOB_INFO_1, status) },
33 { "priority", PY_UINT32, offsetof(JOB_INFO_1, priority) },
34 { "position", PY_UINT32, offsetof(JOB_INFO_1, position) },
35 { "total_pages", PY_UINT32, offsetof(JOB_INFO_1, totalpages) },
36 { "pages_printed", PY_UINT32, offsetof(JOB_INFO_1, pagesprinted) },
37 { NULL }
40 struct pyconv py_JOB_INFO_2[] = {
41 { "jobid", PY_UINT32, offsetof(JOB_INFO_2, jobid) },
42 { "printer_name", PY_UNISTR, offsetof(JOB_INFO_2, printername) },
43 { "server_name", PY_UNISTR, offsetof(JOB_INFO_2, machinename) },
44 { "user_name", PY_UNISTR, offsetof(JOB_INFO_2, username) },
45 { "document_name", PY_UNISTR, offsetof(JOB_INFO_2, document) },
46 { "notify_name", PY_UNISTR, offsetof(JOB_INFO_2, notifyname) },
47 { "data_type", PY_UNISTR, offsetof(JOB_INFO_2, datatype) },
48 { "print_processor", PY_UNISTR, offsetof(JOB_INFO_2, printprocessor) },
49 { "parameters", PY_UNISTR, offsetof(JOB_INFO_2, parameters) },
50 { "driver_name", PY_UNISTR, offsetof(JOB_INFO_2, drivername) },
51 { "text_status", PY_UNISTR, offsetof(JOB_INFO_2, text_status) },
52 { "status", PY_UINT32, offsetof(JOB_INFO_2, status) },
53 { "priority", PY_UINT32, offsetof(JOB_INFO_2, priority) },
54 { "position", PY_UINT32, offsetof(JOB_INFO_2, position) },
55 { "start_time", PY_UINT32, offsetof(JOB_INFO_2, starttime) },
56 { "until_time", PY_UINT32, offsetof(JOB_INFO_2, untiltime) },
57 { "total_pages", PY_UINT32, offsetof(JOB_INFO_2, totalpages) },
58 { "size", PY_UINT32, offsetof(JOB_INFO_2, size) },
59 { "time_elapsed", PY_UINT32, offsetof(JOB_INFO_2, timeelapsed) },
60 { "pages_printed", PY_UINT32, offsetof(JOB_INFO_2, pagesprinted) },
61 { NULL }
64 struct pyconv py_DOC_INFO_1[] = {
65 { "document_name", PY_UNISTR, offsetof(DOC_INFO_1, docname) },
66 { "output_file", PY_UNISTR, offsetof(DOC_INFO_1, outputfile) },
67 { "data_type", PY_UNISTR, offsetof(DOC_INFO_1, datatype) },
68 { NULL }
71 BOOL py_from_JOB_INFO_1(PyObject **dict, JOB_INFO_1 *info)
73 *dict = from_struct(info, py_JOB_INFO_1);
74 return True;
77 BOOL py_to_JOB_INFO_1(JOB_INFO_1 *info, PyObject *dict)
79 return False;
82 BOOL py_from_JOB_INFO_2(PyObject **dict, JOB_INFO_2 *info)
84 *dict = from_struct(info, py_JOB_INFO_2);
85 return True;
88 BOOL py_to_JOB_INFO_2(JOB_INFO_2 *info, PyObject *dict)
90 return False;
93 BOOL py_from_DOC_INFO_1(PyObject **dict, DOC_INFO_1 *info)
95 *dict = from_struct(info, py_DOC_INFO_1);
96 return True;
99 BOOL py_to_DOC_INFO_1(DOC_INFO_1 *info, PyObject *dict)
101 return to_struct(info, dict, py_DOC_INFO_1);