Home | History | Annotate | Download | only in file

Lines Matching refs:Output

58         Output("%s %s__buf__;", self.typeName, name)
59 Output("%s *%s = &%s__buf__;", self.typeName, name, name)
67 Output("PyObject *%s__object = NULL;", name)
68 Output("FSCatalogInfoBitmap %s__bitmap = 0;", name)
69 Output("FSCatalogInfo %s;", name)
78 Output("if (!convert_FSCatalogInfo(%s__object, %s__bitmap, &%s)) return NULL;", name, name, name)
93 Output("if ((%s__object = new_FSCatalogInfo(%s__bitmap, &%s)) == NULL) return NULL;", name, name)
499 Output("if (itself == NULL) { Py_INCREF(Py_None); return Py_None; }")
502 Output("PyObject *self;");
503 Output()
504 Output("if ((self = type->tp_alloc(type, 0)) == NULL) return NULL;")
505 Output("memset(&((%s *)self)->ob_itself, 0, sizeof(%s));",
507 Output("return self;")
510 Output("static char *kw[] = {%s, 0};", self.INITNAMES)
511 Output()
512 Output("if (!PyArg_ParseTupleAndKeywords(_args, _kwds, \"|%s\", kw, %s))",
515 Output("return -1;")
517 Output("return 0;")
554 Output("if (itself == NULL) return PyMac_Error(resNotFound);")
557 Output("PyObject *self;");
558 Output()
559 Output("if ((self = type->tp_alloc(type, 0)) == NULL) return NULL;")
560 Output("memset(&((%s *)self)->ob_itself, 0, sizeof(%s));",
562 Output("return self;")
565 Output("%s *itself = NULL;", self.itselftype)
566 Output("static char *kw[] = {\"itself\", 0};")
567 Output()
568 Output("if (PyArg_ParseTupleAndKeywords(_args, _kwds, \"|O&\", kw, FInfo_Convert, &itself))")
570 Output("if (itself) memcpy(&((%s *)_self)->ob_itself, itself, sizeof(%s));",
572 Output("return 0;")
574 Output("return -1;")
590 Output("if (itself == NULL) return PyMac_Error(resNotFound);")
597 Output("PyObject *self;");
598 Output()
599 Output("if ((self = type->tp_alloc(type, 0)) == NULL) return NULL;")
600 Output("memset(&((%s *)self)->ob_itself, 0, sizeof(%s));",
602 Output("return self;")
605 Output("PyObject *v = NULL;")
606 Output("char *rawdata = NULL;")
607 Output("int rawdatalen = 0;")
608 Output("static char *kw[] = {\"itself\", \"rawdata\", 0};")
609 Output()
610 Output("if (!PyArg_ParseTupleAndKeywords(_args, _kwds, \"|Os#\", kw, &v, &rawdata, &rawdatalen))")
611 Output("return -1;")
612 Output("if (v && rawdata)")
614 Output("PyErr_SetString(PyExc_TypeError, \"Only one of itself or rawdata may be specified\");")
615 Output("return -1;")
617 Output("if (!v && !rawdata)")
619 Output("PyErr_SetString(PyExc_TypeError, \"One of itself or rawdata must be specified\");")
620 Output("return -1;")
622 Output("if (rawdata)")
624 Output("if (rawdatalen != sizeof(%s))", self.itselftype)
626 Output("PyErr_SetString(PyExc_TypeError, \"%s rawdata incorrect size\");",
628 Output("return -1;")
630 Output("memcpy(&((%s *)_self)->ob_itself, rawdata, rawdatalen);", self.objecttype)
631 Output("return 0;")
633 Output("if (PyMac_GetFSSpec(v, &((%s *)_self)->ob_itself)) return 0;", self.objecttype)
634 Output("return -1;")
637 Output()
638 Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype)
640 Output("char buf[512];")
641 Output("""PyOS_snprintf(buf, sizeof(buf), \"%%s((%%d, %%ld, '%%.*s'))\",
646 Output("return PyString_FromString(buf);")
663 Output("if (itself == NULL) return PyMac_Error(resNotFound);")
670 Output("PyObject *self;");
671 Output()
672 Output("if ((self = type->tp_alloc(type, 0)) == NULL) return NULL;")
673 Output("memset(&((%s *)self)->ob_itself, 0, sizeof(%s));",
675 Output("return self;")
678 Output("PyObject *v = NULL;")
679 Output("char *rawdata = NULL;")
680 Output("int rawdatalen = 0;")
681 Output("static char *kw[] = {\"itself\", \"rawdata\", 0};")
682 Output()
683 Output("if (!PyArg_ParseTupleAndKeywords(_args, _kwds, \"|Os#\", kw, &v, &rawdata, &rawdatalen))")
684 Output("return -1;")
685 Output("if (v && rawdata)")
687 Output("PyErr_SetString(PyExc_TypeError, \"Only one of itself or rawdata may be specified\");")
688 Output("return -1;")
690 Output("if (!v && !rawdata)")
692 Output("PyErr_SetString(PyExc_TypeError, \"One of itself or rawdata must be specified\");")
693 Output("return -1;")
695 Output("if (rawdata)")
697 Output("if (rawdatalen != sizeof(%s))", self.itselftype)
699 Output("PyErr_SetString(PyExc_TypeError, \"%s rawdata incorrect size\");",
701 Output("return -1;")
703 Output("memcpy(&((%s *)_self)->ob_itself, rawdata, rawdatalen);", self.objecttype)
704 Output("return 0;")
706 Output("if (PyMac_GetFSRef(v, &((%s *)_self)->ob_itself)) return 0;", self.objecttype)
707 Output("return -1;")
728 Output("if (itself == NULL) return PyMac_Error(resNotFound);")
732 Output("void (*ob_freeit)(%s ptr);", self.itselftype)
736 Output("it->ob_freeit = NULL;")
739 Output("if (self->ob_freeit && self->ob_itself)")
741 Output("self->ob_freeit(self->ob_itself);")
743 Output("self->ob_itself = NULL;")
746 Output("PyObject *self;");
747 Output()
748 Output("if ((self = type->tp_alloc(type, 0)) == NULL) return NULL;")
749 Output("((%s *)self)->ob_itself = NULL;", self.objecttype)
750 Output("return self;")
753 Output("%s itself = NULL;", self.itselftype)
754 Output("char *rawdata = NULL;")
755 Output("int rawdatalen = 0;")
756 Output("Handle h;")
757 Output("static char *kw[] = {\"itself\", \"rawdata\", 0};")
758 Output()
759 Output("if (!PyArg_ParseTupleAndKeywords(_args, _kwds, \"|O&s#\", kw, %s_Convert, &itself, &rawdata, &rawdatalen))",
761 Output("return -1;")
762 Output("if (itself && rawdata)")
764 Output("PyErr_SetString(PyExc_TypeError, \"Only one of itself or rawdata may be specified\");")
765 Output("return -1;")
767 Output("if (!itself && !rawdata)")
769 Output("PyErr_SetString(PyExc_TypeError, \"One of itself or rawdata must be specified\");")
770 Output("return -1;")
772 Output("if (rawdata)")
774 Output("if ((h = NewHandle(rawdatalen)) == NULL)")
776 Output("PyErr_NoMemory();")
777 Output("return -1;")
779 Output("HLock(h);")
780 Output("memcpy((char *)*h, rawdata, rawdatalen);")
781 Output("HUnlock(h);")
782 Output("((%s *)_self)->ob_itself = (%s)h;", self.objecttype, self.itselftype)
783 Output("return 0;")
785 Output("((%s *)_self)->ob_itself = itself;", self.objecttype)
786 Output("return 0;")
916 # generate output (open the output file as late as possible)