File: rpmsystem-py.h

package info (click to toggle)
rpm 6.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,580 kB
  • sloc: cpp: 53,319; ansic: 13,888; sh: 2,038; python: 1,175; makefile: 35; xml: 26
file content (54 lines) | stat: -rw-r--r-- 1,423 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef H_SYSTEM_PYTHON
#define	H_SYSTEM_PYTHON

#if defined(__APPLE__)
#include <sys/types.h>
#endif

#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <structmember.h>

typedef struct {
    PyTypeObject* hdr_Type;
    PyTypeObject* rpmarchive_Type;
    PyTypeObject* rpmds_Type;
    PyTypeObject* rpmfd_Type;
    PyTypeObject* rpmfile_Type;
    PyTypeObject* rpmfiles_Type;
    PyTypeObject* rpmii_Type;
    PyTypeObject* rpmKeyring_Type;
    PyTypeObject* rpmPubkey_Type;
    PyTypeObject* rpmmi_Type;
    PyTypeObject* rpmProblem_Type;
    PyTypeObject* rpmstrPool_Type;
    PyTypeObject* rpmte_Type;
    PyTypeObject* rpmts_Type;
    PyTypeObject* rpmver_Type;
    PyTypeObject* spec_Type;
    PyTypeObject* specPkg_Type;

    PyObject* pyrpmError;
} rpmmodule_state_t;

rpmmodule_state_t *rpmModState_FromObject(PyObject*);
rpmmodule_state_t *rpmModState_FromModule(PyObject*);
rpmmodule_state_t *rpmModState_FromType(PyTypeObject*);

/* Replacement for Py_Version from Python 3.11+
 * version of the Python runtime, packed into an int.
 * For simplicity this only contains "x.y.z", the final byte is 0.
 */
extern unsigned long python_version;

PyObject * utf8FromString(const char *s);

#ifndef Py_TPFLAGS_IMMUTABLETYPE
/*
 * Flag was added in Python 3.10.
 * If the current Python doesn't have it, rpm's type objects will be mutable.
 */
#define Py_TPFLAGS_IMMUTABLETYPE 0
#endif

#endif	/* H_SYSTEM_PYTHON */