# 1 "etc.cc"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 


# 1 "/usr/local2/lib/gcc-lib/sparc-sun-sunos4.1.3_U1/2.7.2.1/include/math.h" 1 3 4
 

 



 













 







extern double	__infinity();
extern double	acos  (double)  ;
extern double	asin  (double)  ;
extern double	atan  (double)  ;
extern double	atan2  (double, double)  ;
extern double	ceil  (double)  ;
extern double	cos  (double)  ;
extern double	cosh  (double)  ;
extern double	exp  (double)  ;
extern double	fabs  (double)  ;
extern double	floor  (double)  ;
extern double	fmod  (double, double)  ;
extern double	frexp  (double, int *)  ;
extern double	ldexp  (double, int)  ;
extern double	log  (double)  ;
extern double	log10  (double)  ;
extern double	modf  (double, double *)  ;
extern double	pow  (double, double)  ;
extern double	sin  (double)  ;
extern double	sinh  (double)  ;
extern double	sqrt  (double)  ;
extern double	tan  (double)  ;
extern double	tanh  (double)  ;


# 1 "/usr/local2/lib/gcc-lib/sparc-sun-sunos4.1.3_U1/2.7.2.1/include/floatingpoint.h" 1 3 4
 

 



 

















# 1 "/usr/local2/lib/gcc-lib/sparc-sun-sunos4.1.3_U1/2.7.2.1/include/sys/ieeefp.h" 1 3 4
 

 



 







 


enum fp_direction_type 		 
	{
	fp_nearest	= 0,
	fp_tozero	= 1,
	fp_positive	= 2,
	fp_negative	= 3
	} ;

# 34 "/usr/local2/lib/gcc-lib/sparc-sun-sunos4.1.3_U1/2.7.2.1/include/sys/ieeefp.h" 3 4

# 43 "/usr/local2/lib/gcc-lib/sparc-sun-sunos4.1.3_U1/2.7.2.1/include/sys/ieeefp.h" 3 4


# 53 "/usr/local2/lib/gcc-lib/sparc-sun-sunos4.1.3_U1/2.7.2.1/include/sys/ieeefp.h" 3 4

enum fp_precision_type		 
	{
	fp_extended	= 0,
	fp_single	= 1,
	fp_double	= 2,
	fp_precision_3	= 3
	} ;


# 73 "/usr/local2/lib/gcc-lib/sparc-sun-sunos4.1.3_U1/2.7.2.1/include/sys/ieeefp.h" 3 4

enum fp_exception_type		 
	{
	fp_inexact	= 0,
	fp_division	= 1,
	fp_underflow	= 2,
	fp_overflow	= 3,
	fp_invalid	= 4
	} ;


enum fp_class_type		 
	{
	fp_zero		= 0,
	fp_subnormal	= 1,
	fp_normal	= 2,
	fp_infinity   	= 3,
	fp_quiet	= 4,
	fp_signaling	= 5
	} ;


# 25 "/usr/local2/lib/gcc-lib/sparc-sun-sunos4.1.3_U1/2.7.2.1/include/floatingpoint.h" 2 3 4


 

typedef float   single;
typedef unsigned long extended[3];	 

typedef long double quadruple;	 








typedef unsigned fp_exception_field_type;
 



typedef int     sigfpe_code_type;	 

typedef void    (*sigfpe_handler_type) ();
 





 

extern enum fp_direction_type fp_direction;
 



extern enum fp_precision_type fp_precision;
 



extern fp_exception_field_type fp_accrued_exceptions;
 





 


 

typedef char    decimal_string[512 ];
 

typedef struct {
	enum fp_class_type fpclass;
	int             sign;
	int             exponent;
	decimal_string  ds;	 


	int             more;	 


	int             ndigits; 


}
                decimal_record;

enum decimal_form {
	fixed_form,		 



	floating_form		 

};

typedef struct {
	enum fp_direction_type rd;
	 
	enum decimal_form df;	 
	int             ndigits; 
}
                decimal_mode;

enum decimal_string_form {	 
	invalid_form,		 
	whitespace_form,	 
	fixed_int_form,		 
	fixed_intdot_form,	 
	fixed_dotfrac_form,	 
	fixed_intdotfrac_form,	 
	floating_int_form,	 
	floating_intdot_form,	 
	floating_dotfrac_form,	 
	floating_intdotfrac_form,	 
	inf_form,		 
	infinity_form,		 
	nan_form,		 
	nanstring_form		 
};

 

extern void     double_to_decimal();
extern void     quadruple_to_decimal();
extern char    *econvert();
extern char    *fconvert();
extern char    *gconvert();
extern char    *qeconvert();
extern char    *qfconvert();
extern char    *qgconvert();

 



extern sigfpe_handler_type ieee_handlers[5 ];
 






extern sigfpe_handler_type sigfpe();

