filedisp.c 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /* Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 */
  2. /* For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt */
  3. #include "util.h"
  4. #include "filedisp.h"
  5. void
  6. CFileDisposition_dealloc(CFileDisposition *self)
  7. {
  8. Py_XDECREF(self->original_filename);
  9. Py_XDECREF(self->canonical_filename);
  10. Py_XDECREF(self->source_filename);
  11. Py_XDECREF(self->trace);
  12. Py_XDECREF(self->reason);
  13. Py_XDECREF(self->file_tracer);
  14. Py_XDECREF(self->has_dynamic_filename);
  15. }
  16. static PyMemberDef
  17. CFileDisposition_members[] = {
  18. { "original_filename", T_OBJECT, offsetof(CFileDisposition, original_filename), 0,
  19. PyDoc_STR("") },
  20. { "canonical_filename", T_OBJECT, offsetof(CFileDisposition, canonical_filename), 0,
  21. PyDoc_STR("") },
  22. { "source_filename", T_OBJECT, offsetof(CFileDisposition, source_filename), 0,
  23. PyDoc_STR("") },
  24. { "trace", T_OBJECT, offsetof(CFileDisposition, trace), 0,
  25. PyDoc_STR("") },
  26. { "reason", T_OBJECT, offsetof(CFileDisposition, reason), 0,
  27. PyDoc_STR("") },
  28. { "file_tracer", T_OBJECT, offsetof(CFileDisposition, file_tracer), 0,
  29. PyDoc_STR("") },
  30. { "has_dynamic_filename", T_OBJECT, offsetof(CFileDisposition, has_dynamic_filename), 0,
  31. PyDoc_STR("") },
  32. { NULL }
  33. };
  34. PyTypeObject
  35. CFileDispositionType = {
  36. MyType_HEAD_INIT
  37. "coverage.CFileDispositionType", /*tp_name*/
  38. sizeof(CFileDisposition), /*tp_basicsize*/
  39. 0, /*tp_itemsize*/
  40. (destructor)CFileDisposition_dealloc, /*tp_dealloc*/
  41. 0, /*tp_print*/
  42. 0, /*tp_getattr*/
  43. 0, /*tp_setattr*/
  44. 0, /*tp_compare*/
  45. 0, /*tp_repr*/
  46. 0, /*tp_as_number*/
  47. 0, /*tp_as_sequence*/
  48. 0, /*tp_as_mapping*/
  49. 0, /*tp_hash */
  50. 0, /*tp_call*/
  51. 0, /*tp_str*/
  52. 0, /*tp_getattro*/
  53. 0, /*tp_setattro*/
  54. 0, /*tp_as_buffer*/
  55. Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
  56. "CFileDisposition objects", /* tp_doc */
  57. 0, /* tp_traverse */
  58. 0, /* tp_clear */
  59. 0, /* tp_richcompare */
  60. 0, /* tp_weaklistoffset */
  61. 0, /* tp_iter */
  62. 0, /* tp_iternext */
  63. 0, /* tp_methods */
  64. CFileDisposition_members, /* tp_members */
  65. 0, /* tp_getset */
  66. 0, /* tp_base */
  67. 0, /* tp_dict */
  68. 0, /* tp_descr_get */
  69. 0, /* tp_descr_set */
  70. 0, /* tp_dictoffset */
  71. 0, /* tp_init */
  72. 0, /* tp_alloc */
  73. 0, /* tp_new */
  74. };