Annotation of researchv10dc/cmd/bcp/CPU.h, revision 1.1.1.1

1.1       root        1: /* Copyright (c) 1989, 1990 AT&T --- All Rights Reserved.              */
                      2: /* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T.                */
                      3: /* The copyright notice does not imply actual or intended publication. */
                      4: /* AUTHORS:                                            */
                      5: /*     H. S. Baird - ATT-BL MH - first versions        */
                      6: /*     T. Thompson - ATT-BL HO - portable versions     */
                      7: /*     C. Macey - ATT-DSG LZ - portable versions       */
                      8: 
                      9: /* Specify the environment:  CPU, OS, graphics, etc.
                     10:    This is an attempt to maintain a single master source tailorable at compile
                     11:    time, while encapsulating as many as possible of the required #if's and
                     12:    #ifdef's in this one file.
                     13:    OS-dependent #includes are triggered by these prior statements:
                     14:        #define LIBC_INCL 1             -- strcpy(), etc
                     15:        #define VALUES_INCL 1           -- math constants (PI etc)
                     16:        #define FILE_TREE_INCL 1        -- UNIX file-tree walking
                     17:    */
                     18: 
                     19: /* CPUs with some support: */
                     20: #define VAX 0
                     21: #define CRAY 1
                     22: #define SUN 2          /* including SPARC */
                     23: #define ATT3B 3
                     24: #define I386 4
                     25: #define MIPS 5         /* including SGI */
                     26: 
                     27: /*** Select CPU here: */
                     28: #define CPU VAX
                     29: 
                     30: 
                     31: /* Operating systems with some support: */
                     32: #define V9_OS 1                /* ATT-BL research UNIX, 9th edition */
                     33: #define SV_OS 2                /* ATT UNIX System V */
                     34: #define SUN_OS 3       /* Sun OS 4.x */
                     35: 
                     36: /*** Select OS here: */
                     37: #define OS V9_OS
                     38: 
                     39: 
                     40: /* Graphics display environments with some support: */
                     41: #define NO_GRAPHICS 0  /* defeat all graphics */
                     42: #define Y_GRAPHICS 1   /* the Y graphics interface (used in 1127 for Metheus) */
                     43: #define SUN_GRAPHICS 2 /* Tim Thompson's Sun interface */
                     44: #define X_GRAPHICS 3    /* Mark Tuomenoksa's X interface */
                     45: 
                     46: /*** Select graphics environment here: */
                     47: #define GRAPHICS Y_GRAPHICS
                     48: 
                     49: 
                     50: /* OCR installation directory */
                     51: #ifndef OCRDIR
                     52: #define OCRDIR "/usr/ocr"
                     53: #endif
                     54: 
                     55: /*** Miscellaneous arcane options:  best left alone **/
                     56: 
                     57: #define FILE_TREE (1)          /* set to zero to defeat UNIX file tree code */
                     58: 
                     59: 
                     60: /*** END OF SELECTIONS ** The rest of this file merely implements their effects */
                     61: 
                     62: /* define byte ordering in CPU */
                     63: 
                     64: #if CPU == SUN || CPU == MIPS
                     65: #define BIG_ENDIAN 1
                     66: #endif
                     67: 
                     68: /* deal with compilers that don't like (void *) */
                     69: 
                     70: #if CPU == MIPS
                     71: #define VOID char
                     72: #else
                     73: #define VOID void
                     74: #endif
                     75: 
                     76: /* include libc functions defs, if necessary */
                     77: 
                     78: #if LIBC_INCL
                     79: 
                     80: #if OS == V9_OS || CPU == CRAY
                     81: #include <libc.h>
                     82: #else
                     83: #if OS == SV_OS || OS == SUN_OS || CPU == MIPS
                     84: #include <string.h>
                     85: #endif
                     86: #endif
                     87: 
                     88: #endif
                     89: 
                     90: /* include values */
                     91: 
                     92: #if VALUES_INCL
                     93: #include <values.h>
                     94: #endif
                     95: 
                     96: /* UNIX file-tree-walk includes */
                     97: 
                     98: #if FILE_TREE_INCL
                     99: 
                    100: #if CPU==VAX || CPU==CRAY || CPU==MIPS
                    101: #include <sys/types.h>
                    102: #include <sys/stat.h>
                    103: #include <ftw.h>
                    104: #else
                    105: #if CPU==SUN || CPU==I386
                    106: #include <sys/types.h>
                    107: #include <sys/stat.h>
                    108: #include "myftw.h"  /* T. Thompson's version */
                    109: #endif
                    110: #endif
                    111: 
                    112: #endif
                    113: 
                    114: #if CPU==SUN||CPU==ATT3B||CPU==MIPS||CPU==I386
                    115: #define sgn(V) (((V)>0)? 1: (((V)<0)? -1: 0))
                    116: #endif 
                    117: 
                    118: #if CPU==SUN||CPU==ATT3B||CPU==MIPS
                    119: /* These are all big-endian machines */
                    120: #define swapshortin(x) (((x)<<8)&0xff00)|(((x)>>8)&0xff)
                    121: #define swapintin(x) \
                    122:                ((((x)<<24)&0xff000000)| \
                    123:                 (((x)<<8) &0x00ff0000)| \
                    124:                 (((x)>>8) &0x0000ff00)| \
                    125:                 (((x)>>24)&0x000000ff))
                    126: /* The order of bytes in an int */
                    127: #define INDEX0 3
                    128: #define INDEX1 2
                    129: #define INDEX2 1
                    130: #define INDEX3 0
                    131: /* disable fast trick for picking out a short from an int */
                    132: #define USESHIFT       /* cf. skewlib.c */
                    133: #else
                    134: #define swapshortin(x) (x)
                    135: #define swapintin(x) (x)
                    136: #define INDEX0 0
                    137: #define INDEX1 1
                    138: #define INDEX2 2
                    139: #define INDEX3 3
                    140: #endif
                    141: 
                    142: /* global max no. classes -- gradually being made dynamic everywhere */
                    143: #if CPU==SUN
                    144: #define MAX_CL 128
                    145: #else
                    146: #define MAX_CL 3200    /* adequate for JIS Level 1 */
                    147: #endif
                    148: 
                    149: /* include char types (is this really necessary?) */
                    150: 
                    151: #if CTYPE_INCL
                    152: 
                    153: #if CPU == SUN
                    154: #include <string.h>
                    155: #else
                    156: #include <ctype.h>
                    157: #endif
                    158: 
                    159: #endif
                    160: 
                    161: /* includes for atan2 special configurations */
                    162: 
                    163: #if ATAN_INCL
                    164: 
                    165: #if CPU == CRAY
                    166: #define use_fast_atan2 F
                    167: #include "CRAY.h"
                    168: #else
                    169: #define use_fast_atan2 T
                    170: #endif
                    171: 
                    172: #endif
                    173: 
                    174: /* regular expression includes (fix to use standard regexp?) */
                    175: 
                    176: #if REGEXP_INCL
                    177: 
                    178: #if OS == V9_OS
                    179: #include <regexp.h>
                    180: #else
                    181: #include "regexp.h"
                    182: #endif
                    183: 
                    184: #endif
                    185: 
                    186: /* Use of the graphics display */
                    187: 
                    188: #if CPU != CRAY
                    189: #define SHOW_GRAPHICS 1
                    190: #endif
                    191: 
                    192: #ifndef PI
                    193: #define PI 3.14159265358979323846
                    194: #endif

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.