summaryrefslogtreecommitdiff
path: root/source3/autoconf/librpc/gen_ndr/py_ntprinting.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/autoconf/librpc/gen_ndr/py_ntprinting.c')
-rw-r--r--source3/autoconf/librpc/gen_ndr/py_ntprinting.c2213
1 files changed, 2213 insertions, 0 deletions
diff --git a/source3/autoconf/librpc/gen_ndr/py_ntprinting.c b/source3/autoconf/librpc/gen_ndr/py_ntprinting.c
new file mode 100644
index 0000000000..21274fe6c4
--- /dev/null
+++ b/source3/autoconf/librpc/gen_ndr/py_ntprinting.c
@@ -0,0 +1,2213 @@
+
+/* Python wrapper functions auto-generated by pidl */
+#include <Python.h>
+#include "includes.h"
+#include <pytalloc.h>
+#include "librpc/rpc/pyrpc.h"
+#include "librpc/rpc/pyrpc_util.h"
+#include "autoconf/librpc/gen_ndr/ndr_ntprinting.h"
+#include "autoconf/librpc/gen_ndr/ndr_ntprinting_c.h"
+
+staticforward PyTypeObject ntprinting_form_Type;
+staticforward PyTypeObject ntprinting_driver_Type;
+staticforward PyTypeObject ntprinting_devicemode_Type;
+staticforward PyTypeObject ntprinting_printer_data_Type;
+staticforward PyTypeObject ntprinting_printer_info_Type;
+staticforward PyTypeObject ntprinting_printer_Type;
+staticforward PyTypeObject ntprinting_InterfaceType;
+
+void initntprinting(void);static PyTypeObject *Object_Type;
+static PyTypeObject *ClientConnection_Type;
+
+static PyObject *py_ntprinting_form_get_position(PyObject *obj, void *closure)
+{
+ struct ntprinting_form *object = (struct ntprinting_form *)pytalloc_get_ptr(obj);
+ PyObject *py_position;
+ py_position = PyInt_FromLong(object->position);
+ return py_position;
+}
+
+static int py_ntprinting_form_set_position(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_form *object = (struct ntprinting_form *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->position = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_form_get_flag(PyObject *obj, void *closure)
+{
+ struct ntprinting_form *object = (struct ntprinting_form *)pytalloc_get_ptr(obj);
+ PyObject *py_flag;
+ py_flag = PyInt_FromLong(object->flag);
+ return py_flag;
+}
+
+static int py_ntprinting_form_set_flag(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_form *object = (struct ntprinting_form *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->flag = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_form_get_width(PyObject *obj, void *closure)
+{
+ struct ntprinting_form *object = (struct ntprinting_form *)pytalloc_get_ptr(obj);
+ PyObject *py_width;
+ py_width = PyInt_FromLong(object->width);
+ return py_width;
+}
+
+static int py_ntprinting_form_set_width(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_form *object = (struct ntprinting_form *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->width = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_form_get_length(PyObject *obj, void *closure)
+{
+ struct ntprinting_form *object = (struct ntprinting_form *)pytalloc_get_ptr(obj);
+ PyObject *py_length;
+ py_length = PyInt_FromLong(object->length);
+ return py_length;
+}
+
+static int py_ntprinting_form_set_length(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_form *object = (struct ntprinting_form *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->length = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_form_get_left(PyObject *obj, void *closure)
+{
+ struct ntprinting_form *object = (struct ntprinting_form *)pytalloc_get_ptr(obj);
+ PyObject *py_left;
+ py_left = PyInt_FromLong(object->left);
+ return py_left;
+}
+
+static int py_ntprinting_form_set_left(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_form *object = (struct ntprinting_form *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->left = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_form_get_top(PyObject *obj, void *closure)
+{
+ struct ntprinting_form *object = (struct ntprinting_form *)pytalloc_get_ptr(obj);
+ PyObject *py_top;
+ py_top = PyInt_FromLong(object->top);
+ return py_top;
+}
+
+static int py_ntprinting_form_set_top(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_form *object = (struct ntprinting_form *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->top = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_form_get_right(PyObject *obj, void *closure)
+{
+ struct ntprinting_form *object = (struct ntprinting_form *)pytalloc_get_ptr(obj);
+ PyObject *py_right;
+ py_right = PyInt_FromLong(object->right);
+ return py_right;
+}
+
+static int py_ntprinting_form_set_right(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_form *object = (struct ntprinting_form *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->right = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_form_get_bottom(PyObject *obj, void *closure)
+{
+ struct ntprinting_form *object = (struct ntprinting_form *)pytalloc_get_ptr(obj);
+ PyObject *py_bottom;
+ py_bottom = PyInt_FromLong(object->bottom);
+ return py_bottom;
+}
+
+static int py_ntprinting_form_set_bottom(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_form *object = (struct ntprinting_form *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->bottom = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyGetSetDef py_ntprinting_form_getsetters[] = {
+ { discard_const_p(char, "position"), py_ntprinting_form_get_position, py_ntprinting_form_set_position },
+ { discard_const_p(char, "flag"), py_ntprinting_form_get_flag, py_ntprinting_form_set_flag },
+ { discard_const_p(char, "width"), py_ntprinting_form_get_width, py_ntprinting_form_set_width },
+ { discard_const_p(char, "length"), py_ntprinting_form_get_length, py_ntprinting_form_set_length },
+ { discard_const_p(char, "left"), py_ntprinting_form_get_left, py_ntprinting_form_set_left },
+ { discard_const_p(char, "top"), py_ntprinting_form_get_top, py_ntprinting_form_set_top },
+ { discard_const_p(char, "right"), py_ntprinting_form_get_right, py_ntprinting_form_set_right },
+ { discard_const_p(char, "bottom"), py_ntprinting_form_get_bottom, py_ntprinting_form_set_bottom },
+ { NULL }
+};
+
+static PyObject *py_ntprinting_form_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ return pytalloc_new(struct ntprinting_form, type);
+}
+
+static PyObject *py_ntprinting_form_ndr_pack(PyObject *py_obj)
+{
+ struct ntprinting_form *object = (struct ntprinting_form *)pytalloc_get_ptr(py_obj);
+ DATA_BLOB blob;
+ enum ndr_err_code err;
+ err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_ntprinting_form);
+ if (err != NDR_ERR_SUCCESS) {
+ PyErr_SetNdrError(err);
+ return NULL;
+ }
+
+ return PyString_FromStringAndSize((char *)blob.data, blob.length);
+}
+
+static PyObject *py_ntprinting_form_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
+{
+ struct ntprinting_form *object = (struct ntprinting_form *)pytalloc_get_ptr(py_obj);
+ DATA_BLOB blob;
+ int blob_length = 0;
+ enum ndr_err_code err;
+ const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
+ PyObject *allow_remaining_obj = NULL;
+ bool allow_remaining = false;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
+ discard_const_p(char *, kwnames),
+ &blob.data, &blob_length,
+ &allow_remaining_obj)) {
+ return NULL;
+ }
+ blob.length = blob_length;
+
+ if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
+ allow_remaining = true;
+ }
+
+ if (allow_remaining) {
+ err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ntprinting_form);
+ } else {
+ err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ntprinting_form);
+ }
+ if (err != NDR_ERR_SUCCESS) {
+ PyErr_SetNdrError(err);
+ return NULL;
+ }
+
+ Py_RETURN_NONE;
+}
+
+static PyObject *py_ntprinting_form_ndr_print(PyObject *py_obj)
+{
+ struct ntprinting_form *object = (struct ntprinting_form *)pytalloc_get_ptr(py_obj);
+ PyObject *ret;
+ char *retstr;
+
+ retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_ntprinting_form, "ntprinting_form", object);
+ ret = PyString_FromString(retstr);
+ talloc_free(retstr);
+
+ return ret;
+}
+
+static PyMethodDef py_ntprinting_form_methods[] = {
+ { "__ndr_pack__", (PyCFunction)py_ntprinting_form_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
+ { "__ndr_unpack__", (PyCFunction)py_ntprinting_form_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
+ { "__ndr_print__", (PyCFunction)py_ntprinting_form_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
+ { NULL, NULL, 0, NULL }
+};
+
+
+static PyTypeObject ntprinting_form_Type = {
+ PyObject_HEAD_INIT(NULL) 0,
+ .tp_name = "ntprinting.form",
+ .tp_getset = py_ntprinting_form_getsetters,
+ .tp_methods = py_ntprinting_form_methods,
+ .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ .tp_basicsize = sizeof(pytalloc_Object),
+ .tp_new = py_ntprinting_form_new,
+};
+
+
+static PyObject *py_ntprinting_driver_get_version(PyObject *obj, void *closure)
+{
+ struct ntprinting_driver *object = (struct ntprinting_driver *)pytalloc_get_ptr(obj);
+ PyObject *py_version;
+ py_version = PyInt_FromLong(object->version);
+ return py_version;
+}
+
+static int py_ntprinting_driver_set_version(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_driver *object = (struct ntprinting_driver *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->version = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_driver_get_name(PyObject *obj, void *closure)
+{
+ struct ntprinting_driver *object = (struct ntprinting_driver *)pytalloc_get_ptr(obj);
+ PyObject *py_name;
+ py_name = PyString_FromStringOrNULL(object->name);
+ return py_name;
+}
+
+static int py_ntprinting_driver_set_name(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_driver *object = (struct ntprinting_driver *)pytalloc_get_ptr(py_obj);
+ object->name = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
+ return 0;
+}
+
+static PyObject *py_ntprinting_driver_get_environment(PyObject *obj, void *closure)
+{
+ struct ntprinting_driver *object = (struct ntprinting_driver *)pytalloc_get_ptr(obj);
+ PyObject *py_environment;
+ py_environment = PyString_FromStringOrNULL(object->environment);
+ return py_environment;
+}
+
+static int py_ntprinting_driver_set_environment(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_driver *object = (struct ntprinting_driver *)pytalloc_get_ptr(py_obj);
+ object->environment = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
+ return 0;
+}
+
+static PyObject *py_ntprinting_driver_get_driverpath(PyObject *obj, void *closure)
+{
+ struct ntprinting_driver *object = (struct ntprinting_driver *)pytalloc_get_ptr(obj);
+ PyObject *py_driverpath;
+ py_driverpath = PyString_FromStringOrNULL(object->driverpath);
+ return py_driverpath;
+}
+
+static int py_ntprinting_driver_set_driverpath(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_driver *object = (struct ntprinting_driver *)pytalloc_get_ptr(py_obj);
+ object->driverpath = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
+ return 0;
+}
+
+static PyObject *py_ntprinting_driver_get_datafile(PyObject *obj, void *closure)
+{
+ struct ntprinting_driver *object = (struct ntprinting_driver *)pytalloc_get_ptr(obj);
+ PyObject *py_datafile;
+ py_datafile = PyString_FromStringOrNULL(object->datafile);
+ return py_datafile;
+}
+
+static int py_ntprinting_driver_set_datafile(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_driver *object = (struct ntprinting_driver *)pytalloc_get_ptr(py_obj);
+ object->datafile = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
+ return 0;
+}
+
+static PyObject *py_ntprinting_driver_get_configfile(PyObject *obj, void *closure)
+{
+ struct ntprinting_driver *object = (struct ntprinting_driver *)pytalloc_get_ptr(obj);
+ PyObject *py_configfile;
+ py_configfile = PyString_FromStringOrNULL(object->configfile);
+ return py_configfile;
+}
+
+static int py_ntprinting_driver_set_configfile(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_driver *object = (struct ntprinting_driver *)pytalloc_get_ptr(py_obj);
+ object->configfile = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
+ return 0;
+}
+
+static PyObject *py_ntprinting_driver_get_helpfile(PyObject *obj, void *closure)
+{
+ struct ntprinting_driver *object = (struct ntprinting_driver *)pytalloc_get_ptr(obj);
+ PyObject *py_helpfile;
+ py_helpfile = PyString_FromStringOrNULL(object->helpfile);
+ return py_helpfile;
+}
+
+static int py_ntprinting_driver_set_helpfile(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_driver *object = (struct ntprinting_driver *)pytalloc_get_ptr(py_obj);
+ object->helpfile = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
+ return 0;
+}
+
+static PyObject *py_ntprinting_driver_get_monitorname(PyObject *obj, void *closure)
+{
+ struct ntprinting_driver *object = (struct ntprinting_driver *)pytalloc_get_ptr(obj);
+ PyObject *py_monitorname;
+ py_monitorname = PyString_FromStringOrNULL(object->monitorname);
+ return py_monitorname;
+}
+
+static int py_ntprinting_driver_set_monitorname(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_driver *object = (struct ntprinting_driver *)pytalloc_get_ptr(py_obj);
+ object->monitorname = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
+ return 0;
+}
+
+static PyObject *py_ntprinting_driver_get_defaultdatatype(PyObject *obj, void *closure)
+{
+ struct ntprinting_driver *object = (struct ntprinting_driver *)pytalloc_get_ptr(obj);
+ PyObject *py_defaultdatatype;
+ py_defaultdatatype = PyString_FromStringOrNULL(object->defaultdatatype);
+ return py_defaultdatatype;
+}
+
+static int py_ntprinting_driver_set_defaultdatatype(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_driver *object = (struct ntprinting_driver *)pytalloc_get_ptr(py_obj);
+ object->defaultdatatype = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
+ return 0;
+}
+
+static PyObject *py_ntprinting_driver_get_dependent_files(PyObject *obj, void *closure)
+{
+ struct ntprinting_driver *object = (struct ntprinting_driver *)pytalloc_get_ptr(obj);
+ PyObject *py_dependent_files;
+ py_dependent_files = pytalloc_CObject_FromTallocPtr(object->dependent_files);
+ return py_dependent_files;
+}
+
+static int py_ntprinting_driver_set_dependent_files(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_driver *object = (struct ntprinting_driver *)pytalloc_get_ptr(py_obj);
+ object->dependent_files = PyCObject_AsVoidPtr(value);
+ return 0;
+}
+
+static PyGetSetDef py_ntprinting_driver_getsetters[] = {
+ { discard_const_p(char, "version"), py_ntprinting_driver_get_version, py_ntprinting_driver_set_version },
+ { discard_const_p(char, "name"), py_ntprinting_driver_get_name, py_ntprinting_driver_set_name },
+ { discard_const_p(char, "environment"), py_ntprinting_driver_get_environment, py_ntprinting_driver_set_environment },
+ { discard_const_p(char, "driverpath"), py_ntprinting_driver_get_driverpath, py_ntprinting_driver_set_driverpath },
+ { discard_const_p(char, "datafile"), py_ntprinting_driver_get_datafile, py_ntprinting_driver_set_datafile },
+ { discard_const_p(char, "configfile"), py_ntprinting_driver_get_configfile, py_ntprinting_driver_set_configfile },
+ { discard_const_p(char, "helpfile"), py_ntprinting_driver_get_helpfile, py_ntprinting_driver_set_helpfile },
+ { discard_const_p(char, "monitorname"), py_ntprinting_driver_get_monitorname, py_ntprinting_driver_set_monitorname },
+ { discard_const_p(char, "defaultdatatype"), py_ntprinting_driver_get_defaultdatatype, py_ntprinting_driver_set_defaultdatatype },
+ { discard_const_p(char, "dependent_files"), py_ntprinting_driver_get_dependent_files, py_ntprinting_driver_set_dependent_files },
+ { NULL }
+};
+
+static PyObject *py_ntprinting_driver_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ return pytalloc_new(struct ntprinting_driver, type);
+}
+
+static PyObject *py_ntprinting_driver_ndr_pack(PyObject *py_obj)
+{
+ struct ntprinting_driver *object = (struct ntprinting_driver *)pytalloc_get_ptr(py_obj);
+ DATA_BLOB blob;
+ enum ndr_err_code err;
+ err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_ntprinting_driver);
+ if (err != NDR_ERR_SUCCESS) {
+ PyErr_SetNdrError(err);
+ return NULL;
+ }
+
+ return PyString_FromStringAndSize((char *)blob.data, blob.length);
+}
+
+static PyObject *py_ntprinting_driver_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
+{
+ struct ntprinting_driver *object = (struct ntprinting_driver *)pytalloc_get_ptr(py_obj);
+ DATA_BLOB blob;
+ int blob_length = 0;
+ enum ndr_err_code err;
+ const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
+ PyObject *allow_remaining_obj = NULL;
+ bool allow_remaining = false;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
+ discard_const_p(char *, kwnames),
+ &blob.data, &blob_length,
+ &allow_remaining_obj)) {
+ return NULL;
+ }
+ blob.length = blob_length;
+
+ if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
+ allow_remaining = true;
+ }
+
+ if (allow_remaining) {
+ err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ntprinting_driver);
+ } else {
+ err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ntprinting_driver);
+ }
+ if (err != NDR_ERR_SUCCESS) {
+ PyErr_SetNdrError(err);
+ return NULL;
+ }
+
+ Py_RETURN_NONE;
+}
+
+static PyObject *py_ntprinting_driver_ndr_print(PyObject *py_obj)
+{
+ struct ntprinting_driver *object = (struct ntprinting_driver *)pytalloc_get_ptr(py_obj);
+ PyObject *ret;
+ char *retstr;
+
+ retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_ntprinting_driver, "ntprinting_driver", object);
+ ret = PyString_FromString(retstr);
+ talloc_free(retstr);
+
+ return ret;
+}
+
+static PyMethodDef py_ntprinting_driver_methods[] = {
+ { "__ndr_pack__", (PyCFunction)py_ntprinting_driver_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
+ { "__ndr_unpack__", (PyCFunction)py_ntprinting_driver_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
+ { "__ndr_print__", (PyCFunction)py_ntprinting_driver_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
+ { NULL, NULL, 0, NULL }
+};
+
+
+static PyTypeObject ntprinting_driver_Type = {
+ PyObject_HEAD_INIT(NULL) 0,
+ .tp_name = "ntprinting.driver",
+ .tp_getset = py_ntprinting_driver_getsetters,
+ .tp_methods = py_ntprinting_driver_methods,
+ .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ .tp_basicsize = sizeof(pytalloc_Object),
+ .tp_new = py_ntprinting_driver_new,
+};
+
+
+static PyObject *py_ntprinting_devicemode_get_devicename(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_devicename;
+ py_devicename = PyString_FromStringOrNULL(object->devicename);
+ return py_devicename;
+}
+
+static int py_ntprinting_devicemode_set_devicename(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ object->devicename = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
+ return 0;
+}
+
+static PyObject *py_ntprinting_devicemode_get_formname(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_formname;
+ py_formname = PyString_FromStringOrNULL(object->formname);
+ return py_formname;
+}
+
+static int py_ntprinting_devicemode_set_formname(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ object->formname = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
+ return 0;
+}
+
+static PyObject *py_ntprinting_devicemode_get_specversion(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_specversion;
+ py_specversion = PyInt_FromLong(object->specversion);
+ return py_specversion;
+}
+
+static int py_ntprinting_devicemode_set_specversion(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->specversion = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_devicemode_get_driverversion(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_driverversion;
+ py_driverversion = PyInt_FromLong(object->driverversion);
+ return py_driverversion;
+}
+
+static int py_ntprinting_devicemode_set_driverversion(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->driverversion = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_devicemode_get_size(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_size;
+ py_size = PyInt_FromLong(object->size);
+ return py_size;
+}
+
+static int py_ntprinting_devicemode_set_size(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->size = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_devicemode_get_driverextra(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_driverextra;
+ py_driverextra = PyInt_FromLong(object->driverextra);
+ return py_driverextra;
+}
+
+static int py_ntprinting_devicemode_set_driverextra(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->driverextra = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_devicemode_get_orientation(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_orientation;
+ py_orientation = PyInt_FromLong(object->orientation);
+ return py_orientation;
+}
+
+static int py_ntprinting_devicemode_set_orientation(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->orientation = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_devicemode_get_papersize(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_papersize;
+ py_papersize = PyInt_FromLong(object->papersize);
+ return py_papersize;
+}
+
+static int py_ntprinting_devicemode_set_papersize(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->papersize = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_devicemode_get_paperlength(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_paperlength;
+ py_paperlength = PyInt_FromLong(object->paperlength);
+ return py_paperlength;
+}
+
+static int py_ntprinting_devicemode_set_paperlength(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->paperlength = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_devicemode_get_paperwidth(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_paperwidth;
+ py_paperwidth = PyInt_FromLong(object->paperwidth);
+ return py_paperwidth;
+}
+
+static int py_ntprinting_devicemode_set_paperwidth(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->paperwidth = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_devicemode_get_scale(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_scale;
+ py_scale = PyInt_FromLong(object->scale);
+ return py_scale;
+}
+
+static int py_ntprinting_devicemode_set_scale(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->scale = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_devicemode_get_copies(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_copies;
+ py_copies = PyInt_FromLong(object->copies);
+ return py_copies;
+}
+
+static int py_ntprinting_devicemode_set_copies(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->copies = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_devicemode_get_defaultsource(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_defaultsource;
+ py_defaultsource = PyInt_FromLong(object->defaultsource);
+ return py_defaultsource;
+}
+
+static int py_ntprinting_devicemode_set_defaultsource(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->defaultsource = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_devicemode_get_printquality(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_printquality;
+ py_printquality = PyInt_FromLong(object->printquality);
+ return py_printquality;
+}
+
+static int py_ntprinting_devicemode_set_printquality(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->printquality = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_devicemode_get_color(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_color;
+ py_color = PyInt_FromLong(object->color);
+ return py_color;
+}
+
+static int py_ntprinting_devicemode_set_color(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->color = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_devicemode_get_duplex(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_duplex;
+ py_duplex = PyInt_FromLong(object->duplex);
+ return py_duplex;
+}
+
+static int py_ntprinting_devicemode_set_duplex(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->duplex = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_devicemode_get_yresolution(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_yresolution;
+ py_yresolution = PyInt_FromLong(object->yresolution);
+ return py_yresolution;
+}
+
+static int py_ntprinting_devicemode_set_yresolution(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->yresolution = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_devicemode_get_ttoption(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_ttoption;
+ py_ttoption = PyInt_FromLong(object->ttoption);
+ return py_ttoption;
+}
+
+static int py_ntprinting_devicemode_set_ttoption(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->ttoption = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_devicemode_get_collate(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_collate;
+ py_collate = PyInt_FromLong(object->collate);
+ return py_collate;
+}
+
+static int py_ntprinting_devicemode_set_collate(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->collate = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_devicemode_get_logpixels(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_logpixels;
+ py_logpixels = PyInt_FromLong(object->logpixels);
+ return py_logpixels;
+}
+
+static int py_ntprinting_devicemode_set_logpixels(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->logpixels = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_devicemode_get_fields(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_fields;
+ py_fields = PyInt_FromLong(object->fields);
+ return py_fields;
+}
+
+static int py_ntprinting_devicemode_set_fields(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->fields = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_devicemode_get_bitsperpel(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_bitsperpel;
+ py_bitsperpel = PyInt_FromLong(object->bitsperpel);
+ return py_bitsperpel;
+}
+
+static int py_ntprinting_devicemode_set_bitsperpel(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->bitsperpel = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_devicemode_get_pelswidth(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_pelswidth;
+ py_pelswidth = PyInt_FromLong(object->pelswidth);
+ return py_pelswidth;
+}
+
+static int py_ntprinting_devicemode_set_pelswidth(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->pelswidth = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_devicemode_get_pelsheight(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_pelsheight;
+ py_pelsheight = PyInt_FromLong(object->pelsheight);
+ return py_pelsheight;
+}
+
+static int py_ntprinting_devicemode_set_pelsheight(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->pelsheight = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_devicemode_get_displayflags(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_displayflags;
+ py_displayflags = PyInt_FromLong(object->displayflags);
+ return py_displayflags;
+}
+
+static int py_ntprinting_devicemode_set_displayflags(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->displayflags = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_devicemode_get_displayfrequency(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_displayfrequency;
+ py_displayfrequency = PyInt_FromLong(object->displayfrequency);
+ return py_displayfrequency;
+}
+
+static int py_ntprinting_devicemode_set_displayfrequency(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->displayfrequency = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_devicemode_get_icmmethod(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_icmmethod;
+ py_icmmethod = PyInt_FromLong(object->icmmethod);
+ return py_icmmethod;
+}
+
+static int py_ntprinting_devicemode_set_icmmethod(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->icmmethod = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_devicemode_get_icmintent(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_icmintent;
+ py_icmintent = PyInt_FromLong(object->icmintent);
+ return py_icmintent;
+}
+
+static int py_ntprinting_devicemode_set_icmintent(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->icmintent = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_devicemode_get_mediatype(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_mediatype;
+ py_mediatype = PyInt_FromLong(object->mediatype);
+ return py_mediatype;
+}
+
+static int py_ntprinting_devicemode_set_mediatype(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->mediatype = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_devicemode_get_dithertype(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_dithertype;
+ py_dithertype = PyInt_FromLong(object->dithertype);
+ return py_dithertype;
+}
+
+static int py_ntprinting_devicemode_set_dithertype(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->dithertype = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_devicemode_get_reserved1(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_reserved1;
+ py_reserved1 = PyInt_FromLong(object->reserved1);
+ return py_reserved1;
+}
+
+static int py_ntprinting_devicemode_set_reserved1(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->reserved1 = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_devicemode_get_reserved2(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_reserved2;
+ py_reserved2 = PyInt_FromLong(object->reserved2);
+ return py_reserved2;
+}
+
+static int py_ntprinting_devicemode_set_reserved2(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->reserved2 = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_devicemode_get_panningwidth(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_panningwidth;
+ py_panningwidth = PyInt_FromLong(object->panningwidth);
+ return py_panningwidth;
+}
+
+static int py_ntprinting_devicemode_set_panningwidth(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->panningwidth = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_devicemode_get_panningheight(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_panningheight;
+ py_panningheight = PyInt_FromLong(object->panningheight);
+ return py_panningheight;
+}
+
+static int py_ntprinting_devicemode_set_panningheight(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->panningheight = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_devicemode_get_nt_dev_private(PyObject *obj, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(obj);
+ PyObject *py_nt_dev_private;
+ if (object->nt_dev_private == NULL) {
+ py_nt_dev_private = Py_None;
+ Py_INCREF(py_nt_dev_private);
+ } else {
+ py_nt_dev_private = PyString_FromStringAndSize((char *)(*object->nt_dev_private).data, (*object->nt_dev_private).length);
+ }
+ return py_nt_dev_private;
+}
+
+static int py_ntprinting_devicemode_set_nt_dev_private(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->nt_dev_private);
+ if (value == Py_None) {
+ object->nt_dev_private = NULL;
+ } else {
+ object->nt_dev_private = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->nt_dev_private);
+ *object->nt_dev_private = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value), PyString_GET_SIZE(value));
+ }
+ return 0;
+}
+
+static PyGetSetDef py_ntprinting_devicemode_getsetters[] = {
+ { discard_const_p(char, "devicename"), py_ntprinting_devicemode_get_devicename, py_ntprinting_devicemode_set_devicename },
+ { discard_const_p(char, "formname"), py_ntprinting_devicemode_get_formname, py_ntprinting_devicemode_set_formname },
+ { discard_const_p(char, "specversion"), py_ntprinting_devicemode_get_specversion, py_ntprinting_devicemode_set_specversion },
+ { discard_const_p(char, "driverversion"), py_ntprinting_devicemode_get_driverversion, py_ntprinting_devicemode_set_driverversion },
+ { discard_const_p(char, "size"), py_ntprinting_devicemode_get_size, py_ntprinting_devicemode_set_size },
+ { discard_const_p(char, "driverextra"), py_ntprinting_devicemode_get_driverextra, py_ntprinting_devicemode_set_driverextra },
+ { discard_const_p(char, "orientation"), py_ntprinting_devicemode_get_orientation, py_ntprinting_devicemode_set_orientation },
+ { discard_const_p(char, "papersize"), py_ntprinting_devicemode_get_papersize, py_ntprinting_devicemode_set_papersize },
+ { discard_const_p(char, "paperlength"), py_ntprinting_devicemode_get_paperlength, py_ntprinting_devicemode_set_paperlength },
+ { discard_const_p(char, "paperwidth"), py_ntprinting_devicemode_get_paperwidth, py_ntprinting_devicemode_set_paperwidth },
+ { discard_const_p(char, "scale"), py_ntprinting_devicemode_get_scale, py_ntprinting_devicemode_set_scale },
+ { discard_const_p(char, "copies"), py_ntprinting_devicemode_get_copies, py_ntprinting_devicemode_set_copies },
+ { discard_const_p(char, "defaultsource"), py_ntprinting_devicemode_get_defaultsource, py_ntprinting_devicemode_set_defaultsource },
+ { discard_const_p(char, "printquality"), py_ntprinting_devicemode_get_printquality, py_ntprinting_devicemode_set_printquality },
+ { discard_const_p(char, "color"), py_ntprinting_devicemode_get_color, py_ntprinting_devicemode_set_color },
+ { discard_const_p(char, "duplex"), py_ntprinting_devicemode_get_duplex, py_ntprinting_devicemode_set_duplex },
+ { discard_const_p(char, "yresolution"), py_ntprinting_devicemode_get_yresolution, py_ntprinting_devicemode_set_yresolution },
+ { discard_const_p(char, "ttoption"), py_ntprinting_devicemode_get_ttoption, py_ntprinting_devicemode_set_ttoption },
+ { discard_const_p(char, "collate"), py_ntprinting_devicemode_get_collate, py_ntprinting_devicemode_set_collate },
+ { discard_const_p(char, "logpixels"), py_ntprinting_devicemode_get_logpixels, py_ntprinting_devicemode_set_logpixels },
+ { discard_const_p(char, "fields"), py_ntprinting_devicemode_get_fields, py_ntprinting_devicemode_set_fields },
+ { discard_const_p(char, "bitsperpel"), py_ntprinting_devicemode_get_bitsperpel, py_ntprinting_devicemode_set_bitsperpel },
+ { discard_const_p(char, "pelswidth"), py_ntprinting_devicemode_get_pelswidth, py_ntprinting_devicemode_set_pelswidth },
+ { discard_const_p(char, "pelsheight"), py_ntprinting_devicemode_get_pelsheight, py_ntprinting_devicemode_set_pelsheight },
+ { discard_const_p(char, "displayflags"), py_ntprinting_devicemode_get_displayflags, py_ntprinting_devicemode_set_displayflags },
+ { discard_const_p(char, "displayfrequency"), py_ntprinting_devicemode_get_displayfrequency, py_ntprinting_devicemode_set_displayfrequency },
+ { discard_const_p(char, "icmmethod"), py_ntprinting_devicemode_get_icmmethod, py_ntprinting_devicemode_set_icmmethod },
+ { discard_const_p(char, "icmintent"), py_ntprinting_devicemode_get_icmintent, py_ntprinting_devicemode_set_icmintent },
+ { discard_const_p(char, "mediatype"), py_ntprinting_devicemode_get_mediatype, py_ntprinting_devicemode_set_mediatype },
+ { discard_const_p(char, "dithertype"), py_ntprinting_devicemode_get_dithertype, py_ntprinting_devicemode_set_dithertype },
+ { discard_const_p(char, "reserved1"), py_ntprinting_devicemode_get_reserved1, py_ntprinting_devicemode_set_reserved1 },
+ { discard_const_p(char, "reserved2"), py_ntprinting_devicemode_get_reserved2, py_ntprinting_devicemode_set_reserved2 },
+ { discard_const_p(char, "panningwidth"), py_ntprinting_devicemode_get_panningwidth, py_ntprinting_devicemode_set_panningwidth },
+ { discard_const_p(char, "panningheight"), py_ntprinting_devicemode_get_panningheight, py_ntprinting_devicemode_set_panningheight },
+ { discard_const_p(char, "nt_dev_private"), py_ntprinting_devicemode_get_nt_dev_private, py_ntprinting_devicemode_set_nt_dev_private },
+ { NULL }
+};
+
+static PyObject *py_ntprinting_devicemode_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ return pytalloc_new(struct ntprinting_devicemode, type);
+}
+
+static PyObject *py_ntprinting_devicemode_ndr_pack(PyObject *py_obj)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ DATA_BLOB blob;
+ enum ndr_err_code err;
+ err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_ntprinting_devicemode);
+ if (err != NDR_ERR_SUCCESS) {
+ PyErr_SetNdrError(err);
+ return NULL;
+ }
+
+ return PyString_FromStringAndSize((char *)blob.data, blob.length);
+}
+
+static PyObject *py_ntprinting_devicemode_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ DATA_BLOB blob;
+ int blob_length = 0;
+ enum ndr_err_code err;
+ const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
+ PyObject *allow_remaining_obj = NULL;
+ bool allow_remaining = false;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
+ discard_const_p(char *, kwnames),
+ &blob.data, &blob_length,
+ &allow_remaining_obj)) {
+ return NULL;
+ }
+ blob.length = blob_length;
+
+ if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
+ allow_remaining = true;
+ }
+
+ if (allow_remaining) {
+ err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ntprinting_devicemode);
+ } else {
+ err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ntprinting_devicemode);
+ }
+ if (err != NDR_ERR_SUCCESS) {
+ PyErr_SetNdrError(err);
+ return NULL;
+ }
+
+ Py_RETURN_NONE;
+}
+
+static PyObject *py_ntprinting_devicemode_ndr_print(PyObject *py_obj)
+{
+ struct ntprinting_devicemode *object = (struct ntprinting_devicemode *)pytalloc_get_ptr(py_obj);
+ PyObject *ret;
+ char *retstr;
+
+ retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_ntprinting_devicemode, "ntprinting_devicemode", object);
+ ret = PyString_FromString(retstr);
+ talloc_free(retstr);
+
+ return ret;
+}
+
+static PyMethodDef py_ntprinting_devicemode_methods[] = {
+ { "__ndr_pack__", (PyCFunction)py_ntprinting_devicemode_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
+ { "__ndr_unpack__", (PyCFunction)py_ntprinting_devicemode_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
+ { "__ndr_print__", (PyCFunction)py_ntprinting_devicemode_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
+ { NULL, NULL, 0, NULL }
+};
+
+
+static PyTypeObject ntprinting_devicemode_Type = {
+ PyObject_HEAD_INIT(NULL) 0,
+ .tp_name = "ntprinting.devicemode",
+ .tp_getset = py_ntprinting_devicemode_getsetters,
+ .tp_methods = py_ntprinting_devicemode_methods,
+ .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ .tp_basicsize = sizeof(pytalloc_Object),
+ .tp_new = py_ntprinting_devicemode_new,
+};
+
+
+static PyObject *py_ntprinting_printer_data_get_ptr(PyObject *obj, void *closure)
+{
+ struct ntprinting_printer_data *object = (struct ntprinting_printer_data *)pytalloc_get_ptr(obj);
+ PyObject *py_ptr;
+ py_ptr = PyInt_FromLong(object->ptr);
+ return py_ptr;
+}
+
+static int py_ntprinting_printer_data_set_ptr(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_printer_data *object = (struct ntprinting_printer_data *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->ptr = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_printer_data_get_name(PyObject *obj, void *closure)
+{
+ struct ntprinting_printer_data *object = (struct ntprinting_printer_data *)pytalloc_get_ptr(obj);
+ PyObject *py_name;
+ py_name = PyString_FromStringOrNULL(object->name);
+ return py_name;
+}
+
+static int py_ntprinting_printer_data_set_name(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_printer_data *object = (struct ntprinting_printer_data *)pytalloc_get_ptr(py_obj);
+ object->name = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
+ return 0;
+}
+
+static PyObject *py_ntprinting_printer_data_get_type(PyObject *obj, void *closure)
+{
+ struct ntprinting_printer_data *object = (struct ntprinting_printer_data *)pytalloc_get_ptr(obj);
+ PyObject *py_type;
+ py_type = PyInt_FromLong(object->type);
+ return py_type;
+}
+
+static int py_ntprinting_printer_data_set_type(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_printer_data *object = (struct ntprinting_printer_data *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->type = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_printer_data_get_data(PyObject *obj, void *closure)
+{
+ struct ntprinting_printer_data *object = (struct ntprinting_printer_data *)pytalloc_get_ptr(obj);
+ PyObject *py_data;
+ py_data = PyString_FromStringAndSize((char *)(object->data).data, (object->data).length);
+ return py_data;
+}
+
+static int py_ntprinting_printer_data_set_data(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_printer_data *object = (struct ntprinting_printer_data *)pytalloc_get_ptr(py_obj);
+ object->data = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value), PyString_GET_SIZE(value));
+ return 0;
+}
+
+static PyGetSetDef py_ntprinting_printer_data_getsetters[] = {
+ { discard_const_p(char, "ptr"), py_ntprinting_printer_data_get_ptr, py_ntprinting_printer_data_set_ptr },
+ { discard_const_p(char, "name"), py_ntprinting_printer_data_get_name, py_ntprinting_printer_data_set_name },
+ { discard_const_p(char, "type"), py_ntprinting_printer_data_get_type, py_ntprinting_printer_data_set_type },
+ { discard_const_p(char, "data"), py_ntprinting_printer_data_get_data, py_ntprinting_printer_data_set_data },
+ { NULL }
+};
+
+static PyObject *py_ntprinting_printer_data_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ return pytalloc_new(struct ntprinting_printer_data, type);
+}
+
+static PyObject *py_ntprinting_printer_data_ndr_pack(PyObject *py_obj)
+{
+ struct ntprinting_printer_data *object = (struct ntprinting_printer_data *)pytalloc_get_ptr(py_obj);
+ DATA_BLOB blob;
+ enum ndr_err_code err;
+ err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_ntprinting_printer_data);
+ if (err != NDR_ERR_SUCCESS) {
+ PyErr_SetNdrError(err);
+ return NULL;
+ }
+
+ return PyString_FromStringAndSize((char *)blob.data, blob.length);
+}
+
+static PyObject *py_ntprinting_printer_data_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
+{
+ struct ntprinting_printer_data *object = (struct ntprinting_printer_data *)pytalloc_get_ptr(py_obj);
+ DATA_BLOB blob;
+ int blob_length = 0;
+ enum ndr_err_code err;
+ const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
+ PyObject *allow_remaining_obj = NULL;
+ bool allow_remaining = false;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
+ discard_const_p(char *, kwnames),
+ &blob.data, &blob_length,
+ &allow_remaining_obj)) {
+ return NULL;
+ }
+ blob.length = blob_length;
+
+ if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
+ allow_remaining = true;
+ }
+
+ if (allow_remaining) {
+ err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ntprinting_printer_data);
+ } else {
+ err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ntprinting_printer_data);
+ }
+ if (err != NDR_ERR_SUCCESS) {
+ PyErr_SetNdrError(err);
+ return NULL;
+ }
+
+ Py_RETURN_NONE;
+}
+
+static PyObject *py_ntprinting_printer_data_ndr_print(PyObject *py_obj)
+{
+ struct ntprinting_printer_data *object = (struct ntprinting_printer_data *)pytalloc_get_ptr(py_obj);
+ PyObject *ret;
+ char *retstr;
+
+ retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_ntprinting_printer_data, "ntprinting_printer_data", object);
+ ret = PyString_FromString(retstr);
+ talloc_free(retstr);
+
+ return ret;
+}
+
+static PyMethodDef py_ntprinting_printer_data_methods[] = {
+ { "__ndr_pack__", (PyCFunction)py_ntprinting_printer_data_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
+ { "__ndr_unpack__", (PyCFunction)py_ntprinting_printer_data_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
+ { "__ndr_print__", (PyCFunction)py_ntprinting_printer_data_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
+ { NULL, NULL, 0, NULL }
+};
+
+
+static PyTypeObject ntprinting_printer_data_Type = {
+ PyObject_HEAD_INIT(NULL) 0,
+ .tp_name = "ntprinting.printer_data",
+ .tp_getset = py_ntprinting_printer_data_getsetters,
+ .tp_methods = py_ntprinting_printer_data_methods,
+ .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ .tp_basicsize = sizeof(pytalloc_Object),
+ .tp_new = py_ntprinting_printer_data_new,
+};
+
+
+static PyObject *py_ntprinting_printer_info_get_attributes(PyObject *obj, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(obj);
+ PyObject *py_attributes;
+ py_attributes = PyInt_FromLong(object->attributes);
+ return py_attributes;
+}
+
+static int py_ntprinting_printer_info_set_attributes(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->attributes = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_printer_info_get_priority(PyObject *obj, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(obj);
+ PyObject *py_priority;
+ py_priority = PyInt_FromLong(object->priority);
+ return py_priority;
+}
+
+static int py_ntprinting_printer_info_set_priority(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->priority = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_printer_info_get_default_priority(PyObject *obj, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(obj);
+ PyObject *py_default_priority;
+ py_default_priority = PyInt_FromLong(object->default_priority);
+ return py_default_priority;
+}
+
+static int py_ntprinting_printer_info_set_default_priority(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->default_priority = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_printer_info_get_starttime(PyObject *obj, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(obj);
+ PyObject *py_starttime;
+ py_starttime = PyInt_FromLong(object->starttime);
+ return py_starttime;
+}
+
+static int py_ntprinting_printer_info_set_starttime(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->starttime = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_printer_info_get_untiltime(PyObject *obj, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(obj);
+ PyObject *py_untiltime;
+ py_untiltime = PyInt_FromLong(object->untiltime);
+ return py_untiltime;
+}
+
+static int py_ntprinting_printer_info_set_untiltime(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->untiltime = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_printer_info_get_status(PyObject *obj, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(obj);
+ PyObject *py_status;
+ py_status = PyInt_FromLong(object->status);
+ return py_status;
+}
+
+static int py_ntprinting_printer_info_set_status(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->status = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_printer_info_get_cjobs(PyObject *obj, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(obj);
+ PyObject *py_cjobs;
+ py_cjobs = PyInt_FromLong(object->cjobs);
+ return py_cjobs;
+}
+
+static int py_ntprinting_printer_info_set_cjobs(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->cjobs = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_printer_info_get_averageppm(PyObject *obj, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(obj);
+ PyObject *py_averageppm;
+ py_averageppm = PyInt_FromLong(object->averageppm);
+ return py_averageppm;
+}
+
+static int py_ntprinting_printer_info_set_averageppm(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->averageppm = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_printer_info_get_changeid(PyObject *obj, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(obj);
+ PyObject *py_changeid;
+ py_changeid = PyInt_FromLong(object->changeid);
+ return py_changeid;
+}
+
+static int py_ntprinting_printer_info_set_changeid(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->changeid = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_printer_info_get_c_setprinter(PyObject *obj, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(obj);
+ PyObject *py_c_setprinter;
+ py_c_setprinter = PyInt_FromLong(object->c_setprinter);
+ return py_c_setprinter;
+}
+
+static int py_ntprinting_printer_info_set_c_setprinter(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->c_setprinter = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_printer_info_get_setuptime(PyObject *obj, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(obj);
+ PyObject *py_setuptime;
+ py_setuptime = PyInt_FromLong(object->setuptime);
+ return py_setuptime;
+}
+
+static int py_ntprinting_printer_info_set_setuptime(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->setuptime = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_printer_info_get_servername(PyObject *obj, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(obj);
+ PyObject *py_servername;
+ py_servername = PyString_FromStringOrNULL(object->servername);
+ return py_servername;
+}
+
+static int py_ntprinting_printer_info_set_servername(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(py_obj);
+ object->servername = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
+ return 0;
+}
+
+static PyObject *py_ntprinting_printer_info_get_printername(PyObject *obj, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(obj);
+ PyObject *py_printername;
+ py_printername = PyString_FromStringOrNULL(object->printername);
+ return py_printername;
+}
+
+static int py_ntprinting_printer_info_set_printername(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(py_obj);
+ object->printername = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
+ return 0;
+}
+
+static PyObject *py_ntprinting_printer_info_get_sharename(PyObject *obj, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(obj);
+ PyObject *py_sharename;
+ py_sharename = PyString_FromStringOrNULL(object->sharename);
+ return py_sharename;
+}
+
+static int py_ntprinting_printer_info_set_sharename(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(py_obj);
+ object->sharename = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
+ return 0;
+}
+
+static PyObject *py_ntprinting_printer_info_get_portname(PyObject *obj, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(obj);
+ PyObject *py_portname;
+ py_portname = PyString_FromStringOrNULL(object->portname);
+ return py_portname;
+}
+
+static int py_ntprinting_printer_info_set_portname(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(py_obj);
+ object->portname = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
+ return 0;
+}
+
+static PyObject *py_ntprinting_printer_info_get_drivername(PyObject *obj, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(obj);
+ PyObject *py_drivername;
+ py_drivername = PyString_FromStringOrNULL(object->drivername);
+ return py_drivername;
+}
+
+static int py_ntprinting_printer_info_set_drivername(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(py_obj);
+ object->drivername = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
+ return 0;
+}
+
+static PyObject *py_ntprinting_printer_info_get_comment(PyObject *obj, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(obj);
+ PyObject *py_comment;
+ py_comment = PyString_FromStringOrNULL(object->comment);
+ return py_comment;
+}
+
+static int py_ntprinting_printer_info_set_comment(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(py_obj);
+ object->comment = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
+ return 0;
+}
+
+static PyObject *py_ntprinting_printer_info_get_location(PyObject *obj, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(obj);
+ PyObject *py_location;
+ py_location = PyString_FromStringOrNULL(object->location);
+ return py_location;
+}
+
+static int py_ntprinting_printer_info_set_location(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(py_obj);
+ object->location = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
+ return 0;
+}
+
+static PyObject *py_ntprinting_printer_info_get_sepfile(PyObject *obj, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(obj);
+ PyObject *py_sepfile;
+ py_sepfile = PyString_FromStringOrNULL(object->sepfile);
+ return py_sepfile;
+}
+
+static int py_ntprinting_printer_info_set_sepfile(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(py_obj);
+ object->sepfile = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
+ return 0;
+}
+
+static PyObject *py_ntprinting_printer_info_get_printprocessor(PyObject *obj, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(obj);
+ PyObject *py_printprocessor;
+ py_printprocessor = PyString_FromStringOrNULL(object->printprocessor);
+ return py_printprocessor;
+}
+
+static int py_ntprinting_printer_info_set_printprocessor(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(py_obj);
+ object->printprocessor = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
+ return 0;
+}
+
+static PyObject *py_ntprinting_printer_info_get_datatype(PyObject *obj, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(obj);
+ PyObject *py_datatype;
+ py_datatype = PyString_FromStringOrNULL(object->datatype);
+ return py_datatype;
+}
+
+static int py_ntprinting_printer_info_set_datatype(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(py_obj);
+ object->datatype = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
+ return 0;
+}
+
+static PyObject *py_ntprinting_printer_info_get_parameters(PyObject *obj, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(obj);
+ PyObject *py_parameters;
+ py_parameters = PyString_FromStringOrNULL(object->parameters);
+ return py_parameters;
+}
+
+static int py_ntprinting_printer_info_set_parameters(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(py_obj);
+ object->parameters = talloc_strdup(pytalloc_get_mem_ctx(py_obj), PyString_AS_STRING(value));
+ return 0;
+}
+
+static PyGetSetDef py_ntprinting_printer_info_getsetters[] = {
+ { discard_const_p(char, "attributes"), py_ntprinting_printer_info_get_attributes, py_ntprinting_printer_info_set_attributes },
+ { discard_const_p(char, "priority"), py_ntprinting_printer_info_get_priority, py_ntprinting_printer_info_set_priority },
+ { discard_const_p(char, "default_priority"), py_ntprinting_printer_info_get_default_priority, py_ntprinting_printer_info_set_default_priority },
+ { discard_const_p(char, "starttime"), py_ntprinting_printer_info_get_starttime, py_ntprinting_printer_info_set_starttime },
+ { discard_const_p(char, "untiltime"), py_ntprinting_printer_info_get_untiltime, py_ntprinting_printer_info_set_untiltime },
+ { discard_const_p(char, "status"), py_ntprinting_printer_info_get_status, py_ntprinting_printer_info_set_status },
+ { discard_const_p(char, "cjobs"), py_ntprinting_printer_info_get_cjobs, py_ntprinting_printer_info_set_cjobs },
+ { discard_const_p(char, "averageppm"), py_ntprinting_printer_info_get_averageppm, py_ntprinting_printer_info_set_averageppm },
+ { discard_const_p(char, "changeid"), py_ntprinting_printer_info_get_changeid, py_ntprinting_printer_info_set_changeid },
+ { discard_const_p(char, "c_setprinter"), py_ntprinting_printer_info_get_c_setprinter, py_ntprinting_printer_info_set_c_setprinter },
+ { discard_const_p(char, "setuptime"), py_ntprinting_printer_info_get_setuptime, py_ntprinting_printer_info_set_setuptime },
+ { discard_const_p(char, "servername"), py_ntprinting_printer_info_get_servername, py_ntprinting_printer_info_set_servername },
+ { discard_const_p(char, "printername"), py_ntprinting_printer_info_get_printername, py_ntprinting_printer_info_set_printername },
+ { discard_const_p(char, "sharename"), py_ntprinting_printer_info_get_sharename, py_ntprinting_printer_info_set_sharename },
+ { discard_const_p(char, "portname"), py_ntprinting_printer_info_get_portname, py_ntprinting_printer_info_set_portname },
+ { discard_const_p(char, "drivername"), py_ntprinting_printer_info_get_drivername, py_ntprinting_printer_info_set_drivername },
+ { discard_const_p(char, "comment"), py_ntprinting_printer_info_get_comment, py_ntprinting_printer_info_set_comment },
+ { discard_const_p(char, "location"), py_ntprinting_printer_info_get_location, py_ntprinting_printer_info_set_location },
+ { discard_const_p(char, "sepfile"), py_ntprinting_printer_info_get_sepfile, py_ntprinting_printer_info_set_sepfile },
+ { discard_const_p(char, "printprocessor"), py_ntprinting_printer_info_get_printprocessor, py_ntprinting_printer_info_set_printprocessor },
+ { discard_const_p(char, "datatype"), py_ntprinting_printer_info_get_datatype, py_ntprinting_printer_info_set_datatype },
+ { discard_const_p(char, "parameters"), py_ntprinting_printer_info_get_parameters, py_ntprinting_printer_info_set_parameters },
+ { NULL }
+};
+
+static PyObject *py_ntprinting_printer_info_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ return pytalloc_new(struct ntprinting_printer_info, type);
+}
+
+static PyObject *py_ntprinting_printer_info_ndr_pack(PyObject *py_obj)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(py_obj);
+ DATA_BLOB blob;
+ enum ndr_err_code err;
+ err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_ntprinting_printer_info);
+ if (err != NDR_ERR_SUCCESS) {
+ PyErr_SetNdrError(err);
+ return NULL;
+ }
+
+ return PyString_FromStringAndSize((char *)blob.data, blob.length);
+}
+
+static PyObject *py_ntprinting_printer_info_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(py_obj);
+ DATA_BLOB blob;
+ int blob_length = 0;
+ enum ndr_err_code err;
+ const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
+ PyObject *allow_remaining_obj = NULL;
+ bool allow_remaining = false;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
+ discard_const_p(char *, kwnames),
+ &blob.data, &blob_length,
+ &allow_remaining_obj)) {
+ return NULL;
+ }
+ blob.length = blob_length;
+
+ if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
+ allow_remaining = true;
+ }
+
+ if (allow_remaining) {
+ err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ntprinting_printer_info);
+ } else {
+ err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ntprinting_printer_info);
+ }
+ if (err != NDR_ERR_SUCCESS) {
+ PyErr_SetNdrError(err);
+ return NULL;
+ }
+
+ Py_RETURN_NONE;
+}
+
+static PyObject *py_ntprinting_printer_info_ndr_print(PyObject *py_obj)
+{
+ struct ntprinting_printer_info *object = (struct ntprinting_printer_info *)pytalloc_get_ptr(py_obj);
+ PyObject *ret;
+ char *retstr;
+
+ retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_ntprinting_printer_info, "ntprinting_printer_info", object);
+ ret = PyString_FromString(retstr);
+ talloc_free(retstr);
+
+ return ret;
+}
+
+static PyMethodDef py_ntprinting_printer_info_methods[] = {
+ { "__ndr_pack__", (PyCFunction)py_ntprinting_printer_info_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
+ { "__ndr_unpack__", (PyCFunction)py_ntprinting_printer_info_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
+ { "__ndr_print__", (PyCFunction)py_ntprinting_printer_info_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
+ { NULL, NULL, 0, NULL }
+};
+
+
+static PyTypeObject ntprinting_printer_info_Type = {
+ PyObject_HEAD_INIT(NULL) 0,
+ .tp_name = "ntprinting.printer_info",
+ .tp_getset = py_ntprinting_printer_info_getsetters,
+ .tp_methods = py_ntprinting_printer_info_methods,
+ .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ .tp_basicsize = sizeof(pytalloc_Object),
+ .tp_new = py_ntprinting_printer_info_new,
+};
+
+
+static PyObject *py_ntprinting_printer_get_info(PyObject *obj, void *closure)
+{
+ struct ntprinting_printer *object = (struct ntprinting_printer *)pytalloc_get_ptr(obj);
+ PyObject *py_info;
+ py_info = pytalloc_reference_ex(&ntprinting_printer_info_Type, pytalloc_get_mem_ctx(obj), &object->info);
+ return py_info;
+}
+
+static int py_ntprinting_printer_set_info(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_printer *object = (struct ntprinting_printer *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&ntprinting_printer_info_Type, value, return -1;);
+ if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ object->info = *(struct ntprinting_printer_info *)pytalloc_get_ptr(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_printer_get_devmode(PyObject *obj, void *closure)
+{
+ struct ntprinting_printer *object = (struct ntprinting_printer *)pytalloc_get_ptr(obj);
+ PyObject *py_devmode;
+ if (object->devmode == NULL) {
+ py_devmode = Py_None;
+ Py_INCREF(py_devmode);
+ } else {
+ py_devmode = pytalloc_reference_ex(&ntprinting_devicemode_Type, object->devmode, object->devmode);
+ }
+ return py_devmode;
+}
+
+static int py_ntprinting_printer_set_devmode(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_printer *object = (struct ntprinting_printer *)pytalloc_get_ptr(py_obj);
+ talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->devmode);
+ if (value == Py_None) {
+ object->devmode = NULL;
+ } else {
+ object->devmode = NULL;
+ PY_CHECK_TYPE(&ntprinting_devicemode_Type, value, return -1;);
+ if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ object->devmode = (struct ntprinting_devicemode *)pytalloc_get_ptr(value);
+ }
+ return 0;
+}
+
+static PyObject *py_ntprinting_printer_get_count(PyObject *obj, void *closure)
+{
+ struct ntprinting_printer *object = (struct ntprinting_printer *)pytalloc_get_ptr(obj);
+ PyObject *py_count;
+ py_count = PyInt_FromLong(object->count);
+ return py_count;
+}
+
+static int py_ntprinting_printer_set_count(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_printer *object = (struct ntprinting_printer *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
+ object->count = PyInt_AsLong(value);
+ return 0;
+}
+
+static PyObject *py_ntprinting_printer_get_printer_data(PyObject *obj, void *closure)
+{
+ struct ntprinting_printer *object = (struct ntprinting_printer *)pytalloc_get_ptr(obj);
+ PyObject *py_printer_data;
+ py_printer_data = PyList_New(object->count);
+ if (py_printer_data == NULL) {
+ return NULL;
+ }
+ {
+ int printer_data_cntr_0;
+ for (printer_data_cntr_0 = 0; printer_data_cntr_0 < object->count; printer_data_cntr_0++) {
+ PyObject *py_printer_data_0;
+ py_printer_data_0 = pytalloc_reference_ex(&ntprinting_printer_data_Type, object->printer_data, &object->printer_data[printer_data_cntr_0]);
+ PyList_SetItem(py_printer_data, printer_data_cntr_0, py_printer_data_0);
+ }
+ }
+ return py_printer_data;
+}
+
+static int py_ntprinting_printer_set_printer_data(PyObject *py_obj, PyObject *value, void *closure)
+{
+ struct ntprinting_printer *object = (struct ntprinting_printer *)pytalloc_get_ptr(py_obj);
+ PY_CHECK_TYPE(&PyList_Type, value, return -1;);
+ {
+ int printer_data_cntr_0;
+ object->printer_data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->printer_data, PyList_GET_SIZE(value));
+ if (!object->printer_data) { return -1;; }
+ talloc_set_name_const(object->printer_data, "ARRAY: object->printer_data");
+ for (printer_data_cntr_0 = 0; printer_data_cntr_0 < PyList_GET_SIZE(value); printer_data_cntr_0++) {
+ PY_CHECK_TYPE(&ntprinting_printer_data_Type, PyList_GET_ITEM(value, printer_data_cntr_0), return -1;);
+ if (talloc_reference(object->printer_data, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, printer_data_cntr_0))) == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ object->printer_data[printer_data_cntr_0] = *(struct ntprinting_printer_data *)pytalloc_get_ptr(PyList_GET_ITEM(value, printer_data_cntr_0));
+ }
+ }
+ return 0;
+}
+
+static PyGetSetDef py_ntprinting_printer_getsetters[] = {
+ { discard_const_p(char, "info"), py_ntprinting_printer_get_info, py_ntprinting_printer_set_info },
+ { discard_const_p(char, "devmode"), py_ntprinting_printer_get_devmode, py_ntprinting_printer_set_devmode },
+ { discard_const_p(char, "count"), py_ntprinting_printer_get_count, py_ntprinting_printer_set_count },
+ { discard_const_p(char, "printer_data"), py_ntprinting_printer_get_printer_data, py_ntprinting_printer_set_printer_data },
+ { NULL }
+};
+
+static PyObject *py_ntprinting_printer_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ return pytalloc_new(struct ntprinting_printer, type);
+}
+
+static PyObject *py_ntprinting_printer_ndr_pack(PyObject *py_obj)
+{
+ struct ntprinting_printer *object = (struct ntprinting_printer *)pytalloc_get_ptr(py_obj);
+ DATA_BLOB blob;
+ enum ndr_err_code err;
+ err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_ntprinting_printer);
+ if (err != NDR_ERR_SUCCESS) {
+ PyErr_SetNdrError(err);
+ return NULL;
+ }
+
+ return PyString_FromStringAndSize((char *)blob.data, blob.length);
+}
+
+static PyObject *py_ntprinting_printer_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
+{
+ struct ntprinting_printer *object = (struct ntprinting_printer *)pytalloc_get_ptr(py_obj);
+ DATA_BLOB blob;
+ int blob_length = 0;
+ enum ndr_err_code err;
+ const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
+ PyObject *allow_remaining_obj = NULL;
+ bool allow_remaining = false;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
+ discard_const_p(char *, kwnames),
+ &blob.data, &blob_length,
+ &allow_remaining_obj)) {
+ return NULL;
+ }
+ blob.length = blob_length;
+
+ if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
+ allow_remaining = true;
+ }
+
+ if (allow_remaining) {
+ err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ntprinting_printer);
+ } else {
+ err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_ntprinting_printer);
+ }
+ if (err != NDR_ERR_SUCCESS) {
+ PyErr_SetNdrError(err);
+ return NULL;
+ }
+
+ Py_RETURN_NONE;
+}
+
+static PyObject *py_ntprinting_printer_ndr_print(PyObject *py_obj)
+{
+ struct ntprinting_printer *object = (struct ntprinting_printer *)pytalloc_get_ptr(py_obj);
+ PyObject *ret;
+ char *retstr;
+
+ retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_ntprinting_printer, "ntprinting_printer", object);
+ ret = PyString_FromString(retstr);
+ talloc_free(retstr);
+
+ return ret;
+}
+
+static PyMethodDef py_ntprinting_printer_methods[] = {
+ { "__ndr_pack__", (PyCFunction)py_ntprinting_printer_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
+ { "__ndr_unpack__", (PyCFunction)py_ntprinting_printer_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
+ { "__ndr_print__", (PyCFunction)py_ntprinting_printer_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
+ { NULL, NULL, 0, NULL }
+};
+
+
+static PyTypeObject ntprinting_printer_Type = {
+ PyObject_HEAD_INIT(NULL) 0,
+ .tp_name = "ntprinting.printer",
+ .tp_getset = py_ntprinting_printer_getsetters,
+ .tp_methods = py_ntprinting_printer_methods,
+ .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ .tp_basicsize = sizeof(pytalloc_Object),
+ .tp_new = py_ntprinting_printer_new,
+};
+
+
+static bool pack_py_decode_ntprinting_form_args_in(PyObject *args, PyObject *kwargs, struct decode_ntprinting_form *r)
+{
+ PyObject *py_form;
+ const char *kwnames[] = {
+ "form", NULL
+ };
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:decode_ntprinting_form", discard_const_p(char *, kwnames), &py_form)) {
+ return false;
+ }
+
+ PY_CHECK_TYPE(&ntprinting_form_Type, py_form, return false;);
+ if (talloc_reference(r, pytalloc_get_mem_ctx(py_form)) == NULL) {
+ PyErr_NoMemory();
+ return false;
+ }
+ r->in.form = *(struct ntprinting_form *)pytalloc_get_ptr(py_form);
+ return true;
+}
+
+static PyObject *unpack_py_decode_ntprinting_form_args_out(struct decode_ntprinting_form *r)
+{
+ PyObject *result;
+ result = Py_None;
+ Py_INCREF(result);
+ return result;
+}
+
+static bool pack_py_decode_ntprinting_driver_args_in(PyObject *args, PyObject *kwargs, struct decode_ntprinting_driver *r)
+{
+ PyObject *py_driver;
+ const char *kwnames[] = {
+ "driver", NULL
+ };
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:decode_ntprinting_driver", discard_const_p(char *, kwnames), &py_driver)) {
+ return false;
+ }
+
+ PY_CHECK_TYPE(&ntprinting_driver_Type, py_driver, return false;);
+ if (talloc_reference(r, pytalloc_get_mem_ctx(py_driver)) == NULL) {
+ PyErr_NoMemory();
+ return false;
+ }
+ r->in.driver = *(struct ntprinting_driver *)pytalloc_get_ptr(py_driver);
+ return true;
+}
+
+static PyObject *unpack_py_decode_ntprinting_driver_args_out(struct decode_ntprinting_driver *r)
+{
+ PyObject *result;
+ result = Py_None;
+ Py_INCREF(result);
+ return result;
+}
+
+static bool pack_py_decode_ntprinting_printer_args_in(PyObject *args, PyObject *kwargs, struct decode_ntprinting_printer *r)
+{
+ PyObject *py_printer;
+ const char *kwnames[] = {
+ "printer", NULL
+ };
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:decode_ntprinting_printer", discard_const_p(char *, kwnames), &py_printer)) {
+ return false;
+ }
+
+ PY_CHECK_TYPE(&ntprinting_printer_Type, py_printer, return false;);
+ if (talloc_reference(r, pytalloc_get_mem_ctx(py_printer)) == NULL) {
+ PyErr_NoMemory();
+ return false;
+ }
+ r->in.printer = *(struct ntprinting_printer *)pytalloc_get_ptr(py_printer);
+ return true;
+}
+
+static PyObject *unpack_py_decode_ntprinting_printer_args_out(struct decode_ntprinting_printer *r)
+{
+ PyObject *result;
+ result = Py_None;
+ Py_INCREF(result);
+ return result;
+}
+
+const struct PyNdrRpcMethodDef py_ndr_ntprinting_methods[] = {
+ { "decode_ntprinting_form", "S.decode_ntprinting_form(form) -> None", (py_dcerpc_call_fn)dcerpc_decode_ntprinting_form_r, (py_data_pack_fn)pack_py_decode_ntprinting_form_args_in, (py_data_unpack_fn)unpack_py_decode_ntprinting_form_args_out, 0, &ndr_table_ntprinting },
+ { "decode_ntprinting_driver", "S.decode_ntprinting_driver(driver) -> None", (py_dcerpc_call_fn)dcerpc_decode_ntprinting_driver_r, (py_data_pack_fn)pack_py_decode_ntprinting_driver_args_in, (py_data_unpack_fn)unpack_py_decode_ntprinting_driver_args_out, 1, &ndr_table_ntprinting },
+ { "decode_ntprinting_printer", "S.decode_ntprinting_printer(printer) -> None", (py_dcerpc_call_fn)dcerpc_decode_ntprinting_printer_r, (py_data_pack_fn)pack_py_decode_ntprinting_printer_args_in, (py_data_unpack_fn)unpack_py_decode_ntprinting_printer_args_out, 2, &ndr_table_ntprinting },
+ { NULL }
+};
+
+static PyObject *interface_ntprinting_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_ntprinting);
+}
+
+#define PY_DOC_NTPRINTING "s3 printing tdb formats"
+static PyTypeObject ntprinting_InterfaceType = {
+ PyObject_HEAD_INIT(NULL) 0,
+ .tp_name = "ntprinting.ntprinting",
+ .tp_basicsize = sizeof(dcerpc_InterfaceObject),
+ .tp_doc = "ntprinting(binding, lp_ctx=None, credentials=None) -> connection\n"
+"\n"
+"binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
+"lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
+"credentials should be a credentials.Credentials object.\n\n"PY_DOC_NTPRINTING,
+ .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ .tp_new = interface_ntprinting_new,
+};
+
+static PyMethodDef ntprinting_methods[] = {
+ { NULL, NULL, 0, NULL }
+};
+
+void initntprinting(void)
+{
+ PyObject *m;
+ PyObject *dep_talloc;
+ PyObject *dep_samba_dcerpc_base;
+
+ dep_talloc = PyImport_ImportModule("talloc");
+ if (dep_talloc == NULL)
+ return;
+
+ dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
+ if (dep_samba_dcerpc_base == NULL)
+ return;
+
+ Object_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "Object");
+ if (Object_Type == NULL)
+ return;
+
+ ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
+ if (ClientConnection_Type == NULL)
+ return;
+
+ ntprinting_form_Type.tp_base = Object_Type;
+
+ ntprinting_driver_Type.tp_base = Object_Type;
+
+ ntprinting_devicemode_Type.tp_base = Object_Type;
+
+ ntprinting_printer_data_Type.tp_base = Object_Type;
+
+ ntprinting_printer_info_Type.tp_base = Object_Type;
+
+ ntprinting_printer_Type.tp_base = Object_Type;
+
+ ntprinting_InterfaceType.tp_base = ClientConnection_Type;
+
+ if (PyType_Ready(&ntprinting_form_Type) < 0)
+ return;
+ if (PyType_Ready(&ntprinting_driver_Type) < 0)
+ return;
+ if (PyType_Ready(&ntprinting_devicemode_Type) < 0)
+ return;
+ if (PyType_Ready(&ntprinting_printer_data_Type) < 0)
+ return;
+ if (PyType_Ready(&ntprinting_printer_info_Type) < 0)
+ return;
+ if (PyType_Ready(&ntprinting_printer_Type) < 0)
+ return;
+ if (PyType_Ready(&ntprinting_InterfaceType) < 0)
+ return;
+ if (!PyInterface_AddNdrRpcMethods(&ntprinting_InterfaceType, py_ndr_ntprinting_methods))
+ return;
+
+#ifdef PY_FORM_PATCH
+ PY_FORM_PATCH(&ntprinting_form_Type);
+#endif
+#ifdef PY_DRIVER_PATCH
+ PY_DRIVER_PATCH(&ntprinting_driver_Type);
+#endif
+#ifdef PY_DEVICEMODE_PATCH
+ PY_DEVICEMODE_PATCH(&ntprinting_devicemode_Type);
+#endif
+#ifdef PY_PRINTER_DATA_PATCH
+ PY_PRINTER_DATA_PATCH(&ntprinting_printer_data_Type);
+#endif
+#ifdef PY_PRINTER_INFO_PATCH
+ PY_PRINTER_INFO_PATCH(&ntprinting_printer_info_Type);
+#endif
+#ifdef PY_PRINTER_PATCH
+ PY_PRINTER_PATCH(&ntprinting_printer_Type);
+#endif
+#ifdef PY_NTPRINTING_PATCH
+ PY_NTPRINTING_PATCH(&ntprinting_InterfaceType);
+#endif
+
+ m = Py_InitModule3("ntprinting", ntprinting_methods, "ntprinting DCE/RPC");
+ if (m == NULL)
+ return;
+
+ Py_INCREF((PyObject *)(void *)&ntprinting_form_Type);
+ PyModule_AddObject(m, "form", (PyObject *)(void *)&ntprinting_form_Type);
+ Py_INCREF((PyObject *)(void *)&ntprinting_driver_Type);
+ PyModule_AddObject(m, "driver", (PyObject *)(void *)&ntprinting_driver_Type);
+ Py_INCREF((PyObject *)(void *)&ntprinting_devicemode_Type);
+ PyModule_AddObject(m, "devicemode", (PyObject *)(void *)&ntprinting_devicemode_Type);
+ Py_INCREF((PyObject *)(void *)&ntprinting_printer_data_Type);
+ PyModule_AddObject(m, "printer_data", (PyObject *)(void *)&ntprinting_printer_data_Type);
+ Py_INCREF((PyObject *)(void *)&ntprinting_printer_info_Type);
+ PyModule_AddObject(m, "printer_info", (PyObject *)(void *)&ntprinting_printer_info_Type);
+ Py_INCREF((PyObject *)(void *)&ntprinting_printer_Type);
+ PyModule_AddObject(m, "printer", (PyObject *)(void *)&ntprinting_printer_Type);
+ Py_INCREF((PyObject *)(void *)&ntprinting_InterfaceType);
+ PyModule_AddObject(m, "ntprinting", (PyObject *)(void *)&ntprinting_InterfaceType);
+#ifdef PY_MOD_NTPRINTING_PATCH
+ PY_MOD_NTPRINTING_PATCH(m);
+#endif
+
+}