Lines Matching refs:Output
13 Output("OSErr _err = ResError();")
14 Output("if (_err != noErr) return PyMac_Error(_err);")
140 Output("if (itself == NULL) return PyMac_Error(resNotFound);")
144 Output("if (!%s_Check(v))", self.prefix)
146 Output("PyObject *tmp;")
147 Output('if ( (tmp=PyObject_CallMethod(v, "as_Resource", "")) )')
149 Output("*p_itself = ((ResourceObject *)tmp)->ob_itself;")
150 Output("Py_DECREF(tmp);")
151 Output("return 1;")
153 Output("PyErr_Clear();")
158 Output("void (*ob_freeit)(%s ptr);", self.itselftype)
162 Output("it->ob_freeit = NULL;")
165 Output("if (self->ob_freeit && self->ob_itself)")
167 Output("self->ob_freeit(self->ob_itself);")
169 Output("self->ob_itself = NULL;")
172 Output("PyObject *self;")
173 Output
174 Output("if ((self = type->tp_alloc(type, 0)) == NULL) return NULL;")
175 Output("((%s *)self)->ob_itself = NULL;", self.objecttype)
176 Output("((%s *)self)->ob_freeit = NULL;", self.objecttype)
177 Output("return self;")
180 Output("char *srcdata = NULL;")
181 Output("int srclen = 0;")
182 Output("%s itself;", self.itselftype);
183 Output("char *kw[] = {\"itself\", 0};")
184 Output()
185 Output("if (PyArg_ParseTupleAndKeywords(_args, _kwds, \"O&\", kw, %s_Convert, &itself))",
188 Output("((%s *)_self)->ob_itself = itself;", self.objecttype)
189 Output("return 0;")
191 Output("PyErr_Clear();")
192 Output("if (!PyArg_ParseTupleAndKeywords(_args, _kwds, \"|s#\", kw, &srcdata, &srclen)) return -1;")
193 Output("if ((itself = NewHandle(srclen)) == NULL)")
195 Output("PyErr_NoMemory();")
196 Output("return 0;")
198 Output("((%s *)_self)->ob_itself = itself;", self.objecttype)
199 # XXXX Output("((%s *)self)->ob_freeit = PyMac_AutoDisposeHandle;")
200 Output("if (srclen && srcdata)")
202 Output("HLock(itself);")
203 Output("memcpy(*itself, srcdata, srclen);")
204 Output("HUnlock(itself);")
206 Output("return 0;")