summaryrefslogtreecommitdiffstats
path: root/glib/pygspawn.c
diff options
context:
space:
mode:
authorJohan Dahlin <johan@gnome.org>2008-07-26 13:46:56 +0000
committerJohan Dahlin <johan@src.gnome.org>2008-07-26 13:46:56 +0000
commit4cd2081ae3d8adacd4256742be9e90714783c242 (patch)
treec5e4fe6b3ca14cd5c994418a8f18a1d00116cfaf /glib/pygspawn.c
parentec4671da7f7fe70f40dafb91a870fa644c2b9f2c (diff)
downloadpygobject-4cd2081ae3d8adacd4256742be9e90714783c242.tar.gz
pygobject-4cd2081ae3d8adacd4256742be9e90714783c242.tar.xz
pygobject-4cd2081ae3d8adacd4256742be9e90714783c242.zip
Convert the pid/mainloop/maincontext/optiongroup/optioncontext.
2008-07-26 Johan Dahlin <johan@gnome.org> * glib/pygmaincontext.c (pyglib_maincontext_register_types): * glib/pygmainloop.c (pyg_main_loop_init), (pyglib_mainloop_register_types): * glib/pygoptioncontext.c (pyg_option_context_set_main_group), (pyglib_option_context_register_types): * glib/pygoptiongroup.c (pyglib_option_group_register_types): * glib/pygspawn.c (pyglib_spawn_register_types): Convert the pid/mainloop/maincontext/optiongroup/optioncontext. svn path=/trunk/; revision=872
Diffstat (limited to 'glib/pygspawn.c')
-rw-r--r--glib/pygspawn.c50
1 files changed, 6 insertions, 44 deletions
diff --git a/glib/pygspawn.c b/glib/pygspawn.c
index 515cdd9..7bb76b5 100644
--- a/glib/pygspawn.c
+++ b/glib/pygspawn.c
@@ -32,6 +32,8 @@ struct _PyGChildSetupData {
PyObject *data;
};
+PYGLIB_DEFINE_TYPE("glib.Pid", PyGPid_Type, PyIntObject)
+
static PyObject *
pyg_pid_close(PyIntObject *self, PyObject *args, PyObject *kwargs)
{
@@ -59,50 +61,6 @@ pyg_pid_tp_init(PyObject *self, PyObject *args, PyObject *kwargs)
return -1;
}
-static PyTypeObject PyGPid_Type = {
- PyObject_HEAD_INIT(NULL)
- 0,
- "glib.Pid",
- sizeof(PyIntObject),
- 0,
- 0, /* 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, /* tp_flags */
- 0, /* tp_doc */
- 0, /* tp_traverse */
- 0, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- pyg_pid_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- 0, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- pyg_pid_tp_init, /* tp_init */
- 0, /* tp_alloc */
- 0, /* tp_new */
- (freefunc)pyg_pid_free, /* tp_free */
- 0, /* tp_is_gc */
-};
-
PyObject *
pyg_pid_new(GPid pid)
{
@@ -293,5 +251,9 @@ void
pyglib_spawn_register_types(PyObject *d)
{
PyGPid_Type.tp_base = &PyInt_Type;
+ PyGPid_Type.tp_flags = Py_TPFLAGS_DEFAULT;
+ PyGPid_Type.tp_methods = pyg_pid_methods;
+ PyGPid_Type.tp_init = pyg_pid_tp_init;
+ PyGPid_Type.tp_free = (freefunc)pyg_pid_free;
PYGLIB_REGISTER_TYPE(d, PyGPid_Type, "Pid");
}