extern void     single_to_decimal();
extern void     extended_to_decimal();

extern void     decimal_to_single();
extern void     decimal_to_double();
extern void     decimal_to_extended();
extern void     decimal_to_quadruple();

extern char    *seconvert();
extern char    *sfconvert();
extern char    *sgconvert();

extern void     string_to_decimal();
extern void     file_to_decimal();
extern void     func_to_decimal();

 

extern double   atof  (const char *)  ;

 

extern int      errno;

extern double   strtod  (const char *, char **)  ;


# 56 "/usr/local2/lib/gcc-lib/sparc-sun-sunos4.1.3_U1/2.7.2.1/include/math.h" 2 3 4

extern double	acosh  (double)  ;
extern double	asinh  (double)  ;
extern double	atanh  (double)  ;
extern double	cbrt  (double)  ;
extern double	copysign  (double, double)  ;
extern double	erf  (double)  ;
extern double	erfc  (double)  ;
extern double	expm1();
extern int	finite  (double)  ;
extern double	hypot  (double, double)  ;
extern double	j0  (double)  ;
extern double	j1  (double)  ;
extern double	jn  (int, double)  ;
extern double	lgamma  (double)  ;
extern double	log1p();
extern double	rint  (double)  ;
extern double	y0  (double)  ;
extern double	y1  (double)  ;
extern double	yn  (int, double)  ;

 



 


enum fp_pi_type {
	fp_pi_infinite	= 0,	 
	fp_pi_66	= 1,	 
	fp_pi_53	= 2	 
};

 


extern enum	fp_pi_type fp_pi;

 





extern int	ieee_flags();
extern int	ieee_handler();
extern void	ieee_retrospective();
extern int	ilogb();
extern double	infinity();
extern int	irint();
extern int	isinf  (double)  ;
extern int	isnan  (double)  ;
extern int	isnormal();
extern int	issubnormal();
extern int	iszero();
extern double	logb  (double)  ;
extern double	max_normal();
extern double	max_subnormal();
extern double	min_normal();
extern double	min_subnormal();
extern double	nextafter  (double, double)  ;
extern void	nonstandard_arithmetic();
extern double	quiet_nan();
extern double	remainder  (double, double)  ;
extern double	scalb  (double, double)  ;
extern double	scalbn();
extern double	signaling_nan();
extern int	signbit();
extern double	significand();
extern void	standard_arithmetic();

 


extern double	acospi();
extern double	aint();
extern double	anint();
extern double	annuity();
extern double	asinpi();
extern double	atan2pi();
extern double	atanpi();
extern double	compound();
extern double	cospi();
extern double	exp10();
extern double	exp2();
extern double	log2();
extern int	nint();
extern void	sincos();
extern void	sincospi();
extern double	sinpi();
extern double	tanpi();
struct exception;
extern int	matherr  (struct exception *)  ;


 














 







 







 







 




extern int		 ir_finite_();
extern enum fp_class_type ir_fp_class_();
extern int		 ir_ilogb_();
extern int		 ir_irint_();
extern int		 ir_isinf_();
extern int		 ir_isnan_();
extern int		 ir_isnormal_();
extern int		 ir_issubnormal_();
extern int		 ir_iszero_();
extern int		 ir_nint_();
extern int		 ir_signbit_();
extern void		 r_sincos_();
extern void		 r_sincospi_();
extern double  r_acos_();
extern double  r_acosh_();
extern double  r_acospi_();
extern double  r_aint_();
extern double  r_anint_();
extern double  r_annuity_();
extern double  r_asin_();
extern double  r_asinh_();
extern double  r_asinpi_();
extern double  r_atan2_();
extern double  r_atan2pi_();
extern double  r_atan_();
extern double  r_atanh_();
extern double  r_atanpi_();
extern double  r_cbrt_();
extern double  r_ceil_();
extern double  r_compound_();
extern double  r_copysign_();
extern double  r_cos_();
extern double  r_cosh_();
extern double  r_cospi_();
extern double  r_erf_();
extern double  r_erfc_();
extern double  r_exp10_();
extern double  r_exp2_();
extern double  r_exp_();
extern double  r_expm1_();
extern double  r_fabs_();
extern double  r_floor_();
extern double  r_fmod_();
extern double  r_hypot_();
extern double  r_infinity_();
extern double  r_j0_();
extern double  r_j1_();
extern double  r_jn_();
extern double  r_lgamma_();
extern double  r_log10_();
extern double  r_log1p_();
extern double  r_log2_();
extern double  r_log_();
extern double  r_logb_();
extern double  r_max_normal_();
extern double  r_max_subnormal_();
extern double  r_min_normal_();
extern double  r_min_subnormal_();
extern double  r_nextafter_();
extern double  r_pow_();
extern double  r_quiet_nan_();
extern double  r_remainder_();
extern double  r_rint_();
extern double  r_scalb_();
extern double  r_scalbn_();
extern double  r_signaling_nan_();
extern double  r_significand_();
extern double  r_sin_();
extern double  r_sinh_();
extern double  r_sinpi_();
extern double  r_sqrt_();
extern double  r_tan_();
extern double  r_tanh_();
extern double  r_tanpi_();
extern double  r_y0_();
extern double  r_y1_();
extern double  r_yn_();

 












