/**************************************************************************/
/*                                                                        */
/*                                 Sources                                */
/*                                from  the                               */
/*                           XSC SOFTWARE PACKAGE                         */
/*                                                                        */
/*                Copyright (c) 1997 University of Karlsruhe              */
/*                     Institute for Appl. Mathematics                    */
/*                                                                        */
/* This program is free software for non-commercial use. For details, see */
/* the file LICENSE.XSC, distributed with this software package.          */
/*                                                                        */
/* This program is distributed WITHOUT ANY WARRANTY. For details, see the */
/* file LICENSE.XSC, distributed with this software package.              */
/*                                                                        */
/**************************************************************************/

/* RCS $Id: r_fcth.h,v 1.6 1997/09/25 16:46:31 ae59 Exp $ */
/*
$Log: r_fcth.h,v $
 * Revision 1.6  1997/09/25  16:46:31  ae59
 * Copyright-message
 *
 * Revision 1.5  1996/03/22  15:05:37  ae59
 * Hardware support for RS6000 with precise and imprecise (default) traps
 *
 * Revision 1.4  1996/03/18  12:18:06  ae59
 * Hardware support for sparc solaris
 *
 * Revision 1.3  1995/09/04  16:51:52  ae59
 * hardware support for ibm_emx_c similar to ibm_linux_c
 *
 * Revision 1.2  1995/08/17  12:45:25  ae59
 * support for linux-387 added by CB
 *
 * Revision 1.1  1994/01/27  13:23:58  ae59
 * Put under RCS control
 *
 */
/****************************************************************/
/*                                                              */
/*      Filename        : r_fcth.h                              */
/*                                                              */
/*      Description     : function prototypes                   */
/*                                                              */
/*      Date    : 1993-12-01                                    */
/*      1995-08-10 cb : i486 linux hardware                     */
/*      1993-12-01 : add DEC_ARITH, r_writ, r_read new prot =b= */
/*      1993-08-25 : use _Prototype     =b=                     */
/*      1992-07-24 : add r_lfsr         =b=                     */
/*      1992-07-22 : add r_fini, r_ftrp =b=                     */
/*                   include files for hardware                 */
/*      1992-02-07 : chg a_char to char in r_cnst,r_cnsd,       */
/*                   r_cnsu =b=                                 */
/*      1992-01-21 : r_frac()                                   */
/*      1991-11-07 : r_valu()                                   */
/*      1991-09-06 : reduce maximum line length                 */
/*      1991-01-22 : r_pcmp()                                   */
/*      1990-11-28 : i_read()                                   */
/*      1990-11-20 : args of i_cns2/i_cnst are of type a_char * */
/*      1990-10-31 : r_rval()                                   */
/*      1990-10-24 : r_cnsd(),r_cnsu(),i_cnst(),i_cns2()        */
/*      1990-10-23 : new argument to r_conv()                   */
/*      1990-10-22 : new argument to r_sval()                   */
/*      1990-10-18 : i_*() = interval routines                  */
/*      1990-10-15 : r_aval replaces r_rval, new r_sval         */
/*      1990-09-04 : r_rdcr                                     */
/*      1990-09-03 : r_lg10,r_log2,r_ep10,r_exp2                */
/*      1990-07-30 : char replaced by a_char                    */
/****************************************************************/

#ifdef IEEE_HARDWARE
/* need sigcontext at r_ftrp */
#if SUN4_OS4_C+SUN4_GNU_C
#include <signal.h>
#include <floatingpoint.h>
#include <sys/ieeefp.h>
#endif /* sun */
#if SUN4_CPP_C
#include <signal.h>
#include <floatingpoint.h>
#endif /* sun */
#if SUN4_OS5_GNU_C
#include <signal.h>
#include <siginfo.h>
#include <ucontext.h>
#endif /* solaris */
#if IBM_LINUX_C+IBM_EMX_C
#include <signal.h>
#endif /* IBM_LINUX_C */
#if IBM_RS6000_C
#include <signal.h>
#include <fpxcp.h>
#include <fptrap.h>
#endif /* IBM_RS6000_C */
#endif

