Changeset 740 for vendor/current/libcli/nbt/pynbt.c
- Timestamp:
- Nov 14, 2012, 12:59:34 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/libcli/nbt/pynbt.c
r414 r740 18 18 */ 19 19 20 #include <Python.h> 20 21 #include "includes.h" 21 #include <Python.h>22 22 #include "libcli/util/pyerrors.h" 23 23 #include "scripting/python/modules.h" … … 25 25 #include "lib/events/events.h" 26 26 27 void initnetbios(void); 28 27 29 #ifndef Py_RETURN_NONE 28 30 #define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None 29 31 #endif 30 32 31 PyAPI_DATA(PyTypeObject)nbt_node_Type;33 extern PyTypeObject nbt_node_Type; 32 34 33 35 typedef struct { … … 37 39 } nbt_node_Object; 38 40 39 static void py_nbt_node_dealloc( PyObject *obj)40 { 41 talloc_free( ((nbt_node_Object *)obj)->mem_ctx);42 PyObject_Del(obj);41 static void py_nbt_node_dealloc(nbt_node_Object *self) 42 { 43 talloc_free(self->mem_ctx); 44 self->ob_type->tp_free(self); 43 45 } 44 46 … … 53 55 54 56 ev = s4_event_context_init(ret->mem_ctx); 55 ret->socket = nbt_name_socket_init(ret->mem_ctx, ev , py_iconv_convenience(ret->mem_ctx));57 ret->socket = nbt_name_socket_init(ret->mem_ctx, ev); 56 58 return (PyObject *)ret; 57 59 } … … 125 127 } 126 128 127 static PyObject *PyObject_FromNBTName(struct nbt_name_socket *name_socket, struct smb_iconv_convenience *ic,129 static PyObject *PyObject_FromNBTName(struct nbt_name_socket *name_socket, 128 130 struct nbt_name *name) 129 131 { … … 176 178 PyTuple_SetItem(ret, 0, PyString_FromString(io.out.reply_from)); 177 179 178 py_name = PyObject_FromNBTName(node->socket, py_iconv_convenience(node->socket),&io.out.name);180 py_name = PyObject_FromNBTName(node->socket, &io.out.name); 179 181 if (py_name == NULL) 180 182 return NULL; … … 234 236 PyTuple_SetItem(ret, 0, PyString_FromString(io.out.reply_from)); 235 237 236 py_name = PyObject_FromNBTName(node->socket, py_iconv_convenience(NULL),&io.out.name);238 py_name = PyObject_FromNBTName(node->socket, &io.out.name); 237 239 if (py_name == NULL) 238 240 return NULL; … … 297 299 PyTuple_SetItem(ret, 0, PyString_FromString(io.out.reply_from)); 298 300 299 py_name = PyObject_FromNBTName(node->socket, py_iconv_convenience(NULL),&io.out.name);301 py_name = PyObject_FromNBTName(node->socket, &io.out.name); 300 302 if (py_name == NULL) 301 303 return NULL; … … 352 354 PyTuple_SetItem(ret, 0, PyString_FromString(io.out.reply_from)); 353 355 354 py_name = PyObject_FromNBTName(node->socket, py_iconv_convenience(NULL),&io.out.name);356 py_name = PyObject_FromNBTName(node->socket, &io.out.name); 355 357 if (py_name == NULL) 356 358 return NULL; … … 394 396 .tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, 395 397 .tp_new = py_nbt_node_init, 396 .tp_dealloc = py_nbt_node_dealloc,398 .tp_dealloc = (destructor)py_nbt_node_dealloc, 397 399 .tp_methods = py_nbt_methods, 398 400 .tp_doc = "Node()\n"
Note:
See TracChangeset
for help on using the changeset viewer.