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 24struct 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 } 38}; 39 40struct 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 } 62}; 63 64struct 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 } 69}; 70 71BOOL py_from_JOB_INFO_1(PyObject **dict, JOB_INFO_1 *info) 72{ 73 *dict = from_struct(info, py_JOB_INFO_1); 74 return True; 75} 76 77BOOL py_to_JOB_INFO_1(JOB_INFO_1 *info, PyObject *dict) 78{ 79 return False; 80} 81 82BOOL py_from_JOB_INFO_2(PyObject **dict, JOB_INFO_2 *info) 83{ 84 *dict = from_struct(info, py_JOB_INFO_2); 85 return True; 86} 87 88BOOL py_to_JOB_INFO_2(JOB_INFO_2 *info, PyObject *dict) 89{ 90 return False; 91} 92 93BOOL py_from_DOC_INFO_1(PyObject **dict, DOC_INFO_1 *info) 94{ 95 *dict = from_struct(info, py_DOC_INFO_1); 96 return True; 97} 98 99BOOL py_to_DOC_INFO_1(DOC_INFO_1 *info, PyObject *dict) 100{ 101 return to_struct(info, dict, py_DOC_INFO_1); 102} 103