All pastes #734017 Raw Edit

Mine

public c v1 · immutable
·published 2007-10-12 09:17 UTC
rendered paste body
#include <Python.h>#include "structmember.h"typedef struct {    PyObject_HEAD} NoddyObject;void Noddy_dealloc(NoddyObject* self);PyObject *Noddy_new(PyTypeObject *type, PyObject *args, PyObject *kwds);int Noddy_init(NoddyObject *self, PyObject *args, PyObject *kwds);PyObject *Noddy_testNoddy(NoddyObject *self, PyObject *args, PyObject *kwds);static PyMethodDef Noddy_methods[] = {    {"testNoddy", (PyCFunction)Noddy_testNoddy, METH_VARARGS,     "Return the name, combining the first and last name"    },    {NULL}  /* Sentinel */};static PyMemberDef Noddy_members[] = {    {NULL}  /* Sentinel */};static PyTypeObject NoddyType = {    PyObject_HEAD_INIT(NULL)    0,                         /*ob_size*/    "noddy.Noddy",             /*tp_name*/    sizeof(NoddyObject),       /*tp_basicsize*/    0,                         /*tp_itemsize*/    (destructor)Noddy_dealloc, /*tp_dealloc*/    0,                         /*tp_print*/    0,                         /*tp_getattr*/    0,                         /*tp_setattr*/    0,                         /*tp_compare*/    0,                         /*tp_repr*/    0,                         /*tp_as_number*/    0,                         /*tp_as_sequence*/    0,                         /*tp_as_mapping*/    0,                         /*tp_hash */    0,                         /*tp_call*/    0,                         /*tp_str*/    0,                         /*tp_getattro*/    0,                         /*tp_setattro*/    0,                         /*tp_as_buffer*/    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/    "Noddy objects",           /* tp_doc */    0,		               /* tp_traverse */    0,		               /* tp_clear */    0,		               /* tp_richcompare */    0,		               /* tp_weaklistoffset */    0,		               /* tp_iter */    0,		               /* tp_iternext */    Noddy_methods,             /* tp_methods */    Noddy_members,             /* tp_members */    0,                         /* tp_getset */    0,                         /* tp_base */    0,                         /* tp_dict */    0,                         /* tp_descr_get */    0,                         /* tp_descr_set */    0,                         /* tp_dictoffset */    (initproc)Noddy_init,      /* tp_init */    0,                         /* tp_alloc */    Noddy_new,                 /* tp_new */};typedef struct {    PyObject_HEAD} OtherObject;void Other_dealloc(OtherObject* self);PyObject *Other_new(PyTypeObject *type, PyObject *args, PyObject *kwds);int Other_init(OtherObject *self, PyObject *args, PyObject *kwds);static PyMethodDef Other_methods[] = {    {NULL}  /* Sentinel */};static PyMemberDef Other_members[] = {    {NULL}  /* Sentinel */};static PyTypeObject OtherType = {    PyObject_HEAD_INIT(NULL)    0,                         /*ob_size*/    "other.Other",             /*tp_name*/    sizeof(OtherObject),       /*tp_basicsize*/    0,                         /*tp_itemsize*/    (destructor)Other_dealloc, /*tp_dealloc*/    0,                         /*tp_print*/    0,                         /*tp_getattr*/    0,                         /*tp_setattr*/    0,                         /*tp_compare*/    0,                         /*tp_repr*/    0,                         /*tp_as_number*/    0,                         /*tp_as_sequence*/    0,                         /*tp_as_mapping*/    0,                         /*tp_hash */    0,                         /*tp_call*/    0,                         /*tp_str*/    0,                         /*tp_getattro*/    0,                         /*tp_setattro*/    0,                         /*tp_as_buffer*/    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/    "Other objects",           /* tp_doc */    0,		               /* tp_traverse */    0,		               /* tp_clear */    0,		               /* tp_richcompare */    0,		               /* tp_weaklistoffset */    0,		               /* tp_iter */    0,		               /* tp_iternext */    Other_methods,             /* tp_methods */    Other_members,             /* tp_members */    0,                         /* tp_getset */    0,                         /* tp_base */    0,                         /* tp_dict */    0,                         /* tp_descr_get */    0,                         /* tp_descr_set */    0,                         /* tp_dictoffset */    (initproc)Other_init,      /* tp_init */    0,                         /* tp_alloc */    Other_new,                 /* tp_new */};static PyMethodDef module_methods[] = {    {NULL}  /* Sentinel */};