summaryrefslogtreecommitdiff
path: root/python/apt_pkgmodule.h
diff options
context:
space:
mode:
Diffstat (limited to 'python/apt_pkgmodule.h')
-rw-r--r--python/apt_pkgmodule.h36
1 files changed, 35 insertions, 1 deletions
diff --git a/python/apt_pkgmodule.h b/python/apt_pkgmodule.h
index ec6cf10e..a22a25f0 100644
--- a/python/apt_pkgmodule.h
+++ b/python/apt_pkgmodule.h
@@ -13,6 +13,7 @@
#include <Python.h>
#include <apt-pkg/hashes.h>
#include <apt-pkg/acquire-item.h>
+#include "generic.h"
// Configuration Stuff
#define Configuration_Check(op) ((op)->ob_type == &PyConfiguration_Type)
@@ -122,8 +123,41 @@ extern PyTypeObject PyAcquireWorker_Type;
extern PyTypeObject PySystemLock_Type;
extern PyTypeObject PyFileLock_Type;
+// Functions to be exported in the public API.
PyObject *PyAcquire_FromCpp(pkgAcquire *fetcher, bool Delete);
-PyObject *PyAcquireItem_FromCpp(pkgAcquire::Item *item, bool Delete, PyObject *owner);
+# define PyAcquire_ToCpp GetCpp<pkgAcquire*>
+# define PyAcquireFile_ToCpp GetCpp<pkgAcqFile*>
+# define PyAcquireItem_ToCpp GetCpp<pkgAcquire::Item*>
+# define PyAcquireItemDesc_ToCpp GetCpp<pkgAcquire::ItemDesc*>
+# define PyAcquireWorker_ToCpp GetCpp<pkgAcquire::Worker*>
+# define PyActionGroup_ToCpp GetCpp<pkgDepCache::ActionGroup*>
+# define PyCache_ToCpp GetCpp<pkgCache*>
+# define PyCacheFile_ToCpp GetCpp<pkgCacheFile*>
+# define PyCdrom_ToCpp GetCpp<pkgCdrom>
+# define PyConfiguration_ToCpp GetCpp<Configuration*>
+# define PyDepCache_ToCpp GetCpp<pkgDepCache*>
+# define PyDependency_ToCpp GetCpp<pkgCache::DepIterator>
+# define PyDependencyList_ToCpp GetCpp<RDepListStruct> // TODO
+# define PyDescription_ToCpp GetCpp<pkgCache::DescIterator>
+# define PyHashes_ToCpp GetCpp<Hashes>
+# define PyHashString_ToCpp GetCpp<HashString*>
+# define PyIndexRecords_ToCpp GetCpp<indexRecords*>
+# define PyMetaIndex_ToCpp GetCpp<metaIndex*>
+# define PyPackage_ToCpp GetCpp<pkgCache::PkgIterator>
+# define PyPackageFile_ToCpp GetCpp<pkgCache::PkgFileIterator>
+# define PyIndexFile_ToCpp GetCpp<pkgIndexFile*>
+# define PyPackageList_ToCpp GetCpp<PkgListStruct> // TODO
+# define PyPackageManager_ToCpp GetCpp<pkgPackageManager*>
+# define PyPackageRecords_ToCpp GetCpp<PkgRecordsStruct> // TODO
+# define PyPolicy_ToCpp GetCpp<pkgPolicy*>
+# define PyProblemResolver_ToCpp GetCpp<pkgProblemResolver*>
+# define PySourceList_ToCpp GetCpp<pkgSourceList*>
+# define PySourceRecords_ToCpp GetCpp<PkgSrcRecordsStruct> // TODO
+# define PyTagFile_ToCpp GetCpp<pkgTagFile>
+# define PyTagSection_ToCpp GetCpp<pkgTagSection>
+# define PyVersion_ToCpp GetCpp<pkgCache::VerIterator>
+
+
#include "python-apt.h"
#endif