struct exception {
	int type;
	char *name;
	double arg1;
	double arg2;
	double retval;
};

 





























extern int	signgam;
 




extern double cabs();	 



extern double drem  (double, double)  ;	 


extern double gamma  (double)  ;	 






# 18 "etc.cc" 2

# 1 "/usr/local2/lib/gcc-lib/sparc-sun-sunos4.1.3_U1/2.7.2.1/include/string.h" 1 3 4
 











# 1 "/usr/local2/lib/gcc-lib/sparc-sun-sunos4.1.3_U1/2.7.2.1/include/sys/stdtypes.h" 1 3 4
 

 










typedef	int		sigset_t;	 

typedef	unsigned int	speed_t;	 
typedef	unsigned long	tcflag_t;	 
typedef	unsigned char	cc_t;		 
typedef	int		pid_t;		 

typedef	unsigned short	mode_t;		 
typedef	short		nlink_t;	 

typedef	long		clock_t;	 
typedef	long		time_t;		 






typedef long unsigned int size_t;		 






typedef int ptrdiff_t;	 













# 13 "/usr/local2/lib/gcc-lib/sparc-sun-sunos4.1.3_U1/2.7.2.1/include/string.h" 2 3 4







extern char *	strcat  (char *, const char *)  ;
extern char *	strchr  (const char *, int)  ;
extern int	strcmp  (const char *, const char *)  ;
extern char *	strcpy  (char *, const char *)  ;
extern size_t	strcspn  (const char *, const char *)  ;

extern char *	strdup  (const char *)  ;

extern size_t	strlen  (const char *)  ;
extern char *	strncat  (char *, const char *, long unsigned int )  ;
extern int	strncmp  (const char *, const char *, long unsigned int )  ;
extern char *	strncpy  (char *, const char *, long unsigned int )  ;
extern char *	strpbrk  (const char *, const char *)  ;
extern char *	strrchr  (const char *, int)  ;
extern size_t	strspn  (const char *, const char *)  ;
extern char *	strstr  (const char *, const char *)  ;
extern char *	strtok  (char *, const char *)  ;


extern void * memchr (const void *, int, long unsigned int );
extern int memcmp (const void *, const void *, long unsigned int );
extern void * memcpy (void *, const void *, long unsigned int );

extern void * memmove (void *, const void *, long unsigned int );

extern void * memset (void *, int, long unsigned int );
extern int strcoll (const char *, const char *);
extern char * strerror (int);
extern long unsigned int strxfrm (char *, const char *, long unsigned int );


# 19 "etc.cc" 2

# 1 "/usr/local2/lib/gcc-lib/sparc-sun-sunos4.1.3_U1/2.7.2.1/include/stdio.h" 1 3 4








# 1 "/usr/local2/lib/gcc-lib/sparc-sun-sunos4.1.3_U1/2.7.2.1/include/stdarg.h" 1 3 4
 




























# 1 "/usr/local2/lib/gcc-lib/sparc-sun-sunos4.1.3_U1/2.7.2.1/include/va-sparc.h" 1 3 4
 


 




# 19 "/usr/local2/lib/gcc-lib/sparc-sun-sunos4.1.3_U1/2.7.2.1/include/va-sparc.h" 3 4


 

typedef char * __gnuc_va_list;








 

# 203 "/usr/local2/lib/gcc-lib/sparc-sun-sunos4.1.3_U1/2.7.2.1/include/va-sparc.h" 3 4

# 30 "/usr/local2/lib/gcc-lib/sparc-sun-sunos4.1.3_U1/2.7.2.1/include/stdarg.h" 2 3 4

# 100 "/usr/local2/lib/gcc-lib/sparc-sun-sunos4.1.3_U1/2.7.2.1/include/stdarg.h" 3 4







# 171 "/usr/local2/lib/gcc-lib/sparc-sun-sunos4.1.3_U1/2.7.2.1/include/stdarg.h" 3 4




# 9 "/usr/local2/lib/gcc-lib/sparc-sun-sunos4.1.3_U1/2.7.2.1/include/stdio.h" 2 3 4

 




extern	struct	_iobuf {
	int	_cnt;
	unsigned char *_ptr;
	unsigned char *_base;
	int	_bufsiz;
	short	_flag;
	char	_file;		 
} _iob[];








































