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 3 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, see <http://www.gnu.org/licenses/>.
20 #include "python/py_spoolss.h"
21 #include "python/py_conv.h"
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
) },
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
) },
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
) },
70 BOOL
py_from_JOB_INFO_1(PyObject
**dict
, JOB_INFO_1
*info
)
72 *dict
= from_struct(info
, py_JOB_INFO_1
);
76 BOOL
py_to_JOB_INFO_1(JOB_INFO_1
*info
, PyObject
*dict
)
81 BOOL
py_from_JOB_INFO_2(PyObject
**dict
, JOB_INFO_2
*info
)
83 *dict
= from_struct(info
, py_JOB_INFO_2
);
87 BOOL
py_to_JOB_INFO_2(JOB_INFO_2
*info
, PyObject
*dict
)
92 BOOL
py_from_DOC_INFO_1(PyObject
**dict
, DOC_INFO_1
*info
)
94 *dict
= from_struct(info
, py_DOC_INFO_1
);
98 BOOL
py_to_DOC_INFO_1(DOC_INFO_1
*info
, PyObject
*dict
)
100 return to_struct(info
, dict
, py_DOC_INFO_1
);