more ices
[ICEs.git] / bfin-5624 / qfontengine.i.1
1 typedef long int ptrdiff_t;
2 typedef long unsigned int size_t;
3 typedef signed char qint8;
4 typedef unsigned char quint8;
5 typedef short qint16;
6 typedef unsigned short quint16;
7 typedef int qint32;
8 typedef unsigned int quint32;
9 typedef long long qint64;
10 typedef unsigned long long quint64;
11 typedef qint64 qlonglong;
12 typedef quint64 qulonglong;
13 template <int> class QUintForSize { private: typedef void Type; };
14 template <> class QUintForSize<4> { public: typedef quint32 Type; };
15 template <> class QUintForSize<8> { public: typedef quint64 Type; };
16 template <typename T> class QUintForType : public QUintForSize<sizeof(T)> { };
17 typedef QUintForType<void *>::Type quintptr;
18 template <int> class QIntForSize { private: typedef void Type; };
19 template <> class QIntForSize<4> { public: typedef qint32 Type; };
20 template <> class QIntForSize<8> { public: typedef qint64 Type; };
21 template <typename T> class QIntForType : public QIntForSize<sizeof(T)> { };
22 typedef QIntForType<void *>::Type qptrdiff;
23 typedef unsigned char uchar;
24 typedef unsigned short ushort;
25 typedef unsigned int uint;
26 typedef unsigned long ulong;
27 typedef int QNoImplicitBoolCast;
28 typedef double qreal;
29 template <typename T>
30 inline T qAbs(const T &t) { return t >= 0 ? t : -t; }
31 inline int qRound(qreal d)
32 { return d >= 0.0 ? int(d + 0.5) : int(d - int(d-1) + 0.5) + int(d-1); }
33 inline qint64 qRound64(qreal d)
34 { return d >= 0.0 ? qint64(d + 0.5) : qint64(d - qint64(d-1) + 0.5) + qint64(d-1); }
35 template <typename T>
36 inline const T &qMin(const T &a, const T &b) { if (a < b) return a; return b; }
37 template <typename T>
38 inline const T &qMax(const T &a, const T &b) { if (a < b) return b; return a; }
39 template <typename T>
40 inline const T &qBound(const T &min, const T &val, const T &max)
41 { return qMax(min, qMin(max, val)); }
42 class QDataStream;
43 class QString;
44 class __attribute__((visibility("default"))) QSysInfo {
45 public:
46 enum Sizes {
47 WordSize = (sizeof(void *)<<3)
48 };
49 enum Endian {
50 BigEndian,
51 LittleEndian
52 , ByteOrder = LittleEndian
53 };
54 };
55 __attribute__((visibility("default"))) const char *qVersion();
56 __attribute__((visibility("default"))) bool qSharedBuild();
57 __attribute__((visibility("default"))) void qDebug(const char *, ...)
58 __attribute__ ((format (printf, 1, 2)))
59 ;
60 __attribute__((visibility("default"))) void qWarning(const char *, ...)
61 __attribute__ ((format (printf, 1, 2)))
62 ;
63 class QString;
64 __attribute__((visibility("default"))) QString qt_error_string(int errorCode = -1);
65 __attribute__((visibility("default"))) void qCritical(const char *, ...)
66 __attribute__ ((format (printf, 1, 2)))
67 ;
68 __attribute__((visibility("default"))) void qFatal(const char *, ...)
69 __attribute__ ((format (printf, 1, 2)))
70 ;
71 __attribute__((visibility("default"))) void qErrnoWarning(int code, const char *msg, ...);
72 __attribute__((visibility("default"))) void qErrnoWarning(const char *msg, ...);
73 class QDebug;
74 class QNoDebug;
75 __attribute__((visibility("default"))) inline QDebug qDebug();
76 __attribute__((visibility("default"))) inline QDebug qWarning();
77 __attribute__((visibility("default"))) inline QDebug qCritical();
78 inline void qt_noop() {}
79 __attribute__((visibility("default"))) void qt_assert(const char *assertion, const char *file, int line);
80 __attribute__((visibility("default"))) void qt_assert_x(const char *where, const char *what, const char *file, int line);
81 __attribute__((visibility("default"))) void qt_check_pointer(const char *, int);
82 enum QtMsgType { QtDebugMsg, QtWarningMsg, QtCriticalMsg, QtFatalMsg, QtSystemMsg = QtCriticalMsg };
83 __attribute__((visibility("default"))) void qt_message_output(QtMsgType, const char *buf);
84 typedef void (*QtMsgHandler)(QtMsgType, const char *);
85 __attribute__((visibility("default"))) QtMsgHandler qInstallMsgHandler(QtMsgHandler);
86 template <typename T> class QBasicAtomicPointer;
87 template <typename T>
88 class QGlobalStatic
89 {
90 public:
91 QBasicAtomicPointer<T> pointer;
92 bool destroyed;
93 };
94 template <typename T>
95 class QGlobalStaticDeleter
96 {
97 public:
98 QGlobalStatic<T> &globalStatic;
99 QGlobalStaticDeleter(QGlobalStatic<T> &_globalStatic)
100 : globalStatic(_globalStatic)
101 { }
102 inline ~QGlobalStaticDeleter()
103 {
104 delete globalStatic.pointer;
105 globalStatic.pointer = 0;
106 globalStatic.destroyed = true;
107 }
108 };
109 class QBool
110 {
111 bool b;
112 public:
113 inline explicit QBool(bool B) : b(B) {}
114 inline operator const void *() const
115 { return b ? static_cast<const void *>(this) : static_cast<const void *>(0); }
116 };
117 inline bool operator==(QBool b1, bool b2) { return !b1 == !b2; }
118 inline bool operator==(bool b1, QBool b2) { return !b1 == !b2; }
119 inline bool operator==(QBool b1, QBool b2) { return !b1 == !b2; }
120 inline bool operator!=(QBool b1, bool b2) { return !b1 != !b2; }
121 inline bool operator!=(bool b1, QBool b2) { return !b1 != !b2; }
122 inline bool operator!=(QBool b1, QBool b2) { return !b1 != !b2; }
123 static inline bool qFuzzyCompare(double p1, double p2)
124 {
125 return (qAbs(p1 - p2) <= 0.000000000001 * qMin(qAbs(p1), qAbs(p2)));
126 }
127 static inline bool qFuzzyCompare(float p1, float p2)
128 {
129 return (qAbs(p1 - p2) <= 0.00001f * qMin(qAbs(p1), qAbs(p2)));
130 }
131 static inline bool qIsNull(double d)
132 {
133 union U {
134 double d;
135 quint64 u;
136 };
137 U val;
138 val.d = d;
139 return val.u == quint64(0);
140 }
141 static inline bool qIsNull(float f)
142 {
143 union U {
144 float f;
145 quint32 u;
146 };
147 U val;
148 val.f = f;
149 return val.u == 0u;
150 }
151 template <typename T> inline bool qIsDetached(T &) { return true; }
152 template <typename T>
153 class QTypeInfo
154 {
155 public:
156 enum {
157 isPointer = false,
158 isComplex = true,
159 isStatic = true,
160 isLarge = (sizeof(T)>sizeof(void*)),
161 isDummy = false
162 };
163 };
164 template <typename T>
165 class QTypeInfo<T*>
166 {
167 public:
168 enum {
169 isPointer = true,
170 isComplex = false,
171 isStatic = false,
172 isLarge = false,
173 isDummy = false
174 };
175 };
176 enum {
177 Q_COMPLEX_TYPE = 0,
178 Q_PRIMITIVE_TYPE = 0x1,
179 Q_STATIC_TYPE = 0,
180 Q_MOVABLE_TYPE = 0x2,
181 Q_DUMMY_TYPE = 0x4
182 };
183 template <> class QTypeInfo<bool> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(bool)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "bool"; } };
184 template <> class QTypeInfo<char> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(char)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "char"; } };
185 template <> class QTypeInfo<signed char> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(signed char)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "signed char"; } };
186 template <> class QTypeInfo<uchar> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(uchar)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "uchar"; } };
187 template <> class QTypeInfo<short> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(short)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "short"; } };
188 template <> class QTypeInfo<ushort> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(ushort)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "ushort"; } };
189 template <> class QTypeInfo<int> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(int)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "int"; } };
190 template <> class QTypeInfo<uint> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(uint)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "uint"; } };
191 template <> class QTypeInfo<long> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(long)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "long"; } };
192 template <> class QTypeInfo<ulong> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(ulong)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "ulong"; } };
193 template <> class QTypeInfo<qint64> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(qint64)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "qint64"; } };
194 template <> class QTypeInfo<quint64> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(quint64)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "quint64"; } };
195 template <> class QTypeInfo<float> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(float)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "float"; } };
196 template <> class QTypeInfo<double> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(double)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "double"; } };
197 template <> class QTypeInfo<long double> { public: enum { isComplex = (((Q_PRIMITIVE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_PRIMITIVE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(long double)>sizeof(void*)), isPointer = false, isDummy = (((Q_PRIMITIVE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "long double"; } };
198 __attribute__((visibility("default"))) void *qMalloc(size_t size);
199 __attribute__((visibility("default"))) void qFree(void *ptr);
200 __attribute__((visibility("default"))) void *qRealloc(void *ptr, size_t size);
201 __attribute__((visibility("default"))) void *qMemCopy(void *dest, const void *src, size_t n);
202 __attribute__((visibility("default"))) void *qMemSet(void *dest, int c, size_t n);
203 class __attribute__((visibility("default"))) QFlag
204 {
205 int i;
206 public:
207 inline QFlag(int i);
208 inline operator int() const { return i; }
209 };
210 inline QFlag::QFlag(int ai) : i(ai) {}
211 class __attribute__((visibility("default"))) QIncompatibleFlag
212 {
213 int i;
214 public:
215 inline explicit QIncompatibleFlag(int i);
216 inline operator int() const { return i; }
217 };
218 inline QIncompatibleFlag::QIncompatibleFlag(int ai) : i(ai) {}
219 template<typename Enum>
220 class QFlags
221 {
222 typedef void **Zero;
223 int i;
224 public:
225 typedef Enum enum_type;
226 inline QFlags(const QFlags &f) : i(f.i) {}
227 inline QFlags(Enum f) : i(f) {}
228 inline QFlags(Zero = 0) : i(0) {}
229 inline QFlags(QFlag f) : i(f) {}
230 inline QFlags &operator=(const QFlags &f) { i = f.i; return *this; }
231 inline QFlags &operator&=(int mask) { i &= mask; return *this; }
232 inline QFlags &operator&=(uint mask) { i &= mask; return *this; }
233 inline QFlags &operator|=(QFlags f) { i |= f.i; return *this; }
234 inline QFlags &operator|=(Enum f) { i |= f; return *this; }
235 inline QFlags &operator^=(QFlags f) { i ^= f.i; return *this; }
236 inline QFlags &operator^=(Enum f) { i ^= f; return *this; }
237 inline operator int() const { return i; }
238 inline QFlags operator|(QFlags f) const { QFlags g; g.i = i | f.i; return g; }
239 inline QFlags operator|(Enum f) const { QFlags g; g.i = i | f; return g; }
240 inline QFlags operator^(QFlags f) const { QFlags g; g.i = i ^ f.i; return g; }
241 inline QFlags operator^(Enum f) const { QFlags g; g.i = i ^ f; return g; }
242 inline QFlags operator&(int mask) const { QFlags g; g.i = i & mask; return g; }
243 inline QFlags operator&(uint mask) const { QFlags g; g.i = i & mask; return g; }
244 inline QFlags operator&(Enum f) const { QFlags g; g.i = i & f; return g; }
245 inline QFlags operator~() const { QFlags g; g.i = ~i; return g; }
246 inline bool operator!() const { return !i; }
247 inline bool testFlag(Enum f) const { return (i & f) == f; }
248 };
249 template <typename T>
250 class QForeachContainer {
251 public:
252 inline QForeachContainer(const T& t) : c(t), brk(0), i(c.begin()), e(c.end()) { }
253 const T c;
254 int brk;
255 typename T::const_iterator i, e;
256 };
257 class QByteArray;
258 __attribute__((visibility("default"))) QByteArray qgetenv(const char *varName);
259 __attribute__((visibility("default"))) bool qputenv(const char *varName, const QByteArray& value);
260 inline int qIntCast(double f) { return int(f); }
261 inline int qIntCast(float f) { return int(f); }
262 __attribute__((visibility("default"))) void qsrand(uint seed);
263 __attribute__((visibility("default"))) int qrand();
264 enum QtValidLicenseForCoreModule { LicensedCore = true };
265 enum QtValidLicenseForGuiModule { LicensedGui = true };
266 enum QtValidLicenseForNetworkModule { LicensedNetwork = true };
267 enum QtValidLicenseForOpenGLModule { LicensedOpenGL = true };
268 enum QtValidLicenseForSqlModule { LicensedSql = true };
269 enum QtValidLicenseForXmlModule { LicensedXml = true };
270 enum QtValidLicenseForXmlPatternsModule { LicensedXmlPatterns = true };
271 enum QtValidLicenseForHelpModule { LicensedHelp = true };
272 enum QtValidLicenseForScriptModule { LicensedScript = true };
273 enum QtValidLicenseForScriptToolsModule { LicensedScriptTools = true };
274 enum QtValidLicenseForQt3SupportLightModule { LicensedQt3SupportLight = true };
275 enum QtValidLicenseForQt3SupportModule { LicensedQt3Support = true };
276 enum QtValidLicenseForSvgModule { LicensedSvg = true };
277 enum QtValidLicenseForTestModule { LicensedTest = true };
278 enum QtValidLicenseForDBusModule { LicensedDBus = true };
279 typedef QtValidLicenseForCoreModule QtCoreModule;
280 namespace QAlgorithmsPrivate {
281 template <typename RandomAccessIterator, typename T, typename LessThan>
282 void qSortHelper(RandomAccessIterator start, RandomAccessIterator end, const T &t, LessThan lessThan);
283 template <typename RandomAccessIterator, typename T>
284 inline void qSortHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &dummy);
285 template <typename RandomAccessIterator, typename T, typename LessThan>
286 void qStableSortHelper(RandomAccessIterator start, RandomAccessIterator end, const T &t, LessThan lessThan);
287 template <typename RandomAccessIterator, typename T>
288 inline void qStableSortHelper(RandomAccessIterator, RandomAccessIterator, const T &);
289 template <typename RandomAccessIterator, typename T, typename LessThan>
290 RandomAccessIterator qLowerBoundHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan);
291 template <typename RandomAccessIterator, typename T, typename LessThan>
292 RandomAccessIterator qUpperBoundHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan);
293 template <typename RandomAccessIterator, typename T, typename LessThan>
294 RandomAccessIterator qBinaryFindHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan);
295 }
296 template <typename InputIterator, typename OutputIterator>
297 inline OutputIterator qCopy(InputIterator begin, InputIterator end, OutputIterator dest)
298 {
299 while (begin != end)
300 *dest++ = *begin++;
301 return dest;
302 }
303 template <typename BiIterator1, typename BiIterator2>
304 inline BiIterator2 qCopyBackward(BiIterator1 begin, BiIterator1 end, BiIterator2 dest)
305 {
306 while (begin != end)
307 *--dest = *--end;
308 return dest;
309 }
310 template <typename InputIterator1, typename InputIterator2>
311 inline bool qEqual(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2)
312 {
313 for (; first1 != last1; ++first1, ++first2)
314 if (!(*first1 == *first2))
315 return false;
316 return true;
317 }
318 template <typename ForwardIterator, typename T>
319 inline void qFill(ForwardIterator first, ForwardIterator last, const T &val)
320 {
321 for (; first != last; ++first)
322 *first = val;
323 }
324 template <typename Container, typename T>
325 inline void qFill(Container &container, const T &val)
326 {
327 qFill(container.begin(), container.end(), val);
328 }
329 template <typename InputIterator, typename T>
330 inline InputIterator qFind(InputIterator first, InputIterator last, const T &val)
331 {
332 while (first != last && !(*first == val))
333 ++first;
334 return first;
335 }
336 template <typename Container, typename T>
337 inline typename Container::const_iterator qFind(const Container &container, const T &val)
338 {
339 return qFind(container.constBegin(), container.constEnd(), val);
340 }
341 template <typename InputIterator, typename T, typename Size>
342 inline void qCount(InputIterator first, InputIterator last, const T &value, Size &n)
343 {
344 for (; first != last; ++first)
345 if (*first == value)
346 ++n;
347 }
348 template <typename Container, typename T, typename Size>
349 inline void qCount(const Container &container, const T &value, Size &n)
350 {
351 qCount(container.constBegin(), container.constEnd(), value, n);
352 }
353 template <typename T>
354 inline void qSwap(T &value1, T &value2)
355 {
356 T t = value1;
357 value1 = value2;
358 value2 = t;
359 }
360 template <typename T>
361 class qLess
362 {
363 public:
364 inline bool operator()(const T &t1, const T &t2) const
365 {
366 return (t1 < t2);
367 }
368 };
369 template <typename T>
370 class qGreater
371 {
372 public:
373 inline bool operator()(const T &t1, const T &t2) const
374 {
375 return (t2 < t1);
376 }
377 };
378 template <typename RandomAccessIterator>
379 inline void qSort(RandomAccessIterator start, RandomAccessIterator end)
380 {
381 if (start != end)
382 QAlgorithmsPrivate::qSortHelper(start, end, *start);
383 }
384 template <typename RandomAccessIterator, typename LessThan>
385 inline void qSort(RandomAccessIterator start, RandomAccessIterator end, LessThan lessThan)
386 {
387 if (start != end)
388 QAlgorithmsPrivate::qSortHelper(start, end, *start, lessThan);
389 }
390 template<typename Container>
391 inline void qSort(Container &c)
392 {
393 if (!c.empty())
394 QAlgorithmsPrivate::qSortHelper(c.begin(), c.end(), *c.begin());
395 }
396 template <typename RandomAccessIterator>
397 inline void qStableSort(RandomAccessIterator start, RandomAccessIterator end)
398 {
399 if (start != end)
400 QAlgorithmsPrivate::qStableSortHelper(start, end, *start);
401 }
402 template <typename RandomAccessIterator, typename LessThan>
403 inline void qStableSort(RandomAccessIterator start, RandomAccessIterator end, LessThan lessThan)
404 {
405 if (start != end)
406 QAlgorithmsPrivate::qStableSortHelper(start, end, *start, lessThan);
407 }
408 template<typename Container>
409 inline void qStableSort(Container &c)
410 {
411 if (!c.empty())
412 QAlgorithmsPrivate::qStableSortHelper(c.begin(), c.end(), *c.begin());
413 }
414 template <typename RandomAccessIterator, typename T>
415 RandomAccessIterator qLowerBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value)
416 {
417 RandomAccessIterator middle;
418 int n = end - begin;
419 int half;
420 while (n > 0) {
421 half = n >> 1;
422 middle = begin + half;
423 if (*middle < value) {
424 begin = middle + 1;
425 n -= half + 1;
426 } else {
427 n = half;
428 }
429 }
430 return begin;
431 }
432 template <typename RandomAccessIterator, typename T, typename LessThan>
433 RandomAccessIterator qLowerBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
434 {
435 return QAlgorithmsPrivate::qLowerBoundHelper(begin, end, value, lessThan);
436 }
437 template <typename Container, typename T>
438 typename Container::const_iterator qLowerBound(const Container &container, const T &value)
439 {
440 return QAlgorithmsPrivate::qLowerBoundHelper(container.constBegin(), container.constEnd(), value, qLess<T>());
441 }
442 template <typename RandomAccessIterator, typename T>
443 RandomAccessIterator qUpperBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value)
444 {
445 RandomAccessIterator middle;
446 int n = end - begin;
447 int half;
448 while (n > 0) {
449 half = n >> 1;
450 middle = begin + half;
451 if (value < *middle) {
452 n = half;
453 } else {
454 begin = middle + 1;
455 n -= half + 1;
456 }
457 }
458 return begin;
459 }
460 template <typename RandomAccessIterator, typename T, typename LessThan>
461 RandomAccessIterator qUpperBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
462 {
463 return QAlgorithmsPrivate::qUpperBoundHelper(begin, end, value, lessThan);
464 }
465 template <typename Container, typename T>
466 typename Container::const_iterator qUpperBound(const Container &container, const T &value)
467 {
468 return QAlgorithmsPrivate::qUpperBoundHelper(container.constBegin(), container.constEnd(), value, qLess<T>());
469 }
470 template <typename RandomAccessIterator, typename T>
471 RandomAccessIterator qBinaryFind(RandomAccessIterator begin, RandomAccessIterator end, const T &value)
472 {
473 qint64 l = 0;
474 qint64 r = end - begin - 1;
475 if (r < 0)
476 return end;
477 qint64 i = (l + r + 1) / 2;
478 while (r != l) {
479 if (value < begin[i])
480 r = i - 1;
481 else
482 l = i;
483 i = (l + r + 1) / 2;
484 }
485 if (begin[i] < value || value < begin[i])
486 return end;
487 else
488 return begin + i;
489 }
490 template <typename RandomAccessIterator, typename T, typename LessThan>
491 RandomAccessIterator qBinaryFind(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
492 {
493 return QAlgorithmsPrivate::qBinaryFindHelper(begin, end, value, lessThan);
494 }
495 template <typename Container, typename T>
496 typename Container::const_iterator qBinaryFind(const Container &container, const T &value)
497 {
498 return QAlgorithmsPrivate::qBinaryFindHelper(container.constBegin(), container.constEnd(), value, qLess<T>());
499 }
500 template <typename ForwardIterator>
501 void qDeleteAll(ForwardIterator begin, ForwardIterator end)
502 {
503 while (begin != end) {
504 delete *begin;
505 ++begin;
506 }
507 }
508 template <typename Container>
509 inline void qDeleteAll(const Container &c)
510 {
511 qDeleteAll(c.begin(), c.end());
512 }
513 namespace QAlgorithmsPrivate {
514 template <typename RandomAccessIterator, typename T, typename LessThan>
515 void qSortHelper(RandomAccessIterator start, RandomAccessIterator end, const T &t, LessThan lessThan)
516 {
517 top:
518 int span = end - start;
519 if (span < 2)
520 return;
521 --end;
522 RandomAccessIterator low = start, high = end - 1;
523 RandomAccessIterator pivot = start + span / 2;
524 if (lessThan(*end, *start))
525 qSwap(*end, *start);
526 if (span == 2)
527 return;
528 if (lessThan(*pivot, *start))
529 qSwap(*pivot, *start);
530 if (lessThan(*end, *pivot))
531 qSwap(*end, *pivot);
532 if (span == 3)
533 return;
534 qSwap(*pivot, *end);
535 while (low < high) {
536 while (low < high && lessThan(*low, *end))
537 ++low;
538 while (high > low && lessThan(*end, *high))
539 --high;
540 if (low < high) {
541 qSwap(*low, *high);
542 ++low;
543 --high;
544 } else {
545 break;
546 }
547 }
548 if (lessThan(*low, *end))
549 ++low;
550 qSwap(*end, *low);
551 qSortHelper(start, low, t, lessThan);
552 start = low + 1;
553 ++end;
554 goto top;
555 }
556 template <typename RandomAccessIterator, typename T>
557 inline void qSortHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &dummy)
558 {
559 qSortHelper(begin, end, dummy, qLess<T>());
560 }
561 template <typename RandomAccessIterator>
562 void qReverse(RandomAccessIterator begin, RandomAccessIterator end)
563 {
564 --end;
565 while (begin < end)
566 qSwap(*begin++, *end--);
567 }
568 template <typename RandomAccessIterator>
569 void qRotate(RandomAccessIterator begin, RandomAccessIterator middle, RandomAccessIterator end)
570 {
571 qReverse(begin, middle);
572 qReverse(middle, end);
573 qReverse(begin, end);
574 }
575 template <typename RandomAccessIterator, typename T, typename LessThan>
576 void qMerge(RandomAccessIterator begin, RandomAccessIterator pivot, RandomAccessIterator end, T &t, LessThan lessThan)
577 {
578 const int len1 = pivot - begin;
579 const int len2 = end - pivot;
580 if (len1 == 0 || len2 == 0)
581 return;
582 if (len1 + len2 == 2) {
583 if (lessThan(*(begin + 1), *(begin)))
584 qSwap(*begin, *(begin + 1));
585 return;
586 }
587 RandomAccessIterator firstCut;
588 RandomAccessIterator secondCut;
589 int len2Half;
590 if (len1 > len2) {
591 const int len1Half = len1 / 2;
592 firstCut = begin + len1Half;
593 secondCut = qLowerBound(pivot, end, *firstCut, lessThan);
594 len2Half = secondCut - pivot;
595 } else {
596 len2Half = len2 / 2;
597 secondCut = pivot + len2Half;
598 firstCut = qUpperBound(begin, pivot, *secondCut, lessThan);
599 }
600 qRotate(firstCut, pivot, secondCut);
601 const RandomAccessIterator newPivot = firstCut + len2Half;
602 qMerge(begin, firstCut, newPivot, t, lessThan);
603 qMerge(newPivot, secondCut, end, t, lessThan);
604 }
605 template <typename RandomAccessIterator, typename T, typename LessThan>
606 void qStableSortHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &t, LessThan lessThan)
607 {
608 const int span = end - begin;
609 if (span < 2)
610 return;
611 const RandomAccessIterator middle = begin + span / 2;
612 qStableSortHelper(begin, middle, t, lessThan);
613 qStableSortHelper(middle, end, t, lessThan);
614 qMerge(begin, middle, end, t, lessThan);
615 }
616 template <typename RandomAccessIterator, typename T>
617 inline void qStableSortHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &dummy)
618 {
619 qStableSortHelper(begin, end, dummy, qLess<T>());
620 }
621 template <typename RandomAccessIterator, typename T, typename LessThan>
622 RandomAccessIterator qLowerBoundHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
623 {
624 RandomAccessIterator middle;
625 int n = end - begin;
626 int half;
627 while (n > 0) {
628 half = n >> 1;
629 middle = begin + half;
630 if (lessThan(*middle, value)) {
631 begin = middle + 1;
632 n -= half + 1;
633 } else {
634 n = half;
635 }
636 }
637 return begin;
638 }
639 template <typename RandomAccessIterator, typename T, typename LessThan>
640 RandomAccessIterator qUpperBoundHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
641 {
642 RandomAccessIterator middle;
643 int n = end - begin;
644 int half;
645 while (n > 0) {
646 half = n >> 1;
647 middle = begin + half;
648 if (lessThan(value, *middle)) {
649 n = half;
650 } else {
651 begin = middle + 1;
652 n -= half + 1;
653 }
654 }
655 return begin;
656 }
657 template <typename RandomAccessIterator, typename T, typename LessThan>
658 RandomAccessIterator qBinaryFindHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
659 {
660 qint64 l = 0;
661 qint64 r = end - begin - 1;
662 if (r < 0)
663 return end;
664 qint64 i = (l + r + 1) / 2;
665 while (r != l) {
666 if (lessThan(value, begin[i]))
667 r = i - 1;
668 else
669 l = i;
670 i = (l + r + 1) / 2;
671 }
672 if (lessThan(begin[i], value) || lessThan(value, begin[i]))
673 return end;
674 else
675 return begin + i;
676 }
677 }
678 typedef QtValidLicenseForCoreModule QtCoreModule;
679 class __attribute__((visibility("default"))) QBasicAtomicInt
680 {
681 public:
682 volatile int _q_value;
683 inline bool operator==(int value) const
684 {
685 return _q_value == value;
686 }
687 inline bool operator!=(int value) const
688 {
689 return _q_value != value;
690 }
691 inline bool operator!() const
692 {
693 return _q_value == 0;
694 }
695 inline operator int() const
696 {
697 return _q_value;
698 }
699 inline QBasicAtomicInt &operator=(int value)
700 {
701 _q_value = value;
702 return *this;
703 }
704 static bool isReferenceCountingNative();
705 static bool isReferenceCountingWaitFree();
706 bool ref();
707 bool deref();
708 static bool isTestAndSetNative();
709 static bool isTestAndSetWaitFree();
710 bool testAndSetRelaxed(int expectedValue, int newValue);
711 bool testAndSetAcquire(int expectedValue, int newValue);
712 bool testAndSetRelease(int expectedValue, int newValue);
713 bool testAndSetOrdered(int expectedValue, int newValue);
714 static bool isFetchAndStoreNative();
715 static bool isFetchAndStoreWaitFree();
716 int fetchAndStoreRelaxed(int newValue);
717 int fetchAndStoreAcquire(int newValue);
718 int fetchAndStoreRelease(int newValue);
719 int fetchAndStoreOrdered(int newValue);
720 static bool isFetchAndAddNative();
721 static bool isFetchAndAddWaitFree();
722 int fetchAndAddRelaxed(int valueToAdd);
723 int fetchAndAddAcquire(int valueToAdd);
724 int fetchAndAddRelease(int valueToAdd);
725 int fetchAndAddOrdered(int valueToAdd);
726 };
727 template <typename T>
728 class QBasicAtomicPointer
729 {
730 public:
731 T * volatile _q_value;
732 inline bool operator==(T *value) const
733 {
734 return _q_value == value;
735 }
736 inline bool operator!=(T *value) const
737 {
738 return !operator==(value);
739 }
740 inline bool operator!() const
741 {
742 return operator==(0);
743 }
744 inline operator T *() const
745 {
746 return _q_value;
747 }
748 inline T *operator->() const
749 {
750 return _q_value;
751 }
752 inline QBasicAtomicPointer<T> &operator=(T *value)
753 {
754 _q_value = value;
755 return *this;
756 }
757 static bool isTestAndSetNative();
758 static bool isTestAndSetWaitFree();
759 bool testAndSetRelaxed(T *expectedValue, T *newValue);
760 bool testAndSetAcquire(T *expectedValue, T *newValue);
761 bool testAndSetRelease(T *expectedValue, T *newValue);
762 bool testAndSetOrdered(T *expectedValue, T *newValue);
763 static bool isFetchAndStoreNative();
764 static bool isFetchAndStoreWaitFree();
765 T *fetchAndStoreRelaxed(T *newValue);
766 T *fetchAndStoreAcquire(T *newValue);
767 T *fetchAndStoreRelease(T *newValue);
768 T *fetchAndStoreOrdered(T *newValue);
769 static bool isFetchAndAddNative();
770 static bool isFetchAndAddWaitFree();
771 T *fetchAndAddRelaxed(qptrdiff valueToAdd);
772 T *fetchAndAddAcquire(qptrdiff valueToAdd);
773 T *fetchAndAddRelease(qptrdiff valueToAdd);
774 T *fetchAndAddOrdered(qptrdiff valueToAdd);
775 };
776 inline bool QBasicAtomicInt::isReferenceCountingNative()
777 { return false; }
778 inline bool QBasicAtomicInt::isReferenceCountingWaitFree()
779 { return false; }
780 inline bool QBasicAtomicInt::isTestAndSetNative()
781 { return false; }
782 inline bool QBasicAtomicInt::isTestAndSetWaitFree()
783 { return false; }
784 inline bool QBasicAtomicInt::isFetchAndStoreNative()
785 { return false; }
786 inline bool QBasicAtomicInt::isFetchAndStoreWaitFree()
787 { return false; }
788 inline bool QBasicAtomicInt::isFetchAndAddNative()
789 { return false; }
790 inline bool QBasicAtomicInt::isFetchAndAddWaitFree()
791 { return false; }
792 template <typename T>
793 inline bool QBasicAtomicPointer<T>::isTestAndSetNative()
794 { return false; }
795 template <typename T>
796 inline bool QBasicAtomicPointer<T>::isTestAndSetWaitFree()
797 { return false; }
798 template <typename T>
799 inline bool QBasicAtomicPointer<T>::isFetchAndStoreNative()
800 { return false; }
801 template <typename T>
802 inline bool QBasicAtomicPointer<T>::isFetchAndStoreWaitFree()
803 { return false; }
804 template <typename T>
805 inline bool QBasicAtomicPointer<T>::isFetchAndAddNative()
806 { return false; }
807 template <typename T>
808 inline bool QBasicAtomicPointer<T>::isFetchAndAddWaitFree()
809 { return false; }
810 __attribute__((visibility("default"))) bool QBasicAtomicInt_testAndSetOrdered(volatile int *, int, int);
811 __attribute__((visibility("default"))) int QBasicAtomicInt_fetchAndStoreOrdered(volatile int *, int);
812 __attribute__((visibility("default"))) int QBasicAtomicInt_fetchAndAddOrdered(volatile int *, int);
813 __attribute__((visibility("default"))) bool QBasicAtomicPointer_testAndSetOrdered(void * volatile *, void *, void *);
814 __attribute__((visibility("default"))) void *QBasicAtomicPointer_fetchAndStoreOrdered(void * volatile *, void *);
815 __attribute__((visibility("default"))) void *QBasicAtomicPointer_fetchAndAddOrdered(void * volatile *, qptrdiff);
816 inline bool QBasicAtomicInt::ref()
817 {
818 return QBasicAtomicInt_fetchAndAddOrdered(&_q_value, 1) != -1;
819 }
820 inline bool QBasicAtomicInt::deref()
821 {
822 return QBasicAtomicInt_fetchAndAddOrdered(&_q_value, -1) != 1;
823 }
824 inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue)
825 {
826 return QBasicAtomicInt_testAndSetOrdered(&_q_value, expectedValue, newValue);
827 }
828 inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue)
829 {
830 return testAndSetOrdered(expectedValue, newValue);
831 }
832 inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue)
833 {
834 return testAndSetOrdered(expectedValue, newValue);
835 }
836 inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue)
837 {
838 return testAndSetOrdered(expectedValue, newValue);
839 }
840 inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue)
841 {
842 return QBasicAtomicInt_fetchAndStoreOrdered(&_q_value, newValue);
843 }
844 inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue)
845 {
846 return fetchAndStoreOrdered(newValue);
847 }
848 inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue)
849 {
850 return fetchAndStoreOrdered(newValue);
851 }
852 inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue)
853 {
854 return fetchAndStoreOrdered(newValue);
855 }
856 inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd)
857 {
858 return QBasicAtomicInt_fetchAndAddOrdered(&_q_value, valueToAdd);
859 }
860 inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd)
861 {
862 return fetchAndAddOrdered(valueToAdd);
863 }
864 inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd)
865 {
866 return fetchAndAddOrdered(valueToAdd);
867 }
868 inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd)
869 {
870 return fetchAndAddOrdered(valueToAdd);
871 }
872 template <typename T>
873 inline bool QBasicAtomicPointer<T>::testAndSetOrdered(T *expectedValue, T *newValue)
874 {
875 union { T * volatile * typed; void * volatile * voidp; } pointer;
876 pointer.typed = &_q_value;
877 return QBasicAtomicPointer_testAndSetOrdered(pointer.voidp, expectedValue, newValue);
878 }
879 template <typename T>
880 inline bool QBasicAtomicPointer<T>::testAndSetRelaxed(T *expectedValue, T *newValue)
881 {
882 return testAndSetOrdered(expectedValue, newValue);
883 }
884 template <typename T>
885 inline bool QBasicAtomicPointer<T>::testAndSetAcquire(T *expectedValue, T *newValue)
886 {
887 return testAndSetOrdered(expectedValue, newValue);
888 }
889 template <typename T>
890 inline bool QBasicAtomicPointer<T>::testAndSetRelease(T *expectedValue, T *newValue)
891 {
892 return testAndSetOrdered(expectedValue, newValue);
893 }
894 template <typename T>
895 inline T *QBasicAtomicPointer<T>::fetchAndStoreOrdered(T *newValue)
896 {
897 union { T * volatile * typed; void * volatile * voidp; } pointer;
898 union { T *typed; void *voidp; } returnValue;
899 pointer.typed = &_q_value;
900 returnValue.voidp = QBasicAtomicPointer_fetchAndStoreOrdered(pointer.voidp, newValue);
901 return returnValue.typed;
902 }
903 template <typename T>
904 inline T *QBasicAtomicPointer<T>::fetchAndStoreRelaxed(T *newValue)
905 {
906 return fetchAndStoreOrdered(newValue);
907 }
908 template <typename T>
909 inline T *QBasicAtomicPointer<T>::fetchAndStoreAcquire(T *newValue)
910 {
911 return fetchAndStoreOrdered(newValue);
912 }
913 template <typename T>
914 inline T *QBasicAtomicPointer<T>::fetchAndStoreRelease(T *newValue)
915 {
916 return fetchAndStoreOrdered(newValue);
917 }
918 template <typename T>
919 inline T *QBasicAtomicPointer<T>::fetchAndAddOrdered(qptrdiff valueToAdd)
920 {
921 union { T * volatile *typed; void * volatile *voidp; } pointer;
922 union { T *typed; void *voidp; } returnValue;
923 pointer.typed = &_q_value;
924 returnValue.voidp = QBasicAtomicPointer_fetchAndAddOrdered(pointer.voidp, valueToAdd * sizeof(T));
925 return returnValue.typed;
926 }
927 template <typename T>
928 inline T *QBasicAtomicPointer<T>::fetchAndAddRelaxed(qptrdiff valueToAdd)
929 {
930 return fetchAndAddOrdered(valueToAdd);
931 }
932 template <typename T>
933 inline T *QBasicAtomicPointer<T>::fetchAndAddAcquire(qptrdiff valueToAdd)
934 {
935 return fetchAndAddOrdered(valueToAdd);
936 }
937 template <typename T>
938 inline T *QBasicAtomicPointer<T>::fetchAndAddRelease(qptrdiff valueToAdd)
939 {
940 return fetchAndAddOrdered(valueToAdd);
941 }
942 typedef QtValidLicenseForCoreModule QtCoreModule;
943 class __attribute__((visibility("default"))) QAtomicInt : public QBasicAtomicInt
944 {
945 public:
946 inline QAtomicInt(int value = 0)
947 {
948 _q_value = value;
949 }
950 inline QAtomicInt(const QAtomicInt &other)
951 {
952 _q_value = other._q_value;
953 }
954 inline QAtomicInt &operator=(int value)
955 {
956 (void) QBasicAtomicInt::operator=(value);
957 return *this;
958 }
959 inline QAtomicInt &operator=(const QAtomicInt &other)
960 {
961 (void) QBasicAtomicInt::operator=(other);
962 return *this;
963 }
964 };
965 template <typename T>
966 class QAtomicPointer : public QBasicAtomicPointer<T>
967 {
968 public:
969 inline QAtomicPointer(T *value = 0)
970 {
971 QBasicAtomicPointer<T>::_q_value = value;
972 }
973 inline QAtomicPointer(const QAtomicPointer<T> &other)
974 {
975 QBasicAtomicPointer<T>::_q_value = other._q_value;
976 }
977 inline QAtomicPointer<T> &operator=(T *value)
978 {
979 (void) QBasicAtomicPointer<T>::operator=(value);
980 return *this;
981 }
982 inline QAtomicPointer<T> &operator=(const QAtomicPointer<T> &other)
983 {
984 (void) QBasicAtomicPointer<T>::operator=(other);
985 return *this;
986 }
987 };
988 template <typename T>
989 inline void qAtomicAssign(T *&d, T *x)
990 {
991 if (d == x)
992 return;
993 x->ref.ref();
994 if (!d->ref.deref())
995 delete d;
996 d = x;
997 }
998 template <typename T>
999 inline void qAtomicDetach(T *&d)
1000 {
1001 if (d->ref == 1)
1002 return;
1003 T *x = d;
1004 d = new T(*d);
1005 if (!x->ref.deref())
1006 delete x;
1007 }
1008 typedef QtValidLicenseForCoreModule QtCoreModule;
1009 class QString;
1010 struct QLatin1Char
1011 {
1012 public:
1013 inline explicit QLatin1Char(char c) : ch(c) {}
1014 inline char toLatin1() const { return ch; }
1015 inline ushort unicode() const { return ushort(uchar(ch)); }
1016 private:
1017 char ch;
1018 };
1019 class __attribute__((visibility("default"))) QChar {
1020 public:
1021 QChar();
1022 __attribute__ ((__deprecated__)) QChar(char c);
1023 __attribute__ ((__deprecated__)) QChar(uchar c);
1024 QChar(QLatin1Char ch);
1025 QChar(uchar c, uchar r);
1026 inline QChar(ushort rc) : ucs(rc){}
1027 QChar(short rc);
1028 QChar(uint rc);
1029 QChar(int rc);
1030 enum SpecialCharacter {
1031 Null = 0x0000,
1032 Nbsp = 0x00a0,
1033 ReplacementCharacter = 0xfffd,
1034 ObjectReplacementCharacter = 0xfffc,
1035 ByteOrderMark = 0xfeff,
1036 ByteOrderSwapped = 0xfffe,
1037 ParagraphSeparator = 0x2029,
1038 LineSeparator = 0x2028
1039 };
1040 QChar(SpecialCharacter sc);
1041 enum Category
1042 {
1043 NoCategory,
1044 Mark_NonSpacing,
1045 Mark_SpacingCombining,
1046 Mark_Enclosing,
1047 Number_DecimalDigit,
1048 Number_Letter,
1049 Number_Other,
1050 Separator_Space,
1051 Separator_Line,
1052 Separator_Paragraph,
1053 Other_Control,
1054 Other_Format,
1055 Other_Surrogate,
1056 Other_PrivateUse,
1057 Other_NotAssigned,
1058 Letter_Uppercase,
1059 Letter_Lowercase,
1060 Letter_Titlecase,
1061 Letter_Modifier,
1062 Letter_Other,
1063 Punctuation_Connector,
1064 Punctuation_Dash,
1065 Punctuation_Open,
1066 Punctuation_Close,
1067 Punctuation_InitialQuote,
1068 Punctuation_FinalQuote,
1069 Punctuation_Other,
1070 Symbol_Math,
1071 Symbol_Currency,
1072 Symbol_Modifier,
1073 Symbol_Other,
1074 Punctuation_Dask = Punctuation_Dash
1075 };
1076 enum Direction
1077 {
1078 DirL, DirR, DirEN, DirES, DirET, DirAN, DirCS, DirB, DirS, DirWS, DirON,
1079 DirLRE, DirLRO, DirAL, DirRLE, DirRLO, DirPDF, DirNSM, DirBN
1080 };
1081 enum Decomposition
1082 {
1083 NoDecomposition,
1084 Canonical,
1085 Font,
1086 NoBreak,
1087 Initial,
1088 Medial,
1089 Final,
1090 Isolated,
1091 Circle,
1092 Super,
1093 Sub,
1094 Vertical,
1095 Wide,
1096 Narrow,
1097 Small,
1098 Square,
1099 Compat,
1100 Fraction
1101 };
1102 enum Joining
1103 {
1104 OtherJoining, Dual, Right, Center
1105 };
1106 enum CombiningClass
1107 {
1108 Combining_BelowLeftAttached = 200,
1109 Combining_BelowAttached = 202,
1110 Combining_BelowRightAttached = 204,
1111 Combining_LeftAttached = 208,
1112 Combining_RightAttached = 210,
1113 Combining_AboveLeftAttached = 212,
1114 Combining_AboveAttached = 214,
1115 Combining_AboveRightAttached = 216,
1116 Combining_BelowLeft = 218,
1117 Combining_Below = 220,
1118 Combining_BelowRight = 222,
1119 Combining_Left = 224,
1120 Combining_Right = 226,
1121 Combining_AboveLeft = 228,
1122 Combining_Above = 230,
1123 Combining_AboveRight = 232,
1124 Combining_DoubleBelow = 233,
1125 Combining_DoubleAbove = 234,
1126 Combining_IotaSubscript = 240
1127 };
1128 enum UnicodeVersion {
1129 Unicode_Unassigned,
1130 Unicode_1_1,
1131 Unicode_2_0,
1132 Unicode_2_1_2,
1133 Unicode_3_0,
1134 Unicode_3_1,
1135 Unicode_3_2,
1136 Unicode_4_0,
1137 Unicode_4_1,
1138 Unicode_5_0
1139 };
1140 Category category() const;
1141 Direction direction() const;
1142 Joining joining() const;
1143 bool hasMirrored() const;
1144 unsigned char combiningClass() const;
1145 QChar mirroredChar() const;
1146 QString decomposition() const;
1147 Decomposition decompositionTag() const;
1148 int digitValue() const;
1149 QChar toLower() const;
1150 QChar toUpper() const;
1151 QChar toTitleCase() const;
1152 QChar toCaseFolded() const;
1153 UnicodeVersion unicodeVersion() const;
1154 char toAscii() const;
1155 inline char toLatin1() const;
1156 inline ushort unicode() const { return ucs; }
1157 inline ushort &unicode() { return const_cast<ushort&>(ucs); }
1158 static QChar fromAscii(char c);
1159 static QChar fromLatin1(char c);
1160 inline bool isNull() const { return ucs == 0; }
1161 bool isPrint() const;
1162 bool isPunct() const;
1163 bool isSpace() const;
1164 bool isMark() const;
1165 bool isLetter() const;
1166 bool isNumber() const;
1167 bool isLetterOrNumber() const;
1168 bool isDigit() const;
1169 bool isSymbol() const;
1170 inline bool isLower() const { return category() == Letter_Lowercase; }
1171 inline bool isUpper() const { return category() == Letter_Uppercase; }
1172 inline bool isTitleCase() const { return category() == Letter_Titlecase; }
1173 inline bool isHighSurrogate() const {
1174 return ((ucs & 0xfc00) == 0xd800);
1175 }
1176 inline bool isLowSurrogate() const {
1177 return ((ucs & 0xfc00) == 0xdc00);
1178 }
1179 inline uchar cell() const { return uchar(ucs & 0xff); }
1180 inline uchar row() const { return uchar((ucs>>8)&0xff); }
1181 inline void setCell(uchar cell);
1182 inline void setRow(uchar row);
1183 static inline uint surrogateToUcs4(ushort high, ushort low) {
1184 return (uint(high)<<10) + low - 0x35fdc00;
1185 }
1186 static inline uint surrogateToUcs4(QChar high, QChar low) {
1187 return (uint(high.ucs)<<10) + low.ucs - 0x35fdc00;
1188 }
1189 static inline ushort highSurrogate(uint ucs4) {
1190 return (ucs4>>10) + 0xd7c0;
1191 }
1192 static inline ushort lowSurrogate(uint ucs4) {
1193 return ucs4%0x400 + 0xdc00;
1194 }
1195 static Category category(uint ucs4);
1196 static Category category(ushort ucs2);
1197 static Direction direction(uint ucs4);
1198 static Direction direction(ushort ucs2);
1199 static Joining joining(uint ucs4);
1200 static Joining joining(ushort ucs2);
1201 static unsigned char combiningClass(uint ucs4);
1202 static unsigned char combiningClass(ushort ucs2);
1203 static uint mirroredChar(uint ucs4);
1204 static ushort mirroredChar(ushort ucs2);
1205 static Decomposition decompositionTag(uint ucs4);
1206 static int digitValue(uint ucs4);
1207 static int digitValue(ushort ucs2);
1208 static uint toLower(uint ucs4);
1209 static ushort toLower(ushort ucs2);
1210 static uint toUpper(uint ucs4);
1211 static ushort toUpper(ushort ucs2);
1212 static uint toTitleCase(uint ucs4);
1213 static ushort toTitleCase(ushort ucs2);
1214 static uint toCaseFolded(uint ucs4);
1215 static ushort toCaseFolded(ushort ucs2);
1216 static UnicodeVersion unicodeVersion(uint ucs4);
1217 static UnicodeVersion unicodeVersion(ushort ucs2);
1218 static QString decomposition(uint ucs4);
1219 private:
1220 ushort ucs;
1221 }
1222 ;
1223 template <> class QTypeInfo<QChar> { public: enum { isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QChar)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) }; static inline const char *name() { return "QChar"; } };
1224 inline QChar::QChar() : ucs(0) {}
1225 inline char QChar::toLatin1() const { return ucs > 0xff ? '\0' : char(ucs); }
1226 inline QChar QChar::fromLatin1(char c) { return QChar(ushort(uchar(c))); }
1227 inline QChar::QChar(uchar c, uchar r) : ucs((r << 8) | c){}
1228 inline QChar::QChar(short rc) : ucs(ushort(rc)){}
1229 inline QChar::QChar(uint rc) : ucs(ushort(rc & 0xffff)){}
1230 inline QChar::QChar(int rc) : ucs(ushort(rc & 0xffff)){}
1231 inline QChar::QChar(SpecialCharacter s) : ucs(ushort(s)) {}
1232 inline QChar::QChar(QLatin1Char ch) : ucs(ch.unicode()) {}
1233 inline void QChar::setCell(uchar acell)
1234 { ucs = (ucs & 0xff00) + acell; }
1235 inline void QChar::setRow(uchar arow)
1236 { ucs = (ushort(arow)<<8) + (ucs&0xff); }
1237 inline bool operator==(QChar c1, QChar c2) { return c1.unicode() == c2.unicode(); }
1238 inline bool operator!=(QChar c1, QChar c2) { return c1.unicode() != c2.unicode(); }
1239 inline bool operator<=(QChar c1, QChar c2) { return c1.unicode() <= c2.unicode(); }
1240 inline bool operator>=(QChar c1, QChar c2) { return c1.unicode() >= c2.unicode(); }
1241 inline bool operator<(QChar c1, QChar c2) { return c1.unicode() < c2.unicode(); }
1242 inline bool operator>(QChar c1, QChar c2) { return c1.unicode() > c2.unicode(); }
1243 __attribute__((visibility("default"))) QDataStream &operator<<(QDataStream &, const QChar &);
1244 __attribute__((visibility("default"))) QDataStream &operator>>(QDataStream &, QChar &);
1245 namespace std {
1246 struct bidirectional_iterator_tag;
1247 struct random_access_iterator_tag;
1248 }
1249 typedef QtValidLicenseForCoreModule QtCoreModule;
1250 namespace std __attribute__ ((__visibility__ ("default"))) {
1251 }
1252 namespace std __attribute__ ((__visibility__ ("default"))) {
1253 using ::ptrdiff_t;
1254 using ::size_t;
1255 }
1256 namespace std __attribute__ ((__visibility__ ("default"))) {
1257 struct input_iterator_tag {};
1258 struct output_iterator_tag {};
1259 struct forward_iterator_tag : public input_iterator_tag {};
1260 struct bidirectional_iterator_tag : public forward_iterator_tag {};
1261 struct random_access_iterator_tag : public bidirectional_iterator_tag {};
1262 template<typename _Category, typename _Tp, typename _Distance = ptrdiff_t,
1263 typename _Pointer = _Tp*, typename _Reference = _Tp&>
1264 struct iterator
1265 {
1266 typedef _Category iterator_category;
1267 typedef _Tp value_type;
1268 typedef _Distance difference_type;
1269 typedef _Pointer pointer;
1270 typedef _Reference reference;
1271 };
1272 template<typename _Iterator>
1273 struct iterator_traits
1274 {
1275 typedef typename _Iterator::iterator_category iterator_category;
1276 typedef typename _Iterator::value_type value_type;
1277 typedef typename _Iterator::difference_type difference_type;
1278 typedef typename _Iterator::pointer pointer;
1279 typedef typename _Iterator::reference reference;
1280 };
1281 template<typename _Tp>
1282 struct iterator_traits<_Tp*>
1283 {
1284 typedef random_access_iterator_tag iterator_category;
1285 typedef _Tp value_type;
1286 typedef ptrdiff_t difference_type;
1287 typedef _Tp* pointer;
1288 typedef _Tp& reference;
1289 };
1290 template<typename _Tp>
1291 struct iterator_traits<const _Tp*>
1292 {
1293 typedef random_access_iterator_tag iterator_category;
1294 typedef _Tp value_type;
1295 typedef ptrdiff_t difference_type;
1296 typedef const _Tp* pointer;
1297 typedef const _Tp& reference;
1298 };
1299 template<typename _Iter>
1300 inline typename iterator_traits<_Iter>::iterator_category
1301 __iterator_category(const _Iter&)
1302 { return typename iterator_traits<_Iter>::iterator_category(); }
1303 }
1304 namespace std __attribute__ ((__visibility__ ("default"))) {
1305 template<typename _InputIterator>
1306 inline typename iterator_traits<_InputIterator>::difference_type
1307 __distance(_InputIterator __first, _InputIterator __last,
1308 input_iterator_tag)
1309 {
1310 typename iterator_traits<_InputIterator>::difference_type __n = 0;
1311 while (__first != __last)
1312 {
1313 ++__first;
1314 ++__n;
1315 }
1316 return __n;
1317 }
1318 template<typename _RandomAccessIterator>
1319 inline typename iterator_traits<_RandomAccessIterator>::difference_type
1320 __distance(_RandomAccessIterator __first, _RandomAccessIterator __last,
1321 random_access_iterator_tag)
1322 {
1323 return __last - __first;
1324 }
1325 template<typename _InputIterator>
1326 inline typename iterator_traits<_InputIterator>::difference_type
1327 distance(_InputIterator __first, _InputIterator __last)
1328 {
1329 return std::__distance(__first, __last,
1330 std::__iterator_category(__first));
1331 }
1332 template<typename _InputIterator, typename _Distance>
1333 inline void
1334 __advance(_InputIterator& __i, _Distance __n, input_iterator_tag)
1335 {
1336 while (__n--)
1337 ++__i;
1338 }
1339 template<typename _BidirectionalIterator, typename _Distance>
1340 inline void
1341 __advance(_BidirectionalIterator& __i, _Distance __n,
1342 bidirectional_iterator_tag)
1343 {
1344 if (__n > 0)
1345 while (__n--)
1346 ++__i;
1347 else
1348 while (__n++)
1349 --__i;
1350 }
1351 template<typename _RandomAccessIterator, typename _Distance>
1352 inline void
1353 __advance(_RandomAccessIterator& __i, _Distance __n,
1354 random_access_iterator_tag)
1355 {
1356 __i += __n;
1357 }
1358 template<typename _InputIterator, typename _Distance>
1359 inline void
1360 advance(_InputIterator& __i, _Distance __n)
1361 {
1362 typename iterator_traits<_InputIterator>::difference_type __d = __n;
1363 std::__advance(__i, __d, std::__iterator_category(__i));
1364 }
1365 }
1366 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
1367 template<typename _Iterator, typename _Container>
1368 class __normal_iterator;
1369 }
1370 namespace std __attribute__ ((__visibility__ ("default"))) {
1371 struct __true_type { };
1372 struct __false_type { };
1373 template<bool>
1374 struct __truth_type
1375 { typedef __false_type __type; };
1376 template<>
1377 struct __truth_type<true>
1378 { typedef __true_type __type; };
1379 template<class _Sp, class _Tp>
1380 struct __traitor
1381 {
1382 enum { __value = bool(_Sp::__value) || bool(_Tp::__value) };
1383 typedef typename __truth_type<__value>::__type __type;
1384 };
1385 template<class _Sp, class _Tp>
1386 struct __traitand
1387 {
1388 enum { __value = bool(_Sp::__value) && bool(_Tp::__value) };
1389 typedef typename __truth_type<__value>::__type __type;
1390 };
1391 template<typename, typename>
1392 struct __are_same
1393 {
1394 enum { __value = 0 };
1395 typedef __false_type __type;
1396 };
1397 template<typename _Tp>
1398 struct __are_same<_Tp, _Tp>
1399 {
1400 enum { __value = 1 };
1401 typedef __true_type __type;
1402 };
1403 template<typename _Tp>
1404 struct __is_void
1405 {
1406 enum { __value = 0 };
1407 typedef __false_type __type;
1408 };
1409 template<>
1410 struct __is_void<void>
1411 {
1412 enum { __value = 1 };
1413 typedef __true_type __type;
1414 };
1415 template<typename _Tp>
1416 struct __is_integer
1417 {
1418 enum { __value = 0 };
1419 typedef __false_type __type;
1420 };
1421 template<>
1422 struct __is_integer<bool>
1423 {
1424 enum { __value = 1 };
1425 typedef __true_type __type;
1426 };
1427 template<>
1428 struct __is_integer<char>
1429 {
1430 enum { __value = 1 };
1431 typedef __true_type __type;
1432 };
1433 template<>
1434 struct __is_integer<signed char>
1435 {
1436 enum { __value = 1 };
1437 typedef __true_type __type;
1438 };
1439 template<>
1440 struct __is_integer<unsigned char>
1441 {
1442 enum { __value = 1 };
1443 typedef __true_type __type;
1444 };
1445 template<>
1446 struct __is_integer<short>
1447 {
1448 enum { __value = 1 };
1449 typedef __true_type __type;
1450 };
1451 template<>
1452 struct __is_integer<unsigned short>
1453 {
1454 enum { __value = 1 };
1455 typedef __true_type __type;
1456 };
1457 template<>
1458 struct __is_integer<int>
1459 {
1460 enum { __value = 1 };
1461 typedef __true_type __type;
1462 };
1463 template<>
1464 struct __is_integer<unsigned int>
1465 {
1466 enum { __value = 1 };
1467 typedef __true_type __type;
1468 };
1469 template<>
1470 struct __is_integer<long>
1471 {
1472 enum { __value = 1 };
1473 typedef __true_type __type;
1474 };
1475 template<>
1476 struct __is_integer<unsigned long>
1477 {
1478 enum { __value = 1 };
1479 typedef __true_type __type;
1480 };
1481 template<>
1482 struct __is_integer<long long>
1483 {
1484 enum { __value = 1 };
1485 typedef __true_type __type;
1486 };
1487 template<>
1488 struct __is_integer<unsigned long long>
1489 {
1490 enum { __value = 1 };
1491 typedef __true_type __type;
1492 };
1493 template<typename _Tp>
1494 struct __is_floating
1495 {
1496 enum { __value = 0 };
1497 typedef __false_type __type;
1498 };
1499 template<>
1500 struct __is_floating<float>
1501 {
1502 enum { __value = 1 };
1503 typedef __true_type __type;
1504 };
1505 template<>
1506 struct __is_floating<double>
1507 {
1508 enum { __value = 1 };
1509 typedef __true_type __type;
1510 };
1511 template<>
1512 struct __is_floating<long double>
1513 {
1514 enum { __value = 1 };
1515 typedef __true_type __type;
1516 };
1517 template<typename _Tp>
1518 struct __is_pointer
1519 {
1520 enum { __value = 0 };
1521 typedef __false_type __type;
1522 };
1523 template<typename _Tp>
1524 struct __is_pointer<_Tp*>
1525 {
1526 enum { __value = 1 };
1527 typedef __true_type __type;
1528 };
1529 template<typename _Tp>
1530 struct __is_normal_iterator
1531 {
1532 enum { __value = 0 };
1533 typedef __false_type __type;
1534 };
1535 template<typename _Iterator, typename _Container>
1536 struct __is_normal_iterator< __gnu_cxx::__normal_iterator<_Iterator,
1537 _Container> >
1538 {
1539 enum { __value = 1 };
1540 typedef __true_type __type;
1541 };
1542 template<typename _Tp>
1543 struct __is_arithmetic
1544 : public __traitor<__is_integer<_Tp>, __is_floating<_Tp> >
1545 { };
1546 template<typename _Tp>
1547 struct __is_fundamental
1548 : public __traitor<__is_void<_Tp>, __is_arithmetic<_Tp> >
1549 { };
1550 template<typename _Tp>
1551 struct __is_scalar
1552 : public __traitor<__is_arithmetic<_Tp>, __is_pointer<_Tp> >
1553 { };
1554 template<typename _Tp>
1555 struct __is_char
1556 {
1557 enum { __value = 0 };
1558 typedef __false_type __type;
1559 };
1560 template<>
1561 struct __is_char<char>
1562 {
1563 enum { __value = 1 };
1564 typedef __true_type __type;
1565 };
1566 template<typename _Tp>
1567 struct __is_byte
1568 {
1569 enum { __value = 0 };
1570 typedef __false_type __type;
1571 };
1572 template<>
1573 struct __is_byte<char>
1574 {
1575 enum { __value = 1 };
1576 typedef __true_type __type;
1577 };
1578 template<>
1579 struct __is_byte<signed char>
1580 {
1581 enum { __value = 1 };
1582 typedef __true_type __type;
1583 };
1584 template<>
1585 struct __is_byte<unsigned char>
1586 {
1587 enum { __value = 1 };
1588 typedef __true_type __type;
1589 };
1590 template<typename _Tp>
1591 struct __is_move_iterator
1592 {
1593 enum { __value = 0 };
1594 typedef __false_type __type;
1595 };
1596 }
1597 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
1598 template<bool, typename>
1599 struct __enable_if
1600 { };
1601 template<typename _Tp>
1602 struct __enable_if<true, _Tp>
1603 { typedef _Tp __type; };
1604 template<bool _Cond, typename _Iftrue, typename _Iffalse>
1605 struct __conditional_type
1606 { typedef _Iftrue __type; };
1607 template<typename _Iftrue, typename _Iffalse>
1608 struct __conditional_type<false, _Iftrue, _Iffalse>
1609 { typedef _Iffalse __type; };
1610 template<typename _Tp>
1611 struct __add_unsigned
1612 {
1613 private:
1614 typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
1615 public:
1616 typedef typename __if_type::__type __type;
1617 };
1618 template<>
1619 struct __add_unsigned<char>
1620 { typedef unsigned char __type; };
1621 template<>
1622 struct __add_unsigned<signed char>
1623 { typedef unsigned char __type; };
1624 template<>
1625 struct __add_unsigned<short>
1626 { typedef unsigned short __type; };
1627 template<>
1628 struct __add_unsigned<int>
1629 { typedef unsigned int __type; };
1630 template<>
1631 struct __add_unsigned<long>
1632 { typedef unsigned long __type; };
1633 template<>
1634 struct __add_unsigned<long long>
1635 { typedef unsigned long long __type; };
1636 template<>
1637 struct __add_unsigned<bool>;
1638 template<>
1639 struct __add_unsigned<wchar_t>;
1640 template<typename _Tp>
1641 struct __remove_unsigned
1642 {
1643 private:
1644 typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
1645 public:
1646 typedef typename __if_type::__type __type;
1647 };
1648 template<>
1649 struct __remove_unsigned<char>
1650 { typedef signed char __type; };
1651 template<>
1652 struct __remove_unsigned<unsigned char>
1653 { typedef signed char __type; };
1654 template<>
1655 struct __remove_unsigned<unsigned short>
1656 { typedef short __type; };
1657 template<>
1658 struct __remove_unsigned<unsigned int>
1659 { typedef int __type; };
1660 template<>
1661 struct __remove_unsigned<unsigned long>
1662 { typedef long __type; };
1663 template<>
1664 struct __remove_unsigned<unsigned long long>
1665 { typedef long long __type; };
1666 template<>
1667 struct __remove_unsigned<bool>;
1668 template<>
1669 struct __remove_unsigned<wchar_t>;
1670 template<typename _Type>
1671 inline bool
1672 __is_null_pointer(_Type* __ptr)
1673 { return __ptr == 0; }
1674 template<typename _Type>
1675 inline bool
1676 __is_null_pointer(_Type)
1677 { return false; }
1678 template<typename _Tp, bool = std::__is_integer<_Tp>::__value>
1679 struct __promote
1680 { typedef double __type; };
1681 template<typename _Tp>
1682 struct __promote<_Tp, false>
1683 { typedef _Tp __type; };
1684 template<typename _Tp, typename _Up>
1685 struct __promote_2
1686 {
1687 private:
1688 typedef typename __promote<_Tp>::__type __type1;
1689 typedef typename __promote<_Up>::__type __type2;
1690 public:
1691 typedef __typeof__(__type1() + __type2()) __type;
1692 };
1693 template<typename _Tp, typename _Up, typename _Vp>
1694 struct __promote_3
1695 {
1696 private:
1697 typedef typename __promote<_Tp>::__type __type1;
1698 typedef typename __promote<_Up>::__type __type2;
1699 typedef typename __promote<_Vp>::__type __type3;
1700 public:
1701 typedef __typeof__(__type1() + __type2() + __type3()) __type;
1702 };
1703 template<typename _Tp, typename _Up, typename _Vp, typename _Wp>
1704 struct __promote_4
1705 {
1706 private:
1707 typedef typename __promote<_Tp>::__type __type1;
1708 typedef typename __promote<_Up>::__type __type2;
1709 typedef typename __promote<_Vp>::__type __type3;
1710 typedef typename __promote<_Wp>::__type __type4;
1711 public:
1712 typedef __typeof__(__type1() + __type2() + __type3() + __type4()) __type;
1713 };
1714 }
1715 namespace std __attribute__ ((__visibility__ ("default"))) {
1716 template<typename _Tp>
1717 inline void
1718 swap(_Tp& __a, _Tp& __b)
1719 {
1720 _Tp __tmp = (__a);
1721 __a = (__b);
1722 __b = (__tmp);
1723 }
1724 }
1725 namespace std __attribute__ ((__visibility__ ("default"))) {
1726 template<typename _Iterator>
1727 class reverse_iterator
1728 : public iterator<typename iterator_traits<_Iterator>::iterator_category,
1729 typename iterator_traits<_Iterator>::value_type,
1730 typename iterator_traits<_Iterator>::difference_type,
1731 typename iterator_traits<_Iterator>::pointer,
1732 typename iterator_traits<_Iterator>::reference>
1733 {
1734 protected:
1735 _Iterator current;
1736 public:
1737 typedef _Iterator iterator_type;
1738 typedef typename iterator_traits<_Iterator>::difference_type
1739 difference_type;
1740 typedef typename iterator_traits<_Iterator>::reference reference;
1741 typedef typename iterator_traits<_Iterator>::pointer pointer;
1742 public:
1743 reverse_iterator() : current() { }
1744 explicit
1745 reverse_iterator(iterator_type __x) : current(__x) { }
1746 reverse_iterator(const reverse_iterator& __x)
1747 : current(__x.current) { }
1748 template<typename _Iter>
1749 reverse_iterator(const reverse_iterator<_Iter>& __x)
1750 : current(__x.base()) { }
1751 iterator_type
1752 base() const
1753 { return current; }
1754 reference
1755 operator*() const
1756 {
1757 _Iterator __tmp = current;
1758 return *--__tmp;
1759 }
1760 pointer
1761 operator->() const
1762 { return &(operator*()); }
1763 reverse_iterator&
1764 operator++()
1765 {
1766 --current;
1767 return *this;
1768 }
1769 reverse_iterator
1770 operator++(int)
1771 {
1772 reverse_iterator __tmp = *this;
1773 --current;
1774 return __tmp;
1775 }
1776 reverse_iterator&
1777 operator--()
1778 {
1779 ++current;
1780 return *this;
1781 }
1782 reverse_iterator
1783 operator--(int)
1784 {
1785 reverse_iterator __tmp = *this;
1786 ++current;
1787 return __tmp;
1788 }
1789 reverse_iterator
1790 operator+(difference_type __n) const
1791 { return reverse_iterator(current - __n); }
1792 reverse_iterator&
1793 operator+=(difference_type __n)
1794 {
1795 current -= __n;
1796 return *this;
1797 }
1798 reverse_iterator
1799 operator-(difference_type __n) const
1800 { return reverse_iterator(current + __n); }
1801 reverse_iterator&
1802 operator-=(difference_type __n)
1803 {
1804 current += __n;
1805 return *this;
1806 }
1807 reference
1808 operator[](difference_type __n) const
1809 { return *(*this + __n); }
1810 };
1811 template<typename _Iterator>
1812 inline bool
1813 operator==(const reverse_iterator<_Iterator>& __x,
1814 const reverse_iterator<_Iterator>& __y)
1815 { return __x.base() == __y.base(); }
1816 template<typename _Iterator>
1817 inline bool
1818 operator<(const reverse_iterator<_Iterator>& __x,
1819 const reverse_iterator<_Iterator>& __y)
1820 { return __y.base() < __x.base(); }
1821 template<typename _Iterator>
1822 inline bool
1823 operator!=(const reverse_iterator<_Iterator>& __x,
1824 const reverse_iterator<_Iterator>& __y)
1825 { return !(__x == __y); }
1826 template<typename _Iterator>
1827 inline bool
1828 operator>(const reverse_iterator<_Iterator>& __x,
1829 const reverse_iterator<_Iterator>& __y)
1830 { return __y < __x; }
1831 template<typename _Iterator>
1832 inline bool
1833 operator<=(const reverse_iterator<_Iterator>& __x,
1834 const reverse_iterator<_Iterator>& __y)
1835 { return !(__y < __x); }
1836 template<typename _Iterator>
1837 inline bool
1838 operator>=(const reverse_iterator<_Iterator>& __x,
1839 const reverse_iterator<_Iterator>& __y)
1840 { return !(__x < __y); }
1841 template<typename _Iterator>
1842 inline typename reverse_iterator<_Iterator>::difference_type
1843 operator-(const reverse_iterator<_Iterator>& __x,
1844 const reverse_iterator<_Iterator>& __y)
1845 { return __y.base() - __x.base(); }
1846 template<typename _Iterator>
1847 inline reverse_iterator<_Iterator>
1848 operator+(typename reverse_iterator<_Iterator>::difference_type __n,
1849 const reverse_iterator<_Iterator>& __x)
1850 { return reverse_iterator<_Iterator>(__x.base() - __n); }
1851 template<typename _IteratorL, typename _IteratorR>
1852 inline bool
1853 operator==(const reverse_iterator<_IteratorL>& __x,
1854 const reverse_iterator<_IteratorR>& __y)
1855 { return __x.base() == __y.base(); }
1856 template<typename _IteratorL, typename _IteratorR>
1857 inline bool
1858 operator<(const reverse_iterator<_IteratorL>& __x,
1859 const reverse_iterator<_IteratorR>& __y)
1860 { return __y.base() < __x.base(); }
1861 template<typename _IteratorL, typename _IteratorR>
1862 inline bool
1863 operator!=(const reverse_iterator<_IteratorL>& __x,
1864 const reverse_iterator<_IteratorR>& __y)
1865 { return !(__x == __y); }
1866 template<typename _IteratorL, typename _IteratorR>
1867 inline bool
1868 operator>(const reverse_iterator<_IteratorL>& __x,
1869 const reverse_iterator<_IteratorR>& __y)
1870 { return __y < __x; }
1871 template<typename _IteratorL, typename _IteratorR>
1872 inline bool
1873 operator<=(const reverse_iterator<_IteratorL>& __x,
1874 const reverse_iterator<_IteratorR>& __y)
1875 { return !(__y < __x); }
1876 template<typename _IteratorL, typename _IteratorR>
1877 inline bool
1878 operator>=(const reverse_iterator<_IteratorL>& __x,
1879 const reverse_iterator<_IteratorR>& __y)
1880 { return !(__x < __y); }
1881 template<typename _IteratorL, typename _IteratorR>
1882 inline typename reverse_iterator<_IteratorL>::difference_type
1883 operator-(const reverse_iterator<_IteratorL>& __x,
1884 const reverse_iterator<_IteratorR>& __y)
1885 { return __y.base() - __x.base(); }
1886 template<typename _Container>
1887 class back_insert_iterator
1888 : public iterator<output_iterator_tag, void, void, void, void>
1889 {
1890 protected:
1891 _Container* container;
1892 public:
1893 typedef _Container container_type;
1894 explicit
1895 back_insert_iterator(_Container& __x) : container(&__x) { }
1896 back_insert_iterator&
1897 operator=(typename _Container::const_reference __value)
1898 {
1899 container->push_back(__value);
1900 return *this;
1901 }
1902 back_insert_iterator&
1903 operator*()
1904 { return *this; }
1905 back_insert_iterator&
1906 operator++()
1907 { return *this; }
1908 back_insert_iterator
1909 operator++(int)
1910 { return *this; }
1911 };
1912 template<typename _Container>
1913 inline back_insert_iterator<_Container>
1914 back_inserter(_Container& __x)
1915 { return back_insert_iterator<_Container>(__x); }
1916 template<typename _Container>
1917 class front_insert_iterator
1918 : public iterator<output_iterator_tag, void, void, void, void>
1919 {
1920 protected:
1921 _Container* container;
1922 public:
1923 typedef _Container container_type;
1924 explicit front_insert_iterator(_Container& __x) : container(&__x) { }
1925 front_insert_iterator&
1926 operator=(typename _Container::const_reference __value)
1927 {
1928 container->push_front(__value);
1929 return *this;
1930 }
1931 front_insert_iterator&
1932 operator*()
1933 { return *this; }
1934 front_insert_iterator&
1935 operator++()
1936 { return *this; }
1937 front_insert_iterator
1938 operator++(int)
1939 { return *this; }
1940 };
1941 template<typename _Container>
1942 inline front_insert_iterator<_Container>
1943 front_inserter(_Container& __x)
1944 { return front_insert_iterator<_Container>(__x); }
1945 template<typename _Container>
1946 class insert_iterator
1947 : public iterator<output_iterator_tag, void, void, void, void>
1948 {
1949 protected:
1950 _Container* container;
1951 typename _Container::iterator iter;
1952 public:
1953 typedef _Container container_type;
1954 insert_iterator(_Container& __x, typename _Container::iterator __i)
1955 : container(&__x), iter(__i) {}
1956 insert_iterator&
1957 operator=(typename _Container::const_reference __value)
1958 {
1959 iter = container->insert(iter, __value);
1960 ++iter;
1961 return *this;
1962 }
1963 insert_iterator&
1964 operator*()
1965 { return *this; }
1966 insert_iterator&
1967 operator++()
1968 { return *this; }
1969 insert_iterator&
1970 operator++(int)
1971 { return *this; }
1972 };
1973 template<typename _Container, typename _Iterator>
1974 inline insert_iterator<_Container>
1975 inserter(_Container& __x, _Iterator __i)
1976 {
1977 return insert_iterator<_Container>(__x,
1978 typename _Container::iterator(__i));
1979 }
1980 }
1981 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
1982 using std::iterator_traits;
1983 using std::iterator;
1984 template<typename _Iterator, typename _Container>
1985 class __normal_iterator
1986 {
1987 protected:
1988 _Iterator _M_current;
1989 public:
1990 typedef _Iterator iterator_type;
1991 typedef typename iterator_traits<_Iterator>::iterator_category
1992 iterator_category;
1993 typedef typename iterator_traits<_Iterator>::value_type value_type;
1994 typedef typename iterator_traits<_Iterator>::difference_type
1995 difference_type;
1996 typedef typename iterator_traits<_Iterator>::reference reference;
1997 typedef typename iterator_traits<_Iterator>::pointer pointer;
1998 __normal_iterator() : _M_current(_Iterator()) { }
1999 explicit
2000 __normal_iterator(const _Iterator& __i) : _M_current(__i) { }
2001 template<typename _Iter>
2002 __normal_iterator(const __normal_iterator<_Iter,
2003 typename __enable_if<
2004 (std::__are_same<_Iter, typename _Container::pointer>::__value),
2005 _Container>::__type>& __i)
2006 : _M_current(__i.base()) { }
2007 reference
2008 operator*() const
2009 { return *_M_current; }
2010 pointer
2011 operator->() const
2012 { return _M_current; }
2013 __normal_iterator&
2014 operator++()
2015 {
2016 ++_M_current;
2017 return *this;
2018 }
2019 __normal_iterator
2020 operator++(int)
2021 { return __normal_iterator(_M_current++); }
2022 __normal_iterator&
2023 operator--()
2024 {
2025 --_M_current;
2026 return *this;
2027 }
2028 __normal_iterator
2029 operator--(int)
2030 { return __normal_iterator(_M_current--); }
2031 reference
2032 operator[](const difference_type& __n) const
2033 { return _M_current[__n]; }
2034 __normal_iterator&
2035 operator+=(const difference_type& __n)
2036 { _M_current += __n; return *this; }
2037 __normal_iterator
2038 operator+(const difference_type& __n) const
2039 { return __normal_iterator(_M_current + __n); }
2040 __normal_iterator&
2041 operator-=(const difference_type& __n)
2042 { _M_current -= __n; return *this; }
2043 __normal_iterator
2044 operator-(const difference_type& __n) const
2045 { return __normal_iterator(_M_current - __n); }
2046 const _Iterator&
2047 base() const
2048 { return _M_current; }
2049 };
2050 template<typename _IteratorL, typename _IteratorR, typename _Container>
2051 inline bool
2052 operator==(const __normal_iterator<_IteratorL, _Container>& __lhs,
2053 const __normal_iterator<_IteratorR, _Container>& __rhs)
2054 { return __lhs.base() == __rhs.base(); }
2055 template<typename _Iterator, typename _Container>
2056 inline bool
2057 operator==(const __normal_iterator<_Iterator, _Container>& __lhs,
2058 const __normal_iterator<_Iterator, _Container>& __rhs)
2059 { return __lhs.base() == __rhs.base(); }
2060 template<typename _IteratorL, typename _IteratorR, typename _Container>
2061 inline bool
2062 operator!=(const __normal_iterator<_IteratorL, _Container>& __lhs,
2063 const __normal_iterator<_IteratorR, _Container>& __rhs)
2064 { return __lhs.base() != __rhs.base(); }
2065 template<typename _Iterator, typename _Container>
2066 inline bool
2067 operator!=(const __normal_iterator<_Iterator, _Container>& __lhs,
2068 const __normal_iterator<_Iterator, _Container>& __rhs)
2069 { return __lhs.base() != __rhs.base(); }
2070 template<typename _IteratorL, typename _IteratorR, typename _Container>
2071 inline bool
2072 operator<(const __normal_iterator<_IteratorL, _Container>& __lhs,
2073 const __normal_iterator<_IteratorR, _Container>& __rhs)
2074 { return __lhs.base() < __rhs.base(); }
2075 template<typename _Iterator, typename _Container>
2076 inline bool
2077 operator<(const __normal_iterator<_Iterator, _Container>& __lhs,
2078 const __normal_iterator<_Iterator, _Container>& __rhs)
2079 { return __lhs.base() < __rhs.base(); }
2080 template<typename _IteratorL, typename _IteratorR, typename _Container>
2081 inline bool
2082 operator>(const __normal_iterator<_IteratorL, _Container>& __lhs,
2083 const __normal_iterator<_IteratorR, _Container>& __rhs)
2084 { return __lhs.base() > __rhs.base(); }
2085 template<typename _Iterator, typename _Container>
2086 inline bool
2087 operator>(const __normal_iterator<_Iterator, _Container>& __lhs,
2088 const __normal_iterator<_Iterator, _Container>& __rhs)
2089 { return __lhs.base() > __rhs.base(); }
2090 template<typename _IteratorL, typename _IteratorR, typename _Container>
2091 inline bool
2092 operator<=(const __normal_iterator<_IteratorL, _Container>& __lhs,
2093 const __normal_iterator<_IteratorR, _Container>& __rhs)
2094 { return __lhs.base() <= __rhs.base(); }
2095 template<typename _Iterator, typename _Container>
2096 inline bool
2097 operator<=(const __normal_iterator<_Iterator, _Container>& __lhs,
2098 const __normal_iterator<_Iterator, _Container>& __rhs)
2099 { return __lhs.base() <= __rhs.base(); }
2100 template<typename _IteratorL, typename _IteratorR, typename _Container>
2101 inline bool
2102 operator>=(const __normal_iterator<_IteratorL, _Container>& __lhs,
2103 const __normal_iterator<_IteratorR, _Container>& __rhs)
2104 { return __lhs.base() >= __rhs.base(); }
2105 template<typename _Iterator, typename _Container>
2106 inline bool
2107 operator>=(const __normal_iterator<_Iterator, _Container>& __lhs,
2108 const __normal_iterator<_Iterator, _Container>& __rhs)
2109 { return __lhs.base() >= __rhs.base(); }
2110 template<typename _IteratorL, typename _IteratorR, typename _Container>
2111 inline typename __normal_iterator<_IteratorL, _Container>::difference_type
2112 operator-(const __normal_iterator<_IteratorL, _Container>& __lhs,
2113 const __normal_iterator<_IteratorR, _Container>& __rhs)
2114 { return __lhs.base() - __rhs.base(); }
2115 template<typename _Iterator, typename _Container>
2116 inline typename __normal_iterator<_Iterator, _Container>::difference_type
2117 operator-(const __normal_iterator<_Iterator, _Container>& __lhs,
2118 const __normal_iterator<_Iterator, _Container>& __rhs)
2119 { return __lhs.base() - __rhs.base(); }
2120 template<typename _Iterator, typename _Container>
2121 inline __normal_iterator<_Iterator, _Container>
2122 operator+(typename __normal_iterator<_Iterator, _Container>::difference_type
2123 __n, const __normal_iterator<_Iterator, _Container>& __i)
2124 { return __normal_iterator<_Iterator, _Container>(__i.base() + __n); }
2125 }
2126 namespace std __attribute__ ((__visibility__ ("default"))) {
2127 template<typename _Alloc>
2128 class allocator;
2129 template<class _CharT>
2130 struct char_traits;
2131 template<typename _CharT, typename _Traits = char_traits<_CharT>,
2132 typename _Alloc = allocator<_CharT> >
2133 class basic_string;
2134 template<> struct char_traits<char>;
2135 typedef basic_string<char> string;
2136 }
2137 extern "C"
2138 {
2139 typedef struct
2140 {
2141 int __fill[6];
2142 } mbstate_t;
2143 }
2144 namespace std __attribute__ ((__visibility__ ("default"))) {
2145 using ::mbstate_t;
2146 }
2147 typedef signed char int8_t;
2148 typedef short int int16_t;
2149 typedef int int32_t;
2150 __extension__
2151 typedef long long int int64_t;
2152 typedef unsigned char uint8_t;
2153 typedef unsigned short int uint16_t;
2154 typedef unsigned int uint32_t;
2155 __extension__
2156 typedef unsigned long long int uint64_t;
2157 typedef signed char int_least8_t;
2158 typedef short int int_least16_t;
2159 typedef int int_least32_t;
2160 __extension__
2161 typedef long long int int_least64_t;
2162 typedef unsigned char uint_least8_t;
2163 typedef unsigned short int uint_least16_t;
2164 typedef unsigned int uint_least32_t;
2165 __extension__
2166 typedef unsigned long long int uint_least64_t;
2167 typedef signed char int_fast8_t;
2168 typedef int int_fast16_t;
2169 typedef int int_fast32_t;
2170 __extension__
2171 typedef long long int int_fast64_t;
2172 typedef unsigned char uint_fast8_t;
2173 typedef unsigned int uint_fast16_t;
2174 typedef unsigned int uint_fast32_t;
2175 __extension__
2176 typedef unsigned long long int uint_fast64_t;
2177 typedef int intptr_t;
2178 typedef unsigned int uintptr_t;
2179 __extension__
2180 typedef long long int intmax_t;
2181 __extension__
2182 typedef unsigned long long int uintmax_t;
2183 namespace std __attribute__ ((__visibility__ ("default"))) {
2184 typedef int64_t streamoff;
2185 typedef ptrdiff_t streamsize;
2186 template<typename _StateT>
2187 class fpos
2188 {
2189 private:
2190 streamoff _M_off;
2191 _StateT _M_state;
2192 public:
2193 fpos()
2194 : _M_off(0), _M_state() { }
2195 fpos(streamoff __off)
2196 : _M_off(__off), _M_state() { }
2197 operator streamoff() const { return _M_off; }
2198 void
2199 state(_StateT __st)
2200 { _M_state = __st; }
2201 _StateT
2202 state() const
2203 { return _M_state; }
2204 fpos&
2205 operator+=(streamoff __off)
2206 {
2207 _M_off += __off;
2208 return *this;
2209 }
2210 fpos&
2211 operator-=(streamoff __off)
2212 {
2213 _M_off -= __off;
2214 return *this;
2215 }
2216 fpos
2217 operator+(streamoff __off) const
2218 {
2219 fpos __pos(*this);
2220 __pos += __off;
2221 return __pos;
2222 }
2223 fpos
2224 operator-(streamoff __off) const
2225 {
2226 fpos __pos(*this);
2227 __pos -= __off;
2228 return __pos;
2229 }
2230 streamoff
2231 operator-(const fpos& __other) const
2232 { return _M_off - __other._M_off; }
2233 };
2234 template<typename _StateT>
2235 inline bool
2236 operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
2237 { return streamoff(__lhs) == streamoff(__rhs); }
2238 template<typename _StateT>
2239 inline bool
2240 operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
2241 { return streamoff(__lhs) != streamoff(__rhs); }
2242 typedef fpos<mbstate_t> streampos;
2243 typedef fpos<mbstate_t> wstreampos;
2244 }
2245 namespace std __attribute__ ((__visibility__ ("default"))) {
2246 template<typename _CharT, typename _Traits = char_traits<_CharT> >
2247 class basic_ios;
2248 template<typename _CharT, typename _Traits = char_traits<_CharT> >
2249 class basic_streambuf;
2250 template<typename _CharT, typename _Traits = char_traits<_CharT> >
2251 class basic_istream;
2252 template<typename _CharT, typename _Traits = char_traits<_CharT> >
2253 class basic_ostream;
2254 template<typename _CharT, typename _Traits = char_traits<_CharT> >
2255 class basic_iostream;
2256 template<typename _CharT, typename _Traits = char_traits<_CharT>,
2257 typename _Alloc = allocator<_CharT> >
2258 class basic_stringbuf;
2259 template<typename _CharT, typename _Traits = char_traits<_CharT>,
2260 typename _Alloc = allocator<_CharT> >
2261 class basic_istringstream;
2262 template<typename _CharT, typename _Traits = char_traits<_CharT>,
2263 typename _Alloc = allocator<_CharT> >
2264 class basic_ostringstream;
2265 template<typename _CharT, typename _Traits = char_traits<_CharT>,
2266 typename _Alloc = allocator<_CharT> >
2267 class basic_stringstream;
2268 template<typename _CharT, typename _Traits = char_traits<_CharT> >
2269 class basic_filebuf;
2270 template<typename _CharT, typename _Traits = char_traits<_CharT> >
2271 class basic_ifstream;
2272 template<typename _CharT, typename _Traits = char_traits<_CharT> >
2273 class basic_ofstream;
2274 template<typename _CharT, typename _Traits = char_traits<_CharT> >
2275 class basic_fstream;
2276 template<typename _CharT, typename _Traits = char_traits<_CharT> >
2277 class istreambuf_iterator;
2278 template<typename _CharT, typename _Traits = char_traits<_CharT> >
2279 class ostreambuf_iterator;
2280 class ios_base;
2281 typedef basic_ios<char> ios;
2282 typedef basic_streambuf<char> streambuf;
2283 typedef basic_istream<char> istream;
2284 typedef basic_ostream<char> ostream;
2285 typedef basic_iostream<char> iostream;
2286 typedef basic_stringbuf<char> stringbuf;
2287 typedef basic_istringstream<char> istringstream;
2288 typedef basic_ostringstream<char> ostringstream;
2289 typedef basic_stringstream<char> stringstream;
2290 typedef basic_filebuf<char> filebuf;
2291 typedef basic_ifstream<char> ifstream;
2292 typedef basic_ofstream<char> ofstream;
2293 typedef basic_fstream<char> fstream;
2294 }
2295 extern "C++" {
2296 namespace std
2297 {
2298 class exception
2299 {
2300 public:
2301 exception() throw() { }
2302 virtual ~exception() throw();
2303 virtual const char* what() const throw();
2304 };
2305 class bad_exception : public exception
2306 {
2307 public:
2308 bad_exception() throw() { }
2309 virtual ~bad_exception() throw();
2310 virtual const char* what() const throw();
2311 };
2312 typedef void (*terminate_handler) ();
2313 typedef void (*unexpected_handler) ();
2314 terminate_handler set_terminate(terminate_handler) throw();
2315 void terminate() __attribute__ ((__noreturn__));
2316 unexpected_handler set_unexpected(unexpected_handler) throw();
2317 void unexpected() __attribute__ ((__noreturn__));
2318 bool uncaught_exception() throw();
2319 }
2320 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
2321 void __verbose_terminate_handler ();
2322 }
2323 }
2324 namespace std __attribute__ ((__visibility__ ("default"))) {
2325 void
2326 __throw_bad_exception(void) __attribute__((__noreturn__));
2327 void
2328 __throw_bad_alloc(void) __attribute__((__noreturn__));
2329 void
2330 __throw_bad_cast(void) __attribute__((__noreturn__));
2331 void
2332 __throw_bad_typeid(void) __attribute__((__noreturn__));
2333 void
2334 __throw_logic_error(const char*) __attribute__((__noreturn__));
2335 void
2336 __throw_domain_error(const char*) __attribute__((__noreturn__));
2337 void
2338 __throw_invalid_argument(const char*) __attribute__((__noreturn__));
2339 void
2340 __throw_length_error(const char*) __attribute__((__noreturn__));
2341 void
2342 __throw_out_of_range(const char*) __attribute__((__noreturn__));
2343 void
2344 __throw_runtime_error(const char*) __attribute__((__noreturn__));
2345 void
2346 __throw_range_error(const char*) __attribute__((__noreturn__));
2347 void
2348 __throw_overflow_error(const char*) __attribute__((__noreturn__));
2349 void
2350 __throw_underflow_error(const char*) __attribute__((__noreturn__));
2351 void
2352 __throw_ios_failure(const char*) __attribute__((__noreturn__));
2353 }
2354 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
2355 template<typename _Value>
2356 struct __numeric_traits_integer
2357 {
2358 static const _Value __min = (((_Value)(-1) < 0) ? (_Value)1 << (sizeof(_Value) * 8 - ((_Value)(-1) < 0)) : (_Value)0);
2359 static const _Value __max = (((_Value)(-1) < 0) ? (((((_Value)1 << ((sizeof(_Value) * 8 - ((_Value)(-1) < 0)) - 1)) - 1) << 1) + 1) : ~(_Value)0);
2360 static const bool __is_signed = ((_Value)(-1) < 0);
2361 static const int __digits = (sizeof(_Value) * 8 - ((_Value)(-1) < 0));
2362 };
2363 template<typename _Value>
2364 const _Value __numeric_traits_integer<_Value>::__min;
2365 template<typename _Value>
2366 const _Value __numeric_traits_integer<_Value>::__max;
2367 template<typename _Value>
2368 const bool __numeric_traits_integer<_Value>::__is_signed;
2369 template<typename _Value>
2370 const int __numeric_traits_integer<_Value>::__digits;
2371 template<typename _Value>
2372 struct __numeric_traits_floating
2373 {
2374 static const int __max_digits10 = (2 + (std::__are_same<_Value, float>::__value ? 24 : std::__are_same<_Value, double>::__value ? 53 : 53) * 3010 / 10000);
2375 static const bool __is_signed = true;
2376 static const int __digits10 = (std::__are_same<_Value, float>::__value ? 6 : std::__are_same<_Value, double>::__value ? 15 : 15);
2377 static const int __max_exponent10 = (std::__are_same<_Value, float>::__value ? 38 : std::__are_same<_Value, double>::__value ? 308 : 308);
2378 };
2379 template<typename _Value>
2380 const int __numeric_traits_floating<_Value>::__max_digits10;
2381 template<typename _Value>
2382 const bool __numeric_traits_floating<_Value>::__is_signed;
2383 template<typename _Value>
2384 const int __numeric_traits_floating<_Value>::__digits10;
2385 template<typename _Value>
2386 const int __numeric_traits_floating<_Value>::__max_exponent10;
2387 template<typename _Value>
2388 struct __numeric_traits
2389 : public __conditional_type<std::__is_integer<_Value>::__value,
2390 __numeric_traits_integer<_Value>,
2391 __numeric_traits_floating<_Value> >::__type
2392 { };
2393 }
2394 namespace std __attribute__ ((__visibility__ ("default"))) {
2395 template<class _T1, class _T2>
2396 struct pair
2397 {
2398 typedef _T1 first_type;
2399 typedef _T2 second_type;
2400 _T1 first;
2401 _T2 second;
2402 pair()
2403 : first(), second() { }
2404 pair(const _T1& __a, const _T2& __b)
2405 : first(__a), second(__b) { }
2406 template<class _U1, class _U2>
2407 pair(const pair<_U1, _U2>& __p)
2408 : first(__p.first),
2409 second(__p.second) { }
2410 };
2411 template<class _T1, class _T2>
2412 inline bool
2413 operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
2414 { return __x.first == __y.first && __x.second == __y.second; }
2415 template<class _T1, class _T2>
2416 inline bool
2417 operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
2418 { return __x.first < __y.first
2419 || (!(__y.first < __x.first) && __x.second < __y.second); }
2420 template<class _T1, class _T2>
2421 inline bool
2422 operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
2423 { return !(__x == __y); }
2424 template<class _T1, class _T2>
2425 inline bool
2426 operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
2427 { return __y < __x; }
2428 template<class _T1, class _T2>
2429 inline bool
2430 operator<=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
2431 { return !(__y < __x); }
2432 template<class _T1, class _T2>
2433 inline bool
2434 operator>=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
2435 { return !(__x < __y); }
2436 template<class _T1, class _T2>
2437 inline pair<_T1, _T2>
2438 make_pair(_T1 __x, _T2 __y)
2439 { return pair<_T1, _T2>(__x, __y); }
2440 }
2441 namespace std
2442 {
2443 namespace __debug { }
2444 }
2445 namespace __gnu_debug
2446 {
2447 using namespace std::__debug;
2448 }
2449 namespace std __attribute__ ((__visibility__ ("default"))) {
2450 template<bool _BoolType>
2451 struct __iter_swap
2452 {
2453 template<typename _ForwardIterator1, typename _ForwardIterator2>
2454 static void
2455 iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
2456 {
2457 typedef typename iterator_traits<_ForwardIterator1>::value_type
2458 _ValueType1;
2459 _ValueType1 __tmp = (*__a);
2460 *__a = (*__b);
2461 *__b = (__tmp);
2462 }
2463 };
2464 template<>
2465 struct __iter_swap<true>
2466 {
2467 template<typename _ForwardIterator1, typename _ForwardIterator2>
2468 static void
2469 iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
2470 {
2471 swap(*__a, *__b);
2472 }
2473 };
2474 template<typename _ForwardIterator1, typename _ForwardIterator2>
2475 inline void
2476 iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
2477 {
2478 typedef typename iterator_traits<_ForwardIterator1>::value_type
2479 _ValueType1;
2480 typedef typename iterator_traits<_ForwardIterator2>::value_type
2481 _ValueType2;
2482 typedef typename iterator_traits<_ForwardIterator1>::reference
2483 _ReferenceType1;
2484 typedef typename iterator_traits<_ForwardIterator2>::reference
2485 _ReferenceType2;
2486 std::__iter_swap<__are_same<_ValueType1, _ValueType2>::__value
2487 && __are_same<_ValueType1&, _ReferenceType1>::__value
2488 && __are_same<_ValueType2&, _ReferenceType2>::__value>::
2489 iter_swap(__a, __b);
2490 }
2491 template<typename _ForwardIterator1, typename _ForwardIterator2>
2492 _ForwardIterator2
2493 swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
2494 _ForwardIterator2 __first2)
2495 {
2496 ;
2497 for (; __first1 != __last1; ++__first1, ++__first2)
2498 std::iter_swap(__first1, __first2);
2499 return __first2;
2500 }
2501 template<typename _Tp>
2502 inline const _Tp&
2503 min(const _Tp& __a, const _Tp& __b)
2504 {
2505 if (__b < __a)
2506 return __b;
2507 return __a;
2508 }
2509 template<typename _Tp>
2510 inline const _Tp&
2511 max(const _Tp& __a, const _Tp& __b)
2512 {
2513 if (__a < __b)
2514 return __b;
2515 return __a;
2516 }
2517 template<typename _Tp, typename _Compare>
2518 inline const _Tp&
2519 min(const _Tp& __a, const _Tp& __b, _Compare __comp)
2520 {
2521 if (__comp(__b, __a))
2522 return __b;
2523 return __a;
2524 }
2525 template<typename _Tp, typename _Compare>
2526 inline const _Tp&
2527 max(const _Tp& __a, const _Tp& __b, _Compare __comp)
2528 {
2529 if (__comp(__a, __b))
2530 return __b;
2531 return __a;
2532 }
2533 template<typename _Iterator,
2534 bool _IsNormal = __is_normal_iterator<_Iterator>::__value>
2535 struct __niter_base
2536 {
2537 static _Iterator
2538 __b(_Iterator __it)
2539 { return __it; }
2540 };
2541 template<typename _Iterator>
2542 struct __niter_base<_Iterator, true>
2543 {
2544 static typename _Iterator::iterator_type
2545 __b(_Iterator __it)
2546 { return __it.base(); }
2547 };
2548 template<typename _Iterator,
2549 bool _IsMove = __is_move_iterator<_Iterator>::__value>
2550 struct __miter_base
2551 {
2552 static _Iterator
2553 __b(_Iterator __it)
2554 { return __it; }
2555 };
2556 template<typename _Iterator>
2557 struct __miter_base<_Iterator, true>
2558 {
2559 static typename _Iterator::iterator_type
2560 __b(_Iterator __it)
2561 { return __it.base(); }
2562 };
2563 template<bool, bool, typename>
2564 struct __copy_move
2565 {
2566 template<typename _II, typename _OI>
2567 static _OI
2568 __copy_m(_II __first, _II __last, _OI __result)
2569 {
2570 for (; __first != __last; ++__result, ++__first)
2571 *__result = *__first;
2572 return __result;
2573 }
2574 };
2575 template<>
2576 struct __copy_move<false, false, random_access_iterator_tag>
2577 {
2578 template<typename _II, typename _OI>
2579 static _OI
2580 __copy_m(_II __first, _II __last, _OI __result)
2581 {
2582 typedef typename iterator_traits<_II>::difference_type _Distance;
2583 for(_Distance __n = __last - __first; __n > 0; --__n)
2584 {
2585 *__result = *__first;
2586 ++__first;
2587 ++__result;
2588 }
2589 return __result;
2590 }
2591 };
2592 template<bool _IsMove>
2593 struct __copy_move<_IsMove, true, random_access_iterator_tag>
2594 {
2595 template<typename _Tp>
2596 static _Tp*
2597 __copy_m(const _Tp* __first, const _Tp* __last, _Tp* __result)
2598 {
2599 __builtin_memmove(__result, __first,
2600 sizeof(_Tp) * (__last - __first));
2601 return __result + (__last - __first);
2602 }
2603 };
2604 template<bool _IsMove, typename _II, typename _OI>
2605 inline _OI
2606 __copy_move_a(_II __first, _II __last, _OI __result)
2607 {
2608 typedef typename iterator_traits<_II>::value_type _ValueTypeI;
2609 typedef typename iterator_traits<_OI>::value_type _ValueTypeO;
2610 typedef typename iterator_traits<_II>::iterator_category _Category;
2611 const bool __simple = (__is_pod(_ValueTypeI)
2612 && __is_pointer<_II>::__value
2613 && __is_pointer<_OI>::__value
2614 && __are_same<_ValueTypeI, _ValueTypeO>::__value);
2615 return std::__copy_move<_IsMove, __simple,
2616 _Category>::__copy_m(__first, __last, __result);
2617 }
2618 template<typename _CharT>
2619 struct char_traits;
2620 template<typename _CharT, typename _Traits>
2621 class istreambuf_iterator;
2622 template<typename _CharT, typename _Traits>
2623 class ostreambuf_iterator;
2624 template<bool _IsMove, typename _CharT>
2625 typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
2626 ostreambuf_iterator<_CharT, char_traits<_CharT> > >::__type
2627 __copy_move_a2(_CharT*, _CharT*,
2628 ostreambuf_iterator<_CharT, char_traits<_CharT> >);
2629 template<bool _IsMove, typename _CharT>
2630 typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
2631 ostreambuf_iterator<_CharT, char_traits<_CharT> > >::__type
2632 __copy_move_a2(const _CharT*, const _CharT*,
2633 ostreambuf_iterator<_CharT, char_traits<_CharT> >);
2634 template<bool _IsMove, typename _CharT>
2635 typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
2636 _CharT*>::__type
2637 __copy_move_a2(istreambuf_iterator<_CharT, char_traits<_CharT> >,
2638 istreambuf_iterator<_CharT, char_traits<_CharT> >, _CharT*);
2639 template<bool _IsMove, typename _II, typename _OI>
2640 inline _OI
2641 __copy_move_a2(_II __first, _II __last, _OI __result)
2642 {
2643 return _OI(std::__copy_move_a<_IsMove>
2644 (std::__niter_base<_II>::__b(__first),
2645 std::__niter_base<_II>::__b(__last),
2646 std::__niter_base<_OI>::__b(__result)));
2647 }
2648 template<typename _II, typename _OI>
2649 inline _OI
2650 copy(_II __first, _II __last, _OI __result)
2651 {
2652 ;
2653 return (std::__copy_move_a2<__is_move_iterator<_II>::__value>
2654 (std::__miter_base<_II>::__b(__first),
2655 std::__miter_base<_II>::__b(__last), __result));
2656 }
2657 template<bool, bool, typename>
2658 struct __copy_move_backward
2659 {
2660 template<typename _BI1, typename _BI2>
2661 static _BI2
2662 __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
2663 {
2664 while (__first != __last)
2665 *--__result = *--__last;
2666 return __result;
2667 }
2668 };
2669 template<>
2670 struct __copy_move_backward<false, false, random_access_iterator_tag>
2671 {
2672 template<typename _BI1, typename _BI2>
2673 static _BI2
2674 __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
2675 {
2676 typename iterator_traits<_BI1>::difference_type __n;
2677 for (__n = __last - __first; __n > 0; --__n)
2678 *--__result = *--__last;
2679 return __result;
2680 }
2681 };
2682 template<bool _IsMove>
2683 struct __copy_move_backward<_IsMove, true, random_access_iterator_tag>
2684 {
2685 template<typename _Tp>
2686 static _Tp*
2687 __copy_move_b(const _Tp* __first, const _Tp* __last, _Tp* __result)
2688 {
2689 const ptrdiff_t _Num = __last - __first;
2690 __builtin_memmove(__result - _Num, __first, sizeof(_Tp) * _Num);
2691 return __result - _Num;
2692 }
2693 };
2694 template<bool _IsMove, typename _BI1, typename _BI2>
2695 inline _BI2
2696 __copy_move_backward_a(_BI1 __first, _BI1 __last, _BI2 __result)
2697 {
2698 typedef typename iterator_traits<_BI1>::value_type _ValueType1;
2699 typedef typename iterator_traits<_BI2>::value_type _ValueType2;
2700 typedef typename iterator_traits<_BI1>::iterator_category _Category;
2701 const bool __simple = (__is_pod(_ValueType1)
2702 && __is_pointer<_BI1>::__value
2703 && __is_pointer<_BI2>::__value
2704 && __are_same<_ValueType1, _ValueType2>::__value);
2705 return std::__copy_move_backward<_IsMove, __simple,
2706 _Category>::__copy_move_b(__first,
2707 __last,
2708 __result);
2709 }
2710 template<bool _IsMove, typename _BI1, typename _BI2>
2711 inline _BI2
2712 __copy_move_backward_a2(_BI1 __first, _BI1 __last, _BI2 __result)
2713 {
2714 return _BI2(std::__copy_move_backward_a<_IsMove>
2715 (std::__niter_base<_BI1>::__b(__first),
2716 std::__niter_base<_BI1>::__b(__last),
2717 std::__niter_base<_BI2>::__b(__result)));
2718 }
2719 template<typename _BI1, typename _BI2>
2720 inline _BI2
2721 copy_backward(_BI1 __first, _BI1 __last, _BI2 __result)
2722 {
2723 ;
2724 return (std::__copy_move_backward_a2<__is_move_iterator<_BI1>::__value>
2725 (std::__miter_base<_BI1>::__b(__first),
2726 std::__miter_base<_BI1>::__b(__last), __result));
2727 }
2728 template<typename _ForwardIterator, typename _Tp>
2729 inline typename
2730 __gnu_cxx::__enable_if<!__is_scalar<_Tp>::__value, void>::__type
2731 __fill_a(_ForwardIterator __first, _ForwardIterator __last,
2732 const _Tp& __value)
2733 {
2734 for (; __first != __last; ++__first)
2735 *__first = __value;
2736 }
2737 template<typename _ForwardIterator, typename _Tp>
2738 inline typename
2739 __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, void>::__type
2740 __fill_a(_ForwardIterator __first, _ForwardIterator __last,
2741 const _Tp& __value)
2742 {
2743 const _Tp __tmp = __value;
2744 for (; __first != __last; ++__first)
2745 *__first = __tmp;
2746 }
2747 template<typename _Tp>
2748 inline typename
2749 __gnu_cxx::__enable_if<__is_byte<_Tp>::__value, void>::__type
2750 __fill_a(_Tp* __first, _Tp* __last, const _Tp& __c)
2751 {
2752 const _Tp __tmp = __c;
2753 __builtin_memset(__first, static_cast<unsigned char>(__tmp),
2754 __last - __first);
2755 }
2756 template<typename _ForwardIterator, typename _Tp>
2757 inline void
2758 fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
2759 {
2760 ;
2761 std::__fill_a(std::__niter_base<_ForwardIterator>::__b(__first),
2762 std::__niter_base<_ForwardIterator>::__b(__last), __value);
2763 }
2764 template<typename _OutputIterator, typename _Size, typename _Tp>
2765 inline typename
2766 __gnu_cxx::__enable_if<!__is_scalar<_Tp>::__value, _OutputIterator>::__type
2767 __fill_n_a(_OutputIterator __first, _Size __n, const _Tp& __value)
2768 {
2769 for (; __n > 0; --__n, ++__first)
2770 *__first = __value;
2771 return __first;
2772 }
2773 template<typename _OutputIterator, typename _Size, typename _Tp>
2774 inline typename
2775 __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, _OutputIterator>::__type
2776 __fill_n_a(_OutputIterator __first, _Size __n, const _Tp& __value)
2777 {
2778 const _Tp __tmp = __value;
2779 for (; __n > 0; --__n, ++__first)
2780 *__first = __tmp;
2781 return __first;
2782 }
2783 template<typename _Size, typename _Tp>
2784 inline typename
2785 __gnu_cxx::__enable_if<__is_byte<_Tp>::__value, _Tp*>::__type
2786 __fill_n_a(_Tp* __first, _Size __n, const _Tp& __c)
2787 {
2788 std::__fill_a(__first, __first + __n, __c);
2789 return __first + __n;
2790 }
2791 template<typename _OI, typename _Size, typename _Tp>
2792 inline _OI
2793 fill_n(_OI __first, _Size __n, const _Tp& __value)
2794 {
2795 return _OI(std::__fill_n_a(std::__niter_base<_OI>::__b(__first),
2796 __n, __value));
2797 }
2798 template<bool _BoolType>
2799 struct __equal
2800 {
2801 template<typename _II1, typename _II2>
2802 static bool
2803 equal(_II1 __first1, _II1 __last1, _II2 __first2)
2804 {
2805 for (; __first1 != __last1; ++__first1, ++__first2)
2806 if (!(*__first1 == *__first2))
2807 return false;
2808 return true;
2809 }
2810 };
2811 template<>
2812 struct __equal<true>
2813 {
2814 template<typename _Tp>
2815 static bool
2816 equal(const _Tp* __first1, const _Tp* __last1, const _Tp* __first2)
2817 {
2818 return !__builtin_memcmp(__first1, __first2, sizeof(_Tp)
2819 * (__last1 - __first1));
2820 }
2821 };
2822 template<typename _II1, typename _II2>
2823 inline bool
2824 __equal_aux(_II1 __first1, _II1 __last1, _II2 __first2)
2825 {
2826 typedef typename iterator_traits<_II1>::value_type _ValueType1;
2827 typedef typename iterator_traits<_II2>::value_type _ValueType2;
2828 const bool __simple = (__is_integer<_ValueType1>::__value
2829 && __is_pointer<_II1>::__value
2830 && __is_pointer<_II2>::__value
2831 && __are_same<_ValueType1, _ValueType2>::__value);
2832 return std::__equal<__simple>::equal(__first1, __last1, __first2);
2833 }
2834 template<typename, typename>
2835 struct __lc_rai
2836 {
2837 template<typename _II1, typename _II2>
2838 static _II1
2839 __newlast1(_II1, _II1 __last1, _II2, _II2)
2840 { return __last1; }
2841 template<typename _II>
2842 static bool
2843 __cnd2(_II __first, _II __last)
2844 { return __first != __last; }
2845 };
2846 template<>
2847 struct __lc_rai<random_access_iterator_tag, random_access_iterator_tag>
2848 {
2849 template<typename _RAI1, typename _RAI2>
2850 static _RAI1
2851 __newlast1(_RAI1 __first1, _RAI1 __last1,
2852 _RAI2 __first2, _RAI2 __last2)
2853 {
2854 const typename iterator_traits<_RAI1>::difference_type
2855 __diff1 = __last1 - __first1;
2856 const typename iterator_traits<_RAI2>::difference_type
2857 __diff2 = __last2 - __first2;
2858 return __diff2 < __diff1 ? __first1 + __diff2 : __last1;
2859 }
2860 template<typename _RAI>
2861 static bool
2862 __cnd2(_RAI, _RAI)
2863 { return true; }
2864 };
2865 template<bool _BoolType>
2866 struct __lexicographical_compare
2867 {
2868 template<typename _II1, typename _II2>
2869 static bool __lc(_II1, _II1, _II2, _II2);
2870 };
2871 template<bool _BoolType>
2872 template<typename _II1, typename _II2>
2873 bool
2874 __lexicographical_compare<_BoolType>::
2875 __lc(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2)
2876 {
2877 typedef typename iterator_traits<_II1>::iterator_category _Category1;
2878 typedef typename iterator_traits<_II2>::iterator_category _Category2;
2879 typedef std::__lc_rai<_Category1, _Category2> __rai_type;
2880 __last1 = __rai_type::__newlast1(__first1, __last1,
2881 __first2, __last2);
2882 for (; __first1 != __last1 && __rai_type::__cnd2(__first2, __last2);
2883 ++__first1, ++__first2)
2884 {
2885 if (*__first1 < *__first2)
2886 return true;
2887 if (*__first2 < *__first1)
2888 return false;
2889 }
2890 return __first1 == __last1 && __first2 != __last2;
2891 }
2892 template<>
2893 struct __lexicographical_compare<true>
2894 {
2895 template<typename _Tp, typename _Up>
2896 static bool
2897 __lc(const _Tp* __first1, const _Tp* __last1,
2898 const _Up* __first2, const _Up* __last2)
2899 {
2900 const size_t __len1 = __last1 - __first1;
2901 const size_t __len2 = __last2 - __first2;
2902 const int __result = __builtin_memcmp(__first1, __first2,
2903 std::min(__len1, __len2));
2904 return __result != 0 ? __result < 0 : __len1 < __len2;
2905 }
2906 };
2907 template<typename _II1, typename _II2>
2908 inline bool
2909 __lexicographical_compare_aux(_II1 __first1, _II1 __last1,
2910 _II2 __first2, _II2 __last2)
2911 {
2912 typedef typename iterator_traits<_II1>::value_type _ValueType1;
2913 typedef typename iterator_traits<_II2>::value_type _ValueType2;
2914 const bool __simple =
2915 (__is_byte<_ValueType1>::__value && __is_byte<_ValueType2>::__value
2916 && !__gnu_cxx::__numeric_traits<_ValueType1>::__is_signed
2917 && !__gnu_cxx::__numeric_traits<_ValueType2>::__is_signed
2918 && __is_pointer<_II1>::__value
2919 && __is_pointer<_II2>::__value);
2920 return std::__lexicographical_compare<__simple>::__lc(__first1, __last1,
2921 __first2, __last2);
2922 }
2923 }
2924 namespace std __attribute__ ((__visibility__ ("default"))) {
2925 template<typename _II1, typename _II2>
2926 inline bool
2927 equal(_II1 __first1, _II1 __last1, _II2 __first2)
2928 {
2929 ;
2930 return std::__equal_aux(std::__niter_base<_II1>::__b(__first1),
2931 std::__niter_base<_II1>::__b(__last1),
2932 std::__niter_base<_II2>::__b(__first2));
2933 }
2934 template<typename _IIter1, typename _IIter2, typename _BinaryPredicate>
2935 inline bool
2936 equal(_IIter1 __first1, _IIter1 __last1,
2937 _IIter2 __first2, _BinaryPredicate __binary_pred)
2938 {
2939 ;
2940 for (; __first1 != __last1; ++__first1, ++__first2)
2941 if (!bool(__binary_pred(*__first1, *__first2)))
2942 return false;
2943 return true;
2944 }
2945 template<typename _II1, typename _II2>
2946 inline bool
2947 lexicographical_compare(_II1 __first1, _II1 __last1,
2948 _II2 __first2, _II2 __last2)
2949 {
2950 typedef typename iterator_traits<_II1>::value_type _ValueType1;
2951 typedef typename iterator_traits<_II2>::value_type _ValueType2;
2952 ;
2953 ;
2954 return std::__lexicographical_compare_aux
2955 (std::__niter_base<_II1>::__b(__first1),
2956 std::__niter_base<_II1>::__b(__last1),
2957 std::__niter_base<_II2>::__b(__first2),
2958 std::__niter_base<_II2>::__b(__last2));
2959 }
2960 template<typename _II1, typename _II2, typename _Compare>
2961 bool
2962 lexicographical_compare(_II1 __first1, _II1 __last1,
2963 _II2 __first2, _II2 __last2, _Compare __comp)
2964 {
2965 typedef typename iterator_traits<_II1>::iterator_category _Category1;
2966 typedef typename iterator_traits<_II2>::iterator_category _Category2;
2967 typedef std::__lc_rai<_Category1, _Category2> __rai_type;
2968 ;
2969 ;
2970 __last1 = __rai_type::__newlast1(__first1, __last1, __first2, __last2);
2971 for (; __first1 != __last1 && __rai_type::__cnd2(__first2, __last2);
2972 ++__first1, ++__first2)
2973 {
2974 if (__comp(*__first1, *__first2))
2975 return true;
2976 if (__comp(*__first2, *__first1))
2977 return false;
2978 }
2979 return __first1 == __last1 && __first2 != __last2;
2980 }
2981 template<typename _InputIterator1, typename _InputIterator2>
2982 pair<_InputIterator1, _InputIterator2>
2983 mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
2984 _InputIterator2 __first2)
2985 {
2986 ;
2987 while (__first1 != __last1 && *__first1 == *__first2)
2988 {
2989 ++__first1;
2990 ++__first2;
2991 }
2992 return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
2993 }
2994 template<typename _InputIterator1, typename _InputIterator2,
2995 typename _BinaryPredicate>
2996 pair<_InputIterator1, _InputIterator2>
2997 mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
2998 _InputIterator2 __first2, _BinaryPredicate __binary_pred)
2999 {
3000 ;
3001 while (__first1 != __last1 && bool(__binary_pred(*__first1, *__first2)))
3002 {
3003 ++__first1;
3004 ++__first2;
3005 }
3006 return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
3007 }
3008 }
3009 extern "C" {
3010 typedef unsigned short __kernel_dev_t;
3011 typedef unsigned long __kernel_ino_t;
3012 typedef unsigned short __kernel_mode_t;
3013 typedef unsigned short __kernel_nlink_t;
3014 typedef long __kernel_off_t;
3015 typedef int __kernel_pid_t;
3016 typedef unsigned int __kernel_ipc_pid_t;
3017 typedef unsigned int __kernel_uid_t;
3018 typedef unsigned int __kernel_gid_t;
3019 typedef unsigned int __kernel_size_t;
3020 typedef int __kernel_ssize_t;
3021 typedef int __kernel_ptrdiff_t;
3022 typedef long __kernel_time_t;
3023 typedef long __kernel_suseconds_t;
3024 typedef long __kernel_clock_t;
3025 typedef int __kernel_daddr_t;
3026 typedef char * __kernel_caddr_t;
3027 typedef unsigned short __kernel_uid16_t;
3028 typedef unsigned short __kernel_gid16_t;
3029 typedef unsigned int __kernel_uid32_t;
3030 typedef unsigned int __kernel_gid32_t;
3031 typedef unsigned short __kernel_old_uid_t;
3032 typedef unsigned short __kernel_old_gid_t;
3033 typedef long long __kernel_loff_t;
3034 typedef __kernel_dev_t __kernel_old_dev_t;
3035 typedef struct {
3036 int __val[2];
3037 } __kernel_fsid_t;
3038 typedef unsigned char __u_char;
3039 typedef unsigned short int __u_short;
3040 typedef unsigned int __u_int;
3041 typedef unsigned long int __u_long;
3042 typedef signed char __int8_t;
3043 typedef unsigned char __uint8_t;
3044 typedef signed short int __int16_t;
3045 typedef unsigned short int __uint16_t;
3046 typedef signed int __int32_t;
3047 typedef unsigned int __uint32_t;
3048 __extension__ typedef signed long long int __int64_t;
3049 __extension__ typedef unsigned long long int __uint64_t;
3050 __extension__ typedef long long int __quad_t;
3051 __extension__ typedef unsigned long long int __u_quad_t;
3052 __extension__ typedef __u_quad_t __dev_t;
3053 __extension__ typedef unsigned int __uid_t;
3054 __extension__ typedef unsigned int __gid_t;
3055 __extension__ typedef unsigned long int __ino_t;
3056 __extension__ typedef __u_quad_t __ino64_t;
3057 __extension__ typedef unsigned int __mode_t;
3058 __extension__ typedef unsigned int __nlink_t;
3059 __extension__ typedef long int __off_t;
3060 __extension__ typedef __quad_t __off64_t;
3061 __extension__ typedef int __pid_t;
3062 __extension__ typedef struct { int __val[2]; } __fsid_t;
3063 __extension__ typedef long int __clock_t;
3064 __extension__ typedef unsigned long int __rlim_t;
3065 __extension__ typedef __u_quad_t __rlim64_t;
3066 __extension__ typedef unsigned int __id_t;
3067 __extension__ typedef long int __time_t;
3068 __extension__ typedef unsigned int __useconds_t;
3069 __extension__ typedef long int __suseconds_t;
3070 __extension__ typedef int __daddr_t;
3071 __extension__ typedef long int __swblk_t;
3072 __extension__ typedef int __key_t;
3073 __extension__ typedef int __clockid_t;
3074 __extension__ typedef void * __timer_t;
3075 __extension__ typedef long int __blksize_t;
3076 __extension__ typedef long int __blkcnt_t;
3077 __extension__ typedef __quad_t __blkcnt64_t;
3078 __extension__ typedef unsigned long int __fsblkcnt_t;
3079 __extension__ typedef __u_quad_t __fsblkcnt64_t;
3080 __extension__ typedef unsigned long int __fsfilcnt_t;
3081 __extension__ typedef __u_quad_t __fsfilcnt64_t;
3082 __extension__ typedef long int __ssize_t;
3083 typedef __off64_t __loff_t;
3084 typedef __quad_t *__qaddr_t;
3085 typedef char *__caddr_t;
3086 __extension__ typedef int __intptr_t;
3087 __extension__ typedef unsigned int __socklen_t;
3088 typedef __kernel_ipc_pid_t __ipc_pid_t;
3089 struct __sched_param
3090 {
3091 int __sched_priority;
3092 };
3093 struct _pthread_fastlock
3094 {
3095 long int __status;
3096 int __spinlock;
3097 };
3098 typedef struct _pthread_descr_struct *_pthread_descr;
3099 typedef struct __pthread_attr_s
3100 {
3101 int __detachstate;
3102 int __schedpolicy;
3103 struct __sched_param __schedparam;
3104 int __inheritsched;
3105 int __scope;
3106 size_t __guardsize;
3107 int __stackaddr_set;
3108 void *__stackaddr;
3109 size_t __stacksize;
3110 } pthread_attr_t;
3111 typedef struct
3112 {
3113 struct _pthread_fastlock __c_lock;
3114 _pthread_descr __c_waiting;
3115 } pthread_cond_t;
3116 typedef struct
3117 {
3118 int __dummy;
3119 } pthread_condattr_t;
3120 typedef unsigned int pthread_key_t;
3121 typedef struct
3122 {
3123 int __m_reserved;
3124 int __m_count;
3125 _pthread_descr __m_owner;
3126 int __m_kind;
3127 struct _pthread_fastlock __m_lock;
3128 } pthread_mutex_t;
3129 typedef struct
3130 {
3131 int __mutexkind;
3132 } pthread_mutexattr_t;
3133 typedef int pthread_once_t;
3134 typedef struct _pthread_rwlock_t
3135 {
3136 struct _pthread_fastlock __rw_lock;
3137 int __rw_readers;
3138 _pthread_descr __rw_writer;
3139 _pthread_descr __rw_read_waiting;
3140 _pthread_descr __rw_write_waiting;
3141 int __rw_kind;
3142 int __rw_pshared;
3143 } pthread_rwlock_t;
3144 typedef struct
3145 {
3146 int __lockkind;
3147 int __pshared;
3148 } pthread_rwlockattr_t;
3149 typedef volatile int pthread_spinlock_t;
3150 typedef struct {
3151 struct _pthread_fastlock __ba_lock;
3152 int __ba_required;
3153 int __ba_present;
3154 _pthread_descr __ba_waiting;
3155 } pthread_barrier_t;
3156 typedef struct {
3157 int __pshared;
3158 } pthread_barrierattr_t;
3159 typedef unsigned long int pthread_t;
3160 typedef struct __STDIO_FILE_STRUCT FILE;
3161 typedef struct __STDIO_FILE_STRUCT __FILE;
3162 struct timespec
3163 {
3164 __time_t tv_sec;
3165 long int tv_nsec;
3166 };
3167 struct sched_param
3168 {
3169 int __sched_priority;
3170 };
3171 extern "C" {
3172 extern int clone (int (*__fn) (void *__arg), void *__child_stack,
3173 int __flags, void *__arg, ...) throw ();
3174 }
3175 typedef unsigned long int __cpu_mask;
3176 typedef struct
3177 {
3178 __cpu_mask __bits[1024 / (8 * sizeof (__cpu_mask))];
3179 } cpu_set_t;
3180 extern "C" {
3181 extern int sched_setparam (__pid_t __pid, __const struct sched_param *__param)
3182 throw ();
3183 extern int sched_getparam (__pid_t __pid, struct sched_param *__param) throw ();
3184 extern int sched_setscheduler (__pid_t __pid, int __policy,
3185 __const struct sched_param *__param) throw ();
3186 extern int sched_getscheduler (__pid_t __pid) throw ();
3187 extern int sched_yield (void) throw ();
3188 extern int sched_get_priority_max (int __algorithm) throw ();
3189 extern int sched_get_priority_min (int __algorithm) throw ();
3190 extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) throw ();
3191 extern int sched_setaffinity (__pid_t __pid, size_t __cpusetsize,
3192 __const cpu_set_t *__cpuset) throw ();
3193 extern int sched_getaffinity (__pid_t __pid, size_t __cpusetsize,
3194 cpu_set_t *__cpuset) throw ();
3195 }
3196 extern "C" {
3197 typedef __clock_t clock_t;
3198 typedef __time_t time_t;
3199 typedef __clockid_t clockid_t;
3200 typedef __timer_t timer_t;
3201 struct tm
3202 {
3203 int tm_sec;
3204 int tm_min;
3205 int tm_hour;
3206 int tm_mday;
3207 int tm_mon;
3208 int tm_year;
3209 int tm_wday;
3210 int tm_yday;
3211 int tm_isdst;
3212 long int tm_gmtoff;
3213 __const char *tm_zone;
3214 };
3215 struct itimerspec
3216 {
3217 struct timespec it_interval;
3218 struct timespec it_value;
3219 };
3220 struct sigevent;
3221 typedef __pid_t pid_t;
3222 extern clock_t clock (void) throw ();
3223 extern time_t time (time_t *__timer) throw ();
3224 extern double difftime (time_t __time1, time_t __time0)
3225 throw () __attribute__ ((__const__));
3226 extern time_t mktime (struct tm *__tp) throw ();
3227 extern size_t strftime (char *__restrict __s, size_t __maxsize,
3228 __const char *__restrict __format,
3229 __const struct tm *__restrict __tp) throw ();
3230 extern char *strptime (__const char *__restrict __s,
3231 __const char *__restrict __fmt, struct tm *__tp)
3232 throw ();
3233 extern struct tm *gmtime (__const time_t *__timer) throw ();
3234 extern struct tm *localtime (__const time_t *__timer) throw ();
3235 extern struct tm *gmtime_r (__const time_t *__restrict __timer,
3236 struct tm *__restrict __tp) throw ();
3237 extern struct tm *localtime_r (__const time_t *__restrict __timer,
3238 struct tm *__restrict __tp) throw ();
3239 extern char *asctime (__const struct tm *__tp) throw ();
3240 extern char *ctime (__const time_t *__timer) throw ();
3241 extern char *asctime_r (__const struct tm *__restrict __tp,
3242 char *__restrict __buf) throw ();
3243 extern char *ctime_r (__const time_t *__restrict __timer,
3244 char *__restrict __buf) throw ();
3245 extern char *tzname[2];
3246 extern void tzset (void) throw ();
3247 extern int daylight;
3248 extern long int timezone;
3249 extern int stime (__const time_t *__when) throw ();
3250 extern time_t timegm (struct tm *__tp) throw ();
3251 extern time_t timelocal (struct tm *__tp) throw ();
3252 extern int dysize (int __year) throw () __attribute__ ((__const__));
3253 extern int nanosleep (__const struct timespec *__requested_time,
3254 struct timespec *__remaining);
3255 extern int clock_getres (clockid_t __clock_id, struct timespec *__res) throw ();
3256 extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) throw ();
3257 extern int clock_settime (clockid_t __clock_id, __const struct timespec *__tp)
3258 throw ();
3259 extern int timer_create (clockid_t __clock_id,
3260 struct sigevent *__restrict __evp,
3261 timer_t *__restrict __timerid) throw ();
3262 extern int timer_delete (timer_t __timerid) throw ();
3263 extern int timer_settime (timer_t __timerid, int __flags,
3264 __const struct itimerspec *__restrict __value,
3265 struct itimerspec *__restrict __ovalue) throw ();
3266 extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
3267 throw ();
3268 extern int timer_getoverrun (timer_t __timerid) throw ();
3269 }
3270 extern "C" {
3271 typedef int __sig_atomic_t;
3272 typedef struct
3273 {
3274 unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
3275 } __sigset_t;
3276 typedef __sigset_t sigset_t;
3277 }
3278 extern "C" {
3279 enum
3280 {
3281 PTHREAD_CREATE_JOINABLE,
3282 PTHREAD_CREATE_DETACHED
3283 };
3284 enum
3285 {
3286 PTHREAD_INHERIT_SCHED,
3287 PTHREAD_EXPLICIT_SCHED
3288 };
3289 enum
3290 {
3291 PTHREAD_SCOPE_SYSTEM,
3292 PTHREAD_SCOPE_PROCESS
3293 };
3294 enum
3295 {
3296 PTHREAD_MUTEX_ADAPTIVE_NP,
3297 PTHREAD_MUTEX_RECURSIVE_NP,
3298 PTHREAD_MUTEX_ERRORCHECK_NP,
3299 PTHREAD_MUTEX_TIMED_NP
3300 ,
3301 PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_ADAPTIVE_NP,
3302 PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP,
3303 PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP,
3304 PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL
3305 , PTHREAD_MUTEX_FAST_NP = PTHREAD_MUTEX_ADAPTIVE_NP
3306 };
3307 enum
3308 {
3309 PTHREAD_PROCESS_PRIVATE,
3310 PTHREAD_PROCESS_SHARED
3311 };
3312 enum
3313 {
3314 PTHREAD_RWLOCK_PREFER_READER_NP,
3315 PTHREAD_RWLOCK_PREFER_WRITER_NP,
3316 PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,
3317 PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_WRITER_NP
3318 };
3319 struct _pthread_cleanup_buffer
3320 {
3321 void (*__routine) (void *);
3322 void *__arg;
3323 int __canceltype;
3324 struct _pthread_cleanup_buffer *__prev;
3325 };
3326 enum
3327 {
3328 PTHREAD_CANCEL_ENABLE,
3329 PTHREAD_CANCEL_DISABLE
3330 };
3331 enum
3332 {
3333 PTHREAD_CANCEL_DEFERRED,
3334 PTHREAD_CANCEL_ASYNCHRONOUS
3335 };
3336 extern int pthread_create (pthread_t *__restrict __threadp,
3337 __const pthread_attr_t *__restrict __attr,
3338 void *(*__start_routine) (void *),
3339 void *__restrict __arg) throw ();
3340 extern pthread_t pthread_self (void) throw ();
3341 extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) throw ();
3342 extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__));
3343 extern int pthread_join (pthread_t __th, void **__thread_return);
3344 extern int pthread_detach (pthread_t __th) throw ();
3345 extern int pthread_attr_init (pthread_attr_t *__attr) throw ();
3346 extern int pthread_attr_destroy (pthread_attr_t *__attr) throw ();
3347 extern int pthread_attr_setdetachstate (pthread_attr_t *__attr,
3348 int __detachstate) throw ();
3349 extern int pthread_attr_getdetachstate (__const pthread_attr_t *__attr,
3350 int *__detachstate) throw ();
3351 extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr,
3352 __const struct sched_param *__restrict
3353 __param) throw ();
3354 extern int pthread_attr_getschedparam (__const pthread_attr_t *__restrict
3355 __attr,
3356 struct sched_param *__restrict __param)
3357 throw ();
3358 extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy)
3359 throw ();
3360 extern int pthread_attr_getschedpolicy (__const pthread_attr_t *__restrict
3361 __attr, int *__restrict __policy)
3362 throw ();
3363 extern int pthread_attr_setinheritsched (pthread_attr_t *__attr,
3364 int __inherit) throw ();
3365 extern int pthread_attr_getinheritsched (__const pthread_attr_t *__restrict
3366 __attr, int *__restrict __inherit)
3367 throw ();
3368 extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope)
3369 throw ();
3370 extern int pthread_attr_getscope (__const pthread_attr_t *__restrict __attr,
3371 int *__restrict __scope) throw ();
3372 extern int pthread_attr_setguardsize (pthread_attr_t *__attr,
3373 size_t __guardsize) throw ();
3374 extern int pthread_attr_getguardsize (__const pthread_attr_t *__restrict
3375 __attr, size_t *__restrict __guardsize)
3376 throw ();
3377 extern int pthread_attr_setstackaddr (pthread_attr_t *__attr,
3378 void *__stackaddr) throw ();
3379 extern int pthread_attr_getstackaddr (__const pthread_attr_t *__restrict
3380 __attr, void **__restrict __stackaddr)
3381 throw ();
3382 extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
3383 size_t __stacksize) throw ();
3384 extern int pthread_attr_getstack (__const pthread_attr_t *__restrict __attr,
3385 void **__restrict __stackaddr,
3386 size_t *__restrict __stacksize) throw ();
3387 extern int pthread_attr_setstacksize (pthread_attr_t *__attr,
3388 size_t __stacksize) throw ();
3389 extern int pthread_attr_getstacksize (__const pthread_attr_t *__restrict
3390 __attr, size_t *__restrict __stacksize)
3391 throw ();
3392 extern int pthread_setschedparam (pthread_t __target_thread, int __policy,
3393 __const struct sched_param *__param)
3394 throw ();
3395 extern int pthread_getschedparam (pthread_t __target_thread,
3396 int *__restrict __policy,
3397 struct sched_param *__restrict __param)
3398 throw ();
3399 extern int pthread_getconcurrency (void) throw ();
3400 extern int pthread_setconcurrency (int __level) throw ();
3401 extern int pthread_mutex_init (pthread_mutex_t *__restrict __mutex,
3402 __const pthread_mutexattr_t *__restrict
3403 __mutex_attr) throw ();
3404 extern int pthread_mutex_destroy (pthread_mutex_t *__mutex) throw ();
3405 extern int pthread_mutex_trylock (pthread_mutex_t *__mutex) throw ();
3406 extern int pthread_mutex_lock (pthread_mutex_t *__mutex) throw ();
3407 extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
3408 __const struct timespec *__restrict
3409 __abstime) throw ();
3410 extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) throw ();
3411 extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr) throw ();
3412 extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr) throw ();
3413 extern int pthread_mutexattr_getpshared (__const pthread_mutexattr_t *
3414 __restrict __attr,
3415 int *__restrict __pshared) throw ();
3416 extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr,
3417 int __pshared) throw ();
3418 extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind)
3419 throw ();
3420 extern int pthread_mutexattr_gettype (__const pthread_mutexattr_t *__restrict
3421 __attr, int *__restrict __kind) throw ();
3422 extern int pthread_cond_init (pthread_cond_t *__restrict __cond,
3423 __const pthread_condattr_t *__restrict
3424 __cond_attr) throw ();
3425 extern int pthread_cond_destroy (pthread_cond_t *__cond) throw ();
3426 extern int pthread_cond_signal (pthread_cond_t *__cond) throw ();
3427 extern int pthread_cond_broadcast (pthread_cond_t *__cond) throw ();
3428 extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
3429 pthread_mutex_t *__restrict __mutex);
3430 extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
3431 pthread_mutex_t *__restrict __mutex,
3432 __const struct timespec *__restrict
3433 __abstime);
3434 extern int pthread_condattr_init (pthread_condattr_t *__attr) throw ();
3435 extern int pthread_condattr_destroy (pthread_condattr_t *__attr) throw ();
3436 extern int pthread_condattr_getpshared (__const pthread_condattr_t *
3437 __restrict __attr,
3438 int *__restrict __pshared) throw ();
3439 extern int pthread_condattr_setpshared (pthread_condattr_t *__attr,
3440 int __pshared) throw ();
3441 extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
3442 __const pthread_rwlockattr_t *__restrict
3443 __attr) throw ();
3444 extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock) throw ();
3445 extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock) throw ();
3446 extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) throw ();
3447 extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
3448 __const struct timespec *__restrict
3449 __abstime) throw ();
3450 extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock) throw ();
3451 extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) throw ();
3452 extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
3453 __const struct timespec *__restrict
3454 __abstime) throw ();
3455 extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock) throw ();
3456 extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr) throw ();
3457 extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr) throw ();
3458 extern int pthread_rwlockattr_getpshared (__const pthread_rwlockattr_t *
3459 __restrict __attr,
3460 int *__restrict __pshared) throw ();
3461 extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr,
3462 int __pshared) throw ();
3463 extern int pthread_rwlockattr_getkind_np (__const pthread_rwlockattr_t *__attr,
3464 int *__pref) throw ();
3465 extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr,
3466 int __pref) throw ();
3467 extern int pthread_key_create (pthread_key_t *__key,
3468 void (*__destr_function) (void *)) throw ();
3469 extern int pthread_key_delete (pthread_key_t __key) throw ();
3470 extern int pthread_setspecific (pthread_key_t __key,
3471 __const void *__pointer) throw ();
3472 extern void *pthread_getspecific (pthread_key_t __key) throw ();
3473 extern int pthread_once (pthread_once_t *__once_control,
3474 void (*__init_routine) (void));
3475 extern int pthread_setcancelstate (int __state, int *__oldstate);
3476 extern int pthread_setcanceltype (int __type, int *__oldtype);
3477 extern int pthread_cancel (pthread_t __cancelthread);
3478 extern void pthread_testcancel (void);
3479 extern void _pthread_cleanup_push (struct _pthread_cleanup_buffer *__buffer,
3480 void (*__routine) (void *),
3481 void *__arg) throw ();
3482 extern void _pthread_cleanup_pop (struct _pthread_cleanup_buffer *__buffer,
3483 int __execute) throw ();
3484 extern void _pthread_cleanup_push_defer (struct _pthread_cleanup_buffer *__buffer,
3485 void (*__routine) (void *),
3486 void *__arg) throw ();
3487 extern void __pthread_cleanup_push_defer (struct _pthread_cleanup_buffer *__buffer,
3488 void (*__routine) (void *),
3489 void *__arg) throw ();
3490 extern void _pthread_cleanup_pop_restore (struct _pthread_cleanup_buffer *__buffer,
3491 int __execute) throw ();
3492 extern void __pthread_cleanup_pop_restore (struct _pthread_cleanup_buffer *__buffer,
3493 int __execute) throw ();
3494 extern int pthread_sigmask (int __how,
3495 __const __sigset_t *__restrict __newmask,
3496 __sigset_t *__restrict __oldmask)throw ();
3497 extern int pthread_kill (pthread_t __threadid, int __signo) throw ();
3498 extern int pthread_atfork (void (*__prepare) (void),
3499 void (*__parent) (void),
3500 void (*__child) (void)) throw ();
3501 extern void pthread_kill_other_threads_np (void) throw ();
3502 }
3503 typedef struct {
3504 __off_t __pos;
3505 } __STDIO_fpos_t;
3506 typedef struct {
3507 __off64_t __pos;
3508 } __STDIO_fpos64_t;
3509 typedef __off64_t __offmax_t;
3510 struct __STDIO_FILE_STRUCT {
3511 unsigned short __modeflags;
3512 unsigned char __ungot[2];
3513 int __filedes;
3514 unsigned char *__bufstart;
3515 unsigned char *__bufend;
3516 unsigned char *__bufpos;
3517 unsigned char *__bufread;
3518 unsigned char *__bufgetc_u;
3519 unsigned char *__bufputc_u;
3520 struct __STDIO_FILE_STRUCT *__nextopen;
3521 int __user_locking;
3522 pthread_mutex_t __lock;
3523 };
3524 extern int __fgetc_unlocked(FILE *__stream);
3525 extern int __fputc_unlocked(int __c, FILE *__stream);
3526 extern FILE *__stdin;
3527 extern FILE *__stdout;
3528 typedef __builtin_va_list __gnuc_va_list;
3529 typedef __STDIO_fpos_t fpos_t;
3530 typedef __STDIO_fpos64_t fpos64_t;
3531 extern FILE *stdin;
3532 extern FILE *stdout;
3533 extern FILE *stderr;
3534 extern int remove (__const char *__filename) throw ();
3535 extern int rename (__const char *__old, __const char *__new) throw ();
3536 extern FILE *tmpfile (void) ;
3537 extern FILE *tmpfile64 (void) ;
3538 extern char *tmpnam (char *__s) throw () ;
3539 extern char *tmpnam_r (char *__s) throw () ;
3540 extern char *tempnam (__const char *__dir, __const char *__pfx)
3541 throw () __attribute__ ((__malloc__)) ;
3542 extern int fclose (FILE *__stream);
3543 extern int fflush (FILE *__stream);
3544 extern int fflush_unlocked (FILE *__stream);
3545 extern int fcloseall (void);
3546 extern FILE *fopen (__const char *__restrict __filename,
3547 __const char *__restrict __modes) ;
3548 extern FILE *freopen (__const char *__restrict __filename,
3549 __const char *__restrict __modes,
3550 FILE *__restrict __stream) ;
3551 extern FILE *fopen64 (__const char *__restrict __filename,
3552 __const char *__restrict __modes) ;
3553 extern FILE *freopen64 (__const char *__restrict __filename,
3554 __const char *__restrict __modes,
3555 FILE *__restrict __stream) ;
3556 extern FILE *fdopen (int __fd, __const char *__modes) throw () ;
3557 extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) throw ();
3558 extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
3559 int __modes, size_t __n) throw ();
3560 extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
3561 size_t __size) throw ();
3562 extern void setlinebuf (FILE *__stream) throw ();
3563 extern int fprintf (FILE *__restrict __stream,
3564 __const char *__restrict __format, ...);
3565 extern int printf (__const char *__restrict __format, ...);
3566 extern int sprintf (char *__restrict __s,
3567 __const char *__restrict __format, ...) throw ();
3568 extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format,
3569 __gnuc_va_list __arg);
3570 extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg);
3571 extern int vsprintf (char *__restrict __s, __const char *__restrict __format,
3572 __gnuc_va_list __arg) throw ();
3573 extern int snprintf (char *__restrict __s, size_t __maxlen,
3574 __const char *__restrict __format, ...)
3575 throw () __attribute__ ((__format__ (__printf__, 3, 4)));
3576 extern int vsnprintf (char *__restrict __s, size_t __maxlen,
3577 __const char *__restrict __format, __gnuc_va_list __arg)
3578 throw () __attribute__ ((__format__ (__printf__, 3, 0)));
3579 extern int vasprintf (char **__restrict __ptr, __const char *__restrict __f,
3580 __gnuc_va_list __arg)
3581 throw () __attribute__ ((__format__ (__printf__, 2, 0))) ;
3582 extern int asprintf (char **__restrict __ptr,
3583 __const char *__restrict __fmt, ...)
3584 throw () __attribute__ ((__format__ (__printf__, 2, 3))) ;
3585 extern int vdprintf (int __fd, __const char *__restrict __fmt,
3586 __gnuc_va_list __arg)
3587 __attribute__ ((__format__ (__printf__, 2, 0)));
3588 extern int dprintf (int __fd, __const char *__restrict __fmt, ...)
3589 __attribute__ ((__format__ (__printf__, 2, 3)));
3590 extern int fscanf (FILE *__restrict __stream,
3591 __const char *__restrict __format, ...) ;
3592 extern int scanf (__const char *__restrict __format, ...) ;
3593 extern int sscanf (__const char *__restrict __s,
3594 __const char *__restrict __format, ...) throw ();
3595 extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format,
3596 __gnuc_va_list __arg)
3597 __attribute__ ((__format__ (__scanf__, 2, 0))) ;
3598 extern int vscanf (__const char *__restrict __format, __gnuc_va_list __arg)
3599 __attribute__ ((__format__ (__scanf__, 1, 0))) ;
3600 extern int vsscanf (__const char *__restrict __s,
3601 __const char *__restrict __format, __gnuc_va_list __arg)
3602 throw () __attribute__ ((__format__ (__scanf__, 2, 0)));
3603 extern int fgetc (FILE *__stream);
3604 extern int getc (FILE *__stream);
3605 extern int getchar (void);
3606 extern int getc_unlocked (FILE *__stream);
3607 extern int getchar_unlocked (void);
3608 extern int fgetc_unlocked (FILE *__stream);
3609 extern int fputc (int __c, FILE *__stream);
3610 extern int putc (int __c, FILE *__stream);
3611 extern int putchar (int __c);
3612 extern int fputc_unlocked (int __c, FILE *__stream);
3613 extern int putc_unlocked (int __c, FILE *__stream);
3614 extern int putchar_unlocked (int __c);
3615 extern int getw (FILE *__stream);
3616 extern int putw (int __w, FILE *__stream);
3617 extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
3618 ;
3619 extern char *gets (char *__s) ;
3620 extern char *fgets_unlocked (char *__restrict __s, int __n,
3621 FILE *__restrict __stream) ;
3622 extern __ssize_t getdelim (char **__restrict __lineptr,
3623 size_t *__restrict __n, int __delimiter,
3624 FILE *__restrict __stream) ;
3625 extern __ssize_t getline (char **__restrict __lineptr,
3626 size_t *__restrict __n,
3627 FILE *__restrict __stream) ;
3628 extern int fputs (__const char *__restrict __s, FILE *__restrict __stream);
3629 extern int puts (__const char *__s);
3630 extern int ungetc (int __c, FILE *__stream);
3631 extern size_t fread (void *__restrict __ptr, size_t __size,
3632 size_t __n, FILE *__restrict __stream) ;
3633 extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
3634 size_t __n, FILE *__restrict __s) ;
3635 extern int fputs_unlocked (__const char *__restrict __s,
3636 FILE *__restrict __stream);
3637 extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
3638 size_t __n, FILE *__restrict __stream) ;
3639 extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size,
3640 size_t __n, FILE *__restrict __stream) ;
3641 extern int fseek (FILE *__stream, long int __off, int __whence);
3642 extern long int ftell (FILE *__stream) ;
3643 extern void rewind (FILE *__stream);
3644 extern int fseeko (FILE *__stream, __off_t __off, int __whence);
3645 extern __off_t ftello (FILE *__stream) ;
3646 extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos);
3647 extern int fsetpos (FILE *__stream, __const fpos_t *__pos);
3648 extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
3649 extern __off64_t ftello64 (FILE *__stream) ;
3650 extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
3651 extern int fsetpos64 (FILE *__stream, __const fpos64_t *__pos);
3652 extern void clearerr (FILE *__stream) throw ();
3653 extern int feof (FILE *__stream) throw () ;
3654 extern int ferror (FILE *__stream) throw () ;
3655 extern void clearerr_unlocked (FILE *__stream) throw ();
3656 extern int feof_unlocked (FILE *__stream) throw () ;
3657 extern int ferror_unlocked (FILE *__stream) throw () ;
3658 extern void perror (__const char *__s);
3659 extern int fileno (FILE *__stream) throw () ;
3660 extern int fileno_unlocked (FILE *__stream) throw () ;
3661 extern FILE *popen (__const char *__command, __const char *__modes) ;
3662 extern int pclose (FILE *__stream);
3663 extern char *ctermid (char *__s) throw ();
3664 extern char *cuserid (char *__s);
3665 extern void flockfile (FILE *__stream) throw ();
3666 extern int ftrylockfile (FILE *__stream) throw () ;
3667 extern void funlockfile (FILE *__stream) throw ();
3668 }
3669 namespace std __attribute__ ((__visibility__ ("default"))) {
3670 using ::FILE;
3671 using ::fpos_t;
3672 using ::clearerr;
3673 using ::fclose;
3674 using ::feof;
3675 using ::ferror;
3676 using ::fflush;
3677 using ::fgetc;
3678 using ::fgetpos;
3679 using ::fgets;
3680 using ::fopen;
3681 using ::fprintf;
3682 using ::fputc;
3683 using ::fputs;
3684 using ::fread;
3685 using ::freopen;
3686 using ::fscanf;
3687 using ::fseek;
3688 using ::fsetpos;
3689 using ::ftell;
3690 using ::fwrite;
3691 using ::getc;
3692 using ::getchar;
3693 using ::gets;
3694 using ::perror;
3695 using ::printf;
3696 using ::putc;
3697 using ::putchar;
3698 using ::puts;
3699 using ::remove;
3700 using ::rename;
3701 using ::rewind;
3702 using ::scanf;
3703 using ::setbuf;
3704 using ::setvbuf;
3705 using ::sprintf;
3706 using ::sscanf;
3707 using ::tmpfile;
3708 using ::tmpnam;
3709 using ::ungetc;
3710 using ::vfprintf;
3711 using ::vprintf;
3712 using ::vsprintf;
3713 }
3714 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
3715 template<typename _CharT>
3716 struct _Char_types
3717 {
3718 typedef unsigned long int_type;
3719 typedef std::streampos pos_type;
3720 typedef std::streamoff off_type;
3721 typedef std::mbstate_t state_type;
3722 };
3723 template<typename _CharT>
3724 struct char_traits
3725 {
3726 typedef _CharT char_type;
3727 typedef typename _Char_types<_CharT>::int_type int_type;
3728 typedef typename _Char_types<_CharT>::pos_type pos_type;
3729 typedef typename _Char_types<_CharT>::off_type off_type;
3730 typedef typename _Char_types<_CharT>::state_type state_type;
3731 static void
3732 assign(char_type& __c1, const char_type& __c2)
3733 { __c1 = __c2; }
3734 static bool
3735 eq(const char_type& __c1, const char_type& __c2)
3736 { return __c1 == __c2; }
3737 static bool
3738 lt(const char_type& __c1, const char_type& __c2)
3739 { return __c1 < __c2; }
3740 static int
3741 compare(const char_type* __s1, const char_type* __s2, std::size_t __n);
3742 static std::size_t
3743 length(const char_type* __s);
3744 static const char_type*
3745 find(const char_type* __s, std::size_t __n, const char_type& __a);
3746 static char_type*
3747 move(char_type* __s1, const char_type* __s2, std::size_t __n);
3748 static char_type*
3749 copy(char_type* __s1, const char_type* __s2, std::size_t __n);
3750 static char_type*
3751 assign(char_type* __s, std::size_t __n, char_type __a);
3752 static char_type
3753 to_char_type(const int_type& __c)
3754 { return static_cast<char_type>(__c); }
3755 static int_type
3756 to_int_type(const char_type& __c)
3757 { return static_cast<int_type>(__c); }
3758 static bool
3759 eq_int_type(const int_type& __c1, const int_type& __c2)
3760 { return __c1 == __c2; }
3761 static int_type
3762 eof()
3763 { return static_cast<int_type>((-1)); }
3764 static int_type
3765 not_eof(const int_type& __c)
3766 { return !eq_int_type(__c, eof()) ? __c : to_int_type(char_type()); }
3767 };
3768 template<typename _CharT>
3769 int
3770 char_traits<_CharT>::
3771 compare(const char_type* __s1, const char_type* __s2, std::size_t __n)
3772 {
3773 for (std::size_t __i = 0; __i < __n; ++__i)
3774 if (lt(__s1[__i], __s2[__i]))
3775 return -1;
3776 else if (lt(__s2[__i], __s1[__i]))
3777 return 1;
3778 return 0;
3779 }
3780 template<typename _CharT>
3781 std::size_t
3782 char_traits<_CharT>::
3783 length(const char_type* __p)
3784 {
3785 std::size_t __i = 0;
3786 while (!eq(__p[__i], char_type()))
3787 ++__i;
3788 return __i;
3789 }
3790 template<typename _CharT>
3791 const typename char_traits<_CharT>::char_type*
3792 char_traits<_CharT>::
3793 find(const char_type* __s, std::size_t __n, const char_type& __a)
3794 {
3795 for (std::size_t __i = 0; __i < __n; ++__i)
3796 if (eq(__s[__i], __a))
3797 return __s + __i;
3798 return 0;
3799 }
3800 template<typename _CharT>
3801 typename char_traits<_CharT>::char_type*
3802 char_traits<_CharT>::
3803 move(char_type* __s1, const char_type* __s2, std::size_t __n)
3804 {
3805 return static_cast<_CharT*>(__builtin_memmove(__s1, __s2,
3806 __n * sizeof(char_type)));
3807 }
3808 template<typename _CharT>
3809 typename char_traits<_CharT>::char_type*
3810 char_traits<_CharT>::
3811 copy(char_type* __s1, const char_type* __s2, std::size_t __n)
3812 {
3813 std::copy(__s2, __s2 + __n, __s1);
3814 return __s1;
3815 }
3816 template<typename _CharT>
3817 typename char_traits<_CharT>::char_type*
3818 char_traits<_CharT>::
3819 assign(char_type* __s, std::size_t __n, char_type __a)
3820 {
3821 std::fill_n(__s, __n, __a);
3822 return __s;
3823 }
3824 }
3825 namespace std __attribute__ ((__visibility__ ("default"))) {
3826 template<class _CharT>
3827 struct char_traits : public __gnu_cxx::char_traits<_CharT>
3828 { };
3829 template<>
3830 struct char_traits<char>
3831 {
3832 typedef char char_type;
3833 typedef int int_type;
3834 typedef streampos pos_type;
3835 typedef streamoff off_type;
3836 typedef mbstate_t state_type;
3837 static void
3838 assign(char_type& __c1, const char_type& __c2)
3839 { __c1 = __c2; }
3840 static bool
3841 eq(const char_type& __c1, const char_type& __c2)
3842 { return __c1 == __c2; }
3843 static bool
3844 lt(const char_type& __c1, const char_type& __c2)
3845 { return __c1 < __c2; }
3846 static int
3847 compare(const char_type* __s1, const char_type* __s2, size_t __n)
3848 { return __builtin_memcmp(__s1, __s2, __n); }
3849 static size_t
3850 length(const char_type* __s)
3851 { return __builtin_strlen(__s); }
3852 static const char_type*
3853 find(const char_type* __s, size_t __n, const char_type& __a)
3854 { return static_cast<const char_type*>(__builtin_memchr(__s, __a, __n)); }
3855 static char_type*
3856 move(char_type* __s1, const char_type* __s2, size_t __n)
3857 { return static_cast<char_type*>(__builtin_memmove(__s1, __s2, __n)); }
3858 static char_type*
3859 copy(char_type* __s1, const char_type* __s2, size_t __n)
3860 { return static_cast<char_type*>(__builtin_memcpy(__s1, __s2, __n)); }
3861 static char_type*
3862 assign(char_type* __s, size_t __n, char_type __a)
3863 { return static_cast<char_type*>(__builtin_memset(__s, __a, __n)); }
3864 static char_type
3865 to_char_type(const int_type& __c)
3866 { return static_cast<char_type>(__c); }
3867 static int_type
3868 to_int_type(const char_type& __c)
3869 { return static_cast<int_type>(static_cast<unsigned char>(__c)); }
3870 static bool
3871 eq_int_type(const int_type& __c1, const int_type& __c2)
3872 { return __c1 == __c2; }
3873 static int_type
3874 eof() { return static_cast<int_type>((-1)); }
3875 static int_type
3876 not_eof(const int_type& __c)
3877 { return (__c == eof()) ? 0 : __c; }
3878 };
3879 }
3880 extern "C" {
3881 struct lconv
3882 {
3883 char *decimal_point;
3884 char *thousands_sep;
3885 char *grouping;
3886 char *int_curr_symbol;
3887 char *currency_symbol;
3888 char *mon_decimal_point;
3889 char *mon_thousands_sep;
3890 char *mon_grouping;
3891 char *positive_sign;
3892 char *negative_sign;
3893 char int_frac_digits;
3894 char frac_digits;
3895 char p_cs_precedes;
3896 char p_sep_by_space;
3897 char n_cs_precedes;
3898 char n_sep_by_space;
3899 char p_sign_posn;
3900 char n_sign_posn;
3901 char int_p_cs_precedes;
3902 char int_p_sep_by_space;
3903 char int_n_cs_precedes;
3904 char int_n_sep_by_space;
3905 char int_p_sign_posn;
3906 char int_n_sign_posn;
3907 };
3908 extern char *setlocale (int __category, __const char *__locale) throw ();
3909 extern struct lconv *localeconv (void) throw ();
3910 }
3911 namespace std __attribute__ ((__visibility__ ("default"))) {
3912 using ::lconv;
3913 using ::setlocale;
3914 using ::localeconv;
3915 }
3916 namespace std __attribute__ ((__visibility__ ("default"))) {
3917 typedef int* __c_locale;
3918 inline int
3919 __convert_from_v(const __c_locale&, char* __out,
3920 const int __size __attribute__((__unused__)),
3921 const char* __fmt, ...)
3922 {
3923 char* __old = std::setlocale(1, __null);
3924 char* __sav = __null;
3925 if (__builtin_strcmp(__old, "C"))
3926 {
3927 const size_t __len = __builtin_strlen(__old) + 1;
3928 __sav = new char[__len];
3929 __builtin_memcpy(__sav, __old, __len);
3930 std::setlocale(1, "C");
3931 }
3932 __builtin_va_list __args;
3933 __builtin_va_start(__args, __fmt);
3934 const int __ret = __builtin_vsprintf(__out, __fmt, __args);
3935 __builtin_va_end(__args);
3936 if (__sav)
3937 {
3938 std::setlocale(1, __sav);
3939 delete [] __sav;
3940 }
3941 return __ret;
3942 }
3943 }
3944 extern "C" {
3945 enum
3946 {
3947 _ISupper = (1 << (0)),
3948 _ISlower = (1 << (1)),
3949 _ISalpha = (1 << (2)),
3950 _ISdigit = (1 << (3)),
3951 _ISxdigit = (1 << (4)),
3952 _ISspace = (1 << (5)),
3953 _ISprint = (1 << (6)),
3954 _ISgraph = (1 << (7)),
3955 _ISblank = (1 << (8)),
3956 _IScntrl = (1 << (9)),
3957 _ISpunct = (1 << (10)),
3958 _ISalnum = (1 << (11))
3959 };
3960 typedef __uint16_t __ctype_mask_t;
3961 typedef __int16_t __ctype_touplow_t;
3962 extern const __ctype_mask_t *__C_ctype_b;
3963 extern const __ctype_touplow_t *__C_ctype_toupper;
3964 extern const __ctype_touplow_t *__C_ctype_tolower;
3965 extern const __ctype_mask_t *__ctype_b;
3966 extern const __ctype_touplow_t *__ctype_toupper;
3967 extern const __ctype_touplow_t *__ctype_tolower;
3968 extern int isalnum (int) throw ();
3969 extern int isalpha (int) throw ();
3970 extern int iscntrl (int) throw ();
3971 extern int isdigit (int) throw ();
3972 extern int islower (int) throw ();
3973 extern int isgraph (int) throw ();
3974 extern int isprint (int) throw ();
3975 extern int ispunct (int) throw ();
3976 extern int isspace (int) throw ();
3977 extern int isupper (int) throw ();
3978 extern int isxdigit (int) throw ();
3979 extern int tolower (int __c) throw ();
3980 extern int toupper (int __c) throw ();
3981 extern int isblank (int) throw ();
3982 extern int isctype (int __c, int __mask) throw ();
3983 extern int isascii (int __c) throw ();
3984 extern int toascii (int __c) throw ();
3985 extern int _toupper (int) throw ();
3986 extern int _tolower (int) throw ();
3987 }
3988 namespace std __attribute__ ((__visibility__ ("default"))) {
3989 using ::isalnum;
3990 using ::isalpha;
3991 using ::iscntrl;
3992 using ::isdigit;
3993 using ::isgraph;
3994 using ::islower;
3995 using ::isprint;
3996 using ::ispunct;
3997 using ::isspace;
3998 using ::isupper;
3999 using ::isxdigit;
4000 using ::tolower;
4001 using ::toupper;
4002 }
4003 namespace std __attribute__ ((__visibility__ ("default"))) {
4004 class locale;
4005 template<typename _Facet>
4006 bool
4007 has_facet(const locale&) throw();
4008 template<typename _Facet>
4009 const _Facet&
4010 use_facet(const locale&);
4011 template<typename _CharT>
4012 bool
4013 isspace(_CharT, const locale&);
4014 template<typename _CharT>
4015 bool
4016 isprint(_CharT, const locale&);
4017 template<typename _CharT>
4018 bool
4019 iscntrl(_CharT, const locale&);
4020 template<typename _CharT>
4021 bool
4022 isupper(_CharT, const locale&);
4023 template<typename _CharT>
4024 bool
4025 islower(_CharT, const locale&);
4026 template<typename _CharT>
4027 bool
4028 isalpha(_CharT, const locale&);
4029 template<typename _CharT>
4030 bool
4031 isdigit(_CharT, const locale&);
4032 template<typename _CharT>
4033 bool
4034 ispunct(_CharT, const locale&);
4035 template<typename _CharT>
4036 bool
4037 isxdigit(_CharT, const locale&);
4038 template<typename _CharT>
4039 bool
4040 isalnum(_CharT, const locale&);
4041 template<typename _CharT>
4042 bool
4043 isgraph(_CharT, const locale&);
4044 template<typename _CharT>
4045 _CharT
4046 toupper(_CharT, const locale&);
4047 template<typename _CharT>
4048 _CharT
4049 tolower(_CharT, const locale&);
4050 class ctype_base;
4051 template<typename _CharT>
4052 class ctype;
4053 template<> class ctype<char>;
4054 template<typename _CharT>
4055 class ctype_byname;
4056 class codecvt_base;
4057 template<typename _InternT, typename _ExternT, typename _StateT>
4058 class codecvt;
4059 template<> class codecvt<char, char, mbstate_t>;
4060 template<typename _InternT, typename _ExternT, typename _StateT>
4061 class codecvt_byname;
4062 template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
4063 class num_get;
4064 template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
4065 class num_put;
4066 template<typename _CharT> class numpunct;
4067 template<typename _CharT> class numpunct_byname;
4068 template<typename _CharT>
4069 class collate;
4070 template<typename _CharT> class
4071 collate_byname;
4072 class time_base;
4073 template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
4074 class time_get;
4075 template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
4076 class time_get_byname;
4077 template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
4078 class time_put;
4079 template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
4080 class time_put_byname;
4081 class money_base;
4082 template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
4083 class money_get;
4084 template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
4085 class money_put;
4086 template<typename _CharT, bool _Intl = false>
4087 class moneypunct;
4088 template<typename _CharT, bool _Intl = false>
4089 class moneypunct_byname;
4090 class messages_base;
4091 template<typename _CharT>
4092 class messages;
4093 template<typename _CharT>
4094 class messages_byname;
4095 }
4096 extern "C" {
4097 typedef __ssize_t ssize_t;
4098 typedef __gid_t gid_t;
4099 typedef __uid_t uid_t;
4100 typedef __off_t off_t;
4101 typedef __off64_t off64_t;
4102 typedef __useconds_t useconds_t;
4103 typedef __socklen_t socklen_t;
4104 extern int access (__const char *__name, int __type) throw () __attribute__ ((__nonnull__ (1)));
4105 extern __off_t lseek (int __fd, __off_t __offset, int __whence) throw ();
4106 extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
4107 throw ();
4108 extern int close (int __fd);
4109 extern ssize_t read (int __fd, void *__buf, size_t __nbytes) ;
4110 extern ssize_t write (int __fd, __const void *__buf, size_t __n) ;
4111 extern ssize_t pread (int __fd, void *__buf, size_t __nbytes,
4112 __off_t __offset) ;
4113 extern ssize_t pwrite (int __fd, __const void *__buf, size_t __n,
4114 __off_t __offset) ;
4115 extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
4116 __off64_t __offset) ;
4117 extern ssize_t pwrite64 (int __fd, __const void *__buf, size_t __n,
4118 __off64_t __offset) ;
4119 extern int pipe (int __pipedes[2]) throw () ;
4120 extern unsigned int alarm (unsigned int __seconds) throw ();
4121 extern unsigned int sleep (unsigned int __seconds);
4122 extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
4123 throw ();
4124 extern int usleep (__useconds_t __useconds);
4125 extern int pause (void);
4126 extern int chown (__const char *__file, __uid_t __owner, __gid_t __group)
4127 throw () __attribute__ ((__nonnull__ (1))) ;
4128 extern int fchown (int __fd, __uid_t __owner, __gid_t __group) throw () ;
4129 extern int lchown (__const char *__file, __uid_t __owner, __gid_t __group)
4130 throw () __attribute__ ((__nonnull__ (1))) ;
4131 extern int chdir (__const char *__path) throw () __attribute__ ((__nonnull__ (1))) ;
4132 extern int fchdir (int __fd) throw () ;
4133 extern char *getcwd (char *__buf, size_t __size) throw () ;
4134 extern char *get_current_dir_name (void) throw ();
4135 extern int dup (int __fd) throw () ;
4136 extern int dup2 (int __fd, int __fd2) throw ();
4137 extern char **__environ;
4138 extern char **environ;
4139 extern int execve (__const char *__path, char *__const __argv[],
4140 char *__const __envp[]) throw () __attribute__ ((__nonnull__ (1)));
4141 extern int execv (__const char *__path, char *__const __argv[])
4142 throw () __attribute__ ((__nonnull__ (1)));
4143 extern int execle (__const char *__path, __const char *__arg, ...)
4144 throw () __attribute__ ((__nonnull__ (1)));
4145 extern int execl (__const char *__path, __const char *__arg, ...)
4146 throw () __attribute__ ((__nonnull__ (1)));
4147 extern int execvp (__const char *__file, char *__const __argv[])
4148 throw () __attribute__ ((__nonnull__ (1)));
4149 extern int execlp (__const char *__file, __const char *__arg, ...)
4150 throw () __attribute__ ((__nonnull__ (1)));
4151 extern int nice (int __inc) throw () ;
4152 extern void _exit (int __status) __attribute__ ((__noreturn__));
4153 enum
4154 {
4155 _PC_LINK_MAX,
4156 _PC_MAX_CANON,
4157 _PC_MAX_INPUT,
4158 _PC_NAME_MAX,
4159 _PC_PATH_MAX,
4160 _PC_PIPE_BUF,
4161 _PC_CHOWN_RESTRICTED,
4162 _PC_NO_TRUNC,
4163 _PC_VDISABLE,
4164 _PC_SYNC_IO,
4165 _PC_ASYNC_IO,
4166 _PC_PRIO_IO,
4167 _PC_SOCK_MAXBUF,
4168 _PC_FILESIZEBITS,
4169 _PC_REC_INCR_XFER_SIZE,
4170 _PC_REC_MAX_XFER_SIZE,
4171 _PC_REC_MIN_XFER_SIZE,
4172 _PC_REC_XFER_ALIGN,
4173 _PC_ALLOC_SIZE_MIN,
4174 _PC_SYMLINK_MAX,
4175 _PC_2_SYMLINKS
4176 };
4177 enum
4178 {
4179 _SC_ARG_MAX,
4180 _SC_CHILD_MAX,
4181 _SC_CLK_TCK,
4182 _SC_NGROUPS_MAX,
4183 _SC_OPEN_MAX,
4184 _SC_STREAM_MAX,
4185 _SC_TZNAME_MAX,
4186 _SC_JOB_CONTROL,
4187 _SC_SAVED_IDS,
4188 _SC_REALTIME_SIGNALS,
4189 _SC_PRIORITY_SCHEDULING,
4190 _SC_TIMERS,
4191 _SC_ASYNCHRONOUS_IO,
4192 _SC_PRIORITIZED_IO,
4193 _SC_SYNCHRONIZED_IO,
4194 _SC_FSYNC,
4195 _SC_MAPPED_FILES,
4196 _SC_MEMLOCK,
4197 _SC_MEMLOCK_RANGE,
4198 _SC_MEMORY_PROTECTION,
4199 _SC_MESSAGE_PASSING,
4200 _SC_SEMAPHORES,
4201 _SC_SHARED_MEMORY_OBJECTS,
4202 _SC_AIO_LISTIO_MAX,
4203 _SC_AIO_MAX,
4204 _SC_AIO_PRIO_DELTA_MAX,
4205 _SC_DELAYTIMER_MAX,
4206 _SC_MQ_OPEN_MAX,
4207 _SC_MQ_PRIO_MAX,
4208 _SC_VERSION,
4209 _SC_PAGESIZE,
4210 _SC_RTSIG_MAX,
4211 _SC_SEM_NSEMS_MAX,
4212 _SC_SEM_VALUE_MAX,
4213 _SC_SIGQUEUE_MAX,
4214 _SC_TIMER_MAX,
4215 _SC_BC_BASE_MAX,
4216 _SC_BC_DIM_MAX,
4217 _SC_BC_SCALE_MAX,
4218 _SC_BC_STRING_MAX,
4219 _SC_COLL_WEIGHTS_MAX,
4220 _SC_EQUIV_CLASS_MAX,
4221 _SC_EXPR_NEST_MAX,
4222 _SC_LINE_MAX,
4223 _SC_RE_DUP_MAX,
4224 _SC_CHARCLASS_NAME_MAX,
4225 _SC_2_VERSION,
4226 _SC_2_C_BIND,
4227 _SC_2_C_DEV,
4228 _SC_2_FORT_DEV,
4229 _SC_2_FORT_RUN,
4230 _SC_2_SW_DEV,
4231 _SC_2_LOCALEDEF,
4232 _SC_PII,
4233 _SC_PII_XTI,
4234 _SC_PII_SOCKET,
4235 _SC_PII_INTERNET,
4236 _SC_PII_OSI,
4237 _SC_POLL,
4238 _SC_SELECT,
4239 _SC_UIO_MAXIOV,
4240 _SC_IOV_MAX = _SC_UIO_MAXIOV,
4241 _SC_PII_INTERNET_STREAM,
4242 _SC_PII_INTERNET_DGRAM,
4243 _SC_PII_OSI_COTS,
4244 _SC_PII_OSI_CLTS,
4245 _SC_PII_OSI_M,
4246 _SC_T_IOV_MAX,
4247 _SC_THREADS,
4248 _SC_THREAD_SAFE_FUNCTIONS,
4249 _SC_GETGR_R_SIZE_MAX,
4250 _SC_GETPW_R_SIZE_MAX,
4251 _SC_LOGIN_NAME_MAX,
4252 _SC_TTY_NAME_MAX,
4253 _SC_THREAD_DESTRUCTOR_ITERATIONS,
4254 _SC_THREAD_KEYS_MAX,
4255 _SC_THREAD_STACK_MIN,