home *** CD-ROM | disk | FTP | other *** search
/ nisttime.carsoncity.k12.mi.us / nisttime.carsoncity.k12.mi.us.tar / nisttime.carsoncity.k12.mi.us / pub / acts / nistime.h < prev    next >
C/C++ Source or Header  |  1996-11-07  |  4KB  |  110 lines

  1. /*
  2.     include file nistime.h
  3.  
  4.     this file is used to define the constants
  5.     that govern the compilation of program NISTIME.
  6.  
  7.     if the constant IBMPC is defined then the
  8.     program is intended to run on an IBM-PC
  9.     (or equivalent machine) under MSDOS.
  10.  
  11.     if the constant SUN is defined then the
  12.     program is intended to run on a SUN work
  13.     station.  This version is as non-specific
  14.     as possible so that it should run with only
  15.     minor modifications in other unix environments.
  16.  
  17.     the DOS version of the program assumes that the 
  18.     declaration "int" implies a 16-bit quantity and 
  19.     that a "long int" is 32-bits long.  some work-station
  20.     environments use 32-bit quantities for both "int"
  21.     and "long int" with 16-bit quantities defined as
  22.     "short int". This should not be a problem in most
  23.     cases, since there is usually no harm is using a
  24.     32-bit integer when a 16-bit one would have been
  25.     sufficient.
  26.     The code may not work, however, if the machine uses
  27.     64 bits for a "long int" and 32-bits for an "int"
  28.     (e.g., DEC Alpha).  The long-int declarations will
  29.     then produce 64 bit quantities which will not be
  30.     correct in many cases (mostly when the quantity
  31.     is passed by reference to a system subroutine which
  32.     expects a parameter that is 32 bits long, but possibly
  33.     in other situations as well).
  34.  
  35.     therefore --
  36.     if SUN is defined and if the machine uses 16 or 32 bits 
  37.     for an "int" and 32 bits for a "long int" then define
  38.     B64 as 0.
  39.     if SUN is defined and if the machine uses 64 bits for a 
  40.     "long int" then define B64 as 1.  The only common machine
  41.     currently in this category is a DEC Alpha-based system.
  42.     if MSDOS is defined then B64 should be 0 since a long
  43.     int is 32 bits in this environment.
  44.  
  45.     these two definitions are in the include file sizint.h,
  46.     and that file should be edited appropriately by
  47.     removing the definitions from the comment block
  48.     (note that some
  49.     compilers require that pre-processor directives of 
  50.     this type start in col 1.)
  51. */
  52. /*    #define IBMPC  1*/
  53. #define SUN   1
  54. #include "sizint.h"
  55. /*
  56.     There are two MSDOS versions of the program:
  57.  
  58.     if the constant BIOS is defined, then the
  59.     program will access the RS-232 port via calls
  60.     to the system BIOS.
  61.  
  62.     if the constant BIOS is not defined, then the
  63.     program uses direct input/output via inport and outport.
  64.  
  65.     if the following line is not a comment, then input/output
  66.     will be done via calls to the BIOS.
  67. */
  68. /*
  69.     #define BIOS 1
  70. */
  71. /*
  72.     if IBMPC is defined, then an MSDOS version is being
  73.     generated.  In that case, if direct input/output is
  74.     to be used, the following constants define the
  75.     offsets from the port address for the various
  76.     registers of the rs-232 device.
  77. */
  78. #ifdef IBMPC
  79. #ifndef BIOS
  80. #define txbuf  0        /* transmit buffer offset */
  81. #define rxbuf  0        /* receiver buffer offset */
  82. #define divlsb 0        /* divisor latch, low part */
  83. #define divmsb 1        /* divisor latch, high part */
  84. #define intena 1        /* interrupt enable register */
  85. #define intid  2        /* interrupt ident. register */
  86. #define lcreg  3        /* line control register */
  87. #define modreg 4        /* modem control register */
  88. #define lsreg  5        /* line status register   */
  89. #define msreg  6        /* modem status register  */
  90. #endif
  91. #endif
  92. /*
  93.     if this is the UNIX version then parameter tickus
  94.     gives the time interval between ticks in microseconds.
  95.     typical values are 20 milliseconds for a SUN,
  96.     10 milliseconds for a VAX and 3906 milliseconds for
  97.     a DEC ULTRIX/RISC machine.
  98.     this value is used in the interpolation routines
  99.     interp.c, arcdif.c and parset.c.  If this parameter
  100.     is specified as 0 then the interpolation between ticks
  101.     is disabled and the comparison will use the integer
  102.     tick value as read from the system clock.
  103.     this constant is not needed in the MS-DOS environment
  104.     since all of those machines use a constant value of
  105.     18.2 ticks/second or about 55 milliseconds between ticks.
  106. */
  107. #ifdef SUN
  108. long int tickus = 3906;
  109. #endif
  110.