This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
irix-65-sighandling-bug
- To: bug-gcc at gnu dot org, Daniel Heiserer <Daniel dot Heiserer at bmw dot de>
- Subject: irix-65-sighandling-bug
- From: Daniel Heiserer <Daniel dot Heiserer at bmw dot de>
- Date: Tue, 12 Sep 2000 13:58:53 +0200
- Organization: BMW AG
Hi,
I cannot compile octave (http://www.che.wisc.edu/octave/) on irix-65.
there are some versions of octave I could compile some time before,
but now the signalhandling is weird.
e.g. octave supports a ctrl-c to work like in the tcsh with flushing
the line and asking for the next input line. for
the versions I could compile ctrl-c terminated the process.
Here is my output:
c++ -c -I. -I.. -I../liboctave -I../src -I../libcruft/misc -I../glob
-I../glob -DHAVE_CONFIG_H -fno-rtti -fno-exceptions
-fno-implicit-templates -g -O2 -Wall sighandlers.cc
sighandlers.cc:649: Internal compiler error in `output_die', at
dwarf2out.c:5426
Please submit a full bug report.
See <URL:http://www.gnu.org/software/gcc/faq.html#bugreport> for
instructions.
gmake[2]: *** [sighandlers.o] Error 1
gcc --version
2.95.2
uname -a
IRIX64 super5 6.5 07151432 IP27
I also attached the file signalhandlers.ii like requested.
thanks daniel
# 1 "sighandlers.cc"
# 1 "../config.h" 1
# 24 "sighandlers.cc" 2
# 1 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/cstdlib" 1 3
# 1 "/usr/include/stdlib.h" 1 3
extern "C" {
#ident "$Revision: 1.78 $"
# 1 "/usr/include/standards.h" 1 3
#ident "$Id: standards.h,v 1.19 1997/12/15 21:30:25 jph Exp $"
# 34 "/usr/include/stdlib.h" 2 3
# 1 "/usr/include/sgidefs.h" 1 3
extern "C" {
#ident "$Revision: 1.11 $"
typedef int __int32_t;
typedef unsigned __uint32_t;
typedef long long __int64_t;
typedef unsigned long long __uint64_t;
# 214 "/usr/include/sgidefs.h" 3
typedef __int32_t __psint_t;
typedef __uint32_t __psunsigned_t;
typedef __int32_t __scint_t;
typedef __uint32_t __scunsigned_t;
}
# 35 "/usr/include/stdlib.h" 2 3
# 64 "/usr/include/stdlib.h" 3
typedef struct {
int quot;
int rem;
} div_t;
typedef struct {
long quot;
long rem;
} ldiv_t;
typedef unsigned int size_t;
typedef int ssize_t;
typedef long wchar_t;
# 1 "/usr/include/locale_attr.h" 1 3
extern "C" {
#ident "$Revision: 1.4 $"
typedef struct {
unsigned int _class [ 257 ];
signed short _lower [ 257 ];
signed short _upper [ 257 ];
char _cswidth [ 7 ];
char _fill [ 1 ];
} __ctype_t;
typedef int (*__isset_func_t)(int);
typedef long wint_t;
typedef int (*__iscodeset_func_t)(int, wint_t);
typedef struct __attr {
__ctype_t * _ctype_tbl;
struct _csinfo {
unsigned char _eucwidth[3];
unsigned char _scrwidth[3];
unsigned char _mb_cur_max;
} _csinfo;
struct _euc_func {
int _is_euc;
__isset_func_t _isset2;
__isset_func_t _isset3;
__iscodeset_func_t _iscodeset;
} _euc_func;
struct _collate_res {
unsigned char _coll_as_cmp;
} _collate_res;
void * _fill[15];
} __attr_t;
extern __attr_t __libc_attr;
}
# 133 "/usr/include/stdlib.h" 2 3
extern double atof(const char *);
extern int atoi(const char *);
extern long int atol(const char *);
extern double strtod(const char *, char **);
extern long int strtol(const char *, char **, int);
extern unsigned long int strtoul(const char *, char **, int);
extern int rand(void);
extern void srand(unsigned int);
extern void *calloc(size_t, size_t);
extern void free(void *);
extern void *malloc(size_t);
extern void *realloc(void *, size_t);
extern void abort(void);
extern int atexit(void (*)(void));
extern void exit(int);
extern char *getenv(const char *);
extern int system(const char *);
extern void *bsearch(const void *, const void *, size_t, size_t,
int (*)(const void *, const void *));
extern void qsort(void *, size_t, size_t,
int (*)(const void *, const void *));
inline int abs(int x) {return x > 0 ? x : -x;}
extern div_t div(int, int);
extern long int labs(long);
extern ldiv_t ldiv(long, long);
extern int mbtowc(wchar_t *, const char *, size_t);
extern int mblen(const char *, size_t);
extern int wctomb(char *, wchar_t);
extern size_t mbstowcs(wchar_t *, const char *, size_t);
extern size_t wcstombs(char *, const wchar_t *, size_t);
extern int putenv(const char *);
extern double drand48(void);
extern double erand48(unsigned short [3]);
extern long lrand48(void);
extern long nrand48(unsigned short [3]);
extern long mrand48(void);
extern long jrand48(unsigned short [3]);
extern void srand48(long);
extern void lcong48(unsigned short int [7]);
extern void setkey(const char *);
extern unsigned short * seed48(unsigned short int [3]);
extern long a64l(const char *);
extern char *ecvt(double, int, int *, int *);
extern char *fcvt(double, int, int *, int *);
extern char *gcvt(double, int, char *);
extern int getsubopt(char **, char * const *, char **);
extern int grantpt(int);
extern char *initstate(unsigned int, char *, size_t);
extern char *l64a(long);
extern char *mktemp(char *);
extern int mkstemp(char *);
extern char *ptsname(int);
extern long random(void);
extern char *realpath(const char *, char *);
extern char *setstate(const char *);
extern void srandom(unsigned);
extern int ttyslot(void);
extern int unlockpt(int);
extern void *valloc(size_t);
extern int rand_r(unsigned int *);
# 1 "../liboctave/getopt.h" 1
extern "C" {
extern char *optarg;
extern int optind;
extern int opterr;
extern int optopt;
struct option
{
const char *name;
int has_arg;
int *flag;
int val;
};
extern int getopt ();
extern int getopt_long (int argc, char *const *argv, const char *shortopts,
const struct option *longopts, int *longind);
extern int getopt_long_only (int argc, char *const *argv,
const char *shortopts,
const struct option *longopts, int *longind);
extern int _getopt_internal (int argc, char *const *argv,
const char *shortopts,
const struct option *longopts, int *longind,
int long_only);
}
# 250 "/usr/include/stdlib.h" 2 3
extern int atcheckpoint(void (*)(void));
extern int atrestart(void (*)(void));
extern int dup2(int, int);
extern int getpw(int, char *);
extern char *getcwd(char *, size_t);
extern char *getlogin(void);
extern char *getpass(const char *);
extern int isatty(int);
extern void l3tol(long *, const char *, int);
extern void ltol3(char *, const long *, int);
extern void *memalign(size_t, size_t);
extern long double atold(const char *);
extern long double strtold(const char *nptr, char **endptr);
extern char *qecvt(long double, int, int *, int *);
extern char *qfcvt(long double, int, int *, int *);
extern char *qgcvt(long double, int, char *);
extern char *ecvtl(long double, int, int *, int *);
extern char *fcvtl(long double, int, int *, int *);
extern char *gcvtl(long double, int, char *);
typedef struct {
__int64_t quot;
__int64_t rem;
} lldiv_t;
extern __int64_t atoll(const char *);
extern __int64_t strtoll(const char *, char **, int);
extern __uint64_t strtoull(const char *, char **, int);
extern __int64_t llabs(__int64_t);
extern lldiv_t lldiv(__int64_t, __int64_t);
extern char *ecvt_r(double, int, int *, int *, char *);
extern char *fcvt_r(double, int, int *, int *, char *);
extern char *qecvt_r(long double, int, int *, int *, char *);
extern char *qfcvt_r(long double, int, int *, int *, char *);
extern char *ecvtl_r(long double, int, int *, int *, char *);
extern char *fcvtl_r(long double, int, int *, int *, char *);
}
# 343 "/usr/include/stdlib.h" 3
# 6 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/cstdlib" 2 3
#pragma interface "cstdlib"
extern "C++" {
inline long abs(long x) { return x >= 0 ? x : -x; }
}
# 27 "sighandlers.cc" 2
# 1 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/csignal" 1 3
# 1 "/usr/include/signal.h" 1 3
extern "C" {
#ident "$Revision: 1.57 $"
# 108 "/usr/include/signal.h" 3
# 1 "/usr/include/sys/signal.h" 1 3
extern "C" {
#ident "$Revision: 3.144 $"
# 1 "/usr/include/sys/types.h" 1 3
#ident "$Revision: 3.138 $"
typedef unsigned char uchar_t;
typedef unsigned short ushort_t;
typedef unsigned int uint_t;
typedef unsigned long ulong_t;
# 1 "/usr/include/sys/pthread.h" 1 3
extern "C" {
typedef unsigned int pthread_t;
typedef struct { long __D[5]; } pthread_attr_t;
typedef struct { long __D[8]; } pthread_mutex_t;
typedef struct { long __D[2]; } pthread_mutexattr_t;
typedef struct { long __D[8]; } pthread_cond_t;
typedef struct { long __D[2]; } pthread_condattr_t;
typedef struct { long __D[16]; } pthread_rwlock_t;
typedef struct { long __D[4]; } pthread_rwlockattr_t;
typedef int pthread_key_t;
typedef int pthread_once_t;
}
# 40 "/usr/include/sys/types.h" 2 3
typedef char * addr_t;
typedef char * caddr_t;
typedef __int64_t daddr_t;
typedef long pgno_t;
typedef __uint32_t pfn_t;
typedef short cnt_t;
typedef unsigned long basictime_t;
typedef __int64_t micro_t;
typedef __int32_t pgcnt_t;
typedef enum { B_FALSE, B_TRUE } boolean_t;
typedef long id_t;
typedef ulong_t major_t;
typedef ulong_t minor_t;
typedef ushort_t o_mode_t;
typedef short o_dev_t;
typedef ushort_t o_uid_t;
typedef o_uid_t o_gid_t;
typedef short o_nlink_t;
typedef short o_pid_t;
typedef __uint32_t o_ino_t;
typedef unsigned long mode_t;
typedef unsigned long dev_t;
typedef long uid_t;
typedef long gid_t;
typedef unsigned long nlink_t;
typedef long pid_t;
typedef int tid_t;
typedef dev_t vertex_hdl_t;
typedef __uint64_t ino_t;
typedef __uint64_t ino64_t;
typedef __int64_t off_t;
typedef __int64_t off64_t;
typedef __scint_t __scoff_t;
typedef __scoff_t scoff_t;
typedef __int64_t blkcnt64_t;
typedef __uint64_t fsblkcnt64_t;
typedef __uint64_t fsfilcnt64_t;
typedef __int64_t blkcnt_t;
typedef __uint64_t fsblkcnt_t;
typedef __uint64_t fsfilcnt_t;
typedef long swblk_t;
typedef unsigned long paddr_t;
typedef unsigned long iopaddr_t;
typedef int key_t;
typedef unsigned char use_t;
typedef long sysid_t;
typedef short index_t;
typedef signed short nasid_t;
typedef signed short cnodeid_t;
typedef signed char partid_t;
typedef signed short moduleid_t;
typedef signed short cmoduleid_t;
typedef unsigned int lock_t;
typedef signed short cpuid_t;
typedef unsigned char pri_t;
typedef __uint64_t accum_t;
typedef __int64_t prid_t;
typedef __int64_t ash_t;
typedef short cell_t;
typedef int credid_t;
# 213 "/usr/include/sys/types.h" 3
# 223 "/usr/include/sys/types.h" 3
typedef long time_t;
typedef long clock_t;
# 253 "/usr/include/sys/types.h" 3
typedef int clockid_t;
typedef int timer_t;
typedef unsigned int useconds_t;
typedef __scunsigned_t bitnum_t;
typedef __scunsigned_t bitlen_t;
typedef int processorid_t;
typedef int toid_t;
typedef long *qaddr_t;
typedef __uint32_t inst_t;
typedef __uint64_t machreg_t;
typedef __uint64_t fpreg_t;
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef signed short int16_t;
typedef unsigned short uint16_t;
typedef signed int int32_t;
typedef unsigned int uint32_t;
typedef __int64_t int64_t;
typedef __uint64_t uint64_t;
typedef __int64_t intmax_t;
typedef __uint64_t uintmax_t;
typedef signed long int intptr_t;
typedef unsigned long int uintptr_t;
typedef unsigned char u_int8_t;
typedef unsigned short u_int16_t;
typedef __uint32_t u_int32_t;
typedef long hostid_t;
# 1 "/usr/include/sys/bsd_types.h" 1 3
#ident "$Revision: 1.2 $"
typedef struct { int r[1]; } * physadr;
typedef unsigned char unchar;
typedef unsigned char u_char;
typedef unsigned short ushort;
typedef unsigned short u_short;
typedef unsigned int uint;
typedef unsigned int u_int;
typedef unsigned long ulong;
typedef unsigned long u_long;
typedef struct _quad { long val[2]; } quad;
# 1 "/usr/include/sys/select.h" 1 3
#ident "$Revision: 1.17 $"
extern "C" {
typedef long fd_mask_t;
typedef unsigned long ufd_mask_t;
typedef struct fd_set {
fd_mask_t fds_bits[((( 1024 )+(( (int)(sizeof(fd_mask_t) * 8 ) )-1))/( (int)(sizeof(fd_mask_t) * 8 ) )) ];
} fd_set;
# 1 "/usr/include/string.h" 1 3
extern "C" {
#ident "$Revision: 1.41 $"
# 48 "/usr/include/string.h" 3
extern void *memcpy(void *, const void *, size_t);
extern void *memmove(void *, const void *, size_t);
extern char *strcpy(char *, const char *);
extern char *strncpy(char *, const char *, size_t);
extern char *strcat(char *, const char *);
extern char *strncat(char *, const char *, size_t);
extern void *memccpy(void *, const void *, int, size_t);
extern int memcmp(const void *, const void *, size_t);
extern int strcmp(const char *, const char *);
extern int strcoll(const char *, const char *);
extern int strncmp(const char *, const char *, size_t);
extern size_t strxfrm(char *, const char *, size_t);
extern void *memchr(const void *, int, size_t);
extern char *strchr(const char *, int);
extern size_t strcspn(const char *, const char *);
#pragma int_to_unsigned strcspn
extern char *strpbrk(const char *, const char *);
extern char *strrchr(const char *, int);
extern size_t strspn(const char *, const char *);
#pragma int_to_unsigned strspn
extern char *strstr(const char *, const char *);
extern char *strtok(char *, const char *);
extern void *memset(void *, int, size_t);
extern char *strerror(int);
extern size_t strlen(const char *);
#pragma int_to_unsigned strlen
extern int ffs(int);
extern int strcasecmp(const char *, const char *);
extern int strncasecmp(const char *, const char *, size_t);
extern char *strdup(const char *);
extern char *strtok_r(char *, const char *, char **);
# 132 "/usr/include/string.h" 3
}
# 205 "/usr/include/string.h" 3
# 80 "/usr/include/sys/select.h" 2 3
# 91 "/usr/include/sys/select.h" 3
typedef long fd_mask;
}
# 44 "/usr/include/sys/bsd_types.h" 2 3
# 372 "/usr/include/sys/types.h" 2 3
typedef __uint64_t k_sigset_t;
# 497 "/usr/include/sys/types.h" 3
# 82 "/usr/include/sys/signal.h" 2 3
typedef void (*SIG_PF) (int );
# 1 "/usr/include/sys/sigevent.h" 1 3
#ident "$Revision: 1.8 $"
extern "C" {
typedef union sigval {
int sival_int;
void *sival_ptr;
} sigval_t;
typedef union notifyinfo {
int nisigno ;
void (* nifunc ) (sigval_t);
} notifyinfo_t;
typedef struct sigevent {
int sigev_notify;
notifyinfo_t sigev_notifyinfo;
sigval_t sigev_value;
void (*sigev_notify_function) (sigval_t);
pthread_attr_t *sigev_notify_attributes;
unsigned long sigev_reserved[11];
unsigned long sigev_pad[6];
} sigevent_t;
}
# 114 "/usr/include/sys/signal.h" 2 3
# 1 "/usr/include/sys/siginfo.h" 1 3
#ident "$Revision: 1.26 $"
extern "C" {
typedef struct __siginfo {
int si_signo;
int si_code;
int si_errno;
union {
int si_pad[((128 / sizeof(__int32_t)) - 3) ];
struct {
pid_t __pid;
union {
struct {
uid_t __uid;
} __kill;
struct {
clock_t __utime;
int __status;
clock_t __stime;
int __swap;
} __cld;
} __pdata;
} __proc;
struct {
void *__addr;
} __fault;
struct {
int __fd;
long __band;
} __file;
union sigval __value;
} __data;
} siginfo_t;
}
# 121 "/usr/include/sys/signal.h" 2 3
typedef struct {
__uint32_t __sigbits[4];
} sigset_t;
typedef union __sighandler {
void (*sa_handler1)(int );
void (*sa_sigaction1)(int, siginfo_t *, void *);
} __sighandler_t;
typedef struct sigaction {
int sa_flags;
__sighandler_t sa_sighandler;
sigset_t sa_mask;
int sa_resv[2];
} sigaction_t;
struct sigstack {
void *ss_sp;
int ss_onstack;
};
# 1 "/usr/include/sys/ucontext.h" 1 3
#ident "$Revision: 1.36 $"
extern "C" {
typedef struct _sigaltstack {
void *ss_sp;
size_t ss_size;
int ss_flags;
} stack_t;
# 119 "/usr/include/sys/ucontext.h" 3
typedef machreg_t greg_t;
typedef greg_t gregset_t[37 ];
typedef struct __fpregset {
union {
double __fp_dregs[32];
struct {
__uint32_t _fp_fill;
float _fp_fregs;
} __fp_fregs[32];
machreg_t __fp_regs[32];
} __fp_r;
__uint32_t __fp_csr;
__uint32_t __fp_pad;
} fpregset_t;
typedef struct {
gregset_t __gregs;
fpregset_t __fpregs;
} mcontext_t;
typedef struct __ucontext {
unsigned long uc_flags;
struct __ucontext *uc_link;
sigset_t uc_sigmask;
stack_t uc_stack;
mcontext_t uc_mcontext;
long uc_filler[49];
} ucontext_t;
# 223 "/usr/include/sys/ucontext.h" 3
# 328 "/usr/include/sys/ucontext.h" 3
}
# 216 "/usr/include/sys/signal.h" 2 3
# 265 "/usr/include/sys/signal.h" 3
extern void (*bsd_signal(int, void (*)(int)))(int);
extern int killpg(pid_t, int);
extern int sigstack(struct sigstack *, struct sigstack *);
extern void (*signal(int,void (*)(int )))(int );
typedef struct sigcontext {
__uint32_t sc_regmask;
__uint32_t sc_status;
__uint64_t sc_pc;
__uint64_t sc_regs[32];
__uint64_t sc_fpregs[32];
__uint32_t sc_ownedfp;
__uint32_t sc_fpc_csr;
__uint32_t sc_fpc_eir;
__uint32_t sc_ssflags;
__uint64_t sc_mdhi;
__uint64_t sc_mdlo;
__uint64_t sc_cause;
__uint64_t sc_badvaddr;
__uint64_t sc_triggersave;
sigset_t sc_sigset;
__uint64_t sc_fp_rounded_result;
__uint64_t sc_pad[31];
} sigcontext_t;
# 366 "/usr/include/sys/signal.h" 3
}
# 109 "/usr/include/signal.h" 2 3
typedef int sig_atomic_t;
extern int raise(int);
extern int kill(pid_t, int);
extern int sigaction(int, const struct sigaction *, struct sigaction *);
extern int sigpending(sigset_t *);
extern int sigprocmask(int, const sigset_t *, sigset_t *);
extern int sigsuspend(const sigset_t *);
extern int sigaddset(sigset_t *, int);
extern int sigdelset(sigset_t *, int);
extern int sigemptyset(sigset_t *);
extern int sigfillset(sigset_t *);
extern int sigismember(const sigset_t *, int);
# 1 "/usr/include/sys/timespec.h" 1 3
#ident "$Revision: 1.5 $"
extern "C" {
typedef struct timespec {
time_t tv_sec;
long tv_nsec;
} timespec_t;
}
# 136 "/usr/include/signal.h" 2 3
extern int sigqueue(pid_t , int, const union sigval);
extern int sigwaitinfo(const sigset_t *, siginfo_t *);
extern int sigtimedwait(const sigset_t *, siginfo_t *, const timespec_t *);
extern int sigwait(const sigset_t *, int *);
extern int pthread_kill(pthread_t, int);
extern int pthread_sigmask(int, const sigset_t *, sigset_t *);
extern int sigpause(int);
extern void (*sigset(int,void (*)(int )))(int );
extern int sighold(int);
extern int sigrelse(int);
extern int sigignore(int);
extern int siginterrupt(int, int);
extern int _sigaltstack (const stack_t *, stack_t *);
extern char *_sys_siglist[];
extern int _sys_nsig;
# 1 "/usr/include/sys/procset.h" 1 3
extern "C" {
#ident "$Revision: 1.11 $"
typedef enum idtype {
P_PID,
P_PPID,
P_PGID,
P_SID,
P_CID,
P_UID,
P_GID,
P_ALL
} idtype_t;
typedef enum idop {
POP_DIFF,
POP_AND,
POP_OR,
POP_XOR
} idop_t;
typedef struct procset {
idop_t p_op;
idtype_t p_lidtype;
id_t p_lid;
idtype_t p_ridtype;
id_t p_rid;
} procset_t;
}
# 180 "/usr/include/signal.h" 2 3
extern int (*ssignal(int, int (*)(int)))(int);
extern int gsignal(int);
extern int sigsend(idtype_t, id_t, int);
extern int sigsendset(const procset_t *, int);
extern int sgi_altersigs(int, sigset_t *, int[]);
extern int sgi_sigffset(sigset_t *, int);
extern int sgi_dumpset(sigset_t *);
}
# 6 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/csignal" 2 3
# 28 "sighandlers.cc" 2
# 1 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/include/new" 1 3
#pragma interface "new"
# 1 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/include/stddef.h" 1 3
# 61 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/include/stddef.h" 3
typedef int ptrdiff_t;
# 187 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/include/stddef.h" 3
# 268 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/include/stddef.h" 3
# 317 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/include/stddef.h" 3
# 8 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/include/new" 2 3
# 1 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/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 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/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; }
}
# 30 "sighandlers.cc" 2
# 1 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/iostream.h" 1 3
#pragma interface
# 1 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/streambuf.h" 1 3
#pragma interface
extern "C" {
# 1 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/libio.h" 1 3
# 1 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../mips-sgi-irix6.5/include/_G_config.h" 1 3
typedef int _G_int8_t __attribute__((__mode__(__QI__)));
typedef unsigned int _G_uint8_t __attribute__((__mode__(__QI__)));
typedef int _G_int16_t __attribute__((__mode__(__HI__)));
typedef unsigned int _G_uint16_t __attribute__((__mode__(__HI__)));
typedef int _G_int32_t __attribute__((__mode__(__SI__)));
typedef unsigned int _G_uint32_t __attribute__((__mode__(__SI__)));
typedef int _G_int64_t __attribute__((__mode__(__DI__)));
typedef unsigned int _G_uint64_t __attribute__((__mode__(__DI__)));
__extension__ typedef long long _G_llong;
__extension__ typedef unsigned long long _G_ullong;
typedef long _G_clock_t;
typedef unsigned long _G_dev_t;
typedef _G_llong _G_fpos_t;
typedef long _G_gid_t;
typedef _G_ullong _G_ino_t;
typedef unsigned long _G_mode_t;
typedef unsigned long _G_nlink_t;
typedef _G_llong _G_off_t;
typedef long _G_pid_t;
typedef int _G_ptrdiff_t;
typedef int _G_sigset_t;
typedef unsigned int _G_size_t;
typedef long _G_time_t;
typedef long _G_uid_t;
typedef long _G_wchar_t;
typedef int _G_ssize_t;
typedef unsigned int _G_wint_t;
typedef char * _G_va_list;
# 1 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/include/stddef.h" 1 3
# 19 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/include/stddef.h" 3
# 61 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/include/stddef.h" 3
# 126 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/include/stddef.h" 3
# 187 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/include/stddef.h" 3
# 268 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/include/stddef.h" 3
# 317 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/include/stddef.h" 3
# 86 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../mips-sgi-irix6.5/include/_G_config.h" 2 3
# 30 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/libio.h" 2 3
# 55 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/libio.h" 3
# 1 "/usr/include/sys/cdefs.h" 1 3
#ident "$Revision: 1.3 $"
# 59 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/libio.h" 2 3
# 104 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/libio.h" 3
struct _IO_jump_t; struct _IO_FILE;
# 174 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/libio.h" 3
typedef void _IO_lock_t;
struct _IO_marker {
struct _IO_marker *_next;
struct _IO_FILE *_sbuf;
int _pos;
# 207 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/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;
_G_off_t _offset;
unsigned short _cur_column;
char _unused;
char _shortbuf[1];
};
struct _IO_FILE_plus;
extern struct _IO_FILE_plus _IO_stdin_, _IO_stdout_, _IO_stderr_;
typedef struct
{
_G_ssize_t (*read) (struct _IO_FILE *, void *, _G_ssize_t ) ;
_G_ssize_t (*write) (struct _IO_FILE *, const void *, _G_ssize_t ) ;
_G_fpos_t (*seek) (struct _IO_FILE *, _G_off_t , int) ;
int (*close) (struct _IO_FILE *) ;
} _IO_cookie_io_functions_t;
struct _IO_cookie_file
{
struct _IO_FILE file;
const void *vtable;
void *cookie;
_IO_cookie_io_functions_t io_functions;
};
extern "C" {
extern int __underflow (_IO_FILE *) ;
extern int __uflow (_IO_FILE *) ;
extern int __overflow (_IO_FILE *, int) ;
extern int _IO_getc (_IO_FILE *__fp) ;
extern int _IO_putc (int __c, _IO_FILE *__fp) ;
extern int _IO_feof (_IO_FILE *__fp) ;
extern int _IO_ferror (_IO_FILE *__fp) ;
extern int _IO_peekc_locked (_IO_FILE *__fp) ;
extern void _IO_flockfile (_IO_FILE *) ;
extern void _IO_funlockfile (_IO_FILE *) ;
extern int _IO_ftrylockfile (_IO_FILE *) ;
extern int _IO_vfscanf (_IO_FILE *, const char *, _G_va_list , int *) ;
extern int _IO_vfprintf (_IO_FILE *, const char *, _G_va_list ) ;
extern _G_ssize_t _IO_padn (_IO_FILE *, int, _G_ssize_t ) ;
extern _G_size_t _IO_sgetn (_IO_FILE *, void *, _G_size_t ) ;
extern _G_fpos_t _IO_seekoff (_IO_FILE *, _G_off_t , int, int) ;
extern _G_fpos_t _IO_seekpos (_IO_FILE *, _G_fpos_t , int) ;
extern void _IO_free_backup_area (_IO_FILE *) ;
}
# 36 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/streambuf.h" 2 3
}
extern "C++" {
class istream;
class ostream; class streambuf;
typedef _G_off_t streamoff;
typedef _G_fpos_t streampos;
typedef _G_ssize_t streamsize;
typedef unsigned long __fmtflags;
typedef unsigned char __iostate;
struct _ios_fields
{
streambuf *_strbuf;
ostream* _tie;
int _width;
__fmtflags _flags;
short _fill;
__iostate _state;
__iostate _exceptions;
int _precision;
void *_arrays;
};
# 124 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/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 _G_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 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/streambuf.h" 3
ostream* tie() const { return _tie; }
ostream* tie(ostream* val) { ostream* save=_tie; _tie=val; return save; }
short fill() const { return _fill; }
short fill(short newf)
{short 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, _G_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, _G_va_list ap, ios* stream = __null );
int scan(char const *fmt0 ...);
int vform(char const *fmt0, _G_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*);
};
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 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/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, _G_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) { return operator<<((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:
_G_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();
_G_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, _G_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; }
}
# 32 "sighandlers.cc" 2
# 1 "/usr/include/unistd.h" 1 3
extern "C" {
#ident "$Revision: 1.137 $"
# 1 "/usr/include/sys/unistd.h" 1 3
# 189 "/usr/include/sys/unistd.h" 3
# 278 "/usr/include/unistd.h" 2 3
extern int access(const char *, int);
extern unsigned alarm(unsigned);
extern int chdir(const char *);
extern int chown(const char *, uid_t, gid_t);
extern int close(int);
extern char *ctermid(char *);
extern char *cuserid(char *);
extern int dup(int);
extern int dup2(int, int);
extern int execl(const char *, const char *, ...);
extern int execle(const char *, const char *, ...);
extern int execlp(const char *, const char *, ...);
extern int execv(const char *, char *const *);
extern int execve(const char *, char *const *, char *const *);
extern int execvp(const char *, char *const *);
extern void _exit(int);
extern pid_t fork(void);
extern long fpathconf(int, int);
extern char *getcwd(char *, size_t);
extern gid_t getegid(void);
extern uid_t geteuid(void);
extern gid_t getgid(void);
extern int getgroups(int, gid_t *);
extern char *getlogin(void);
extern pid_t getpgrp(void);
extern pid_t getpid(void);
extern pid_t getppid(void);
extern uid_t getuid(void);
extern int isatty(int);
extern int link(const char *, const char *);
extern int linkfollow(const char *, const char *);
# 334 "/usr/include/unistd.h" 3
extern off_t lseek(int, off_t, int);
extern long pathconf(const char *, int);
extern int pause(void);
extern int pipe(int *);
extern ssize_t read(int, void *, size_t);
extern int rmdir(const char *);
extern int setgid(gid_t);
extern int setpgid(pid_t, pid_t);
extern pid_t setsid(void);
extern int setuid(uid_t);
extern unsigned sleep(unsigned);
extern long sysconf(int);
extern pid_t tcgetpgrp(int);
extern int tcsetpgrp(int, pid_t);
extern char *ttyname(int);
extern int unlink(const char *);
extern ssize_t write(int, const void *, size_t);
extern int fdatasync(int);
extern int fsync(int);
extern int ftruncate(int, off_t);
extern int getlogin_r(char *, size_t);
extern int ttyname_r(int, char *, size_t);
extern int pthread_atfork(void (*)(void), void (*)(void), void (*)(void));
extern size_t confstr(int, char *, size_t);
extern int chroot(const char *);
extern int nice(int);
extern char *crypt(const char *, const char *);
extern void encrypt(char *, int);
extern char *getpass(const char *);
extern void swab(const void *, void *, ssize_t);
extern int brk(void *);
extern int fchown(int, uid_t, gid_t);
extern int fchdir(int);
extern int getdtablesize(void);
extern long gethostid(void);
extern int gethostname(char *, size_t);
extern int getpagesize(void);
extern pid_t getpgid(pid_t);
extern pid_t getsid(pid_t);
extern char *getwd(char *);
extern int lchown(const char *, uid_t, gid_t);
extern int lockf(int, int, off_t);
extern int readlink(const char *, char *, size_t);
extern void *sbrk(ssize_t);
extern pid_t setpgrp(void);
extern int setregid(gid_t, gid_t);
# 439 "/usr/include/unistd.h" 3
extern int setreuid(uid_t, uid_t);
extern int symlink(const char *, const char *);
extern void sync(void);
extern int truncate(const char *, off_t);
extern useconds_t ualarm(useconds_t, useconds_t);
extern int usleep(useconds_t);
extern ssize_t pread(int, void *, size_t, off_t);
extern ssize_t pwrite(int, const void *, size_t, off_t);
struct timeval;
extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
# 1 "/usr/include/sys/uio.h" 1 3
#ident "@(#)uts-3b2:io/uio.h 1.2"
#ident "$Revision: 1.22 $"
extern "C" {
typedef struct iovec {
void *iov_base;
size_t iov_len;
} iovec_t;
extern ssize_t readv(int, const struct iovec *, int);
extern ssize_t writev(int, const struct iovec *, int);
# 87 "/usr/include/sys/uio.h" 3
}
# 480 "/usr/include/unistd.h" 2 3
# 1 "/usr/include/utime.h" 1 3
extern "C" {
#ident "$Revision: 1.9 $"
# 1 "/usr/include/sys/utime.h" 1 3
struct utimbuf {
time_t actime;
time_t modtime;
};
# 34 "/usr/include/utime.h" 2 3
extern int utime(const char *, const struct utimbuf *);
}
# 481 "/usr/include/unistd.h" 2 3
# 1 "/usr/include/re_comp.h" 1 3
extern "C" {
#ident "$Revision: 1.1 $"
extern char *re_comp(const char *);
extern int re_exec(const char *);
}
# 482 "/usr/include/unistd.h" 2 3
extern int acct(const char *);
extern void exit(int);
extern char *gettxt(const char *, const char *);
extern int profil(unsigned short *, unsigned int, unsigned int, unsigned int);
extern int ptrace(int, pid_t, int, int);
extern int rename(const char *, const char *);
extern int seteuid(uid_t);
extern int setegid(gid_t);
extern int stime(const time_t *);
extern off_t tell(int);
struct acct_spi;
extern int atfork_child(void (*func)(void));
extern int atfork_child_prepend(void (*func)(void));
extern int atfork_parent(void (*func)(int, int));
extern int atfork_pre(void (*func)(void));
extern int atsproc_child(void (*func)(void));
extern int atsproc_parent(void (*func)(int, int));
extern int atsproc_pre(void (*func)(unsigned int));
extern void bset(char *, bitnum_t);
extern void bclr(char *, bitnum_t);
extern int btst(char *, bitnum_t);
extern void bfset(char *, bitnum_t, bitlen_t);
extern void bfclr(char *, bitnum_t, bitlen_t);
extern bitlen_t bftstset(char *, bitnum_t, bitlen_t);
extern bitlen_t bftstclr(char *, bitnum_t, bitlen_t);
extern int BSDchown(const char *, uid_t, gid_t);
extern int BSDdup2(int, int);
extern int BSDfchown(int, uid_t, gid_t);
extern int BSDgetpgrp(int);
extern int BSDsetpgrp(int, int);
extern int BSDsetgroups(int, int *);
extern int BSDgetgroups(int, int *);
extern int _daemonize(int, int, int, int);
extern ash_t getash(void);
extern int getdtablehi(void);
extern int getdomainname(char *, int);
extern prid_t getprid(void);
extern char *_getpty(int *, int, mode_t, int);
extern int getspinfo(struct acct_spi *);
extern int mincore(caddr_t, size_t, char *);
extern int mpin(void *, size_t);
extern int munpin(void *, size_t);
extern int newarraysess(void);
extern pid_t pcreatel(const char *, const char *, ...);
extern pid_t pcreatelp(const char *, const char *, ...);
extern pid_t pcreatev(const char *, char *const *);
extern pid_t pcreateve(const char *, char *const *, char *const *);
extern pid_t pcreatevp(const char *, char *const *);
extern ssize_t pread64(int, void *, size_t, off64_t);
extern ssize_t pwrite64(int, const void *, size_t, off64_t);
extern int rexecl(cell_t, const char *, const char *, ...);
extern int rexecle(cell_t, const char *, const char *, ...);
extern int rexeclp(cell_t, const char *, const char *, ...);
extern int rexecv(cell_t, const char *, char *const *);
extern int rexecve(cell_t, const char *, char *const *, char *const *);
extern int rexecvp(cell_t, const char *, char *const *);
extern float _sqrt_s(float);
extern double _sqrt_d(double);
extern int setash(ash_t);
extern int setdomainname(const char *, int);
extern int setgroups(int, const gid_t *);
extern int sethostid(int);
extern int sethostname(const char *, int);
extern int setprid(prid_t);
extern int setrgid(gid_t);
extern int setruid(uid_t);
extern int setspinfo(struct acct_spi *);
extern int sgikopt(const char *, char *, int);
extern long sginap(long);
extern off64_t tell64(int);
extern int vhangup(void);
extern int fattach(int, const char *);
extern int fdetach(const char *);
extern int ioctl(int, int, ...);
extern int ftruncate64(int, off64_t);
extern int lockf64(int, int, off64_t);
extern off64_t lseek64(int, off64_t, int);
extern int truncate64(const char *, off64_t);
}
# 38 "sighandlers.cc" 2
# 1 "error.h" 1
class ostrstream;
extern void message (const char *name, const char *fmt, ...);
extern void usage (const char *fmt, ...);
extern void warning (const char *fmt, ...);
extern void error (const char *fmt, ...);
extern void parse_error (const char *fmt, ...);
extern void panic (const char *fmt, ...) __attribute__ ((__noreturn__)) ;
extern int error_state;
extern int buffer_error_messages;
extern ostrstream *error_message_buffer;
extern void symbols_of_error (void);
# 41 "sighandlers.cc" 2
# 1 "input.h" 1
# 1 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/cstdio" 1 3
# 1 "/usr/include/stdio.h" 1 3
extern "C" {
#ident "$Revision: 1.75 $"
# 48 "/usr/include/stdio.h" 3
# 59 "/usr/include/stdio.h" 3
typedef __int64_t fpos_t;
# 86 "/usr/include/stdio.h" 3
typedef __int64_t fpos64_t;
typedef char *va_list;
# 140 "/usr/include/stdio.h" 3
typedef struct
__file_s
{
int _cnt;
unsigned char *_ptr;
unsigned char *_base;
unsigned char _flag;
unsigned char _o_file;
unsigned short _file;
} FILE;
extern FILE __iob[100 ];
extern FILE *_lastbuf;
extern unsigned char *_bufendtab[];
extern unsigned char _sibuf[], _sobuf[];
extern int remove(const char *);
extern int rename(const char *, const char *);
extern FILE *tmpfile(void);
extern char *tmpnam(char *);
extern int fclose(FILE *);
extern int fflush(FILE *);
extern FILE *fopen(const char *, const char *);
extern FILE *freopen(const char *, const char *, FILE *);
extern void setbuf(FILE *, char *);
extern int setvbuf(FILE *, char *, int, size_t);
extern int fprintf(FILE *, const char *, ...);
extern int fscanf(FILE *, const char *, ...);
extern int printf(const char *, ...);
extern int scanf(const char *, ...);
extern int snprintf(char *, ssize_t, const char *, ...);
extern int sprintf(char *, const char *, ...);
extern int sscanf(const char *, const char *, ...);
extern int vfprintf(FILE *, const char *, char *);
extern int vprintf(const char *, char *);
extern int vsnprintf(char *, ssize_t, const char *, char *);
extern int vsprintf(char *, const char *, char *);
# 256 "/usr/include/stdio.h" 3
extern int fgetc(FILE *);
extern char *fgets(char *, int, FILE *);
extern int fputc(int, FILE *);
extern int fputs(const char *, FILE *);
extern int getc(FILE *);
extern int getchar(void);
extern char *gets(char *);
extern int putc(int, FILE *);
extern int putchar(int);
extern int puts(const char *);
extern int ungetc(int, FILE *);
extern size_t fread(void *, size_t, size_t, FILE *);
#pragma int_to_unsigned fread
extern size_t fwrite(const void *, size_t, size_t, FILE *);
#pragma int_to_unsigned fwrite
extern int fgetpos(FILE *, fpos_t *);
extern int fseek(FILE *, long, int);
extern int fsetpos(FILE *, const fpos_t *);
extern long ftell(FILE *);
extern void rewind(FILE *);
extern void clearerr(FILE *);
extern int feof(FILE *);
extern int ferror(FILE *);
extern void perror(const char *);
extern int __filbuf(FILE *);
extern int __flsbuf(int, FILE *);
extern FILE *fdopen(int, const char *);
extern int fileno(FILE *);
extern void flockfile(FILE *);
extern int ftrylockfile(FILE *);
extern void funlockfile(FILE *);
extern int getc_unlocked(FILE *);
extern int putc_unlocked(int, FILE *);
extern int getchar_unlocked(void);
extern int putchar_unlocked(int);
extern FILE *popen(const char *, const char *);
extern int pclose(FILE *);
extern char *ctermid(char *);
extern char *cuserid(char *);
extern char *tempnam(const char *, const char *);
extern int getw(FILE *);
extern int putw(int, FILE *);
extern char *mktemp(char *);
extern int mkstemp(char *);
extern int setbuffer(FILE *, char *, int);
extern int setlinebuf(FILE *);
extern int system(const char *);
extern off_t ftello(FILE *);
extern int fseeko(FILE *, off_t, int);
extern int fgetpos64(FILE *, fpos64_t *);
extern FILE *fopen64(const char *, const char *);
extern FILE *freopen64(const char *, const char *, FILE *);
extern int fseek64(FILE *, __int64_t, int);
extern int fseeko64(FILE *, off64_t, int);
extern int fsetpos64(FILE *, const fpos64_t *);
extern __int64_t ftell64(FILE *);
extern off64_t ftello64(FILE *);
extern FILE *tmpfile64(void);
extern int __semputc(int, FILE *);
extern int __semgetc(FILE *);
extern int __us_rsthread_stdio;
extern char *ctermid_r(char *);
# 447 "/usr/include/stdio.h" 3
}
# 6 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/cstdio" 2 3
# 28 "input.h" 2
# 1 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/string" 1 3
# 1 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/std/bastring.h" 1 3
#pragma interface
# 1 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/cstddef" 1 3
# 1 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/include/stddef.h" 1 3
# 342 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/include/stddef.h" 3
# 6 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/cstddef" 2 3
# 35 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/std/bastring.h" 2 3
# 1 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/std/straits.h" 1 3
#pragma interface "std/straits.h"
extern "C++" {
template <class charT>
struct string_char_traits {
typedef charT char_type;
static void assign (char_type& c1, const char_type& c2)
{ c1 = c2; }
static bool eq (const char_type& c1, const char_type& c2)
{ return (c1 == c2); }
static bool ne (const char_type& c1, const char_type& c2)
{ return !(c1 == c2); }
static bool lt (const char_type& c1, const char_type& c2)
{ return (c1 < c2); }
static char_type eos () { return char_type(); }
static bool is_del(char_type a) { return 0; }
static int compare (const char_type* s1, const char_type* s2, size_t n)
{
size_t i;
for (i = 0; i < n; ++i)
if (ne (s1[i], s2[i]))
return lt (s1[i], s2[i]) ? -1 : 1;
return 0;
}
static size_t length (const char_type* s)
{
size_t l = 0;
while (ne (*s++, eos ()))
++l;
return l;
}
static char_type* copy (char_type* s1, const char_type* s2, size_t n)
{
for (; n--; )
assign (s1[n], s2[n]);
return s1;
}
static char_type* move (char_type* s1, const char_type* s2, size_t n)
{
char_type a[n];
size_t i;
for (i = 0; i < n; ++i)
assign (a[i], s2[i]);
for (i = 0; i < n; ++i)
assign (s1[i], a[i]);
return s1;
}
static char_type* set (char_type* s1, const char_type& c, size_t n)
{
for (; n--; )
assign (s1[n], c);
return s1;
}
};
class istream;
class ostream;
# 1 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/cctype" 1 3
# 1 "/usr/include/ctype.h" 1 3
extern "C" {
#ident "$Revision: 1.29 $"
extern int isalnum(int);
extern int isalpha(int);
extern int iscntrl(int);
extern int isdigit(int);
extern int isgraph(int);
extern int islower(int);
extern int isprint(int);
extern int ispunct(int);
extern int isspace(int);
extern int __isblank(int);
extern int isupper(int);
extern int isxdigit(int);
extern int tolower(int);
extern int toupper(int);
extern int isascii(int);
extern int toascii(int);
extern int _tolower(int);
extern int _toupper(int);
# 143 "/usr/include/ctype.h" 3
}
# 6 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/cctype" 2 3
# 105 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/std/straits.h" 2 3
# 1 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/cstring" 1 3
# 94 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/cstring" 3
# 106 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/std/straits.h" 2 3
struct string_char_traits <char> {
typedef char char_type;
static void assign (char_type& c1, const char_type& c2)
{ c1 = c2; }
static bool eq (const char_type & c1, const char_type& c2)
{ return (c1 == c2); }
static bool ne (const char_type& c1, const char_type& c2)
{ return (c1 != c2); }
static bool lt (const char_type& c1, const char_type& c2)
{ return (c1 < c2); }
static char_type eos () { return 0; }
static bool is_del(char_type a) { return ((__libc_attr._ctype_tbl->_class+1)[ a ] & (0x00000008 | 0x80000000 ) ) ; }
static int compare (const char_type* s1, const char_type* s2, size_t n)
{ return memcmp (s1, s2, n); }
static size_t length (const char_type* s)
{ return strlen (s); }
static char_type* copy (char_type* s1, const char_type* s2, size_t n)
{ return (char_type*) memcpy (s1, s2, n); }
static char_type* move (char_type* s1, const char_type* s2, size_t n)
{ return (char_type*) memmove (s1, s2, n); }
static char_type* set (char_type* s1, const char_type& c, size_t n)
{ return (char_type*) memset (s1, c, n); }
};
# 159 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/std/straits.h" 3
}
# 36 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/std/bastring.h" 2 3
# 1 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/alloc.h" 1 3
# 1 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/stl_config.h" 1 3
# 148 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/stl_config.h" 3
# 178 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/stl_config.h" 3
# 234 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/stl_config.h" 3
# 248 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/stl_config.h" 3
# 316 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/stl_config.h" 3
# 18 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/alloc.h" 2 3
# 1 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/stl_alloc.h" 1 3
# 1 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/include/stddef.h" 1 3
# 342 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/include/stddef.h" 3
# 53 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/stl_alloc.h" 2 3
# 1 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../mips-sgi-irix6.5/include/assert.h" 1 3
# 19 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../mips-sgi-irix6.5/include/assert.h" 3
extern "C" {
extern void __eprintf (const char *, const char *, unsigned, const char *)
__attribute__ ((noreturn));
}
# 52 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../mips-sgi-irix6.5/include/assert.h" 3
# 56 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/stl_alloc.h" 2 3
# 78 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/stl_alloc.h" 3
# 87 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/stl_alloc.h" 3
# 97 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/stl_alloc.h" 3
# 115 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/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 : (__eprintf ("%s:%u: failed assertion `%s'\n", "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/stl_alloc.h" , 263 , "*(size_t*)__real_p == __n" ), 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 : (__eprintf ("%s:%u: failed assertion `%s'\n", "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/stl_alloc.h" , 270 , "*(size_t*)__real_p == __old_sz" ), 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* _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;
# 389 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/stl_alloc.h" 3
class _Lock {
public:
_Lock() { ; }
~_Lock() { ; }
};
friend class _Lock;
public:
static void* allocate(size_t __n)
{
_Obj* * __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);
__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* * __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);
__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< false , 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* * __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* * __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* * __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);
}
# 602 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/stl_alloc.h" 3
# 689 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/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*
__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() {}
allocator(const allocator&) {}
template <class _Tp1> allocator(const allocator<_Tp1>&) {}
~allocator() {}
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
{ 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() {}
__allocator(const __allocator& __a)
: __underlying_alloc(__a.__underlying_alloc) {}
template <class _Tp1>
__allocator(const __allocator<_Tp1, _Alloc>& __a)
: __underlying_alloc(__a.__underlying_alloc) {}
~__allocator() {}
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
{ 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;
};
# 21 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/alloc.h" 2 3
# 40 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/alloc.h" 3
# 39 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/std/bastring.h" 2 3
extern "C++" {
class istream; class ostream;
# 1 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/iterator" 1 3
# 1 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/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);
}
# 31 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/iterator" 2 3
# 1 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/include/stddef.h" 1 3
# 342 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/include/stddef.h" 3
# 32 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/iterator" 2 3
# 1 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/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 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/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 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/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 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/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 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/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 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/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 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/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 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/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 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/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 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/stl_iterator.h" 3
# 38 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/iterator" 2 3
# 44 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/std/bastring.h" 2 3
# 56 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/std/bastring.h" 3
# 1 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/cassert" 1 3
# 1 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../mips-sgi-irix6.5/include/assert.h" 1 3
# 19 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../mips-sgi-irix6.5/include/assert.h" 3
extern "C" {
extern void __eprintf (const char *, const char *, unsigned, const char *)
__attribute__ ((noreturn));
}
# 52 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../mips-sgi-irix6.5/include/assert.h" 3
# 6 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/cassert" 2 3
# 58 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/std/bastring.h" 2 3
template <class charT, class traits = string_char_traits<charT>,
class Allocator = alloc >
class basic_string
{
private:
struct Rep {
size_t len, res, ref;
bool selfish;
charT* data () { return reinterpret_cast<charT *>(this + 1); }
charT& operator[] (size_t s) { return data () [s]; }
charT* grab () { if (selfish) return clone (); ++ref; return data (); }
# 108 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/std/bastring.h" 3
void release () { if (--ref == 0) delete this; }
inline static void * operator new (size_t, size_t);
inline static void operator delete (void *);
inline static Rep* create (size_t);
charT* clone ();
inline void copy (size_t, const charT *, size_t);
inline void move (size_t, const charT *, size_t);
inline void set (size_t, const charT, size_t);
inline static bool excess_slop (size_t, size_t);
inline static size_t frob_size (size_t);
private:
Rep &operator= (const Rep &);
};
public:
typedef traits traits_type;
typedef typename traits::char_type value_type;
typedef Allocator allocator_type;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef charT& reference;
typedef const charT& const_reference;
typedef charT* pointer;
typedef const charT* const_pointer;
typedef pointer iterator;
typedef const_pointer const_iterator;
typedef ::reverse_iterator<iterator> reverse_iterator;
typedef ::reverse_iterator<const_iterator> const_reverse_iterator;
static const size_type npos = static_cast<size_type>(-1);
private:
Rep *rep () const { return reinterpret_cast<Rep *>(dat) - 1; }
void repup (Rep *p) { rep ()->release (); dat = p->data (); }
public:
const charT* data () const
{ return rep ()->data(); }
size_type length () const
{ return rep ()->len; }
size_type size () const
{ return rep ()->len; }
size_type capacity () const
{ return rep ()->res; }
size_type max_size () const
{ return (npos - 1)/sizeof (charT); }
bool empty () const
{ return size () == 0; }
basic_string& operator= (const basic_string& str)
{
if (&str != this) { rep ()->release (); dat = str.rep ()->grab (); }
return *this;
}
explicit basic_string (): dat (nilRep.grab ()) { }
basic_string (const basic_string& str): dat (str.rep ()->grab ()) { }
basic_string (const basic_string& str, size_type pos, size_type n = npos)
: dat (nilRep.grab ()) { assign (str, pos, n); }
basic_string (const charT* s, size_type n)
: dat (nilRep.grab ()) { assign (s, n); }
basic_string (const charT* s)
: dat (nilRep.grab ()) { assign (s); }
basic_string (size_type n, charT c)
: dat (nilRep.grab ()) { assign (n, c); }
template<class InputIterator>
basic_string(InputIterator begin, InputIterator end)
: dat (nilRep.grab ()) { assign (begin, end); }
~basic_string ()
{ rep ()->release (); }
void swap (basic_string &s) { charT *d = dat; dat = s.dat; s.dat = d; }
basic_string& append (const basic_string& str, size_type pos = 0,
size_type n = npos)
{ return replace (length (), 0, str, pos, n); }
basic_string& append (const charT* s, size_type n)
{ return replace (length (), 0, s, n); }
basic_string& append (const charT* s)
{ return append (s, traits::length (s)); }
basic_string& append (size_type n, charT c)
{ return replace (length (), 0, n, c); }
template<class InputIterator>
basic_string& append(InputIterator first, InputIterator last)
{ return replace (iend (), iend (), first, last); }
basic_string& assign (const basic_string& str, size_type pos = 0,
size_type n = npos)
{ return replace (0, npos, str, pos, n); }
basic_string& assign (const charT* s, size_type n)
{ return replace (0, npos, s, n); }
basic_string& assign (const charT* s)
{ return assign (s, traits::length (s)); }
basic_string& assign (size_type n, charT c)
{ return replace (0, npos, n, c); }
template<class InputIterator>
basic_string& assign(InputIterator first, InputIterator last)
{ return replace (ibegin (), iend (), first, last); }
basic_string& operator= (const charT* s)
{ return assign (s); }
basic_string& operator= (charT c)
{ return assign (1, c); }
basic_string& operator+= (const basic_string& rhs)
{ return append (rhs); }
basic_string& operator+= (const charT* s)
{ return append (s); }
basic_string& operator+= (charT c)
{ return append (1, c); }
basic_string& insert (size_type pos1, const basic_string& str,
size_type pos2 = 0, size_type n = npos)
{ return replace (pos1, 0, str, pos2, n); }
basic_string& insert (size_type pos, const charT* s, size_type n)
{ return replace (pos, 0, s, n); }
basic_string& insert (size_type pos, const charT* s)
{ return insert (pos, s, traits::length (s)); }
basic_string& insert (size_type pos, size_type n, charT c)
{ return replace (pos, 0, n, c); }
iterator insert(iterator p, charT c)
{ size_type __o = p - ibegin ();
insert (p - ibegin (), 1, c); selfish ();
return ibegin () + __o; }
iterator insert(iterator p, size_type n, charT c)
{ size_type __o = p - ibegin ();
insert (p - ibegin (), n, c); selfish ();
return ibegin () + __o; }
template<class InputIterator>
void insert(iterator p, InputIterator first, InputIterator last)
{ replace (p, p, first, last); }
basic_string& erase (size_type pos = 0, size_type n = npos)
{ return replace (pos, n, (size_type)0, (charT)0); }
iterator erase(iterator p)
{ size_type __o = p - begin();
replace (__o, 1, (size_type)0, (charT)0); selfish ();
return ibegin() + __o; }
iterator erase(iterator f, iterator l)
{ size_type __o = f - ibegin();
replace (__o, l-f, (size_type)0, (charT)0);selfish ();
return ibegin() + __o; }
basic_string& replace (size_type pos1, size_type n1, const basic_string& str,
size_type pos2 = 0, size_type n2 = npos);
basic_string& replace (size_type pos, size_type n1, const charT* s,
size_type n2);
basic_string& replace (size_type pos, size_type n1, const charT* s)
{ return replace (pos, n1, s, traits::length (s)); }
basic_string& replace (size_type pos, size_type n1, size_type n2, charT c);
basic_string& replace (size_type pos, size_type n, charT c)
{ return replace (pos, n, 1, c); }
basic_string& replace (iterator i1, iterator i2, const basic_string& str)
{ return replace (i1 - ibegin (), i2 - i1, str); }
basic_string& replace (iterator i1, iterator i2, const charT* s, size_type n)
{ return replace (i1 - ibegin (), i2 - i1, s, n); }
basic_string& replace (iterator i1, iterator i2, const charT* s)
{ return replace (i1 - ibegin (), i2 - i1, s); }
basic_string& replace (iterator i1, iterator i2, size_type n, charT c)
{ return replace (i1 - ibegin (), i2 - i1, n, c); }
template<class InputIterator>
basic_string& replace(iterator i1, iterator i2,
InputIterator j1, InputIterator j2);
private:
static charT eos () { return traits::eos (); }
void unique () { if (rep ()->ref > 1) alloc (length (), true); }
void selfish () { unique (); rep ()->selfish = true; }
public:
charT operator[] (size_type pos) const
{
if (pos == length ())
return eos ();
return data ()[pos];
}
reference operator[] (size_type pos)
{ selfish (); return (*rep ())[pos]; }
reference at (size_type pos)
{
((void) (( !( pos >= length () ) ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/std/bastring.h" , 320 , "!(pos >= length ())" ), 0) )) ;
return (*this)[pos];
}
const_reference at (size_type pos) const
{
((void) (( !( pos >= length () ) ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/std/bastring.h" , 325 , "!(pos >= length ())" ), 0) )) ;
return data ()[pos];
}
private:
void terminate () const
{ traits::assign ((*rep ())[length ()], eos ()); }
public:
const charT* c_str () const
{ if (length () == 0) return ""; terminate (); return data (); }
void resize (size_type n, charT c);
void resize (size_type n)
{ resize (n, eos ()); }
void reserve (size_type) { }
size_type copy (charT* s, size_type n, size_type pos = 0) const;
size_type find (const basic_string& str, size_type pos = 0) const
{ return find (str.data(), pos, str.length()); }
size_type find (const charT* s, size_type pos, size_type n) const;
size_type find (const charT* s, size_type pos = 0) const
{ return find (s, pos, traits::length (s)); }
size_type find (charT c, size_type pos = 0) const;
size_type rfind (const basic_string& str, size_type pos = npos) const
{ return rfind (str.data(), pos, str.length()); }
size_type rfind (const charT* s, size_type pos, size_type n) const;
size_type rfind (const charT* s, size_type pos = npos) const
{ return rfind (s, pos, traits::length (s)); }
size_type rfind (charT c, size_type pos = npos) const;
size_type find_first_of (const basic_string& str, size_type pos = 0) const
{ return find_first_of (str.data(), pos, str.length()); }
size_type find_first_of (const charT* s, size_type pos, size_type n) const;
size_type find_first_of (const charT* s, size_type pos = 0) const
{ return find_first_of (s, pos, traits::length (s)); }
size_type find_first_of (charT c, size_type pos = 0) const
{ return find (c, pos); }
size_type find_last_of (const basic_string& str, size_type pos = npos) const
{ return find_last_of (str.data(), pos, str.length()); }
size_type find_last_of (const charT* s, size_type pos, size_type n) const;
size_type find_last_of (const charT* s, size_type pos = npos) const
{ return find_last_of (s, pos, traits::length (s)); }
size_type find_last_of (charT c, size_type pos = npos) const
{ return rfind (c, pos); }
size_type find_first_not_of (const basic_string& str, size_type pos = 0) const
{ return find_first_not_of (str.data(), pos, str.length()); }
size_type find_first_not_of (const charT* s, size_type pos, size_type n) const;
size_type find_first_not_of (const charT* s, size_type pos = 0) const
{ return find_first_not_of (s, pos, traits::length (s)); }
size_type find_first_not_of (charT c, size_type pos = 0) const;
size_type find_last_not_of (const basic_string& str, size_type pos = npos) const
{ return find_last_not_of (str.data(), pos, str.length()); }
size_type find_last_not_of (const charT* s, size_type pos, size_type n) const;
size_type find_last_not_of (const charT* s, size_type pos = npos) const
{ return find_last_not_of (s, pos, traits::length (s)); }
size_type find_last_not_of (charT c, size_type pos = npos) const;
basic_string substr (size_type pos = 0, size_type n = npos) const
{ return basic_string (*this, pos, n); }
int compare (const basic_string& str, size_type pos = 0, size_type n = npos) const;
int compare (const charT* s, size_type pos, size_type n) const;
int compare (const charT* s, size_type pos = 0) const
{ return compare (s, pos, traits::length (s)); }
iterator begin () { selfish (); return &(*this)[0]; }
iterator end () { selfish (); return &(*this)[length ()]; }
private:
iterator ibegin () const { return &(*rep ())[0]; }
iterator iend () const { return &(*rep ())[length ()]; }
public:
const_iterator begin () const { return ibegin (); }
const_iterator end () const { return iend (); }
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 ()); }
private:
void alloc (size_type size, bool save);
static size_type _find (const charT* ptr, charT c, size_type xpos, size_type len);
inline bool check_realloc (size_type s) const;
static Rep nilRep;
charT *dat;
};
template <class charT, class traits, class Allocator> template <class InputIterator>
basic_string <charT, traits, Allocator>& basic_string <charT, traits, Allocator>::
replace (iterator i1, iterator i2, InputIterator j1, InputIterator j2)
{
const size_type len = length ();
size_type pos = i1 - ibegin ();
size_type n1 = i2 - i1;
size_type n2 = j2 - j1;
((void) (( !( pos > len ) ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/std/bastring.h" , 438 , "!(pos > len)" ), 0) )) ;
if (n1 > len - pos)
n1 = len - pos;
((void) (( !( len - n1 > max_size () - n2 ) ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/std/bastring.h" , 441 , "!(len - n1 > max_size () - n2)" ), 0) )) ;
size_t newlen = len - n1 + n2;
if (check_realloc (newlen))
{
Rep *p = Rep::create (newlen);
p->copy (0, data (), pos);
p->copy (pos + n2, data () + pos + n1, len - (pos + n1));
for (; j1 != j2; ++j1, ++pos)
traits::assign ((*p)[pos], *j1);
repup (p);
}
else
{
rep ()->move (pos + n2, data () + pos + n1, len - (pos + n1));
for (; j1 != j2; ++j1, ++pos)
traits::assign ((*rep ())[pos], *j1);
}
rep ()->len = newlen;
return *this;
}
template <class charT, class traits, class Allocator>
inline basic_string <charT, traits, Allocator>
operator+ (const basic_string <charT, traits, Allocator>& lhs,
const basic_string <charT, traits, Allocator>& rhs)
{
basic_string <charT, traits, Allocator> str (lhs);
str.append (rhs);
return str;
}
template <class charT, class traits, class Allocator>
inline basic_string <charT, traits, Allocator>
operator+ (const charT* lhs, const basic_string <charT, traits, Allocator>& rhs)
{
basic_string <charT, traits, Allocator> str (lhs);
str.append (rhs);
return str;
}
template <class charT, class traits, class Allocator>
inline basic_string <charT, traits, Allocator>
operator+ (charT lhs, const basic_string <charT, traits, Allocator>& rhs)
{
basic_string <charT, traits, Allocator> str (1, lhs);
str.append (rhs);
return str;
}
template <class charT, class traits, class Allocator>
inline basic_string <charT, traits, Allocator>
operator+ (const basic_string <charT, traits, Allocator>& lhs, const charT* rhs)
{
basic_string <charT, traits, Allocator> str (lhs);
str.append (rhs);
return str;
}
template <class charT, class traits, class Allocator>
inline basic_string <charT, traits, Allocator>
operator+ (const basic_string <charT, traits, Allocator>& lhs, charT rhs)
{
basic_string <charT, traits, Allocator> str (lhs);
str.append (1, rhs);
return str;
}
template <class charT, class traits, class Allocator>
inline bool
operator== (const basic_string <charT, traits, Allocator>& lhs,
const basic_string <charT, traits, Allocator>& rhs)
{
return (lhs.compare (rhs) == 0);
}
template <class charT, class traits, class Allocator>
inline bool
operator== (const charT* lhs, const basic_string <charT, traits, Allocator>& rhs)
{
return (rhs.compare (lhs) == 0);
}
template <class charT, class traits, class Allocator>
inline bool
operator== (const basic_string <charT, traits, Allocator>& lhs, const charT* rhs)
{
return (lhs.compare (rhs) == 0);
}
template <class charT, class traits, class Allocator>
inline bool
operator!= (const charT* lhs, const basic_string <charT, traits, Allocator>& rhs)
{
return (rhs.compare (lhs) != 0);
}
template <class charT, class traits, class Allocator>
inline bool
operator!= (const basic_string <charT, traits, Allocator>& lhs, const charT* rhs)
{
return (lhs.compare (rhs) != 0);
}
template <class charT, class traits, class Allocator>
inline bool
operator< (const basic_string <charT, traits, Allocator>& lhs,
const basic_string <charT, traits, Allocator>& rhs)
{
return (lhs.compare (rhs) < 0);
}
template <class charT, class traits, class Allocator>
inline bool
operator< (const charT* lhs, const basic_string <charT, traits, Allocator>& rhs)
{
return (rhs.compare (lhs) > 0);
}
template <class charT, class traits, class Allocator>
inline bool
operator< (const basic_string <charT, traits, Allocator>& lhs, const charT* rhs)
{
return (lhs.compare (rhs) < 0);
}
template <class charT, class traits, class Allocator>
inline bool
operator> (const charT* lhs, const basic_string <charT, traits, Allocator>& rhs)
{
return (rhs.compare (lhs) < 0);
}
template <class charT, class traits, class Allocator>
inline bool
operator> (const basic_string <charT, traits, Allocator>& lhs, const charT* rhs)
{
return (lhs.compare (rhs) > 0);
}
template <class charT, class traits, class Allocator>
inline bool
operator<= (const charT* lhs, const basic_string <charT, traits, Allocator>& rhs)
{
return (rhs.compare (lhs) >= 0);
}
template <class charT, class traits, class Allocator>
inline bool
operator<= (const basic_string <charT, traits, Allocator>& lhs, const charT* rhs)
{
return (lhs.compare (rhs) <= 0);
}
template <class charT, class traits, class Allocator>
inline bool
operator>= (const charT* lhs, const basic_string <charT, traits, Allocator>& rhs)
{
return (rhs.compare (lhs) <= 0);
}
template <class charT, class traits, class Allocator>
inline bool
operator>= (const basic_string <charT, traits, Allocator>& lhs, const charT* rhs)
{
return (lhs.compare (rhs) >= 0);
}
template <class charT, class traits, class Allocator>
inline bool
operator!= (const basic_string <charT, traits, Allocator>& lhs,
const basic_string <charT, traits, Allocator>& rhs)
{
return (lhs.compare (rhs) != 0);
}
template <class charT, class traits, class Allocator>
inline bool
operator> (const basic_string <charT, traits, Allocator>& lhs,
const basic_string <charT, traits, Allocator>& rhs)
{
return (lhs.compare (rhs) > 0);
}
template <class charT, class traits, class Allocator>
inline bool
operator<= (const basic_string <charT, traits, Allocator>& lhs,
const basic_string <charT, traits, Allocator>& rhs)
{
return (lhs.compare (rhs) <= 0);
}
template <class charT, class traits, class Allocator>
inline bool
operator>= (const basic_string <charT, traits, Allocator>& lhs,
const basic_string <charT, traits, Allocator>& rhs)
{
return (lhs.compare (rhs) >= 0);
}
class istream; class ostream;
template <class charT, class traits, class Allocator> istream&
operator>> (istream&, basic_string <charT, traits, Allocator>&);
template <class charT, class traits, class Allocator> ostream&
operator<< (ostream&, const basic_string <charT, traits, Allocator>&);
template <class charT, class traits, class Allocator> istream&
getline (istream&, basic_string <charT, traits, Allocator>&, charT delim = '\n');
}
# 1 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/std/bastring.cc" 1 3
extern "C++" {
template <class charT, class traits, class Allocator>
inline void * basic_string <charT, traits, Allocator>::Rep::
operator new (size_t s, size_t extra)
{
return Allocator::allocate(s + extra * sizeof (charT));
}
template <class charT, class traits, class Allocator>
inline void basic_string <charT, traits, Allocator>::Rep::
operator delete (void * ptr)
{
Allocator::deallocate(ptr, sizeof(Rep) +
reinterpret_cast<Rep *>(ptr)->res *
sizeof (charT));
}
template <class charT, class traits, class Allocator>
inline size_t basic_string <charT, traits, Allocator>::Rep::
frob_size (size_t s)
{
size_t i = 16;
while (i < s) i *= 2;
return i;
}
template <class charT, class traits, class Allocator>
inline basic_string <charT, traits, Allocator>::Rep *
basic_string <charT, traits, Allocator>::Rep::
create (size_t extra)
{
extra = frob_size (extra + 1);
Rep *p = new (extra) Rep;
p->res = extra;
p->ref = 1;
p->selfish = false;
return p;
}
template <class charT, class traits, class Allocator>
charT * basic_string <charT, traits, Allocator>::Rep::
clone ()
{
Rep *p = Rep::create (len);
p->copy (0, data (), len);
p->len = len;
return p->data ();
}
template <class charT, class traits, class Allocator>
inline bool basic_string <charT, traits, Allocator>::Rep::
excess_slop (size_t s, size_t r)
{
return 2 * (s <= 16 ? 16 : s) < r;
}
template <class charT, class traits, class Allocator>
inline bool basic_string <charT, traits, Allocator>::
check_realloc (basic_string::size_type s) const
{
s += sizeof (charT);
rep ()->selfish = false;
return (rep ()->ref > 1
|| s > capacity ()
|| Rep::excess_slop (s, capacity ()));
}
template <class charT, class traits, class Allocator>
void basic_string <charT, traits, Allocator>::
alloc (basic_string::size_type size, bool save)
{
if (! check_realloc (size))
return;
Rep *p = Rep::create (size);
if (save)
{
p->copy (0, data (), length ());
p->len = length ();
}
else
p->len = 0;
repup (p);
}
template <class charT, class traits, class Allocator>
basic_string <charT, traits, Allocator>&
basic_string <charT, traits, Allocator>::
replace (size_type pos1, size_type n1,
const basic_string& str, size_type pos2, size_type n2)
{
const size_t len2 = str.length ();
if (pos1 == 0 && n1 >= length () && pos2 == 0 && n2 >= len2)
return operator= (str);
((void) (( !( pos2 > len2 ) ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/std/bastring.cc" , 126 , "!(pos2 > len2)" ), 0) )) ;
if (n2 > len2 - pos2)
n2 = len2 - pos2;
return replace (pos1, n1, str.data () + pos2, n2);
}
template <class charT, class traits, class Allocator>
inline void basic_string <charT, traits, Allocator>::Rep::
copy (size_t pos, const charT *s, size_t n)
{
if (n)
traits::copy (data () + pos, s, n);
}
template <class charT, class traits, class Allocator>
inline void basic_string <charT, traits, Allocator>::Rep::
move (size_t pos, const charT *s, size_t n)
{
if (n)
traits::move (data () + pos, s, n);
}
template <class charT, class traits, class Allocator>
basic_string <charT, traits, Allocator>&
basic_string <charT, traits, Allocator>::
replace (size_type pos, size_type n1, const charT* s, size_type n2)
{
const size_type len = length ();
((void) (( !( pos > len ) ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/std/bastring.cc" , 156 , "!(pos > len)" ), 0) )) ;
if (n1 > len - pos)
n1 = len - pos;
((void) (( !( len - n1 > max_size () - n2 ) ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/std/bastring.cc" , 159 , "!(len - n1 > max_size () - n2)" ), 0) )) ;
size_t newlen = len - n1 + n2;
if (check_realloc (newlen))
{
Rep *p = Rep::create (newlen);
p->copy (0, data (), pos);
p->copy (pos + n2, data () + pos + n1, len - (pos + n1));
p->copy (pos, s, n2);
repup (p);
}
else
{
rep ()->move (pos + n2, data () + pos + n1, len - (pos + n1));
rep ()->copy (pos, s, n2);
}
rep ()->len = newlen;
return *this;
}
template <class charT, class traits, class Allocator>
inline void basic_string <charT, traits, Allocator>::Rep::
set (size_t pos, const charT c, size_t n)
{
traits::set (data () + pos, c, n);
}
template <class charT, class traits, class Allocator>
basic_string <charT, traits, Allocator>& basic_string <charT, traits, Allocator>::
replace (size_type pos, size_type n1, size_type n2, charT c)
{
const size_t len = length ();
((void) (( !( pos > len ) ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/std/bastring.cc" , 192 , "!(pos > len)" ), 0) )) ;
if (n1 > len - pos)
n1 = len - pos;
((void) (( !( len - n1 > max_size () - n2 ) ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/std/bastring.cc" , 195 , "!(len - n1 > max_size () - n2)" ), 0) )) ;
size_t newlen = len - n1 + n2;
if (check_realloc (newlen))
{
Rep *p = Rep::create (newlen);
p->copy (0, data (), pos);
p->copy (pos + n2, data () + pos + n1, len - (pos + n1));
p->set (pos, c, n2);
repup (p);
}
else
{
rep ()->move (pos + n2, data () + pos + n1, len - (pos + n1));
rep ()->set (pos, c, n2);
}
rep ()->len = newlen;
return *this;
}
template <class charT, class traits, class Allocator>
void basic_string <charT, traits, Allocator>::
resize (size_type n, charT c)
{
((void) (( !( n > max_size () ) ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/std/bastring.cc" , 220 , "!(n > max_size ())" ), 0) )) ;
if (n > length ())
append (n - length (), c);
else
erase (n);
}
template <class charT, class traits, class Allocator>
basic_string <charT, traits, Allocator>::size_type
basic_string <charT, traits, Allocator>::
copy (charT* s, size_type n, size_type pos) const
{
((void) (( !( pos > length () ) ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/std/bastring.cc" , 233 , "!(pos > length ())" ), 0) )) ;
if (n > length () - pos)
n = length () - pos;
traits::copy (s, data () + pos, n);
return n;
}
template <class charT, class traits, class Allocator>
basic_string <charT, traits, Allocator>::size_type
basic_string <charT, traits, Allocator>::
find (const charT* s, size_type pos, size_type n) const
{
size_t xpos = pos;
for (; xpos + n <= length (); ++xpos)
if (traits::eq (data () [xpos], *s)
&& traits::compare (data () + xpos, s, n) == 0)
return xpos;
return npos;
}
template <class charT, class traits, class Allocator>
inline basic_string <charT, traits, Allocator>::size_type
basic_string <charT, traits, Allocator>::
_find (const charT* ptr, charT c, size_type xpos, size_type len)
{
for (; xpos < len; ++xpos)
if (traits::eq (ptr [xpos], c))
return xpos;
return npos;
}
template <class charT, class traits, class Allocator>
basic_string <charT, traits, Allocator>::size_type
basic_string <charT, traits, Allocator>::
find (charT c, size_type pos) const
{
return _find (data (), c, pos, length ());
}
template <class charT, class traits, class Allocator>
basic_string <charT, traits, Allocator>::size_type
basic_string <charT, traits, Allocator>::
rfind (const charT* s, size_type pos, size_type n) const
{
if (n > length ())
return npos;
size_t xpos = length () - n;
if (xpos > pos)
xpos = pos;
for (++xpos; xpos-- > 0; )
if (traits::eq (data () [xpos], *s)
&& traits::compare (data () + xpos, s, n) == 0)
return xpos;
return npos;
}
template <class charT, class traits, class Allocator>
basic_string <charT, traits, Allocator>::size_type
basic_string <charT, traits, Allocator>::
rfind (charT c, size_type pos) const
{
if (1 > length ())
return npos;
size_t xpos = length () - 1;
if (xpos > pos)
xpos = pos;
for (++xpos; xpos-- > 0; )
if (traits::eq (data () [xpos], c))
return xpos;
return npos;
}
template <class charT, class traits, class Allocator>
basic_string <charT, traits, Allocator>::size_type
basic_string <charT, traits, Allocator>::
find_first_of (const charT* s, size_type pos, size_type n) const
{
size_t xpos = pos;
for (; xpos < length (); ++xpos)
if (_find (s, data () [xpos], 0, n) != npos)
return xpos;
return npos;
}
template <class charT, class traits, class Allocator>
basic_string <charT, traits, Allocator>::size_type
basic_string <charT, traits, Allocator>::
find_last_of (const charT* s, size_type pos, size_type n) const
{
if (length() == 0)
return npos;
size_t xpos = length () - 1;
if (xpos > pos)
xpos = pos;
for (++xpos; xpos-- > 0;)
if (_find (s, data () [xpos], 0, n) != npos)
return xpos;
return npos;
}
template <class charT, class traits, class Allocator>
basic_string <charT, traits, Allocator>::size_type
basic_string <charT, traits, Allocator>::
find_first_not_of (const charT* s, size_type pos, size_type n) const
{
size_t xpos = pos;
for (; xpos < length (); ++xpos)
if (_find (s, data () [xpos], 0, n) == npos)
return xpos;
return npos;
}
template <class charT, class traits, class Allocator>
basic_string <charT, traits, Allocator>::size_type
basic_string <charT, traits, Allocator>::
find_first_not_of (charT c, size_type pos) const
{
size_t xpos = pos;
for (; xpos < length (); ++xpos)
if (traits::ne (data () [xpos], c))
return xpos;
return npos;
}
template <class charT, class traits, class Allocator>
basic_string <charT, traits, Allocator>::size_type
basic_string <charT, traits, Allocator>::
find_last_not_of (const charT* s, size_type pos, size_type n) const
{
if (length() == 0)
return npos;
size_t xpos = length () - 1;
if (xpos > pos)
xpos = pos;
for (++xpos; xpos-- > 0;)
if (_find (s, data () [xpos], 0, n) == npos)
return xpos;
return npos;
}
template <class charT, class traits, class Allocator>
basic_string <charT, traits, Allocator>::size_type
basic_string <charT, traits, Allocator>::
find_last_not_of (charT c, size_type pos) const
{
if (length() == 0)
return npos;
size_t xpos = length () - 1;
if (xpos > pos)
xpos = pos;
for (++xpos; xpos-- > 0;)
if (traits::ne (data () [xpos], c))
return xpos;
return npos;
}
template <class charT, class traits, class Allocator>
int basic_string <charT, traits, Allocator>::
compare (const basic_string& str, size_type pos, size_type n) const
{
((void) (( !( pos > length () ) ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/std/bastring.cc" , 399 , "!(pos > length ())" ), 0) )) ;
size_t rlen = length () - pos;
if (rlen > n)
rlen = n;
if (rlen > str.length ())
rlen = str.length ();
int r = traits::compare (data () + pos, str.data (), rlen);
if (r != 0)
return r;
if (rlen == n)
return 0;
return (length () - pos) - str.length ();
}
template <class charT, class traits, class Allocator>
int basic_string <charT, traits, Allocator>::
compare (const charT* s, size_type pos, size_type n) const
{
((void) (( !( pos > length () ) ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/std/bastring.cc" , 418 , "!(pos > length ())" ), 0) )) ;
size_t rlen = length () - pos;
if (rlen > n)
rlen = n;
int r = traits::compare (data () + pos, s, rlen);
if (r != 0)
return r;
return (length () - pos) - n;
}
template <class charT, class traits, class Allocator>
istream &
operator>> (istream &is, basic_string <charT, traits, Allocator> &s)
{
int w = is.width (0);
if (is.ipfx0 ())
{
register streambuf *sb = is.rdbuf ();
s.resize (0);
while (1)
{
int ch = sb->sbumpc ();
if (ch == (-1) )
{
is.setstate (ios::eofbit);
break;
}
else if (traits::is_del (ch))
{
sb->sungetc ();
break;
}
s += static_cast<charT> (ch);
if (--w == 1)
break;
}
}
is.isfx ();
if (s.length () == 0)
is.setstate (ios::failbit);
return is;
}
template <class charT, class traits, class Allocator>
ostream &
operator<< (ostream &o, const basic_string <charT, traits, Allocator>& s)
{
return o.write (s.data (), s.length ());
}
template <class charT, class traits, class Allocator>
istream&
getline (istream &is, basic_string <charT, traits, Allocator>& s, charT delim)
{
if (is.ipfx1 ())
{
_G_size_t count = 0;
streambuf *sb = is.rdbuf ();
s.resize (0);
while (1)
{
int ch = sb->sbumpc ();
if (ch == (-1) )
{
is.setstate (count == 0
? (ios::failbit|ios::eofbit)
: ios::eofbit);
break;
}
++count;
if (ch == delim)
break;
s += static_cast<charT> (ch);
if (s.length () == s.npos - 1)
{
is.setstate (ios::failbit);
break;
}
}
}
is.isfx ();
return is;
}
template <class charT, class traits, class Allocator>
basic_string <charT, traits, Allocator>::Rep
basic_string<charT, traits, Allocator>::nilRep = { 0, 0, 1, false };
template <class charT, class traits, class Allocator>
const basic_string <charT, traits, Allocator>::size_type
basic_string <charT, traits, Allocator>::npos;
}
# 652 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/std/bastring.h" 2 3
# 6 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/string" 2 3
extern "C++" {
typedef basic_string <char> string;
}
# 30 "input.h" 2
extern int octave_read (char *buf, unsigned max_size);
extern FILE *get_input_from_file (const string& name, int warn = 1);
extern FILE *get_input_from_stdin (void);
extern void initialize_readline (void);
extern string current_eval_string;
extern int get_input_from_eval_string;
extern int reading_fcn_file;
extern string curr_fcn_file_name;
extern string curr_fcn_file_full_name;
extern int reading_script_file;
extern FILE *ff_instream;
extern int interactive;
extern int forced_interactive;
extern int promptflag;
extern string current_input_line;
extern bool octave_completion_matches_called;
extern bool octave_initialized_readline;
char *gnu_readline (const char *s, bool force_readline = false);
extern string Vps4;
extern double Vlast_prompt_time;
extern void symbols_of_input (void);
# 42 "sighandlers.cc" 2
# 1 "load-save.h" 1
class ostream;
class octave_value;
extern int save_ascii_data (ostream& os, const octave_value& t,
const string& name = string (),
int strip_nan_and_inf = 0,
int mark_as_global = 0, int precision = 0);
extern int save_three_d (ostream& os, const octave_value& t,
int parametric = 0);
extern void save_user_variables (void);
extern void symbols_of_load_save (void);
# 43 "sighandlers.cc" 2
# 1 "pager.h" 1
# 1 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/strstream.h" 1 3
#pragma interface
# 1 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/strfile.h" 1 3
typedef void *(*_IO_alloc_type) (_G_size_t ) ;
typedef void (*_IO_free_type) (void*) ;
struct _IO_str_fields
{
_IO_alloc_type _allocate_buffer;
_IO_free_type _free_buffer;
};
struct _IO_streambuf
{
struct _IO_FILE _f;
const void *_vtable;
};
typedef struct _IO_strfile_
{
struct _IO_streambuf _sbf;
struct _IO_str_fields _s;
} _IO_strfile;
# 33 "/proj/lin56a/q127038/GNU/usr/local/lib/gcc-lib/mips-sgi-irix6.5/2.95.2/../../../../include/g++-3/strstream.h" 2 3
extern "C++" {
class strstreambuf : public streambuf
{
struct _IO_str_fields _s;
friend class istrstream;
void init_dynamic(_IO_alloc_type alloc, _IO_free_type free,
int initial_size = 0);
void init_static(char *ptr, int size, char *pstart);
void init_readonly(const char *ptr, int size);
protected:
virtual int overflow(int = (-1) );
virtual int underflow();
virtual int pbackfail(int c);
public:
virtual ~strstreambuf();
strstreambuf() { init_dynamic(0, 0); }
strstreambuf(int initial_size) { init_dynamic(0, 0, initial_size); }
strstreambuf(void *(*alloc)(_G_size_t ), void (*free)(void*))
{ init_dynamic(alloc, free); }
strstreambuf(char *ptr, int size, char *pstart = __null )
{ init_static(ptr, size, pstart); }
strstreambuf(unsigned char *ptr, int size, unsigned char *pstart = __null )
{ init_static((char*)ptr, size, (char*)pstart); }
strstreambuf(const char *ptr, int size)
{ init_readonly(ptr, size); }
strstreambuf(const unsigned char *ptr, int size)
{ init_readonly((const char*)ptr, size); }
strstreambuf(signed char *ptr, int size, signed char *pstart = __null )
{ init_static((char*)ptr, size, (char*)pstart); }
strstreambuf(const signed char *ptr, int size)
{ init_readonly((const char*)ptr, size); }
int frozen() { return _flags & 1 ? 1 : 0; }
void freeze(int n=1)
{ if ((( this )->_s._allocate_buffer != (_IO_alloc_type)0) )
{ if (n) _flags |= 1 ; else _flags &= ~1 ; } }
_G_ssize_t pcount();
char *str();
virtual streampos seekoff(streamoff, _seek_dir, int mode=ios::in|ios::out);
};
class strstreambase : virtual public ios {
protected:
strstreambuf __my_sb;
public:
strstreambuf* rdbuf() { return &__my_sb; }
protected:
strstreambase() { init (&__my_sb); }
strstreambase(char *cp, int n, int mode=ios::out);
};
class istrstream : public strstreambase, public istream {
public:
istrstream(const char*, int=0);
};
class ostrstream : public strstreambase, public ostream {
public:
ostrstream() { }
ostrstream(char *cp, int n, int mode=ios::out) :strstreambase(cp,n,mode){}
_G_ssize_t pcount() { return ((strstreambuf*)_strbuf)->pcount(); }
char *str() { return ((strstreambuf*)_strbuf)->str(); }
void freeze(int n = 1) { ((strstreambuf*)_strbuf)->freeze(n); }
int frozen() { return ((strstreambuf*)_strbuf)->frozen(); }
};
class strstream : public strstreambase, public iostream {
public:
strstream() { }
strstream(char *cp, int n, int mode=ios::out) :strstreambase(cp,n,mode){}
_G_ssize_t pcount() { return ((strstreambuf*)_strbuf)->pcount(); }
char *str() { return ((strstreambuf*)_strbuf)->str(); }
void freeze(int n = 1) { ((strstreambuf*)_strbuf)->freeze(n); }
int frozen() { return ((strstreambuf*)_strbuf)->frozen(); }
};
}
# 29 "pager.h" 2
class
octave_pager_buf : public strstreambuf
{
public:
octave_pager_buf (int size = 0) : strstreambuf (size) { }
protected:
int sync (void);
};
class
octave_pager_stream : public ostream
{
protected:
octave_pager_stream (void);
public:
~octave_pager_stream (void);
static octave_pager_stream& stream (void);
private:
static octave_pager_stream *instance;
octave_pager_buf *pb;
octave_pager_stream (const octave_pager_stream&);
octave_pager_stream& operator = (const octave_pager_stream&);
};
class
octave_diary_buf : public strstreambuf
{
public:
octave_diary_buf (int size = 0) : strstreambuf (size) { }
protected:
int sync (void);
};
class
octave_diary_stream : public ostream
{
protected:
octave_diary_stream (void);
public:
~octave_diary_stream (void);
static octave_diary_stream& stream (void);
private:
static octave_diary_stream *instance;
octave_diary_buf *db;
octave_diary_stream (const octave_diary_stream&);
octave_diary_stream& operator = (const octave_diary_stream&);
};
extern void flush_octave_stdout (void);
extern void symbols_of_pager (void);
# 44 "sighandlers.cc" 2
# 1 "sighandlers.h" 1
# 1 "../liboctave/Array.h" 1
#pragma interface
class idx_vector;
template <class T>
class Array
{
private:
class ArrayRep
{
public:
T *data;
int len;
int count;
ArrayRep& operator = (const ArrayRep& a);
ArrayRep (T *d, int l) : data (d), len (l), count (1) { }
ArrayRep (void) : data (0), len (0), count (1) { }
ArrayRep (int n) : data (new T [n]), len (n), count (1) { }
ArrayRep (const ArrayRep& a)
: data (new T [a.len]), len (a.len), count (1)
{
for (int i = 0; i < len; i++)
data[i] = a.data[i];
}
~ArrayRep (void) { delete [] data; }
int length (void) const { return len; }
T& elem (int n) { return data[n]; }
T elem (int n) const { return data[n]; }
void qsort (int (*compare) (const void *, const void *))
{
::qsort (data, len, sizeof (T), compare);
}
};
void make_unique (void)
{
if (rep->count > 1)
{
--rep->count;
rep = new ArrayRep (*rep);
}
}
idx_vector *idx;
int max_indices;
int idx_count;
protected:
ArrayRep *rep;
Array (T *d, int l)
{
rep = new ArrayRep (d, l);
idx = 0;
max_indices = 1;
idx_count = 0;
}
public:
Array (void)
{
rep = new ArrayRep ();
idx = 0;
max_indices = 1;
idx_count = 0;
}
Array (int n)
{
rep = new ArrayRep (n);
idx = 0;
max_indices = 1;
idx_count = 0;
}
Array (int n, const T& val);
Array (const Array<T>& a)
{
rep = a.rep;
rep->count++;
max_indices = a.max_indices;
idx_count = 0;
idx = 0;
}
~Array (void);
Array<T>& operator = (const Array<T>& a);
int capacity (void) const { return rep->length (); }
int length (void) const { return rep->length (); }
T& xelem (int n) { return rep->elem (n); }
T xelem (int n) const { return rep->elem (n); }
T& checkelem (int n)
{
if (n < 0 || n >= rep->length ())
return range_error ("T& Array<T>::checkelem", n);
else
{
make_unique ();
return xelem (n);
}
}
T& elem (int n)
{
make_unique ();
return xelem (n);
}
T& operator () (int n) { return elem (n); }
T checkelem (int n) const
{
if (n < 0 || n >= rep->length ())
return range_error ("T Array<T>::checkelem", n);
else
return xelem (n);
}
T elem (int n) const { return xelem (n); }
T operator () (int n) const { return elem (n); }
void resize (int n);
void resize (int n, const T& val);
const T *data (void) const { return rep->data; }
T *fortran_vec (void);
Array<T>& qsort (int (*compare) (const void *, const void *))
{
make_unique ();
rep->qsort (compare);
return *this;
}
T range_error (const char *fcn, int n) const;
T& range_error (const char *fcn, int n);
void set_max_indices (int mi) { max_indices = mi; }
void clear_index (void);
void set_index (const idx_vector& i);
int index_count (void) const { return idx_count; }
idx_vector *get_idx (void) const { return idx; }
void maybe_delete_elements (idx_vector& i);
Array<T> value (void);
Array<T> index (idx_vector& i) const;
};
template <class LT, class RT>
int assign (Array<LT>& lhs, const Array<RT>& rhs);
# 28 "sighandlers.h" 2
# 1 "syswait.h" 1
# 1 "/usr/include/sys/wait.h" 1 3
#ident "$Revision: 1.46 $"
extern "C" {
typedef union wait {
int w_status;
struct {
unsigned int w_Filler:16,
w_Retcode:8,
w_Coredump:1,
w_Termsig:7;
} w_T;
struct {
unsigned int w_Filler:16,
w_Stopsig:8,
w_Stopval:8;
} w_S;
} wait_t;
# 122 "/usr/include/sys/wait.h" 3
# 1 "/usr/include/sys/resource.h" 1 3
extern "C" {
struct timeval {
time_t tv_sec;
long tv_usec;
};
struct __irix5_timeval {
__int32_t tv_sec;
__int32_t tv_usec;
};
struct rusage {
struct timeval ru_utime;
struct timeval ru_stime;
long ru_maxrss;
long ru_ixrss;
long ru_idrss;
long ru_isrss;
long ru_minflt;
long ru_majflt;
long ru_nswap;
long ru_inblock;
long ru_oublock;
long ru_msgsnd;
long ru_msgrcv;
long ru_nsignals;
long ru_nvcsw;
long ru_nivcsw;
};
typedef __uint64_t rlim_t;
struct rlimit {
rlim_t rlim_cur;
rlim_t rlim_max;
};
typedef __uint64_t rlim64_t;
struct rlimit64 {
rlim64_t rlim_cur;
rlim64_t rlim_max;
};
# 166 "/usr/include/sys/resource.h" 3
extern int getrlimit(int, struct rlimit *);
extern int setrlimit(int, const struct rlimit *);
extern int getpriority(int, id_t);
extern int setpriority(int, id_t, int);
extern int getrusage(int, struct rusage *);
extern int getrlimit64(int, struct rlimit64 *);
extern int setrlimit64(int, const struct rlimit64 *);
}
# 153 "/usr/include/sys/wait.h" 2 3
extern pid_t waitpid(pid_t, int *, int);
extern pid_t wait(int *);
extern pid_t wait3(int *, int, struct rusage *);
extern int waitid(idtype_t, id_t, siginfo_t *, int);
}
# 37 "syswait.h" 2
# 49 "syswait.h"
# 30 "sighandlers.h" 2
# 51 "sighandlers.h"
typedef void sig_handler (int);
struct
octave_interrupt_handler
{
sig_handler *int_handler;
};
extern int pipe_handler_error_count;
extern int can_interrupt;
extern sig_handler *octave_set_signal_handler (int, sig_handler *);
extern void install_signal_handlers (void);
extern octave_interrupt_handler octave_catch_interrupts (void);
extern octave_interrupt_handler octave_ignore_interrupts (void);
extern octave_interrupt_handler
octave_set_interrupt_handler (const volatile octave_interrupt_handler&);
extern void octave_save_signal_mask (void);
extern void octave_restore_signal_mask (void);
extern char *sys_siglist[];
class
octave_child
{
public:
typedef void (*dead_child_handler) (pid_t, int);
octave_child (pid_t id = -1, dead_child_handler f = 0)
: pid (id), handler (f) { }
octave_child (const octave_child& oc)
: pid (oc.pid), handler (oc.handler) { }
octave_child& operator = (const octave_child& oc)
{
if (&oc != this)
{
pid = oc.pid;
handler = oc.handler;
}
return *this;
}
~octave_child (void) { }
pid_t pid;
dead_child_handler handler;
};
class
octave_child_list
{
protected:
octave_child_list (void) : list (0), curr_len (0) { }
public:
~octave_child_list (void) { }
static void insert (pid_t pid, octave_child::dead_child_handler f);
static void remove (pid_t pid);
static int length (void) { return instance ? instance->curr_len : 0; }
static octave_child& elem (int i)
{
static octave_child foo;
if (instance)
{
int n = length ();
if (i >= 0 && i < n)
return instance->list (i);
}
return foo;
}
private:
Array<octave_child> list;
int curr_len;
static octave_child_list *instance;
void do_insert (pid_t pid, octave_child::dead_child_handler f);
void do_remove (pid_t pid);
};
# 45 "sighandlers.cc" 2
# 1 "syswait.h" 1
# 73 "syswait.h"
# 46 "sighandlers.cc" 2
# 1 "toplev.h" 1
class octave_value;
class octave_value_list;
class tree_function;
class tree_statement_list;
class charMatrix;
extern void clean_up_for_exit (void);
extern void clean_up_and_exit (int) __attribute__ ((__noreturn__)) ;
extern void parse_and_execute (FILE *f, int print = 0);
extern void parse_and_execute (const string& s, int print = 0,
int verbose = 0,
const char *warn_for = 0);
extern octave_value eval_string (const string&, int print,
int& parse_status);
extern octave_value_list
feval (const string& name, const octave_value_list& args, int nargout);
extern octave_value_list
feval (const octave_value_list& args, int nargout);
extern int main_loop (void);
extern void do_octave_atexit (void);
extern void symbols_of_toplev (void);
extern string Vprogram_invocation_name;
extern string Vprogram_name;
extern string Vuser_name;
extern string Vhost_name;
extern string Vhome_directory;
extern int using_readline;
extern int reading_startup_message_printed;
extern int current_command_number;
extern int quitting_gracefully;
extern tree_statement_list *global_command;
extern tree_function *curr_function;
extern int input_from_startup_file;
extern int input_from_command_line_file;
# 47 "sighandlers.cc" 2
# 1 "utils.h" 1
class istream;
class ostrstream;
# 1 "../liboctave/lo-utils.h" 1
extern int NINT (double x);
extern double D_NINT (double x);
# 31 "utils.h" 2
class octave_value_list;
class string_vector;
extern char *strsave (const char *);
extern string search_path_for_file (const string&, const string&);
extern string file_in_path (const string&, const string&);
extern string fcn_file_in_path (const string&);
extern string oct_file_in_path (const string&);
extern "C" void jump_to_top_level (void) __attribute__ ((__noreturn__)) ;
extern int almost_match (const string& std, const string& s,
int min_match_len = 1, int case_sens = 1);
extern int
keyword_almost_match (const char **std, int *min_len,
const string& s, int min_toks_to_match,
int max_toks);
extern int empty_arg (const char *name, int nr, int nc);
extern const char *undo_string_escape (char c);
extern string do_string_escapes (const string& s);
extern string undo_string_escapes (const string& s);
extern void oct_putenv (const char *, const char *);
extern int check_preference (const string& var);
extern "C" void octave_usleep (unsigned int useconds);
extern "C" int octave_strcasecmp (const char *s1, const char *s2);
extern "C" int octave_strncasecmp (const char *s1, const char *s2, size_t n);
# 48 "sighandlers.cc" 2
int pipe_handler_error_count = 0;
int can_interrupt = 0;
static sigset_t octave_signal_mask;
void
octave_save_signal_mask (void)
{
sigprocmask (0, 0, &octave_signal_mask);
}
void
octave_restore_signal_mask (void)
{
sigprocmask (3 , &octave_signal_mask, 0);
}
static void
my_friendly_exit (const char *sig_name, int sig_number)
{
static bool been_there_done_that = false;
if (been_there_done_that)
{
octave_set_signal_handler (6 , ((SIG_PF)0L) );
cerr << "error: attempted clean up apparently failed -- aborting...\n";
abort ();
}
else
{
been_there_done_that = true;
cerr << "error: " << sig_name << " -- stopping myself...\n";
save_user_variables ();
clean_up_for_exit ();
if (sig_number < 0)
exit (1);
else
{
octave_set_signal_handler (sig_number, ((SIG_PF)0L) );
kill (getpid (), sig_number);
}
}
}
static void
octave_new_handler (void)
{
cerr << "error: memory exhausted -- trying to return to prompt\n";
if (can_interrupt)
{
jump_to_top_level ();
panic ("impossible state reached in file `%s' at line %d", "sighandlers.cc", 159) ;
}
else
my_friendly_exit ("operator new", 6 );
}
sig_handler *
octave_set_signal_handler (int sig, sig_handler *handler)
{
struct sigaction act, oact;
act. sa_sighandler.sa_handler1 = handler;
act.sa_flags = 0;
sigemptyset (&act.sa_mask);
sigemptyset (&oact.sa_mask);
sigaction (sig, &act, &oact);
return oact. sa_sighandler.sa_handler1 ;
}
static void
generic_sig_handler (int sig)
{
my_friendly_exit (sys_siglist[sig], sig);
return ;
}
static void
sigchld_handler (int )
{
volatile octave_interrupt_handler saved_interrupt_handler
= octave_ignore_interrupts ();
sigset_t set, oset;
do { sigemptyset (& set ); sigaddset (& set , 18 ); sigemptyset (& oset ); sigprocmask (1 , & set , & oset ); } while (0) ;
int n = octave_child_list::length ();
for (int i = 0; i < n; i++)
{
octave_child& elt = octave_child_list::elem (i);
pid_t pid = elt.pid;
if (pid > 0)
{
int status;
if (waitpid (pid, &status, 0100 ) > 0)
{
elt.pid = -1;
octave_child::dead_child_handler f = elt.handler;
if (f)
f (pid, status);
break;
}
}
}
octave_set_interrupt_handler (saved_interrupt_handler);
sigprocmask (3 , & oset , 0) ;
do { } while (0) ;
do { } while (0) ;
return ;
}
# 269 "sighandlers.cc"
# 289 "sighandlers.cc"
static void
sigint_handler (int sig)
{
do { } while (0) ;
do { } while (0) ;
if (can_interrupt)
{
jump_to_top_level ();
panic ("impossible state reached in file `%s' at line %d", "sighandlers.cc", 307) ;
}
return ;
}
static void
sigpipe_handler (int )
{
do { } while (0) ;
do { } while (0) ;
if (pipe_handler_error_count++ == 0)
cerr << "warning: broken pipe\n";
if (pipe_handler_error_count > 100)
jump_to_top_level ();
return ;
}
octave_interrupt_handler
octave_catch_interrupts (void)
{
octave_interrupt_handler retval;
retval.int_handler = octave_set_signal_handler (2 , sigint_handler);
return retval;
}
octave_interrupt_handler
octave_ignore_interrupts (void)
{
octave_interrupt_handler retval;
retval.int_handler = octave_set_signal_handler (2 , ((SIG_PF)1L) );
return retval;
}
octave_interrupt_handler
octave_set_interrupt_handler (const volatile octave_interrupt_handler& h)
{
octave_interrupt_handler retval;
retval.int_handler = octave_set_signal_handler (2 , h.int_handler);
return retval;
}
void
install_signal_handlers (void)
{
set_new_handler (octave_new_handler);
octave_catch_interrupts ();
octave_set_signal_handler (6 , generic_sig_handler);
octave_set_signal_handler (14 , generic_sig_handler);
octave_set_signal_handler (10 , generic_sig_handler);
octave_set_signal_handler (18 , sigchld_handler);
octave_set_signal_handler (7 , generic_sig_handler);
octave_set_signal_handler (8 , generic_sig_handler);
octave_set_signal_handler (1 , generic_sig_handler);
octave_set_signal_handler (4 , generic_sig_handler);
octave_set_signal_handler (22 , ((SIG_PF)1L) );
octave_set_signal_handler (6 , generic_sig_handler);
octave_set_signal_handler (13 , sigpipe_handler);
octave_set_signal_handler (22 , ((SIG_PF)1L) );
octave_set_signal_handler (29 , generic_sig_handler);
octave_set_signal_handler (3 , generic_sig_handler);
octave_set_signal_handler (11 , generic_sig_handler);
octave_set_signal_handler (12 , generic_sig_handler);
octave_set_signal_handler (15 , generic_sig_handler);
octave_set_signal_handler (5 , generic_sig_handler);
octave_set_signal_handler (16 , generic_sig_handler);
octave_set_signal_handler (17 , generic_sig_handler);
octave_set_signal_handler (28 , generic_sig_handler);
octave_set_signal_handler (30 , generic_sig_handler);
octave_set_signal_handler (31 , generic_sig_handler);
}
# 618 "sighandlers.cc"
octave_child_list *octave_child_list::instance = 0;
void
octave_child_list::do_insert (pid_t pid, octave_child::dead_child_handler f)
{
bool enlarge = true;
for (int i = 0; i < curr_len; i++)
{
octave_child& tmp = list (i);
if (tmp.pid < 0)
{
list (i) = octave_child (pid, f);
enlarge = false;
break;
}
}
if (enlarge)
{
int total_len = list.length ();
if (curr_len == total_len)
{
if (total_len == 0)
list.resize (16);
else
list.resize (total_len * 2);
}
list (curr_len) = octave_child (pid, f);
curr_len++;
}
}
void
octave_child_list::insert (pid_t pid, octave_child::dead_child_handler f)
{
if (! instance)
instance = new octave_child_list ();
if (instance)
instance->do_insert (pid, f);
else
panic ("impossible state reached in file `%s' at line %d", "sighandlers.cc", 668) ;
}
void
octave_child_list::do_remove (pid_t pid)
{
for (int i = 0; i < curr_len; i++)
{
octave_child& tmp = list (i);
if (tmp.pid == pid)
{
tmp.pid = -1;
break;
}
}
}
void
octave_child_list::remove (pid_t pid)
{
if (! instance)
instance = new octave_child_list ();
if (instance)
instance->do_remove (pid);
else
panic ("impossible state reached in file `%s' at line %d", "sighandlers.cc", 697) ;
}