diff options
author | aneejit1 <aneejit1@gmail.com> | 2022-05-25 14:18:49 +0000 |
---|---|---|
committer | aneejit1 <aneejit1@gmail.com> | 2022-05-25 14:18:49 +0000 |
commit | b92a3b0a4eb3cf0790904121c803717ebbbabd55 (patch) | |
tree | 99f1f9887c9bf103658eb54a4b772156f2d469c6 | |
parent | b9448655a28d8357dbed7d2a4f3171440703c0bf (diff) | |
download | sip4-tqt-b92a3b0a4eb3cf0790904121c803717ebbbabd55.tar.gz sip4-tqt-b92a3b0a4eb3cf0790904121c803717ebbbabd55.zip |
Make sip_api_get_address a public API function
The sipGetAddress function has been renamed as sip_api_get_address
and made available as part of the public API.
Signed-off-by: aneejit1 <aneejit1@gmail.com>
-rw-r--r-- | siplib/sip-tqt.h | 1 | ||||
-rw-r--r-- | siplib/sipint.h | 3 | ||||
-rw-r--r-- | siplib/siplib.c | 13 | ||||
-rw-r--r-- | siplib/tqtlib.c | 4 |
4 files changed, 11 insertions, 10 deletions
diff --git a/siplib/sip-tqt.h b/siplib/sip-tqt.h index 8c49068..e3a306f 100644 --- a/siplib/sip-tqt.h +++ b/siplib/sip-tqt.h @@ -1295,6 +1295,7 @@ typedef struct _sipAPIDef { sipAttrGetterFunc getter); int (*api_is_api_enabled)(const char *name, int from, int to); sipErrorState (*api_bad_callable_arg)(int arg_nr, PyObject *arg); + void *(*api_get_address)(sipSimpleWrapper *w); /* * The following are deprecated parts of the public API. diff --git a/siplib/sipint.h b/siplib/sipint.h index f229fbe..49fad01 100644 --- a/siplib/sipint.h +++ b/siplib/sipint.h @@ -118,6 +118,7 @@ PyObject *sip_api_invoke_slot(const sipSlot *slot, PyObject *sigargs); void *sip_api_convert_rx(sipWrapper *txSelf, const char *sigargs, PyObject *rxObj, const char *slot, const char **memberp, int flags); int sip_api_save_slot(sipSlot *sp, PyObject *rxObj, const char *slot); +void *sip_api_get_address(sipSimpleWrapper *w); /* @@ -139,8 +140,6 @@ int sipOMRemoveObject(sipObjectMap *om, sipSimpleWrapper *val); void sipSetBool(void *ptr,int val); -void *sipGetAddress(sipSimpleWrapper *w); - #ifdef __cplusplus } diff --git a/siplib/siplib.c b/siplib/siplib.c index 39df89f..242a1cb 100644 --- a/siplib/siplib.c +++ b/siplib/siplib.c @@ -307,6 +307,7 @@ static const sipAPIDef sip_api = { sip_api_register_attribute_getter, sip_api_is_api_enabled, sip_api_bad_callable_arg, + sip_api_get_address, /* * The following are deprecated parts of the public API. */ @@ -901,7 +902,7 @@ static PyObject *dumpWrapper(PyObject *self, PyObject *args) #else printf(" Reference count: %d\n", Py_REFCNT(sw)); #endif - printf(" Address of wrapped object: %p\n", sipGetAddress(sw)); + printf(" Address of wrapped object: %p\n", sip_api_get_address(sw)); printf(" To be destroyed by: %s\n", (sipIsPyOwned(sw) ? "Python" : "C/C++")); printf(" Derived class?: %s\n", (sipIsDerived(sw) ? "yes" : "no")); @@ -1071,7 +1072,7 @@ static PyObject *isDeleted(PyObject *self, PyObject *args) if (!PyArg_ParseTuple(args, "O!:isdeleted", &sipSimpleWrapper_Type, &sw)) return NULL; - res = (sipGetAddress(sw) == NULL ? Py_True : Py_False); + res = (sip_api_get_address(sw) == NULL ? Py_True : Py_False); Py_INCREF(res); return res; @@ -7369,7 +7370,7 @@ static PyObject *sip_api_get_pyobject(void *cppPtr, const sipTypeDef *td) /* * Return the C/C++ pointer from a wrapper without any checks. */ -void *sipGetAddress(sipSimpleWrapper *sw) +void *sip_api_get_address(sipSimpleWrapper *sw) { if (sipIsAccessFunc(sw)) return (*sw->u.afPtr)(); @@ -7416,7 +7417,7 @@ static void *getComplexCppPtr(sipSimpleWrapper *sw, const sipTypeDef *td) */ void *sip_api_get_cpp_ptr(sipSimpleWrapper *sw, const sipTypeDef *td) { - void *ptr = sipGetAddress(sw); + void *ptr = sip_api_get_address(sw); if (checkPointer(ptr, sw) < 0) return NULL; @@ -9213,7 +9214,7 @@ static int sipWrapper_clear(sipWrapper *self) /* Remove any slots connected via a proxy. */ if (sipTQtSupport != NULL && sipPossibleProxy(sw)) { - void *tx = sipGetAddress(sw); + void *tx = sip_api_get_address(sw); if (tx != NULL) { @@ -9281,7 +9282,7 @@ static int sipWrapper_traverse(sipWrapper *self, visitproc visit, void *arg) /* This should be handwritten code in PyTQt. */ if (sipTQtSupport != NULL) { - void *tx = sipGetAddress(sw); + void *tx = sip_api_get_address(sw); if (tx != NULL) { diff --git a/siplib/tqtlib.c b/siplib/tqtlib.c index 83e4add..1628c83 100644 --- a/siplib/tqtlib.c +++ b/siplib/tqtlib.c @@ -143,7 +143,7 @@ PyObject *sip_api_invoke_slot(const sipSlot *slot, PyObject *sigargs) * longer exists. */ if (PyObject_TypeCheck(self, (PyTypeObject *)&sipSimpleWrapper_Type) && - sipGetAddress(self) == NULL) + sip_api_get_address(self) == NULL) { Py_XDECREF(sref); @@ -371,7 +371,7 @@ void *sipGetRx(sipSimpleWrapper *txSelf, const char *sigargs, PyObject *rxObj, * The slot was either a Python callable or PyTQt3 Python signal so there * should be a universal slot. */ - return sipTQtSupport->qt_find_slot(sipGetAddress(txSelf), sigargs, rxObj, slot, memberp); + return sipTQtSupport->qt_find_slot(sip_api_get_address(txSelf), sigargs, rxObj, slot, memberp); } |