extern struct _iobuf 	*fopen  (const char *, const char *)  ;
extern struct _iobuf 	*fdopen  (int, const char *)  ;
extern struct _iobuf 	*freopen  (const char *, const char *, struct _iobuf  *)  ;
extern struct _iobuf 	*popen  (const char *, const char *)  ;
extern struct _iobuf 	*tmpfile();
extern long	ftell  (struct _iobuf  *)  ;
extern char	*fgets  (char *, int, struct _iobuf  *)  ;
extern char	*gets  (char *)  ;
extern char	*sprintf  (char *, const char *, ...)  ;
extern char	*ctermid  (char *)  ;
extern char	*cuserid  (char *)  ;
extern char	*tempnam  (const char *, const char *)  ;
extern char	*tmpnam  (char *)  ;







extern int fclose (struct _iobuf  *);
extern int fflush (struct _iobuf  *);
extern int fgetc (struct _iobuf  *);
extern int fgetpos (struct _iobuf  *, long *);
extern int fprintf (struct _iobuf  *, const char *, ...);
extern int fputc (int, struct _iobuf  *);
extern int fputs (const char *, struct _iobuf  *);
extern long unsigned int fread (void *, long unsigned int , long unsigned int , struct _iobuf  *);
extern int fscanf (struct _iobuf  *, const char *, ...);
extern int fseek (struct _iobuf  *, long int, int);
extern int fsetpos (struct _iobuf  *, const long *);
extern long unsigned int fwrite (const void *, long unsigned int , long unsigned int , struct _iobuf  *);
extern int pclose (struct _iobuf  *);
extern void perror (const char *);
extern int printf (const char *, ...);
extern int puts (const char *);
extern int remove (const char *);
extern int rename (const char *, const char *);
extern void rewind (struct _iobuf  *);
extern int scanf (const char *, ...);
extern void setbuf (struct _iobuf  *, char *);
extern int setvbuf (struct _iobuf  *, char *, int, long unsigned int );
extern int sscanf (const char *, const char *, ...);

extern int vprintf (const char *, __gnuc_va_list);


extern int vsprintf (char *, const char *, __gnuc_va_list);


extern int vfprintf (struct _iobuf  *, const char *, __gnuc_va_list);

extern int ungetc (int, struct _iobuf  *);
extern int _filbuf (struct _iobuf  *);
extern int _flsbuf (unsigned int, struct _iobuf  *);

# 20 "etc.cc" 2


# 1 "/usr/local2/lib/gcc-lib/sparc-sun-sunos4.1.3_U1/2.7.2.1/include/stdlib.h" 1 3 4
 

 















extern unsigned int _mb_cur_max;




 
extern void	abort( );
extern int	abs  (int)  ;
extern double	atof  (const char *)  ;
extern int	atoi  (const char *)  ;
extern long int	atol  (const char *)  ;
extern char *	bsearch  (const void *, const void *, long unsigned int , long unsigned int , int (*) (const void *, const void *))  ;
extern void *	calloc  (long unsigned int , long unsigned int )  ;
extern void	exit  (int)  ;
extern void	free  (void *)  ;
extern char *	getenv  (const char *)  ;
extern void *	malloc  (long unsigned int )  ;
extern int	qsort  (void *, long unsigned int , long unsigned int , int (*) (const void *, const void *))  ;
extern int	rand( );
extern void *	realloc  (void *, long unsigned int )  ;
extern int	srand  (unsigned int)  ;

extern int    mbtowc  (__wchar_t *, const char *, long unsigned int )  ;
extern int    wctomb  (char *, __wchar_t )  ;
extern size_t mbstowcs  (__wchar_t *, const char *, long unsigned int )  ;
extern size_t wcstombs  (char *, const __wchar_t *, long unsigned int )  ;


extern int atexit (void (*) (void));
extern long int labs (long int);
extern int putenv (char *);
extern double strtod (const char *, char **);
extern long int strtol (const char *, char **, int);
extern long unsigned int strtoul (const char *, char **, int);
extern int system (const char *);


# 22 "etc.cc" 2


# 1 "/usr/local2/lib/g++-include/iomanip.h" 1 3
 

























#pragma interface



# 1 "/usr/local2/lib/g++-include/iostream.h" 1 3
 

























#pragma interface



# 1 "/usr/local2/lib/g++-include/streambuf.h" 1 3
 


























#pragma interface


   



extern "C" {
# 1 "/usr/local2/lib/g++-include/libio.h" 1 3
 























 




# 1 "/usr/local2/lib/g++-include/_G_config.h" 1 3
  







typedef long _G_clock_t;
typedef short _G_dev_t;
typedef long   _G_fpos_t;
typedef unsigned short _G_gid_t;
typedef unsigned long _G_ino_t;
typedef unsigned short _G_mode_t;
typedef short _G_nlink_t;
typedef long _G_off_t;
typedef int _G_pid_t;



typedef int _G_ptrdiff_t;
typedef int _G_sigset_t;



typedef long unsigned int _G_size_t;
typedef long _G_time_t;
typedef unsigned short _G_uid_t;
typedef short unsigned int _G_wchar_t;
typedef int   _G_ssize_t;
typedef int   _G_wint_t;
typedef char * _G_va_list;




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__)));


































