Home | History | Annotate | Download | only in cf

Lines Matching refs:Output

255         Output('if (itself == NULL)')
257 Output('PyErr_SetString(PyExc_RuntimeError, "cannot wrap NULL");')
258 Output('return NULL;')
262 Output("void (*ob_freeit)(CFTypeRef ptr);")
265 ## Output("it->ob_freeit = NULL;")
266 Output("it->ob_freeit = CFRelease;")
273 Output("if (self->ob_freeit && self->ob_itself)")
275 Output("self->ob_freeit((CFTypeRef)self->ob_itself);")
276 Output("self->ob_itself = NULL;")
280 Output()
281 Output("static int %s_compare(%s *self, %s *other)", self.prefix, self.objecttype, self.objecttype)
283 Output("/* XXXX Or should we use CFEqual?? */")
284 Output("if ( self->ob_itself > other->ob_itself ) return 1;")
285 Output("if ( self->ob_itself < other->ob_itself ) return -1;")
286 Output("return 0;")
290 Output()
291 Output("static int %s_hash(%s *self)", self.prefix, self.objecttype)
293 Output("/* XXXX Or should we use CFHash?? */")
294 Output("return (int)self->ob_itself;")
298 Output()
299 Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype)
301 Output("char buf[100];")
302 Output("""sprintf(buf, "<CFTypeRef type-%%d object at 0x%%8.8x for 0x%%8.8x>", (int)CFGetTypeID(self->ob_itself), (unsigned)self, (unsigned)self->ob_itself);""")
303 Output("return PyString_FromString(buf);")
307 Output("PyObject *self;")
308 Output
309 Output("if ((self = type->tp_alloc(type, 0)) == NULL) return NULL;")
310 Output("((%s *)self)->ob_itself = NULL;", self.objecttype)
311 Output("((%s *)self)->ob_freeit = CFRelease;", self.objecttype)
312 Output("return self;")
315 Output("%s itself;", self.itselftype)
316 Output("char *kw[] = {\"itself\", 0};")
317 Output()
318 Output("if (PyArg_ParseTupleAndKeywords(_args, _kwds, \"O&\", kw, %s_Convert, &itself))",
321 Output("((%s *)_self)->ob_itself = itself;", self.objecttype)
322 Output("return 0;")
325 Output()
326 Output("/* Any CFTypeRef descendent is allowed as initializer too */")
327 Output("if (PyArg_ParseTupleAndKeywords(_args, _kwds, \"O&\", kw, CFTypeRefObj_Convert, &itself))")
329 Output("((%s *)_self)->ob_itself = itself;", self.objecttype)
330 Output("return 0;")
332 Output("return -1;")
341 Output()
342 Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype)
344 Output("char buf[100];")
345 Output("""sprintf(buf, "<CFArrayRef object at 0x%%8.8x for 0x%%8.8x>", (unsigned)self, (unsigned)self->ob_itself);""")
346 Output("return PyString_FromString(buf);")
353 Output()
354 Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype)
356 Output("char buf[100];")
357 Output("""sprintf(buf, "<CFMutableArrayRef object at 0x%%8.8x for 0x%%8.8x>", (unsigned)self, (unsigned)self->ob_itself);""")
358 Output("return PyString_FromString(buf);")
365 Output()
366 Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype)
368 Output("char buf[100];")
369 Output("""sprintf(buf, "<CFDictionaryRef object at 0x%%8.8x for 0x%%8.8x>", (unsigned)self, (unsigned)self->ob_itself);""")
370 Output("return PyString_FromString(buf);")
377 Output()
378 Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype)
380 Output("char buf[100];")
381 Output("""sprintf(buf, "<CFMutableDictionaryRef object at 0x%%8.8x for 0x%%8.8x>", (unsigned)self, (unsigned)self->ob_itself);""")
382 Output("return PyString_FromString(buf);")
401 Output()
402 Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype)
404 Output("char buf[100];")
405 Output("""sprintf(buf, "<CFDataRef object at 0x%%8.8x for 0x%%8.8x>", (unsigned)self, (unsigned)self->ob_itself);""")
406 Output("return PyString_FromString(buf);")
413 Output()
414 Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype)
416 Output("char buf[100];")
417 Output("""sprintf(buf, "<CFMutableDataRef object at 0x%%8.8x for 0x%%8.8x>", (unsigned)self, (unsigned)self->ob_itself);""")
418 Output("return PyString_FromString(buf);")
447 Output()
448 Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype)
450 Output("char buf[100];")
451 Output("""sprintf(buf, "<CFStringRef object at 0x%%8.8x for 0x%%8.8x>", (unsigned)self, (unsigned)self->ob_itself);""")
452 Output("return PyString_FromString(buf);")
463 Output()
464 Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype)
466 Output("char buf[100];")
467 Output("""sprintf(buf, "<CFMutableStringRef object at 0x%%8.8x for 0x%%8.8x>", (unsigned)self, (unsigned)self->ob_itself);""")
468 Output("return PyString_FromString(buf);")
475 Output()
476 Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype)
478 Output("char buf[100];")
479 Output("""sprintf(buf, "<CFURL object at 0x%%8.8x for 0x%%8.8x>", (unsigned)self, (unsigned)self->ob_itself);""")
480 Output("return PyString_FromString(buf);")
664 # generate output (open the output file as late as possible)