3 /* set this to 0 (zero) to only create a subset of the bindings
18 // stuff swig seems to be unable to parse
19 #define BOOST_NOEXCEPT
20 #define BOOST_SP_NOEXCEPT
21 #define BOOST_SP_NOEXCEPT_WITH_ASSERT
22 #define BOOST_NO_CXX11_NOEXCEPT
23 #define BOOST_NO_CXX11_RVALUE_REFERENCES
24 #define BOOST_NO_CXX11_SMART_PTR
26 #define BOOST_CONSTEXPR constexpr
29 /* Includes the header in the wrapper code */
31 #define REG_EXTENDED 1
32 #define REG_ICASE (REG_EXTENDED << 1)
33 #define REG_NEWLINE (REG_ICASE << 1)
34 #define REG_NOSUB (REG_NEWLINE << 1)
38 * type definitions to keep the C code generic
41 #if defined(SWIGPYTHON)
42 #define Target_Null_p(x) (x == Py_None)
43 #define Target_INCREF(x) Py_INCREF(x)
44 #define Target_DECREF(x) Py_DECREF(x)
45 #define Target_True Py_True
46 #define Target_False Py_False
47 #define Target_Null Py_None
48 #define Target_Type PyObject*
49 #define Target_Bool(x) PyBool_FromLong(x)
50 #define Target_WChar(x) PyInt_FromLong(x)
51 #define Target_Int(x) PyInt_FromLong(x)
52 #define Target_String(x) PyString_FromString(x)
53 #define Target_Real(x) Py_None
54 #define Target_Array() PyList_New(0)
55 #define Target_SizedArray(len) PyList_New(len)
56 #define Target_Append(x,y) PyList_Append(x,y)
57 #define Target_DateTime(x) Py_None
59 #define TARGET_THREAD_BEGIN_BLOCK SWIG_PYTHON_THREAD_BEGIN_BLOCK
60 #define TARGET_THREAD_END_BLOCK SWIG_PYTHON_THREAD_END_BLOCK
61 #define TARGET_THREAD_BEGIN_ALLOW SWIG_PYTHON_THREAD_BEGIN_ALLOW
62 #define TARGET_THREAD_END_ALLOW SWIG_PYTHON_THREAD_END_ALLOW
66 #define Target_Null_p(x) NIL_P(x)
67 #define Target_INCREF(x)
68 #define Target_DECREF(x)
69 #define Target_True Qtrue
70 #define Target_False Qfalse
71 #define Target_Null Qnil
72 #define Target_Type VALUE
73 #define Target_Bool(x) ((x)?Qtrue:Qfalse)
74 #define Target_WChar(x) INT2FIX(x)
75 #define Target_Int(x) INT2FIX(x)
76 #define Target_String(x) rb_str_new2(x)
77 #define Target_Real(x) rb_float_new(x)
78 #define Target_Array() rb_ary_new()
79 #define Target_SizedArray(len) rb_ary_new2(len)
80 #define Target_Append(x,y) rb_ary_push(x,y)
81 #define Target_DateTime(x) Qnil
82 #define TARGET_THREAD_BEGIN_BLOCK do {} while(0)
83 #define TARGET_THREAD_END_BLOCK do {} while(0)
84 #define TARGET_THREAD_BEGIN_ALLOW do {} while(0)
85 #define TARGET_THREAD_END_ALLOW do {} while(0)
90 #define TARGET_THREAD_BEGIN_BLOCK do {} while(0)
91 #define TARGET_THREAD_END_BLOCK do {} while(0)
92 #define TARGET_THREAD_BEGIN_ALLOW do {} while(0)
93 #define TARGET_THREAD_END_ALLOW do {} while(0)
95 SWIGINTERNINLINE SV *SWIG_From_long SWIG_PERL_DECL_ARGS_1(long value);
96 SWIGINTERNINLINE SV *SWIG_FromCharPtr(const char *cptr);
97 SWIGINTERNINLINE SV *SWIG_From_double SWIG_PERL_DECL_ARGS_1(double value);
99 #define Target_Null_p(x) (x == NULL)
100 #define Target_INCREF(x)
101 #define Target_DECREF(x)
102 #define Target_True (&PL_sv_yes)
103 #define Target_False (&PL_sv_no)
104 #define Target_Null NULL
105 #define Target_Type SV *
106 #define Target_Bool(x) (x)?Target_True:Target_False
107 #define Target_WChar(x) NULL
108 #define Target_Int(x) SWIG_From_long(x)
109 #define Target_String(x) SWIG_FromCharPtr(x)
110 #define Target_Real(x) SWIG_From_double(x)
111 #define Target_Array() (SV *)newAV()
112 #define Target_SizedArray(len) (SV *)newAV()
113 #define Target_Append(x,y) av_push(((AV *)(x)), y)
114 #define Target_DateTime(x) NULL
121 #undef seed // don't know where it comes from, but it conflicts with <random>
122 #include "zypp/base/PtrTypes.h"
123 #include "zypp/base/ReferenceCounted.h"
124 #include "zypp/Edition.h"
125 #include "zypp/Pathname.h"
126 #include "zypp/ResTraits.h"
127 #include "zypp/ZYppFactory.h"
128 #include "zypp/ZYpp.h"
130 #include "zypp/ResObjects.h"
131 #include "zypp/Target.h"
132 #include "zypp/target/TargetImpl.h"
133 #include "zypp/MediaSetAccess.h"
134 #include "zypp/ResFilters.h"
135 #include "zypp/OnMediaLocation.h"
136 #include "zypp/Repository.h"
137 #include "zypp/ServiceInfo.h"
138 #include "zypp/RepoManager.h"
139 #include "zypp/repo/RepoType.h"
140 #include "zypp/repo/PackageProvider.h"
141 #include "zypp/TmpPath.h"
142 #include "zypp/Resolver.h"
143 #include "legacy/GetResolvablesToInsDel.h"
145 #include "zypp/sat/SolvAttr.h"
146 #include "zypp/PoolQuery.h"
147 #include "zypp/Product.h"
149 using namespace boost;
150 using namespace zypp;
151 using namespace zypp::repo;
152 using namespace zypp::resfilter;
153 using namespace zypp::filesystem;
155 typedef std::list<std::string> StringList;
159 /* swig does not understand the __attribute__ extension */
160 #define __attribute__(x)
162 /* prevent swig from creating a type called 'Target_Type' */
163 #if defined(SWIGRUBY)
164 #define Target_Type VALUE
166 #if defined(SWIGPYTHON)
167 #define Target_Type PyObject*
169 #if defined(SWIGPERL)
170 #define Target_Type SV *
174 %include "ruby/std_list.i"
175 %include "ruby/std_set.i"
176 %include "ruby/ruby.i"
180 %include "std_list.i"
182 %include "python/python.i"
186 %include "std_list.i"
187 %include "perl5/perl.i"
190 #define VERSION ZYPP_VERSION
192 /* These include files are pending to be cleaned up from C++ cruft */
193 #if PRODUCTION /* set 0 for testing, these files still carry the full C++ cruft */
197 %rename("+") "operator+";
198 %rename("<<") "operator<<";
199 %rename("!=") "operator!=";
200 %rename("!") "operator!";
201 %rename("==") "operator==";
205 // silence 'Nothing known about class..' warning
206 class ReferenceCounted {};
210 %include "std_string.i"
213 %import <boost/config.hpp>
214 %import <boost/pointer_cast.hpp>
216 #ifdef BOOST_SMARTPTR_INCLUDE_DIR
217 %import <boost/smart_ptr/scoped_ptr.hpp>
218 %import <boost/smart_ptr/shared_ptr.hpp>
219 %import <boost/smart_ptr/weak_ptr.hpp>
220 %import <boost/smart_ptr/intrusive_ptr.hpp>
222 %import <boost/scoped_ptr.hpp>
223 %import <boost/shared_ptr.hpp>
224 %import <boost/weak_ptr.hpp>
225 %import <boost/intrusive_ptr.hpp>
227 %import <zypp/base/PtrTypes.h>
228 %import <zypp/base/Flags.h>
230 %include "IdStringType.i"
231 %include "Pathname.i"
232 %include "ByteCount.i"
234 %include "NeedAType.i"
237 %include "CheckSum.i"
239 %include "Changelog.i"
241 %include "Capability.i"
242 %include "Capabilities.i"
243 %include "CapMatch.i"
244 %include "OnMediaLocation.i"
245 %include "SolvAttr.i"
246 %include "RepoType.i"
247 %include "RepoInfo.i"
248 %include "Repository.i"
249 %include "Resolvable.i"
250 %include "ServiceInfo.i"
251 %include "ResTraits.i"
252 %include "ResStatus.i"
253 %include "ResObject.i"
254 %include "VendorSupportOptions.i"
256 %include "PackageProvider.i"
260 %include "SrcPackage.i"
261 %include "RepoStatus.i"
262 %include "RepoManager.i"
263 %include "PublicKey.i"
266 %include "MediaSetAccess.i"
267 %include "PoolItem.i"
269 %include "ZYppCommitPolicy.i"
270 %include "ZYppCommitResult.i"
272 %include "Resolver.i"
274 %include "PoolQuery.i"
276 //just simple files, where we need default ctor
277 %include <zypp/repo/RepoProvideFile.h>
278 %include <zypp/repo/DeltaCandidates.h>
280 %ignore zypp::ZYpp::setTextLocale;
281 %ignore zypp::ZYpp::getTextLocale;
282 %ignore zypp::ZYpp::setRequestedLocales;
283 %ignore zypp::ZYpp::getRequestedLocales;
284 %ignore zypp::ZYpp::getAvailableLocales;
285 %ignore zypp::ZYpp::architecture;
286 %ignore zypp::ZYpp::setArchitecture;
287 %ignore zypp::ZYpp::applyLocks;
289 %include "ZYppFactory.i"
293 %include "Callbacks.i"
299 #include <zypp/base/LogControl.h>
304 void setZyppLogfile( const std::string & file_r )
306 base::LogControl::instance().logfile( file_r );