• Home
  • Raw
  • Download

Lines Matching refs:module_state

40     _csvstate *module_state = PyModule_GetState(module);  in _csv_clear()  local
41 Py_CLEAR(module_state->error_obj); in _csv_clear()
42 Py_CLEAR(module_state->dialects); in _csv_clear()
43 Py_CLEAR(module_state->dialect_type); in _csv_clear()
44 Py_CLEAR(module_state->reader_type); in _csv_clear()
45 Py_CLEAR(module_state->writer_type); in _csv_clear()
52 _csvstate *module_state = PyModule_GetState(module); in _csv_traverse() local
53 Py_VISIT(module_state->error_obj); in _csv_traverse()
54 Py_VISIT(module_state->dialects); in _csv_traverse()
55 Py_VISIT(module_state->dialect_type); in _csv_traverse()
56 Py_VISIT(module_state->reader_type); in _csv_traverse()
57 Py_VISIT(module_state->writer_type); in _csv_traverse()
140 get_dialect_from_registry(PyObject *name_obj, _csvstate *module_state) in get_dialect_from_registry() argument
144 dialect_obj = PyDict_GetItemWithError(module_state->dialects, name_obj); in get_dialect_from_registry()
147 PyErr_Format(module_state->error_obj, "unknown dialect"); in get_dialect_from_registry()
381 _csvstate *module_state = PyModule_GetState(module); in _csv_state_from_type() local
382 if (module_state == NULL) { in _csv_state_from_type()
387 return module_state; in _csv_state_from_type()
418 _csvstate *module_state = _csv_state_from_type(type, "dialect_new"); in dialect_new() local
419 if (module_state == NULL) { in dialect_new()
425 dialect = get_dialect_from_registry(dialect, module_state); in dialect_new()
432 if (PyObject_TypeCheck(dialect, module_state->dialect_type) && in dialect_new()
591 _call_dialect(_csvstate *module_state, PyObject *dialect_inst, PyObject *kwargs) in _call_dialect() argument
593 PyObject *type = (PyObject *)module_state->dialect_type; in _call_dialect()
651 parse_add_char(ReaderObj *self, _csvstate *module_state, Py_UCS4 c) in parse_add_char() argument
653 if (self->field_len >= module_state->field_limit) { in parse_add_char()
654 PyErr_Format(module_state->error_obj, in parse_add_char()
656 module_state->field_limit); in parse_add_char()
666 parse_process_char(ReaderObj *self, _csvstate *module_state, Py_UCS4 c) in parse_process_char() argument
712 if (parse_add_char(self, module_state, c) < 0) in parse_process_char()
720 if (parse_add_char(self, module_state, c) < 0) in parse_process_char()
727 if (parse_add_char(self, module_state, c) < 0) in parse_process_char()
757 if (parse_add_char(self, module_state, c) < 0) in parse_process_char()
783 if (parse_add_char(self, module_state, c) < 0) in parse_process_char()
791 if (parse_add_char(self, module_state, c) < 0) in parse_process_char()
801 if (parse_add_char(self, module_state, c) < 0) in parse_process_char()
818 if (parse_add_char(self, module_state, c) < 0) in parse_process_char()
824 PyErr_Format(module_state->error_obj, "'%c' expected after '%c'", in parse_process_char()
837 PyErr_Format(module_state->error_obj, in parse_process_char()
869 _csvstate *module_state = _csv_state_from_type(Py_TYPE(self), in Reader_iternext() local
871 if (module_state == NULL) { in Reader_iternext()
884 PyErr_SetString(module_state->error_obj, in Reader_iternext()
892 PyErr_Format(module_state->error_obj, in Reader_iternext()
914 PyErr_Format(module_state->error_obj, in Reader_iternext()
918 if (parse_process_char(self, module_state, c) < 0) { in Reader_iternext()
925 if (parse_process_char(self, module_state, 0) < 0) in Reader_iternext()
1012 _csvstate *module_state = get_csv_state(module); in csv_reader() local
1015 module_state->reader_type); in csv_reader()
1041 self->dialect = (DialectObj *)_call_dialect(module_state, dialect, in csv_reader()
1437 _csvstate *module_state = get_csv_state(module); in csv_writer() local
1438 WriterObj * self = PyObject_GC_New(WriterObj, module_state->writer_type); in csv_writer()
1452 self->error_obj = Py_NewRef(module_state->error_obj); in csv_writer()
1468 self->dialect = (DialectObj *)_call_dialect(module_state, dialect, in csv_writer()
1491 _csvstate *module_state = get_csv_state(module); in csv_register_dialect() local
1503 dialect = _call_dialect(module_state, dialect_obj, kwargs); in csv_register_dialect()
1506 if (PyDict_SetItem(module_state->dialects, name_obj, dialect) < 0) { in csv_register_dialect()
1517 _csvstate *module_state = get_csv_state(module); in csv_unregister_dialect() local
1518 if (PyDict_DelItem(module_state->dialects, name_obj) < 0) { in csv_unregister_dialect()
1520 PyErr_Format(module_state->error_obj, "unknown dialect"); in csv_unregister_dialect()
1537 _csvstate *module_state = get_csv_state(module); in csv_field_size_limit() local
1538 long old_limit = module_state->field_limit; in csv_field_size_limit()
1548 module_state->field_limit = PyLong_AsLong(new_limit); in csv_field_size_limit()
1549 if (module_state->field_limit == -1 && PyErr_Occurred()) { in csv_field_size_limit()
1550 module_state->field_limit = old_limit; in csv_field_size_limit()
1703 _csvstate *module_state = get_csv_state(module); in csv_exec() local
1706 module_state->dialect_type = (PyTypeObject *)temp; in csv_exec()
1712 module_state->reader_type = (PyTypeObject *)temp; in csv_exec()
1718 module_state->writer_type = (PyTypeObject *)temp; in csv_exec()
1730 module_state->field_limit = 128 * 1024; in csv_exec()
1733 module_state->dialects = PyDict_New(); in csv_exec()
1734 if (PyModule_AddObjectRef(module, "_dialects", module_state->dialects) < 0) { in csv_exec()
1750 module_state->error_obj = PyType_FromModuleAndSpec(module, &error_spec, in csv_exec()
1753 if (module_state->error_obj == NULL) { in csv_exec()
1756 if (PyModule_AddType(module, (PyTypeObject *)module_state->error_obj) != 0) { in csv_exec()