# 30 "/usr/local2/lib/g++-include/libio.h" 2 3













# 51 "/usr/local2/lib/g++-include/libio.h" 3














 




































 























 

















 

struct _IO_jump_t;  struct _IO_FILE;

struct _IO_marker {
  struct _IO_marker *_next;
  struct _IO_FILE *_sbuf;
   

   
  int _pos;
# 164 "/usr/local2/lib/g++-include/libio.h" 3

};

struct _IO_FILE {
  int _flags;		 


   
   
  char* _IO_read_ptr;	 
  char* _IO_read_end;	 
  char* _IO_read_base;	 
  char* _IO_write_base;	 
  char* _IO_write_ptr;	 
  char* _IO_write_end;	 
  char* _IO_buf_base;	 
  char* _IO_buf_end;	 
   
  char *_IO_save_base;  
  char *_IO_backup_base;   
  char *_IO_save_end;  

  struct _IO_marker *_markers;
  
  struct _IO_FILE *_chain;
  
  int _fileno;
  int _blksize;
  _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_;





extern "C" {


extern int __underflow  (_IO_FILE*)  ;
extern int __uflow  (_IO_FILE*)  ;
extern int __overflow  (_IO_FILE*, int)  ;

















 



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 "/usr/local2/lib/g++-include/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;  
};















# 115 "/usr/local2/lib/g++-include/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 int 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};
     
     
    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
    };

# 168 "/usr/local2/lib/g++-include/streambuf.h" 3


    ostream* tie() const { return _tie; }
    ostream* tie(ostream* val) { ostream* save=_tie; _tie=val; return save; }

     
    short  fill() const { return (short )_fill; }
    short  fill(short  newf)
	{short  oldf = (short )_fill; _fill = (char)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 != 0 ; }
    int have_markers() { return _markers != 0 ; }
    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() == 0 ) 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 (((  this )->_IO_write_ptr >= (  this )->_IO_write_end) ? __overflow(  this , (unsigned char)( c )) : (unsigned char)(*(  this )->_IO_write_ptr++ = ( c ))) ; }
    int sbumpc() { return (( this )->_IO_read_ptr >= ( this )->_IO_read_end ? __uflow( this ) : *(unsigned char*)( this )->_IO_read_ptr++) ; }
    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 = 0 );
    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() {



    if (_arrays) delete [] _arrays;
}
}  

# 31 "/usr/local2/lib/g++-include/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= 0 );
    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);

    ostream& operator<<(long long n);
    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<<(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= 0 );
    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);
		       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&);

    istream& operator>>(long long&);
    istream& operator>>(unsigned long long&);

    istream& operator>>(short&);
    istream& operator>>(unsigned int&);
    istream& operator>>(unsigned long&);
    istream& operator>>(unsigned short&);



    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= 0 );
};

class _IO_istream_withassign : public istream {
public:
  _IO_istream_withassign& operator=(istream&);
};

class _IO_ostream_withassign : public ostream {
public:
  _IO_ostream_withassign& operator=(ostream&);
};

extern _IO_istream_withassign cin;
 
extern _IO_ostream_withassign cout, cerr;

extern _IO_ostream_withassign clog



;

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; }
}  


# 31 "/usr/local2/lib/g++-include/iomanip.h" 2 3


