/**************************************************************************/
/*                                                                        */
/*                                 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: o_syst.h,v 1.8 1997/09/25 16:45:52 ae59 Exp $ */
/*
$Log: o_syst.h,v $
 * Revision 1.8  1997/09/25  16:45:52  ae59
 * Copyright-message
 *
 * Revision 1.7  1995/09/12  08:54:17  ae59
 * defined INTEL for Watcom C
 *
 * Revision 1.6  1995/01/24  14:56:13  ae59
 * add CHAM_32_c and CHAM_64_c for chameleon C compiler
 *
 * Revision 1.5  1995/01/20  09:33:32  ae59
 * add IBM_LINUX_c
 * ,
 *
 * Revision 1.4  1994/10/25  11:19:28  ae59
 * add DECALPHA
 *
 * Revision 1.3  1994/09/20  08:42:27  ae59
 * EMX needs setting of intel
 *
 * Revision 1.2  1994/05/05  13:54:03  ae59
 * no INTEL for IBM_emx_cc
 *
 * Revision 1.1  1994/01/27  13:23:39  ae59
 * Put under RCS control
 *
 */
/****************************************************************/
/*                                                              */
/*      Filename        : o_syst.h                              */
/*                                                              */
/*      Date            : 1993-08-23                            */
/*      1993-08-23 : B_TYPINI defined        =b=                */
/*      1993-01-15 : unique flag for zortech =b=                */
/*      1992-12-17 : IBM_OS2_Icc_c added     =b=                */
/*      1992-04-13 : IBM...BOR_C added       =b=                */
/*      1992-04-10 : Intel is set Vax_UNIX_c =b=                */
/*      1992-01-28 : DEC_ULTRIX_C                               */
/*      1991-09-06 : no continuation line in #if                */
/****************************************************************/

/* -------- Operating System Selection ------------------------ */

/* This option specifies the way data is stored in memory       */
/* cells.                                                       */
/* 0 - most significant byte at high address                    */
/* 1 - most significant byte at low address (Intel)             */
#define DUMMY_INTEL IBM_AT_MS_C+IBM_AT_TURBO_C+IBM_PS2_C+T800_HELIOS_C\
                    +IBM_AT_BOR_C+IBM_OS2_ICC_C+IBM_EMX_C+IBM_LINUX_C
#if DUMMY_INTEL+GNU_C+ZORTECH_C+VAX_VMS_C+VAX_UNIX_C+DEC_ULTRIX_C+DEC_ALPHA_C+\
    CHAM_32_C+CHAM_64_C+IBM_WATCOM_C
#define INTEL           1
#else
#define INTEL           0
#endif

/* -------- Operating System Properties ----------------------- */

/*    Special memory set operation available which initializes  */
/*    a certain amount of memory.                               */
/*    1 - char *memset(char *s,int c,size_t n)                  */
#define O_P_1           1

/*    Special memory copy operation available which copies      */
/*    a certain amount of memory.                               */
/*    1 - char *memcpy(char *s1,char *s2,size_t n)              */
#define O_P_2           1

/*    Special memory compare operation available which compares */
/*    a certain amount of memory.                               */
#define O_P_3           0

/*    Data for Intel processors is stored in reverse order, i.e.*/
/*    high storage addresses hold upper parts of data.          */
/*    This option is 1 if INTEL is selected.                    */
#define O_P_4           INTEL

/* -------- Operating System Dependent Macros ----------------- */

/*    Clear all bits of a 'a_btyp' array.                       */
/*    Actual argument s must not be an expression.              */
#if O_P_1
#define B_CLEAR(s,n)    { \
        (void)memset((char *)(s),(int)'\0',(size_t)((n)*sizeof(a_btyp)));}
#else
#define B_CLEAR(s,n) {size_t _; _=n; while(--_>=0) (s)[_]=ZERO;}
#endif

/*    Copy all bits of a 'a_btyp'/'char' array from left to right.     */
/*    Actual arguments d and s must not be expressions.                */
#if O_P_2
#define B_COPY(d,s,n)   { \
        (void)memcpy((char *)(d),(char *)(s),(size_t)((n)*sizeof(a_btyp)));}
#define C_COPY(d,s,n)   { \
        (void)memcpy((char *)(d),(char *)(s),(size_t)(n)); }
#else
#define B_COPY(d,s,n) {size_t _; _=n; while(--_>=0) (d)[_]=(s)[_];}
#define C_COPY(d,s,n) {size_t _; _=n; while(--_>=0) (d)[_]=(s)[_];}
#endif

/*    Compare all bits of 'a_btyp' arrays from left to right.   */
/*    Actual arguments d and s must not be expressions.         */
#if O_P_3
#else
#endif

/*    Specify indices of most significant and least significant */
/*    part of a a_btyp array which is equivalenced with a real  */
/*    number (D_U_RATIO = sizeof(a_real)/sizeof(a_btyp))        */
#if O_P_4
#define B_HPART         (D_U_RATIO-1)
#define B_LPART         0
#define B_TYPINI(a,b)   { b,a }       
#else
#define B_HPART         0
#define B_LPART         (D_U_RATIO-1)
#if CRAY_UNIX_C
#define B_TYPINI(a,b)   { (a<<B_LENGTH)+b }       
#else
#define B_TYPINI(a,b)   { a,b }       
#endif
#endif
