3 /* set this to 0 (zero) to only create a subset of the bindings
19 /* Includes the header in the wrapper code */
21 #define REG_EXTENDED 1
22 #define REG_ICASE (REG_EXTENDED << 1)
23 #define REG_NEWLINE (REG_ICASE << 1)
24 #define REG_NOSUB (REG_NEWLINE << 1)
28 * type definitions to keep the C code generic
31 #if defined(SWIGPYTHON)
32 #define Target_Null_p(x) (x == Py_None)
33 #define Target_INCREF(x) Py_INCREF(x)
34 #define Target_DECREF(x) Py_DECREF(x)
35 #define Target_True Py_True
36 #define Target_False Py_False
37 #define Target_Null Py_None
38 #define Target_Type PyObject*
39 #define Target_Bool(x) PyBool_FromLong(x)
40 #define Target_WChar(x) PyInt_FromLong(x)
41 #define Target_Int(x) PyInt_FromLong(x)
42 #define Target_String(x) PyString_FromString(x)
43 #define Target_Real(x) Py_None
44 #define Target_Array() PyList_New(0)
45 #define Target_SizedArray(len) PyList_New(len)
46 #define Target_Append(x,y) PyList_Append(x,y)
47 #define Target_DateTime(x) Py_None
49 #define TARGET_THREAD_BEGIN_BLOCK SWIG_PYTHON_THREAD_BEGIN_BLOCK
50 #define TARGET_THREAD_END_BLOCK SWIG_PYTHON_THREAD_END_BLOCK
51 #define TARGET_THREAD_BEGIN_ALLOW SWIG_PYTHON_THREAD_BEGIN_ALLOW
52 #define TARGET_THREAD_END_ALLOW SWIG_PYTHON_THREAD_END_ALLOW
56 #define Target_Null_p(x) NIL_P(x)
57 #define Target_INCREF(x)
58 #define Target_DECREF(x)
59 #define Target_True Qtrue
60 #define Target_False Qfalse
61 #define Target_Null Qnil
62 #define Target_Type VALUE
63 #define Target_Bool(x) ((x)?Qtrue:Qfalse)
64 #define Target_WChar(x) INT2FIX(x)
65 #define Target_Int(x) INT2FIX(x)
66 #define Target_String(x) rb_str_new2(x)
67 #define Target_Real(x) rb_float_new(x)
68 #define Target_Array() rb_ary_new()
69 #define Target_SizedArray(len) rb_ary_new2(len)
70 #define Target_Append(x,y) rb_ary_push(x,y)
71 #define Target_DateTime(x) Qnil
72 #define TARGET_THREAD_BEGIN_BLOCK do {} while(0)
73 #define TARGET_THREAD_END_BLOCK do {} while(0)
74 #define TARGET_THREAD_BEGIN_ALLOW do {} while(0)
75 #define TARGET_THREAD_END_ALLOW do {} while(0)
81 #define TARGET_THREAD_BEGIN_BLOCK do {} while(0)
82 #define TARGET_THREAD_END_BLOCK do {} while(0)
83 #define TARGET_THREAD_BEGIN_ALLOW do {} while(0)
84 #define TARGET_THREAD_END_ALLOW do {} while(0)
86 SWIGINTERNINLINE SV *SWIG_From_long SWIG_PERL_DECL_ARGS_1(long value);
87 SWIGINTERNINLINE SV *SWIG_FromCharPtr(const char *cptr);
88 SWIGINTERNINLINE SV *SWIG_From_double SWIG_PERL_DECL_ARGS_1(double value);
90 #define Target_Null_p(x) (x == NULL)
91 #define Target_INCREF(x)
92 #define Target_DECREF(x)
93 #define Target_True (&PL_sv_yes)
94 #define Target_False (&PL_sv_no)
95 #define Target_Null NULL
96 #define Target_Type SV *
97 #define Target_Bool(x) (x)?Target_True:Target_False
98 #define Target_WChar(x) NULL
99 #define Target_Int(x) SWIG_From_long(x)
100 #define Target_String(x) SWIG_FromCharPtr(x)
101 #define Target_Real(x) SWIG_From_double(x)
102 #define Target_Array() (SV *)newAV()
103 #define Target_SizedArray(len) (SV *)newAV()
104 #define Target_Append(x,y) av_push(((AV *)(x)), y)
105 #define Target_DateTime(x) NULL
112 #include "zypp/base/PtrTypes.h"
113 #include "zypp/base/ReferenceCounted.h"
114 #include "zypp/Edition.h"
115 #include "zypp/Pathname.h"
116 #include "zypp/ResTraits.h"
117 #include "zypp/ZYppFactory.h"
118 #include "zypp/ZYpp.h"
120 #include "zypp/ResObjects.h"
121 #include "zypp/Target.h"
122 #include "zypp/target/TargetImpl.h"
123 #include "zypp/MediaSetAccess.h"
124 #include "zypp/ResFilters.h"
125 #include "zypp/OnMediaLocation.h"
126 #include "zypp/Repository.h"
127 #include "zypp/ServiceInfo.h"
128 #include "zypp/RepoManager.h"
129 #include "zypp/repo/RepoType.h"
130 #include "zypp/TmpPath.h"
131 #include "zypp/Resolver.h"
132 #include "zypp/pool/GetResolvablesToInsDel.h"
134 #include "zypp/Product.h"
136 using namespace boost;
137 using namespace zypp;
138 using namespace zypp::repo;
139 using namespace zypp::resfilter;
140 using namespace zypp::filesystem;
142 typedef std::list<std::string> StringList;
146 /* prevent swig from creating a type called 'Target_Type' */
147 #if defined(SWIGRUBY)
148 #define Target_Type VALUE
150 #if defined(SWIGPYTHON)
151 #define Target_Type PyObject*
153 #if defined(SWIGPERL)
154 #define Target_Type SV *
158 %include "ruby/std_list.i"
159 %include "ruby/std_set.i"
160 %include "ruby/ruby.i"
164 %include "std_list.i"
166 %include "python/python.i"
170 %include "std_list.i"
171 %include "perl5/perl.i"
174 #define VERSION ZYPP_VERSION
176 /* These include files are pending to be cleaned up from C++ cruft */
177 #if PRODUCTION /* set 0 for testing, these files still carry the full C++ cruft */
181 %rename("+") "operator+";
182 %rename("<<") "operator<<";
183 %rename("!=") "operator!=";
184 %rename("!") "operator!";
185 %rename("==") "operator==";
189 // silence 'Nothing known about class..' warning
190 class ReferenceCounted {};
194 %include "std_string.i"
197 #ifdef BOOST_SMARTPTR_INCLUDE_DIR
198 %import <boost/smart_ptr/scoped_ptr.hpp>
199 %import <boost/smart_ptr/shared_ptr.hpp>
200 %import <boost/smart_ptr/weak_ptr.hpp>
201 %import <boost/smart_ptr/intrusive_ptr.hpp>
203 %import <boost/scoped_ptr.hpp>
204 %import <boost/shared_ptr.hpp>
205 %import <boost/weak_ptr.hpp>
206 %import <boost/intrusive_ptr.hpp>
208 %import <zypp/base/PtrTypes.h>
209 %import <zypp/base/Flags.h>
211 %include "IdStringType.i"
212 %include "Pathname.i"
213 %include "ByteCount.i"
215 %include "NeedAType.i"
218 %include "CheckSum.i"
221 %include "Capability.i"
222 %include "Capabilities.i"
223 %include "CapMatch.i"
224 %include "OnMediaLocation.i"
225 %include "Resolvable.i"
226 %include "RepoType.i"
227 %include "RepoInfo.i"
228 %include "ServiceInfo.i"
229 %include "ResTraits.i"
230 %include "ResStatus.i"
231 %include "ResObject.i"
236 %include "SrcPackage.i"
237 %include "Repository.i"
238 %include "RepoStatus.i"
239 %include "RepoManager.i"
240 %include "PublicKey.i"
243 %include "MediaSetAccess.i"
244 %include "PoolItem.i"
246 %include "ZYppCommitPolicy.i"
247 %include "ZYppCommitResult.i"
249 %include "Resolver.i"
252 %ignore zypp::ZYpp::setTextLocale;
253 %ignore zypp::ZYpp::getTextLocale;
254 %ignore zypp::ZYpp::setRequestedLocales;
255 %ignore zypp::ZYpp::getRequestedLocales;
256 %ignore zypp::ZYpp::getAvailableLocales;
257 %ignore zypp::ZYpp::architecture;
258 %ignore zypp::ZYpp::setArchitecture;
259 %ignore zypp::ZYpp::applyLocks;
261 %include <zypp/ZYpp.h>
263 %include "ZYppFactory.i"
267 %include "Callbacks.i"
273 #include <zypp/base/LogControl.h>
278 void setZyppLogfile( const std::string & file_r )
280 base::LogControl::instance().logfile( file_r );