extern "C++" {
 
 
 

 
 
 
 
template<class TP> class smanip;  

template<class TP> class sapp {
    ios& (*_f)(ios&, TP);
public: 
    sapp(ios& (*f)(ios&, TP)) : _f(f) {}
     
    smanip<TP> operator()(TP a) 
      { return smanip<TP>(_f, a); }
};

template <class TP> class smanip {
    ios& (*_f)(ios&, TP);
    TP _a;
public:
    smanip(ios& (*f)(ios&, TP), TP a) : _f(f), _a(a) {}
     
    friend 
      istream& operator>>(istream& i, const smanip<TP>& m);
    friend
      ostream& operator<<(ostream& o, const smanip<TP>& m);
};


extern template class smanip<int>;
extern template class smanip<ios::fmtflags>;


template<class TP>
inline istream& operator>>(istream& i, const smanip<TP>& m)
{ (*m._f)(i, m._a); return i; }

template<class TP>
inline ostream& operator<<(ostream& o, const smanip<TP>& m)
{ (*m._f)(o, m._a); return o;}


extern template istream& operator>>(istream&, const smanip<int>&);
extern template istream& operator>>(istream&, const smanip<ios::fmtflags>&);
extern template ostream& operator<<(ostream&, const smanip<int>&);
extern template ostream& operator<<(ostream&, const smanip<ios::fmtflags>&);


 
 
 
 
template<class TP> class imanip; 

template<class TP> class iapp {
    istream& (*_f)(istream&, TP);
public: 
    iapp(istream& (*f)(istream&,TP)) : _f(f) {}
     
    imanip<TP> operator()(TP a)
       { return imanip<TP>(_f, a); }
};

template <class TP> class imanip {
    istream& (*_f)(istream&, TP);
    TP _a;
public:
    imanip(istream& (*f)(istream&, TP), TP a) : _f(f), _a(a) {}
     
    friend
      istream& operator>>(istream& i, const imanip<TP>& m);
};

template <class TP>
inline istream& operator>>(istream& i, const imanip<TP>& m)
{ return (*m._f)( i, m._a); }

 
 
 
 
template<class TP> class omanip; 

template<class TP> class oapp {
    ostream& (*_f)(ostream&, TP);
public: 
    oapp(ostream& (*f)(ostream&,TP)) : _f(f) {}
     
    omanip<TP> operator()(TP a)
      { return omanip<TP>(_f, a); }
};

template <class TP> class omanip {
    ostream& (*_f)(ostream&, TP);
    TP _a;
public:
    omanip(ostream& (*f)(ostream&, TP), TP a) : _f(f), _a(a) {}
     
    friend
      ostream& operator<<(ostream& o, const omanip<TP>& m);
};

template <class TP>
inline ostream& operator<<(ostream& o, const omanip<TP>& m)
{ return (*m._f)(o, m._a); }

 
 
 

 
 
 
 





extern ios& __iomanip_setbase  (ios&,   int ); inline   smanip <  int >   setbase  (  int  n) { return   smanip <  int > (__iomanip_setbase , n); } 
extern ios& __iomanip_setfill  (ios&,   int ); inline   smanip <  int >   setfill  (  int  n) { return   smanip <  int > (__iomanip_setfill , n); } 
extern ios& __iomanip_setprecision  (ios&,   int ); inline   smanip <  int >   setprecision  (  int  n) { return   smanip <  int > (__iomanip_setprecision , n); } 
extern ios& __iomanip_setw  (ios&,   int ); inline   smanip <  int >   setw  (  int  n) { return   smanip <  int > (__iomanip_setw , n); } 

extern ios& __iomanip_resetiosflags  (ios&,   ios::fmtflags ); inline   smanip <  ios::fmtflags >   resetiosflags  (  ios::fmtflags  n) { return   smanip <  ios::fmtflags > (__iomanip_resetiosflags , n); } 
extern ios& __iomanip_setiosflags  (ios&,   ios::fmtflags ); inline   smanip <  ios::fmtflags >   setiosflags  (  ios::fmtflags  n) { return   smanip <  ios::fmtflags > (__iomanip_setiosflags , n); } 
}  


# 24 "etc.cc" 2


# 1 "/usr/local2/lib/g++-include/strstream.h" 1 3
 























 




#pragma interface


# 1 "/usr/local2/lib/g++-include/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;
};

typedef struct _IO_strfile_
{
  struct _IO_FILE _f;
  const void *_vtable;
  struct _IO_str_fields _s;
} _IO_strfile;

 



 


# 33 "/usr/local2/lib/g++-include/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 = 0 )
	{ init_static(ptr, size, pstart); }
    strstreambuf(unsigned char *ptr, int size, unsigned char *pstart = 0 )
	{ 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 = 0 )
	{ 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(); }
};
}  


# 26 "etc.cc" 2

# 1 "/usr/local2/lib/g++-include/fstream.h" 1 3
 


























#pragma interface



extern "C++" {
class fstreambase : virtual public ios {

    mutable filebuf __my_fb;  

    void __fb_init ();
  public:
    fstreambase();
    fstreambase(int fd);
    fstreambase(int fd, char *p, int l);  
    fstreambase(const char *name, int mode, int prot=0664);
    void close();

    filebuf* rdbuf() const { return &__my_fb; }



    void open(const char *name, int mode, int prot=0664);
    int is_open() const { return rdbuf()->is_open(); }
    void setbuf(char *ptr, int len) { rdbuf()->setbuf(ptr, len); }
    void attach(int fd);




};

class ifstream : public fstreambase, public istream {
  public:
    ifstream() : fstreambase() { }
    ifstream(int fd) : fstreambase(fd) { }
    ifstream(int fd, char *p, int l) : fstreambase(fd, p, l) { }  
    ifstream(const char *name, int mode=ios::in, int prot=0664)
	: fstreambase(name, mode, prot) { }
    void open(const char *name, int mode=ios::in, int prot=0664)
	{ fstreambase::open(name, mode, prot); }
};

class ofstream : public fstreambase, public ostream {
  public:
    ofstream() : fstreambase() { }
    ofstream(int fd) : fstreambase(fd) { }
    ofstream(int fd, char *p, int l) : fstreambase(fd, p, l) { }  
    ofstream(const char *name, int mode=ios::out, int prot=0664)
	: fstreambase(name, mode, prot) { }
    void open(const char *name, int mode=ios::out, int prot=0664)
	{ fstreambase::open(name, mode, prot); }
};

class fstream : public fstreambase, public iostream {
  public:
    fstream() : fstreambase() { }
    fstream(int fd) : fstreambase(fd) { }
    fstream(const char *name, int mode, int prot=0664)
	: fstreambase(name, mode, prot) { }
    fstream(int fd, char *p, int l) : fstreambase(fd, p, l) { }  
    void open(const char *name, int mode, int prot=0664)
	{ fstreambase::open(name, mode, prot); }
};
}  

