1/*
2 * Implementation for objc.NULL
3 */
4#include "pyobjc.h"
5
6PyObject* PyObjC_NULL = NULL;
7
8static PyObject*
9obj_repr(PyObject* self __attribute__((__unused__)))
10{
11	return PyText_FromString("objc.NULL");
12}
13
14PyTypeObject PyObjC_NULL_Type = {
15	PyVarObject_HEAD_INIT(&PyType_Type, 0)
16	"objc.NULL_type",			/* tp_name */
17	sizeof(PyObject),			/* tp_basicsize */
18	0,					/* tp_itemsize */
19	/* methods */
20	0,	 				/* tp_dealloc */
21	0,					/* tp_print */
22	0,					/* tp_getattr */
23	0,					/* tp_setattr */
24	0,					/* tp_compare */
25	obj_repr,				/* tp_repr */
26	0,					/* tp_as_number */
27	0,					/* tp_as_sequence */
28	0,		       			/* tp_as_mapping */
29	0,					/* tp_hash */
30	0,					/* tp_call */
31	0,					/* tp_str */
32	0,					/* tp_getattro */
33	0,					/* tp_setattro */
34	0,					/* tp_as_buffer */
35	Py_TPFLAGS_DEFAULT,			/* tp_flags */
36 	0,					/* tp_doc */
37 	0,					/* tp_traverse */
38 	0,					/* tp_clear */
39	0,					/* tp_richcompare */
40	0,					/* tp_weaklistoffset */
41	0,					/* tp_iter */
42	0,					/* tp_iternext */
43	0,					/* tp_methods */
44	0,					/* tp_members */
45	0,					/* tp_getset */
46	0,					/* tp_base */
47	0,					/* tp_dict */
48	0,					/* tp_descr_get */
49	0,					/* tp_descr_set */
50	0,					/* tp_dictoffset */
51	0,					/* tp_init */
52	0,					/* tp_alloc */
53	0,					/* tp_new */
54	0,		        		/* tp_free */
55	0,					/* tp_is_gc */
56	0,					/* tp_bases */
57	0,					/* tp_mro */
58	0,					/* tp_cache */
59	0, 					/* tp_subclasses */
60	0,					/* tp_weaklist */
61	0					/* tp_del */
62#if PY_VERSION_HEX >= 0x02060000
63	, 0                                     /* tp_version_tag */
64#endif
65
66};
67
68PyObject* PyObjCInitNULL(void)
69{
70	PyObject* result;
71
72	result = PyObjC_NULL = PyObject_New(PyObject, &PyObjC_NULL_Type);
73	Py_XINCREF(PyObjC_NULL);
74
75	return result;
76}
77