4 * Architecture definitions
7 * Instances of Arch represent architecture and compatibility.
8 * The system has an architecture (i.e. x86_64) and so does every
11 * +Arch#compatible_with?+ is used to detect compatible architectures.
12 * 'noarch' is compatible with any system architecture.
14 * There is no limit to architecture specifiers, any string can be
15 * passed to the Arch constructor.
16 * However, there is a set of architectures built into libzypp.
17 * +Arch#builtin?+ returns true for an architecture from the builtin set.
20 * arch = Arch.new("i686")
24 * arch.builtin? -> true
28 %nodefault zypp::Arch;
37 return new zypp::Arch(s);
46 static Arch noarch() { return zypp::Arch_noarch; }
50 static Arch i386() { return zypp::Arch_i386; }
54 static Arch i486() { return zypp::Arch_i486; }
58 static Arch i586() { return zypp::Arch_i586; }
62 static Arch i686() { return zypp::Arch_i686; }
64 * builtin: i86_64 (AMD 64)
66 static Arch x86_64() { return zypp::Arch_x86_64; }
68 * builtin: ia64 (Itanium)
70 static Arch ia64() { return zypp::Arch_ia64; }
72 * builtin: ppc (Power PC 32 bit)
74 static Arch ppc() { return zypp::Arch_ppc; }
76 * builtin: ppc64 (Power PC 64 bit)
78 static Arch ppc64() { return zypp::Arch_ppc64; }
80 * builtin: s390 (zSeries 32 bit)
82 static Arch s390() { return zypp::Arch_s390; }
84 * builtin: s390s (zSeries 64 bit)
86 static Arch s390x() { return zypp::Arch_s390x; }
90 static Arch armv7tnhl() { return zypp::Arch_armv7tnhl; }
94 static Arch armv7thl() { return zypp::Arch_armv7thl; }
98 static Arch armv7nhl() { return zypp::Arch_armv7nhl; }
102 static Arch armv7hl() { return zypp::Arch_armv7hl; }
106 static Arch armv7tnhl() { return zypp::Arch_armv7tnhl; }
110 static Arch armv7thl() { return zypp::Arch_armv7thl; }
114 static Arch armv7nhl() { return zypp::Arch_armv7nhl; }
118 static Arch armv7hl() { return zypp::Arch_armv7hl; }
123 static Arch armv7l() { return zypp::Arch_armv7l; }
127 static Arch armv6l() { return zypp::Arch_armv6l; }
131 static Arch armv5tejl() { return zypp::Arch_armv5tejl; }
135 static Arch armv5tel() { return zypp::Arch_armv5tel; }
139 static Arch armv5l() { return zypp::Arch_armv5l; }
143 static Arch armv4tl() { return zypp::Arch_armv4tl; }
147 static Arch armv4l() { return zypp::Arch_armv4l; }
151 static Arch armv3l() { return zypp::Arch_armv3l; }
153 #if 0 /* defined(SWIGRUBY) */
154 %typemap(out) int is_builtin
155 "$result = $1 ? Qtrue : Qfalse;";
156 %rename("builtin?") builtin;
159 * Whether this is a builtin (or known) architecture.
163 return ($self->isBuiltIn() ? 1 : 0);
165 #if defined(SWIGRUBY)
166 %typemap(out) int compatible_with
167 "$result = $1 ? Qtrue : Qfalse;";
168 %rename("compatible_with?") compatible_with;
171 * Check if this architecture is compatible with another one
173 * e.g. 'noarch' is compatible with any arch
176 int compatible_with(const zypp::Arch & arch) {
177 return ($self->compatibleWith(arch) ? 1 : 0);
180 #if ZYPP_VERSION > 800
182 * return the arch before noarch if it's not a multilib arch
183 * (e.g. x86_64,sparc64v,sparc64,ppc64,s390x).
186 zypp::Arch base_arch()
188 return $self->baseArch();
192 #if defined(SWIGRUBY)
193 %alias compare "<=>";
195 #if defined(SWIGPYTHON)
199 int __cmp__( const zypp::Arch & arch )
202 * Comparison operator
204 * returning <0 (smaller), 0 (equal) or >0 (greater)
207 int compare( const zypp::Arch & arch )
209 { return $self->compare( arch ); }
211 #if defined(SWIGPERL)
215 int __eq__( const zypp::Arch & arch )
217 #if defined(SWIGRUBY)
218 %typemap(out) int equal
219 "$result = $1 ? Qtrue : Qfalse;";
225 int equal( const zypp::Arch & arch )
228 #if defined(SWIGPYTHON)
231 * Python treats 'eq' and 'ne' distinct.
233 int __ne__( const zypp::Arch & arch )
234 { return $self->compare(arch) != 0; }
235 int __eq__( const zypp::Arch & arch )
237 { return $self->compare(arch) == 0; }
241 %rename ("__str__") string();
244 %rename ("to_s") string();
247 * String representation
252 return $self->c_str();