Lines Matching defs:file

242     PyObject *file, *ret;
247 file = (PyObject *) context;
248 if (file == NULL) return(-1);
249 ret = PyEval_CallMethod(file, (char *) "close", (char *) "()");
253 Py_DECREF(file);
263 * Read @len bytes to @buffer from the Python file in the I/O channel
269 PyObject *file;
277 file = (PyObject *) context;
278 if (file == NULL) return(-1);
279 ret = PyEval_CallMethod(file, (char *) "read", (char *) "(i)", len);
310 PyObject *file;
318 file = (PyObject *) context;
319 if (file == NULL) return(-1);
320 ret = PyEval_CallMethod(file, (char *) "io_read", (char *) "(i)", len);
351 PyObject *file;
359 file = (PyObject *) context;
360 if (file == NULL) return(-1);
363 if (PyObject_HasAttrString(file, (char *) "io_write")) {
364 ret = PyEval_CallMethod(file, (char *) "io_write", (char *) "(O)",
366 } else if (PyObject_HasAttrString(file, (char *) "write")) {
367 ret = PyEval_CallMethod(file, (char *) "write", (char *) "(O)",
395 PyObject *file, *ret = NULL;
400 file = (PyObject *) context;
401 if (file == NULL) return(-1);
402 if (PyObject_HasAttrString(file, (char *) "io_close")) {
403 ret = PyEval_CallMethod(file, (char *) "io_close", (char *) "()");
404 } else if (PyObject_HasAttrString(file, (char *) "flush")) {
405 ret = PyEval_CallMethod(file, (char *) "flush", (char *) "()");
416 * @file: a PyFile_Type
425 xmlOutputBufferCreatePythonFile(PyObject *file,
429 if (file == NULL) return(NULL);
433 ret->context = file;
434 /* Py_INCREF(file); */
445 PyObject *file;
452 &file, &encoding))
457 buffer = xmlOutputBufferCreatePythonFile(file, handler);
476 PyObject *file;
492 "outputBufferGetPythonFile: not a python file wrapper\n");
496 file = (PyObject *) obj->context;
497 if (file == NULL) {
501 Py_INCREF(file);
502 return(file);
593 * @file: a PyFile_Type
602 xmlParserInputBufferCreatePythonFile(PyObject *file,
606 if (file == NULL) return(NULL);
610 ret->context = file;
611 /* Py_INCREF(file); */
622 PyObject *file;
629 &file, &encoding))
634 buffer = xmlParserInputBufferCreatePythonFile(file, enc);
3616 PyErr_SetString(PyExc_TypeError, "bad file.");
3621 PyErr_SetString(PyExc_TypeError, "bad file.");