# 27 "etc.cc" 2


# 1 "etc.hh" 1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 









 
 
 
 



 







typedef float real;
 


 
void error(char *s);

 
void error(char *s, char* s2);


 
 
 
 





 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 


void read_inits(char *filename);
void read_inits(istream& instr);




void report_extra_inits();

#pragma interface
 
char *lookup(char *tag);

 
 
 
 
 

template <class T>
void 
do_init(char *tag, T& variable)
{
    char *valstr = lookup(tag);
    if (valstr == 0) 
      error("argument \"%s\" not found processing input", tag);
    istrstream ist(valstr, strlen(valstr));
    ist >> variable;
}

template <class T>
void 
do_init(char *tag, T& variable, T default_val)
{
    char *valstr = lookup(tag);
    if (valstr == 0) 
      variable = default_val;
    else {
	istrstream ist(valstr);
	ist >> variable;
    }
}



 
 
 

 
typedef enum {bogus_typ, uchar_typ, char_typ, ushort_typ, short_typ, uint_typ, int_typ, float_typ, double_typ} 
type_t;

 
 
type_t
string_to_type(char *tag);

 
char *
type_to_string(type_t the_type);

 
inline type_t type_of(unsigned char x) {return uchar_typ;}
inline type_t type_of(char x) {return char_typ;}
inline type_t type_of(unsigned short x) {return ushort_typ;}
inline type_t type_of(short x) {return short_typ;}
inline type_t type_of(unsigned int x) {return uint_typ;}
inline type_t type_of(int x) {return int_typ;}
inline type_t type_of(float x) {return float_typ;}
inline type_t type_of(double x) {return double_typ;}

 
template <class T>
char *
type_string(T& arg)
{
    return type_to_string(type_of(arg));
}

 
ostream&
operator<<(ostream& s, const type_t t);

 


 

 
int random(int max);

 
real random(real range);



























 



real radians_to_degrees(real rads);
real degrees_to_radians(real degrees);


# 229 "etc.hh"


inline int min(int a, int b)
{
    return (a < b) ? a : b;
}
inline int max(int a, int b)
{
    return (a > b) ? a : b;
}

inline real min(real a, real b)
{
    return (a < b) ? a : b;
}
inline real max(real a, real b)
{
    return (a > b) ? a : b;
}

inline double min(double a, double b)
{
    return (a < b) ? a : b;
}
inline double max(double a, double b)
{
    return (a > b) ? a : b;
}







inline int square(int a)
{
    return a * a;
}

inline real square(real a)
{
    return a * a;
}




 

 


extern "C" int irint(double);

inline int round(real a)
{
    return (irint((double) a));
}
# 297 "etc.hh"
















extern "C" double atan2(double y, double x);
extern "C" double sin(double theta);
extern "C" double cos(double theta);
extern "C" double sqrt(double x);
extern "C" double fabs(double x);

float sin(float theta);
float cos(float theta);
float atan2(float y, float x);
float sqrt(float x);
float fabs(float x);



istream& domatch(istream& s, char* str);



 
 

imanip<char *> eat(char *str);







 
float gauss(float inverse_sigma, float x);


 

typedef unsigned char uchar;

# 29 "etc.cc" 2


 
void cruise_table(void);

 
char *copy(char *s);



 
 





char *tag_table[1024 ];
char *val_table[1024 ];
char tag_used[1024 ];

int table_end = 0;

char tag_tmp[128 ];
char val_tmp[1024 ];


void read_inits(char *filename)
{
    ifstream from(filename);
    if (!from) error("failed to open initfile %s", filename);
    read_inits(from);
}


char *copy_to_string(istream& stream)
{
    stream.seekg(0,ios::end);	
    streampos length = stream.tellg();
    stream.seekg(0,ios::beg);	
    char *result = new char [length + 1];
    int i;
    for (i = 0; i < length; i++)
      stream.get(result[i]);
    result[i] = 0;
(cerr << "result" << " -> " << ( result ) << "\n"  << flush, ( result )) ; (cerr << "length" << " -> " << ( length ) << "\n"  << flush, ( length )) ;
    return result;
}


