Remove rpmal from the Python API
[platform/upstream/rpm.git] / python / rpmdebug-py.c
1
2 extern PyTypeObject PyCode_Type;
3 extern PyTypeObject PyDictIter_Type;
4 extern PyTypeObject PyFrame_Type;
5
6 #include "header-py.h"  /* XXX debug only */
7 #include "rpmds-py.h"   /* XXX debug only */
8 #include "rpmfd-py.h"   /* XXX debug only */
9 #include "rpmfi-py.h"   /* XXX debug only */
10 #include "rpmmi-py.h"   /* XXX debug only */
11 #include "rpmps-py.h"   /* XXX debug only */
12 #include "rpmmacro-py.h"        /* XXX debug only */
13 #include "rpmte-py.h"   /* XXX debug only */
14 #include "rpmts-py.h"   /* XXX debug only */
15
16 /**
17  */
18 static const char * lbl(void * s)
19 {
20     PyObject * o = s;
21
22     if (o == NULL)      return "null";
23
24     if (o == Py_None)   return "None";
25
26
27     if (o->ob_type == &PyType_Type)     return o->ob_type->tp_name;
28
29     if (o->ob_type == &PyBaseObject_Type)       return "BaseObj";
30     if (o->ob_type == &PyBuffer_Type)   return "Buffer";
31     if (o->ob_type == &PyCFunction_Type)        return "CFunction";
32     if (o->ob_type == &PyCObject_Type)  return "CObject";
33     if (o->ob_type == &PyCell_Type)     return "Cell";
34     if (o->ob_type == &PyClass_Type)    return "Class";
35     if (o->ob_type == &PyClassMethod_Type)      return "ClassMethod";
36     if (o->ob_type == &PyStaticMethod_Type)     return "StaticMethod";
37     if (o->ob_type == &PyCode_Type)     return "Code";
38     if (o->ob_type == &PyComplex_Type)  return "Complex";
39     if (o->ob_type == &PyDict_Type)     return "Dict";
40 #if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 4
41     if (o->ob_type == &PyDictIter_Type) return "DictIter";
42 #endif
43     if (o->ob_type == &PyFile_Type)     return "File";
44     if (o->ob_type == &PyFloat_Type)    return "Float";
45     if (o->ob_type == &PyFrame_Type)    return "Frame";
46     if (o->ob_type == &PyFunction_Type) return "Function";
47     if (o->ob_type == &PyInstance_Type) return "Instance";
48     if (o->ob_type == &PyInt_Type)      return "Int";
49     if (o->ob_type == &PyList_Type)     return "List";
50     if (o->ob_type == &PyLong_Type)     return "Long";
51     if (o->ob_type == &PyMethod_Type)   return "Method";
52     if (o->ob_type == &PyWrapperDescr_Type)     return "WrapperDescr";
53     if (o->ob_type == &PyProperty_Type) return "Property";
54     if (o->ob_type == &PyModule_Type)   return "Module";
55     if (o->ob_type == &PyRange_Type)    return "Range";
56     if (o->ob_type == &PySeqIter_Type)  return "SeqIter";
57     if (o->ob_type == &PyCallIter_Type) return "CallIter";
58     if (o->ob_type == &PySlice_Type)    return "Slice";
59     if (o->ob_type == &PyString_Type)   return "String";
60     if (o->ob_type == &PySuper_Type)    return "Super";
61     if (o->ob_type == &PyTuple_Type)    return "Tuple";
62     if (o->ob_type == &PyType_Type)     return "Type";
63     if (o->ob_type == &PyUnicode_Type)  return "Unicode";
64
65     if (o->ob_type == &hdr_Type)        return "hdr";
66     if (o->ob_type == &rpmds_Type)      return "rpmds";
67     if (o->ob_type == &rpmfd_Type)      return "rpmfd";
68     if (o->ob_type == &rpmfi_Type)      return "rpmfi";
69     if (o->ob_type == &rpmfts_Type)     return "rpmfts";
70     if (o->ob_type == &rpmmi_Type)      return "rpmmi";
71     if (o->ob_type == &rpmps_Type)      return "rpmps";
72     if (o->ob_type == &rpmte_Type)      return "rpmte";
73     if (o->ob_type == &rpmts_Type)      return "rpmts";
74
75     return "Unknown";
76 }