diff options
author | Tim Potter <tpot@samba.org> | 2002-03-27 05:28:42 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2002-03-27 05:28:42 +0000 |
commit | b66111f9ba0c1286725a591e7584acc9805b5081 (patch) | |
tree | c34521f3c042b38e995741f23055fc5149d0cc27 /source3/python | |
parent | b2df666ca91941734d01f1add567391948221f8b (diff) | |
download | samba-b66111f9ba0c1286725a591e7584acc9805b5081.tar.gz samba-b66111f9ba0c1286725a591e7584acc9805b5081.tar.bz2 samba-b66111f9ba0c1286725a591e7584acc9805b5081.zip |
Moved pyconv definitions across.
Fixed misc compile problems.
(This used to be commit 723bfa1a857b4c3e114b7e510c8f991ba73c1ba1)
Diffstat (limited to 'source3/python')
-rw-r--r-- | source3/python/py_spoolss_ports.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/source3/python/py_spoolss_ports.c b/source3/python/py_spoolss_ports.c index c6cd14279e..1064f3f3d2 100644 --- a/source3/python/py_spoolss_ports.c +++ b/source3/python/py_spoolss_ports.c @@ -24,14 +24,29 @@ #include "python/py_conv.h" #include "python/py_spoolss.h" +struct pyconv py_PORT_INFO_1[] = { + { "name", PY_UNISTR, offsetof(PORT_INFO_1, port_name) }, + { NULL } +}; + +struct pyconv py_PORT_INFO_2[] = { + { "name", PY_UNISTR, offsetof(PORT_INFO_2, port_name) }, + { "monitor_name", PY_UNISTR, offsetof(PORT_INFO_2, monitor_name) }, + { "description", PY_UNISTR, offsetof(PORT_INFO_2, description) }, + { "reserved", PY_UINT32, offsetof(PORT_INFO_2, reserved) }, + { "type", PY_UINT32, offsetof(PORT_INFO_2, port_type) }, + { NULL } +}; + /* Enumerate ports */ -PyObject *spoolss_enumports(PyObject *self, PyObject *args, PyObject *kw) +static PyObject *spoolss_enumports(PyObject *self, PyObject *args, + PyObject *kw) { WERROR werror; PyObject *result, *creds = NULL; int level = 1; - uint32 needed; + uint32 i, needed, num_ports; static char *kwlist[] = {"server", "level", "creds", NULL}; TALLOC_CTX *mem_ctx = NULL; struct cli_state *cli = NULL; @@ -76,7 +91,7 @@ PyObject *spoolss_enumports(PyObject *self, PyObject *args, PyObject *kw) PyObject *value; value = from_struct ( - &ctr.port.info_1[i], py_PORT_INFO_0); + &ctr.port.info_1[i], py_PORT_INFO_1); PyList_SetItem(result, i, value); } @@ -87,7 +102,7 @@ PyObject *spoolss_enumports(PyObject *self, PyObject *args, PyObject *kw) PyObject *value; value = from_struct( - &ctr.port.info_2[i], py_PORT_INFO_1); + &ctr.port.info_2[i], py_PORT_INFO_2); PyList_SetItem(result, i, value); } |