void delete_comments(char *str)
{
 
    int i = 0, j = 0, in_comment = false, c;
    while ((c = str[i++]) != 0 ) 
      if (in_comment) {
	  if (c == '\n') in_comment = false;
      } else {
	  if (c == '#') in_comment = true;
	  else str[j++] = c;
      }
    str[j] = 0;
 
}


void read_inits(istream& arg_instr)
{
    char *stuff = copy_to_string(arg_instr);
    delete_comments(stuff);
    istrstream instr(stuff, (cerr << "strlen(stuff)" << " -> " << ( strlen(stuff) ) << "\n"  << flush, ( strlen(stuff) )) );

    int i;
    for(i = 0; i < 1024 ; i++) tag_used[i] = 0;
    for(table_end = 0; table_end < 1024 ; table_end++) {
	 
        if (!(instr >> tag_tmp)) return;
	if (strlen(tag_tmp) > 128 ) error("name too long processing input");
	 
	int i;
	for (i = 0; i < 1024 ; i++) {
	    char c;
	    if (!instr.get(c)) error("missing value for %s", tag_tmp);
	    if (c == ';') break;
	    val_tmp[i] = c; 
	}
	val_tmp[i] = 0;
	if (i == 1024 ) 
	  error("value too long processing input for", tag_tmp);
	 
	tag_table[table_end] = copy(tag_tmp);
	val_table[table_end] = copy(val_tmp);	
    }
    delete [] stuff;
}

void report_extra_inits()
{
    int i;
    for (i = 0; i < table_end; i++)
      if (!tag_used[i])
	cerr << "Warning: unused TAG: " << tag_table[i] << " := " << val_table[i] << "\n";
}


void cruise_table()
{
    for(int i = 0; i < table_end; i++) 
      printf("%d %s:|%s|\n", i, tag_table[i], val_table[i]);
}


 
char *lookup(char *tag)
{
    for (int i = 0; 1; i++) {
	if (i == table_end) return(0);
	if (0 == strcmp(tag, tag_table[i])) {
	    tag_used[i] = 1;
	    return(val_table[i]);
	}
    }
}

 
char *copy(char *s)
{
    int len = strlen(s);
    char *result = new char [len + 1];
    strcpy(result, s);
    return result;
}


 
void error(char *m)
{
    error("%s", m);
}

 
void error(char *s, char *s2)
{
    fprintf((&_iob[2]) , "Error: ");
    fprintf((&_iob[2]) , s, s2);
    fprintf((&_iob[2]) , "\n");
    exit(-1);
}








extern "C" long random(void);

 
 
 
 

 







int random(int max)
{
    return (rand() % max);
}


 



 
real random(real range)
{
    return( range *(((real) (1 << 14) ) - random(2 * (1 << 14) )) / ((real) (1 << 14) ));
}



 

float sin(float theta)
{
    return((float)sin((double) theta));
}

float cos(float theta)
{
    return((float)cos((double) theta));
}

float atan2(float y, float x)
{
    return((float)atan2((double) y, (double) x));
}

float sqrt(float x)
{
    return((float) sqrt((double)x));
}

float fabs(float x)
{
    return (float) fabs((double) x);
}








 
istream& domatch(istream& s, char* str)
{
    for(int i = 0; str[i] != 0; i++){
	char c;
	s >> c;
	if (str[i] != c) s.clear(ios::badbit);
    }
    
    return s;
}


 
 

imanip<char *> eat(char *str)
{
    return imanip<char *>(&domatch, str);
}


 
# 293 "etc.cc"




 

real gauss(real inverse_sigma, real x)
{
    real tmp = inverse_sigma * x;
    return ((real) 0.3989422)  * inverse_sigma * exp(((real) -.5) * tmp * tmp);
}

real radians_to_degrees(real rads)
{
    return (((real) 180.0) / ((real) 3.1415927) ) * rads;
}

real degrees_to_radians(real degrees)
{
    return (((real) 3.1415927)  / ((real) 180.0)) * degrees;
}


static char *typestrings[] = {"ignore me", "uchar", "char", "ushort", "short", "uint", "int", "float", "double"};

type_t 
string_to_type(char *type_name)
{
    int elts = (sizeof(typestrings) / (sizeof(char *)));
    (cerr << "elts" << " -> " << ( elts ) << "\n"  << flush, ( elts )) ;
    (cerr << "type_name" << " -> " << ( type_name ) << "\n"  << flush, ( type_name )) ;
    for (int i = 1; i < elts ; i++)
      if (! strcmp(type_name, typestrings[i])) return((type_t) i);
    return(bogus_typ);
}

char *
type_to_string(type_t the_type)
{
    return typestrings[the_type];
}


ostream&
operator<<(ostream& s, const type_t t)
{
    return (s << type_to_string(t));
}

