HP2500C driver writes devmode with private data that ends
[samba.git] / source3 / python / py_spoolss_drivers_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 2 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, write to the Free Software
18    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21 #include "python/py_spoolss.h"
22 #include "python/py_conv.h"
23
24 /* Structure/hash conversions */
25
26 struct pyconv py_DRIVER_INFO_1[] = {
27         { "name", PY_UNISTR, offsetof(DRIVER_INFO_1, name) },
28         { NULL }
29 };
30
31 struct pyconv py_DRIVER_INFO_2[] = {
32         { "version", PY_UINT32, offsetof(DRIVER_INFO_2, version) },
33         { "name", PY_UNISTR, offsetof(DRIVER_INFO_2, name) },
34         { "architecture", PY_UNISTR, offsetof(DRIVER_INFO_2, architecture) },
35         { "driver_path", PY_UNISTR, offsetof(DRIVER_INFO_2, driverpath) },
36         { "data_file", PY_UNISTR, offsetof(DRIVER_INFO_2, datafile) },
37         { "config_file", PY_UNISTR, offsetof(DRIVER_INFO_2, configfile) },
38         { NULL }
39 };
40
41 struct pyconv py_DRIVER_INFO_3[] = {
42         { "version", PY_UINT32, offsetof(DRIVER_INFO_3, version) },
43         { "name", PY_UNISTR, offsetof(DRIVER_INFO_3, name) },
44         { "architecture", PY_UNISTR, offsetof(DRIVER_INFO_3, architecture) },
45         { "driver_path", PY_UNISTR, offsetof(DRIVER_INFO_3, driverpath) },
46         { "data_file", PY_UNISTR, offsetof(DRIVER_INFO_3, datafile) },
47         { "config_file", PY_UNISTR, offsetof(DRIVER_INFO_3, configfile) },
48         { "help_file", PY_UNISTR, offsetof(DRIVER_INFO_3, helpfile) },
49         /* dependentfiles */
50         { "monitor_name", PY_UNISTR, offsetof(DRIVER_INFO_3, monitorname) },
51         { "default_datatype", PY_UNISTR, offsetof(DRIVER_INFO_3, defaultdatatype) },
52         { NULL }
53 };
54
55 struct pyconv py_DRIVER_INFO_6[] = {
56         { "version", PY_UINT32, offsetof(DRIVER_INFO_6, version) },
57         { "name", PY_UNISTR, offsetof(DRIVER_INFO_6, name) },
58         { "architecture", PY_UNISTR, offsetof(DRIVER_INFO_6, architecture) },
59         { "driver_path", PY_UNISTR, offsetof(DRIVER_INFO_6, driverpath) },
60         { "data_file", PY_UNISTR, offsetof(DRIVER_INFO_6, datafile) },
61         { "config_file", PY_UNISTR, offsetof(DRIVER_INFO_6, configfile) },
62         { "help_file", PY_UNISTR, offsetof(DRIVER_INFO_6, helpfile) },
63         /* dependentfiles */
64         { "monitor_name", PY_UNISTR, offsetof(DRIVER_INFO_6, monitorname) },
65         { "default_datatype", PY_UNISTR, offsetof(DRIVER_INFO_6, defaultdatatype) },
66         /* driver_date */
67
68         { "padding", PY_UINT32, offsetof(DRIVER_INFO_6, padding) },
69         { "driver_version_low", PY_UINT32, offsetof(DRIVER_INFO_6, driver_version_low) },
70         { "driver_version_high", PY_UINT32, offsetof(DRIVER_INFO_6, driver_version_high) },
71         { "mfg_name", PY_UNISTR, offsetof(DRIVER_INFO_6, mfgname) },
72         { "oem_url", PY_UNISTR, offsetof(DRIVER_INFO_6, oem_url) },
73         { "hardware_id", PY_UNISTR, offsetof(DRIVER_INFO_6, hardware_id) },
74         { "provider", PY_UNISTR, offsetof(DRIVER_INFO_6, provider) },
75         
76         { NULL }
77 };
78
79 struct pyconv py_DRIVER_DIRECTORY_1[] = {
80         { "name", PY_UNISTR, offsetof(DRIVER_DIRECTORY_1, name) },
81         { NULL }
82 };
83
84 BOOL py_from_DRIVER_INFO_1(PyObject **dict, DRIVER_INFO_1 *info)
85 {
86         *dict = from_struct(info, py_DRIVER_INFO_1);
87         return True;
88 }
89
90 BOOL py_to_DRIVER_INFO_1(DRIVER_INFO_1 *info, PyObject *dict)
91 {
92         return False;
93 }
94
95 BOOL py_from_DRIVER_INFO_2(PyObject **dict, DRIVER_INFO_2 *info)
96 {
97         *dict = from_struct(info, py_DRIVER_INFO_2);
98         return True;
99 }
100
101 BOOL py_to_DRIVER_INFO_2(DRIVER_INFO_2 *info, PyObject *dict)
102 {
103         return False;
104 }
105
106 BOOL py_from_DRIVER_INFO_3(PyObject **dict, DRIVER_INFO_3 *info)
107 {
108         *dict = from_struct(info, py_DRIVER_INFO_3);
109         return True;
110 }
111
112 BOOL py_to_DRIVER_INFO_3(DRIVER_INFO_3 *info, PyObject *dict)
113 {
114         return False;
115 }
116
117 BOOL py_from_DRIVER_INFO_6(PyObject **dict, DRIVER_INFO_6 *info)
118 {
119         *dict = from_struct(info, py_DRIVER_INFO_6);
120         return True;
121 }
122
123 BOOL py_to_DRIVER_INFO_6(DRIVER_INFO_6 *info, PyObject *dict)
124 {
125         return False;
126 }
127
128 BOOL py_from_DRIVER_DIRECTORY_1(PyObject **dict, DRIVER_DIRECTORY_1 *info)
129 {
130         *dict = from_struct(info, py_DRIVER_DIRECTORY_1);
131         return True;
132 }
133
134 BOOL py_to_DRIVER_DIRECTORY_1(DRIVER_DIRECTORY_1 *info, PyObject *dict)
135 {
136         return False;
137 }