_PROTOTYPE( a_intv  i_acos,(a_intv a));
_PROTOTYPE( a_intv  i_acot,(a_intv a));
_PROTOTYPE( a_intv  i_acsh,(a_intv a));
_PROTOTYPE( a_intv  i_acth,(a_intv a));
_PROTOTYPE( a_intv  i_asin,(a_intv a));
_PROTOTYPE( a_intv  i_asnh,(a_intv a));
_PROTOTYPE( a_intv  i_atan,(a_intv a));
_PROTOTYPE( a_intv  i_atnh,(a_intv a));
_PROTOTYPE( a_intv  i_cnst,(a_char *str));
_PROTOTYPE( a_intv  i_cns2,(a_char *stl,a_char *str));
_PROTOTYPE( a_intv  i_cos,(a_intv a));
_PROTOTYPE( a_intv  i_cosh,(a_intv a));
_PROTOTYPE( a_intv  i_cot,(a_intv a));
_PROTOTYPE( a_intv  i_coth,(a_intv a));
_PROTOTYPE( a_intv  i_ep10,(a_intv a));
_PROTOTYPE( a_intv  i_exp,(a_intv a));
_PROTOTYPE( a_intv  i_exp2,(a_intv a));
_PROTOTYPE( a_intv  i_lg10,(a_intv a));
_PROTOTYPE( a_intv  i_log,(a_intv a));
_PROTOTYPE( a_intv  i_loga,(a_intv a,a_real base));
_PROTOTYPE( a_intv  i_log2,(a_intv a));
_PROTOTYPE( a_intv  i_pow,(a_intv a,a_intv x));
_PROTOTYPE( void    i_read,(FILE *device,a_intv *s,int i));
_PROTOTYPE( a_intv  i_sin,(a_intv a));
_PROTOTYPE( a_intv  i_sinh,(a_intv a));
_PROTOTYPE( a_intv  i_sqrt,(a_intv a));
_PROTOTYPE( a_intv  i_tan,(a_intv a));
_PROTOTYPE( a_intv  i_tanh,(a_intv a));
_PROTOTYPE( a_real  r_abs ,(a_real a));
_PROTOTYPE( a_real  r_acos,(a_real a));
_PROTOTYPE( a_real  r_acot,(a_real a));
_PROTOTYPE( a_real  r_acsh,(a_real a));
_PROTOTYPE( a_real  r_acth,(a_real a));
_PROTOTYPE( a_real  r_addd,(a_real a,a_real b));
_PROTOTYPE( a_real  r_addn,(a_real a,a_real b));
_PROTOTYPE( a_real  r_addu,(a_real a,a_real b));
_PROTOTYPE( a_real  r_asin,(a_real a));
_PROTOTYPE( a_real  r_asnh,(a_real a));
_PROTOTYPE( void    r_ass ,(a_real *x,a_real y));
_PROTOTYPE( a_real  r_atan,(a_real a));
_PROTOTYPE( a_real  r_atn2,(a_real a,a_real b));
_PROTOTYPE( a_real  r_atnh,(a_real a));
_PROTOTYPE( a_real  r_aval,(a_char s[],a_intg n,a_intg rnd));
_PROTOTYPE( a_real  r_ceil,(a_real r));
_PROTOTYPE( a_intg  r_clss,(a_real x));
_PROTOTYPE( a_real  r_cnsd,(char *str));
_PROTOTYPE( a_real  r_cnst,(char *str));
_PROTOTYPE( a_real  r_cnsu,(char *str));
_PROTOTYPE( a_real  r_comp,(a_real m,a_intg e));
_PROTOTYPE( void    r_conv,(a_char *str,a_real *s,a_intg rnd,a_char **next));
_PROTOTYPE( a_real  r_cos ,(a_real a));
_PROTOTYPE( a_real  r_cosh,(a_real a));
_PROTOTYPE( a_real  r_cot ,(a_real a));
_PROTOTYPE( a_real  r_coth,(a_real a));
_PROTOTYPE( a_real  r_divd,(a_real a,a_real b));
_PROTOTYPE( a_real  r_divn,(a_real a,a_real b));
_PROTOTYPE( a_real  r_divu,(a_real a,a_real b));
_PROTOTYPE( a_real  r_ep10,(a_real a));
_PROTOTYPE( a_bool  r_eq  ,(a_real a,a_real b));
_PROTOTYPE( a_real  r_exp ,(a_real a));
_PROTOTYPE( a_real  r_exp2,(a_real a));
_PROTOTYPE( a_intg  r_expo,(a_real m));
_PROTOTYPE( void    r_fini,(void));

#ifdef IEEE_HARDWARE
_PROTOTYPE( void    r_lfsr,(void));

#if SUN4_OS4_C+SUN4_GNU_C+SUN4_CPP_C
_PROTOTYPE( void    r_ftrp,( int sig, int code, 
			     struct sigcontext *scp , char *addr));
