public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/3043: Inernal compiler error
@ 2001-06-03 16:26 christian.gleich
0 siblings, 0 replies; 2+ messages in thread
From: christian.gleich @ 2001-06-03 16:26 UTC (permalink / raw)
To: gcc-gnats
>Number: 3043
>Category: c++
>Synopsis: Inernal compiler error
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Jun 03 16:26:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Christian Gleich
>Release: gcc version 2.95.2 19991024
>Organization:
>Environment:
Linux 2.2.18 i686
>Description:
Internal compiler error
>How-To-Repeat:
g++ l.cc
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="l.cc"
Content-Disposition: inline; filename="l.cc"
# 1 "GnutellaService.cc"
# 1 "/usr/include/g++/queue" 1 3
# 1 "/usr/include/g++/stl_algobase.h" 1 3
# 1 "/usr/include/g++/stl_config.h" 1 3
# 148 "/usr/include/g++/stl_config.h" 3
# 1 "/usr/include/_G_config.h" 1 3
# 1 "/usr/include/bits/types.h" 1 3
# 1 "/usr/include/features.h" 1 3
# 173 "/usr/include/features.h" 3
# 1 "/usr/include/sys/cdefs.h" 1 3
# 65 "/usr/include/sys/cdefs.h" 3
# 283 "/usr/include/features.h" 2 3
# 1 "/usr/include/gnu/stubs.h" 1 3
# 311 "/usr/include/features.h" 2 3
# 26 "/usr/include/bits/types.h" 2 3
# 1 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 1 3
# 19 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 61 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 131 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
typedef unsigned int size_t;
# 271 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 283 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 317 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 29 "/usr/include/bits/types.h" 2 3
typedef unsigned char __u_char;
typedef unsigned short __u_short;
typedef unsigned int __u_int;
typedef unsigned long __u_long;
__extension__ typedef unsigned long long int __u_quad_t;
__extension__ typedef long long int __quad_t;
# 48 "/usr/include/bits/types.h" 3
typedef signed char __int8_t;
typedef unsigned char __uint8_t;
typedef signed short int __int16_t;
typedef unsigned short int __uint16_t;
typedef signed int __int32_t;
typedef unsigned int __uint32_t;
__extension__ typedef signed long long int __int64_t;
__extension__ typedef unsigned long long int __uint64_t;
typedef __quad_t *__qaddr_t;
typedef __u_quad_t __dev_t;
typedef __u_int __uid_t;
typedef __u_int __gid_t;
typedef __u_long __ino_t;
typedef __u_int __mode_t;
typedef __u_int __nlink_t;
typedef long int __off_t;
typedef __quad_t __loff_t;
typedef int __pid_t;
typedef int __ssize_t;
typedef __u_long __rlim_t;
typedef __u_quad_t __rlim64_t;
typedef __u_int __id_t;
typedef struct
{
int __val[2];
} __fsid_t;
typedef int __daddr_t;
typedef char *__caddr_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __swblk_t;
\f
typedef long int __clock_t;
typedef int __clockid_t;
typedef int __timer_t;
typedef unsigned long int __fd_mask;
typedef struct
{
__fd_mask fds_bits[1024 / (8 * sizeof (__fd_mask)) ];
} __fd_set;
typedef int __key_t;
typedef unsigned short int __ipc_pid_t;
typedef long int __blksize_t;
typedef long int __blkcnt_t;
typedef __quad_t __blkcnt64_t;
typedef __u_long __fsblkcnt_t;
typedef __u_quad_t __fsblkcnt64_t;
typedef __u_long __fsfilcnt_t;
typedef __u_quad_t __fsfilcnt64_t;
typedef __u_quad_t __ino64_t;
typedef __loff_t __off64_t;
typedef long int __t_scalar_t;
typedef unsigned long int __t_uscalar_t;
typedef int __intptr_t;
typedef unsigned int __socklen_t;
# 1 "/usr/include/bits/pthreadtypes.h" 1 3
# 1 "/usr/include/bits/sched.h" 1 3
# 62 "/usr/include/bits/sched.h" 3
struct __sched_param
{
int sched_priority;
};
# 23 "/usr/include/bits/pthreadtypes.h" 2 3
struct _pthread_fastlock
{
long int __status;
int __spinlock;
};
typedef struct _pthread_descr_struct *_pthread_descr;
typedef struct
{
int __detachstate;
int __schedpolicy;
struct __sched_param __schedparam;
int __inheritsched;
int __scope;
size_t __guardsize;
int __stackaddr_set;
void *__stackaddr;
size_t __stacksize;
} pthread_attr_t;
typedef struct
{
struct _pthread_fastlock __c_lock;
_pthread_descr __c_waiting;
} pthread_cond_t;
typedef struct
{
int __dummy;
} pthread_condattr_t;
typedef unsigned int pthread_key_t;
typedef struct
{
int __m_reserved;
int __m_count;
_pthread_descr __m_owner;
int __m_kind;
struct _pthread_fastlock __m_lock;
} pthread_mutex_t;
typedef struct
{
int __mutexkind;
} pthread_mutexattr_t;
typedef int pthread_once_t;
typedef struct _pthread_rwlock_t
{
struct _pthread_fastlock __rw_lock;
int __rw_readers;
_pthread_descr __rw_writer;
_pthread_descr __rw_read_waiting;
_pthread_descr __rw_write_waiting;
int __rw_kind;
int __rw_pshared;
} pthread_rwlock_t;
typedef struct
{
int __lockkind;
int __pshared;
} pthread_rwlockattr_t;
typedef volatile int pthread_spinlock_t;
typedef struct {
struct _pthread_fastlock __ba_lock;
int __ba_required;
int __ba_present;
_pthread_descr __ba_waiting;
} pthread_barrier_t;
typedef struct {
int __pshared;
} pthread_barrierattr_t;
typedef unsigned long int pthread_t;
# 165 "/usr/include/bits/types.h" 2 3
# 9 "/usr/include/_G_config.h" 2 3
# 1 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 1 3
# 19 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 61 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 131 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 188 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
typedef unsigned int wint_t;
# 317 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 14 "/usr/include/_G_config.h" 2 3
# 1 "/usr/include/wchar.h" 1 3
# 43 "/usr/include/wchar.h" 3
# 1 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 1 3
# 19 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 61 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 131 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 190 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 271 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 317 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 45 "/usr/include/wchar.h" 2 3
# 1 "/usr/include/bits/wchar.h" 1 3
# 47 "/usr/include/wchar.h" 2 3
typedef struct
{
int __count;
union
{
wint_t __wch;
char __wchb[4];
} __value;
} __mbstate_t;
# 681 "/usr/include/wchar.h" 3
# 24 "/usr/include/_G_config.h" 2 3
typedef struct
{
__off_t __pos;
__mbstate_t __state;
} _G_fpos_t;
typedef struct
{
__off64_t __pos;
__mbstate_t __state;
} _G_fpos64_t;
# 1 "/usr/include/gconv.h" 1 3
# 1 "/usr/include/wchar.h" 1 3
# 43 "/usr/include/wchar.h" 3
# 1 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 1 3
# 19 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 61 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 131 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 190 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 271 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 317 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 45 "/usr/include/wchar.h" 2 3
# 73 "/usr/include/wchar.h" 3
# 681 "/usr/include/wchar.h" 3
# 28 "/usr/include/gconv.h" 2 3
# 1 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 1 3
# 19 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 61 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 131 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 188 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 271 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 283 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 317 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 30 "/usr/include/gconv.h" 2 3
enum
{
__GCONV_OK = 0,
__GCONV_NOCONV,
__GCONV_NODB,
__GCONV_NOMEM,
__GCONV_EMPTY_INPUT,
__GCONV_FULL_OUTPUT,
__GCONV_ILLEGAL_INPUT,
__GCONV_INCOMPLETE_INPUT,
__GCONV_ILLEGAL_DESCRIPTOR,
__GCONV_INTERNAL_ERROR
};
enum
{
__GCONV_IS_LAST = 0x0001,
__GCONV_IGNORE_ERRORS = 0x0002
};
struct __gconv_step;
struct __gconv_step_data;
struct __gconv_loaded_object;
struct __gconv_trans_data;
typedef int (*__gconv_fct) (struct __gconv_step *, struct __gconv_step_data *,
__const unsigned char **, __const unsigned char *,
unsigned char **, size_t *, int, int);
typedef int (*__gconv_init_fct) (struct __gconv_step *);
typedef void (*__gconv_end_fct) (struct __gconv_step *);
typedef int (*__gconv_trans_fct) (struct __gconv_step *,
struct __gconv_step_data *, void *,
__const unsigned char *,
__const unsigned char **,
__const unsigned char *, unsigned char **,
size_t *);
typedef int (*__gconv_trans_context_fct) (void *, __const unsigned char *,
__const unsigned char *,
unsigned char *, unsigned char *);
typedef int (*__gconv_trans_query_fct) (__const char *, __const char ***,
size_t *);
typedef int (*__gconv_trans_init_fct) (void **, const char *);
typedef void (*__gconv_trans_end_fct) (void *);
struct __gconv_trans_data
{
__gconv_trans_fct __trans_fct;
__gconv_trans_context_fct __trans_context_fct;
__gconv_trans_end_fct __trans_end_fct;
void *__data;
struct __gconv_trans_data *__next;
};
struct __gconv_step
{
struct __gconv_loaded_object *__shlib_handle;
__const char *__modname;
int __counter;
__const char *__from_name;
__const char *__to_name;
__gconv_fct __fct;
__gconv_init_fct __init_fct;
__gconv_end_fct __end_fct;
int __min_needed_from;
int __max_needed_from;
int __min_needed_to;
int __max_needed_to;
int __stateful;
void *__data;
};
struct __gconv_step_data
{
unsigned char *__outbuf;
unsigned char *__outbufend;
int __flags;
int __invocation_counter;
int __internal_use;
__mbstate_t *__statep;
__mbstate_t __state;
struct __gconv_trans_data *__trans;
};
typedef struct __gconv_info
{
size_t __nsteps;
struct __gconv_step *__steps;
__extension__ struct __gconv_step_data __data[0];
} *__gconv_t;
# 44 "/usr/include/_G_config.h" 2 3
typedef union
{
struct __gconv_info __cd;
struct
{
struct __gconv_info __cd;
struct __gconv_step_data __data;
} __combined;
} _G_iconv_t;
typedef int _G_int16_t __attribute__ ((__mode__ (__HI__)));
typedef int _G_int32_t __attribute__ ((__mode__ (__SI__)));
typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__)));
typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
# 151 "/usr/include/g++/stl_config.h" 2 3
# 234 "/usr/include/g++/stl_config.h" 3
# 248 "/usr/include/g++/stl_config.h" 3
# 316 "/usr/include/g++/stl_config.h" 3
# 36 "/usr/include/g++/stl_algobase.h" 2 3
# 1 "/usr/include/g++/stl_relops.h" 1 3
template <class _Tp>
inline bool operator!=(const _Tp& __x, const _Tp& __y) {
return !(__x == __y);
}
template <class _Tp>
inline bool operator>(const _Tp& __x, const _Tp& __y) {
return __y < __x;
}
template <class _Tp>
inline bool operator<=(const _Tp& __x, const _Tp& __y) {
return !(__y < __x);
}
template <class _Tp>
inline bool operator>=(const _Tp& __x, const _Tp& __y) {
return !(__x < __y);
}
# 39 "/usr/include/g++/stl_algobase.h" 2 3
# 1 "/usr/include/g++/stl_pair.h" 1 3
template <class _T1, class _T2>
struct pair {
typedef _T1 first_type;
typedef _T2 second_type;
_T1 first;
_T2 second;
pair() : first(_T1()), second(_T2()) {}
pair(const _T1& __a, const _T2& __b) : first(__a), second(__b) {}
template <class _U1, class _U2>
pair(const pair<_U1, _U2>& __p) : first(__p.first), second(__p.second) {}
};
template <class _T1, class _T2>
inline bool operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
{
return __x.first == __y.first && __x.second == __y.second;
}
template <class _T1, class _T2>
inline bool operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
{
return __x.first < __y.first ||
(!(__y.first < __x.first) && __x.second < __y.second);
}
template <class _T1, class _T2>
inline pair<_T1, _T2> make_pair(const _T1& __x, const _T2& __y)
{
return pair<_T1, _T2>(__x, __y);
}
# 42 "/usr/include/g++/stl_algobase.h" 2 3
# 1 "/usr/include/g++/type_traits.h" 1 3
struct __true_type {
};
struct __false_type {
};
template <class _Tp>
struct __type_traits {
typedef __true_type this_dummy_member_must_be_first;
typedef __false_type has_trivial_default_constructor;
typedef __false_type has_trivial_copy_constructor;
typedef __false_type has_trivial_assignment_operator;
typedef __false_type has_trivial_destructor;
typedef __false_type is_POD_type;
};
template<> struct __type_traits<bool> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
typedef __true_type has_trivial_destructor;
typedef __true_type is_POD_type;
};
template<> struct __type_traits<char> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
typedef __true_type has_trivial_destructor;
typedef __true_type is_POD_type;
};
template<> struct __type_traits<signed char> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
typedef __true_type has_trivial_destructor;
typedef __true_type is_POD_type;
};
template<> struct __type_traits<unsigned char> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
typedef __true_type has_trivial_destructor;
typedef __true_type is_POD_type;
};
template<> struct __type_traits<wchar_t> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
typedef __true_type has_trivial_destructor;
typedef __true_type is_POD_type;
};
template<> struct __type_traits<short> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
typedef __true_type has_trivial_destructor;
typedef __true_type is_POD_type;
};
template<> struct __type_traits<unsigned short> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
typedef __true_type has_trivial_destructor;
typedef __true_type is_POD_type;
};
template<> struct __type_traits<int> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
typedef __true_type has_trivial_destructor;
typedef __true_type is_POD_type;
};
template<> struct __type_traits<unsigned int> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
typedef __true_type has_trivial_destructor;
typedef __true_type is_POD_type;
};
template<> struct __type_traits<long> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
typedef __true_type has_trivial_destructor;
typedef __true_type is_POD_type;
};
template<> struct __type_traits<unsigned long> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
typedef __true_type has_trivial_destructor;
typedef __true_type is_POD_type;
};
template<> struct __type_traits<long long> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
typedef __true_type has_trivial_destructor;
typedef __true_type is_POD_type;
};
template<> struct __type_traits<unsigned long long> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
typedef __true_type has_trivial_destructor;
typedef __true_type is_POD_type;
};
template<> struct __type_traits<float> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
typedef __true_type has_trivial_destructor;
typedef __true_type is_POD_type;
};
template<> struct __type_traits<double> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
typedef __true_type has_trivial_destructor;
typedef __true_type is_POD_type;
};
template<> struct __type_traits<long double> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
typedef __true_type has_trivial_destructor;
typedef __true_type is_POD_type;
};
template <class _Tp>
struct __type_traits<_Tp*> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
typedef __true_type has_trivial_destructor;
typedef __true_type is_POD_type;
};
# 295 "/usr/include/g++/type_traits.h" 3
template <class _Tp> struct _Is_integer {
typedef __false_type _Integral;
};
template<> struct _Is_integer<bool> {
typedef __true_type _Integral;
};
template<> struct _Is_integer<char> {
typedef __true_type _Integral;
};
template<> struct _Is_integer<signed char> {
typedef __true_type _Integral;
};
template<> struct _Is_integer<unsigned char> {
typedef __true_type _Integral;
};
template<> struct _Is_integer<wchar_t> {
typedef __true_type _Integral;
};
template<> struct _Is_integer<short> {
typedef __true_type _Integral;
};
template<> struct _Is_integer<unsigned short> {
typedef __true_type _Integral;
};
template<> struct _Is_integer<int> {
typedef __true_type _Integral;
};
template<> struct _Is_integer<unsigned int> {
typedef __true_type _Integral;
};
template<> struct _Is_integer<long> {
typedef __true_type _Integral;
};
template<> struct _Is_integer<unsigned long> {
typedef __true_type _Integral;
};
template<> struct _Is_integer<long long> {
typedef __true_type _Integral;
};
template<> struct _Is_integer<unsigned long long> {
typedef __true_type _Integral;
};
# 45 "/usr/include/g++/stl_algobase.h" 2 3
# 1 "/usr/include/string.h" 1 3
extern "C" {
# 1 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 1 3
# 19 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 61 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 131 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 188 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 271 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 283 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 317 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 33 "/usr/include/string.h" 2 3
extern void *memcpy (void *__restrict __dest,
__const void *__restrict __src, size_t __n) throw () ;
extern void *memmove (void *__dest, __const void *__src, size_t __n)
throw () ;
extern void *memccpy (void *__restrict __dest, __const void *__restrict __src,
int __c, size_t __n)
throw () ;
extern void *memset (void *__s, int __c, size_t __n) throw () ;
extern int memcmp (__const void *__s1, __const void *__s2, size_t __n)
throw () ;
extern void *memchr (__const void *__s, int __c, size_t __n)
throw () ;
extern void *rawmemchr (__const void *__s, int __c) throw () ;
extern void *memrchr (__const void *__s, int __c, size_t __n)
throw () ;
extern char *strcpy (char *__restrict __dest, __const char *__restrict __src)
throw () ;
extern char *strncpy (char *__restrict __dest,
__const char *__restrict __src, size_t __n) throw () ;
extern char *strcat (char *__restrict __dest, __const char *__restrict __src)
throw () ;
extern char *strncat (char *__restrict __dest, __const char *__restrict __src,
size_t __n) throw () ;
extern int strcmp (__const char *__s1, __const char *__s2)
throw () ;
extern int strncmp (__const char *__s1, __const char *__s2, size_t __n)
throw () ;
extern int strcoll (__const char *__s1, __const char *__s2)
throw () ;
extern size_t strxfrm (char *__restrict __dest,
__const char *__restrict __src, size_t __n) throw () ;
# 1 "/usr/include/xlocale.h" 1 3
typedef struct __locale_struct
{
struct locale_data *__locales[13];
const unsigned short int *__ctype_b;
const int *__ctype_tolower;
const int *__ctype_toupper;
} *__locale_t;
# 108 "/usr/include/string.h" 2 3
extern int __strcoll_l (__const char *__s1, __const char *__s2, __locale_t __l)
throw () ;
extern size_t __strxfrm_l (char *__dest, __const char *__src, size_t __n,
__locale_t __l) throw () ;
extern char *strdup (__const char *__s) throw () ;
extern char *strndup (__const char *__string, size_t __n)
throw () ;
# 152 "/usr/include/string.h" 3
extern char *strchr (__const char *__s, int __c) throw () ;
extern char *strrchr (__const char *__s, int __c) throw () ;
extern char *strchrnul (__const char *__s, int __c) throw () ;
extern size_t strcspn (__const char *__s, __const char *__reject)
throw () ;
extern size_t strspn (__const char *__s, __const char *__accept)
throw () ;
extern char *strpbrk (__const char *__s, __const char *__accept)
throw () ;
extern char *strstr (__const char *__haystack, __const char *__needle)
throw () ;
extern char *strcasestr (__const char *__haystack, __const char *__needle)
throw () ;
extern char *strtok (char *__restrict __s, __const char *__restrict __delim)
throw () ;
extern char *__strtok_r (char *__restrict __s,
__const char *__restrict __delim,
char **__restrict __save_ptr) throw () ;
extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim,
char **__restrict __save_ptr) throw () ;
extern void *memmem (__const void *__haystack, size_t __haystacklen,
__const void *__needle, size_t __needlelen)
throw () ;
extern void *__mempcpy (void *__restrict __dest,
__const void *__restrict __src, size_t __n) throw () ;
extern void *mempcpy (void *__restrict __dest,
__const void *__restrict __src, size_t __n) throw () ;
extern size_t strlen (__const char *__s) throw () ;
extern size_t strnlen (__const char *__string, size_t __maxlen)
throw () ;
extern char *strerror (int __errnum) throw () ;
extern char *__strerror_r (int __errnum, char *__buf, size_t __buflen) throw () ;
extern char *strerror_r (int __errnum, char *__buf, size_t __buflen) throw () ;
extern void __bzero (void *__s, size_t __n) throw () ;
extern void bcopy (__const void *__src, void *__dest, size_t __n) throw () ;
extern void bzero (void *__s, size_t __n) throw () ;
extern int bcmp (__const void *__s1, __const void *__s2, size_t __n)
throw () ;
extern char *index (__const char *__s, int __c) throw () ;
extern char *rindex (__const char *__s, int __c) throw () ;
extern int __ffs (int __i) throw () __attribute__ ((const));
extern int ffs (int __i) throw () __attribute__ ((const));
extern int ffsl (long int __l) throw () __attribute__ ((const));
__extension__ extern int ffsll (long long int __ll)
throw () __attribute__ ((const));
extern int strcasecmp (__const char *__s1, __const char *__s2)
throw () ;
extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n)
throw () ;
extern int __strcasecmp_l (__const char *__s1, __const char *__s2,
__locale_t __loc) throw () ;
extern int __strncasecmp_l (__const char *__s1, __const char *__s2,
size_t __n, __locale_t __loc)
throw () ;
extern char *strsep (char **__restrict __stringp,
__const char *__restrict __delim) throw () ;
extern int strverscmp (__const char *__s1, __const char *__s2)
throw () ;
extern char *strsignal (int __sig) throw () ;
extern char *__stpcpy (char *__restrict __dest, __const char *__restrict __src)
throw () ;
extern char *stpcpy (char *__restrict __dest, __const char *__restrict __src)
throw () ;
extern char *__stpncpy (char *__restrict __dest,
__const char *__restrict __src, size_t __n) throw () ;
extern char *stpncpy (char *__restrict __dest,
__const char *__restrict __src, size_t __n) throw () ;
extern char *strfry (char *__string) throw () ;
extern void *memfrob (void *__s, size_t __n) throw () ;
extern char *basename (__const char *__filename) throw () ;
# 362 "/usr/include/string.h" 3
}
# 48 "/usr/include/g++/stl_algobase.h" 2 3
# 1 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/limits.h" 1 3
# 1 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/syslimits.h" 1 3
# 1 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/limits.h" 1 3
# 114 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/limits.h" 3
# 1 "/usr/include/limits.h" 1 3
# 113 "/usr/include/limits.h" 3
# 140 "/usr/include/limits.h" 3
# 1 "/usr/include/bits/posix1_lim.h" 1 3
# 1 "/usr/include/bits/local_lim.h" 1 3
# 1 "/usr/include/linux/limits.h" 1 3
# 36 "/usr/include/bits/local_lim.h" 2 3
# 126 "/usr/include/bits/posix1_lim.h" 2 3
# 144 "/usr/include/limits.h" 2 3
# 1 "/usr/include/bits/posix2_lim.h" 1 3
# 148 "/usr/include/limits.h" 2 3
# 1 "/usr/include/bits/xopen_lim.h" 1 3
# 1 "/usr/include/bits/stdio_lim.h" 1 3
# 32 "/usr/include/bits/stdio_lim.h" 3
# 35 "/usr/include/bits/xopen_lim.h" 2 3
# 117 "/usr/include/bits/xopen_lim.h" 3
# 136 "/usr/include/bits/xopen_lim.h" 3
# 1 "/usr/include/bits/wordsize.h" 1 3
# 137 "/usr/include/bits/xopen_lim.h" 2 3
# 152 "/usr/include/limits.h" 2 3
# 117 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/limits.h" 2 3
# 7 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/syslimits.h" 2 3
# 11 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/limits.h" 2 3
# 49 "/usr/include/g++/stl_algobase.h" 2 3
# 1 "/usr/include/stdlib.h" 1 3
# 1 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 1 3
# 19 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 61 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 131 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 188 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 269 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 283 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 317 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 33 "/usr/include/stdlib.h" 2 3
extern "C" {
# 1 "/usr/include/bits/waitflags.h" 1 3
# 42 "/usr/include/stdlib.h" 2 3
# 1 "/usr/include/bits/waitstatus.h" 1 3
# 1 "/usr/include/endian.h" 1 3
# 1 "/usr/include/bits/endian.h" 1 3
# 37 "/usr/include/endian.h" 2 3
# 63 "/usr/include/bits/waitstatus.h" 2 3
union wait
{
int w_status;
struct
{
unsigned int __w_termsig:7;
unsigned int __w_coredump:1;
unsigned int __w_retcode:8;
unsigned int:16;
} __wait_terminated;
struct
{
unsigned int __w_stopval:8;
unsigned int __w_stopsig:8;
unsigned int:16;
} __wait_stopped;
};
# 43 "/usr/include/stdlib.h" 2 3
# 74 "/usr/include/stdlib.h" 3
typedef struct
{
int quot;
int rem;
} div_t;
typedef struct
{
long int quot;
long int rem;
} ldiv_t;
__extension__ typedef struct
{
long long int quot;
long long int rem;
} lldiv_t;
extern size_t __ctype_get_mb_cur_max (void) throw () ;
extern double atof (__const char *__nptr) throw () ;
extern int atoi (__const char *__nptr) throw () ;
extern long int atol (__const char *__nptr) throw () ;
__extension__ extern long long int atoll (__const char *__nptr)
throw () ;
extern double strtod (__const char *__restrict __nptr,
char **__restrict __endptr) throw () ;
extern float strtof (__const char *__restrict __nptr,
char **__restrict __endptr) throw () ;
extern long double strtold (__const char *__restrict __nptr,
char **__restrict __endptr) throw () ;
extern long int strtol (__const char *__restrict __nptr,
char **__restrict __endptr, int __base) throw () ;
extern unsigned long int strtoul (__const char *__restrict __nptr,
char **__restrict __endptr, int __base)
throw () ;
__extension__
extern long long int strtoq (__const char *__restrict __nptr,
char **__restrict __endptr, int __base) throw () ;
__extension__
extern unsigned long long int strtouq (__const char *__restrict __nptr,
char **__restrict __endptr, int __base)
throw () ;
__extension__
extern long long int strtoll (__const char *__restrict __nptr,
char **__restrict __endptr, int __base) throw () ;
__extension__
extern unsigned long long int strtoull (__const char *__restrict __nptr,
char **__restrict __endptr, int __base)
throw () ;
extern long int __strtol_l (__const char *__restrict __nptr,
char **__restrict __endptr, int __base,
__locale_t __loc) throw () ;
extern unsigned long int __strtoul_l (__const char *__restrict __nptr,
char **__restrict __endptr,
int __base, __locale_t __loc) throw () ;
__extension__
extern long long int __strtoll_l (__const char *__restrict __nptr,
char **__restrict __endptr, int __base,
__locale_t __loc) throw () ;
__extension__
extern unsigned long long int __strtoull_l (__const char *__restrict __nptr,
char **__restrict __endptr,
int __base, __locale_t __loc)
throw () ;
extern double __strtod_l (__const char *__restrict __nptr,
char **__restrict __endptr, __locale_t __loc)
throw () ;
extern float __strtof_l (__const char *__restrict __nptr,
char **__restrict __endptr, __locale_t __loc) throw () ;
extern long double __strtold_l (__const char *__restrict __nptr,
char **__restrict __endptr,
__locale_t __loc) throw () ;
extern double __strtod_internal (__const char *__restrict __nptr,
char **__restrict __endptr, int __group)
throw () ;
extern float __strtof_internal (__const char *__restrict __nptr,
char **__restrict __endptr, int __group)
throw () ;
extern long double __strtold_internal (__const char *__restrict __nptr,
char **__restrict __endptr,
int __group) throw () ;
extern long int __strtol_internal (__const char *__restrict __nptr,
char **__restrict __endptr,
int __base, int __group) throw () ;
extern unsigned long int __strtoul_internal (__const char *__restrict __nptr,
char **__restrict __endptr,
int __base, int __group) throw () ;
__extension__
extern long long int __strtoll_internal (__const char *__restrict __nptr,
char **__restrict __endptr,
int __base, int __group) throw () ;
__extension__
extern unsigned long long int __strtoull_internal (__const char *
__restrict __nptr,
char **__restrict __endptr,
int __base, int __group)
throw () ;
# 378 "/usr/include/stdlib.h" 3
extern char *l64a (long int __n) throw () ;
extern long int a64l (__const char *__s) throw () ;
# 1 "/usr/include/sys/types.h" 1 3
extern "C" {
typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;
typedef __loff_t loff_t;
typedef __ino_t ino_t;
typedef __ino64_t ino64_t;
typedef __dev_t dev_t;
typedef __gid_t gid_t;
typedef __mode_t mode_t;
typedef __nlink_t nlink_t;
typedef __uid_t uid_t;
typedef __off_t off_t;
typedef __off64_t off64_t;
typedef __pid_t pid_t;
typedef __id_t id_t;
typedef __ssize_t ssize_t;
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;
typedef __key_t key_t;
# 1 "/usr/include/time.h" 1 3
# 51 "/usr/include/time.h" 3
typedef __clock_t clock_t;
typedef __time_t time_t;
typedef __clockid_t clockid_t;
typedef __timer_t timer_t;
# 112 "/usr/include/time.h" 3
# 364 "/usr/include/time.h" 3
# 126 "/usr/include/sys/types.h" 2 3
typedef __useconds_t useconds_t;
typedef __suseconds_t suseconds_t;
# 1 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 1 3
# 19 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 61 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 131 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 188 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 271 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 283 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 317 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 140 "/usr/include/sys/types.h" 2 3
typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;
# 174 "/usr/include/sys/types.h" 3
typedef int int8_t __attribute__ ((__mode__ ( __QI__ ))) ;
typedef int int16_t __attribute__ ((__mode__ ( __HI__ ))) ;
typedef int int32_t __attribute__ ((__mode__ ( __SI__ ))) ;
typedef int int64_t __attribute__ ((__mode__ ( __DI__ ))) ;
typedef unsigned int u_int8_t __attribute__ ((__mode__ ( __QI__ ))) ;
typedef unsigned int u_int16_t __attribute__ ((__mode__ ( __HI__ ))) ;
typedef unsigned int u_int32_t __attribute__ ((__mode__ ( __SI__ ))) ;
typedef unsigned int u_int64_t __attribute__ ((__mode__ ( __DI__ ))) ;
typedef int register_t __attribute__ ((__mode__ (__word__)));
# 1 "/usr/include/sys/select.h" 1 3
# 1 "/usr/include/bits/select.h" 1 3
# 36 "/usr/include/bits/select.h" 3
# 56 "/usr/include/bits/select.h" 3
# 72 "/usr/include/bits/select.h" 3
# 31 "/usr/include/sys/select.h" 2 3
# 1 "/usr/include/bits/sigset.h" 1 3
typedef int __sig_atomic_t;
typedef struct
{
unsigned long int __val[(1024 / (8 * sizeof (unsigned long int))) ];
} __sigset_t;
# 125 "/usr/include/bits/sigset.h" 3
# 34 "/usr/include/sys/select.h" 2 3
# 1 "/usr/include/time.h" 1 3
# 51 "/usr/include/time.h" 3
# 61 "/usr/include/time.h" 3
# 72 "/usr/include/time.h" 3
# 84 "/usr/include/time.h" 3
# 96 "/usr/include/time.h" 3
struct timespec
{
long int tv_sec;
long int tv_nsec;
};
# 364 "/usr/include/time.h" 3
# 38 "/usr/include/sys/select.h" 2 3
extern "C" {
struct timeval;
typedef __fd_mask fd_mask;
typedef __fd_set fd_set;
extern int select (int __nfds, __fd_set *__restrict __readfds,
__fd_set *__restrict __writefds,
__fd_set *__restrict __exceptfds,
struct timeval *__restrict __timeout) throw () ;
extern int pselect (int __nfds, __fd_set *__restrict __readfds,
__fd_set *__restrict __writefds,
__fd_set *__restrict __exceptfds,
const struct timespec *__restrict __timeout,
const __sigset_t *__restrict __sigmask) throw () ;
}
# 209 "/usr/include/sys/types.h" 2 3
# 1 "/usr/include/sys/sysmacros.h" 1 3
# 47 "/usr/include/sys/sysmacros.h" 3
# 212 "/usr/include/sys/types.h" 2 3
typedef __blksize_t blksize_t;
typedef __blkcnt_t blkcnt_t;
typedef __fsblkcnt_t fsblkcnt_t;
typedef __fsfilcnt_t fsfilcnt_t;
# 248 "/usr/include/sys/types.h" 3
typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;
}
# 391 "/usr/include/stdlib.h" 2 3
extern int32_t random (void) throw () ;
extern void srandom (unsigned int __seed) throw () ;
extern char *initstate (unsigned int __seed, char *__statebuf,
size_t __statelen) throw () ;
extern char *setstate (char *__statebuf) throw () ;
struct random_data
{
int32_t *fptr;
int32_t *rptr;
int32_t *state;
int rand_type;
int rand_deg;
int rand_sep;
int32_t *end_ptr;
};
extern int random_r (struct random_data *__restrict __buf,
int32_t *__restrict __result) throw () ;
extern int srandom_r (unsigned int __seed, struct random_data *__buf) throw () ;
extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
size_t __statelen,
struct random_data *__restrict __buf) throw () ;
extern int setstate_r (char *__restrict __statebuf,
struct random_data *__restrict __buf) throw () ;
extern int rand (void) throw () ;
extern void srand (unsigned int __seed) throw () ;
extern int rand_r (unsigned int *__seed) throw () ;
extern double drand48 (void) throw () ;
extern double erand48 (unsigned short int __xsubi[3]) throw () ;
extern long int lrand48 (void) throw () ;
extern long int nrand48 (unsigned short int __xsubi[3]) throw () ;
extern long int mrand48 (void) throw () ;
extern long int jrand48 (unsigned short int __xsubi[3]) throw () ;
extern void srand48 (long int __seedval) throw () ;
extern unsigned short int *seed48 (unsigned short int __seed16v[3]) throw () ;
extern void lcong48 (unsigned short int __param[7]) throw () ;
struct drand48_data
{
unsigned short int x[3];
unsigned short int a[3];
unsigned short int c;
unsigned short int old_x[3];
int init;
};
extern int drand48_r (struct drand48_data *__restrict __buffer,
double *__restrict __result) throw () ;
extern int erand48_r (unsigned short int __xsubi[3],
struct drand48_data *__restrict __buffer,
double *__restrict __result) throw () ;
extern int lrand48_r (struct drand48_data *__restrict __buffer,
long int *__restrict __result) throw () ;
extern int nrand48_r (unsigned short int __xsubi[3],
struct drand48_data *__restrict __buffer,
long int *__restrict __result) throw () ;
extern int mrand48_r (struct drand48_data *__restrict __buffer,
long int *__restrict __result) throw () ;
extern int jrand48_r (unsigned short int __xsubi[3],
struct drand48_data *__restrict __buffer,
long int *__restrict __result) throw () ;
extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
throw () ;
extern int seed48_r (unsigned short int __seed16v[3],
struct drand48_data *__buffer) throw () ;
extern int lcong48_r (unsigned short int __param[7],
struct drand48_data *__buffer) throw () ;
extern void *malloc (size_t __size) throw () ;
extern void *calloc (size_t __nmemb, size_t __size)
throw () ;
extern void *realloc (void *__ptr, size_t __size) throw () ;
extern void free (void *__ptr) throw () ;
extern void cfree (void *__ptr) throw () ;
# 1 "/usr/include/alloca.h" 1 3
# 1 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 1 3
# 19 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 61 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 131 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 188 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 271 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 283 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 317 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 25 "/usr/include/alloca.h" 2 3
extern "C" {
extern void *alloca (size_t __size) throw () ;
}
# 545 "/usr/include/stdlib.h" 2 3
extern void *valloc (size_t __size) throw () ;
extern int posix_memalign (void **memptr, size_t alignment, size_t size)
throw () ;
extern void abort (void) throw () __attribute__ ((__noreturn__));
extern int atexit (void (*__func) (void)) throw () ;
extern int __on_exit (void (*__func) (int __status, void *__arg), void *__arg)
throw () ;
extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
throw () ;
extern void exit (int __status) throw () __attribute__ ((__noreturn__));
extern void _Exit (int __status) throw () __attribute__ ((__noreturn__));
extern char *getenv (__const char *__name) throw () ;
extern char *__secure_getenv (__const char *__name) throw () ;
extern int putenv (char *__string) throw () ;
extern int setenv (__const char *__name, __const char *__value, int __replace)
throw () ;
extern void unsetenv (__const char *__name) throw () ;
extern int clearenv (void) throw () ;
extern char *mktemp (char *__template) throw () ;
extern int mkstemp (char *__template) throw () ;
extern int mkstemp64 (char *__template) throw () ;
extern char *mkdtemp (char *__template) throw () ;
extern int system (__const char *__command) throw () ;
extern char *canonicalize_file_name (__const char *__name) throw () ;
extern char *realpath (__const char *__restrict __name,
char *__restrict __resolved) throw () ;
typedef int (*__compar_fn_t) (__const void *, __const void *);
typedef __compar_fn_t comparison_fn_t;
extern void *bsearch (__const void *__key, __const void *__base,
size_t __nmemb, size_t __size, __compar_fn_t __compar);
extern void qsort (void *__base, size_t __nmemb, size_t __size,
__compar_fn_t __compar);
extern int abs (int __x) throw () __attribute__ ((__const__));
extern long int labs (long int __x) throw () __attribute__ ((__const__));
__extension__ extern long long int llabs (long long int __x)
throw () __attribute__ ((__const__));
extern div_t div (int __numer, int __denom)
throw () __attribute__ ((__const__));
extern ldiv_t ldiv (long int __numer, long int __denom)
throw () __attribute__ ((__const__));
__extension__ extern lldiv_t lldiv (long long int __numer,
long long int __denom)
throw () __attribute__ ((__const__));
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
int *__restrict __sign) throw () ;
extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
int *__restrict __sign) throw () ;
extern char *gcvt (double __value, int __ndigit, char *__buf) throw () ;
extern char *qecvt (long double __value, int __ndigit,
int *__restrict __decpt, int *__restrict __sign) throw () ;
extern char *qfcvt (long double __value, int __ndigit,
int *__restrict __decpt, int *__restrict __sign) throw () ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf) throw () ;
extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
int *__restrict __sign, char *__restrict __buf,
size_t __len) throw () ;
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
int *__restrict __sign, char *__restrict __buf,
size_t __len) throw () ;
extern int qecvt_r (long double __value, int __ndigit,
int *__restrict __decpt, int *__restrict __sign,
char *__restrict __buf, size_t __len) throw () ;
extern int qfcvt_r (long double __value, int __ndigit,
int *__restrict __decpt, int *__restrict __sign,
char *__restrict __buf, size_t __len) throw () ;
extern int mblen (__const char *__s, size_t __n) throw () ;
extern int mbtowc (wchar_t *__restrict __pwc,
__const char *__restrict __s, size_t __n) throw () ;
extern int wctomb (char *__s, wchar_t __wchar) throw () ;
extern size_t mbstowcs (wchar_t *__restrict __pwcs,
__const char *__restrict __s, size_t __n) throw () ;
extern size_t wcstombs (char *__restrict __s,
__const wchar_t *__restrict __pwcs, size_t __n)
throw () ;
extern int rpmatch (__const char *__response) throw () ;
extern int getsubopt (char **__restrict __optionp,
char *__const *__restrict __tokens,
char **__restrict __valuep) throw () ;
extern void setkey (__const char *__key) throw () ;
extern int grantpt (int __fd) throw () ;
extern int unlockpt (int __fd) throw () ;
extern char *ptsname (int __fd) throw () ;
extern int ptsname_r (int __fd, char *__buf, size_t __buflen) throw () ;
extern int getpt (void) throw () ;
extern int getloadavg (double __loadavg[], int __nelem) throw () ;
}
# 50 "/usr/include/g++/stl_algobase.h" 2 3
# 1 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 1 3
# 61 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
typedef int ptrdiff_t;
# 188 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 269 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 317 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 51 "/usr/include/g++/stl_algobase.h" 2 3
# 1 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/new.h" 1 3
# 1 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/new" 1 3
#pragma interface "new"
# 1 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 1 3
# 342 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 8 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/new" 2 3
# 1 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/exception" 1 3
#pragma interface "exception"
extern "C++" {
namespace std {
class exception {
public:
exception () { }
virtual ~exception () { }
virtual const char* what () const;
};
class bad_exception : public exception {
public:
bad_exception () { }
virtual ~bad_exception () { }
};
typedef void (*terminate_handler) ();
typedef void (*unexpected_handler) ();
terminate_handler set_terminate (terminate_handler);
void terminate () __attribute__ ((__noreturn__));
unexpected_handler set_unexpected (unexpected_handler);
void unexpected () __attribute__ ((__noreturn__));
bool uncaught_exception ();
}
}
# 9 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/new" 2 3
extern "C++" {
namespace std {
class bad_alloc : public exception {
public:
virtual const char* what() const throw() { return "bad_alloc"; }
};
struct nothrow_t {};
extern const nothrow_t nothrow;
typedef void (*new_handler)();
new_handler set_new_handler (new_handler);
}
void *operator new (size_t) throw (std::bad_alloc);
void *operator new[] (size_t) throw (std::bad_alloc);
void operator delete (void *) throw();
void operator delete[] (void *) throw();
void *operator new (size_t, const std::nothrow_t&) throw();
void *operator new[] (size_t, const std::nothrow_t&) throw();
void operator delete (void *, const std::nothrow_t&) throw();
void operator delete[] (void *, const std::nothrow_t&) throw();
inline void *operator new(size_t, void *place) throw() { return place; }
inline void *operator new[](size_t, void *place) throw() { return place; }
}
# 6 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/new.h" 2 3
using std::new_handler;
using std::set_new_handler;
# 52 "/usr/include/g++/stl_algobase.h" 2 3
# 1 "/usr/include/g++/iostream.h" 1 3
#pragma interface
# 1 "/usr/include/g++/streambuf.h" 1 3
#pragma interface
extern "C" {
# 1 "/usr/include/libio.h" 1 3
# 1 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stdarg.h" 1 3
typedef void *__gnuc_va_list;
# 122 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stdarg.h" 3
# 209 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stdarg.h" 3
# 51 "/usr/include/libio.h" 2 3
# 70 "/usr/include/libio.h" 3
# 101 "/usr/include/libio.h" 3
struct _IO_jump_t; struct _IO_FILE;
typedef void _IO_lock_t;
struct _IO_marker {
struct _IO_marker *_next;
struct _IO_FILE *_sbuf;
int _pos;
# 190 "/usr/include/libio.h" 3
};
enum __codecvt_result
{
__codecvt_ok,
__codecvt_partial,
__codecvt_error,
__codecvt_noconv
};
# 261 "/usr/include/libio.h" 3
struct _IO_FILE {
int _flags;
char* _IO_read_ptr;
char* _IO_read_end;
char* _IO_read_base;
char* _IO_write_base;
char* _IO_write_ptr;
char* _IO_write_end;
char* _IO_buf_base;
char* _IO_buf_end;
char *_IO_save_base;
char *_IO_backup_base;
char *_IO_save_end;
struct _IO_marker *_markers;
struct _IO_FILE *_chain;
int _fileno;
int _blksize;
__off_t _old_offset;
unsigned short _cur_column;
signed char _vtable_offset;
char _shortbuf[1];
_IO_lock_t *_lock;
__off64_t _offset;
void *__pad1;
void *__pad2;
int _mode;
char _unused2[15 * sizeof (int) - 2 * sizeof (void *)];
};
struct _IO_FILE_plus;
extern struct _IO_FILE_plus _IO_2_1_stdin_;
extern struct _IO_FILE_plus _IO_2_1_stdout_;
extern struct _IO_FILE_plus _IO_2_1_stderr_;
typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);
typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf,
size_t __n);
typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w);
typedef int __io_close_fn (void *__cookie);
typedef __io_read_fn cookie_read_function_t;
typedef __io_write_fn cookie_write_function_t;
typedef __io_seek_fn cookie_seek_function_t;
typedef __io_close_fn cookie_close_function_t;
typedef struct
{
__io_read_fn *read;
__io_write_fn *write;
__io_seek_fn *seek;
__io_close_fn *close;
} _IO_cookie_io_functions_t;
typedef _IO_cookie_io_functions_t cookie_io_functions_t;
struct _IO_cookie_file;
extern void _IO_cookie_init (struct _IO_cookie_file *__cfile, int __read_write,
void *__cookie, _IO_cookie_io_functions_t __fns);
extern "C" {
extern int __underflow (_IO_FILE *) throw () ;
extern int __uflow (_IO_FILE *) throw () ;
extern int __overflow (_IO_FILE *, int) throw () ;
extern wint_t __wunderflow (_IO_FILE *) throw () ;
extern wint_t __wuflow (_IO_FILE *) throw () ;
extern wint_t __woverflow (_IO_FILE *, wint_t ) throw () ;
extern int _IO_getc (_IO_FILE *__fp) throw () ;
extern int _IO_putc (int __c, _IO_FILE *__fp) throw () ;
extern int _IO_feof (_IO_FILE *__fp) throw () ;
extern int _IO_ferror (_IO_FILE *__fp) throw () ;
extern int _IO_peekc_locked (_IO_FILE *__fp) throw () ;
extern void _IO_flockfile (_IO_FILE *) throw () ;
extern void _IO_funlockfile (_IO_FILE *) throw () ;
extern int _IO_ftrylockfile (_IO_FILE *) throw () ;
extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,
__gnuc_va_list , int *__restrict) throw () ;
extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
__gnuc_va_list ) throw () ;
extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t ) throw () ;
extern size_t _IO_sgetn (_IO_FILE *, void *, size_t ) throw () ;
extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t , int, int) throw () ;
extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t , int) throw () ;
extern void _IO_free_backup_area (_IO_FILE *) throw () ;
# 511 "/usr/include/libio.h" 3
}
# 36 "/usr/include/g++/streambuf.h" 2 3
}
# 1 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stdarg.h" 1 3
void va_end (__gnuc_va_list);
# 175 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stdarg.h" 3
typedef __gnuc_va_list va_list;
# 40 "/usr/include/g++/streambuf.h" 2 3
extern "C++" {
class istream;
class ostream; class streambuf;
typedef __off64_t streamoff;
typedef __off64_t streampos;
typedef __ssize_t streamsize;
typedef unsigned long __fmtflags;
typedef unsigned char __iostate;
struct _ios_fields
{
streambuf *_strbuf;
ostream* _tie;
int _width;
__fmtflags _flags;
wchar_t _fill;
__iostate _state;
__iostate _exceptions;
int _precision;
void *_arrays;
};
# 124 "/usr/include/g++/streambuf.h" 3
class ios : public _ios_fields {
ios& operator=(ios&);
ios (const ios&);
public:
typedef __fmtflags fmtflags;
typedef int iostate;
typedef int openmode;
typedef __ssize_t streamsize;
enum io_state {
goodbit = 0 ,
eofbit = 1 ,
failbit = 2 ,
badbit = 4 };
enum open_mode {
in = 1 ,
out = 2 ,
ate = 4 ,
app = 8 ,
trunc = 16 ,
nocreate = 32 ,
noreplace = 64 ,
bin = 128 ,
binary = 128 };
enum seek_dir { beg, cur, end};
typedef enum seek_dir seekdir;
enum { skipws= 01 ,
left= 02 , right= 04 , internal= 010 ,
dec= 020 , oct= 040 , hex= 0100 ,
showbase= 0200 , showpoint= 0400 ,
uppercase= 01000 , showpos= 02000 ,
scientific= 04000 , fixed= 010000 ,
unitbuf= 020000 , stdio= 040000
};
enum {
basefield=dec+oct+hex,
floatfield = scientific+fixed,
adjustfield = left+right+internal
};
# 177 "/usr/include/g++/streambuf.h" 3
ostream* tie() const { return _tie; }
ostream* tie(ostream* val) { ostream* save=_tie; _tie=val; return save; }
wchar_t fill() const { return _fill; }
wchar_t fill(wchar_t newf)
{wchar_t oldf = _fill; _fill = newf; return oldf;}
fmtflags flags() const { return _flags; }
fmtflags flags(fmtflags new_val) {
fmtflags old_val = _flags; _flags = new_val; return old_val; }
int precision() const { return _precision; }
int precision(int newp) {
unsigned short oldp = _precision; _precision = (unsigned short)newp;
return oldp; }
fmtflags setf(fmtflags val) {
fmtflags oldbits = _flags;
_flags |= val; return oldbits; }
fmtflags setf(fmtflags val, fmtflags mask) {
fmtflags oldbits = _flags;
_flags = (_flags & ~mask) | (val & mask); return oldbits; }
fmtflags unsetf(fmtflags mask) {
fmtflags oldbits = _flags;
_flags &= ~mask; return oldbits; }
int width() const { return _width; }
int width(int val) { int save = _width; _width = val; return save; }
void _throw_failure() const { }
void clear(iostate state = 0) {
_state = _strbuf ? state : state|badbit;
if (_state & _exceptions) _throw_failure(); }
void set(iostate flag) { _state |= flag;
if (_state & _exceptions) _throw_failure(); }
void setstate(iostate flag) { _state |= flag;
if (_state & _exceptions) _throw_failure(); }
int good() const { return _state == 0; }
int eof() const { return _state & ios::eofbit; }
int fail() const { return _state & (ios::badbit|ios::failbit); }
int bad() const { return _state & ios::badbit; }
iostate rdstate() const { return _state; }
operator void*() const { return fail() ? (void*)0 : (void*)(-1); }
int operator!() const { return fail(); }
iostate exceptions() const { return _exceptions; }
void exceptions(iostate enable) {
_exceptions = enable;
if (_state & _exceptions) _throw_failure(); }
streambuf* rdbuf() const { return _strbuf; }
streambuf* rdbuf(streambuf *_s) {
streambuf *_old = _strbuf; _strbuf = _s; clear (); return _old; }
static int sync_with_stdio(int on);
static void sync_with_stdio() { sync_with_stdio(1); }
static fmtflags bitalloc();
static int xalloc();
void*& pword(int);
void* pword(int) const;
long& iword(int);
long iword(int) const;
class Init {
public:
Init () { }
};
protected:
inline ios(streambuf* sb = 0, ostream* tie_to = 0);
inline virtual ~ios();
inline void init(streambuf* sb, ostream* tie = 0);
};
typedef ios::seek_dir _seek_dir;
class streammarker : private _IO_marker {
friend class streambuf;
void set_offset(int offset) { _pos = offset; }
public:
streammarker(streambuf *sb);
~streammarker();
int saving() { return 1; }
int delta(streammarker&);
int delta();
};
struct streambuf : public _IO_FILE {
friend class ios;
friend class istream;
friend class ostream;
friend class streammarker;
const void *&_vtable() { return *(const void**)((_IO_FILE*)this + 1); }
protected:
static streambuf* _list_all;
_IO_FILE*& xchain() { return _chain; }
void _un_link();
void _link_in();
char* gptr() const
{ return _flags & 0x100 ? _IO_save_base : _IO_read_ptr; }
char* pptr() const { return _IO_write_ptr; }
char* egptr() const
{ return _flags & 0x100 ? _IO_save_end : _IO_read_end; }
char* epptr() const { return _IO_write_end; }
char* pbase() const { return _IO_write_base; }
char* eback() const
{ return _flags & 0x100 ? _IO_save_base : _IO_read_base;}
char* base() const { return _IO_buf_base; }
char* ebuf() const { return _IO_buf_end; }
int blen() const { return _IO_buf_end - _IO_buf_base; }
void xput_char(char c) { *_IO_write_ptr++ = c; }
int xflags() { return _flags ; }
int xflags(int f) {int fl = _flags ; _flags = f; return fl;}
void xsetflags(int f) { _flags |= f; }
void xsetflags(int f, int mask)
{ _flags = (_flags & ~mask) | (f & mask); }
void gbump(int n)
{ _flags & 0x100 ? (_IO_save_base+=n):(_IO_read_ptr+=n);}
void pbump(int n) { _IO_write_ptr += n; }
void setb(char* b, char* eb, int a=0);
void setp(char* p, char* ep)
{ _IO_write_base=_IO_write_ptr=p; _IO_write_end=ep; }
void setg(char* eb, char* g, char *eg) {
if (_flags & 0x100 ) _IO_free_backup_area(this);
_IO_read_base = eb; _IO_read_ptr = g; _IO_read_end = eg; }
char *shortbuf() { return _shortbuf; }
int in_backup() { return _flags & 0x100 ; }
char *Gbase() { return in_backup() ? _IO_save_base : _IO_read_base; }
char *eGptr() { return in_backup() ? _IO_save_end : _IO_read_end; }
char *Bbase() { return in_backup() ? _IO_read_base : _IO_save_base; }
char *Bptr() { return _IO_backup_base; }
char *eBptr() { return in_backup() ? _IO_read_end : _IO_save_end; }
char *Nbase() { return _IO_save_base; }
char *eNptr() { return _IO_save_end; }
int have_backup() { return _IO_save_base != __null ; }
int have_markers() { return _markers != __null ; }
void free_backup_area();
void unsave_markers();
int put_mode() { return _flags & 0x800 ; }
int switch_to_get_mode();
streambuf(int flags=0);
public:
static int flush_all();
static void flush_all_linebuffered();
virtual ~streambuf();
virtual int overflow(int c = (-1) );
virtual int underflow();
virtual int uflow();
virtual int pbackfail(int c);
virtual streamsize xsputn(const char* s, streamsize n);
virtual streamsize xsgetn(char* s, streamsize n);
virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
virtual streampos seekpos(streampos pos, int mode = ios::in|ios::out);
streampos pubseekoff(streamoff o, _seek_dir d, int mode=ios::in|ios::out)
{ return _IO_seekoff (this, o, d, mode); }
streampos pubseekpos(streampos pos, int mode = ios::in|ios::out)
{ return _IO_seekpos (this, pos, mode); }
streampos sseekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
streampos sseekpos(streampos pos, int mode = ios::in|ios::out);
virtual streambuf* setbuf(char* p, int len);
virtual int sync();
virtual int doallocate();
int seekmark(streammarker& mark, int delta = 0);
int sputbackc(char c);
int sungetc();
int unbuffered() { return _flags & 2 ? 1 : 0; }
int linebuffered() { return _flags & 0x200 ? 1 : 0; }
void unbuffered(int i)
{ if (i) _flags |= 2 ; else _flags &= ~2 ; }
void linebuffered(int i)
{ if (i) _flags |= 0x200 ; else _flags &= ~0x200 ; }
int allocate() {
if (base() || unbuffered()) return 0;
else return doallocate(); }
void allocbuf() { if (base() == __null ) doallocbuf(); }
void doallocbuf();
int in_avail() { return _IO_read_end - _IO_read_ptr; }
int out_waiting() { return _IO_write_ptr - _IO_write_base; }
streamsize sputn(const char* s, streamsize n) { return xsputn(s, n); }
streamsize padn(char pad, streamsize n) { return _IO_padn(this, pad, n); }
streamsize sgetn(char* s, streamsize n) { return _IO_sgetn(this, s, n); }
int ignore(int);
int get_column();
int set_column(int);
long sgetline(char* buf, size_t n, char delim, int putback_delim);
int sputc(int c) { return _IO_putc(c, this); }
int sbumpc() { return _IO_getc(this); }
int sgetc() { return (( this )->_IO_read_ptr >= ( this )->_IO_read_end && __underflow ( this ) == (-1) ? (-1) : *(unsigned char *) ( this )->_IO_read_ptr) ; }
int snextc() {
if (_IO_read_ptr >= _IO_read_end && __underflow(this) == (-1) )
return (-1) ;
else return _IO_read_ptr++, sgetc(); }
void stossc() { if (_IO_read_ptr < _IO_read_end) _IO_read_ptr++; }
int vscan(char const *fmt0, __gnuc_va_list ap, ios* stream = __null );
int scan(char const *fmt0 ...);
int vform(char const *fmt0, __gnuc_va_list ap);
int form(char const *fmt0 ...);
virtual streamsize sys_read(char* buf, streamsize size);
virtual streamsize sys_write(const char*, streamsize);
virtual streampos sys_seek(streamoff, _seek_dir);
virtual int sys_close();
virtual int sys_stat(void*);
virtual int showmanyc();
virtual void imbue(void *);
};
class filebuf : public streambuf {
protected:
void init();
public:
static const int openprot;
filebuf();
filebuf(int fd);
filebuf(int fd, char* p, int len);
~filebuf();
filebuf* attach(int fd);
filebuf* open(const char *filename, const char *mode);
filebuf* open(const char *filename, ios::openmode mode, int prot = 0664);
virtual int underflow();
virtual int overflow(int c = (-1) );
int is_open() const { return _fileno >= 0; }
int fd() const { return is_open() ? _fileno : (-1) ; }
filebuf* close();
virtual int doallocate();
virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
virtual streambuf* setbuf(char* p, int len);
streamsize xsputn(const char* s, streamsize n);
streamsize xsgetn(char* s, streamsize n);
virtual int sync();
protected:
int is_reading() { return eback() != egptr(); }
char* cur_ptr() { return is_reading() ? gptr() : pptr(); }
char* file_ptr() { return eGptr(); }
virtual streamsize sys_read(char* buf, streamsize size);
virtual streampos sys_seek(streamoff, _seek_dir);
virtual streamsize sys_write(const char*, streamsize);
virtual int sys_stat(void*);
virtual int sys_close();
};
inline void ios::init(streambuf* sb, ostream* tie_to) {
_state = sb ? ios::goodbit : ios::badbit; _exceptions=0;
_strbuf=sb; _tie = tie_to; _width=0; _fill=' ';
_flags=ios::skipws|ios::dec;
_precision=6; _arrays = 0; }
inline ios::ios(streambuf* sb, ostream* tie_to) { init(sb, tie_to); }
inline ios::~ios() {
operator delete[] (_arrays);
}
}
# 31 "/usr/include/g++/iostream.h" 2 3
extern "C++" {
class istream; class ostream;
typedef ios& (*__manip)(ios&);
typedef istream& (*__imanip)(istream&);
typedef ostream& (*__omanip)(ostream&);
extern istream& ws(istream& ins);
extern ostream& flush(ostream& outs);
extern ostream& endl(ostream& outs);
extern ostream& ends(ostream& outs);
class ostream : virtual public ios
{
void do_osfx();
public:
ostream() { }
ostream(streambuf* sb, ostream* tied= __null );
int opfx() {
if (!good()) return 0;
else { if (_tie) _tie->flush(); ; return 1;} }
void osfx() { ;
if (flags() & (ios::unitbuf|ios::stdio))
do_osfx(); }
ostream& flush();
ostream& put(char c) { _strbuf->sputc(c); return *this; }
ostream& write(const char *s, streamsize n);
ostream& write(const unsigned char *s, streamsize n)
{ return write((const char*)s, n);}
ostream& write(const signed char *s, streamsize n)
{ return write((const char*)s, n);}
ostream& write(const void *s, streamsize n)
{ return write((const char*)s, n);}
ostream& seekp(streampos);
ostream& seekp(streamoff, _seek_dir);
streampos tellp();
ostream& form(const char *format ...);
ostream& vform(const char *format, __gnuc_va_list args);
ostream& operator<<(char c);
ostream& operator<<(unsigned char c) { return (*this) << (char)c; }
ostream& operator<<(signed char c) { return (*this) << (char)c; }
ostream& operator<<(const char *s);
ostream& operator<<(const unsigned char *s)
{ return (*this) << (const char*)s; }
ostream& operator<<(const signed char *s)
{ return (*this) << (const char*)s; }
ostream& operator<<(const void *p);
ostream& operator<<(int n);
ostream& operator<<(unsigned int n);
ostream& operator<<(long n);
ostream& operator<<(unsigned long n);
__extension__ ostream& operator<<(long long n);
__extension__ ostream& operator<<(unsigned long long n);
ostream& operator<<(short n) {return operator<<((int)n);}
ostream& operator<<(unsigned short n) {return operator<<((unsigned int)n);}
ostream& operator<<(bool b) { return operator<<((int)b); }
ostream& operator<<(double n);
ostream& operator<<(float n) { return operator<<((double)n); }
ostream& operator<<(long double n);
ostream& operator<<(__omanip func) { return (*func)(*this); }
ostream& operator<<(__manip func) {(*func)(*this); return *this;}
ostream& operator<<(streambuf*);
};
class istream : virtual public ios
{
protected:
size_t _gcount;
int _skip_ws();
public:
istream(): _gcount (0) { }
istream(streambuf* sb, ostream*tied= __null );
istream& get(char* ptr, int len, char delim = '\n');
istream& get(unsigned char* ptr, int len, char delim = '\n')
{ return get((char*)ptr, len, delim); }
istream& get(char& c);
istream& get(unsigned char& c) { return get((char&)c); }
istream& getline(char* ptr, int len, char delim = '\n');
istream& getline(unsigned char* ptr, int len, char delim = '\n')
{ return getline((char*)ptr, len, delim); }
istream& get(signed char& c) { return get((char&)c); }
istream& get(signed char* ptr, int len, char delim = '\n')
{ return get((char*)ptr, len, delim); }
istream& getline(signed char* ptr, int len, char delim = '\n')
{ return getline((char*)ptr, len, delim); }
istream& read(char *ptr, streamsize n);
istream& read(unsigned char *ptr, streamsize n)
{ return read((char*)ptr, n); }
istream& read(signed char *ptr, streamsize n)
{ return read((char*)ptr, n); }
istream& read(void *ptr, streamsize n)
{ return read((char*)ptr, n); }
istream& get(streambuf& sb, char delim = '\n');
istream& gets(char **s, char delim = '\n');
int ipfx(int need = 0) {
if (!good()) { set(ios::failbit); return 0; }
else {
;
if (_tie && (need == 0 || rdbuf()->in_avail() < need)) _tie->flush();
if (!need && (flags() & ios::skipws)) return _skip_ws();
else return 1;
}
}
int ipfx0() {
if (!good()) { set(ios::failbit); return 0; }
else {
;
if (_tie) _tie->flush();
if (flags() & ios::skipws) return _skip_ws();
else return 1;
}
}
int ipfx1() {
if (!good()) { set(ios::failbit); return 0; }
else {
;
if (_tie && rdbuf()->in_avail() == 0) _tie->flush();
return 1;
}
}
void isfx() { ; }
int get() { if (!ipfx1()) return (-1) ;
else { int ch = _strbuf->sbumpc();
if (ch == (-1) ) set(ios::eofbit);
isfx();
return ch;
} }
int peek();
size_t gcount() { return _gcount; }
istream& ignore(int n=1, int delim = (-1) );
int sync ();
istream& seekg(streampos);
istream& seekg(streamoff, _seek_dir);
streampos tellg();
istream& putback(char ch) {
if (good() && _strbuf->sputbackc(ch) == (-1) ) clear(ios::badbit);
return *this;}
istream& unget() {
if (good() && _strbuf->sungetc() == (-1) ) clear(ios::badbit);
return *this;}
istream& scan(const char *format ...);
istream& vscan(const char *format, __gnuc_va_list args);
istream& operator>>(char*);
istream& operator>>(unsigned char* p) { return operator>>((char*)p); }
istream& operator>>(signed char*p) { return operator>>((char*)p); }
istream& operator>>(char& c);
istream& operator>>(unsigned char& c) {return operator>>((char&)c);}
istream& operator>>(signed char& c) {return operator>>((char&)c);}
istream& operator>>(int&);
istream& operator>>(long&);
__extension__ istream& operator>>(long long&);
__extension__ istream& operator>>(unsigned long long&);
istream& operator>>(short&);
istream& operator>>(unsigned int&);
istream& operator>>(unsigned long&);
istream& operator>>(unsigned short&);
istream& operator>>(bool&);
istream& operator>>(float&);
istream& operator>>(double&);
istream& operator>>(long double&);
istream& operator>>( __manip func) {(*func)(*this); return *this;}
istream& operator>>(__imanip func) { return (*func)(*this); }
istream& operator>>(streambuf*);
};
class iostream : public istream, public ostream
{
public:
iostream() { }
iostream(streambuf* sb, ostream*tied= __null );
};
class _IO_istream_withassign : public istream {
public:
_IO_istream_withassign& operator=(istream&);
_IO_istream_withassign& operator=(_IO_istream_withassign& rhs)
{ return operator= (static_cast<istream&> (rhs)); }
};
class _IO_ostream_withassign : public ostream {
public:
_IO_ostream_withassign& operator=(ostream&);
_IO_ostream_withassign& operator=(_IO_ostream_withassign& rhs)
{ return operator= (static_cast<ostream&> (rhs)); }
};
extern _IO_istream_withassign cin;
extern _IO_ostream_withassign cout, cerr;
extern _IO_ostream_withassign clog
;
extern istream& lock(istream& ins);
extern istream& unlock(istream& ins);
extern ostream& lock(ostream& outs);
extern ostream& unlock(ostream& outs);
struct Iostream_init { } ;
inline ios& dec(ios& i)
{ i.setf(ios::dec, ios::dec|ios::hex|ios::oct); return i; }
inline ios& hex(ios& i)
{ i.setf(ios::hex, ios::dec|ios::hex|ios::oct); return i; }
inline ios& oct(ios& i)
{ i.setf(ios::oct, ios::dec|ios::hex|ios::oct); return i; }
}
# 53 "/usr/include/g++/stl_algobase.h" 2 3
# 1 "/usr/include/g++/stl_iterator.h" 1 3
struct input_iterator_tag {};
struct output_iterator_tag {};
struct forward_iterator_tag : public input_iterator_tag {};
struct bidirectional_iterator_tag : public forward_iterator_tag {};
struct random_access_iterator_tag : public bidirectional_iterator_tag {};
template <class _Tp, class _Distance> struct input_iterator {
typedef input_iterator_tag iterator_category;
typedef _Tp value_type;
typedef _Distance difference_type;
typedef _Tp* pointer;
typedef _Tp& reference;
};
struct output_iterator {
typedef output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
};
template <class _Tp, class _Distance> struct forward_iterator {
typedef forward_iterator_tag iterator_category;
typedef _Tp value_type;
typedef _Distance difference_type;
typedef _Tp* pointer;
typedef _Tp& reference;
};
template <class _Tp, class _Distance> struct bidirectional_iterator {
typedef bidirectional_iterator_tag iterator_category;
typedef _Tp value_type;
typedef _Distance difference_type;
typedef _Tp* pointer;
typedef _Tp& reference;
};
template <class _Tp, class _Distance> struct random_access_iterator {
typedef random_access_iterator_tag iterator_category;
typedef _Tp value_type;
typedef _Distance difference_type;
typedef _Tp* pointer;
typedef _Tp& reference;
};
# 98 "/usr/include/g++/stl_iterator.h" 3
template <class _Iterator>
struct iterator_traits {
typedef typename _Iterator::iterator_category iterator_category;
typedef typename _Iterator::value_type value_type;
typedef typename _Iterator::difference_type difference_type;
typedef typename _Iterator::pointer pointer;
typedef typename _Iterator::reference reference;
};
template <class _Tp>
struct iterator_traits<_Tp*> {
typedef random_access_iterator_tag iterator_category;
typedef _Tp value_type;
typedef ptrdiff_t difference_type;
typedef _Tp* pointer;
typedef _Tp& reference;
};
template <class _Tp>
struct iterator_traits<const _Tp*> {
typedef random_access_iterator_tag iterator_category;
typedef _Tp value_type;
typedef ptrdiff_t difference_type;
typedef const _Tp* pointer;
typedef const _Tp& reference;
};
template <class _Iter>
inline typename iterator_traits<_Iter>::iterator_category
__iterator_category(const _Iter&)
{
typedef typename iterator_traits<_Iter>::iterator_category _Category;
return _Category();
}
template <class _Iter>
inline typename iterator_traits<_Iter>::difference_type*
__distance_type(const _Iter&)
{
return static_cast<typename iterator_traits<_Iter>::difference_type*>(0);
}
template <class _Iter>
inline typename iterator_traits<_Iter>::value_type*
__value_type(const _Iter&)
{
return static_cast<typename iterator_traits<_Iter>::value_type*>(0);
}
template <class _Iter>
inline typename iterator_traits<_Iter>::iterator_category
iterator_category(const _Iter& __i) { return __iterator_category(__i); }
template <class _Iter>
inline typename iterator_traits<_Iter>::difference_type*
distance_type(const _Iter& __i) { return __distance_type(__i); }
template <class _Iter>
inline typename iterator_traits<_Iter>::value_type*
value_type(const _Iter& __i) { return __value_type(__i); }
# 259 "/usr/include/g++/stl_iterator.h" 3
template <class _InputIterator, class _Distance>
inline void __distance(_InputIterator __first, _InputIterator __last,
_Distance& __n, input_iterator_tag)
{
while (__first != __last) { ++__first; ++__n; }
}
template <class _RandomAccessIterator, class _Distance>
inline void __distance(_RandomAccessIterator __first,
_RandomAccessIterator __last,
_Distance& __n, random_access_iterator_tag)
{
__n += __last - __first;
}
template <class _InputIterator, class _Distance>
inline void distance(_InputIterator __first,
_InputIterator __last, _Distance& __n)
{
__distance(__first, __last, __n, iterator_category(__first));
}
template <class _InputIterator>
inline typename iterator_traits<_InputIterator>::difference_type
__distance(_InputIterator __first, _InputIterator __last, input_iterator_tag)
{
typename iterator_traits<_InputIterator>::difference_type __n = 0;
while (__first != __last) {
++__first; ++__n;
}
return __n;
}
template <class _RandomAccessIterator>
inline typename iterator_traits<_RandomAccessIterator>::difference_type
__distance(_RandomAccessIterator __first, _RandomAccessIterator __last,
random_access_iterator_tag) {
return __last - __first;
}
template <class _InputIterator>
inline typename iterator_traits<_InputIterator>::difference_type
distance(_InputIterator __first, _InputIterator __last) {
typedef typename iterator_traits<_InputIterator>::iterator_category
_Category;
return __distance(__first, __last, _Category());
}
template <class _InputIter, class _Distance>
inline void __advance(_InputIter& __i, _Distance __n, input_iterator_tag) {
while (__n--) ++__i;
}
template <class _BidirectionalIterator, class _Distance>
inline void __advance(_BidirectionalIterator& __i, _Distance __n,
bidirectional_iterator_tag) {
if (__n >= 0)
while (__n--) ++__i;
else
while (__n++) --__i;
}
template <class _RandomAccessIterator, class _Distance>
inline void __advance(_RandomAccessIterator& __i, _Distance __n,
random_access_iterator_tag) {
__i += __n;
}
template <class _InputIterator, class _Distance>
inline void advance(_InputIterator& __i, _Distance __n) {
__advance(__i, __n, iterator_category(__i));
}
template <class _Container>
class back_insert_iterator {
protected:
_Container* container;
public:
typedef _Container container_type;
typedef output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
explicit back_insert_iterator(_Container& __x) : container(&__x) {}
back_insert_iterator<_Container>&
operator=(const typename _Container::value_type& __value) {
container->push_back(__value);
return *this;
}
back_insert_iterator<_Container>& operator*() { return *this; }
back_insert_iterator<_Container>& operator++() { return *this; }
back_insert_iterator<_Container>& operator++(int) { return *this; }
};
# 378 "/usr/include/g++/stl_iterator.h" 3
template <class _Container>
inline back_insert_iterator<_Container> back_inserter(_Container& __x) {
return back_insert_iterator<_Container>(__x);
}
template <class _Container>
class front_insert_iterator {
protected:
_Container* container;
public:
typedef _Container container_type;
typedef output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
explicit front_insert_iterator(_Container& __x) : container(&__x) {}
front_insert_iterator<_Container>&
operator=(const typename _Container::value_type& __value) {
container->push_front(__value);
return *this;
}
front_insert_iterator<_Container>& operator*() { return *this; }
front_insert_iterator<_Container>& operator++() { return *this; }
front_insert_iterator<_Container>& operator++(int) { return *this; }
};
# 417 "/usr/include/g++/stl_iterator.h" 3
template <class _Container>
inline front_insert_iterator<_Container> front_inserter(_Container& __x) {
return front_insert_iterator<_Container>(__x);
}
template <class _Container>
class insert_iterator {
protected:
_Container* container;
typename _Container::iterator iter;
public:
typedef _Container container_type;
typedef output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
insert_iterator(_Container& __x, typename _Container::iterator __i)
: container(&__x), iter(__i) {}
insert_iterator<_Container>&
operator=(const typename _Container::value_type& __value) {
iter = container->insert(iter, __value);
++iter;
return *this;
}
insert_iterator<_Container>& operator*() { return *this; }
insert_iterator<_Container>& operator++() { return *this; }
insert_iterator<_Container>& operator++(int) { return *this; }
};
# 459 "/usr/include/g++/stl_iterator.h" 3
template <class _Container, class _Iterator>
inline
insert_iterator<_Container> inserter(_Container& __x, _Iterator __i)
{
typedef typename _Container::iterator __iter;
return insert_iterator<_Container>(__x, __iter(__i));
}
template <class _BidirectionalIterator, class _Tp, class _Reference = _Tp&,
class _Distance = ptrdiff_t>
class reverse_bidirectional_iterator {
typedef reverse_bidirectional_iterator<_BidirectionalIterator, _Tp,
_Reference, _Distance> _Self;
protected:
_BidirectionalIterator current;
public:
typedef bidirectional_iterator_tag iterator_category;
typedef _Tp value_type;
typedef _Distance difference_type;
typedef _Tp* pointer;
typedef _Reference reference;
reverse_bidirectional_iterator() {}
explicit reverse_bidirectional_iterator(_BidirectionalIterator __x)
: current(__x) {}
_BidirectionalIterator base() const { return current; }
_Reference operator*() const {
_BidirectionalIterator __tmp = current;
return *--__tmp;
}
pointer operator->() const { return &(operator*()); }
_Self& operator++() {
--current;
return *this;
}
_Self operator++(int) {
_Self __tmp = *this;
--current;
return __tmp;
}
_Self& operator--() {
++current;
return *this;
}
_Self operator--(int) {
_Self __tmp = *this;
++current;
return __tmp;
}
};
# 550 "/usr/include/g++/stl_iterator.h" 3
template <class _BiIter, class _Tp, class _Ref,
class _Distance>
inline bool operator==(
const reverse_bidirectional_iterator<_BiIter, _Tp, _Ref, _Distance>& __x,
const reverse_bidirectional_iterator<_BiIter, _Tp, _Ref, _Distance>& __y)
{
return __x.base() == __y.base();
}
template <class _Iterator>
class reverse_iterator
{
protected:
_Iterator current;
public:
typedef typename iterator_traits<_Iterator>::iterator_category
iterator_category;
typedef typename iterator_traits<_Iterator>::value_type
value_type;
typedef typename iterator_traits<_Iterator>::difference_type
difference_type;
typedef typename iterator_traits<_Iterator>::pointer
pointer;
typedef typename iterator_traits<_Iterator>::reference
reference;
typedef _Iterator iterator_type;
typedef reverse_iterator<_Iterator> _Self;
public:
reverse_iterator() {}
explicit reverse_iterator(iterator_type __x) : current(__x) {}
reverse_iterator(const _Self& __x) : current(__x.current) {}
template <class _Iter>
reverse_iterator(const reverse_iterator<_Iter>& __x)
: current(__x.base()) {}
iterator_type base() const { return current; }
reference operator*() const {
_Iterator __tmp = current;
return *--__tmp;
}
pointer operator->() const { return &(operator*()); }
_Self& operator++() {
--current;
return *this;
}
_Self operator++(int) {
_Self __tmp = *this;
--current;
return __tmp;
}
_Self& operator--() {
++current;
return *this;
}
_Self operator--(int) {
_Self __tmp = *this;
++current;
return __tmp;
}
_Self operator+(difference_type __n) const {
return _Self(current - __n);
}
_Self& operator+=(difference_type __n) {
current -= __n;
return *this;
}
_Self operator-(difference_type __n) const {
return _Self(current + __n);
}
_Self& operator-=(difference_type __n) {
current += __n;
return *this;
}
reference operator[](difference_type __n) const { return *(*this + __n); }
};
template <class _Iterator>
inline bool operator==(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y) {
return __x.base() == __y.base();
}
template <class _Iterator>
inline bool operator<(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y) {
return __y.base() < __x.base();
}
template <class _Iterator>
inline typename reverse_iterator<_Iterator>::difference_type
operator-(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y) {
return __y.base() - __x.base();
}
template <class _Iterator>
inline reverse_iterator<_Iterator>
operator+(typename reverse_iterator<_Iterator>::difference_type __n,
const reverse_iterator<_Iterator>& __x) {
return reverse_iterator<_Iterator>(__x.base() - __n);
}
# 805 "/usr/include/g++/stl_iterator.h" 3
template <class _Tp, class _Dist = ptrdiff_t>
class istream_iterator {
friend bool operator== <> (const istream_iterator&,
const istream_iterator&);
protected:
istream* _M_stream;
_Tp _M_value;
bool _M_end_marker;
void _M_read() {
_M_end_marker = (*_M_stream) ? true : false;
if (_M_end_marker) *_M_stream >> _M_value;
_M_end_marker = (*_M_stream) ? true : false;
}
public:
typedef input_iterator_tag iterator_category;
typedef _Tp value_type;
typedef _Dist difference_type;
typedef const _Tp* pointer;
typedef const _Tp& reference;
istream_iterator() : _M_stream(&cin), _M_end_marker(false) {}
istream_iterator(istream& __s) : _M_stream(&__s) { _M_read(); }
reference operator*() const { return _M_value; }
pointer operator->() const { return &(operator*()); }
istream_iterator<_Tp, _Dist>& operator++() {
_M_read();
return *this;
}
istream_iterator<_Tp, _Dist> operator++(int) {
istream_iterator<_Tp, _Dist> __tmp = *this;
_M_read();
return __tmp;
}
};
# 864 "/usr/include/g++/stl_iterator.h" 3
template <class _Tp, class _Distance>
inline bool operator==(const istream_iterator<_Tp, _Distance>& __x,
const istream_iterator<_Tp, _Distance>& __y) {
return (__x._M_stream == __y._M_stream &&
__x._M_end_marker == __y._M_end_marker) ||
__x._M_end_marker == false && __y._M_end_marker == false;
}
template <class _Tp>
class ostream_iterator {
protected:
ostream* _M_stream;
const char* _M_string;
public:
typedef output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
ostream_iterator(ostream& __s) : _M_stream(&__s), _M_string(0) {}
ostream_iterator(ostream& __s, const char* __c)
: _M_stream(&__s), _M_string(__c) {}
ostream_iterator<_Tp>& operator=(const _Tp& __value) {
*_M_stream << __value;
if (_M_string) *_M_stream << _M_string;
return *this;
}
ostream_iterator<_Tp>& operator*() { return *this; }
ostream_iterator<_Tp>& operator++() { return *this; }
ostream_iterator<_Tp>& operator++(int) { return *this; }
};
# 907 "/usr/include/g++/stl_iterator.h" 3
# 56 "/usr/include/g++/stl_algobase.h" 2 3
template <class _ForwardIter1, class _ForwardIter2, class _Tp>
inline void __iter_swap(_ForwardIter1 __a, _ForwardIter2 __b, _Tp*) {
_Tp __tmp = *__a;
*__a = *__b;
*__b = __tmp;
}
template <class _ForwardIter1, class _ForwardIter2>
inline void iter_swap(_ForwardIter1 __a, _ForwardIter2 __b) {
__iter_swap(__a, __b, __value_type( __a ) );
}
template <class _Tp>
inline void swap(_Tp& __a, _Tp& __b) {
_Tp __tmp = __a;
__a = __b;
__b = __tmp;
}
template <class _Tp>
inline const _Tp& min(const _Tp& __a, const _Tp& __b) {
return __b < __a ? __b : __a;
}
template <class _Tp>
inline const _Tp& max(const _Tp& __a, const _Tp& __b) {
return __a < __b ? __b : __a;
}
template <class _Tp, class _Compare>
inline const _Tp& min(const _Tp& __a, const _Tp& __b, _Compare __comp) {
return __comp(__b, __a) ? __b : __a;
}
template <class _Tp, class _Compare>
inline const _Tp& max(const _Tp& __a, const _Tp& __b, _Compare __comp) {
return __comp(__a, __b) ? __b : __a;
}
template <class _InputIter, class _OutputIter, class _Distance>
inline _OutputIter __copy(_InputIter __first, _InputIter __last,
_OutputIter __result,
input_iterator_tag, _Distance*)
{
for ( ; __first != __last; ++__result, ++__first)
*__result = *__first;
return __result;
}
template <class _RandomAccessIter, class _OutputIter, class _Distance>
inline _OutputIter
__copy(_RandomAccessIter __first, _RandomAccessIter __last,
_OutputIter __result, random_access_iterator_tag, _Distance*)
{
for (_Distance __n = __last - __first; __n > 0; --__n) {
*__result = *__first;
++__first;
++__result;
}
return __result;
}
template <class _Tp>
inline _Tp*
__copy_trivial(const _Tp* __first, const _Tp* __last, _Tp* __result) {
memmove(__result, __first, sizeof(_Tp) * (__last - __first));
return __result + (__last - __first);
}
template <class _InputIter, class _OutputIter, class _BoolType>
struct __copy_dispatch {
static _OutputIter copy(_InputIter __first, _InputIter __last,
_OutputIter __result) {
typedef typename iterator_traits<_InputIter>::iterator_category _Category;
typedef typename iterator_traits<_InputIter>::difference_type _Distance;
return __copy(__first, __last, __result, _Category(), (_Distance*) 0);
}
};
template <class _Tp>
struct __copy_dispatch<_Tp*, _Tp*, __true_type>
{
static _Tp* copy(const _Tp* __first, const _Tp* __last, _Tp* __result) {
return __copy_trivial(__first, __last, __result);
}
};
template <class _Tp>
struct __copy_dispatch<const _Tp*, _Tp*, __true_type>
{
static _Tp* copy(const _Tp* __first, const _Tp* __last, _Tp* __result) {
return __copy_trivial(__first, __last, __result);
}
};
template <class _InputIter, class _OutputIter>
inline _OutputIter copy(_InputIter __first, _InputIter __last,
_OutputIter __result) {
typedef typename iterator_traits<_InputIter>::value_type _Tp;
typedef typename __type_traits<_Tp>::has_trivial_assignment_operator
_Trivial;
return __copy_dispatch<_InputIter, _OutputIter, _Trivial>
::copy(__first, __last, __result);
}
# 213 "/usr/include/g++/stl_algobase.h" 3
template <class _BidirectionalIter1, class _BidirectionalIter2,
class _Distance>
inline _BidirectionalIter2 __copy_backward(_BidirectionalIter1 __first,
_BidirectionalIter1 __last,
_BidirectionalIter2 __result,
bidirectional_iterator_tag,
_Distance*)
{
while (__first != __last)
*--__result = *--__last;
return __result;
}
template <class _RandomAccessIter, class _BidirectionalIter, class _Distance>
inline _BidirectionalIter __copy_backward(_RandomAccessIter __first,
_RandomAccessIter __last,
_BidirectionalIter __result,
random_access_iterator_tag,
_Distance*)
{
for (_Distance __n = __last - __first; __n > 0; --__n)
*--__result = *--__last;
return __result;
}
template <class _BidirectionalIter1, class _BidirectionalIter2,
class _BoolType>
struct __copy_backward_dispatch
{
typedef typename iterator_traits<_BidirectionalIter1>::iterator_category
_Cat;
typedef typename iterator_traits<_BidirectionalIter1>::difference_type
_Distance;
static _BidirectionalIter2 copy(_BidirectionalIter1 __first,
_BidirectionalIter1 __last,
_BidirectionalIter2 __result) {
return __copy_backward(__first, __last, __result, _Cat(), (_Distance*) 0);
}
};
template <class _Tp>
struct __copy_backward_dispatch<_Tp*, _Tp*, __true_type>
{
static _Tp* copy(const _Tp* __first, const _Tp* __last, _Tp* __result) {
const ptrdiff_t _Num = __last - __first;
memmove(__result - _Num, __first, sizeof(_Tp) * _Num);
return __result - _Num;
}
};
template <class _Tp>
struct __copy_backward_dispatch<const _Tp*, _Tp*, __true_type>
{
static _Tp* copy(const _Tp* __first, const _Tp* __last, _Tp* __result) {
return __copy_backward_dispatch<_Tp*, _Tp*, __true_type>
::copy(__first, __last, __result);
}
};
template <class _BI1, class _BI2>
inline _BI2 copy_backward(_BI1 __first, _BI1 __last, _BI2 __result) {
typedef typename __type_traits<typename iterator_traits<_BI2>::value_type>
::has_trivial_assignment_operator
_Trivial;
return __copy_backward_dispatch<_BI1, _BI2, _Trivial>
::copy(__first, __last, __result);
}
# 303 "/usr/include/g++/stl_algobase.h" 3
template <class _InputIter, class _Size, class _OutputIter>
pair<_InputIter, _OutputIter> __copy_n(_InputIter __first, _Size __count,
_OutputIter __result,
input_iterator_tag) {
for ( ; __count > 0; --__count) {
*__result = *__first;
++__first;
++__result;
}
return pair<_InputIter, _OutputIter>(__first, __result);
}
template <class _RAIter, class _Size, class _OutputIter>
inline pair<_RAIter, _OutputIter>
__copy_n(_RAIter __first, _Size __count,
_OutputIter __result,
random_access_iterator_tag) {
_RAIter __last = __first + __count;
return pair<_RAIter, _OutputIter>(__last, copy(__first, __last, __result));
}
template <class _InputIter, class _Size, class _OutputIter>
inline pair<_InputIter, _OutputIter>
__copy_n(_InputIter __first, _Size __count, _OutputIter __result) {
return __copy_n(__first, __count, __result,
__iterator_category( __first ) );
}
template <class _InputIter, class _Size, class _OutputIter>
inline pair<_InputIter, _OutputIter>
copy_n(_InputIter __first, _Size __count, _OutputIter __result) {
return __copy_n(__first, __count, __result);
}
template <class _ForwardIter, class _Tp>
void fill(_ForwardIter __first, _ForwardIter __last, const _Tp& __value) {
for ( ; __first != __last; ++__first)
*__first = __value;
}
template <class _OutputIter, class _Size, class _Tp>
_OutputIter fill_n(_OutputIter __first, _Size __n, const _Tp& __value) {
for ( ; __n > 0; --__n, ++__first)
*__first = __value;
return __first;
}
template <class _InputIter1, class _InputIter2>
pair<_InputIter1, _InputIter2> mismatch(_InputIter1 __first1,
_InputIter1 __last1,
_InputIter2 __first2) {
while (__first1 != __last1 && *__first1 == *__first2) {
++__first1;
++__first2;
}
return pair<_InputIter1, _InputIter2>(__first1, __first2);
}
template <class _InputIter1, class _InputIter2, class _BinaryPredicate>
pair<_InputIter1, _InputIter2> mismatch(_InputIter1 __first1,
_InputIter1 __last1,
_InputIter2 __first2,
_BinaryPredicate __binary_pred) {
while (__first1 != __last1 && __binary_pred(*__first1, *__first2)) {
++__first1;
++__first2;
}
return pair<_InputIter1, _InputIter2>(__first1, __first2);
}
template <class _InputIter1, class _InputIter2>
inline bool equal(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2) {
for ( ; __first1 != __last1; ++__first1, ++__first2)
if (*__first1 != *__first2)
return false;
return true;
}
template <class _InputIter1, class _InputIter2, class _BinaryPredicate>
inline bool equal(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _BinaryPredicate __binary_pred) {
for ( ; __first1 != __last1; ++__first1, ++__first2)
if (!__binary_pred(*__first1, *__first2))
return false;
return true;
}
template <class _InputIter1, class _InputIter2>
bool lexicographical_compare(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2) {
for ( ; __first1 != __last1 && __first2 != __last2
; ++__first1, ++__first2) {
if (*__first1 < *__first2)
return true;
if (*__first2 < *__first1)
return false;
}
return __first1 == __last1 && __first2 != __last2;
}
template <class _InputIter1, class _InputIter2, class _Compare>
bool lexicographical_compare(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2,
_Compare __comp) {
for ( ; __first1 != __last1 && __first2 != __last2
; ++__first1, ++__first2) {
if (__comp(*__first1, *__first2))
return true;
if (__comp(*__first2, *__first1))
return false;
}
return __first1 == __last1 && __first2 != __last2;
}
inline bool
lexicographical_compare(const unsigned char* __first1,
const unsigned char* __last1,
const unsigned char* __first2,
const unsigned char* __last2)
{
const size_t __len1 = __last1 - __first1;
const size_t __len2 = __last2 - __first2;
const int __result = memcmp(__first1, __first2, min(__len1, __len2));
return __result != 0 ? __result < 0 : __len1 < __len2;
}
inline bool lexicographical_compare(const char* __first1, const char* __last1,
const char* __first2, const char* __last2)
{
return lexicographical_compare((const signed char*) __first1,
(const signed char*) __last1,
(const signed char*) __first2,
(const signed char*) __last2);
}
template <class _InputIter1, class _InputIter2>
int __lexicographical_compare_3way(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2)
{
while (__first1 != __last1 && __first2 != __last2) {
if (*__first1 < *__first2)
return -1;
if (*__first2 < *__first1)
return 1;
++__first1;
++__first2;
}
if (__first2 == __last2) {
return !(__first1 == __last1);
}
else {
return -1;
}
}
inline int
__lexicographical_compare_3way(const unsigned char* __first1,
const unsigned char* __last1,
const unsigned char* __first2,
const unsigned char* __last2)
{
const ptrdiff_t __len1 = __last1 - __first1;
const ptrdiff_t __len2 = __last2 - __first2;
const int __result = memcmp(__first1, __first2, min(__len1, __len2));
return __result != 0 ? __result
: (__len1 == __len2 ? 0 : (__len1 < __len2 ? -1 : 1));
}
inline int
__lexicographical_compare_3way(const char* __first1, const char* __last1,
const char* __first2, const char* __last2)
{
return __lexicographical_compare_3way(
(const signed char*) __first1,
(const signed char*) __last1,
(const signed char*) __first2,
(const signed char*) __last2);
}
template <class _InputIter1, class _InputIter2>
int lexicographical_compare_3way(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2)
{
return __lexicographical_compare_3way(__first1, __last1, __first2, __last2);
}
# 30 "/usr/include/g++/queue" 2 3
# 1 "/usr/include/g++/stl_alloc.h" 1 3
# 1 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 1 3
# 342 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 53 "/usr/include/g++/stl_alloc.h" 2 3
# 1 "/usr/include/assert.h" 1 3
# 32 "/usr/include/assert.h" 3
# 56 "/usr/include/assert.h" 3
extern "C" {
extern void __assert_fail (__const char *__assertion, __const char *__file,
unsigned int __line, __const char *__function)
throw () __attribute__ ((__noreturn__));
extern void __assert_perror_fail (int __errnum, __const char *__file,
unsigned int __line,
__const char *__function)
throw () __attribute__ ((__noreturn__));
extern void __assert (const char *__assertion, const char *__file, int __line)
throw () __attribute__ ((__noreturn__));
}
# 56 "/usr/include/g++/stl_alloc.h" 2 3
# 1 "/usr/include/pthread.h" 1 3
# 1 "/usr/include/sched.h" 1 3
# 1 "/usr/include/time.h" 1 3
# 51 "/usr/include/time.h" 3
# 61 "/usr/include/time.h" 3
# 72 "/usr/include/time.h" 3
# 84 "/usr/include/time.h" 3
# 96 "/usr/include/time.h" 3
# 112 "/usr/include/time.h" 3
# 364 "/usr/include/time.h" 3
# 29 "/usr/include/sched.h" 2 3
# 1 "/usr/include/bits/sched.h" 1 3
struct sched_param
{
int sched_priority;
};
extern "C" {
extern int clone (int (*__fn) (void *__arg), void *__child_stack,
int __flags, void *__arg) throw () ;
}
# 73 "/usr/include/bits/sched.h" 3
# 32 "/usr/include/sched.h" 2 3
extern "C" {
extern int sched_setparam (__pid_t __pid, __const struct sched_param *__param)
throw () ;
extern int sched_getparam (__pid_t __pid, struct sched_param *__param) throw () ;
extern int sched_setscheduler (__pid_t __pid, int __policy,
__const struct sched_param *__param) throw () ;
extern int sched_getscheduler (__pid_t __pid) throw () ;
extern int sched_yield (void) throw () ;
extern int sched_get_priority_max (int __algorithm) throw () ;
extern int sched_get_priority_min (int __algorithm) throw () ;
extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) throw () ;
}
# 20 "/usr/include/pthread.h" 2 3
# 1 "/usr/include/time.h" 1 3
extern "C" {
# 1 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 1 3
# 19 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 61 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 126 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 188 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 269 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 317 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 38 "/usr/include/time.h" 2 3
# 1 "/usr/include/bits/time.h" 1 3
extern long int __sysconf (int);
# 73 "/usr/include/bits/time.h" 3
# 42 "/usr/include/time.h" 2 3
# 61 "/usr/include/time.h" 3
# 72 "/usr/include/time.h" 3
# 84 "/usr/include/time.h" 3
# 96 "/usr/include/time.h" 3
# 112 "/usr/include/time.h" 3
struct tm
{
int tm_sec;
int tm_min;
int tm_hour;
int tm_mday;
int tm_mon;
int tm_year;
int tm_wday;
int tm_yday;
int tm_isdst;
long int tm_gmtoff;
__const char *tm_zone;
};
struct itimerspec
{
struct timespec it_interval;
struct timespec it_value;
};
struct sigevent;
extern clock_t clock (void) throw () ;
extern time_t time (time_t *__timer) throw () ;
extern double difftime (time_t __time1, time_t __time0)
throw () __attribute__ ((__const__));
extern time_t mktime (struct tm *__tp) throw () ;
extern size_t strftime (char *__restrict __s, size_t __maxsize,
__const char *__restrict __format,
__const struct tm *__restrict __tp) throw () ;
extern char *strptime (__const char *__restrict __s,
__const char *__restrict __fmt, struct tm *__tp)
throw () ;
extern struct tm *gmtime (__const time_t *__timer) throw () ;
extern struct tm *localtime (__const time_t *__timer) throw () ;
extern struct tm *gmtime_r (__const time_t *__restrict __timer,
struct tm *__restrict __tp) throw () ;
extern struct tm *localtime_r (__const time_t *__restrict __timer,
struct tm *__restrict __tp) throw () ;
extern char *asctime (__const struct tm *__tp) throw () ;
extern char *ctime (__const time_t *__timer) throw () ;
extern char *asctime_r (__const struct tm *__restrict __tp,
char *__restrict __buf) throw () ;
extern char *ctime_r (__const time_t *__restrict __timer,
char *__restrict __buf) throw () ;
extern char *__tzname[2];
extern int __daylight;
extern long int __timezone;
extern char *tzname[2];
extern void tzset (void) throw () ;
extern int daylight;
extern long int timezone;
extern int stime (__const time_t *__when) throw () ;
extern time_t timegm (struct tm *__tp) throw () ;
extern time_t timelocal (struct tm *__tp) throw () ;
extern int dysize (int __year) throw () __attribute__ ((__const__));
extern int nanosleep (__const struct timespec *__requested_time,
struct timespec *__remaining) throw () ;
extern int clock_getres (clockid_t __clock_id, struct timespec *__res) throw () ;
extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) throw () ;
extern int clock_settime (clockid_t __clock_id, __const struct timespec *__tp)
throw () ;
extern int clock_nanosleep (clockid_t __clock_id, int __flags,
__const struct timespec *__req,
struct timespec *__rem) throw () ;
extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) throw () ;
extern int timer_create (clockid_t __clock_id,
struct sigevent *__restrict __evp,
timer_t *__restrict __timerid) throw () ;
extern int timer_delete (timer_t __timerid) throw () ;
extern int timer_settime (timer_t __timerid, int __flags,
__const struct itimerspec *__restrict __value,
struct itimerspec *__restrict __ovalue) throw () ;
extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
throw () ;
extern int timer_getoverrun (timer_t __timerid) throw () ;
extern int getdate_err;
extern struct tm *getdate (__const char *__string) throw () ;
extern int getdate_r (__const char *__restrict __string,
struct tm *__restrict __resbufp) throw () ;
}
# 21 "/usr/include/pthread.h" 2 3
# 1 "/usr/include/signal.h" 1 3
extern "C" {
# 1 "/usr/include/bits/sigset.h" 1 3
# 33 "/usr/include/bits/sigset.h" 3
# 125 "/usr/include/bits/sigset.h" 3
# 33 "/usr/include/signal.h" 2 3
typedef __sigset_t sigset_t;
# 371 "/usr/include/signal.h" 3
}
# 24 "/usr/include/pthread.h" 2 3
# 1 "/usr/include/bits/pthreadtypes.h" 1 3
# 142 "/usr/include/bits/pthreadtypes.h" 3
# 25 "/usr/include/pthread.h" 2 3
# 1 "/usr/include/bits/initspin.h" 1 3
# 26 "/usr/include/pthread.h" 2 3
extern "C" {
enum
{
PTHREAD_CREATE_JOINABLE,
PTHREAD_CREATE_DETACHED
};
enum
{
PTHREAD_INHERIT_SCHED,
PTHREAD_EXPLICIT_SCHED
};
enum
{
PTHREAD_SCOPE_SYSTEM,
PTHREAD_SCOPE_PROCESS
};
enum
{
PTHREAD_MUTEX_TIMED_NP,
PTHREAD_MUTEX_RECURSIVE_NP,
PTHREAD_MUTEX_ERRORCHECK_NP,
PTHREAD_MUTEX_ADAPTIVE_NP
,
PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP,
PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP,
PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP,
PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL
, PTHREAD_MUTEX_FAST_NP = PTHREAD_MUTEX_ADAPTIVE_NP
};
enum
{
PTHREAD_PROCESS_PRIVATE,
PTHREAD_PROCESS_SHARED
};
enum
{
PTHREAD_RWLOCK_PREFER_READER_NP,
PTHREAD_RWLOCK_PREFER_WRITER_NP,
PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,
PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_WRITER_NP
};
struct _pthread_cleanup_buffer
{
void (*__routine) (void *);
void *__arg;
int __canceltype;
struct _pthread_cleanup_buffer *__prev;
};
enum
{
PTHREAD_CANCEL_ENABLE,
PTHREAD_CANCEL_DISABLE
};
enum
{
PTHREAD_CANCEL_DEFERRED,
PTHREAD_CANCEL_ASYNCHRONOUS
};
extern int pthread_create (pthread_t *__restrict __thread,
__const pthread_attr_t *__restrict __attr,
void *(*__start_routine) (void *),
void *__restrict __arg) throw () ;
extern pthread_t pthread_self (void) throw () ;
extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) throw () ;
extern void pthread_exit (void *__retval)
throw () __attribute__ ((__noreturn__));
extern int pthread_join (pthread_t __th, void **__thread_return) throw () ;
extern int pthread_detach (pthread_t __th) throw () ;
extern int pthread_attr_init (pthread_attr_t *__attr) throw () ;
extern int pthread_attr_destroy (pthread_attr_t *__attr) throw () ;
extern int pthread_attr_setdetachstate (pthread_attr_t *__attr,
int __detachstate) throw () ;
extern int pthread_attr_getdetachstate (__const pthread_attr_t *__attr,
int *__detachstate) throw () ;
extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr,
__const struct sched_param *__restrict
__param) throw () ;
extern int pthread_attr_getschedparam (__const pthread_attr_t *__restrict
__attr,
struct sched_param *__restrict __param)
throw () ;
extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy)
throw () ;
extern int pthread_attr_getschedpolicy (__const pthread_attr_t *__restrict
__attr, int *__restrict __policy)
throw () ;
extern int pthread_attr_setinheritsched (pthread_attr_t *__attr,
int __inherit) throw () ;
extern int pthread_attr_getinheritsched (__const pthread_attr_t *__restrict
__attr, int *__restrict __inherit)
throw () ;
extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope)
throw () ;
extern int pthread_attr_getscope (__const pthread_attr_t *__restrict __attr,
int *__restrict __scope) throw () ;
extern int pthread_attr_setguardsize (pthread_attr_t *__attr,
size_t __guardsize) throw () ;
extern int pthread_attr_getguardsize (__const pthread_attr_t *__restrict
__attr, size_t *__restrict __guardsize)
throw () ;
extern int pthread_attr_setstackaddr (pthread_attr_t *__attr,
void *__stackaddr) throw () ;
extern int pthread_attr_getstackaddr (__const pthread_attr_t *__restrict
__attr, void **__restrict __stackaddr)
throw () ;
extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
size_t __stacksize) throw () ;
extern int pthread_attr_getstack (__const pthread_attr_t *__restrict __attr,
void **__restrict __stackaddr,
size_t *__restrict __stacksize) throw () ;
extern int pthread_attr_setstacksize (pthread_attr_t *__attr,
size_t __stacksize) throw () ;
extern int pthread_attr_getstacksize (__const pthread_attr_t *__restrict
__attr, size_t *__restrict __stacksize)
throw () ;
extern int pthread_setschedparam (pthread_t __target_thread, int __policy,
__const struct sched_param *__param)
throw () ;
extern int pthread_getschedparam (pthread_t __target_thread,
int *__restrict __policy,
struct sched_param *__restrict __param)
throw () ;
extern int pthread_getconcurrency (void) throw () ;
extern int pthread_setconcurrency (int __level) throw () ;
extern int pthread_yield (void) throw () ;
extern int pthread_mutex_init (pthread_mutex_t *__restrict __mutex,
__const pthread_mutexattr_t *__restrict
__mutex_attr) throw () ;
extern int pthread_mutex_destroy (pthread_mutex_t *__mutex) throw () ;
extern int pthread_mutex_trylock (pthread_mutex_t *__mutex) throw () ;
extern int pthread_mutex_lock (pthread_mutex_t *__mutex) throw () ;
extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
__const struct timespec *__restrict
__abstime) throw () ;
extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) throw () ;
extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr) throw () ;
extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr) throw () ;
extern int pthread_mutexattr_getpshared (__const pthread_mutexattr_t *
__restrict __attr,
int *__restrict __pshared) throw () ;
extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr,
int __pshared) throw () ;
extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind)
throw () ;
extern int pthread_mutexattr_gettype (__const pthread_mutexattr_t *__restrict
__attr, int *__restrict __kind) throw () ;
extern int pthread_cond_init (pthread_cond_t *__restrict __cond,
__const pthread_condattr_t *__restrict
__cond_attr) throw () ;
extern int pthread_cond_destroy (pthread_cond_t *__cond) throw () ;
extern int pthread_cond_signal (pthread_cond_t *__cond) throw () ;
extern int pthread_cond_broadcast (pthread_cond_t *__cond) throw () ;
extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
pthread_mutex_t *__restrict __mutex) throw () ;
extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
pthread_mutex_t *__restrict __mutex,
__const struct timespec *__restrict
__abstime) throw () ;
extern int pthread_condattr_init (pthread_condattr_t *__attr) throw () ;
extern int pthread_condattr_destroy (pthread_condattr_t *__attr) throw () ;
extern int pthread_condattr_getpshared (__const pthread_condattr_t *
__restrict __attr,
int *__restrict __pshared) throw () ;
extern int pthread_condattr_setpshared (pthread_condattr_t *__attr,
int __pshared) throw () ;
extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
__const pthread_rwlockattr_t *__restrict
__attr) throw () ;
extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock) throw () ;
extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock) throw () ;
extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) throw () ;
extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
__const struct timespec *__restrict
__abstime) throw () ;
extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock) throw () ;
extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) throw () ;
extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
__const struct timespec *__restrict
__abstime) throw () ;
extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock) throw () ;
extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr) throw () ;
extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr) throw () ;
extern int pthread_rwlockattr_getpshared (__const pthread_rwlockattr_t *
__restrict __attr,
int *__restrict __pshared) throw () ;
extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr,
int __pshared) throw () ;
extern int pthread_rwlockattr_getkind_np (__const pthread_rwlockattr_t *__attr,
int *__pref) throw () ;
extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr,
int __pref) throw () ;
extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared)
throw () ;
extern int pthread_spin_destroy (pthread_spinlock_t *__lock) throw () ;
extern int pthread_spin_lock (pthread_spinlock_t *__lock) throw () ;
extern int pthread_spin_trylock (pthread_spinlock_t *__lock) throw () ;
extern int pthread_spin_unlock (pthread_spinlock_t *__lock) throw () ;
extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier,
__const pthread_barrierattr_t *__restrict
__attr, unsigned int __count) throw () ;
extern int pthread_barrier_destroy (pthread_barrier_t *__barrier) throw () ;
extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr) throw () ;
extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr) throw () ;
extern int pthread_barrierattr_getpshared (__const pthread_barrierattr_t *
__restrict __attr,
int *__restrict __pshared) throw () ;
extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr,
int __pshared) throw () ;
extern int pthread_barrier_wait (pthread_barrier_t *__barrier) throw () ;
extern int pthread_key_create (pthread_key_t *__key,
void (*__destr_function) (void *)) throw () ;
extern int pthread_key_delete (pthread_key_t __key) throw () ;
extern int pthread_setspecific (pthread_key_t __key,
__const void *__pointer) throw () ;
extern void *pthread_getspecific (pthread_key_t __key) throw () ;
extern int pthread_once (pthread_once_t *__once_control,
void (*__init_routine) (void)) throw () ;
extern int pthread_setcancelstate (int __state, int *__oldstate) throw () ;
extern int pthread_setcanceltype (int __type, int *__oldtype) throw () ;
extern int pthread_cancel (pthread_t __thread) throw () ;
extern void pthread_testcancel (void) throw () ;
extern void _pthread_cleanup_push (struct _pthread_cleanup_buffer *__buffer,
void (*__routine) (void *),
void *__arg) throw () ;
extern void _pthread_cleanup_pop (struct _pthread_cleanup_buffer *__buffer,
int __execute) throw () ;
extern void _pthread_cleanup_push_defer (struct _pthread_cleanup_buffer *__buffer,
void (*__routine) (void *),
void *__arg) throw () ;
extern void _pthread_cleanup_pop_restore (struct _pthread_cleanup_buffer *__buffer,
int __execute) throw () ;
extern int pthread_getcpuclockid (pthread_t __thread_id,
clockid_t *__clock_id) throw () ;
# 1 "/usr/include/bits/sigthread.h" 1 3
extern int pthread_sigmask (int __how,
__const __sigset_t *__restrict __newmask,
__sigset_t *__restrict __oldmask)throw () ;
extern int pthread_kill (pthread_t __thread, int __signo) throw () ;
# 650 "/usr/include/pthread.h" 2 3
extern int pthread_atfork (void (*__prepare) (void),
void (*__parent) (void),
void (*__child) (void)) throw () ;
extern void pthread_kill_other_threads_np (void) throw () ;
extern void __pthread_initialize (void) throw () ;
}
# 71 "/usr/include/g++/stl_alloc.h" 2 3
# 87 "/usr/include/g++/stl_alloc.h" 3
# 97 "/usr/include/g++/stl_alloc.h" 3
# 115 "/usr/include/g++/stl_alloc.h" 3
template <int __inst>
class __malloc_alloc_template {
private:
static void* _S_oom_malloc(size_t);
static void* _S_oom_realloc(void*, size_t);
static void (* __malloc_alloc_oom_handler)();
public:
static void* allocate(size_t __n)
{
void* __result = malloc(__n);
if (0 == __result) __result = _S_oom_malloc(__n);
return __result;
}
static void deallocate(void* __p, size_t )
{
free(__p);
}
static void* reallocate(void* __p, size_t , size_t __new_sz)
{
void* __result = realloc(__p, __new_sz);
if (0 == __result) __result = _S_oom_realloc(__p, __new_sz);
return __result;
}
static void (* __set_malloc_handler(void (*__f)()))()
{
void (* __old)() = __malloc_alloc_oom_handler;
__malloc_alloc_oom_handler = __f;
return(__old);
}
};
template <int __inst>
void (* __malloc_alloc_template<__inst>::__malloc_alloc_oom_handler)() = 0;
template <int __inst>
void*
__malloc_alloc_template<__inst>::_S_oom_malloc(size_t __n)
{
void (* __my_malloc_handler)();
void* __result;
for (;;) {
__my_malloc_handler = __malloc_alloc_oom_handler;
if (0 == __my_malloc_handler) { cerr << "out of memory" << endl; exit(1) ; }
(*__my_malloc_handler)();
__result = malloc(__n);
if (__result) return(__result);
}
}
template <int __inst>
void* __malloc_alloc_template<__inst>::_S_oom_realloc(void* __p, size_t __n)
{
void (* __my_malloc_handler)();
void* __result;
for (;;) {
__my_malloc_handler = __malloc_alloc_oom_handler;
if (0 == __my_malloc_handler) { cerr << "out of memory" << endl; exit(1) ; }
(*__my_malloc_handler)();
__result = realloc(__p, __n);
if (__result) return(__result);
}
}
typedef __malloc_alloc_template<0> malloc_alloc;
template<class _Tp, class _Alloc>
class simple_alloc {
public:
static _Tp* allocate(size_t __n)
{ return 0 == __n ? 0 : (_Tp*) _Alloc::allocate(__n * sizeof (_Tp)); }
static _Tp* allocate(void)
{ return (_Tp*) _Alloc::allocate(sizeof (_Tp)); }
static void deallocate(_Tp* __p, size_t __n)
{ if (0 != __n) _Alloc::deallocate(__p, __n * sizeof (_Tp)); }
static void deallocate(_Tp* __p)
{ _Alloc::deallocate(__p, sizeof (_Tp)); }
};
template <class _Alloc>
class debug_alloc {
private:
enum {_S_extra = 8};
public:
static void* allocate(size_t __n)
{
char* __result = (char*)_Alloc::allocate(__n + _S_extra);
*(size_t*)__result = __n;
return __result + _S_extra;
}
static void deallocate(void* __p, size_t __n)
{
char* __real_p = (char*)__p - _S_extra;
((void) (( *(size_t*)__real_p == __n ) ? 0 : (__assert_fail ("*(size_t*)__real_p == __n" , "/usr/include/g++/stl_alloc.h", 263, __PRETTY_FUNCTION__ ), 0))) ;
_Alloc::deallocate(__real_p, __n + _S_extra);
}
static void* reallocate(void* __p, size_t __old_sz, size_t __new_sz)
{
char* __real_p = (char*)__p - _S_extra;
((void) (( *(size_t*)__real_p == __old_sz ) ? 0 : (__assert_fail ("*(size_t*)__real_p == __old_sz" , "/usr/include/g++/stl_alloc.h", 270, __PRETTY_FUNCTION__ ), 0))) ;
char* __result = (char*)
_Alloc::reallocate(__real_p, __old_sz + _S_extra, __new_sz + _S_extra);
*(size_t*)__result = __new_sz;
return __result + _S_extra;
}
};
template <bool threads, int inst>
class __default_alloc_template {
private:
enum {_ALIGN = 8};
enum {_MAX_BYTES = 128};
enum {_NFREELISTS = _MAX_BYTES/_ALIGN};
static size_t
_S_round_up(size_t __bytes)
{ return (((__bytes) + _ALIGN-1) & ~(_ALIGN - 1)); }
private :
union _Obj {
union _Obj* _M_free_list_link;
char _M_client_data[1];
};
private:
static _Obj* volatile _S_free_list[_NFREELISTS];
static size_t _S_freelist_index(size_t __bytes) {
return (((__bytes) + _ALIGN-1)/_ALIGN - 1);
}
static void* _S_refill(size_t __n);
static char* _S_chunk_alloc(size_t __size, int& __nobjs);
static char* _S_start_free;
static char* _S_end_free;
static size_t _S_heap_size;
static pthread_mutex_t _S_node_allocator_lock;
# 389 "/usr/include/g++/stl_alloc.h" 3
class _Lock {
public:
_Lock() { if (threads) pthread_mutex_lock(&_S_node_allocator_lock) ; }
~_Lock() { if (threads) pthread_mutex_unlock(&_S_node_allocator_lock) ; }
};
friend class _Lock;
public:
static void* allocate(size_t __n)
{
_Obj* volatile * __my_free_list;
_Obj* __result;
if (__n > (size_t) _MAX_BYTES) {
return(malloc_alloc::allocate(__n));
}
__my_free_list = _S_free_list + _S_freelist_index(__n);
_Lock __lock_instance;
__result = *__my_free_list;
if (__result == 0) {
void* __r = _S_refill(_S_round_up(__n));
return __r;
}
*__my_free_list = __result -> _M_free_list_link;
return (__result);
};
static void deallocate(void* __p, size_t __n)
{
_Obj* __q = (_Obj*)__p;
_Obj* volatile * __my_free_list;
if (__n > (size_t) _MAX_BYTES) {
malloc_alloc::deallocate(__p, __n);
return;
}
__my_free_list = _S_free_list + _S_freelist_index(__n);
_Lock __lock_instance;
__q -> _M_free_list_link = *__my_free_list;
*__my_free_list = __q;
}
static void* reallocate(void* __p, size_t __old_sz, size_t __new_sz);
} ;
typedef __default_alloc_template< true , 0> alloc;
typedef __default_alloc_template<false, 0> single_client_alloc;
template <bool __threads, int __inst>
char*
__default_alloc_template<__threads, __inst>::_S_chunk_alloc(size_t __size,
int& __nobjs)
{
char* __result;
size_t __total_bytes = __size * __nobjs;
size_t __bytes_left = _S_end_free - _S_start_free;
if (__bytes_left >= __total_bytes) {
__result = _S_start_free;
_S_start_free += __total_bytes;
return(__result);
} else if (__bytes_left >= __size) {
__nobjs = (int)(__bytes_left/__size);
__total_bytes = __size * __nobjs;
__result = _S_start_free;
_S_start_free += __total_bytes;
return(__result);
} else {
size_t __bytes_to_get =
2 * __total_bytes + _S_round_up(_S_heap_size >> 4);
if (__bytes_left > 0) {
_Obj* volatile * __my_free_list =
_S_free_list + _S_freelist_index(__bytes_left);
((_Obj*)_S_start_free) -> _M_free_list_link = *__my_free_list;
*__my_free_list = (_Obj*)_S_start_free;
}
_S_start_free = (char*)malloc(__bytes_to_get);
if (0 == _S_start_free) {
size_t __i;
_Obj* volatile * __my_free_list;
_Obj* __p;
for (__i = __size; __i <= _MAX_BYTES; __i += _ALIGN) {
__my_free_list = _S_free_list + _S_freelist_index(__i);
__p = *__my_free_list;
if (0 != __p) {
*__my_free_list = __p -> _M_free_list_link;
_S_start_free = (char*)__p;
_S_end_free = _S_start_free + __i;
return(_S_chunk_alloc(__size, __nobjs));
}
}
_S_end_free = 0;
_S_start_free = (char*)malloc_alloc::allocate(__bytes_to_get);
}
_S_heap_size += __bytes_to_get;
_S_end_free = _S_start_free + __bytes_to_get;
return(_S_chunk_alloc(__size, __nobjs));
}
}
template <bool __threads, int __inst>
void*
__default_alloc_template<__threads, __inst>::_S_refill(size_t __n)
{
int __nobjs = 20;
char* __chunk = _S_chunk_alloc(__n, __nobjs);
_Obj* volatile * __my_free_list;
_Obj* __result;
_Obj* __current_obj;
_Obj* __next_obj;
int __i;
if (1 == __nobjs) return(__chunk);
__my_free_list = _S_free_list + _S_freelist_index(__n);
__result = (_Obj*)__chunk;
*__my_free_list = __next_obj = (_Obj*)(__chunk + __n);
for (__i = 1; ; __i++) {
__current_obj = __next_obj;
__next_obj = (_Obj*)((char*)__next_obj + __n);
if (__nobjs - 1 == __i) {
__current_obj -> _M_free_list_link = 0;
break;
} else {
__current_obj -> _M_free_list_link = __next_obj;
}
}
return(__result);
}
template <bool threads, int inst>
void*
__default_alloc_template<threads, inst>::reallocate(void* __p,
size_t __old_sz,
size_t __new_sz)
{
void* __result;
size_t __copy_sz;
if (__old_sz > (size_t) _MAX_BYTES && __new_sz > (size_t) _MAX_BYTES) {
return(realloc(__p, __new_sz));
}
if (_S_round_up(__old_sz) == _S_round_up(__new_sz)) return(__p);
__result = allocate(__new_sz);
__copy_sz = __new_sz > __old_sz? __old_sz : __new_sz;
memcpy(__result, __p, __copy_sz);
deallocate(__p, __old_sz);
return(__result);
}
template <bool __threads, int __inst>
pthread_mutex_t
__default_alloc_template<__threads, __inst>::_S_node_allocator_lock
= {0, 0, 0, PTHREAD_MUTEX_TIMED_NP, { 0, 0 } } ;
# 602 "/usr/include/g++/stl_alloc.h" 3
# 689 "/usr/include/g++/stl_alloc.h" 3
template <bool __threads, int __inst>
char* __default_alloc_template<__threads, __inst>::_S_start_free = 0;
template <bool __threads, int __inst>
char* __default_alloc_template<__threads, __inst>::_S_end_free = 0;
template <bool __threads, int __inst>
size_t __default_alloc_template<__threads, __inst>::_S_heap_size = 0;
template <bool __threads, int __inst>
__default_alloc_template<__threads, __inst>::_Obj* volatile
__default_alloc_template<__threads, __inst> ::_S_free_list[
_NFREELISTS
] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, };
template <class _Tp>
class allocator {
typedef alloc _Alloc;
public:
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef _Tp* pointer;
typedef const _Tp* const_pointer;
typedef _Tp& reference;
typedef const _Tp& const_reference;
typedef _Tp value_type;
template <class _Tp1> struct rebind {
typedef allocator<_Tp1> other;
};
allocator() throw() {}
allocator(const allocator&) throw() {}
template <class _Tp1> allocator(const allocator<_Tp1>&) throw() {}
~allocator() throw() {}
pointer address(reference __x) const { return &__x; }
const_pointer address(const_reference __x) const { return &__x; }
_Tp* allocate(size_type __n, const void* = 0) {
return __n != 0 ? static_cast<_Tp*>(_Alloc::allocate(__n * sizeof(_Tp)))
: 0;
}
void deallocate(pointer __p, size_type __n)
{ _Alloc::deallocate(__p, __n * sizeof(_Tp)); }
size_type max_size() const throw()
{ return size_t(-1) / sizeof(_Tp); }
void construct(pointer __p, const _Tp& __val) { new(__p) _Tp(__val); }
void destroy(pointer __p) { __p->~_Tp(); }
};
template<>
class allocator<void> {
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef void* pointer;
typedef const void* const_pointer;
typedef void value_type;
template <class _Tp1> struct rebind {
typedef allocator<_Tp1> other;
};
};
template <class _T1, class _T2>
inline bool operator==(const allocator<_T1>&, const allocator<_T2>&)
{
return true;
}
template <class _T1, class _T2>
inline bool operator!=(const allocator<_T1>&, const allocator<_T2>&)
{
return false;
}
template <class _Tp, class _Alloc>
struct __allocator {
_Alloc __underlying_alloc;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef _Tp* pointer;
typedef const _Tp* const_pointer;
typedef _Tp& reference;
typedef const _Tp& const_reference;
typedef _Tp value_type;
template <class _Tp1> struct rebind {
typedef __allocator<_Tp1, _Alloc> other;
};
__allocator() throw() {}
__allocator(const __allocator& __a) throw()
: __underlying_alloc(__a.__underlying_alloc) {}
template <class _Tp1>
__allocator(const __allocator<_Tp1, _Alloc>& __a) throw()
: __underlying_alloc(__a.__underlying_alloc) {}
~__allocator() throw() {}
pointer address(reference __x) const { return &__x; }
const_pointer address(const_reference __x) const { return &__x; }
_Tp* allocate(size_type __n, const void* = 0) {
return __n != 0
? static_cast<_Tp*>(__underlying_alloc.allocate(__n * sizeof(_Tp)))
: 0;
}
void deallocate(pointer __p, size_type __n)
{ __underlying_alloc.deallocate(__p, __n * sizeof(_Tp)); }
size_type max_size() const throw()
{ return size_t(-1) / sizeof(_Tp); }
void construct(pointer __p, const _Tp& __val) { new(__p) _Tp(__val); }
void destroy(pointer __p) { __p->~_Tp(); }
};
template <class _Alloc>
class __allocator<void, _Alloc> {
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef void* pointer;
typedef const void* const_pointer;
typedef void value_type;
template <class _Tp1> struct rebind {
typedef __allocator<_Tp1, _Alloc> other;
};
};
template <class _Tp, class _Alloc>
inline bool operator==(const __allocator<_Tp, _Alloc>& __a1,
const __allocator<_Tp, _Alloc>& __a2)
{
return __a1.__underlying_alloc == __a2.__underlying_alloc;
}
template <class _Tp, class _Alloc>
inline bool operator!=(const __allocator<_Tp, _Alloc>& __a1,
const __allocator<_Tp, _Alloc>& __a2)
{
return __a1.__underlying_alloc != __a2.__underlying_alloc;
}
template <int inst>
inline bool operator==(const __malloc_alloc_template<inst>&,
const __malloc_alloc_template<inst>&)
{
return true;
}
template <int __inst>
inline bool operator!=(const __malloc_alloc_template<__inst>&,
const __malloc_alloc_template<__inst>&)
{
return false;
}
template <bool __threads, int __inst>
inline bool operator==(const __default_alloc_template<__threads, __inst>&,
const __default_alloc_template<__threads, __inst>&)
{
return true;
}
template <bool __threads, int __inst>
inline bool operator!=(const __default_alloc_template<__threads, __inst>&,
const __default_alloc_template<__threads, __inst>&)
{
return false;
}
template <class _Alloc>
inline bool operator==(const debug_alloc<_Alloc>&,
const debug_alloc<_Alloc>&) {
return true;
}
template <class _Alloc>
inline bool operator!=(const debug_alloc<_Alloc>&,
const debug_alloc<_Alloc>&) {
return false;
}
template <class _Tp, class _Allocator>
struct _Alloc_traits
{
static const bool _S_instanceless = false;
typedef typename _Allocator:: rebind<_Tp>::other
allocator_type;
};
template <class _Tp, class _Allocator>
const bool _Alloc_traits<_Tp, _Allocator>::_S_instanceless;
template <class _Tp, class _Tp1>
struct _Alloc_traits<_Tp, allocator<_Tp1> >
{
static const bool _S_instanceless = true;
typedef simple_alloc<_Tp, alloc> _Alloc_type;
typedef allocator<_Tp> allocator_type;
};
template <class _Tp, int __inst>
struct _Alloc_traits<_Tp, __malloc_alloc_template<__inst> >
{
static const bool _S_instanceless = true;
typedef simple_alloc<_Tp, __malloc_alloc_template<__inst> > _Alloc_type;
typedef __allocator<_Tp, __malloc_alloc_template<__inst> > allocator_type;
};
template <class _Tp, bool __threads, int __inst>
struct _Alloc_traits<_Tp, __default_alloc_template<__threads, __inst> >
{
static const bool _S_instanceless = true;
typedef simple_alloc<_Tp, __default_alloc_template<__threads, __inst> >
_Alloc_type;
typedef __allocator<_Tp, __default_alloc_template<__threads, __inst> >
allocator_type;
};
template <class _Tp, class _Alloc>
struct _Alloc_traits<_Tp, debug_alloc<_Alloc> >
{
static const bool _S_instanceless = true;
typedef simple_alloc<_Tp, debug_alloc<_Alloc> > _Alloc_type;
typedef __allocator<_Tp, debug_alloc<_Alloc> > allocator_type;
};
template <class _Tp, class _Tp1, int __inst>
struct _Alloc_traits<_Tp,
__allocator<_Tp1, __malloc_alloc_template<__inst> > >
{
static const bool _S_instanceless = true;
typedef simple_alloc<_Tp, __malloc_alloc_template<__inst> > _Alloc_type;
typedef __allocator<_Tp, __malloc_alloc_template<__inst> > allocator_type;
};
template <class _Tp, class _Tp1, bool __thr, int __inst>
struct _Alloc_traits<_Tp,
__allocator<_Tp1,
__default_alloc_template<__thr, __inst> > >
{
static const bool _S_instanceless = true;
typedef simple_alloc<_Tp, __default_alloc_template<__thr,__inst> >
_Alloc_type;
typedef __allocator<_Tp, __default_alloc_template<__thr,__inst> >
allocator_type;
};
template <class _Tp, class _Tp1, class _Alloc>
struct _Alloc_traits<_Tp, __allocator<_Tp1, debug_alloc<_Alloc> > >
{
static const bool _S_instanceless = true;
typedef simple_alloc<_Tp, debug_alloc<_Alloc> > _Alloc_type;
typedef __allocator<_Tp, debug_alloc<_Alloc> > allocator_type;
};
# 31 "/usr/include/g++/queue" 2 3
# 1 "/usr/include/g++/stl_construct.h" 1 3
template <class _Tp>
inline void destroy(_Tp* __pointer) {
__pointer->~_Tp();
}
template <class _T1, class _T2>
inline void construct(_T1* __p, const _T2& __value) {
new (__p) _T1(__value);
}
template <class _T1>
inline void construct(_T1* __p) {
new (__p) _T1();
}
template <class _ForwardIterator>
inline void
__destroy_aux(_ForwardIterator __first, _ForwardIterator __last, __false_type)
{
for ( ; __first != __last; ++__first)
destroy(&*__first);
}
template <class _ForwardIterator>
inline void __destroy_aux(_ForwardIterator, _ForwardIterator, __true_type) {}
template <class _ForwardIterator, class _Tp>
inline void
__destroy(_ForwardIterator __first, _ForwardIterator __last, _Tp*)
{
typedef typename __type_traits<_Tp>::has_trivial_destructor
_Trivial_destructor;
__destroy_aux(__first, __last, _Trivial_destructor());
}
template <class _ForwardIterator>
inline void destroy(_ForwardIterator __first, _ForwardIterator __last) {
__destroy(__first, __last, __value_type( __first ) );
}
inline void destroy(char*, char*) {}
inline void destroy(wchar_t*, wchar_t*) {}
# 32 "/usr/include/g++/queue" 2 3
# 1 "/usr/include/g++/stl_uninitialized.h" 1 3
template <class _InputIter, class _ForwardIter>
inline _ForwardIter
__uninitialized_copy_aux(_InputIter __first, _InputIter __last,
_ForwardIter __result,
__true_type)
{
return copy(__first, __last, __result);
}
template <class _InputIter, class _ForwardIter>
_ForwardIter
__uninitialized_copy_aux(_InputIter __first, _InputIter __last,
_ForwardIter __result,
__false_type)
{
_ForwardIter __cur = __result;
try {
for ( ; __first != __last; ++__first, ++__cur)
construct(&*__cur, *__first);
return __cur;
}
catch(...) { destroy(__result, __cur) ; throw; } ;
}
template <class _InputIter, class _ForwardIter, class _Tp>
inline _ForwardIter
__uninitialized_copy(_InputIter __first, _InputIter __last,
_ForwardIter __result, _Tp*)
{
typedef typename __type_traits<_Tp>::is_POD_type _Is_POD;
return __uninitialized_copy_aux(__first, __last, __result, _Is_POD());
}
template <class _InputIter, class _ForwardIter>
inline _ForwardIter
uninitialized_copy(_InputIter __first, _InputIter __last,
_ForwardIter __result)
{
return __uninitialized_copy(__first, __last, __result,
__value_type( __result ) );
}
inline char* uninitialized_copy(const char* __first, const char* __last,
char* __result) {
memmove(__result, __first, __last - __first);
return __result + (__last - __first);
}
inline wchar_t*
uninitialized_copy(const wchar_t* __first, const wchar_t* __last,
wchar_t* __result)
{
memmove(__result, __first, sizeof(wchar_t) * (__last - __first));
return __result + (__last - __first);
}
template <class _InputIter, class _Size, class _ForwardIter>
pair<_InputIter, _ForwardIter>
__uninitialized_copy_n(_InputIter __first, _Size __count,
_ForwardIter __result,
input_iterator_tag)
{
_ForwardIter __cur = __result;
try {
for ( ; __count > 0 ; --__count, ++__first, ++__cur)
construct(&*__cur, *__first);
return pair<_InputIter, _ForwardIter>(__first, __cur);
}
catch(...) { destroy(__result, __cur) ; throw; } ;
}
template <class _RandomAccessIter, class _Size, class _ForwardIter>
inline pair<_RandomAccessIter, _ForwardIter>
__uninitialized_copy_n(_RandomAccessIter __first, _Size __count,
_ForwardIter __result,
random_access_iterator_tag) {
_RandomAccessIter __last = __first + __count;
return pair<_RandomAccessIter, _ForwardIter>(
__last,
uninitialized_copy(__first, __last, __result));
}
template <class _InputIter, class _Size, class _ForwardIter>
inline pair<_InputIter, _ForwardIter>
__uninitialized_copy_n(_InputIter __first, _Size __count,
_ForwardIter __result) {
return __uninitialized_copy_n(__first, __count, __result,
__iterator_category( __first ) );
}
template <class _InputIter, class _Size, class _ForwardIter>
inline pair<_InputIter, _ForwardIter>
uninitialized_copy_n(_InputIter __first, _Size __count,
_ForwardIter __result) {
return __uninitialized_copy_n(__first, __count, __result,
__iterator_category( __first ) );
}
template <class _ForwardIter, class _Tp>
inline void
__uninitialized_fill_aux(_ForwardIter __first, _ForwardIter __last,
const _Tp& __x, __true_type)
{
fill(__first, __last, __x);
}
template <class _ForwardIter, class _Tp>
void
__uninitialized_fill_aux(_ForwardIter __first, _ForwardIter __last,
const _Tp& __x, __false_type)
{
_ForwardIter __cur = __first;
try {
for ( ; __cur != __last; ++__cur)
construct(&*__cur, __x);
}
catch(...) { destroy(__first, __cur) ; throw; } ;
}
template <class _ForwardIter, class _Tp, class _Tp1>
inline void __uninitialized_fill(_ForwardIter __first,
_ForwardIter __last, const _Tp& __x, _Tp1*)
{
typedef typename __type_traits<_Tp1>::is_POD_type _Is_POD;
__uninitialized_fill_aux(__first, __last, __x, _Is_POD());
}
template <class _ForwardIter, class _Tp>
inline void uninitialized_fill(_ForwardIter __first,
_ForwardIter __last,
const _Tp& __x)
{
__uninitialized_fill(__first, __last, __x, __value_type( __first ) );
}
template <class _ForwardIter, class _Size, class _Tp>
inline _ForwardIter
__uninitialized_fill_n_aux(_ForwardIter __first, _Size __n,
const _Tp& __x, __true_type)
{
return fill_n(__first, __n, __x);
}
template <class _ForwardIter, class _Size, class _Tp>
_ForwardIter
__uninitialized_fill_n_aux(_ForwardIter __first, _Size __n,
const _Tp& __x, __false_type)
{
_ForwardIter __cur = __first;
try {
for ( ; __n > 0; --__n, ++__cur)
construct(&*__cur, __x);
return __cur;
}
catch(...) { destroy(__first, __cur) ; throw; } ;
}
template <class _ForwardIter, class _Size, class _Tp, class _Tp1>
inline _ForwardIter
__uninitialized_fill_n(_ForwardIter __first, _Size __n, const _Tp& __x, _Tp1*)
{
typedef typename __type_traits<_Tp1>::is_POD_type _Is_POD;
return __uninitialized_fill_n_aux(__first, __n, __x, _Is_POD());
}
template <class _ForwardIter, class _Size, class _Tp>
inline _ForwardIter
uninitialized_fill_n(_ForwardIter __first, _Size __n, const _Tp& __x)
{
return __uninitialized_fill_n(__first, __n, __x, __value_type( __first ) );
}
template <class _InputIter1, class _InputIter2, class _ForwardIter>
inline _ForwardIter
__uninitialized_copy_copy(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2,
_ForwardIter __result)
{
_ForwardIter __mid = uninitialized_copy(__first1, __last1, __result);
try {
return uninitialized_copy(__first2, __last2, __mid);
}
catch(...) { destroy(__result, __mid) ; throw; } ;
}
template <class _ForwardIter, class _Tp, class _InputIter>
inline _ForwardIter
__uninitialized_fill_copy(_ForwardIter __result, _ForwardIter __mid,
const _Tp& __x,
_InputIter __first, _InputIter __last)
{
uninitialized_fill(__result, __mid, __x);
try {
return uninitialized_copy(__first, __last, __mid);
}
catch(...) { destroy(__result, __mid) ; throw; } ;
}
template <class _InputIter, class _ForwardIter, class _Tp>
inline void
__uninitialized_copy_fill(_InputIter __first1, _InputIter __last1,
_ForwardIter __first2, _ForwardIter __last2,
const _Tp& __x)
{
_ForwardIter __mid2 = uninitialized_copy(__first1, __last1, __first2);
try {
uninitialized_fill(__mid2, __last2, __x);
}
catch(...) { destroy(__first2, __mid2) ; throw; } ;
}
# 33 "/usr/include/g++/queue" 2 3
# 1 "/usr/include/g++/stl_vector.h" 1 3
template <class _Tp, class _Allocator, bool _IsStatic>
class _Vector_alloc_base {
public:
typedef typename _Alloc_traits<_Tp, _Allocator>::allocator_type
allocator_type;
allocator_type get_allocator() const { return _M_data_allocator; }
_Vector_alloc_base(const allocator_type& __a)
: _M_data_allocator(__a), _M_start(0), _M_finish(0), _M_end_of_storage(0)
{}
protected:
allocator_type _M_data_allocator;
_Tp* _M_start;
_Tp* _M_finish;
_Tp* _M_end_of_storage;
_Tp* _M_allocate(size_t __n)
{ return _M_data_allocator.allocate(__n); }
void _M_deallocate(_Tp* __p, size_t __n)
{ if (__p) _M_data_allocator.deallocate(__p, __n); }
};
template <class _Tp, class _Allocator>
class _Vector_alloc_base<_Tp, _Allocator, true> {
public:
typedef typename _Alloc_traits<_Tp, _Allocator>::allocator_type
allocator_type;
allocator_type get_allocator() const { return allocator_type(); }
_Vector_alloc_base(const allocator_type&)
: _M_start(0), _M_finish(0), _M_end_of_storage(0)
{}
protected:
_Tp* _M_start;
_Tp* _M_finish;
_Tp* _M_end_of_storage;
typedef typename _Alloc_traits<_Tp, _Allocator>::_Alloc_type _Alloc_type;
_Tp* _M_allocate(size_t __n)
{ return _Alloc_type::allocate(__n); }
void _M_deallocate(_Tp* __p, size_t __n)
{ _Alloc_type::deallocate(__p, __n);}
};
template <class _Tp, class _Alloc>
struct _Vector_base
: public _Vector_alloc_base<_Tp, _Alloc,
_Alloc_traits<_Tp, _Alloc>::_S_instanceless>
{
typedef _Vector_alloc_base<_Tp, _Alloc,
_Alloc_traits<_Tp, _Alloc>::_S_instanceless>
_Base;
typedef typename _Base::allocator_type allocator_type;
_Vector_base(const allocator_type& __a) : _Base(__a) {}
_Vector_base(size_t __n, const allocator_type& __a) : _Base(__a) {
_M_start = _M_allocate(__n);
_M_finish = _M_start;
_M_end_of_storage = _M_start + __n;
}
~_Vector_base() { _M_deallocate(_M_start, _M_end_of_storage - _M_start); }
};
# 150 "/usr/include/g++/stl_vector.h" 3
template <class _Tp, class _Alloc = allocator< _Tp > >
class vector : protected _Vector_base<_Tp, _Alloc>
{
private:
typedef _Vector_base<_Tp, _Alloc> _Base;
public:
typedef _Tp value_type;
typedef value_type* pointer;
typedef const value_type* const_pointer;
typedef value_type* iterator;
typedef const value_type* const_iterator;
typedef value_type& reference;
typedef const value_type& const_reference;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef typename _Base::allocator_type allocator_type;
allocator_type get_allocator() const { return _Base::get_allocator(); }
typedef reverse_iterator<const_iterator> const_reverse_iterator;
typedef reverse_iterator<iterator> reverse_iterator;
protected:
using _Base::_M_allocate;
using _Base::_M_deallocate;
using _Base::_M_start;
using _Base::_M_finish;
using _Base::_M_end_of_storage;
protected:
void _M_insert_aux(iterator __position, const _Tp& __x);
void _M_insert_aux(iterator __position);
public:
iterator begin() { return _M_start; }
const_iterator begin() const { return _M_start; }
iterator end() { return _M_finish; }
const_iterator end() const { return _M_finish; }
reverse_iterator rbegin()
{ return reverse_iterator(end()); }
const_reverse_iterator rbegin() const
{ return const_reverse_iterator(end()); }
reverse_iterator rend()
{ return reverse_iterator(begin()); }
const_reverse_iterator rend() const
{ return const_reverse_iterator(begin()); }
size_type size() const
{ return size_type(end() - begin()); }
size_type max_size() const
{ return size_type(-1) / sizeof(_Tp); }
size_type capacity() const
{ return size_type(_M_end_of_storage - begin()); }
bool empty() const
{ return begin() == end(); }
reference operator[](size_type __n) { return *(begin() + __n); }
const_reference operator[](size_type __n) const { return *(begin() + __n); }
explicit vector(const allocator_type& __a = allocator_type())
: _Base(__a) {}
vector(size_type __n, const _Tp& __value,
const allocator_type& __a = allocator_type())
: _Base(__n, __a)
{ _M_finish = uninitialized_fill_n(_M_start, __n, __value); }
explicit vector(size_type __n)
: _Base(__n, allocator_type())
{ _M_finish = uninitialized_fill_n(_M_start, __n, _Tp()); }
vector(const vector<_Tp, _Alloc>& __x)
: _Base(__x.size(), __x.get_allocator())
{ _M_finish = uninitialized_copy(__x.begin(), __x.end(), _M_start); }
template <class _InputIterator>
vector(_InputIterator __first, _InputIterator __last,
const allocator_type& __a = allocator_type()) : _Base(__a) {
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
_M_initialize_aux(__first, __last, _Integral());
}
template <class _Integer>
void _M_initialize_aux(_Integer __n, _Integer __value, __true_type) {
_M_start = _M_allocate(__n);
_M_end_of_storage = _M_start + __n;
_M_finish = uninitialized_fill_n(_M_start, __n, __value);
}
template <class _InputIterator>
void _M_initialize_aux(_InputIterator __first, _InputIterator __last,
__false_type) {
_M_range_initialize(__first, __last, __iterator_category( __first ) );
}
~vector() { destroy(_M_start, _M_finish); }
vector<_Tp, _Alloc>& operator=(const vector<_Tp, _Alloc>& __x);
void reserve(size_type __n) {
if (capacity() < __n) {
const size_type __old_size = size();
iterator __tmp = _M_allocate_and_copy(__n, _M_start, _M_finish);
destroy(_M_start, _M_finish);
_M_deallocate(_M_start, _M_end_of_storage - _M_start);
_M_start = __tmp;
_M_finish = __tmp + __old_size;
_M_end_of_storage = _M_start + __n;
}
}
void assign(size_type __n, const _Tp& __val);
template <class _InputIterator>
void assign(_InputIterator __first, _InputIterator __last) {
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
_M_assign_dispatch(__first, __last, _Integral());
}
template <class _Integer>
void _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
{ assign((size_type) __n, (_Tp) __val); }
template <class _InputIter>
void _M_assign_dispatch(_InputIter __first, _InputIter __last, __false_type)
{ _M_assign_aux(__first, __last, __iterator_category( __first ) ); }
template <class _InputIterator>
void _M_assign_aux(_InputIterator __first, _InputIterator __last,
input_iterator_tag);
template <class _ForwardIterator>
void _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
forward_iterator_tag);
reference front() { return *begin(); }
const_reference front() const { return *begin(); }
reference back() { return *(end() - 1); }
const_reference back() const { return *(end() - 1); }
void push_back(const _Tp& __x) {
if (_M_finish != _M_end_of_storage) {
construct(_M_finish, __x);
++_M_finish;
}
else
_M_insert_aux(end(), __x);
}
void push_back() {
if (_M_finish != _M_end_of_storage) {
construct(_M_finish);
++_M_finish;
}
else
_M_insert_aux(end());
}
void swap(vector<_Tp, _Alloc>& __x) {
::swap(_M_start, __x._M_start);
::swap(_M_finish, __x._M_finish);
::swap(_M_end_of_storage, __x._M_end_of_storage);
}
iterator insert(iterator __position, const _Tp& __x) {
size_type __n = __position - begin();
if (_M_finish != _M_end_of_storage && __position == end()) {
construct(_M_finish, __x);
++_M_finish;
}
else
_M_insert_aux(__position, __x);
return begin() + __n;
}
iterator insert(iterator __position) {
size_type __n = __position - begin();
if (_M_finish != _M_end_of_storage && __position == end()) {
construct(_M_finish);
++_M_finish;
}
else
_M_insert_aux(__position);
return begin() + __n;
}
template <class _InputIterator>
void insert(iterator __pos, _InputIterator __first, _InputIterator __last) {
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
_M_insert_dispatch(__pos, __first, __last, _Integral());
}
template <class _Integer>
void _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __val,
__true_type) {
insert(__pos, (size_type) __n, (_Tp) __val);
}
template <class _InputIterator>
void _M_insert_dispatch(iterator __pos,
_InputIterator __first, _InputIterator __last,
__false_type) {
_M_range_insert(__pos, __first, __last, __iterator_category( __first ) );
}
void insert (iterator __pos, size_type __n, const _Tp& __x);
void pop_back() {
--_M_finish;
destroy(_M_finish);
}
iterator erase(iterator __position) {
if (__position + 1 != end())
copy(__position + 1, _M_finish, __position);
--_M_finish;
destroy(_M_finish);
return __position;
}
iterator erase(iterator __first, iterator __last) {
iterator __i = copy(__last, _M_finish, __first);
destroy(__i, _M_finish);
_M_finish = _M_finish - (__last - __first);
return __first;
}
void resize(size_type __new_size, const _Tp& __x) {
if (__new_size < size())
erase(begin() + __new_size, end());
else
insert(end(), __new_size - size(), __x);
}
void resize(size_type __new_size) { resize(__new_size, _Tp()); }
void clear() { erase(begin(), end()); }
protected:
template <class _ForwardIterator>
iterator _M_allocate_and_copy(size_type __n, _ForwardIterator __first,
_ForwardIterator __last)
{
iterator __result = _M_allocate(__n);
try {
uninitialized_copy(__first, __last, __result);
return __result;
}
catch(...) { _M_deallocate(__result, __n) ; throw; } ;
}
# 440 "/usr/include/g++/stl_vector.h" 3
template <class _InputIterator>
void _M_range_initialize(_InputIterator __first,
_InputIterator __last, input_iterator_tag)
{
for ( ; __first != __last; ++__first)
push_back(*__first);
}
template <class _ForwardIterator>
void _M_range_initialize(_ForwardIterator __first,
_ForwardIterator __last, forward_iterator_tag)
{
size_type __n = 0;
distance(__first, __last, __n);
_M_start = _M_allocate(__n);
_M_end_of_storage = _M_start + __n;
_M_finish = uninitialized_copy(__first, __last, _M_start);
}
template <class _InputIterator>
void _M_range_insert(iterator __pos,
_InputIterator __first, _InputIterator __last,
input_iterator_tag);
template <class _ForwardIterator>
void _M_range_insert(iterator __pos,
_ForwardIterator __first, _ForwardIterator __last,
forward_iterator_tag);
};
template <class _Tp, class _Alloc>
inline bool
operator==(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
{
return __x.size() == __y.size() &&
equal(__x.begin(), __x.end(), __y.begin());
}
template <class _Tp, class _Alloc>
inline bool
operator<(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
{
return lexicographical_compare(__x.begin(), __x.end(),
__y.begin(), __y.end());
}
template <class _Tp, class _Alloc>
inline void swap(vector<_Tp, _Alloc>& __x, vector<_Tp, _Alloc>& __y)
{
__x.swap(__y);
}
template <class _Tp, class _Alloc>
vector<_Tp,_Alloc>&
vector<_Tp,_Alloc>::operator=(const vector<_Tp, _Alloc>& __x)
{
if (&__x != this) {
const size_type __xlen = __x.size();
if (__xlen > capacity()) {
iterator __tmp = _M_allocate_and_copy(__xlen, __x.begin(), __x.end());
destroy(_M_start, _M_finish);
_M_deallocate(_M_start, _M_end_of_storage - _M_start);
_M_start = __tmp;
_M_end_of_storage = _M_start + __xlen;
}
else if (size() >= __xlen) {
iterator __i = copy(__x.begin(), __x.end(), begin());
destroy(__i, _M_finish);
}
else {
copy(__x.begin(), __x.begin() + size(), _M_start);
uninitialized_copy(__x.begin() + size(), __x.end(), _M_finish);
}
_M_finish = _M_start + __xlen;
}
return *this;
}
template <class _Tp, class _Alloc>
void vector<_Tp, _Alloc>::assign(size_t __n, const value_type& __val) {
if (__n > capacity()) {
vector<_Tp, _Alloc> __tmp(__n, __val, get_allocator());
__tmp.swap(*this);
}
else if (__n > size()) {
fill(begin(), end(), __val);
_M_finish = uninitialized_fill_n(_M_finish, __n - size(), __val);
}
else
erase(fill_n(begin(), __n, __val), end());
}
template <class _Tp, class _Alloc> template <class _InputIter>
void vector<_Tp, _Alloc>::_M_assign_aux(_InputIter __first, _InputIter __last,
input_iterator_tag) {
iterator __cur = begin();
for ( ; __first != __last && __cur != end(); ++__cur, ++__first)
*__cur = *__first;
if (__first == __last)
erase(__cur, end());
else
insert(end(), __first, __last);
}
template <class _Tp, class _Alloc> template <class _ForwardIter>
void
vector<_Tp, _Alloc>::_M_assign_aux(_ForwardIter __first, _ForwardIter __last,
forward_iterator_tag) {
size_type __len = 0;
distance(__first, __last, __len);
if (__len > capacity()) {
iterator __tmp = _M_allocate_and_copy(__len, __first, __last);
destroy(_M_start, _M_finish);
_M_deallocate(_M_start, _M_end_of_storage - _M_start);
_M_start = __tmp;
_M_end_of_storage = _M_finish = _M_start + __len;
}
else if (size() >= __len) {
iterator __new_finish = copy(__first, __last, _M_start);
destroy(__new_finish, _M_finish);
_M_finish = __new_finish;
}
else {
_ForwardIter __mid = __first;
advance(__mid, size());
copy(__first, __mid, _M_start);
_M_finish = uninitialized_copy(__mid, __last, _M_finish);
}
}
template <class _Tp, class _Alloc>
void
vector<_Tp, _Alloc>::_M_insert_aux(iterator __position, const _Tp& __x)
{
if (_M_finish != _M_end_of_storage) {
construct(_M_finish, *(_M_finish - 1));
++_M_finish;
_Tp __x_copy = __x;
copy_backward(__position, _M_finish - 2, _M_finish - 1);
*__position = __x_copy;
}
else {
const size_type __old_size = size();
const size_type __len = __old_size != 0 ? 2 * __old_size : 1;
iterator __new_start = _M_allocate(__len);
iterator __new_finish = __new_start;
try {
__new_finish = uninitialized_copy(_M_start, __position, __new_start);
construct(__new_finish, __x);
++__new_finish;
__new_finish = uninitialized_copy(__position, _M_finish, __new_finish);
}
catch(...) { (destroy(__new_start,__new_finish),
_M_deallocate(__new_start,__len)) ; throw; } ;
destroy(begin(), end());
_M_deallocate(_M_start, _M_end_of_storage - _M_start);
_M_start = __new_start;
_M_finish = __new_finish;
_M_end_of_storage = __new_start + __len;
}
}
template <class _Tp, class _Alloc>
void
vector<_Tp, _Alloc>::_M_insert_aux(iterator __position)
{
if (_M_finish != _M_end_of_storage) {
construct(_M_finish, *(_M_finish - 1));
++_M_finish;
copy_backward(__position, _M_finish - 2, _M_finish - 1);
*__position = _Tp();
}
else {
const size_type __old_size = size();
const size_type __len = __old_size != 0 ? 2 * __old_size : 1;
iterator __new_start = _M_allocate(__len);
iterator __new_finish = __new_start;
try {
__new_finish = uninitialized_copy(_M_start, __position, __new_start);
construct(__new_finish);
++__new_finish;
__new_finish = uninitialized_copy(__position, _M_finish, __new_finish);
}
catch(...) { (destroy(__new_start,__new_finish),
_M_deallocate(__new_start,__len)) ; throw; } ;
destroy(begin(), end());
_M_deallocate(_M_start, _M_end_of_storage - _M_start);
_M_start = __new_start;
_M_finish = __new_finish;
_M_end_of_storage = __new_start + __len;
}
}
template <class _Tp, class _Alloc>
void vector<_Tp, _Alloc>::insert(iterator __position, size_type __n,
const _Tp& __x)
{
if (__n != 0) {
if (size_type(_M_end_of_storage - _M_finish) >= __n) {
_Tp __x_copy = __x;
const size_type __elems_after = _M_finish - __position;
iterator __old_finish = _M_finish;
if (__elems_after > __n) {
uninitialized_copy(_M_finish - __n, _M_finish, _M_finish);
_M_finish += __n;
copy_backward(__position, __old_finish - __n, __old_finish);
fill(__position, __position + __n, __x_copy);
}
else {
uninitialized_fill_n(_M_finish, __n - __elems_after, __x_copy);
_M_finish += __n - __elems_after;
uninitialized_copy(__position, __old_finish, _M_finish);
_M_finish += __elems_after;
fill(__position, __old_finish, __x_copy);
}
}
else {
const size_type __old_size = size();
const size_type __len = __old_size + max(__old_size, __n);
iterator __new_start = _M_allocate(__len);
iterator __new_finish = __new_start;
try {
__new_finish = uninitialized_copy(_M_start, __position, __new_start);
__new_finish = uninitialized_fill_n(__new_finish, __n, __x);
__new_finish
= uninitialized_copy(__position, _M_finish, __new_finish);
}
catch(...) { (destroy(__new_start,__new_finish),
_M_deallocate(__new_start,__len)) ; throw; } ;
destroy(_M_start, _M_finish);
_M_deallocate(_M_start, _M_end_of_storage - _M_start);
_M_start = __new_start;
_M_finish = __new_finish;
_M_end_of_storage = __new_start + __len;
}
}
}
template <class _Tp, class _Alloc> template <class _InputIterator>
void
vector<_Tp, _Alloc>::_M_range_insert(iterator __pos,
_InputIterator __first,
_InputIterator __last,
input_iterator_tag)
{
for ( ; __first != __last; ++__first) {
__pos = insert(__pos, *__first);
++__pos;
}
}
template <class _Tp, class _Alloc> template <class _ForwardIterator>
void
vector<_Tp, _Alloc>::_M_range_insert(iterator __position,
_ForwardIterator __first,
_ForwardIterator __last,
forward_iterator_tag)
{
if (__first != __last) {
size_type __n = 0;
distance(__first, __last, __n);
if (size_type(_M_end_of_storage - _M_finish) >= __n) {
const size_type __elems_after = _M_finish - __position;
iterator __old_finish = _M_finish;
if (__elems_after > __n) {
uninitialized_copy(_M_finish - __n, _M_finish, _M_finish);
_M_finish += __n;
copy_backward(__position, __old_finish - __n, __old_finish);
copy(__first, __last, __position);
}
else {
_ForwardIterator __mid = __first;
advance(__mid, __elems_after);
uninitialized_copy(__mid, __last, _M_finish);
_M_finish += __n - __elems_after;
uninitialized_copy(__position, __old_finish, _M_finish);
_M_finish += __elems_after;
copy(__first, __mid, __position);
}
}
else {
const size_type __old_size = size();
const size_type __len = __old_size + max(__old_size, __n);
iterator __new_start = _M_allocate(__len);
iterator __new_finish = __new_start;
try {
__new_finish = uninitialized_copy(_M_start, __position, __new_start);
__new_finish = uninitialized_copy(__first, __last, __new_finish);
__new_finish
= uninitialized_copy(__position, _M_finish, __new_finish);
}
catch(...) { (destroy(__new_start,__new_finish),
_M_deallocate(__new_start,__len)) ; throw; } ;
destroy(_M_start, _M_finish);
_M_deallocate(_M_start, _M_end_of_storage - _M_start);
_M_start = __new_start;
_M_finish = __new_finish;
_M_end_of_storage = __new_start + __len;
}
}
}
# 810 "/usr/include/g++/stl_vector.h" 3
# 34 "/usr/include/g++/queue" 2 3
# 1 "/usr/include/g++/stl_bvector.h" 1 3
static const int __WORD_BIT = int(8 *sizeof(unsigned int));
struct _Bit_reference {
unsigned int* _M_p;
unsigned int _M_mask;
_Bit_reference(unsigned int* __x, unsigned int __y)
: _M_p(__x), _M_mask(__y) {}
public:
_Bit_reference() : _M_p(0), _M_mask(0) {}
operator bool() const { return !(!(*_M_p & _M_mask)); }
_Bit_reference& operator=(bool __x)
{
if (__x) *_M_p |= _M_mask;
else *_M_p &= ~_M_mask;
return *this;
}
_Bit_reference& operator=(const _Bit_reference& __x)
{ return *this = bool(__x); }
bool operator==(const _Bit_reference& __x) const
{ return bool(*this) == bool(__x); }
bool operator<(const _Bit_reference& __x) const {
return !bool(*this) && bool(__x);
}
void flip() { *_M_p ^= _M_mask; }
};
inline void swap(_Bit_reference __x, _Bit_reference __y)
{
bool __tmp = __x;
__x = __y;
__y = __tmp;
}
struct _Bit_iterator : public random_access_iterator<bool, ptrdiff_t> {
typedef _Bit_reference reference;
typedef _Bit_reference* pointer;
typedef _Bit_iterator iterator;
unsigned int* _M_p;
unsigned int _M_offset;
void bump_up() {
if (_M_offset++ == __WORD_BIT - 1) {
_M_offset = 0;
++_M_p;
}
}
void bump_down() {
if (_M_offset-- == 0) {
_M_offset = __WORD_BIT - 1;
--_M_p;
}
}
_Bit_iterator() : _M_p(0), _M_offset(0) {}
_Bit_iterator(unsigned int* __x, unsigned int __y)
: _M_p(__x), _M_offset(__y) {}
reference operator*() const { return reference(_M_p, 1U << _M_offset); }
iterator& operator++() {
bump_up();
return *this;
}
iterator operator++(int) {
iterator __tmp = *this;
bump_up();
return __tmp;
}
iterator& operator--() {
bump_down();
return *this;
}
iterator operator--(int) {
iterator __tmp = *this;
bump_down();
return __tmp;
}
iterator& operator+=(difference_type __i) {
difference_type __n = __i + _M_offset;
_M_p += __n / __WORD_BIT;
__n = __n % __WORD_BIT;
if (__n < 0) {
_M_offset = (unsigned int) __n + __WORD_BIT;
--_M_p;
} else
_M_offset = (unsigned int) __n;
return *this;
}
iterator& operator-=(difference_type __i) {
*this += -__i;
return *this;
}
iterator operator+(difference_type __i) const {
iterator __tmp = *this;
return __tmp += __i;
}
iterator operator-(difference_type __i) const {
iterator __tmp = *this;
return __tmp -= __i;
}
difference_type operator-(iterator __x) const {
return __WORD_BIT * (_M_p - __x._M_p) + _M_offset - __x._M_offset;
}
reference operator[](difference_type __i) { return *(*this + __i); }
bool operator==(const iterator& __x) const {
return _M_p == __x._M_p && _M_offset == __x._M_offset;
}
bool operator!=(const iterator& __x) const {
return _M_p != __x._M_p || _M_offset != __x._M_offset;
}
bool operator<(iterator __x) const {
return _M_p < __x._M_p || (_M_p == __x._M_p && _M_offset < __x._M_offset);
}
};
struct _Bit_const_iterator
: public random_access_iterator<bool, ptrdiff_t>
{
typedef bool reference;
typedef bool const_reference;
typedef const bool* pointer;
typedef _Bit_const_iterator const_iterator;
unsigned int* _M_p;
unsigned int _M_offset;
void bump_up() {
if (_M_offset++ == __WORD_BIT - 1) {
_M_offset = 0;
++_M_p;
}
}
void bump_down() {
if (_M_offset-- == 0) {
_M_offset = __WORD_BIT - 1;
--_M_p;
}
}
_Bit_const_iterator() : _M_p(0), _M_offset(0) {}
_Bit_const_iterator(unsigned int* __x, unsigned int __y)
: _M_p(__x), _M_offset(__y) {}
_Bit_const_iterator(const _Bit_iterator& __x)
: _M_p(__x._M_p), _M_offset(__x._M_offset) {}
const_reference operator*() const {
return _Bit_reference(_M_p, 1U << _M_offset);
}
const_iterator& operator++() {
bump_up();
return *this;
}
const_iterator operator++(int) {
const_iterator __tmp = *this;
bump_up();
return __tmp;
}
const_iterator& operator--() {
bump_down();
return *this;
}
const_iterator operator--(int) {
const_iterator __tmp = *this;
bump_down();
return __tmp;
}
const_iterator& operator+=(difference_type __i) {
difference_type __n = __i + _M_offset;
_M_p += __n / __WORD_BIT;
__n = __n % __WORD_BIT;
if (__n < 0) {
_M_offset = (unsigned int) __n + __WORD_BIT;
--_M_p;
} else
_M_offset = (unsigned int) __n;
return *this;
}
const_iterator& operator-=(difference_type __i) {
*this += -__i;
return *this;
}
const_iterator operator+(difference_type __i) const {
const_iterator __tmp = *this;
return __tmp += __i;
}
const_iterator operator-(difference_type __i) const {
const_iterator __tmp = *this;
return __tmp -= __i;
}
difference_type operator-(const_iterator __x) const {
return __WORD_BIT * (_M_p - __x._M_p) + _M_offset - __x._M_offset;
}
const_reference operator[](difference_type __i) {
return *(*this + __i);
}
bool operator==(const const_iterator& __x) const {
return _M_p == __x._M_p && _M_offset == __x._M_offset;
}
bool operator!=(const const_iterator& __x) const {
return _M_p != __x._M_p || _M_offset != __x._M_offset;
}
bool operator<(const_iterator __x) const {
return _M_p < __x._M_p || (_M_p == __x._M_p && _M_offset < __x._M_offset);
}
};
template <class _Allocator, bool __is_static>
class _Bvector_alloc_base {
public:
typedef typename _Alloc_traits<bool, _Allocator>::allocator_type
allocator_type;
allocator_type get_allocator() const { return _M_data_allocator; }
_Bvector_alloc_base(const allocator_type& __a)
: _M_data_allocator(__a), _M_start(), _M_finish(), _M_end_of_storage(0) {}
protected:
unsigned int* _M_bit_alloc(size_t __n)
{ return _M_data_allocator.allocate((__n + __WORD_BIT - 1)/__WORD_BIT); }
void _M_deallocate() {
if (_M_start._M_p)
_M_data_allocator.deallocate(_M_start._M_p,
_M_end_of_storage - _M_start._M_p);
}
typename _Alloc_traits<unsigned int, _Allocator>::allocator_type
_M_data_allocator;
_Bit_iterator _M_start;
_Bit_iterator _M_finish;
unsigned int* _M_end_of_storage;
};
template <class _Allocator>
class _Bvector_alloc_base<_Allocator, true> {
public:
typedef typename _Alloc_traits<bool, _Allocator>::allocator_type
allocator_type;
allocator_type get_allocator() const { return allocator_type(); }
_Bvector_alloc_base(const allocator_type&)
: _M_start(), _M_finish(), _M_end_of_storage(0) {}
protected:
typedef typename _Alloc_traits<unsigned int, _Allocator>::_Alloc_type
_Alloc_type;
unsigned int* _M_bit_alloc(size_t __n)
{ return _Alloc_type::allocate((__n + __WORD_BIT - 1)/__WORD_BIT); }
void _M_deallocate() {
if (_M_start._M_p)
_Alloc_type::deallocate(_M_start._M_p,
_M_end_of_storage - _M_start._M_p);
}
_Bit_iterator _M_start;
_Bit_iterator _M_finish;
unsigned int* _M_end_of_storage;
};
template <class _Alloc>
class _Bvector_base
: public _Bvector_alloc_base<_Alloc,
_Alloc_traits<bool, _Alloc>::_S_instanceless>
{
typedef _Bvector_alloc_base<_Alloc,
_Alloc_traits<bool, _Alloc>::_S_instanceless>
_Base;
public:
typedef typename _Base::allocator_type allocator_type;
_Bvector_base(const allocator_type& __a) : _Base(__a) {}
~_Bvector_base() { _Base::_M_deallocate(); }
};
# 348 "/usr/include/g++/stl_bvector.h" 3
template<class _Alloc> class vector<bool,_Alloc>
: public _Bvector_base<_Alloc>
{
typedef _Bvector_base<_Alloc> _Base;
public:
typedef bool value_type;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef _Bit_reference reference;
typedef bool const_reference;
typedef _Bit_reference* pointer;
typedef const bool* const_pointer;
typedef _Bit_iterator iterator;
typedef _Bit_const_iterator const_iterator;
typedef reverse_iterator<const_iterator> const_reverse_iterator;
typedef reverse_iterator<iterator> reverse_iterator;
typedef typename _Base::allocator_type allocator_type;
allocator_type get_allocator() const { return _Base::get_allocator(); }
protected:
protected:
void _M_initialize(size_type __n) {
unsigned int* __q = _M_bit_alloc(__n);
_M_end_of_storage = __q + (__n + __WORD_BIT - 1)/__WORD_BIT;
_M_start = iterator(__q, 0);
_M_finish = _M_start + difference_type(__n);
}
void _M_insert_aux(iterator __position, bool __x) {
if (_M_finish._M_p != _M_end_of_storage) {
copy_backward(__position, _M_finish, _M_finish + 1);
*__position = __x;
++_M_finish;
}
else {
size_type __len = size() ? 2 * size() : __WORD_BIT;
unsigned int* __q = _M_bit_alloc(__len);
iterator __i = copy(begin(), __position, iterator(__q, 0));
*__i++ = __x;
_M_finish = copy(__position, end(), __i);
_M_deallocate();
_M_end_of_storage = __q + (__len + __WORD_BIT - 1)/__WORD_BIT;
_M_start = iterator(__q, 0);
}
}
template <class _InputIterator>
void _M_initialize_range(_InputIterator __first, _InputIterator __last,
input_iterator_tag) {
_M_start = iterator();
_M_finish = iterator();
_M_end_of_storage = 0;
for ( ; __first != __last; ++__first)
push_back(*__first);
}
template <class _ForwardIterator>
void _M_initialize_range(_ForwardIterator __first, _ForwardIterator __last,
forward_iterator_tag) {
size_type __n = 0;
distance(__first, __last, __n);
_M_initialize(__n);
copy(__first, __last, _M_start);
}
template <class _InputIterator>
void _M_insert_range(iterator __pos,
_InputIterator __first, _InputIterator __last,
input_iterator_tag) {
for ( ; __first != __last; ++__first) {
__pos = insert(__pos, *__first);
++__pos;
}
}
template <class _ForwardIterator>
void _M_insert_range(iterator __position,
_ForwardIterator __first, _ForwardIterator __last,
forward_iterator_tag) {
if (__first != __last) {
size_type __n = 0;
distance(__first, __last, __n);
if (capacity() - size() >= __n) {
copy_backward(__position, end(), _M_finish + difference_type(__n));
copy(__first, __last, __position);
_M_finish += difference_type(__n);
}
else {
size_type __len = size() + max(size(), __n);
unsigned int* __q = _M_bit_alloc(__len);
iterator __i = copy(begin(), __position, iterator(__q, 0));
__i = copy(__first, __last, __i);
_M_finish = copy(__position, end(), __i);
_M_deallocate();
_M_end_of_storage = __q + (__len + __WORD_BIT - 1)/__WORD_BIT;
_M_start = iterator(__q, 0);
}
}
}
public:
iterator begin() { return _M_start; }
const_iterator begin() const { return _M_start; }
iterator end() { return _M_finish; }
const_iterator end() const { return _M_finish; }
reverse_iterator rbegin() { return reverse_iterator(end()); }
const_reverse_iterator rbegin() const {
return const_reverse_iterator(end());
}
reverse_iterator rend() { return reverse_iterator(begin()); }
const_reverse_iterator rend() const {
return const_reverse_iterator(begin());
}
size_type size() const { return size_type(end() - begin()); }
size_type max_size() const { return size_type(-1); }
size_type capacity() const {
return size_type(const_iterator(_M_end_of_storage, 0) - begin());
}
bool empty() const { return begin() == end(); }
reference operator[](size_type __n) {
return *(begin() + difference_type(__n));
}
const_reference operator[](size_type __n) const {
return *(begin() + difference_type(__n));
}
explicit vector (const allocator_type& __a = allocator_type())
: _Base(__a) {}
vector (size_type __n, bool __value,
const allocator_type& __a = allocator_type())
: _Base(__a)
{
_M_initialize(__n);
fill(_M_start._M_p, _M_end_of_storage, __value ? ~0 : 0);
}
explicit vector (size_type __n)
: _Base(allocator_type())
{
_M_initialize(__n);
fill(_M_start._M_p, _M_end_of_storage, 0);
}
vector (const vector & __x) : _Base(__x.get_allocator()) {
_M_initialize(__x.size());
copy(__x.begin(), __x.end(), _M_start);
}
template <class _InputIterator>
vector (_InputIterator __first, _InputIterator __last,
const allocator_type& __a = allocator_type())
: _Base(__a)
{
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
_M_initialize_dispatch(__first, __last, _Integral());
}
template <class _Integer>
void _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type) {
_M_initialize(__n);
fill(_M_start._M_p, _M_end_of_storage, __x ? ~0 : 0);
}
template <class _InputIterator>
void _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
__false_type) {
_M_initialize_range(__first, __last, __iterator_category( __first ) );
}
# 587 "/usr/include/g++/stl_bvector.h" 3
~vector () { }
vector & operator=(const vector & __x) {
if (&__x == this) return *this;
if (__x.size() > capacity()) {
_M_deallocate();
_M_initialize(__x.size());
}
copy(__x.begin(), __x.end(), begin());
_M_finish = begin() + difference_type(__x.size());
return *this;
}
void assign(size_t __n, bool __x) {
if (__n > size()) {
fill(_M_start._M_p, _M_end_of_storage, __x ? ~0 : 0);
insert(end(), __n - size(), __x);
}
else {
erase(begin() + __n, end());
fill(_M_start._M_p, _M_end_of_storage, __x ? ~0 : 0);
}
}
template <class _InputIterator>
void assign(_InputIterator __first, _InputIterator __last) {
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
_M_assign_dispatch(__first, __last, _Integral());
}
template <class _Integer>
void _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
{ assign((size_t) __n, (bool) __val); }
template <class _InputIter>
void _M_assign_dispatch(_InputIter __first, _InputIter __last, __false_type)
{ _M_assign_aux(__first, __last, __iterator_category( __first ) ); }
template <class _InputIterator>
void _M_assign_aux(_InputIterator __first, _InputIterator __last,
input_iterator_tag) {
iterator __cur = begin();
for ( ; __first != __last && __cur != end(); ++__cur, ++__first)
*__cur = *__first;
if (__first == __last)
erase(__cur, end());
else
insert(end(), __first, __last);
}
template <class _ForwardIterator>
void _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
forward_iterator_tag) {
size_type __len = 0;
distance(__first, __last, __len);
if (__len < size())
erase(copy(__first, __last, begin()), end());
else {
_ForwardIterator __mid = __first;
advance(__mid, size());
copy(__first, __mid, begin());
insert(end(), __mid, __last);
}
}
void reserve(size_type __n) {
if (capacity() < __n) {
unsigned int* __q = _M_bit_alloc(__n);
_M_finish = copy(begin(), end(), iterator(__q, 0));
_M_deallocate();
_M_start = iterator(__q, 0);
_M_end_of_storage = __q + (__n + __WORD_BIT - 1)/__WORD_BIT;
}
}
reference front() { return *begin(); }
const_reference front() const { return *begin(); }
reference back() { return *(end() - 1); }
const_reference back() const { return *(end() - 1); }
void push_back(bool __x) {
if (_M_finish._M_p != _M_end_of_storage)
*_M_finish++ = __x;
else
_M_insert_aux(end(), __x);
}
void swap(vector & __x) {
::swap(_M_start, __x._M_start);
::swap(_M_finish, __x._M_finish);
::swap(_M_end_of_storage, __x._M_end_of_storage);
}
iterator insert(iterator __position, bool __x = bool()) {
difference_type __n = __position - begin();
if (_M_finish._M_p != _M_end_of_storage && __position == end())
*_M_finish++ = __x;
else
_M_insert_aux(__position, __x);
return begin() + __n;
}
template <class _InputIterator>
void insert(iterator __position,
_InputIterator __first, _InputIterator __last) {
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
_M_insert_dispatch(__position, __first, __last, _Integral());
}
template <class _Integer>
void _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x,
__true_type) {
insert(__pos, (size_type) __n, (bool) __x);
}
template <class _InputIterator>
void _M_insert_dispatch(iterator __pos,
_InputIterator __first, _InputIterator __last,
__false_type) {
_M_insert_range(__pos, __first, __last, __iterator_category( __first ) );
}
# 761 "/usr/include/g++/stl_bvector.h" 3
void insert(iterator __position, size_type __n, bool __x) {
if (__n == 0) return;
if (capacity() - size() >= __n) {
copy_backward(__position, end(), _M_finish + difference_type(__n));
fill(__position, __position + difference_type(__n), __x);
_M_finish += difference_type(__n);
}
else {
size_type __len = size() + max(size(), __n);
unsigned int* __q = _M_bit_alloc(__len);
iterator __i = copy(begin(), __position, iterator(__q, 0));
fill_n(__i, __n, __x);
_M_finish = copy(__position, end(), __i + difference_type(__n));
_M_deallocate();
_M_end_of_storage = __q + (__len + __WORD_BIT - 1)/__WORD_BIT;
_M_start = iterator(__q, 0);
}
}
void pop_back() { --_M_finish; }
iterator erase(iterator __position) {
if (__position + 1 != end())
copy(__position + 1, end(), __position);
--_M_finish;
return __position;
}
iterator erase(iterator __first, iterator __last) {
_M_finish = copy(__last, end(), __first);
return __first;
}
void resize(size_type __new_size, bool __x = bool()) {
if (__new_size < size())
erase(begin() + difference_type(__new_size), end());
else
insert(end(), __new_size - size(), __x);
}
void clear() { erase(begin(), end()); }
};
typedef vector<bool, alloc> bit_vector;
# 822 "/usr/include/g++/stl_bvector.h" 3
# 35 "/usr/include/g++/queue" 2 3
# 1 "/usr/include/g++/stl_heap.h" 1 3
template <class _RandomAccessIterator, class _Distance, class _Tp>
void
__push_heap(_RandomAccessIterator __first,
_Distance __holeIndex, _Distance __topIndex, _Tp __value)
{
_Distance __parent = (__holeIndex - 1) / 2;
while (__holeIndex > __topIndex && *(__first + __parent) < __value) {
*(__first + __holeIndex) = *(__first + __parent);
__holeIndex = __parent;
__parent = (__holeIndex - 1) / 2;
}
*(__first + __holeIndex) = __value;
}
template <class _RandomAccessIterator, class _Distance, class _Tp>
inline void
__push_heap_aux(_RandomAccessIterator __first,
_RandomAccessIterator __last, _Distance*, _Tp*)
{
__push_heap(__first, _Distance((__last - __first) - 1), _Distance(0),
_Tp(*(__last - 1)));
}
template <class _RandomAccessIterator>
inline void
push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
{
__push_heap_aux(__first, __last,
__distance_type( __first ) , __value_type( __first ) );
}
template <class _RandomAccessIterator, class _Distance, class _Tp,
class _Compare>
void
__push_heap(_RandomAccessIterator __first, _Distance __holeIndex,
_Distance __topIndex, _Tp __value, _Compare __comp)
{
_Distance __parent = (__holeIndex - 1) / 2;
while (__holeIndex > __topIndex && __comp(*(__first + __parent), __value)) {
*(__first + __holeIndex) = *(__first + __parent);
__holeIndex = __parent;
__parent = (__holeIndex - 1) / 2;
}
*(__first + __holeIndex) = __value;
}
template <class _RandomAccessIterator, class _Compare,
class _Distance, class _Tp>
inline void
__push_heap_aux(_RandomAccessIterator __first,
_RandomAccessIterator __last, _Compare __comp,
_Distance*, _Tp*)
{
__push_heap(__first, _Distance((__last - __first) - 1), _Distance(0),
_Tp(*(__last - 1)), __comp);
}
template <class _RandomAccessIterator, class _Compare>
inline void
push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Compare __comp)
{
__push_heap_aux(__first, __last, __comp,
__distance_type( __first ) , __value_type( __first ) );
}
template <class _RandomAccessIterator, class _Distance, class _Tp>
void
__adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex,
_Distance __len, _Tp __value)
{
_Distance __topIndex = __holeIndex;
_Distance __secondChild = 2 * __holeIndex + 2;
while (__secondChild < __len) {
if (*(__first + __secondChild) < *(__first + (__secondChild - 1)))
__secondChild--;
*(__first + __holeIndex) = *(__first + __secondChild);
__holeIndex = __secondChild;
__secondChild = 2 * (__secondChild + 1);
}
if (__secondChild == __len) {
*(__first + __holeIndex) = *(__first + (__secondChild - 1));
__holeIndex = __secondChild - 1;
}
__push_heap(__first, __holeIndex, __topIndex, __value);
}
template <class _RandomAccessIterator, class _Tp, class _Distance>
inline void
__pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
_RandomAccessIterator __result, _Tp __value, _Distance*)
{
*__result = *__first;
__adjust_heap(__first, _Distance(0), _Distance(__last - __first), __value);
}
template <class _RandomAccessIterator, class _Tp>
inline void
__pop_heap_aux(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Tp*)
{
__pop_heap(__first, __last - 1, __last - 1,
_Tp(*(__last - 1)), __distance_type( __first ) );
}
template <class _RandomAccessIterator>
inline void pop_heap(_RandomAccessIterator __first,
_RandomAccessIterator __last)
{
__pop_heap_aux(__first, __last, __value_type( __first ) );
}
template <class _RandomAccessIterator, class _Distance,
class _Tp, class _Compare>
void
__adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex,
_Distance __len, _Tp __value, _Compare __comp)
{
_Distance __topIndex = __holeIndex;
_Distance __secondChild = 2 * __holeIndex + 2;
while (__secondChild < __len) {
if (__comp(*(__first + __secondChild), *(__first + (__secondChild - 1))))
__secondChild--;
*(__first + __holeIndex) = *(__first + __secondChild);
__holeIndex = __secondChild;
__secondChild = 2 * (__secondChild + 1);
}
if (__secondChild == __len) {
*(__first + __holeIndex) = *(__first + (__secondChild - 1));
__holeIndex = __secondChild - 1;
}
__push_heap(__first, __holeIndex, __topIndex, __value, __comp);
}
template <class _RandomAccessIterator, class _Tp, class _Compare,
class _Distance>
inline void
__pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
_RandomAccessIterator __result, _Tp __value, _Compare __comp,
_Distance*)
{
*__result = *__first;
__adjust_heap(__first, _Distance(0), _Distance(__last - __first),
__value, __comp);
}
template <class _RandomAccessIterator, class _Tp, class _Compare>
inline void
__pop_heap_aux(_RandomAccessIterator __first,
_RandomAccessIterator __last, _Tp*, _Compare __comp)
{
__pop_heap(__first, __last - 1, __last - 1, _Tp(*(__last - 1)), __comp,
__distance_type( __first ) );
}
template <class _RandomAccessIterator, class _Compare>
inline void
pop_heap(_RandomAccessIterator __first,
_RandomAccessIterator __last, _Compare __comp)
{
__pop_heap_aux(__first, __last, __value_type( __first ) , __comp);
}
template <class _RandomAccessIterator, class _Tp, class _Distance>
void
__make_heap(_RandomAccessIterator __first,
_RandomAccessIterator __last, _Tp*, _Distance*)
{
if (__last - __first < 2) return;
_Distance __len = __last - __first;
_Distance __parent = (__len - 2)/2;
while (true) {
__adjust_heap(__first, __parent, __len, _Tp(*(__first + __parent)));
if (__parent == 0) return;
__parent--;
}
}
template <class _RandomAccessIterator>
inline void
make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
{
__make_heap(__first, __last,
__value_type( __first ) , __distance_type( __first ) );
}
template <class _RandomAccessIterator, class _Compare,
class _Tp, class _Distance>
void
__make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Compare __comp, _Tp*, _Distance*)
{
if (__last - __first < 2) return;
_Distance __len = __last - __first;
_Distance __parent = (__len - 2)/2;
while (true) {
__adjust_heap(__first, __parent, __len, _Tp(*(__first + __parent)),
__comp);
if (__parent == 0) return;
__parent--;
}
}
template <class _RandomAccessIterator, class _Compare>
inline void
make_heap(_RandomAccessIterator __first,
_RandomAccessIterator __last, _Compare __comp)
{
__make_heap(__first, __last, __comp,
__value_type( __first ) , __distance_type( __first ) );
}
template <class _RandomAccessIterator>
void sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
{
while (__last - __first > 1)
pop_heap(__first, __last--);
}
template <class _RandomAccessIterator, class _Compare>
void
sort_heap(_RandomAccessIterator __first,
_RandomAccessIterator __last, _Compare __comp)
{
while (__last - __first > 1)
pop_heap(__first, __last--, __comp);
}
# 36 "/usr/include/g++/queue" 2 3
# 1 "/usr/include/g++/stl_deque.h" 1 3
inline size_t
__deque_buf_size(size_t __n, size_t __size)
{
return __n != 0 ? __n : (__size < 512 ? size_t(512 / __size) : size_t(1));
}
template <class _Tp, class _Ref, class _Ptr, size_t __bufsiz>
struct _Deque_iterator {
typedef _Deque_iterator<_Tp,_Tp&,_Tp*,__bufsiz> iterator;
typedef _Deque_iterator<_Tp,const _Tp&,const _Tp*,__bufsiz> const_iterator;
static size_t
_S_buffer_size() { return __deque_buf_size(__bufsiz, sizeof(_Tp)); }
typedef random_access_iterator_tag iterator_category;
typedef _Tp value_type;
typedef _Ptr pointer;
typedef _Ref reference;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef _Tp** _Map_pointer;
typedef _Deque_iterator _Self;
_Tp* _M_cur;
_Tp* _M_first;
_Tp* _M_last;
_Map_pointer _M_node;
_Deque_iterator(_Tp* __x, _Map_pointer __y)
: _M_cur(__x), _M_first(*__y),
_M_last(*__y + _S_buffer_size()), _M_node(__y) {}
_Deque_iterator() : _M_cur(0), _M_first(0), _M_last(0), _M_node(0) {}
_Deque_iterator(const iterator& __x)
: _M_cur(__x._M_cur), _M_first(__x._M_first),
_M_last(__x._M_last), _M_node(__x._M_node) {}
reference operator*() const { return *_M_cur; }
pointer operator->() const { return _M_cur; }
difference_type operator-(const _Self& __x) const {
return difference_type(_S_buffer_size()) * (_M_node - __x._M_node - 1) +
(_M_cur - _M_first) + (__x._M_last - __x._M_cur);
}
_Self& operator++() {
++_M_cur;
if (_M_cur == _M_last) {
_M_set_node(_M_node + 1);
_M_cur = _M_first;
}
return *this;
}
_Self operator++(int) {
_Self __tmp = *this;
++*this;
return __tmp;
}
_Self& operator--() {
if (_M_cur == _M_first) {
_M_set_node(_M_node - 1);
_M_cur = _M_last;
}
--_M_cur;
return *this;
}
_Self operator--(int) {
_Self __tmp = *this;
--*this;
return __tmp;
}
_Self& operator+=(difference_type __n)
{
difference_type __offset = __n + (_M_cur - _M_first);
if (__offset >= 0 && __offset < difference_type(_S_buffer_size()))
_M_cur += __n;
else {
difference_type __node_offset =
__offset > 0 ? __offset / difference_type(_S_buffer_size())
: -difference_type((-__offset - 1) / _S_buffer_size()) - 1;
_M_set_node(_M_node + __node_offset);
_M_cur = _M_first +
(__offset - __node_offset * difference_type(_S_buffer_size()));
}
return *this;
}
_Self operator+(difference_type __n) const
{
_Self __tmp = *this;
return __tmp += __n;
}
_Self& operator-=(difference_type __n) { return *this += -__n; }
_Self operator-(difference_type __n) const {
_Self __tmp = *this;
return __tmp -= __n;
}
reference operator[](difference_type __n) const { return *(*this + __n); }
bool operator==(const _Self& __x) const { return _M_cur == __x._M_cur; }
bool operator!=(const _Self& __x) const { return !(*this == __x); }
bool operator<(const _Self& __x) const {
return (_M_node == __x._M_node) ?
(_M_cur < __x._M_cur) : (_M_node < __x._M_node);
}
void _M_set_node(_Map_pointer __new_node) {
_M_node = __new_node;
_M_first = *__new_node;
_M_last = _M_first + difference_type(_S_buffer_size());
}
};
# 262 "/usr/include/g++/stl_deque.h" 3
template <class _Tp, class _Alloc, size_t __bufsiz, bool __is_static>
class _Deque_alloc_base {
public:
typedef typename _Alloc_traits<_Tp,_Alloc>::allocator_type allocator_type;
allocator_type get_allocator() const { return node_allocator; }
_Deque_alloc_base(const allocator_type& __a)
: node_allocator(__a), map_allocator(__a), _M_map(0), _M_map_size(0)
{}
protected:
typedef typename _Alloc_traits<_Tp*, _Alloc>::allocator_type
map_allocator_type;
allocator_type node_allocator;
map_allocator_type map_allocator;
_Tp* _M_allocate_node() {
return node_allocator.allocate(__deque_buf_size(__bufsiz,sizeof(_Tp)));
}
void _M_deallocate_node(_Tp* __p) {
node_allocator.deallocate(__p, __deque_buf_size(__bufsiz,sizeof(_Tp)));
}
_Tp** _M_allocate_map(size_t __n)
{ return map_allocator.allocate(__n); }
void _M_deallocate_map(_Tp** __p, size_t __n)
{ map_allocator.deallocate(__p, __n); }
_Tp** _M_map;
size_t _M_map_size;
};
template <class _Tp, class _Alloc, size_t __bufsiz>
class _Deque_alloc_base<_Tp, _Alloc, __bufsiz, true>
{
public:
typedef typename _Alloc_traits<_Tp,_Alloc>::allocator_type allocator_type;
allocator_type get_allocator() const { return allocator_type(); }
_Deque_alloc_base(const allocator_type&) : _M_map(0), _M_map_size(0) {}
protected:
typedef typename _Alloc_traits<_Tp, _Alloc>::_Alloc_type _Node_alloc_type;
typedef typename _Alloc_traits<_Tp*, _Alloc>::_Alloc_type _Map_alloc_type;
_Tp* _M_allocate_node()
{ return _Node_alloc_type::allocate(__deque_buf_size(__bufsiz,
sizeof(_Tp))); }
void _M_deallocate_node(_Tp* __p)
{ _Node_alloc_type::deallocate(__p, __deque_buf_size(__bufsiz,
sizeof(_Tp))); }
_Tp** _M_allocate_map(size_t __n)
{ return _Map_alloc_type::allocate(__n); }
void _M_deallocate_map(_Tp** __p, size_t __n)
{ _Map_alloc_type::deallocate(__p, __n); }
_Tp** _M_map;
size_t _M_map_size;
};
template <class _Tp, class _Alloc, size_t __bufsiz>
class _Deque_base
: public _Deque_alloc_base<_Tp,_Alloc,__bufsiz,
_Alloc_traits<_Tp, _Alloc>::_S_instanceless>
{
public:
typedef _Deque_alloc_base<_Tp,_Alloc,__bufsiz,
_Alloc_traits<_Tp, _Alloc>::_S_instanceless>
_Base;
typedef typename _Base::allocator_type allocator_type;
typedef _Deque_iterator<_Tp,_Tp&,_Tp*,__bufsiz> iterator;
typedef _Deque_iterator<_Tp,const _Tp&,const _Tp&, __bufsiz> const_iterator;
_Deque_base(const allocator_type& __a, size_t __num_elements)
: _Base(__a), _M_start(), _M_finish()
{ _M_initialize_map(__num_elements); }
_Deque_base(const allocator_type& __a)
: _Base(__a), _M_start(), _M_finish() {}
~_Deque_base();
protected:
void _M_initialize_map(size_t);
void _M_create_nodes(_Tp** __nstart, _Tp** __nfinish);
void _M_destroy_nodes(_Tp** __nstart, _Tp** __nfinish);
enum { _S_initial_map_size = 8 };
protected:
iterator _M_start;
iterator _M_finish;
};
# 416 "/usr/include/g++/stl_deque.h" 3
template <class _Tp, class _Alloc, size_t __bufsiz>
_Deque_base<_Tp,_Alloc,__bufsiz>::~_Deque_base() {
if (_M_map) {
_M_destroy_nodes(_M_start._M_node, _M_finish._M_node + 1);
_M_deallocate_map(_M_map, _M_map_size);
}
}
template <class _Tp, class _Alloc, size_t __bufsiz>
void
_Deque_base<_Tp,_Alloc,__bufsiz>::_M_initialize_map(size_t __num_elements)
{
size_t __num_nodes =
__num_elements / __deque_buf_size(__bufsiz, sizeof(_Tp)) + 1;
_M_map_size = max((size_t) _S_initial_map_size, __num_nodes + 2);
_M_map = _M_allocate_map(_M_map_size);
_Tp** __nstart = _M_map + (_M_map_size - __num_nodes) / 2;
_Tp** __nfinish = __nstart + __num_nodes;
try {
_M_create_nodes(__nstart, __nfinish);
}
catch(...) { (_M_deallocate_map(_M_map, _M_map_size),
_M_map = 0, _M_map_size = 0) ; throw; } ;
_M_start._M_set_node(__nstart);
_M_finish._M_set_node(__nfinish - 1);
_M_start._M_cur = _M_start._M_first;
_M_finish._M_cur = _M_finish._M_first +
__num_elements % __deque_buf_size(__bufsiz, sizeof(_Tp));
}
template <class _Tp, class _Alloc, size_t __bufsiz>
void
_Deque_base<_Tp,_Alloc,__bufsiz>::_M_create_nodes(_Tp** __nstart,
_Tp** __nfinish)
{
_Tp** __cur;
try {
for (__cur = __nstart; __cur < __nfinish; ++__cur)
*__cur = _M_allocate_node();
}
catch(...) { _M_destroy_nodes(__nstart, __cur) ; throw; } ;
}
template <class _Tp, class _Alloc, size_t __bufsiz>
void
_Deque_base<_Tp,_Alloc,__bufsiz>::_M_destroy_nodes(_Tp** __nstart,
_Tp** __nfinish)
{
for (_Tp** __n = __nstart; __n < __nfinish; ++__n)
_M_deallocate_node(*__n);
}
template <class _Tp, class _Alloc = allocator< _Tp > ,
size_t __bufsiz = 0>
class deque : protected _Deque_base<_Tp, _Alloc, __bufsiz> {
typedef _Deque_base<_Tp, _Alloc, __bufsiz> _Base;
public:
typedef _Tp value_type;
typedef value_type* pointer;
typedef const value_type* const_pointer;
typedef value_type& reference;
typedef const value_type& const_reference;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef typename _Base::allocator_type allocator_type;
allocator_type get_allocator() const { return _Base::get_allocator(); }
public:
typedef typename _Base::iterator iterator;
typedef typename _Base::const_iterator const_iterator;
typedef reverse_iterator<const_iterator> const_reverse_iterator;
typedef reverse_iterator<iterator> reverse_iterator;
protected:
typedef pointer* _Map_pointer;
static size_t _S_buffer_size()
{ return __deque_buf_size(__bufsiz, sizeof(_Tp)); }
protected:
# 528 "/usr/include/g++/stl_deque.h" 3
public:
iterator begin() { return _M_start; }
iterator end() { return _M_finish; }
const_iterator begin() const { return _M_start; }
const_iterator end() const { return _M_finish; }
reverse_iterator rbegin() { return reverse_iterator(_M_finish); }
reverse_iterator rend() { return reverse_iterator(_M_start); }
const_reverse_iterator rbegin() const
{ return const_reverse_iterator(_M_finish); }
const_reverse_iterator rend() const
{ return const_reverse_iterator(_M_start); }
reference operator[](size_type __n)
{ return _M_start[difference_type(__n)]; }
const_reference operator[](size_type __n) const
{ return _M_start[difference_type(__n)]; }
reference front() { return *_M_start; }
reference back() {
iterator __tmp = _M_finish;
--__tmp;
return *__tmp;
}
const_reference front() const { return *_M_start; }
const_reference back() const {
const_iterator __tmp = _M_finish;
--__tmp;
return *__tmp;
}
size_type size() const { return _M_finish - _M_start;; }
size_type max_size() const { return size_type(-1); }
bool empty() const { return _M_finish == _M_start; }
public:
explicit deque(const allocator_type& __a = allocator_type())
: _Base(__a, 0) {}
deque(const deque& __x) : _Base(__x.get_allocator(), __x.size())
{ uninitialized_copy(__x.begin(), __x.end(), _M_start); }
deque(size_type __n, const value_type& __value,
const allocator_type& __a = allocator_type()) : _Base(__a, __n)
{ _M_fill_initialize(__value); }
explicit deque(size_type __n) : _Base(allocator_type(), __n)
{ _M_fill_initialize(value_type()); }
template <class _InputIterator>
deque(_InputIterator __first, _InputIterator __last,
const allocator_type& __a = allocator_type()) : _Base(__a) {
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
_M_initialize_dispatch(__first, __last, _Integral());
}
template <class _Integer>
void _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type) {
_M_initialize_map(__n);
_M_fill_initialize(__x);
}
template <class _InputIter>
void _M_initialize_dispatch(_InputIter __first, _InputIter __last,
__false_type) {
_M_range_initialize(__first, __last, __iterator_category( __first ) );
}
# 609 "/usr/include/g++/stl_deque.h" 3
~deque() { destroy(_M_start, _M_finish); }
deque& operator= (const deque& __x) {
const size_type __len = size();
if (&__x != this) {
if (__len >= __x.size())
erase(copy(__x.begin(), __x.end(), _M_start), _M_finish);
else {
const_iterator __mid = __x.begin() + difference_type(__len);
copy(__x.begin(), __mid, _M_start);
insert(_M_finish, __mid, __x.end());
}
}
return *this;
}
void swap(deque& __x) {
::swap(_M_start, __x._M_start);
::swap(_M_finish, __x._M_finish);
::swap(_M_map, __x._M_map);
::swap(_M_map_size, __x._M_map_size);
}
public:
void assign(size_type __n, const _Tp& __val) {
if (__n > size()) {
fill(begin(), end(), __val);
insert(end(), __n - size(), __val);
}
else {
erase(begin() + __n, end());
fill(begin(), end(), __val);
}
}
template <class _InputIterator>
void assign(_InputIterator __first, _InputIterator __last) {
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
_M_assign_dispatch(__first, __last, _Integral());
}
private:
template <class _Integer>
void _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
{ assign((size_type) __n, (_Tp) __val); }
template <class _InputIterator>
void _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
__false_type) {
_M_assign_aux(__first, __last, __iterator_category( __first ) );
}
template <class _InputIterator>
void _M_assign_aux(_InputIterator __first, _InputIterator __last,
input_iterator_tag);
template <class _ForwardIterator>
void _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
forward_iterator_tag) {
size_type __len = 0;
distance(__first, __last, __len);
if (__len > size()) {
_ForwardIterator __mid = __first;
advance(__mid, size());
copy(__first, __mid, begin());
insert(end(), __mid, __last);
}
else
erase(copy(__first, __last, begin()), end());
}
public:
void push_back(const value_type& __t) {
if (_M_finish._M_cur != _M_finish._M_last - 1) {
construct(_M_finish._M_cur, __t);
++_M_finish._M_cur;
}
else
_M_push_back_aux(__t);
}
void push_back() {
if (_M_finish._M_cur != _M_finish._M_last - 1) {
construct(_M_finish._M_cur);
++_M_finish._M_cur;
}
else
_M_push_back_aux();
}
void push_front(const value_type& __t) {
if (_M_start._M_cur != _M_start._M_first) {
construct(_M_start._M_cur - 1, __t);
--_M_start._M_cur;
}
else
_M_push_front_aux(__t);
}
void push_front() {
if (_M_start._M_cur != _M_start._M_first) {
construct(_M_start._M_cur - 1);
--_M_start._M_cur;
}
else
_M_push_front_aux();
}
void pop_back() {
if (_M_finish._M_cur != _M_finish._M_first) {
--_M_finish._M_cur;
destroy(_M_finish._M_cur);
}
else
_M_pop_back_aux();
}
void pop_front() {
if (_M_start._M_cur != _M_start._M_last - 1) {
destroy(_M_start._M_cur);
++_M_start._M_cur;
}
else
_M_pop_front_aux();
}
public:
iterator insert(iterator position, const value_type& __x) {
if (position._M_cur == _M_start._M_cur) {
push_front(__x);
return _M_start;
}
else if (position._M_cur == _M_finish._M_cur) {
push_back(__x);
iterator __tmp = _M_finish;
--__tmp;
return __tmp;
}
else {
return _M_insert_aux(position, __x);
}
}
iterator insert(iterator __position)
{ return insert(__position, value_type()); }
void insert(iterator __pos, size_type __n, const value_type& __x);
template <class _InputIterator>
void insert(iterator __pos, _InputIterator __first, _InputIterator __last) {
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
_M_insert_dispatch(__pos, __first, __last, _Integral());
}
template <class _Integer>
void _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x,
__true_type) {
insert(__pos, (size_type) __n, (value_type) __x);
}
template <class _InputIterator>
void _M_insert_dispatch(iterator __pos,
_InputIterator __first, _InputIterator __last,
__false_type) {
insert(__pos, __first, __last, __iterator_category( __first ) );
}
void resize(size_type __new_size, const value_type& __x) {
const size_type __len = size();
if (__new_size < __len)
erase(_M_start + __new_size, _M_finish);
else
insert(_M_finish, __new_size - __len, __x);
}
void resize(size_type new_size) { resize(new_size, value_type()); }
public:
iterator erase(iterator __pos) {
iterator __next = __pos;
++__next;
difference_type __index = __pos - _M_start;
if (__index < (size() >> 1)) {
copy_backward(_M_start, __pos, __next);
pop_front();
}
else {
copy(__next, _M_finish, __pos);
pop_back();
}
return _M_start + __index;
}
iterator erase(iterator __first, iterator __last);
void clear();
protected:
void _M_fill_initialize(const value_type& __value);
template <class _InputIterator>
void _M_range_initialize(_InputIterator __first, _InputIterator __last,
input_iterator_tag);
template <class _ForwardIterator>
void _M_range_initialize(_ForwardIterator __first, _ForwardIterator __last,
forward_iterator_tag);
protected:
void _M_push_back_aux(const value_type&);
void _M_push_back_aux();
void _M_push_front_aux(const value_type&);
void _M_push_front_aux();
void _M_pop_back_aux();
void _M_pop_front_aux();
protected:
template <class _InputIterator>
void insert(iterator __pos, _InputIterator __first, _InputIterator __last,
input_iterator_tag);
template <class _ForwardIterator>
void insert(iterator __pos,
_ForwardIterator __first, _ForwardIterator __last,
forward_iterator_tag);
iterator _M_insert_aux(iterator __pos, const value_type& __x);
iterator _M_insert_aux(iterator __pos);
void _M_insert_aux(iterator __pos, size_type __n, const value_type& __x);
template <class _ForwardIterator>
void _M_insert_aux(iterator __pos,
_ForwardIterator __first, _ForwardIterator __last,
size_type __n);
# 893 "/usr/include/g++/stl_deque.h" 3
iterator _M_reserve_elements_at_front(size_type __n) {
size_type __vacancies = _M_start._M_cur - _M_start._M_first;
if (__n > __vacancies)
_M_new_elements_at_front(__n - __vacancies);
return _M_start - difference_type(__n);
}
iterator _M_reserve_elements_at_back(size_type __n) {
size_type __vacancies = (_M_finish._M_last - _M_finish._M_cur) - 1;
if (__n > __vacancies)
_M_new_elements_at_back(__n - __vacancies);
return _M_finish + difference_type(__n);
}
void _M_new_elements_at_front(size_type __new_elements);
void _M_new_elements_at_back(size_type __new_elements);
protected:
void _M_reserve_map_at_back (size_type __nodes_to_add = 1) {
if (__nodes_to_add + 1 > _M_map_size - (_M_finish._M_node - _M_map))
_M_reallocate_map(__nodes_to_add, false);
}
void _M_reserve_map_at_front (size_type __nodes_to_add = 1) {
if (__nodes_to_add > size_type(_M_start._M_node - _M_map))
_M_reallocate_map(__nodes_to_add, true);
}
void _M_reallocate_map(size_type __nodes_to_add, bool __add_at_front);
# 941 "/usr/include/g++/stl_deque.h" 3
};
template <class _Tp, class _Alloc, size_t __bufsize>
template <class _InputIter>
void deque<_Tp, _Alloc, __bufsize>
::_M_assign_aux(_InputIter __first, _InputIter __last, input_iterator_tag)
{
iterator __cur = begin();
for ( ; __first != __last && __cur != end(); ++__cur, ++__first)
*__cur = *__first;
if (__first == __last)
erase(__cur, end());
else
insert(end(), __first, __last);
}
template <class _Tp, class _Alloc, size_t __bufsize>
void
deque<_Tp, _Alloc, __bufsize>::insert(iterator __pos,
size_type __n, const value_type& __x)
{
if (__pos._M_cur == _M_start._M_cur) {
iterator __new_start = _M_reserve_elements_at_front(__n);
uninitialized_fill(__new_start, _M_start, __x);
_M_start = __new_start;
}
else if (__pos._M_cur == _M_finish._M_cur) {
iterator __new_finish = _M_reserve_elements_at_back(__n);
uninitialized_fill(_M_finish, __new_finish, __x);
_M_finish = __new_finish;
}
else
_M_insert_aux(__pos, __n, __x);
}
# 1038 "/usr/include/g++/stl_deque.h" 3
template <class _Tp, class _Alloc, size_t __bufsize>
deque<_Tp,_Alloc,__bufsize>::iterator
deque<_Tp,_Alloc,__bufsize>::erase(iterator __first, iterator __last)
{
if (__first == _M_start && __last == _M_finish) {
clear();
return _M_finish;
}
else {
difference_type __n = __last - __first;
difference_type __elems_before = __first - _M_start;
if (__elems_before < (size() - __n) / 2) {
copy_backward(_M_start, __first, __last);
iterator __new_start = _M_start + __n;
destroy(_M_start, __new_start);
_M_destroy_nodes(__new_start._M_node, _M_start._M_node);
_M_start = __new_start;
}
else {
copy(__last, _M_finish, __first);
iterator __new_finish = _M_finish - __n;
destroy(__new_finish, _M_finish);
_M_destroy_nodes(__new_finish._M_node + 1, _M_finish._M_node + 1);
_M_finish = __new_finish;
}
return _M_start + __elems_before;
}
}
template <class _Tp, class _Alloc, size_t __bufsize>
void deque<_Tp,_Alloc,__bufsize>::clear()
{
for (_Map_pointer __node = _M_start._M_node + 1;
__node < _M_finish._M_node;
++__node) {
destroy(*__node, *__node + _S_buffer_size());
_M_deallocate_node(*__node);
}
if (_M_start._M_node != _M_finish._M_node) {
destroy(_M_start._M_cur, _M_start._M_last);
destroy(_M_finish._M_first, _M_finish._M_cur);
_M_deallocate_node(_M_finish._M_first);
}
else
destroy(_M_start._M_cur, _M_finish._M_cur);
_M_finish = _M_start;
}
template <class _Tp, class _Alloc, size_t __bufsize>
void
deque<_Tp,_Alloc,__bufsize>::_M_fill_initialize(const value_type& __value) {
_Map_pointer __cur;
try {
for (__cur = _M_start._M_node; __cur < _M_finish._M_node; ++__cur)
uninitialized_fill(*__cur, *__cur + _S_buffer_size(), __value);
uninitialized_fill(_M_finish._M_first, _M_finish._M_cur, __value);
}
catch(...) { destroy(_M_start, iterator(*__cur, __cur)) ; throw; } ;
}
template <class _Tp, class _Alloc, size_t __bufsize>
template <class _InputIterator>
void
deque<_Tp,_Alloc,__bufsize>::_M_range_initialize(_InputIterator __first,
_InputIterator __last,
input_iterator_tag)
{
_M_initialize_map(0);
for ( ; __first != __last; ++__first)
push_back(*__first);
}
template <class _Tp, class _Alloc, size_t __bufsize>
template <class _ForwardIterator>
void
deque<_Tp,_Alloc,__bufsize>::_M_range_initialize(_ForwardIterator __first,
_ForwardIterator __last,
forward_iterator_tag)
{
size_type __n = 0;
distance(__first, __last, __n);
_M_initialize_map(__n);
_Map_pointer __cur_node;
try {
for (__cur_node = _M_start._M_node;
__cur_node < _M_finish._M_node;
++__cur_node) {
_ForwardIterator __mid = __first;
advance(__mid, _S_buffer_size());
uninitialized_copy(__first, __mid, *__cur_node);
__first = __mid;
}
uninitialized_copy(__first, __last, _M_finish._M_first);
}
catch(...) { destroy(_M_start, iterator(*__cur_node, __cur_node)) ; throw; } ;
}
template <class _Tp, class _Alloc, size_t __bufsize>
void
deque<_Tp,_Alloc,__bufsize>::_M_push_back_aux(const value_type& __t)
{
value_type __t_copy = __t;
_M_reserve_map_at_back();
*(_M_finish._M_node + 1) = _M_allocate_node();
try {
construct(_M_finish._M_cur, __t_copy);
_M_finish._M_set_node(_M_finish._M_node + 1);
_M_finish._M_cur = _M_finish._M_first;
}
catch(...) { _M_deallocate_node(*(_M_finish._M_node + 1)) ; throw; } ;
}
template <class _Tp, class _Alloc, size_t __bufsize>
void
deque<_Tp,_Alloc,__bufsize>::_M_push_back_aux()
{
_M_reserve_map_at_back();
*(_M_finish._M_node + 1) = _M_allocate_node();
try {
construct(_M_finish._M_cur);
_M_finish._M_set_node(_M_finish._M_node + 1);
_M_finish._M_cur = _M_finish._M_first;
}
catch(...) { _M_deallocate_node(*(_M_finish._M_node + 1)) ; throw; } ;
}
template <class _Tp, class _Alloc, size_t __bufsize>
void
deque<_Tp,_Alloc,__bufsize>::_M_push_front_aux(const value_type& __t)
{
value_type __t_copy = __t;
_M_reserve_map_at_front();
*(_M_start._M_node - 1) = _M_allocate_node();
try {
_M_start._M_set_node(_M_start._M_node - 1);
_M_start._M_cur = _M_start._M_last - 1;
construct(_M_start._M_cur, __t_copy);
}
catch(...) { (++_M_start, _M_deallocate_node(*(_M_start._M_node - 1))) ; throw; } ;
}
template <class _Tp, class _Alloc, size_t __bufsize>
void
deque<_Tp,_Alloc,__bufsize>::_M_push_front_aux()
{
_M_reserve_map_at_front();
*(_M_start._M_node - 1) = _M_allocate_node();
try {
_M_start._M_set_node(_M_start._M_node - 1);
_M_start._M_cur = _M_start._M_last - 1;
construct(_M_start._M_cur);
}
catch(...) { (++_M_start, _M_deallocate_node(*(_M_start._M_node - 1))) ; throw; } ;
}
template <class _Tp, class _Alloc, size_t __bufsize>
void
deque<_Tp,_Alloc,__bufsize>::_M_pop_back_aux()
{
_M_deallocate_node(_M_finish._M_first);
_M_finish._M_set_node(_M_finish._M_node - 1);
_M_finish._M_cur = _M_finish._M_last - 1;
destroy(_M_finish._M_cur);
}
template <class _Tp, class _Alloc, size_t __bufsize>
void
deque<_Tp,_Alloc,__bufsize>::_M_pop_front_aux()
{
destroy(_M_start._M_cur);
_M_deallocate_node(_M_start._M_first);
_M_start._M_set_node(_M_start._M_node + 1);
_M_start._M_cur = _M_start._M_first;
}
template <class _Tp, class _Alloc, size_t __bufsize>
template <class _InputIterator>
void
deque<_Tp,_Alloc,__bufsize>::insert(iterator __pos,
_InputIterator __first,
_InputIterator __last,
input_iterator_tag)
{
copy(__first, __last, inserter(*this, __pos));
}
template <class _Tp, class _Alloc, size_t __bufsize>
template <class _ForwardIterator>
void
deque<_Tp,_Alloc,__bufsize>::insert(iterator __pos,
_ForwardIterator __first,
_ForwardIterator __last,
forward_iterator_tag) {
size_type __n = 0;
distance(__first, __last, __n);
if (__pos._M_cur == _M_start._M_cur) {
iterator __new_start = _M_reserve_elements_at_front(__n);
try {
uninitialized_copy(__first, __last, __new_start);
_M_start = __new_start;
}
catch(...) { _M_destroy_nodes(__new_start._M_node, _M_start._M_node) ; throw; } ;
}
else if (__pos._M_cur == _M_finish._M_cur) {
iterator __new_finish = _M_reserve_elements_at_back(__n);
try {
uninitialized_copy(__first, __last, _M_finish);
_M_finish = __new_finish;
}
catch(...) { _M_destroy_nodes(_M_finish._M_node + 1,
__new_finish._M_node + 1) ; throw; } ;
}
else
_M_insert_aux(__pos, __first, __last, __n);
}
template <class _Tp, class _Alloc, size_t __bufsize>
typename deque<_Tp, _Alloc, __bufsize>::iterator
deque<_Tp,_Alloc,__bufsize>::_M_insert_aux(iterator __pos,
const value_type& __x)
{
difference_type __index = __pos - _M_start;
value_type __x_copy = __x;
if (__index < size() / 2) {
push_front(front());
iterator __front1 = _M_start;
++__front1;
iterator __front2 = __front1;
++__front2;
__pos = _M_start + __index;
iterator __pos1 = __pos;
++__pos1;
copy(__front2, __pos1, __front1);
}
else {
push_back(back());
iterator __back1 = _M_finish;
--__back1;
iterator __back2 = __back1;
--__back2;
__pos = _M_start + __index;
copy_backward(__pos, __back2, __back1);
}
*__pos = __x_copy;
return __pos;
}
template <class _Tp, class _Alloc, size_t __bufsize>
typename deque<_Tp,_Alloc,__bufsize>::iterator
deque<_Tp,_Alloc,__bufsize>::_M_insert_aux(iterator __pos)
{
difference_type __index = __pos - _M_start;
if (__index < size() / 2) {
push_front(front());
iterator __front1 = _M_start;
++__front1;
iterator __front2 = __front1;
++__front2;
__pos = _M_start + __index;
iterator __pos1 = __pos;
++__pos1;
copy(__front2, __pos1, __front1);
}
else {
push_back(back());
iterator __back1 = _M_finish;
--__back1;
iterator __back2 = __back1;
--__back2;
__pos = _M_start + __index;
copy_backward(__pos, __back2, __back1);
}
*__pos = value_type();
return __pos;
}
template <class _Tp, class _Alloc, size_t __bufsize>
void
deque<_Tp,_Alloc,__bufsize>::_M_insert_aux(iterator __pos,
size_type __n,
const value_type& __x)
{
const difference_type __elems_before = __pos - _M_start;
size_type __length = size();
value_type __x_copy = __x;
if (__elems_before < __length / 2) {
iterator __new_start = _M_reserve_elements_at_front(__n);
iterator __old_start = _M_start;
__pos = _M_start + __elems_before;
try {
if (__elems_before >= difference_type(__n)) {
iterator __start_n = _M_start + difference_type(__n);
uninitialized_copy(_M_start, __start_n, __new_start);
_M_start = __new_start;
copy(__start_n, __pos, __old_start);
fill(__pos - difference_type(__n), __pos, __x_copy);
}
else {
__uninitialized_copy_fill(_M_start, __pos, __new_start,
_M_start, __x_copy);
_M_start = __new_start;
fill(__old_start, __pos, __x_copy);
}
}
catch(...) { _M_destroy_nodes(__new_start._M_node, _M_start._M_node) ; throw; } ;
}
else {
iterator __new_finish = _M_reserve_elements_at_back(__n);
iterator __old_finish = _M_finish;
const difference_type __elems_after =
difference_type(__length) - __elems_before;
__pos = _M_finish - __elems_after;
try {
if (__elems_after > difference_type(__n)) {
iterator __finish_n = _M_finish - difference_type(__n);
uninitialized_copy(__finish_n, _M_finish, _M_finish);
_M_finish = __new_finish;
copy_backward(__pos, __finish_n, __old_finish);
fill(__pos, __pos + difference_type(__n), __x_copy);
}
else {
__uninitialized_fill_copy(_M_finish, __pos + difference_type(__n),
__x_copy, __pos, _M_finish);
_M_finish = __new_finish;
fill(__pos, __old_finish, __x_copy);
}
}
catch(...) { _M_destroy_nodes(_M_finish._M_node + 1,
__new_finish._M_node + 1) ; throw; } ;
}
}
template <class _Tp, class _Alloc, size_t __bufsize>
template <class _ForwardIterator>
void
deque<_Tp,_Alloc,__bufsize>::_M_insert_aux(iterator __pos,
_ForwardIterator __first,
_ForwardIterator __last,
size_type __n)
{
const difference_type __elemsbefore = __pos - _M_start;
size_type __length = size();
if (__elemsbefore < __length / 2) {
iterator __new_start = _M_reserve_elements_at_front(__n);
iterator __old_start = _M_start;
__pos = _M_start + __elemsbefore;
try {
if (__elemsbefore >= difference_type(__n)) {
iterator __start_n = _M_start + difference_type(__n);
uninitialized_copy(_M_start, __start_n, __new_start);
_M_start = __new_start;
copy(__start_n, __pos, __old_start);
copy(__first, __last, __pos - difference_type(__n));
}
else {
_ForwardIterator __mid = __first;
advance(__mid, difference_type(__n) - __elemsbefore);
__uninitialized_copy_copy(_M_start, __pos, __first, __mid,
__new_start);
_M_start = __new_start;
copy(__mid, __last, __old_start);
}
}
catch(...) { _M_destroy_nodes(__new_start._M_node, _M_start._M_node) ; throw; } ;
}
else {
iterator __new_finish = _M_reserve_elements_at_back(__n);
iterator __old_finish = _M_finish;
const difference_type __elemsafter =
difference_type(__length) - __elemsbefore;
__pos = _M_finish - __elemsafter;
try {
if (__elemsafter > difference_type(__n)) {
iterator __finish_n = _M_finish - difference_type(__n);
uninitialized_copy(__finish_n, _M_finish, _M_finish);
_M_finish = __new_finish;
copy_backward(__pos, __finish_n, __old_finish);
copy(__first, __last, __pos);
}
else {
_ForwardIterator __mid = __first;
advance(__mid, __elemsafter);
__uninitialized_copy_copy(__mid, __last, __pos, _M_finish, _M_finish);
_M_finish = __new_finish;
copy(__first, __mid, __pos);
}
}
catch(...) { _M_destroy_nodes(_M_finish._M_node + 1,
__new_finish._M_node + 1) ; throw; } ;
}
}
# 1572 "/usr/include/g++/stl_deque.h" 3
template <class _Tp, class _Alloc, size_t __bufsize>
void
deque<_Tp,_Alloc,__bufsize>::_M_new_elements_at_front(size_type __new_elems)
{
size_type __new_nodes
= (__new_elems + _S_buffer_size() - 1) / _S_buffer_size();
_M_reserve_map_at_front(__new_nodes);
size_type __i;
try {
for (__i = 1; __i <= __new_nodes; ++__i)
*(_M_start._M_node - __i) = _M_allocate_node();
}
catch(...) {
for (size_type __j = 1; __j < __i; ++__j)
_M_deallocate_node(*(_M_start._M_node - __j));
throw;
}
}
template <class _Tp, class _Alloc, size_t __bufsize>
void
deque<_Tp,_Alloc,__bufsize>::_M_new_elements_at_back(size_type __new_elems)
{
size_type __new_nodes
= (__new_elems + _S_buffer_size() - 1) / _S_buffer_size();
_M_reserve_map_at_back(__new_nodes);
size_type __i;
try {
for (__i = 1; __i <= __new_nodes; ++__i)
*(_M_finish._M_node + __i) = _M_allocate_node();
}
catch(...) {
for (size_type __j = 1; __j < __i; ++__j)
_M_deallocate_node(*(_M_finish._M_node + __j));
throw;
}
}
template <class _Tp, class _Alloc, size_t __bufsize>
void
deque<_Tp,_Alloc,__bufsize>::_M_reallocate_map(size_type __nodes_to_add,
bool __add_at_front)
{
size_type __old_num_nodes = _M_finish._M_node - _M_start._M_node + 1;
size_type __new_num_nodes = __old_num_nodes + __nodes_to_add;
_Map_pointer __new_nstart;
if (_M_map_size > 2 * __new_num_nodes) {
__new_nstart = _M_map + (_M_map_size - __new_num_nodes) / 2
+ (__add_at_front ? __nodes_to_add : 0);
if (__new_nstart < _M_start._M_node)
copy(_M_start._M_node, _M_finish._M_node + 1, __new_nstart);
else
copy_backward(_M_start._M_node, _M_finish._M_node + 1,
__new_nstart + __old_num_nodes);
}
else {
size_type __new_map_size =
_M_map_size + max(_M_map_size, __nodes_to_add) + 2;
_Map_pointer __new_map = _M_allocate_map(__new_map_size);
__new_nstart = __new_map + (__new_map_size - __new_num_nodes) / 2
+ (__add_at_front ? __nodes_to_add : 0);
copy(_M_start._M_node, _M_finish._M_node + 1, __new_nstart);
_M_deallocate_map(_M_map, _M_map_size);
_M_map = __new_map;
_M_map_size = __new_map_size;
}
_M_start._M_set_node(__new_nstart);
_M_finish._M_set_node(__new_nstart + __old_num_nodes - 1);
}
template <class _Tp, class _Alloc, size_t __bufsiz>
bool operator==(const deque<_Tp, _Alloc, __bufsiz>& __x,
const deque<_Tp, _Alloc, __bufsiz>& __y)
{
return __x.size() == __y.size() &&
equal(__x.begin(), __x.end(), __y.begin());
}
template <class _Tp, class _Alloc, size_t __bufsiz>
bool operator<(const deque<_Tp, _Alloc, __bufsiz>& __x,
const deque<_Tp, _Alloc, __bufsiz>& __y)
{
return lexicographical_compare(__x.begin(), __x.end(),
__y.begin(), __y.end());
}
template <class _Tp, class _Alloc, size_t __bufsiz>
inline void
swap(deque<_Tp,_Alloc,__bufsiz>& __x, deque<_Tp,_Alloc,__bufsiz>& __y)
{
__x.swap(__y);
}
# 37 "/usr/include/g++/queue" 2 3
# 1 "/usr/include/g++/stl_function.h" 1 3
template <class _Arg, class _Result>
struct unary_function {
typedef _Arg argument_type;
typedef _Result result_type;
};
template <class _Arg1, class _Arg2, class _Result>
struct binary_function {
typedef _Arg1 first_argument_type;
typedef _Arg2 second_argument_type;
typedef _Result result_type;
};
template <class _Tp>
struct plus : public binary_function<_Tp,_Tp,_Tp> {
_Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x + __y; }
};
template <class _Tp>
struct minus : public binary_function<_Tp,_Tp,_Tp> {
_Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x - __y; }
};
template <class _Tp>
struct multiplies : public binary_function<_Tp,_Tp,_Tp> {
_Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x * __y; }
};
template <class _Tp>
struct divides : public binary_function<_Tp,_Tp,_Tp> {
_Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x / __y; }
};
template <class _Tp> inline _Tp identity_element(plus<_Tp>) {
return _Tp(0);
}
template <class _Tp> inline _Tp identity_element(multiplies<_Tp>) {
return _Tp(1);
}
template <class _Tp>
struct modulus : public binary_function<_Tp,_Tp,_Tp>
{
_Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x % __y; }
};
template <class _Tp>
struct negate : public unary_function<_Tp,_Tp>
{
_Tp operator()(const _Tp& __x) const { return -__x; }
};
template <class _Tp>
struct equal_to : public binary_function<_Tp,_Tp,bool>
{
bool operator()(const _Tp& __x, const _Tp& __y) const { return __x == __y; }
};
template <class _Tp>
struct not_equal_to : public binary_function<_Tp,_Tp,bool>
{
bool operator()(const _Tp& __x, const _Tp& __y) const { return __x != __y; }
};
template <class _Tp>
struct greater : public binary_function<_Tp,_Tp,bool>
{
bool operator()(const _Tp& __x, const _Tp& __y) const { return __x > __y; }
};
template <class _Tp>
struct less : public binary_function<_Tp,_Tp,bool>
{
bool operator()(const _Tp& __x, const _Tp& __y) const { return __x < __y; }
};
template <class _Tp>
struct greater_equal : public binary_function<_Tp,_Tp,bool>
{
bool operator()(const _Tp& __x, const _Tp& __y) const { return __x >= __y; }
};
template <class _Tp>
struct less_equal : public binary_function<_Tp,_Tp,bool>
{
bool operator()(const _Tp& __x, const _Tp& __y) const { return __x <= __y; }
};
template <class _Tp>
struct logical_and : public binary_function<_Tp,_Tp,bool>
{
bool operator()(const _Tp& __x, const _Tp& __y) const { return __x && __y; }
};
template <class _Tp>
struct logical_or : public binary_function<_Tp,_Tp,bool>
{
bool operator()(const _Tp& __x, const _Tp& __y) const { return __x || __y; }
};
template <class _Tp>
struct logical_not : public unary_function<_Tp,bool>
{
bool operator()(const _Tp& __x) const { return !__x; }
};
template <class _Predicate>
class unary_negate
: public unary_function<typename _Predicate::argument_type, bool> {
protected:
_Predicate _M_pred;
public:
explicit unary_negate(const _Predicate& __x) : _M_pred(__x) {}
bool operator()(const typename _Predicate::argument_type& __x) const {
return !_M_pred(__x);
}
};
template <class _Predicate>
inline unary_negate<_Predicate>
not1(const _Predicate& __pred)
{
return unary_negate<_Predicate>(__pred);
}
template <class _Predicate>
class binary_negate
: public binary_function<typename _Predicate::first_argument_type,
typename _Predicate::second_argument_type,
bool> {
protected:
_Predicate _M_pred;
public:
explicit binary_negate(const _Predicate& __x) : _M_pred(__x) {}
bool operator()(const typename _Predicate::first_argument_type& __x,
const typename _Predicate::second_argument_type& __y) const
{
return !_M_pred(__x, __y);
}
};
template <class _Predicate>
inline binary_negate<_Predicate>
not2(const _Predicate& __pred)
{
return binary_negate<_Predicate>(__pred);
}
template <class _Operation>
class binder1st
: public unary_function<typename _Operation::second_argument_type,
typename _Operation::result_type> {
protected:
_Operation op;
typename _Operation::first_argument_type value;
public:
binder1st(const _Operation& __x,
const typename _Operation::first_argument_type& __y)
: op(__x), value(__y) {}
typename _Operation::result_type
operator()(const typename _Operation::second_argument_type& __x) const {
return op(value, __x);
}
};
template <class _Operation, class _Tp>
inline binder1st<_Operation>
bind1st(const _Operation& __oper, const _Tp& __x)
{
typedef typename _Operation::first_argument_type _Arg1_type;
return binder1st<_Operation>(__oper, _Arg1_type(__x));
}
template <class _Operation>
class binder2nd
: public unary_function<typename _Operation::first_argument_type,
typename _Operation::result_type> {
protected:
_Operation op;
typename _Operation::second_argument_type value;
public:
binder2nd(const _Operation& __x,
const typename _Operation::second_argument_type& __y)
: op(__x), value(__y) {}
typename _Operation::result_type
operator()(const typename _Operation::first_argument_type& __x) const {
return op(__x, value);
}
};
template <class _Operation, class _Tp>
inline binder2nd<_Operation>
bind2nd(const _Operation& __oper, const _Tp& __x)
{
typedef typename _Operation::second_argument_type _Arg2_type;
return binder2nd<_Operation>(__oper, _Arg2_type(__x));
}
template <class _Operation1, class _Operation2>
class unary_compose
: public unary_function<typename _Operation2::argument_type,
typename _Operation1::result_type>
{
protected:
_Operation1 __op1;
_Operation2 __op2;
public:
unary_compose(const _Operation1& __x, const _Operation2& __y)
: __op1(__x), __op2(__y) {}
typename _Operation1::result_type
operator()(const typename _Operation2::argument_type& __x) const {
return __op1(__op2(__x));
}
};
template <class _Operation1, class _Operation2>
inline unary_compose<_Operation1,_Operation2>
compose1(const _Operation1& __op1, const _Operation2& __op2)
{
return unary_compose<_Operation1,_Operation2>(__op1, __op2);
}
template <class _Operation1, class _Operation2, class _Operation3>
class binary_compose
: public unary_function<typename _Operation2::argument_type,
typename _Operation1::result_type> {
protected:
_Operation1 _M_op1;
_Operation2 _M_op2;
_Operation3 _M_op3;
public:
binary_compose(const _Operation1& __x, const _Operation2& __y,
const _Operation3& __z)
: _M_op1(__x), _M_op2(__y), _M_op3(__z) { }
typename _Operation1::result_type
operator()(const typename _Operation2::argument_type& __x) const {
return _M_op1(_M_op2(__x), _M_op3(__x));
}
};
template <class _Operation1, class _Operation2, class _Operation3>
inline binary_compose<_Operation1, _Operation2, _Operation3>
compose2(const _Operation1& __op1, const _Operation2& __op2,
const _Operation3& __op3)
{
return binary_compose<_Operation1,_Operation2,_Operation3>
(__op1, __op2, __op3);
}
template <class _Arg, class _Result>
class pointer_to_unary_function : public unary_function<_Arg, _Result> {
protected:
_Result (*_M_ptr)(_Arg);
public:
pointer_to_unary_function() {}
explicit pointer_to_unary_function(_Result (*__x)(_Arg)) : _M_ptr(__x) {}
_Result operator()(_Arg __x) const { return _M_ptr(__x); }
};
template <class _Arg, class _Result>
inline pointer_to_unary_function<_Arg, _Result> ptr_fun(_Result (*__x)(_Arg))
{
return pointer_to_unary_function<_Arg, _Result>(__x);
}
template <class _Arg1, class _Arg2, class _Result>
class pointer_to_binary_function :
public binary_function<_Arg1,_Arg2,_Result> {
protected:
_Result (*_M_ptr)(_Arg1, _Arg2);
public:
pointer_to_binary_function() {}
explicit pointer_to_binary_function(_Result (*__x)(_Arg1, _Arg2))
: _M_ptr(__x) {}
_Result operator()(_Arg1 __x, _Arg2 __y) const {
return _M_ptr(__x, __y);
}
};
template <class _Arg1, class _Arg2, class _Result>
inline pointer_to_binary_function<_Arg1,_Arg2,_Result>
ptr_fun(_Result (*__x)(_Arg1, _Arg2)) {
return pointer_to_binary_function<_Arg1,_Arg2,_Result>(__x);
}
template <class _Tp>
struct _Identity : public unary_function<_Tp,_Tp> {
const _Tp& operator()(const _Tp& __x) const { return __x; }
};
template <class _Tp> struct identity : public _Identity<_Tp> {};
template <class _Pair>
struct _Select1st : public unary_function<_Pair, typename _Pair::first_type> {
const typename _Pair::first_type& operator()(const _Pair& __x) const {
return __x.first;
}
};
template <class _Pair>
struct _Select2nd : public unary_function<_Pair, typename _Pair::second_type>
{
const typename _Pair::second_type& operator()(const _Pair& __x) const {
return __x.second;
}
};
template <class _Pair> struct select1st : public _Select1st<_Pair> {};
template <class _Pair> struct select2nd : public _Select2nd<_Pair> {};
template <class _Arg1, class _Arg2>
struct _Project1st : public binary_function<_Arg1, _Arg2, _Arg1> {
_Arg1 operator()(const _Arg1& __x, const _Arg2&) const { return __x; }
};
template <class _Arg1, class _Arg2>
struct _Project2nd : public binary_function<_Arg1, _Arg2, _Arg2> {
_Arg2 operator()(const _Arg1&, const _Arg2& __y) const { return __y; }
};
template <class _Arg1, class _Arg2>
struct project1st : public _Project1st<_Arg1, _Arg2> {};
template <class _Arg1, class _Arg2>
struct project2nd : public _Project2nd<_Arg1, _Arg2> {};
template <class _Result>
struct constant_void_fun
{
typedef _Result result_type;
result_type __val;
constant_void_fun(const result_type& __v) : __val(__v) {}
const result_type& operator()() const { return __val; }
};
template <class _Result, class _Argument = _Result>
struct constant_unary_fun : public unary_function<_Argument, _Result> {
_Result _M_val;
constant_unary_fun(const _Result& __v) : _M_val(__v) {}
const _Result& operator()(const _Argument&) const { return _M_val; }
};
template <class _Result, class _Arg1 = _Result, class _Arg2 = _Arg1>
struct constant_binary_fun : public binary_function<_Arg1, _Arg2, _Result> {
_Result _M_val;
constant_binary_fun(const _Result& __v) : _M_val(__v) {}
const _Result& operator()(const _Arg1&, const _Arg2&) const {
return _M_val;
}
};
template <class _Result>
inline constant_void_fun<_Result> constant0(const _Result& __val)
{
return constant_void_fun<_Result>(__val);
}
template <class _Result>
inline constant_unary_fun<_Result,_Result> constant1(const _Result& __val)
{
return constant_unary_fun<_Result,_Result>(__val);
}
template <class _Result>
inline constant_binary_fun<_Result,_Result,_Result>
constant2(const _Result& __val)
{
return constant_binary_fun<_Result,_Result,_Result>(__val);
}
class subtractive_rng : public unary_function<unsigned int, unsigned int> {
private:
unsigned int _M_table[55];
size_t _M_index1;
size_t _M_index2;
public:
unsigned int operator()(unsigned int __limit) {
_M_index1 = (_M_index1 + 1) % 55;
_M_index2 = (_M_index2 + 1) % 55;
_M_table[_M_index1] = _M_table[_M_index1] - _M_table[_M_index2];
return _M_table[_M_index1] % __limit;
}
void _M_initialize(unsigned int __seed)
{
unsigned int __k = 1;
_M_table[54] = __seed;
size_t __i;
for (__i = 0; __i < 54; __i++) {
size_t __ii = (21 * (__i + 1) % 55) - 1;
_M_table[__ii] = __k;
__k = __seed - __k;
__seed = _M_table[__ii];
}
for (int __loop = 0; __loop < 4; __loop++) {
for (__i = 0; __i < 55; __i++)
_M_table[__i] = _M_table[__i] - _M_table[(1 + __i + 30) % 55];
}
_M_index1 = 0;
_M_index2 = 31;
}
subtractive_rng(unsigned int __seed) { _M_initialize(__seed); }
subtractive_rng() { _M_initialize(161803398u); }
};
template <class _Ret, class _Tp>
class mem_fun_t : public unary_function<_Tp*,_Ret> {
public:
explicit mem_fun_t(_Ret (_Tp::*__pf)()) : _M_f(__pf) {}
_Ret operator()(_Tp* __p) const { return (__p->*_M_f)(); }
private:
_Ret (_Tp::*_M_f)();
};
template <class _Ret, class _Tp>
class const_mem_fun_t : public unary_function<const _Tp*,_Ret> {
public:
explicit const_mem_fun_t(_Ret (_Tp::*__pf)() const) : _M_f(__pf) {}
_Ret operator()(const _Tp* __p) const { return (__p->*_M_f)(); }
private:
_Ret (_Tp::*_M_f)() const;
};
template <class _Ret, class _Tp>
class mem_fun_ref_t : public unary_function<_Tp,_Ret> {
public:
explicit mem_fun_ref_t(_Ret (_Tp::*__pf)()) : _M_f(__pf) {}
_Ret operator()(_Tp& __r) const { return (__r.*_M_f)(); }
private:
_Ret (_Tp::*_M_f)();
};
template <class _Ret, class _Tp>
class const_mem_fun_ref_t : public unary_function<_Tp,_Ret> {
public:
explicit const_mem_fun_ref_t(_Ret (_Tp::*__pf)() const) : _M_f(__pf) {}
_Ret operator()(const _Tp& __r) const { return (__r.*_M_f)(); }
private:
_Ret (_Tp::*_M_f)() const;
};
template <class _Ret, class _Tp, class _Arg>
class mem_fun1_t : public binary_function<_Tp*,_Arg,_Ret> {
public:
explicit mem_fun1_t(_Ret (_Tp::*__pf)(_Arg)) : _M_f(__pf) {}
_Ret operator()(_Tp* __p, _Arg __x) const { return (__p->*_M_f)(__x); }
private:
_Ret (_Tp::*_M_f)(_Arg);
};
template <class _Ret, class _Tp, class _Arg>
class const_mem_fun1_t : public binary_function<const _Tp*,_Arg,_Ret> {
public:
explicit const_mem_fun1_t(_Ret (_Tp::*__pf)(_Arg) const) : _M_f(__pf) {}
_Ret operator()(const _Tp* __p, _Arg __x) const
{ return (__p->*_M_f)(__x); }
private:
_Ret (_Tp::*_M_f)(_Arg) const;
};
template <class _Ret, class _Tp, class _Arg>
class mem_fun1_ref_t : public binary_function<_Tp,_Arg,_Ret> {
public:
explicit mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg)) : _M_f(__pf) {}
_Ret operator()(_Tp& __r, _Arg __x) const { return (__r.*_M_f)(__x); }
private:
_Ret (_Tp::*_M_f)(_Arg);
};
template <class _Ret, class _Tp, class _Arg>
class const_mem_fun1_ref_t : public binary_function<_Tp,_Arg,_Ret> {
public:
explicit const_mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg) const) : _M_f(__pf) {}
_Ret operator()(const _Tp& __r, _Arg __x) const { return (__r.*_M_f)(__x); }
private:
_Ret (_Tp::*_M_f)(_Arg) const;
};
template <class _Tp>
class mem_fun_t<void, _Tp> : public unary_function<_Tp*,void> {
public:
explicit mem_fun_t(void (_Tp::*__pf)()) : _M_f(__pf) {}
void operator()(_Tp* __p) const { (__p->*_M_f)(); }
private:
void (_Tp::*_M_f)();
};
template <class _Tp>
class const_mem_fun_t<void, _Tp> : public unary_function<const _Tp*,void> {
public:
explicit const_mem_fun_t(void (_Tp::*__pf)() const) : _M_f(__pf) {}
void operator()(const _Tp* __p) const { (__p->*_M_f)(); }
private:
void (_Tp::*_M_f)() const;
};
template <class _Tp>
class mem_fun_ref_t<void, _Tp> : public unary_function<_Tp,void> {
public:
explicit mem_fun_ref_t(void (_Tp::*__pf)()) : _M_f(__pf) {}
void operator()(_Tp& __r) const { (__r.*_M_f)(); }
private:
void (_Tp::*_M_f)();
};
template <class _Tp>
class const_mem_fun_ref_t<void, _Tp> : public unary_function<_Tp,void> {
public:
explicit const_mem_fun_ref_t(void (_Tp::*__pf)() const) : _M_f(__pf) {}
void operator()(const _Tp& __r) const { (__r.*_M_f)(); }
private:
void (_Tp::*_M_f)() const;
};
template <class _Tp, class _Arg>
class mem_fun1_t<void, _Tp, _Arg> : public binary_function<_Tp*,_Arg,void> {
public:
explicit mem_fun1_t(void (_Tp::*__pf)(_Arg)) : _M_f(__pf) {}
void operator()(_Tp* __p, _Arg __x) const { (__p->*_M_f)(__x); }
private:
void (_Tp::*_M_f)(_Arg);
};
template <class _Tp, class _Arg>
class const_mem_fun1_t<void, _Tp, _Arg>
: public binary_function<const _Tp*,_Arg,void> {
public:
explicit const_mem_fun1_t(void (_Tp::*__pf)(_Arg) const) : _M_f(__pf) {}
void operator()(const _Tp* __p, _Arg __x) const { (__p->*_M_f)(__x); }
private:
void (_Tp::*_M_f)(_Arg) const;
};
template <class _Tp, class _Arg>
class mem_fun1_ref_t<void, _Tp, _Arg>
: public binary_function<_Tp,_Arg,void> {
public:
explicit mem_fun1_ref_t(void (_Tp::*__pf)(_Arg)) : _M_f(__pf) {}
void operator()(_Tp& __r, _Arg __x) const { (__r.*_M_f)(__x); }
private:
void (_Tp::*_M_f)(_Arg);
};
template <class _Tp, class _Arg>
class const_mem_fun1_ref_t<void, _Tp, _Arg>
: public binary_function<_Tp,_Arg,void> {
public:
explicit const_mem_fun1_ref_t(void (_Tp::*__pf)(_Arg) const) : _M_f(__pf) {}
void operator()(const _Tp& __r, _Arg __x) const { (__r.*_M_f)(__x); }
private:
void (_Tp::*_M_f)(_Arg) const;
};
template <class _Ret, class _Tp>
inline mem_fun_t<_Ret,_Tp> mem_fun(_Ret (_Tp::*__f)())
{ return mem_fun_t<_Ret,_Tp>(__f); }
template <class _Ret, class _Tp>
inline const_mem_fun_t<_Ret,_Tp> mem_fun(_Ret (_Tp::*__f)() const)
{ return const_mem_fun_t<_Ret,_Tp>(__f); }
template <class _Ret, class _Tp>
inline mem_fun_ref_t<_Ret,_Tp> mem_fun_ref(_Ret (_Tp::*__f)())
{ return mem_fun_ref_t<_Ret,_Tp>(__f); }
template <class _Ret, class _Tp>
inline const_mem_fun_ref_t<_Ret,_Tp> mem_fun_ref(_Ret (_Tp::*__f)() const)
{ return const_mem_fun_ref_t<_Ret,_Tp>(__f); }
template <class _Ret, class _Tp, class _Arg>
inline mem_fun1_t<_Ret,_Tp,_Arg> mem_fun(_Ret (_Tp::*__f)(_Arg))
{ return mem_fun1_t<_Ret,_Tp,_Arg>(__f); }
template <class _Ret, class _Tp, class _Arg>
inline const_mem_fun1_t<_Ret,_Tp,_Arg> mem_fun(_Ret (_Tp::*__f)(_Arg) const)
{ return const_mem_fun1_t<_Ret,_Tp,_Arg>(__f); }
template <class _Ret, class _Tp, class _Arg>
inline mem_fun1_ref_t<_Ret,_Tp,_Arg> mem_fun_ref(_Ret (_Tp::*__f)(_Arg))
{ return mem_fun1_ref_t<_Ret,_Tp,_Arg>(__f); }
template <class _Ret, class _Tp, class _Arg>
inline const_mem_fun1_ref_t<_Ret,_Tp,_Arg>
mem_fun_ref(_Ret (_Tp::*__f)(_Arg) const)
{ return const_mem_fun1_ref_t<_Ret,_Tp,_Arg>(__f); }
template <class _Ret, class _Tp, class _Arg>
inline mem_fun1_t<_Ret,_Tp,_Arg> mem_fun1(_Ret (_Tp::*__f)(_Arg))
{ return mem_fun1_t<_Ret,_Tp,_Arg>(__f); }
template <class _Ret, class _Tp, class _Arg>
inline const_mem_fun1_t<_Ret,_Tp,_Arg> mem_fun1(_Ret (_Tp::*__f)(_Arg) const)
{ return const_mem_fun1_t<_Ret,_Tp,_Arg>(__f); }
template <class _Ret, class _Tp, class _Arg>
inline mem_fun1_ref_t<_Ret,_Tp,_Arg> mem_fun1_ref(_Ret (_Tp::*__f)(_Arg))
{ return mem_fun1_ref_t<_Ret,_Tp,_Arg>(__f); }
template <class _Ret, class _Tp, class _Arg>
inline const_mem_fun1_ref_t<_Ret,_Tp,_Arg>
mem_fun1_ref(_Ret (_Tp::*__f)(_Arg) const)
{ return const_mem_fun1_ref_t<_Ret,_Tp,_Arg>(__f); }
# 38 "/usr/include/g++/queue" 2 3
# 1 "/usr/include/g++/stl_queue.h" 1 3
template <class _Tp, class _Sequence = deque<_Tp> >
class queue {
friend bool operator== <> (const queue&, const queue&);
friend bool operator< <> (const queue&, const queue&);
public:
typedef typename _Sequence::value_type value_type;
typedef typename _Sequence::size_type size_type;
typedef _Sequence container_type;
typedef typename _Sequence::reference reference;
typedef typename _Sequence::const_reference const_reference;
protected:
_Sequence c;
public:
queue() : c() {}
explicit queue(const _Sequence& __c) : c(__c) {}
bool empty() const { return c.empty(); }
size_type size() const { return c.size(); }
reference front() { return c.front(); }
const_reference front() const { return c.front(); }
reference back() { return c.back(); }
const_reference back() const { return c.back(); }
void push(const value_type& __x) { c.push_back(__x); }
void pop() { c.pop_front(); }
};
template <class _Tp, class _Sequence>
bool
operator==(const queue<_Tp, _Sequence>& __x, const queue<_Tp, _Sequence>& __y)
{
return __x.c == __y.c;
}
template <class _Tp, class _Sequence>
bool
operator<(const queue<_Tp, _Sequence>& __x, const queue<_Tp, _Sequence>& __y)
{
return __x.c < __y.c;
}
template <class _Tp, class _Sequence>
bool
operator!=(const queue<_Tp, _Sequence>& __x, const queue<_Tp, _Sequence>& __y)
{
return !(__x == __y);
}
template <class _Tp, class _Sequence>
bool
operator>(const queue<_Tp, _Sequence>& __x, const queue<_Tp, _Sequence>& __y)
{
return __y < __x;
}
template <class _Tp, class _Sequence>
bool
operator<=(const queue<_Tp, _Sequence>& __x, const queue<_Tp, _Sequence>& __y)
{
return !(__y < __x);
}
template <class _Tp, class _Sequence>
bool
operator>=(const queue<_Tp, _Sequence>& __x, const queue<_Tp, _Sequence>& __y)
{
return !(__x < __y);
}
template <class _Tp, class _Sequence = vector<_Tp>,
class _Compare = less<typename _Sequence::value_type> >
class priority_queue {
public:
typedef typename _Sequence::value_type value_type;
typedef typename _Sequence::size_type size_type;
typedef _Sequence container_type;
typedef typename _Sequence::reference reference;
typedef typename _Sequence::const_reference const_reference;
protected:
_Sequence c;
_Compare comp;
public:
priority_queue() : c() {}
explicit priority_queue(const _Compare& __x) : c(), comp(__x) {}
priority_queue(const _Compare& __x, const _Sequence& __s)
: c(__s), comp(__x)
{ make_heap(c.begin(), c.end(), comp); }
template <class _InputIterator>
priority_queue(_InputIterator __first, _InputIterator __last)
: c(__first, __last) { make_heap(c.begin(), c.end(), comp); }
template <class _InputIterator>
priority_queue(_InputIterator __first,
_InputIterator __last, const _Compare& __x)
: c(__first, __last), comp(__x)
{ make_heap(c.begin(), c.end(), comp); }
template <class _InputIterator>
priority_queue(_InputIterator __first, _InputIterator __last,
const _Compare& __x, const _Sequence& __s)
: c(__s), comp(__x)
{
c.insert(c.end(), __first, __last);
make_heap(c.begin(), c.end(), comp);
}
# 173 "/usr/include/g++/stl_queue.h" 3
bool empty() const { return c.empty(); }
size_type size() const { return c.size(); }
const_reference top() const { return c.front(); }
void push(const value_type& __x) {
try {
c.push_back(__x);
push_heap(c.begin(), c.end(), comp);
}
catch(...) { c.clear() ; throw; } ;
}
void pop() {
try {
pop_heap(c.begin(), c.end(), comp);
c.pop_back();
}
catch(...) { c.clear() ; throw; } ;
}
};
# 39 "/usr/include/g++/queue" 2 3
# 1 "GnutellaService.cc" 2
# 1 "GnutellaStream.h" 1
# 1 "/usr/local/include/cc++/config.h" 1 3
# 1 "/usr/include/fcntl.h" 1 3
extern "C" {
# 1 "/usr/include/bits/fcntl.h" 1 3
struct flock
{
short int l_type;
short int l_whence;
__off_t l_start;
__off_t l_len;
__pid_t l_pid;
};
struct flock64
{
short int l_type;
short int l_whence;
__off64_t l_start;
__off64_t l_len;
__pid_t l_pid;
};
# 33 "/usr/include/fcntl.h" 2 3
# 1 "/usr/include/sys/stat.h" 1 3
extern "C" {
# 1 "/usr/include/bits/stat.h" 1 3
struct stat
{
__dev_t st_dev;
unsigned short int __pad1;
__ino_t st_ino;
__mode_t st_mode;
__nlink_t st_nlink;
__uid_t st_uid;
__gid_t st_gid;
__dev_t st_rdev;
unsigned short int __pad2;
__off_t st_size;
__blksize_t st_blksize;
__blkcnt_t st_blocks;
__time_t st_atime;
unsigned long int __unused1;
__time_t st_mtime;
unsigned long int __unused2;
__time_t st_ctime;
unsigned long int __unused3;
unsigned long int __unused4;
unsigned long int __unused5;
};
struct stat64
{
__dev_t st_dev;
unsigned int __pad1;
__ino_t __st_ino;
__mode_t st_mode;
__nlink_t st_nlink;
__uid_t st_uid;
__gid_t st_gid;
__dev_t st_rdev;
unsigned int __pad2;
__off64_t st_size;
__blksize_t st_blksize;
__blkcnt64_t st_blocks;
__time_t st_atime;
unsigned long int __unused1;
__time_t st_mtime;
unsigned long int __unused2;
__time_t st_ctime;
unsigned long int __unused3;
__ino64_t st_ino;
};
# 98 "/usr/include/sys/stat.h" 2 3
extern int stat (__const char *__restrict __file,
struct stat *__restrict __buf) throw () ;
extern int fstat (int __fd, struct stat *__buf) throw () ;
# 216 "/usr/include/sys/stat.h" 3
extern int stat64 (__const char *__restrict __file,
struct stat64 *__restrict __buf) throw () ;
extern int fstat64 (int __fd, struct stat64 *__buf) throw () ;
extern int lstat (__const char *__restrict __file,
struct stat *__restrict __buf) throw () ;
# 238 "/usr/include/sys/stat.h" 3
extern int lstat64 (__const char *__restrict __file,
struct stat64 *__restrict __buf) throw () ;
extern int chmod (__const char *__file, __mode_t __mode) throw () ;
extern int fchmod (int __fd, __mode_t __mode) throw () ;
extern __mode_t umask (__mode_t __mask) throw () ;
extern __mode_t getumask (void) throw () ;
extern int mkdir (__const char *__path, __mode_t __mode) throw () ;
extern int mknod (__const char *__path, __mode_t __mode, __dev_t __dev)
throw () ;
extern int mkfifo (__const char *__path, __mode_t __mode) throw () ;
\f
extern int __fxstat (int __ver, int __fildes, struct stat *__stat_buf) throw () ;
extern int __xstat (int __ver, __const char *__filename,
struct stat *__stat_buf) throw () ;
extern int __lxstat (int __ver, __const char *__filename,
struct stat *__stat_buf) throw () ;
# 326 "/usr/include/sys/stat.h" 3
extern int __fxstat64 (int __ver, int __fildes, struct stat64 *__stat_buf)
throw () ;
extern int __xstat64 (int __ver, __const char *__filename,
struct stat64 *__stat_buf) throw () ;
extern int __lxstat64 (int __ver, __const char *__filename,
struct stat64 *__stat_buf) throw () ;
extern int __xmknod (int __ver, __const char *__path, __mode_t __mode,
__dev_t *__dev) throw () ;
extern __inline__ int stat (__const char *__path,
struct stat *__statbuf) throw ()
{
return __xstat (3 , __path, __statbuf);
}
extern __inline__ int lstat (__const char *__path,
struct stat *__statbuf) throw ()
{
return __lxstat (3 , __path, __statbuf);
}
extern __inline__ int fstat (int __fd, struct stat *__statbuf) throw ()
{
return __fxstat (3 , __fd, __statbuf);
}
extern __inline__ int mknod (__const char *__path, __mode_t __mode,
__dev_t __dev) throw ()
{
return __xmknod (1 , __path, __mode, &__dev);
}
extern __inline__ int stat64 (__const char *__path,
struct stat64 *__statbuf) throw ()
{
return __xstat64 (3 , __path, __statbuf);
}
extern __inline__ int lstat64 (__const char *__path,
struct stat64 *__statbuf) throw ()
{
return __lxstat64 (3 , __path, __statbuf);
}
extern __inline__ int fstat64 (int __fd, struct stat64 *__statbuf) throw ()
{
return __fxstat64 (3 , __fd, __statbuf);
}
}
# 37 "/usr/include/fcntl.h" 2 3
extern int __fcntl (int __fd, int __cmd, ...) throw () ;
extern int fcntl (int __fd, int __cmd, ...) throw () ;
extern int __open (__const char *__file, int __oflag, ...) throw () ;
extern int open (__const char *__file, int __oflag, ...) throw () ;
extern int open64 (__const char *__file, int __oflag, ...) throw () ;
extern int creat (__const char *__file, __mode_t __mode) throw () ;
extern int creat64 (__const char *__file, __mode_t __mode) throw () ;
extern int lockf (int __fd, int __cmd, __off_t __len) throw () ;
extern int lockf64 (int __fd, int __cmd, __off64_t __len) throw () ;
extern int posix_fadvise (int __fd, __off_t __offset, size_t __len,
int __advise) throw () ;
# 142 "/usr/include/fcntl.h" 3
extern int posix_fadvise64 (int __fd, __off64_t __offset, size_t __len,
int __advise) throw () ;
extern int posix_fallocate (int __fd, __off_t __offset, size_t __len) throw () ;
# 160 "/usr/include/fcntl.h" 3
extern int posix_fallocate64 (int __fd, __off64_t __offset, size_t __len)
throw () ;
}
# 286 "/usr/local/include/cc++/config.h" 2 3
# 1 "/usr/include/unistd.h" 1 3
extern "C" {
# 1 "/usr/include/bits/posix_opt.h" 1 3
# 175 "/usr/include/unistd.h" 2 3
# 1 "/usr/include/bits/environments.h" 1 3
# 1 "/usr/include/bits/wordsize.h" 1 3
# 23 "/usr/include/bits/environments.h" 2 3
# 47 "/usr/include/bits/environments.h" 3
# 179 "/usr/include/unistd.h" 2 3
# 1 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 1 3
# 19 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 61 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 126 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 188 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 269 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 317 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 199 "/usr/include/unistd.h" 2 3
typedef __intptr_t intptr_t;
typedef __socklen_t socklen_t;
extern int access (__const char *__name, int __type) throw () ;
extern int euidaccess (__const char *__name, int __type) throw () ;
extern __off_t lseek (int __fd, __off_t __offset, int __whence) throw () ;
# 300 "/usr/include/unistd.h" 3
extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence) throw () ;
extern int close (int __fd) throw () ;
extern ssize_t read (int __fd, void *__buf, size_t __nbytes) throw () ;
extern ssize_t write (int __fd, __const void *__buf, size_t __n) throw () ;
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off_t __offset)
throw () ;
extern ssize_t pwrite (int __fd, __const void *__buf, size_t __n,
__off_t __offset) throw () ;
# 334 "/usr/include/unistd.h" 3
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
__off64_t __offset) throw () ;
extern ssize_t pwrite64 (int __fd, __const void *__buf, size_t __n,
__off64_t __offset) throw () ;
extern int pipe (int __pipedes[2]) throw () ;
extern unsigned int alarm (unsigned int __seconds) throw () ;
extern unsigned int sleep (unsigned int __seconds) throw () ;
extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
throw () ;
extern void usleep (__useconds_t __useconds) throw () ;
extern int pause (void) throw () ;
extern int chown (__const char *__file, __uid_t __owner, __gid_t __group)
throw () ;
extern int fchown (int __fd, __uid_t __owner, __gid_t __group) throw () ;
extern int lchown (__const char *__file, __uid_t __owner, __gid_t __group)
throw () ;
extern int chdir (__const char *__path) throw () ;
extern int fchdir (int __fd) throw () ;
extern char *getcwd (char *__buf, size_t __size) throw () ;
extern char *get_current_dir_name (void) throw () ;
extern char *getwd (char *__buf) throw () ;
extern int dup (int __fd) throw () ;
extern int dup2 (int __fd, int __fd2) throw () ;
extern char **__environ;
extern char **environ;
extern int execve (__const char *__path, char *__const __argv[],
char *__const __envp[]) throw () ;
extern int fexecve (int __fd, char *__const __argv[], char *__const __envp[])
throw () ;
extern int execv (__const char *__path, char *__const __argv[]) throw () ;
extern int execle (__const char *__path, __const char *__arg, ...) throw () ;
extern int execl (__const char *__path, __const char *__arg, ...) throw () ;
extern int execvp (__const char *__file, char *__const __argv[]) throw () ;
extern int execlp (__const char *__file, __const char *__arg, ...) throw () ;
extern int nice (int __inc) throw () ;
extern void _exit (int __status) __attribute__ ((__noreturn__));
# 1 "/usr/include/bits/confname.h" 1 3
enum
{
_PC_LINK_MAX,
_PC_MAX_CANON,
_PC_MAX_INPUT,
_PC_NAME_MAX,
_PC_PATH_MAX,
_PC_PIPE_BUF,
_PC_CHOWN_RESTRICTED,
_PC_NO_TRUNC,
_PC_VDISABLE,
_PC_SYNC_IO,
_PC_ASYNC_IO,
_PC_PRIO_IO,
_PC_SOCK_MAXBUF,
_PC_FILESIZEBITS
};
enum
{
_SC_ARG_MAX,
_SC_CHILD_MAX,
_SC_CLK_TCK,
_SC_NGROUPS_MAX,
_SC_OPEN_MAX,
_SC_STREAM_MAX,
_SC_TZNAME_MAX,
_SC_JOB_CONTROL,
_SC_SAVED_IDS,
_SC_REALTIME_SIGNALS,
_SC_PRIORITY_SCHEDULING,
_SC_TIMERS,
_SC_ASYNCHRONOUS_IO,
_SC_PRIORITIZED_IO,
_SC_SYNCHRONIZED_IO,
_SC_FSYNC,
_SC_MAPPED_FILES,
_SC_MEMLOCK,
_SC_MEMLOCK_RANGE,
_SC_MEMORY_PROTECTION,
_SC_MESSAGE_PASSING,
_SC_SEMAPHORES,
_SC_SHARED_MEMORY_OBJECTS,
_SC_AIO_LISTIO_MAX,
_SC_AIO_MAX,
_SC_AIO_PRIO_DELTA_MAX,
_SC_DELAYTIMER_MAX,
_SC_MQ_OPEN_MAX,
_SC_MQ_PRIO_MAX,
_SC_VERSION,
_SC_PAGESIZE,
_SC_RTSIG_MAX,
_SC_SEM_NSEMS_MAX,
_SC_SEM_VALUE_MAX,
_SC_SIGQUEUE_MAX,
_SC_TIMER_MAX,
_SC_BC_BASE_MAX,
_SC_BC_DIM_MAX,
_SC_BC_SCALE_MAX,
_SC_BC_STRING_MAX,
_SC_COLL_WEIGHTS_MAX,
_SC_EQUIV_CLASS_MAX,
_SC_EXPR_NEST_MAX,
_SC_LINE_MAX,
_SC_RE_DUP_MAX,
_SC_CHARCLASS_NAME_MAX,
_SC_2_VERSION,
_SC_2_C_BIND,
_SC_2_C_DEV,
_SC_2_FORT_DEV,
_SC_2_FORT_RUN,
_SC_2_SW_DEV,
_SC_2_LOCALEDEF,
_SC_PII,
_SC_PII_XTI,
_SC_PII_SOCKET,
_SC_PII_INTERNET,
_SC_PII_OSI,
_SC_POLL,
_SC_SELECT,
_SC_UIO_MAXIOV,
_SC_PII_INTERNET_STREAM,
_SC_PII_INTERNET_DGRAM,
_SC_PII_OSI_COTS,
_SC_PII_OSI_CLTS,
_SC_PII_OSI_M,
_SC_T_IOV_MAX,
_SC_THREADS,
_SC_THREAD_SAFE_FUNCTIONS,
_SC_GETGR_R_SIZE_MAX,
_SC_GETPW_R_SIZE_MAX,
_SC_LOGIN_NAME_MAX,
_SC_TTY_NAME_MAX,
_SC_THREAD_DESTRUCTOR_ITERATIONS,
_SC_THREAD_KEYS_MAX,
_SC_THREAD_STACK_MIN,
_SC_THREAD_THREADS_MAX,
_SC_THREAD_ATTR_STACKADDR,
_SC_THREAD_ATTR_STACKSIZE,
_SC_THREAD_PRIORITY_SCHEDULING,
_SC_THREAD_PRIO_INHERIT,
_SC_THREAD_PRIO_PROTECT,
_SC_THREAD_PROCESS_SHARED,
_SC_NPROCESSORS_CONF,
_SC_NPROCESSORS_ONLN,
_SC_PHYS_PAGES,
_SC_AVPHYS_PAGES,
_SC_ATEXIT_MAX,
_SC_PASS_MAX,
_SC_XOPEN_VERSION,
_SC_XOPEN_XCU_VERSION,
_SC_XOPEN_UNIX,
_SC_XOPEN_CRYPT,
_SC_XOPEN_ENH_I18N,
_SC_XOPEN_SHM,
_SC_2_CHAR_TERM,
_SC_2_C_VERSION,
_SC_2_UPE,
_SC_XOPEN_XPG2,
_SC_XOPEN_XPG3,
_SC_XOPEN_XPG4,
_SC_CHAR_BIT,
_SC_CHAR_MAX,
_SC_CHAR_MIN,
_SC_INT_MAX,
_SC_INT_MIN,
_SC_LONG_BIT,
_SC_WORD_BIT,
_SC_MB_LEN_MAX,
_SC_NZERO,
_SC_SSIZE_MAX,
_SC_SCHAR_MAX,
_SC_SCHAR_MIN,
_SC_SHRT_MAX,
_SC_SHRT_MIN,
_SC_UCHAR_MAX,
_SC_UINT_MAX,
_SC_ULONG_MAX,
_SC_USHRT_MAX,
_SC_NL_ARGMAX,
_SC_NL_LANGMAX,
_SC_NL_MSGMAX,
_SC_NL_NMAX,
_SC_NL_SETMAX,
_SC_NL_TEXTMAX,
_SC_XBS5_ILP32_OFF32,
_SC_XBS5_ILP32_OFFBIG,
_SC_XBS5_LP64_OFF64,
_SC_XBS5_LPBIG_OFFBIG,
_SC_XOPEN_LEGACY,
_SC_XOPEN_REALTIME,
_SC_XOPEN_REALTIME_THREADS,
_SC_ADVISORY_INFO,
_SC_BARRIERS,
_SC_BASE,
_SC_C_LANG_SUPPORT,
_SC_C_LANG_SUPPORT_R,
_SC_CLOCK_SELECTION,
_SC_CPUTIME,
_SC_THREAD_CPUTIME,
_SC_DEVICE_IO,
_SC_DEVICE_SPECIFIC,
_SC_DEVICE_SPECIFIC_R,
_SC_FD_MGMT,
_SC_FIFO,
_SC_PIPE,
_SC_FILE_ATTRIBUTES,
_SC_FILE_LOCKING,
_SC_FILE_SYSTEM,
_SC_MONOTONIC_CLOCK,
_SC_MULTIPLE_PROCESS,
_SC_SINGLE_PROCESS,
_SC_NETWORKING,
_SC_READER_WRITER_LOCKS,
_SC_SPIN_LOCKS,
_SC_REGEXP,
_SC_REGEX_VERSION,
_SC_SHELL,
_SC_SIGNALS,
_SC_SPAWN,
_SC_SPORADIC_SERVER,
_SC_THREAD_SPORADIC_SERVER,
_SC_SYSTEM_DATABASE,
_SC_SYSTEM_DATABASE_R,
_SC_TIMEOUTS,
_SC_TYPED_MEMORY_OBJECTS,
_SC_USER_GROUPS,
_SC_USER_GROUPS_R,
_SC_PBS,
_SC_PBS_ACCOUNTING,
_SC_PBS_LOCATE,
_SC_PBS_MESSAGE,
_SC_PBS_TRACK,
_SC_SYMLOOP
};
enum
{
_CS_PATH
,
_CS_LFS_CFLAGS = 1000,
_CS_LFS_LDFLAGS,
_CS_LFS_LIBS,
_CS_LFS_LINTFLAGS,
_CS_LFS64_CFLAGS,
_CS_LFS64_LDFLAGS,
_CS_LFS64_LIBS,
_CS_LFS64_LINTFLAGS
,
_CS_XBS5_ILP32_OFF32_CFLAGS = 1100,
_CS_XBS5_ILP32_OFF32_LDFLAGS,
_CS_XBS5_ILP32_OFF32_LIBS,
_CS_XBS5_ILP32_OFF32_LINTFLAGS,
_CS_XBS5_ILP32_OFFBIG_CFLAGS,
_CS_XBS5_ILP32_OFFBIG_LDFLAGS,
_CS_XBS5_ILP32_OFFBIG_LIBS,
_CS_XBS5_ILP32_OFFBIG_LINTFLAGS,
_CS_XBS5_LP64_OFF64_CFLAGS,
_CS_XBS5_LP64_OFF64_LDFLAGS,
_CS_XBS5_LP64_OFF64_LIBS,
_CS_XBS5_LP64_OFF64_LINTFLAGS,
_CS_XBS5_LPBIG_OFFBIG_CFLAGS,
_CS_XBS5_LPBIG_OFFBIG_LDFLAGS,
_CS_XBS5_LPBIG_OFFBIG_LIBS,
_CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
};
# 500 "/usr/include/unistd.h" 2 3
extern long int pathconf (__const char *__path, int __name) throw () ;
extern long int fpathconf (int __fd, int __name) throw () ;
extern long int sysconf (int __name) throw () __attribute__ ((__const__));
extern size_t confstr (int __name, char *__buf, size_t __len) throw () ;
extern __pid_t getpid (void) throw () ;
extern __pid_t getppid (void) throw () ;
extern __pid_t getpgrp (void) throw () ;
extern __pid_t __getpgid (__pid_t __pid) throw () ;
extern __pid_t getpgid (__pid_t __pid) throw () ;
extern int setpgid (__pid_t __pid, __pid_t __pgid) throw () ;
extern int setpgrp (void) throw () ;
# 574 "/usr/include/unistd.h" 3
extern __pid_t setsid (void) throw () ;
extern __pid_t getsid (__pid_t __pid) throw () ;
extern __uid_t getuid (void) throw () ;
extern __uid_t geteuid (void) throw () ;
extern __gid_t getgid (void) throw () ;
extern __gid_t getegid (void) throw () ;
extern int getgroups (int __size, __gid_t __list[]) throw () ;
extern int group_member (__gid_t __gid) throw () ;
extern int setuid (__uid_t __uid) throw () ;
extern int setreuid (__uid_t __ruid, __uid_t __euid) throw () ;
extern int seteuid (__uid_t __uid) throw () ;
extern int setgid (__gid_t __gid) throw () ;
extern int setregid (__gid_t __rgid, __gid_t __egid) throw () ;
extern int setegid (__gid_t __gid) throw () ;
extern __pid_t fork (void) throw () ;
extern __pid_t vfork (void) throw () ;
extern char *ttyname (int __fd) throw () ;
extern int ttyname_r (int __fd, char *__buf, size_t __buflen) throw () ;
extern int isatty (int __fd) throw () ;
extern int ttyslot (void) throw () ;
extern int link (__const char *__from, __const char *__to) throw () ;
extern int symlink (__const char *__from, __const char *__to) throw () ;
extern int readlink (__const char *__restrict __path, char *__restrict __buf,
size_t __len) throw () ;
extern int unlink (__const char *__name) throw () ;
extern int rmdir (__const char *__path) throw () ;
extern __pid_t tcgetpgrp (int __fd) throw () ;
extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) throw () ;
extern char *getlogin (void) throw () ;
extern int getlogin_r (char *__name, size_t __name_len) throw () ;
extern int setlogin (__const char *__name) throw () ;
# 1 "/usr/include/getopt.h" 1 3
extern "C" {
extern char *optarg;
extern int optind;
extern int opterr;
extern int optopt;
# 113 "/usr/include/getopt.h" 3
extern int getopt (int __argc, char *const *__argv, const char *__shortopts);
# 162 "/usr/include/getopt.h" 3
# 171 "/usr/include/getopt.h" 3
}
# 725 "/usr/include/unistd.h" 2 3
extern int gethostname (char *__name, socklen_t __len) throw () ;
extern int sethostname (__const char *__name, size_t __len) throw () ;
extern int sethostid (long int __id) throw () ;
extern int getdomainname (char *__name, size_t __len) throw () ;
extern int setdomainname (__const char *__name, size_t __len) throw () ;
extern int fsync (int __fd) throw () ;
extern int vhangup (void) throw () ;
extern int revoke (__const char *__file) throw () ;
extern int profil (unsigned short int *__sample_buffer, size_t __size,
size_t __offset, unsigned int __scale) throw () ;
extern int acct (__const char *__name) throw () ;
extern int chroot (__const char *__path) throw () ;
extern char *getusershell (void) throw () ;
extern void endusershell (void) throw () ;
extern void setusershell (void) throw () ;
extern char *getpass (__const char *__prompt) throw () ;
extern int daemon (int __nochdir, int __noclose) throw () ;
extern long int gethostid (void) throw () ;
extern int sync (void) throw () ;
extern int getpagesize (void) throw () __attribute__ ((__const__));
extern int truncate (__const char *__file, __off_t __length) throw () ;
# 827 "/usr/include/unistd.h" 3
extern int truncate64 (__const char *__file, __off64_t __length) throw () ;
extern int ftruncate (int __fd, __off_t __length) throw () ;
extern int ftruncate64 (int __fd, __off64_t __length) throw () ;
extern int getdtablesize (void) throw () ;
extern int brk (void *__addr) throw () ;
extern void *sbrk (intptr_t __delta) throw () ;
extern long int syscall (long int __sysno, ...) throw () ;
# 912 "/usr/include/unistd.h" 3
extern int fdatasync (int __fildes) throw () ;
extern char *crypt (__const char *__key, __const char *__salt) throw () ;
extern void encrypt (char *__block, int __edflag) throw () ;
extern void swab (__const void *__restrict __from, void *__restrict __to,
ssize_t __n) throw () ;
extern char *ctermid (char *__s) throw () ;
extern int pthread_atfork (void (*__prepare) (void),
void (*__parent) (void),
void (*__child) (void)) throw () ;
}
# 295 "/usr/local/include/cc++/config.h" 2 3
typedef int8_t int8;
typedef u_int8_t uint8;
typedef int16_t int16;
typedef u_int16_t uint16;
typedef int32_t int32;
typedef u_int32_t uint32;
typedef int64_t int64;
typedef u_int64_t uint64;
# 334 "/usr/local/include/cc++/config.h" 3
# 1 "/usr/include/signal.h" 1 3
extern "C" {
# 1 "/usr/include/bits/sigset.h" 1 3
# 33 "/usr/include/bits/sigset.h" 3
# 88 "/usr/include/bits/sigset.h" 3
# 97 "/usr/include/bits/sigset.h" 3
extern int __sigismember (__const __sigset_t *, int);
extern int __sigaddset (__sigset_t *, int);
extern int __sigdelset (__sigset_t *, int);
# 122 "/usr/include/bits/sigset.h" 3
# 33 "/usr/include/signal.h" 2 3
typedef __sig_atomic_t sig_atomic_t;
# 1 "/usr/include/bits/signum.h" 1 3
# 56 "/usr/include/signal.h" 2 3
typedef void (*__sighandler_t) (int);
extern __sighandler_t __sysv_signal (int __sig, __sighandler_t __handler)
throw () ;
extern __sighandler_t sysv_signal (int __sig, __sighandler_t __handler)
throw () ;
extern __sighandler_t signal (int __sig, __sighandler_t __handler) throw () ;
# 98 "/usr/include/signal.h" 3
extern __sighandler_t bsd_signal (int __sig, __sighandler_t __handler) throw () ;
extern int kill (__pid_t __pid, int __sig) throw () ;
extern int killpg (__pid_t __pgrp, int __sig) throw () ;
extern int raise (int __sig) throw () ;
extern __sighandler_t ssignal (int __sig, __sighandler_t __handler) throw () ;
extern int gsignal (int __sig) throw () ;
extern void psignal (int __sig, __const char *__s) throw () ;
extern int __sigpause (int __sig_or_mask, int __is_sig) throw () ;
extern int sigpause (int __mask) throw () ;
# 155 "/usr/include/signal.h" 3
extern int sigblock (int __mask) throw () ;
extern int sigsetmask (int __mask) throw () ;
extern int siggetmask (void) throw () ;
typedef __sighandler_t sighandler_t;
typedef __sighandler_t sig_t;
# 1 "/usr/include/bits/siginfo.h" 1 3
# 1 "/usr/include/bits/wordsize.h" 1 3
# 24 "/usr/include/bits/siginfo.h" 2 3
typedef union sigval
{
int sival_int;
void *sival_ptr;
} sigval_t;
typedef struct siginfo
{
int si_signo;
int si_errno;
int si_code;
union
{
int _pad[((128 / sizeof (int)) - 3) ];
struct
{
__pid_t si_pid;
__uid_t si_uid;
} _kill;
struct
{
unsigned int _timer1;
unsigned int _timer2;
} _timer;
struct
{
__pid_t si_pid;
__uid_t si_uid;
sigval_t si_sigval;
} _rt;
struct
{
__pid_t si_pid;
__uid_t si_uid;
int si_status;
__clock_t si_utime;
__clock_t si_stime;
} _sigchld;
struct
{
void *si_addr;
} _sigfault;
struct
{
long int si_band;
int si_fd;
} _sigpoll;
} _sifields;
} siginfo_t;
enum
{
SI_SIGIO = -5,
SI_ASYNCIO,
SI_MESGQ,
SI_TIMER,
SI_QUEUE,
SI_USER,
SI_KERNEL = 0x80
};
enum
{
ILL_ILLOPC = 1,
ILL_ILLOPN,
ILL_ILLADR,
ILL_ILLTRP,
ILL_PRVOPC,
ILL_PRVREG,
ILL_COPROC,
ILL_BADSTK
};
enum
{
FPE_INTDIV = 1,
FPE_INTOVF,
FPE_FLTDIV,
FPE_FLTOVF,
FPE_FLTUND,
FPE_FLTRES,
FPE_FLTINV,
FPE_FLTSUB
};
enum
{
SEGV_MAPERR = 1,
SEGV_ACCERR
};
enum
{
BUS_ADRALN = 1,
BUS_ADRERR,
BUS_OBJERR
};
enum
{
TRAP_BRKPT = 1,
TRAP_TRACE
};
enum
{
CLD_EXITED = 1,
CLD_KILLED,
CLD_DUMPED,
CLD_TRAPPED,
CLD_STOPPED,
CLD_CONTINUED
};
enum
{
POLL_IN = 1,
POLL_OUT,
POLL_MSG,
POLL_ERR,
POLL_PRI,
POLL_HUP
};
typedef struct sigevent
{
sigval_t sigev_value;
int sigev_signo;
int sigev_notify;
union
{
int _pad[((64 / sizeof (int)) - 3) ];
struct
{
void (*_function) (sigval_t);
void *_attribute;
} _sigev_thread;
} _sigev_un;
} sigevent_t;
enum
{
SIGEV_SIGNAL = 0,
SIGEV_NONE,
SIGEV_THREAD
};
# 199 "/usr/include/signal.h" 2 3
extern int sigemptyset (sigset_t *__set) throw () ;
extern int sigfillset (sigset_t *__set) throw () ;
extern int sigaddset (sigset_t *__set, int __signo) throw () ;
extern int sigdelset (sigset_t *__set, int __signo) throw () ;
extern int sigismember (__const sigset_t *__set, int __signo) throw () ;
extern int sigisemptyset (__const sigset_t *__set) throw () ;
extern int sigandset (sigset_t *__set, __const sigset_t *__left,
__const sigset_t *__right) throw () ;
extern int sigorset (sigset_t *__set, __const sigset_t *__left,
__const sigset_t *__right) throw () ;
# 1 "/usr/include/bits/sigaction.h" 1 3
struct sigaction
{
union
{
__sighandler_t sa_handler;
void (*sa_sigaction) (int, siginfo_t *, void *);
}
__sigaction_handler;
__sigset_t sa_mask;
int sa_flags;
void (*sa_restorer) (void);
};
# 232 "/usr/include/signal.h" 2 3
extern int sigprocmask (int __how, __const sigset_t *__restrict __set,
sigset_t *__restrict __oset) throw () ;
extern int sigsuspend (__const sigset_t *__set) throw () ;
extern int __sigaction (int __sig, __const struct sigaction *__restrict __act,
struct sigaction *__restrict __oact) throw () ;
extern int sigaction (int __sig, __const struct sigaction *__restrict __act,
struct sigaction *__restrict __oact) throw () ;
extern int sigpending (sigset_t *__set) throw () ;
extern int sigwait (__const sigset_t *__restrict __set, int *__restrict __sig)
throw () ;
extern int sigwaitinfo (__const sigset_t *__restrict __set,
siginfo_t *__restrict __info) throw () ;
extern int sigtimedwait (__const sigset_t *__restrict __set,
siginfo_t *__restrict __info,
__const struct timespec *__restrict __timeout)
throw () ;
extern int sigqueue (__pid_t __pid, int __sig, __const union sigval __val)
throw () ;
extern __const char *__const _sys_siglist[64 ];
extern __const char *__const sys_siglist[64 ];
struct sigvec
{
__sighandler_t sv_handler;
int sv_mask;
int sv_flags;
};
extern int sigvec (int __sig, __const struct sigvec *__vec,
struct sigvec *__ovec) throw () ;
# 1 "/usr/include/bits/sigcontext.h" 1 3
# 1 "/usr/include/asm/sigcontext.h" 1 3
struct _fpreg {
unsigned short significand[4];
unsigned short exponent;
};
struct _fpxreg {
unsigned short significand[4];
unsigned short exponent;
unsigned short padding[3];
};
struct _xmmreg {
unsigned long element[4];
};
struct _fpstate {
unsigned long cw;
unsigned long sw;
unsigned long tag;
unsigned long ipoff;
unsigned long cssel;
unsigned long dataoff;
unsigned long datasel;
struct _fpreg _st[8];
unsigned short status;
unsigned short magic;
unsigned long _fxsr_env[6];
unsigned long mxcsr;
unsigned long reserved;
struct _fpxreg _fxsr_st[8];
struct _xmmreg _xmm[8];
unsigned long padding[56];
};
struct sigcontext {
unsigned short gs, __gsh;
unsigned short fs, __fsh;
unsigned short es, __esh;
unsigned short ds, __dsh;
unsigned long edi;
unsigned long esi;
unsigned long ebp;
unsigned long esp;
unsigned long ebx;
unsigned long edx;
unsigned long ecx;
unsigned long eax;
unsigned long trapno;
unsigned long err;
unsigned long eip;
unsigned short cs, __csh;
unsigned long eflags;
unsigned long esp_at_signal;
unsigned short ss, __ssh;
struct _fpstate * fpstate;
unsigned long oldmask;
unsigned long cr2;
};
# 28 "/usr/include/bits/sigcontext.h" 2 3
# 309 "/usr/include/signal.h" 2 3
extern int sigreturn (struct sigcontext *__scp) throw () ;
extern int siginterrupt (int __sig, int __interrupt) throw () ;
# 1 "/usr/include/bits/sigstack.h" 1 3
struct sigstack
{
void *ss_sp;
int ss_onstack;
};
enum
{
SS_ONSTACK = 1,
SS_DISABLE
};
typedef struct sigaltstack
{
void *ss_sp;
int ss_flags;
size_t ss_size;
} stack_t;
# 324 "/usr/include/signal.h" 2 3
# 1 "/usr/include/ucontext.h" 1 3
# 1 "/usr/include/sys/ucontext.h" 1 3
# 1 "/usr/include/bits/sigcontext.h" 1 3
# 27 "/usr/include/sys/ucontext.h" 2 3
typedef int greg_t;
typedef greg_t gregset_t[19 ];
enum
{
REG_GS = 0,
REG_FS,
REG_ES,
REG_DS,
REG_EDI,
REG_ESI,
REG_EBP,
REG_ESP,
REG_EBX,
REG_EDX,
REG_ECX,
REG_EAX,
REG_TRAPNO,
REG_ERR,
REG_EIP,
REG_CS,
REG_EFL,
REG_UESP,
REG_SS
};
struct _libc_fpreg
{
unsigned short int significand[4];
unsigned short int exponent;
};
struct _libc_fpstate
{
unsigned long int cw;
unsigned long int sw;
unsigned long int tag;
unsigned long int ipoff;
unsigned long int cssel;
unsigned long int dataoff;
unsigned long int datasel;
struct _libc_fpreg _st[8];
unsigned long int status;
};
typedef struct _libc_fpstate *fpregset_t;
typedef struct
{
gregset_t gregs;
fpregset_t fpregs;
unsigned long int oldmask;
unsigned long int cr2;
} mcontext_t;
typedef struct ucontext
{
unsigned long int uc_flags;
struct ucontext *uc_link;
stack_t uc_stack;
mcontext_t uc_mcontext;
__sigset_t uc_sigmask;
struct _libc_fpstate __fpregs_mem;
} ucontext_t;
# 27 "/usr/include/ucontext.h" 2 3
extern "C" {
extern int getcontext (ucontext_t *__ucp) throw () ;
extern int setcontext (__const ucontext_t *__ucp) throw () ;
extern int swapcontext (ucontext_t *__restrict __oucp,
__const ucontext_t *__restrict __ucp) throw () ;
extern void makecontext (ucontext_t *__ucp, void (*__func) (void),
int __argc, ...) throw () ;
}
# 326 "/usr/include/signal.h" 2 3
extern int sigstack (struct sigstack *__ss, struct sigstack *__oss) throw () ;
extern int sigaltstack (__const struct sigaltstack *__restrict __ss,
struct sigaltstack *__restrict __oss) throw () ;
extern int sighold (int __sig) throw () ;
extern int sigrelse (int __sig) throw () ;
extern int sigignore (int __sig) throw () ;
extern __sighandler_t sigset (int __sig, __sighandler_t __disp) throw () ;
extern int __libc_current_sigrtmin (void) throw () ;
extern int __libc_current_sigrtmax (void) throw () ;
}
# 346 "/usr/local/include/cc++/config.h" 2 3
# 1 "/usr/include/strings.h" 1 3
# 62 "/usr/include/strings.h" 3
# 356 "/usr/local/include/cc++/config.h" 2 3
# 385 "/usr/local/include/cc++/config.h" 3
# 1 "/usr/include/asm/atomic.h" 1 3
# 1 "/usr/include/linux/config.h" 1 3
# 1 "/usr/include/linux/autoconf.h" 1 3
# 4 "/usr/include/linux/config.h" 2 3
# 4 "/usr/include/asm/atomic.h" 2 3
typedef struct { volatile int counter; } atomic_t;
static __inline__ void atomic_add(int i, atomic_t *v)
{
__asm__ __volatile__(
"" "addl %1,%0"
:"=m" (v->counter)
:"ir" (i), "m" (v->counter));
}
static __inline__ void atomic_sub(int i, atomic_t *v)
{
__asm__ __volatile__(
"" "subl %1,%0"
:"=m" (v->counter)
:"ir" (i), "m" (v->counter));
}
static __inline__ int atomic_sub_and_test(int i, atomic_t *v)
{
unsigned char c;
__asm__ __volatile__(
"" "subl %2,%0; sete %1"
:"=m" (v->counter), "=qm" (c)
:"ir" (i), "m" (v->counter) : "memory");
return c;
}
static __inline__ void atomic_inc(atomic_t *v)
{
__asm__ __volatile__(
"" "incl %0"
:"=m" (v->counter)
:"m" (v->counter));
}
static __inline__ void atomic_dec(atomic_t *v)
{
__asm__ __volatile__(
"" "decl %0"
:"=m" (v->counter)
:"m" (v->counter));
}
static __inline__ int atomic_dec_and_test(atomic_t *v)
{
unsigned char c;
__asm__ __volatile__(
"" "decl %0; sete %1"
:"=m" (v->counter), "=qm" (c)
:"m" (v->counter) : "memory");
return c != 0;
}
static __inline__ int atomic_inc_and_test(atomic_t *v)
{
unsigned char c;
__asm__ __volatile__(
"" "incl %0; sete %1"
:"=m" (v->counter), "=qm" (c)
:"m" (v->counter) : "memory");
return c != 0;
}
static __inline__ int atomic_add_negative(int i, atomic_t *v)
{
unsigned char c;
__asm__ __volatile__(
"" "addl %2,%0; sets %1"
:"=m" (v->counter), "=qm" (c)
:"ir" (i), "m" (v->counter) : "memory");
return c;
}
# 392 "/usr/local/include/cc++/config.h" 2 3
# 1 "/usr/include/semaphore.h" 1 3
typedef struct
{
struct
{
long int status;
int spinlock;
} __sem_lock;
int __sem_value;
_pthread_descr __sem_waiting;
} sem_t;
extern "C" {
extern int sem_init (sem_t *__sem, int __pshared, unsigned int __value) throw () ;
extern int sem_destroy (sem_t *__sem) throw () ;
extern sem_t *sem_open (__const char *__name, int __oflag, ...) throw () ;
extern int sem_close (sem_t *__sem) throw () ;
extern int sem_unlink (__const char *__name) throw () ;
extern int sem_wait (sem_t *__sem) throw () ;
extern int sem_timedwait (sem_t *__restrict __sem,
__const struct timespec *__restrict __abstime)
throw () ;
extern int sem_trywait (sem_t *__sem) throw () ;
extern int sem_post (sem_t *__sem) throw () ;
extern int sem_getvalue (sem_t *__restrict __sem, int *__restrict __sval)
throw () ;
}
# 405 "/usr/local/include/cc++/config.h" 2 3
# 443 "/usr/local/include/cc++/config.h" 3
# 496 "/usr/local/include/cc++/config.h" 3
# 1 "/usr/include/sys/time.h" 1 3
# 1 "/usr/include/bits/time.h" 1 3
# 57 "/usr/include/bits/time.h" 3
struct timeval
{
__time_t tv_sec;
__suseconds_t tv_usec;
};
# 28 "/usr/include/sys/time.h" 2 3
extern "C" {
struct timezone
{
int tz_minuteswest;
int tz_dsttime;
};
typedef struct timezone *__restrict __timezone_ptr_t;
extern int gettimeofday (struct timeval *__restrict __tv,
__timezone_ptr_t __tz) throw () ;
extern int settimeofday (__const struct timeval *__tv,
__const struct timezone *__tz) throw () ;
extern int adjtime (__const struct timeval *__delta,
struct timeval *__olddelta) throw () ;
enum __itimer_which
{
ITIMER_REAL = 0,
ITIMER_VIRTUAL = 1,
ITIMER_PROF = 2
};
struct itimerval
{
struct timeval it_interval;
struct timeval it_value;
};
typedef enum __itimer_which __itimer_which_t;
extern int getitimer (__itimer_which_t __which,
struct itimerval *__value) throw () ;
extern int setitimer (__itimer_which_t __which,
__const struct itimerval *__restrict __new,
struct itimerval *__restrict __old) throw () ;
extern int utimes (__const char *__file, __const struct timeval __tvp[2])
throw () ;
# 151 "/usr/include/sys/time.h" 3
# 160 "/usr/include/sys/time.h" 3
}
# 502 "/usr/local/include/cc++/config.h" 2 3
# 1 "/usr/include/sys/socket.h" 1 3
extern "C" {
# 1 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 1 3
# 19 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 61 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 126 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 188 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 269 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 317 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 28 "/usr/include/sys/socket.h" 2 3
# 1 "/usr/include/bits/socket.h" 1 3
# 1 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 1 3
# 19 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 61 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 126 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 188 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 269 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 317 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 29 "/usr/include/bits/socket.h" 2 3
# 1 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/limits.h" 1 3
# 114 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/limits.h" 3
# 31 "/usr/include/bits/socket.h" 2 3
enum __socket_type
{
SOCK_STREAM = 1,
SOCK_DGRAM = 2,
SOCK_RAW = 3,
SOCK_RDM = 4,
SOCK_SEQPACKET = 5,
SOCK_PACKET = 10
};
# 1 "/usr/include/bits/sockaddr.h" 1 3
typedef unsigned short int sa_family_t;
extern int __libc_sa_len (sa_family_t __af) throw () ;
# 138 "/usr/include/bits/socket.h" 2 3
struct sockaddr
{
sa_family_t sa_family ;
char sa_data[14];
};
struct sockaddr_storage
{
sa_family_t __ss_family ;
__uint32_t __ss_align;
char __ss_padding[(128 - (2 * sizeof (__uint32_t ))) ];
};
enum
{
MSG_OOB = 0x01,
MSG_PEEK = 0x02,
MSG_DONTROUTE = 0x04,
MSG_TRYHARD = MSG_DONTROUTE ,
MSG_CTRUNC = 0x08,
MSG_PROXY = 0x10,
MSG_TRUNC = 0x20,
MSG_DONTWAIT = 0x40,
MSG_EOR = 0x80,
MSG_WAITALL = 0x100,
MSG_FIN = 0x200,
MSG_SYN = 0x400,
MSG_CONFIRM = 0x800,
MSG_RST = 0x1000,
MSG_ERRQUEUE = 0x2000,
MSG_NOSIGNAL = 0x4000
};
struct msghdr
{
void *msg_name;
socklen_t msg_namelen;
struct iovec *msg_iov;
size_t msg_iovlen;
void *msg_control;
size_t msg_controllen;
int msg_flags;
};
struct cmsghdr
{
size_t cmsg_len;
int cmsg_level;
int cmsg_type;
__extension__ unsigned char __cmsg_data[0];
};
extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
struct cmsghdr *__cmsg) throw () ;
# 275 "/usr/include/bits/socket.h" 3
enum
{
SCM_RIGHTS = 0x01,
SCM_CREDENTIALS = 0x02,
__SCM_CONNECT = 0x03
};
struct ucred
{
pid_t pid;
uid_t uid;
gid_t gid;
};
# 1 "/usr/include/asm/socket.h" 1 3
# 1 "/usr/include/asm/sockios.h" 1 3
# 4 "/usr/include/asm/socket.h" 2 3
# 59 "/usr/include/asm/socket.h" 3
# 300 "/usr/include/bits/socket.h" 2 3
struct linger
{
int l_onoff;
int l_linger;
};
# 34 "/usr/include/sys/socket.h" 2 3
struct osockaddr
{
unsigned short int sa_family;
unsigned char sa_data[14];
};
enum
{
SHUT_RD = 0,
SHUT_WR,
SHUT_RDWR
};
# 93 "/usr/include/sys/socket.h" 3
extern int socket (int __domain, int __type, int __protocol) throw () ;
extern int socketpair (int __domain, int __type, int __protocol,
int __fds[2]) throw () ;
extern int bind (int __fd, __const struct sockaddr * __addr, socklen_t __len)
throw () ;
extern int getsockname (int __fd, struct sockaddr *__restrict __addr,
socklen_t *__restrict __len) throw () ;
extern int connect (int __fd, __const struct sockaddr * __addr, socklen_t __len)
throw () ;
extern int getpeername (int __fd, struct sockaddr *__restrict __addr,
socklen_t *__restrict __len) throw () ;
extern int send (int __fd, __const void *__buf, size_t __n, int __flags)
throw () ;
extern int recv (int __fd, void *__buf, size_t __n, int __flags)
throw () ;
extern int sendto (int __fd, __const void *__buf, size_t __n,
int __flags, __const struct sockaddr * __addr,
socklen_t __addr_len) throw () ;
extern int recvfrom (int __fd, void *__restrict __buf, size_t __n, int __flags,
struct sockaddr *__restrict __addr, socklen_t *__restrict __addr_len)
throw () ;
extern int sendmsg (int __fd, __const struct msghdr *__message, int __flags)
throw () ;
extern int recvmsg (int __fd, struct msghdr *__message, int __flags)
throw () ;
extern int getsockopt (int __fd, int __level, int __optname,
void *__restrict __optval,
socklen_t *__restrict __optlen) throw () ;
extern int setsockopt (int __fd, int __level, int __optname,
__const void *__optval, socklen_t __optlen) throw () ;
extern int listen (int __fd, unsigned int __n) throw () ;
extern int accept (int __fd, struct sockaddr *__restrict __addr,
socklen_t *__restrict __addr_len)
throw () ;
extern int shutdown (int __fd, int __how) throw () ;
extern int isfdtype (int __fd, int __fdtype) throw () ;
}
# 531 "/usr/local/include/cc++/config.h" 2 3
# 1 "/usr/include/netinet/in.h" 1 3
# 1 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/limits.h" 1 3
# 114 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/limits.h" 3
# 23 "/usr/include/netinet/in.h" 2 3
# 1 "/usr/include/stdint.h" 1 3
# 1 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 1 3
# 19 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 61 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 126 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 188 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 269 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 317 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 28 "/usr/include/stdint.h" 2 3
# 1 "/usr/include/bits/wordsize.h" 1 3
# 30 "/usr/include/stdint.h" 2 3
# 48 "/usr/include/stdint.h" 3
typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;
typedef unsigned int uint32_t;
__extension__
typedef unsigned long long int uint64_t;
typedef signed char int_least8_t;
typedef short int int_least16_t;
typedef int int_least32_t;
__extension__
typedef long long int int_least64_t;
typedef unsigned char uint_least8_t;
typedef unsigned short int uint_least16_t;
typedef unsigned int uint_least32_t;
__extension__
typedef unsigned long long int uint_least64_t;
typedef signed char int_fast8_t;
typedef int int_fast16_t;
typedef int int_fast32_t;
__extension__
typedef long long int int_fast64_t;
typedef unsigned char uint_fast8_t;
typedef unsigned int uint_fast16_t;
typedef unsigned int uint_fast32_t;
__extension__
typedef unsigned long long int uint_fast64_t;
typedef unsigned int uintptr_t;
__extension__
typedef long long int intmax_t;
__extension__
typedef unsigned long long int uintmax_t;
# 284 "/usr/include/stdint.h" 3
# 320 "/usr/include/stdint.h" 3
# 24 "/usr/include/netinet/in.h" 2 3
extern "C" {
enum
{
IPPROTO_IP = 0,
IPPROTO_HOPOPTS = 0,
IPPROTO_ICMP = 1,
IPPROTO_IGMP = 2,
IPPROTO_IPIP = 4,
IPPROTO_TCP = 6,
IPPROTO_EGP = 8,
IPPROTO_PUP = 12,
IPPROTO_UDP = 17,
IPPROTO_IDP = 22,
IPPROTO_TP = 29,
IPPROTO_IPV6 = 41,
IPPROTO_ROUTING = 43,
IPPROTO_FRAGMENT = 44,
IPPROTO_RSVP = 46,
IPPROTO_GRE = 47,
IPPROTO_ESP = 50,
IPPROTO_AH = 51,
IPPROTO_ICMPV6 = 58,
IPPROTO_NONE = 59,
IPPROTO_DSTOPTS = 60,
IPPROTO_MTP = 92,
IPPROTO_ENCAP = 98,
IPPROTO_PIM = 103,
IPPROTO_COMP = 108,
IPPROTO_RAW = 255,
IPPROTO_MAX
};
typedef uint16_t in_port_t;
enum
{
IPPORT_ECHO = 7,
IPPORT_DISCARD = 9,
IPPORT_SYSTAT = 11,
IPPORT_DAYTIME = 13,
IPPORT_NETSTAT = 15,
IPPORT_FTP = 21,
IPPORT_TELNET = 23,
IPPORT_SMTP = 25,
IPPORT_TIMESERVER = 37,
IPPORT_NAMESERVER = 42,
IPPORT_WHOIS = 43,
IPPORT_MTP = 57,
IPPORT_TFTP = 69,
IPPORT_RJE = 77,
IPPORT_FINGER = 79,
IPPORT_TTYLINK = 87,
IPPORT_SUPDUP = 95,
IPPORT_EXECSERVER = 512,
IPPORT_LOGINSERVER = 513,
IPPORT_CMDSERVER = 514,
IPPORT_EFSSERVER = 520,
IPPORT_BIFFUDP = 512,
IPPORT_WHOSERVER = 513,
IPPORT_ROUTESERVER = 520,
IPPORT_RESERVED = 1024,
IPPORT_USERRESERVED = 5000
};
typedef uint32_t in_addr_t;
struct in_addr
{
in_addr_t s_addr;
};
struct in6_addr
{
union
{
uint8_t u6_addr8[16];
uint16_t u6_addr16[8];
uint32_t u6_addr32[4];
} in6_u;
};
extern const struct in6_addr in6addr_any;
extern const struct in6_addr in6addr_loopback;
struct sockaddr_in
{
sa_family_t sin_family ;
in_port_t sin_port;
struct in_addr sin_addr;
unsigned char sin_zero[sizeof (struct sockaddr) -
(sizeof (unsigned short int)) -
sizeof (in_port_t) -
sizeof (struct in_addr)];
};
struct sockaddr_in6
{
sa_family_t sin6_family ;
in_port_t sin6_port;
uint32_t sin6_flowinfo;
struct in6_addr sin6_addr;
uint32_t sin6_scope_id;
};
struct ipv6_mreq
{
struct in6_addr ipv6mr_multiaddr;
unsigned int ipv6mr_interface;
};
# 1 "/usr/include/bits/in.h" 1 3
struct ip_opts
{
struct in_addr ip_dst;
char ip_opts[40];
};
struct ip_mreq
{
struct in_addr imr_multiaddr;
struct in_addr imr_interface;
};
struct ip_mreqn
{
struct in_addr imr_multiaddr;
struct in_addr imr_address;
int imr_ifindex;
};
struct in_pktinfo
{
int ipi_ifindex;
struct in_addr ipi_spec_dst;
struct in_addr ipi_addr;
};
# 227 "/usr/include/netinet/in.h" 2 3
extern uint32_t ntohl (uint32_t __netlong) throw () __attribute__ ((__const__));
extern uint16_t ntohs (uint16_t __netshort)
throw () __attribute__ ((__const__));
extern uint32_t htonl (uint32_t __hostlong)
throw () __attribute__ ((__const__));
extern uint16_t htons (uint16_t __hostshort)
throw () __attribute__ ((__const__));
# 1 "/usr/include/bits/byteswap.h" 1 3
# 40 "/usr/include/bits/byteswap.h" 3
# 68 "/usr/include/bits/byteswap.h" 3
# 79 "/usr/include/bits/byteswap.h" 3
# 247 "/usr/include/netinet/in.h" 2 3
# 268 "/usr/include/netinet/in.h" 3
extern int bindresvport (int __sockfd, struct sockaddr_in *__sock_in) throw () ;
extern int bindresvport6 (int __sockfd, struct sockaddr_in6 *__sock_in)
throw () ;
struct in6_pktinfo
{
struct in6_addr ipi6_addr;
unsigned int ipi6_ifindex;
};
}
# 540 "/usr/local/include/cc++/config.h" 2 3
# 1 "/usr/include/arpa/inet.h" 1 3
extern "C" {
extern in_addr_t inet_addr (__const char *__cp) throw () ;
extern in_addr_t inet_lnaof (struct in_addr __in) throw () ;
extern struct in_addr inet_makeaddr (in_addr_t __net, in_addr_t __host)
throw () ;
extern in_addr_t inet_netof (struct in_addr __in) throw () ;
extern in_addr_t inet_network (__const char *__cp) throw () ;
extern char *inet_ntoa (struct in_addr __in) throw () ;
extern int inet_pton (int __af, __const char *__restrict __cp,
void *__restrict __buf) throw () ;
extern __const char *inet_ntop (int __af, __const void *__restrict __cp,
char *__restrict __buf, socklen_t __len)
throw () ;
extern in_addr_t inet_aton (__const char *__cp, struct in_addr *__inp) throw () ;
extern char *inet_neta (in_addr_t __net, char *__buf, size_t __len) throw () ;
extern char *inet_net_ntop (int __af, __const void *__cp, int __bits,
char *__buf, size_t __len) throw () ;
extern int inet_net_pton (int __af, __const char *__cp,
void *__buf, size_t __len) throw () ;
extern unsigned int inet_nsap_addr (__const char *__cp,
unsigned char *__buf, int __len) throw () ;
extern char *inet_nsap_ntoa (int __len, __const unsigned char *__cp,
char *__buf) throw () ;
}
# 541 "/usr/local/include/cc++/config.h" 2 3
# 1 "/usr/include/netdb.h" 1 3
# 1 "/usr/include/rpc/netdb.h" 1 3
# 1 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 1 3
# 19 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 61 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 126 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 188 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 269 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 317 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 42 "/usr/include/rpc/netdb.h" 2 3
extern "C" {
struct rpcent
{
char *r_name;
char **r_aliases;
int r_number;
};
extern void setrpcent (int __stayopen) throw () ;
extern void endrpcent (void) throw () ;
extern struct rpcent *getrpcbyname (__const char *__name) throw () ;
extern struct rpcent *getrpcbynumber (int __number) throw () ;
extern struct rpcent *getrpcent (void) throw () ;
extern int getrpcbyname_r (__const char *__name, struct rpcent *__result_buf,
char *__buffer, size_t __buflen,
struct rpcent **__result) throw () ;
extern int getrpcbynumber_r (int __number, struct rpcent *__result_buf,
char *__buffer, size_t __buflen,
struct rpcent **__result) throw () ;
extern int getrpcent_r (struct rpcent *__result_buf, char *__buffer,
size_t __buflen, struct rpcent **__result) throw () ;
}
# 30 "/usr/include/netdb.h" 2 3
# 1 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 1 3
# 19 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 61 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 126 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 188 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 269 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 317 "/usr/lib/gcc-lib/i486-suse-linux/2.95.2/include/stddef.h" 3
# 33 "/usr/include/netdb.h" 2 3
# 1 "/usr/include/bits/netdb.h" 1 3
struct netent
{
char *n_name;
char **n_aliases;
int n_addrtype;
uint32_t n_net;
};
# 40 "/usr/include/netdb.h" 2 3
extern "C" {
extern int h_errno;
extern int *__h_errno_location (void) throw () __attribute__ ((__const__));
# 69 "/usr/include/netdb.h" 3
extern void herror (__const char *__str) throw () ;
extern __const char *hstrerror (int __err_num) throw () ;
struct hostent
{
char *h_name;
char **h_aliases;
int h_addrtype;
socklen_t h_length;
char **h_addr_list;
};
extern void sethostent (int __stay_open) throw () ;
extern void endhostent (void) throw () ;
extern struct hostent *gethostent (void) throw () ;
extern struct hostent *gethostbyaddr (__const void *__addr, __socklen_t __len,
int __type) throw () ;
extern struct hostent *gethostbyname (__const char *__name) throw () ;
extern struct hostent *gethostbyname2 (__const char *__name, int __af) throw () ;
extern int gethostent_r (struct hostent *__restrict __result_buf,
char *__restrict __buf, size_t __buflen,
struct hostent **__restrict __result,
int *__restrict __h_errnop) throw () ;
extern int gethostbyaddr_r (__const void *__restrict __addr, __socklen_t __len,
int __type,
struct hostent *__restrict __result_buf,
char *__restrict __buf, size_t __buflen,
struct hostent **__restrict __result,
int *__restrict __h_errnop) throw () ;
extern int gethostbyname_r (__const char *__restrict __name,
struct hostent *__restrict __result_buf,
char *__restrict __buf, size_t __buflen,
struct hostent **__restrict __result,
int *__restrict __h_errnop) throw () ;
extern int gethostbyname2_r (__const char *__restrict __name, int __af,
struct hostent *__restrict __result_buf,
char *__restrict __buf, size_t __buflen,
struct hostent **__restrict __result,
int *__restrict __h_errnop) throw () ;
extern void setnetent (int __stay_open) throw () ;
extern void endnetent (void) throw () ;
extern struct netent *getnetent (void) throw () ;
extern struct netent *getnetbyaddr (uint32_t __net, int __type)
throw () ;
extern struct netent *getnetbyname (__const char *__name) throw () ;
extern int getnetent_r (struct netent *__restrict __result_buf,
char *__restrict __buf, size_t __buflen,
struct netent **__restrict __result,
int *__restrict __h_errnop) throw () ;
extern int getnetbyaddr_r (uint32_t __net, int __type,
struct netent *__restrict __result_buf,
char *__restrict __buf, size_t __buflen,
struct netent **__restrict __result,
int *__restrict __h_errnop) throw () ;
extern int getnetbyname_r (__const char *__restrict __name,
struct netent *__restrict __result_buf,
char *__restrict __buf, size_t __buflen,
struct netent **__restrict __result,
int *__restrict __h_errnop) throw () ;
struct servent
{
char *s_name;
char **s_aliases;
int s_port;
char *s_proto;
};
extern void setservent (int __stay_open) throw () ;
extern void endservent (void) throw () ;
extern struct servent *getservent (void) throw () ;
extern struct servent *getservbyname (__const char *__name,
__const char *__proto) throw () ;
extern struct servent *getservbyport (int __port, __const char *__proto)
throw () ;
extern int getservent_r (struct servent *__restrict __result_buf,
char *__restrict __buf, size_t __buflen,
struct servent **__restrict __result) throw () ;
extern int getservbyname_r (__const char *__restrict __name,
__const char *__restrict __proto,
struct servent *__restrict __result_buf,
char *__restrict __buf, size_t __buflen,
struct servent **__restrict __result) throw () ;
extern int getservbyport_r (int __port, __const char *__restrict __proto,
struct servent *__restrict __result_buf,
char *__restrict __buf, size_t __buflen,
struct servent **__restrict __result) throw () ;
struct protoent
{
char *p_name;
char **p_aliases;
int p_proto;
};
extern void setprotoent (int __stay_open) throw () ;
extern void endprotoent (void) throw () ;
extern struct protoent *getprotoent (void) throw () ;
extern struct protoent *getprotobyname (__const char *__name) throw () ;
extern struct protoent *getprotobynumber (int __proto) throw () ;
extern int getprotoent_r (struct protoent *__restrict __result_buf,
char *__restrict __buf, size_t __buflen,
struct protoent **__restrict __result) throw () ;
extern int getprotobyname_r (__const char *__restrict __name,
struct protoent *__restrict __result_buf,
char *__restrict __buf, size_t __buflen,
struct protoent **__restrict __result) throw () ;
extern int getprotobynumber_r (int __proto,
struct protoent *__restrict __result_buf,
char *__restrict __buf, size_t __buflen,
struct protoent **__restrict __result) throw () ;
extern int setnetgrent (__const char *__netgroup) throw () ;
extern void endnetgrent (void) throw () ;
extern int getnetgrent (char **__restrict __hostp,
char **__restrict __userp,
char **__restrict __domainp) throw () ;
extern int innetgr (__const char *__netgroup, __const char *__host,
__const char *__user, __const char *domain) throw () ;
extern int getnetgrent_r (char **__restrict __hostp,
char **__restrict __userp,
char **__restrict __domainp,
char *__restrict __buffer, size_t __buflen) throw () ;
extern int rcmd (char **__restrict __ahost, unsigned short int __rport,
__const char *__restrict __locuser,
__const char *__restrict __remuser,
__const char *__restrict __cmd, int *__restrict __fd2p)
throw () ;
extern int rcmd_af (char **__restrict __ahost, unsigned short int __rport,
__const char *__restrict __locuser,
__const char *__restrict __remuser,
__const char *__restrict __cmd, int *__restrict __fd2p,
sa_family_t __af) throw () ;
extern int rexec (char **__restrict __ahost, int __rport,
__const char *__restrict __name,
__const char *__restrict __pass,
__const char *__restrict __cmd, int *__restrict __fd2p)
throw () ;
extern int rexec_af (char **__restrict __ahost, int __rport,
__const char *__restrict __name,
__const char *__restrict __pass,
__const char *__restrict __cmd, int *__restrict __fd2p,
sa_family_t __af) throw () ;
extern int ruserok (__const char *__rhost, int __suser,
__const char *__remuser, __const char *__locuser) throw () ;
extern int ruserok_af (__const char *__rhost, int __suser,
__const char *__remuser, __const char *__locuser,
sa_family_t __af) throw () ;
extern int rresvport (int *__alport) throw () ;
extern int rresvport_af (int *__alport, sa_family_t __af) throw () ;
struct addrinfo
{
int ai_flags;
int ai_family;
int ai_socktype;
int ai_protocol;
socklen_t ai_addrlen;
struct sockaddr *ai_addr;
char *ai_canonname;
struct addrinfo *ai_next;
};
extern int getaddrinfo (__const char *__restrict __name,
__const char *__restrict __service,
__const struct addrinfo *__restrict __req,
struct addrinfo **__restrict __pai) throw () ;
extern void freeaddrinfo (struct addrinfo *__ai) throw () ;
extern char *gai_strerror (int __ecode) throw () ;
extern int getnameinfo (__const struct sockaddr *__restrict __sa,
socklen_t __salen, char *__restrict __host,
socklen_t __hostlen, char *__restrict __serv,
socklen_t __servlen, int __flags) throw () ;
}
# 542 "/usr/local/include/cc++/config.h" 2 3
# 1 "/usr/include/netinet/in_systm.h" 1 3
extern "C" {
typedef u_int16_t n_short;
typedef u_int32_t n_long;
typedef u_int32_t n_time;
}
# 545 "/usr/local/include/cc++/config.h" 2 3
# 1 "/usr/include/netinet/ip.h" 1 3
extern "C" {
struct timestamp
{
u_int8_t len;
u_int8_t ptr;
unsigned int flags:4;
unsigned int overflow:4;
u_int32_t data[9];
};
struct iphdr
{
unsigned int ihl:4;
unsigned int version:4;
u_int8_t tos;
u_int16_t tot_len;
u_int16_t id;
u_int16_t frag_off;
u_int8_t ttl;
u_int8_t protocol;
u_int16_t check;
u_int32_t saddr;
u_int32_t daddr;
};
struct ip
{
unsigned int ip_hl:4;
unsigned int ip_v:4;
u_int8_t ip_tos;
u_short ip_len;
u_short ip_id;
u_short ip_off;
u_int8_t ip_ttl;
u_int8_t ip_p;
u_short ip_sum;
struct in_addr ip_src, ip_dst;
};
struct ip_timestamp
{
u_int8_t ipt_code;
u_int8_t ipt_len;
u_int8_t ipt_ptr;
unsigned int ipt_flg:4;
unsigned int ipt_oflw:4;
u_int32_t data[9];
};
}
# 548 "/usr/local/include/cc++/config.h" 2 3
# 1 "/usr/include/sys/un.h" 1 3
extern "C" {
struct sockaddr_un
{
sa_family_t sun_family ;
char sun_path[108];
};
}
# 551 "/usr/local/include/cc++/config.h" 2 3
# 575 "/usr/local/include/cc++/config.h" 3
# 586 "/usr/local/include/cc++/config.h" 3
# 1 "/usr/include/poll.h" 1 3
# 1 "/usr/include/sys/poll.h" 1 3
# 1 "/usr/include/bits/poll.h" 1 3
# 26 "/usr/include/sys/poll.h" 2 3
extern "C" {
struct pollfd
{
int fd;
short int events;
short int revents;
};
extern int poll (struct pollfd *__fds, unsigned long int __nfds, int __timeout)
throw () ;
}
# 1 "/usr/include/poll.h" 2 3
# 590 "/usr/local/include/cc++/config.h" 2 3
# 618 "/usr/local/include/cc++/config.h" 3
# 4 "GnutellaStream.h" 2
# 1 "/usr/local/include/cc++/socket.h" 1 3
# 1 "/usr/local/include/cc++/thread.h" 1 3
# 62 "/usr/local/include/cc++/thread.h" 3
# 1 "/usr/local/include/cc++/macros.h" 1 3
# 70 "/usr/local/include/cc++/thread.h" 2 3
# 1 "/usr/include/setjmp.h" 1 3
extern "C" {
# 1 "/usr/include/bits/setjmp.h" 1 3
# 56 "/usr/include/bits/setjmp.h" 3
typedef int __jmp_buf[6];
# 30 "/usr/include/setjmp.h" 2 3
# 1 "/usr/include/bits/sigset.h" 1 3
# 33 "/usr/include/bits/sigset.h" 3
# 125 "/usr/include/bits/sigset.h" 3
# 31 "/usr/include/setjmp.h" 2 3
typedef struct __jmp_buf_tag
{
__jmp_buf __jmpbuf;
int __mask_was_saved;
__sigset_t __saved_mask;
} jmp_buf[1];
extern int __sigsetjmp (jmp_buf __env, int __savemask) throw () ;
extern void longjmp (jmp_buf __env, int __val)
throw () __attribute__ ((__noreturn__));
extern void _longjmp (jmp_buf __env, int __val)
throw () __attribute__ ((__noreturn__));
typedef jmp_buf sigjmp_buf;
extern void siglongjmp (sigjmp_buf __env, int __val)
throw () __attribute__ ((__noreturn__));
}
# 79 "/usr/local/include/cc++/thread.h" 2 3
typedef pthread_t cctid_t;
typedef unsigned long timeout_t;
typedef int signo_t;
typedef enum {
THROW_NOTHING,
THROW_OBJECT,
THROW_EXCEPTION
} throw_t;
typedef enum
{
THREAD_CANCEL_INITIAL=0,
THREAD_CANCEL_DEFERRED=1,
THREAD_CANCEL_IMMEDIATE,
THREAD_CANCEL_DISABLED,
THREAD_CANCEL_DEFAULT=THREAD_CANCEL_DEFERRED,
THREAD_CANCEL_INVALID
} thread_cancel_t;
typedef enum
{
THREAD_SUSPEND_ENABLE,
THREAD_SUSPEND_DISABLE
} thread_suspend_t;
# 160 "/usr/local/include/cc++/thread.h" 3
class cc_Thread ;
cc_Thread *getThread(void);
extern "C" {
void execHandler(cc_Thread *th);
void sigHandler(int signo);
};
class ThreadLock
{
private:
pthread_rwlock_t _lock;
public:
ThreadLock();
~ThreadLock();
void ReadLock(void);
void WriteLock(void);
bool TryReadLock(void);
bool TryWriteLock(void);
void Unlock(void);
};
class cc_Mutex
{
private:
protected:
pthread_mutex_t _mutex;
public:
cc_Mutex ();
~cc_Mutex ()
{pthread_mutex_destroy(&_mutex);};
inline void EnterMutex(void)
{pthread_mutex_lock(&_mutex);};
bool TryEnterMutex(void);
inline void LeaveMutex(void)
{pthread_mutex_unlock(&_mutex);};
};
class cc_MutexCounter : public cc_Mutex
{
private:
int counter;
public:
cc_MutexCounter (int initial = 0);
friend int operator ++(cc_MutexCounter &mc);
friend int operator --(cc_MutexCounter &mc);
};
class cc_AtomicCounter
{
private:
atomic_t atomic;
public:
cc_AtomicCounter ();
cc_AtomicCounter (int value);
int operator++(void);
int operator--(void);
int operator+=(int change);
int operator-=(int change);
int operator+(int change);
int operator-(int change);
int operator=(int value);
bool operator!(void);
operator int();
};
class cc_Semaphore
{
protected:
sem_t _semaphore;
public:
cc_Semaphore (size_t resource = 0);
~cc_Semaphore ()
;
void Wait(void)
;
bool TryWait(void)
;
void Post(void)
;
int getValue(void);
};
class cc_Event : public cc_Mutex
{
protected:
pthread_cond_t _cond;
bool _signaled;
int _count;
public:
cc_Event ();
~cc_Event ()
{pthread_cond_destroy(&_cond);};
void Reset(void)
{_signaled = false;};
void Signal(void);
bool Wait(timeout_t timer = 0);
};
class cc_Buffer
{
private:
cc_Mutex lock_head, lock_tail;
cc_Semaphore size_head, size_tail;
size_t _size;
size_t _used;
protected:
virtual int OnPeek(void *buf) = 0;
virtual int OnWait(void *buf) = 0;
virtual int OnPost(void *buf) = 0;
public:
cc_Buffer (size_t capacity);
virtual ~cc_Buffer ()
{return;};
inline size_t getSize(void)
{return _size;};
inline size_t getUsed(void)
{return _used;};
int Wait(void *buf);
int Post(void *buf);
int Peek(void *buf);
virtual bool isValid(void)
{return true;};
};
class cc_FixedBuffer : public cc_Buffer
{
private:
char *buf, *head, *tail;
size_t objsize;
protected:
int OnPeek(void *buf);
int OnWait(void *buf);
int OnPost(void *buf);
public:
cc_FixedBuffer (size_t capacity, size_t objsize);
cc_FixedBuffer (const cc_FixedBuffer &fb);
~cc_FixedBuffer ();
cc_FixedBuffer &operator=(const cc_FixedBuffer &fb);
bool isValid(void);
};
class cc_Thread
{
private:
friend class cc_Slog ;
static cc_Thread *_main;
cc_Thread *_parent;
pthread_t _tid;
pthread_attr_t _attr;
thread_cancel_t _cancel;
jmp_buf _env;
time_t _alarm;
cc_Semaphore *_start;
int _msgpos;
char _msgbuf[128];
throw_t _throw;
friend void execHandler(cc_Thread *th);
friend void sigHandler(int signo);
friend cc_Thread *getThread(void);
protected:
virtual void Run(void) = 0;
virtual void First(void)
{return;};
virtual void Final(void)
{return;};
virtual void Initial(void)
{return;};
virtual void *getExtended(void)
{return __null ;};
virtual void Notify(cc_Thread *th)
{return;};
inline void SignalParent(signo_t signo)
{_parent->SignalThread(signo);};
inline void SignalMain(signo_t signo)
{_main->SignalThread(signo);};
virtual void OnTimer(void)
{return;};
virtual void OnHangup(void)
{return;};
virtual void OnException(void)
{return;};
virtual void OnDisconnect(void)
{return;};
virtual void OnPolling(void)
{return;};
virtual void OnSignal(int signo)
{return;};
inline void Sleep(timeout_t msec)
{ccxx_sleep(msec);};
inline void Exit(void)
{longjmp(_env, 1);};
void setTimer(timeout_t timer);
timeout_t getTimer(void);
void endTimer(void);
void WaitSignal(signo_t signo);
void Yield(void);
void testCancel(void);
void setCancel(thread_cancel_t mode);
void setSuspend(thread_suspend_t mode);
void setSignal(int signo, bool mode);
void Terminate(void);
inline void clrParent(void)
{_parent = __null ;};
public:
cc_Thread (bool flag);
cc_Thread (cc_Semaphore *start = __null , int pri = 0, size_t stack = 0);
cc_Thread (const cc_Thread &th);
virtual ~cc_Thread ()
{Terminate();};
int Start(cc_Semaphore *start = __null );
int Detach(cc_Semaphore *start = __null );
inline cc_Thread *getParent(void)
{return _parent;};
inline void SignalThread(int signo)
{pthread_kill(_tid, signo);};
inline void Suspend(void)
{pthread_kill(_tid, 19 );};
inline void Resume(void)
{pthread_kill(_tid, 18 );};
inline int getCancel(void)
{return _cancel;};
bool isRunning(void);
bool isThread(void);
friend throw_t getException(void);
friend void setException(throw_t mode);
friend void ccxx_sleep(timeout_t msec);
friend void suspend(cc_Thread &th)
{pthread_kill(th._tid, 19 );};
friend void resume(cc_Thread &th)
{pthread_kill(th._tid, 18 );};
friend inline void operator++(cc_Thread &th)
{th._start->Post();};
friend inline void operator--(cc_Thread &th)
{th._start->Wait();};
friend inline int start(cc_Thread &th, cc_Semaphore *start)
{return th.Start(start);};
friend void siginstall(int signo);
};
class cc_ThreadKey
{
private:
pthread_key_t key;
public:
cc_ThreadKey ();
~cc_ThreadKey ();
void *getKey(void);
void setKey(void *);
};
class cc_TimerPort
{
struct timeval timer;
bool active;
protected:
cc_TimerPort ();
public:
void setTimer(timeout_t timeout = 0);
void incTimer(timeout_t timeout);
void endTimer(void);
timeout_t getTimer(void);
};
inline void *getKey(cc_ThreadKey &tk)
{return tk.getKey();};
inline void setKey(cc_ThreadKey &tk, void *ptr)
{tk.setKey(ptr);};
inline void operator ++(cc_Mutex &m)
{m.EnterMutex();};
inline void operator --(cc_Mutex &m)
{m.LeaveMutex();};
inline void operator ++(cc_Semaphore &s)
{s.Post();};
inline void operator --(cc_Semaphore &s)
{s.Wait();};
inline void operator ++(cc_Event &s)
{s.Signal();};
inline void operator --(cc_Event &s)
{s.Wait();};
inline void signal(cc_Thread &th, int signo)
{th.SignalThread(signo);};
inline void signal(cc_Event &ev)
{ev.Signal();};
inline void signal(cc_Semaphore &sem)
{sem.Post();};
inline void wait(cc_Semaphore &sem)
{sem.Wait();};
inline void wait(cc_Event &ev, timeout_t timer)
{ev.Wait(timer);};
inline void reset(cc_Event &ev)
{ev.Reset();};
inline int get(cc_Buffer &b, void *o)
{return b.Wait(o);};
inline int put(cc_Buffer &b, void *o)
{return b.Post(o);};
inline int peek(cc_Buffer &b, void *o)
{return b.Peek(o);};
int operator++(cc_MutexCounter &mc);
int operator--(cc_MutexCounter &mc);
struct timespec *gettimeout(struct timespec *spec, timeout_t timeout);
void ccxx_sleep(timeout_t msec);
void ccxx_yield(void);
void wait(signo_t signo);
void pdetach(void);
class Poller
{
private:
int nufds;
pollfd *ufds;
public:
Poller();
~Poller();
pollfd *getList(int cnt);
inline pollfd *getList(void)
{return ufds;};
};
# 55 "/usr/local/include/cc++/socket.h" 2 3
typedef int SOCKET;
typedef enum
{
SOCKET_COMPLETION_IMMEDIATE,
SOCKET_COMPLETION_DELAYED
} sockcomplete_t;
typedef enum
{
SOCKET_INITIAL,
SOCKET_AVAILABLE,
SOCKET_BOUND,
SOCKET_CONNECTED,
SOCKET_CONNECTING,
SOCKET_STREAM
} sockstate_t;
typedef enum
{
SOCKET_SUCCESS = 0,
SOCKET_CREATE_FAILED,
SOCKET_COPY_FAILED,
SOCKET_INPUT_ERROR,
SOCKET_INPUT_INTERRUPT,
SOCKET_RESOURCE_FAILURE,
SOCKET_OUTPUT_ERROR,
SOCKET_OUTPUT_INTERRUPT,
SOCKET_NOT_CONNECTED,
SOCKET_CONNECT_REFUSED,
SOCKET_CONNECT_REJECTED,
SOCKET_CONNECT_TIMEOUT,
SOCKET_CONNECT_FAILED,
SOCKET_CONNECT_INVALID,
SOCKET_CONNECT_BUSY,
SOCKET_CONNECT_NOROUTE,
SOCKET_BINDING_FAILED,
SOCKET_BROADCAST_DENIED,
SOCKET_ROUTING_DENIED,
SOCKET_KEEPALIVE_DENIED,
SOCKET_SERVICE_DENIED,
SOCKET_SERVICE_UNAVAILABLE,
SOCKET_MULTICAST_DISABLED,
SOCKET_EXTENDED_ERROR
} sockerror_t;
typedef enum
{
SOCKET_IPTOS_LOWDELAY,
SOCKET_IPTOS_THROUGHPUT,
SOCKET_IPTOS_RELIABILITY,
SOCKET_IPTOS_MINCOST,
SOCKET_IPTOS_INVALID
} socktos_t;
typedef enum
{
SOCKET_PENDING_INPUT,
SOCKET_PENDING_OUTPUT,
SOCKET_PENDING_ERROR
} sockpend_t;
typedef unsigned short tpport_t;
class cc_InetAddress ;
class cc_InetHostAddress ;
class cc_InetMaskAddress ;
class cc_BroadcastAddress ;
class cc_Socket ;
class cc_UDPSocket ;
class cc_UDPBroadcast ;
class cc_UDPTransmit ;
class cc_UDPReceive ;
class cc_UDPDuplex ;
class cc_TCPSocket ;
class cc_TCPStream ;
class tcpstream;
class cc_TCPSession ;
class cc_InetAddress
{
protected:
struct in_addr * ipaddr;
size_t addr_count;
static cc_Mutex mutex;
bool setIPAddress(const char *host);
void setAddress(const char *host);
public:
cc_InetAddress ();
cc_InetAddress (struct in_addr addr);
cc_InetAddress (const char *address);
cc_InetAddress (const cc_InetAddress &rhs);
virtual ~cc_InetAddress ();
const char *getHostname(void) const;
bool isInetAddress(void) const;
struct in_addr getAddress(void) const;
struct in_addr getAddress(size_t i) const;
size_t getAddressCount() const { return addr_count; }
cc_InetAddress &operator=(const char *str);
cc_InetAddress &operator=(struct in_addr addr);
cc_InetAddress &operator=(const cc_InetAddress &rhs);
cc_InetAddress &operator=(unsigned long addr);
inline bool operator!() const
{return !isInetAddress();};
bool operator==(const cc_InetAddress &a) const;
bool operator!=(const cc_InetAddress &a) const;
};
class cc_InetMaskAddress : public cc_InetAddress
{
public:
cc_InetMaskAddress (const char *mask);
friend cc_InetHostAddress operator&(const cc_InetHostAddress &addr,
const cc_InetMaskAddress &mask);
cc_InetAddress &operator=(unsigned long addr)
{ return cc_InetAddress ::operator =(addr); }
};
class cc_InetHostAddress : public cc_InetAddress
{
public:
cc_InetHostAddress (const char *host = __null );
cc_InetHostAddress (struct in_addr addr);
cc_InetAddress &operator=(unsigned long addr)
{ return cc_InetAddress ::operator =(addr); }
cc_InetHostAddress &operator&=(const cc_InetMaskAddress &mask);
friend class cc_InetMaskAddress ;
friend cc_InetHostAddress operator&(const cc_InetHostAddress &addr,
const cc_InetMaskAddress &mask);
};
class cc_BroadcastAddress : public cc_InetAddress
{
public:
cc_BroadcastAddress (const char *net = "255.255.255.255");
};
class cc_Socket
{
private:
mutable sockerror_t errid;
mutable const char *errstr;
mutable struct
{
bool thrown: 1;
bool broadcast: 1;
bool route: 1;
bool keepalive: 1;
bool loopback: 1;
bool multicast: 1;
unsigned ttl: 8;
} flags;
void setSocket(void);
protected:
SOCKET so;
sockstate_t state;
sockerror_t Error(sockerror_t error, char *errstr = __null ) const;
inline void Error(char *estr)
{Error(SOCKET_EXTENDED_ERROR, estr);};
inline void setError(bool enable)
{flags.thrown = !enable;};
void endSocket(void);
sockerror_t connectError(void);
sockerror_t setBroadcast(bool enable);
sockerror_t setMulticast(bool enable);
sockerror_t setLoopback(bool enable);
sockerror_t setTimeToLive(unsigned char ttl);
sockerror_t Join(cc_InetAddress &ia);
sockerror_t Drop(cc_InetAddress &ia);
sockerror_t setRouting(bool enable);
cc_Socket (int domain, int type, int protocol = 0);
cc_Socket (SOCKET fd);
cc_Socket (const cc_Socket &source);
ssize_t Readline(char *buf, size_t len);
public:
virtual ~cc_Socket ()
{endSocket();};
cc_Socket &operator=(const cc_Socket &from);
cc_InetHostAddress getSender(tpport_t *port = __null ) const;
cc_InetHostAddress getPeer(tpport_t *port = __null ) const;
cc_InetHostAddress getLocal(tpport_t *port = __null ) const;
void setCompletion(sockcomplete_t completion);
sockerror_t setKeepAlive(bool enable);
sockerror_t setTypeOfService(socktos_t service);
bool isConnected(void) const;
bool isActive(void) const;
bool operator!() const;
inline bool isBroadcast(void) const
{return flags.broadcast;};
inline bool isRouted(void) const
{return flags.route;};
inline sockerror_t getErrorNumber(void) const {return errid;}
inline const char *getErrorString(void) const {return errstr;}
virtual bool isPending(sockpend_t pend, timeout_t timeout = ~((timeout_t) 0) );
};
class cc_UDPSocket : public cc_Socket
{
private:
inline sockerror_t setKeepAlive(bool enable)
{return cc_Socket ::setKeepAlive(enable);};
protected:
struct sockaddr_in peer;
public:
cc_UDPSocket (void);
cc_UDPSocket (const cc_InetAddress &bind, tpport_t port);
~cc_UDPSocket ()
{endSocket();};
void setPeer(const cc_InetHostAddress &host, tpport_t port);
inline int Send(void *buf, size_t len)
{return ::sendto(so, (const char *)buf, len, 0, (struct sockaddr *)&peer, (socklen_t)sizeof(peer));};
inline int Recv(void *buf, size_t len)
{return ::recv(so, (char *)buf, len, 0);};
cc_InetHostAddress getPeer(tpport_t *port = __null ) const;
inline int Peek(void *buf, size_t len)
{return ::recv(so, (char *)buf, len, MSG_PEEK );};
};
class cc_UDPBroadcast : public cc_UDPSocket
{
private:
void setPeer(const cc_InetHostAddress &ia, tpport_t port) {};
sockerror_t setBroadcast(bool enable)
{return cc_Socket ::setBroadcast(enable);};
public:
cc_UDPBroadcast (const cc_InetAddress &ia, tpport_t port);
void setPeer(const cc_BroadcastAddress &subnet, tpport_t port);
};
class cc_UDPTransmit : private cc_UDPSocket
{
protected:
cc_UDPTransmit ();
cc_UDPTransmit (const cc_InetAddress &bind, tpport_t port = 5005);
sockerror_t Connect(const cc_InetHostAddress &host, tpport_t port);
sockerror_t Connect(const cc_BroadcastAddress &subnet, tpport_t port);
sockerror_t Disconnect(void);
inline int Send(void *buf, int len)
{return ::send(so, (char *)buf, len, 0);}
inline void endTransmitter(void)
{cc_Socket ::endSocket();}
inline SOCKET getTransmitter(void)
{return so;};
public:
inline int Transmit(const char *buffer, size_t len)
{return ::send(so, buffer, len, MSG_DONTWAIT );}
inline bool isOutputReady(unsigned long timeout = 0l)
{return cc_Socket ::isPending(SOCKET_PENDING_OUTPUT, timeout);};
inline sockerror_t setRouting(bool enable)
{return cc_Socket ::setRouting(enable);};
inline sockerror_t setTypeOfService(socktos_t tos)
{return cc_Socket ::setTypeOfService(tos);};
inline sockerror_t setBroadcast(bool enable)
{return cc_Socket ::setBroadcast(enable);};
};
class cc_UDPReceive : private cc_UDPSocket
{
protected:
cc_UDPReceive (const cc_InetAddress &bind, tpport_t port);
sockerror_t Connect(const cc_InetHostAddress &host, tpport_t port);
sockerror_t Disconnect(void);
bool isPendingReceive(timeout_t timeout)
{return cc_Socket ::isPending(SOCKET_PENDING_INPUT, timeout);};
inline void endReceiver(void)
{cc_Socket ::endSocket();}
inline SOCKET getReceiver(void)
{return so;};
inline sockerror_t setRouting(bool enable)
{return cc_Socket ::setRouting(enable);};
public:
inline int Receive(void *buf, size_t len)
{return ::recv(so, (char *)buf, len, 0);};
inline bool isInputReady(timeout_t timeout = ~((timeout_t) 0) )
{return cc_Socket ::isPending(SOCKET_PENDING_INPUT, timeout);};
};
class cc_UDPDuplex : public cc_UDPTransmit , public cc_UDPReceive
{
public:
cc_UDPDuplex (const cc_InetAddress &bind, tpport_t port);
sockerror_t Connect(const cc_InetHostAddress &host, tpport_t port);
sockerror_t Disconnect(void);
};
class cc_TCPSocket : private cc_Socket
{
protected:
virtual bool OnAccept(const cc_InetHostAddress &ia, short port) {
return false;
}
virtual bool OnAccept(const cc_InetHostAddress &ia, tpport_t port)
{return true;};
friend class cc_TCPStream ;
friend class cc_SocketPort ;
friend class tcpstream;
public:
cc_TCPSocket (const cc_InetAddress &bind, tpport_t port, int backlog = 5);
inline cc_InetHostAddress getRequest(tpport_t *port = __null ) const
{return cc_Socket ::getSender(port);};
void Reject(void);
inline cc_InetHostAddress getLocal(tpport_t *port = __null ) const
{return cc_Socket ::getLocal(port);};
inline bool isPendingConnection(timeout_t timeout = ~((timeout_t) 0) )
{return cc_Socket ::isPending(SOCKET_PENDING_INPUT, timeout);}
~cc_TCPSocket ()
{endSocket();};
};
class cc_TCPStream : public cc_Socket , public streambuf, public iostream
{
private:
inline sockerror_t setBroadcast(bool enable)
{return cc_Socket ::setBroadcast(enable);};
inline cc_InetHostAddress getSender(tpport_t *port) const
{return cc_InetHostAddress ();};
int doallocate();
friend cc_TCPStream & crlf(cc_TCPStream &);
friend cc_TCPStream & lfcr(cc_TCPStream &);
protected:
int bufsize;
char *gbuf, *pbuf;
cc_TCPStream ();
void Allocate(int size);
void endStream(void);
virtual int underflow(void);
int uflow(void);
int overflow(int ch);
void Connect(const cc_InetHostAddress &host, tpport_t port, int size);
iostream *tcp(void)
{return ((iostream *)this);};
public:
cc_TCPStream (cc_TCPSocket &server, int size = 512);
cc_TCPStream (const cc_InetHostAddress &host, tpport_t port, int size = 512);
cc_TCPStream (const cc_TCPStream &source);
~cc_TCPStream ()
{endStream();};
int sync(void);
bool isPending(sockpend_t pend, timeout_t timeout = ~((timeout_t) 0) );
int getBufferSize(void) const
{return bufsize;};
};
class tcpstream : public cc_TCPStream
{
public:
tcpstream();
tcpstream(const char *addr, int buffer = 512);
tcpstream(cc_TCPSocket &tcp, int buffer = 512);
void open(const char *addr, int buffer = 512);
void open(cc_TCPSocket &tcp, int buffer = 512);
void close(void);
bool operator!() const;
};
class cc_TCPSession : public cc_TCPStream , public cc_Thread
{
protected:
int WaitConnection(timeout_t timeout = ~((timeout_t) 0) );
void Initial(void);
void Final(void)
{delete this;};
public:
cc_TCPSession (cc_Semaphore *start, const cc_InetHostAddress &host,
tpport_t port, int size = 512, int pri = 0, int stack = 0);
cc_TCPSession (cc_Semaphore *start, cc_TCPSocket &server, int size = 512,
int pri = 0, int stack = 0);
};
extern ::ostream &operator<<(::ostream &os, const cc_InetAddress &ia);
inline struct in_addr getaddress(const cc_InetAddress &ia)
{return ia.getAddress();}
# 1591 "/usr/local/include/cc++/socket.h" 3
class cc_SocketService ;
class cc_SocketPort : public cc_Socket , public cc_TimerPort
{
private:
cc_SocketPort *next, *prev;
cc_SocketService *service;
struct timeval porttimer;
struct pollfd * ufd;
bool detect_pending;
bool detect_output;
bool detect_disconnect;
friend class cc_SocketService ;
protected:
cc_SocketPort (cc_SocketService *svc, cc_TCPSocket &tcp);
cc_SocketPort (cc_SocketService *svc, const cc_InetAddress &ia, tpport_t port);
void Attach( cc_SocketService * svc );
virtual ~cc_SocketPort ();
void setDetectPending( bool );
bool getDetectPending( void ) const
{ return detect_pending; }
void setDetectOutput( bool );
bool getDetectOutput( void ) const
{ return detect_output; }
virtual void Expired(void)
{return;};
virtual void Pending(void)
{return;};
virtual void Output(void)
{return;};
virtual void Disconnect(void)
{return;};
sockerror_t Connect(const cc_InetAddress &ia, tpport_t port);
inline int Send(void *buf, int len)
{return ::send(so, (char *)buf, len, 0);};
inline int Recv(void *buf, size_t len)
{return ::recv(so, (char *)buf, len, 0);};
inline int Peek(void *buf, size_t len)
{return ::recv(so, (char *)buf, len, MSG_PEEK );};
public:
void setTimer(timeout_t timeout = 0);
void incTimer(timeout_t timeout);
};
class cc_SocketService : public cc_Thread , private cc_Mutex
{
private:
fd_set connect;
int iosync[2];
int hiwater;
int count;
cc_SocketPort *first, *last;
void Attach(cc_SocketPort *port);
void Detach(cc_SocketPort *port);
void Run(void);
friend class cc_SocketPort ;
protected:
virtual void OnUpdate(unsigned char buf)
{return;};
virtual void OnEvent(void)
{return;};
virtual void OnCallback(cc_SocketPort *port)
{return;};
public:
void Update(unsigned char flag = 0xff);
cc_SocketService (int pri = 0);
~cc_SocketService ();
inline int getCount(void) const
{return count;};
};
# 5 "GnutellaStream.h" 2
class GnutellaStream : public cc_TCPStream
{
public:
GnutellaStream(const cc_InetHostAddress &,
tpport_t port);
GnutellaStream(cc_TCPSocket & sock);
typedef enum
{
SERVER_MODE = 0,
CLIENT_MODE = 1
} Mode;
int startUp();
private:
int checkTwoNewline();
Mode mode;
};
# 3 "GnutellaService.cc" 2
# 1 "GnutellaMessage.h" 1
# 1 "GnutellaDescriptor.h" 1
# 1 "gamp.h" 1
# 1 "/usr/include/assert.h" 1 3
# 56 "/usr/include/assert.h" 3
extern "C" {
extern void __assert_fail (__const char *__assertion, __const char *__file,
unsigned int __line, __const char *__function)
throw () __attribute__ ((__noreturn__));
extern void __assert_perror_fail (int __errnum, __const char *__file,
unsigned int __line,
__const char *__function)
throw () __attribute__ ((__noreturn__));
extern void __assert (const char *__assertion, const char *__file, int __line)
throw () __attribute__ ((__noreturn__));
}
# 4 "gamp.h" 2
typedef unsigned char byte;
typedef unsigned int Length;
# 4 "GnutellaDescriptor.h" 2
class GnutellaDescriptor
{
public:
GnutellaDescriptor();
GnutellaDescriptor(GnutellaStream& s);
GnutellaDescriptor(const GnutellaDescriptor&);
virtual ~GnutellaDescriptor();
GnutellaDescriptor& operator=(const GnutellaDescriptor&);
typedef enum
{
PING=0x00,
PONG=0x01,
PUSH=0x40,
QUERY = 0x80,
QUERYHIT=0x81
} PayloadType;
byte getPayloadType() { return (byte) header[16]; }
byte getTTL() { return (byte) header[17]; }
byte getHops() { return (byte) header[18]; }
int getPayloadLength() { return *((int*) &(header[19])); }
void setPayloadType(PayloadType t) { header[16]=(byte) t; }
void setTTL(byte b) { header[17]=b; }
void setHops(byte b) { header[18]=b; }
char* getPayload() { return payload; }
private:
char header[23];
char *payload;
};
ostream& operator<<(ostream& os, GnutellaDescriptor& gdh);
# 4 "GnutellaMessage.h" 2
class GnutellaMessage
{
public:
GnutellaMessage(GnutellaDescriptor* gd)
{
switch (gd->getPayloadType())
{
case GnutellaDescriptor::PUSH:
priority=10;
break;
case GnutellaDescriptor::QUERYHIT:
priority=8;
break;
case GnutellaDescriptor::QUERY:
priority=5;
break;
case GnutellaDescriptor::PONG:
priority=2;
break;
case GnutellaDescriptor::PING:
priority=1;
break;
default:
priority=0;
break;
}
}
GnutellaDescriptor *getDescriptor();
int getPriority() { return priority; }
bool operator<(const GnutellaMessage& m)
{
return priority < m.priority;
}
private:
GnutellaDescriptor *gd;
int priority;
};
# 4 "GnutellaService.cc" 2
# 1 "GnutellaService.h" 1
class GnutellaService : public cc_Thread
{
public:
GnutellaService();
void swapInputQueueForRouter();
void swapOutputQueueForRouter();
void indicateSwap() { doTheSwap=1; }
protected:
void swapInputQueueForService();
void swapOutputQueueForService();
private:
cc_Mutex input_mutex;
queue<GnutellaMessage> *input_to_router;
queue<GnutellaMessage> *input_inbetween;
queue<GnutellaMessage> *input_from_service;
cc_Mutex output_mutex;
priority_queue<GnutellaMessage> *output_from_router;
priority_queue<GnutellaMessage> *output_inbetween;
priority_queue<GnutellaMessage> *output_to_service;
GnutellaStream gs;
volatile int doTheSwap;
};
# 5 "GnutellaService.cc" 2
# 1 "MutexLock.h" 1
class MutexLock
{
public:
MutexLock(cc_Mutex & m) : mutex(m)
{
mutex.EnterMutex();
}
~MutexLock()
{
mutex.LeaveMutex();
}
private:
cc_Mutex & mutex;
}
# 7 "GnutellaService.cc" 2
GnutellaService::GnutellaService()
{
input_to_router=(new queue<GnutellaMessage>),
input_inbetween=(new queue<GnutellaMessage>),
input_from_service=(new queue<GnutellaMessage>),
output_from_router=(new priority_queue<GnutellaMessage>),
output_inbetween=(new priority_queue<GnutellaMessage>),
output_to_service=(new priority_queue<GnutellaMessage>)
}
void GnutellaService::swapInputQueueForRouter()
{
MutexLock ml(input_mutex);
queue<GnutellaMessage> *tmp=input_to_router;
input_to_router=input_inbetween;
input_inbetween=tmp;
}
void GnutellaService::swapOutputQueueForRouter()
{
MutexLock ml(output_mutex);
priority_queue<GnutellaMessage> *tmp=output_from_router;
output_from_router=output_inbetween;
output_inbetween=tmp;
}
void GnutellaService::swapInputQueueForService()
{
MutexLock ml(input_mutex);
queue<GnutellaMessage> *tmp=input_from_service;
input_from_service=input_inbetween;
input_inbetween=tmp;
}
void GnutellaService::swapOutputQueueForService()
{
MutexLock ml(output_mutex);
priority_queue<GnutellaMessage> *tmp=output_to_service;
output_to_service=output_inbetween;
output_inbetween=tmp;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: c++/3043: Inernal compiler error
@ 2001-06-14 18:52 rodrigc
0 siblings, 0 replies; 2+ messages in thread
From: rodrigc @ 2001-06-14 18:52 UTC (permalink / raw)
To: christian.gleich, gcc-bugs, gcc-prs, nobody
Synopsis: Inernal compiler error
State-Changed-From-To: open->closed
State-Changed-By: rodrigc
State-Changed-When: Thu Jun 14 18:52:04 2001
State-Changed-Why:
Your example file, l.cc, includes only two lines:
# 1 "GnutellaService.cc"
# 1 "/usr/include/g++/queue" 1 3
When I compile this file with gcc version 3.0 20010614 (prerelease)
I do not get an Internal Compiler Error.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=3043&database=gcc
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-06-14 18:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-03 16:26 c++/3043: Inernal compiler error christian.gleich
2001-06-14 18:52 rodrigc
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).