diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2009-09-23 00:06:13 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2009-09-23 00:06:13 +0300 |
commit | 2a8da8606fc169aa9929e9a1550c8e29c466880b (patch) | |
tree | e29d23bc8f08f5f5232f319649e7df2d58ac72d8 /python | |
parent | 39d79f91420ba7d9527e04d00b4b0dc2d6cad9ff (diff) | |
download | librpm-tizen-2a8da8606fc169aa9929e9a1550c8e29c466880b.tar.gz librpm-tizen-2a8da8606fc169aa9929e9a1550c8e29c466880b.tar.bz2 librpm-tizen-2a8da8606fc169aa9929e9a1550c8e29c466880b.zip |
Add type checking macros for all rpm python type objects
Diffstat (limited to 'python')
-rw-r--r-- | python/header-py.h | 2 | ||||
-rw-r--r-- | python/rpmds-py.h | 2 | ||||
-rw-r--r-- | python/rpmfi-py.h | 2 | ||||
-rw-r--r-- | python/rpmmi-py.h | 2 | ||||
-rw-r--r-- | python/rpmps-py.h | 2 | ||||
-rw-r--r-- | python/rpmte-py.h | 2 | ||||
-rw-r--r-- | python/rpmts-py.h | 2 | ||||
-rw-r--r-- | python/spec-py.h | 2 |
8 files changed, 16 insertions, 0 deletions
diff --git a/python/header-py.h b/python/header-py.h index 2eb6229c8..51f176b33 100644 --- a/python/header-py.h +++ b/python/header-py.h @@ -7,6 +7,8 @@ typedef struct hdrObject_s hdrObject; extern PyTypeObject hdr_Type; +#define hdrObject_Check(v) ((v)->ob_type == &hdr_Type) + extern PyObject * pyrpmError; PyObject * hdr_Wrap(Header h); diff --git a/python/rpmds-py.h b/python/rpmds-py.h index 8fb83750b..a00eb7db1 100644 --- a/python/rpmds-py.h +++ b/python/rpmds-py.h @@ -7,6 +7,8 @@ typedef struct rpmdsObject_s rpmdsObject; extern PyTypeObject rpmds_Type; +#define rpmdsObject_Check(v) ((v)->ob_type == &rpmds_Type) + rpmds dsFromDs(rpmdsObject * ds); PyObject * rpmds_Wrap(rpmds ds); diff --git a/python/rpmfi-py.h b/python/rpmfi-py.h index 6147d6d76..faa292bfd 100644 --- a/python/rpmfi-py.h +++ b/python/rpmfi-py.h @@ -7,6 +7,8 @@ typedef struct rpmfiObject_s rpmfiObject; extern PyTypeObject rpmfi_Type; +#define rpmfiObject_Check(v) ((v)->ob_type == &rpmfi_Type) + rpmfi fiFromFi(rpmfiObject * fi); PyObject * rpmfi_Wrap(rpmfi fi); diff --git a/python/rpmmi-py.h b/python/rpmmi-py.h index b832c2d68..e5410d6f3 100644 --- a/python/rpmmi-py.h +++ b/python/rpmmi-py.h @@ -5,6 +5,8 @@ typedef struct rpmmiObject_s rpmmiObject; extern PyTypeObject rpmmi_Type; +#define rpmmiObject_Check(v) ((v)->ob_type == &rpmmi_Type) + PyObject * rpmmi_Wrap(rpmdbMatchIterator mi, PyObject *s); #endif diff --git a/python/rpmps-py.h b/python/rpmps-py.h index 350bccda4..de7af0915 100644 --- a/python/rpmps-py.h +++ b/python/rpmps-py.h @@ -7,6 +7,8 @@ typedef struct rpmpsObject_s rpmpsObject; extern PyTypeObject rpmps_Type; +#define rpmpsObject_Check(v) ((v)->ob_type == &rpmps_Type) + rpmps psFromPs(rpmpsObject * ps); PyObject * rpmps_Wrap(rpmps ps); diff --git a/python/rpmte-py.h b/python/rpmte-py.h index e6bfda951..0a273ed1d 100644 --- a/python/rpmte-py.h +++ b/python/rpmte-py.h @@ -7,6 +7,8 @@ typedef struct rpmteObject_s rpmteObject; extern PyTypeObject rpmte_Type; +#define rpmteObject_Check(v) ((v)->ob_type == &rpmte_Type) + PyObject * rpmte_Wrap(rpmte te); #endif diff --git a/python/rpmts-py.h b/python/rpmts-py.h index cad663eeb..956a11b38 100644 --- a/python/rpmts-py.h +++ b/python/rpmts-py.h @@ -7,6 +7,8 @@ typedef struct rpmtsObject_s rpmtsObject; extern PyTypeObject rpmts_Type; +#define rpmtsObject_Check(v) ((v)->ob_type == &rpmts_Type) + /* XXX These names/constants have been removed from the rpmlib API. */ enum { RPMDEP_SENSE_REQUIRES, /*!< requirement not satisfied. */ diff --git a/python/spec-py.h b/python/spec-py.h index 0ed16e6e5..25eac76f3 100644 --- a/python/spec-py.h +++ b/python/spec-py.h @@ -7,6 +7,8 @@ typedef struct specObject_s specObject; extern PyTypeObject spec_Type; +#define specObject_Check(v) ((v)->ob_type == &spec_Type) + rpmSpec specFromSpec(specObject * spec); PyObject * spec_Wrap(rpmSpec spec); |