#endif
#if SUN4_OS5_GNU_C
_PROTOTYPE( void    r_lfsx,(int fsr));
_PROTOTYPE( void    r_ftrp,(int sig, siginfo_t *sip, ucontext_t *ucp));
#endif
#if HP_9000_C
_PROTOTYPE( void r_ftrp,(int code));
#endif
#if IBM_LINUX_C+IBM_EMX_C
_PROTOTYPE( void r_ftrp,(int sig) );
#endif /* IBM_LINUX_C */
#if IBM_RS6000_C
_PROTOTYPE( void r_ftrp,(int sig, int code, struct sigcontext *scp));
#endif /* IBM_RS6000_C */
#else /* ieee_hardware */
_PROTOTYPE( void r_ftrp,(void));
#endif
_PROTOTYPE( a_real  r_flor,(a_real r));
_PROTOTYPE( a_real  r_flot,(a_intg i));
_PROTOTYPE( a_real  r_frac,(a_real r));
_PROTOTYPE( a_bool  r_ge  ,(a_real a,a_real b));
_PROTOTYPE( a_bool  r_gt  ,(a_real a,a_real b));
_PROTOTYPE( a_bool  r_le  ,(a_real a,a_real b));
_PROTOTYPE( a_bool  r_lt  ,(a_real a,a_real b));
_PROTOTYPE( a_real  r_lg10,(a_real a));
_PROTOTYPE( a_real  r_log ,(a_real a));
_PROTOTYPE( a_real  r_log2,(a_real x));
_PROTOTYPE( a_real  r_loga,(a_real x,a_real a));
_PROTOTYPE( a_real  r_mant,(a_real m));
_PROTOTYPE( a_real  r_muld,(a_real a,a_real b));
_PROTOTYPE( a_real  r_muln,(a_real a,a_real b));
_PROTOTYPE( a_real  r_mulu,(a_real a,a_real b));
_PROTOTYPE( a_bool  r_ne  ,(a_real a,a_real b));
_PROTOTYPE( void    r_outp,(char *buffer,a_real s,a_intg TotalWidth,
               a_intg FracDigits,a_intg rnd,a_intg *length));
_PROTOTYPE( a_intg  r_pcmp,(a_real a,a_real b,a_real c,a_real d));
_PROTOTYPE( a_real  r_pow ,(a_real a,a_real b));
_PROTOTYPE( a_real  r_pred,(a_real a));
_PROTOTYPE( void    r_rdcr,(FILE *device,a_real *s,a_intg rnd,int i));
#ifdef DEC_ARITH
_PROTOTYPE( void    r_read,(f_text *device,a_real *s,a_intg rnd));
#else
_PROTOTYPE( void    r_read,(FILE *device,a_real *s,a_intg rnd,int i));
#endif
_PROTOTYPE( a_intg  r_rond,(a_real a));
_PROTOTYPE( a_real  r_rval,(s_trng s,a_intg rnd));
_PROTOTYPE( a_intg  r_sign,(a_real a));
_PROTOTYPE( a_real  r_sin ,(a_real a));
_PROTOTYPE( a_real  r_sinh,(a_real a));
_PROTOTYPE( a_real  r_sqr_,(a_real a));
_PROTOTYPE( a_real  r_sqrt,(a_real a));
_PROTOTYPE( a_real  r_subd,(a_real a,a_real b));
_PROTOTYPE( a_real  r_subn,(a_real a,a_real b));
_PROTOTYPE( a_real  r_subu,(a_real a,a_real b));
_PROTOTYPE( a_real  r_succ,(a_real a));
_PROTOTYPE( a_real  r_sval,(s_trng s,a_intg rnd,s_trng *r));
_PROTOTYPE( a_real  r_tan ,(a_real a));
_PROTOTYPE( a_real  r_tanh,(a_real a));
_PROTOTYPE( a_intg  r_trun,(a_real a));
_PROTOTYPE( a_real  r_umin,(a_real a));
_PROTOTYPE( a_real  r_valu,(a_intg x));
#ifdef DEC_ARITH
_PROTOTYPE( void    r_writ,(f_text *device,a_real s,a_intg TotalWidth,
               a_intg FracDigits,a_intg rnd));
#else
_PROTOTYPE( void    r_writ,(FILE *device,a_real s,a_intg TotalWidth,
               a_intg FracDigits,a_intg rnd));
#endif
