home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / apps / languages / progs / curses / Source / h / general < prev    next >
Encoding:
Text File  |  1994-02-15  |  2.5 KB  |  117 lines

  1. /*
  2.  
  3.        This file is part of the PDP software package.
  4.          
  5.        Copyright 1987 by James L. McClelland and David E. Rumelhart.
  6.        
  7.        Please refer to licensing information in the file license.txt,
  8.        which is in the same directory with this source file and is
  9.        included here by reference.
  10. */
  11.  
  12.  
  13. /* general.h
  14.  
  15.     Some useful and general definitions for the PDP-PC package.
  16.  
  17.     First version implemented by Elliot Jaffe.
  18.     
  19.     Date of last revision:  8-12-87/JLM.
  20. */
  21.  
  22. #include <stdio.h>
  23. #include <ctype.h>
  24.  
  25. #ifdef MSDOS
  26. #define Interrupt (kbhit() == -999) || Interrupt_flag
  27. /* "Interrupt" is used to check whether the interrupt flag has been
  28. set by int_handler.  The call to kbhit is necessary for MSDOS to check whether
  29. the user has typed a control-C.  If a control-C has been typed, MSDOS will
  30. generate an interrupt, which will set the Interrupt flag (before the flag
  31. is evaluated).  kbhit() will never return -999; the call is there only to
  32. cause an interrupt-check.  Removing the kbhit call would render control-C
  33. ineffective. */
  34. #else
  35. #define Interrupt Interrupt_flag
  36. #endif
  37.  
  38.  
  39. #ifdef MSDOS
  40. #include <string.h>
  41.  
  42. #include <conio.h>  /* contains declaration of kbhit() */
  43.  
  44. extern int    sprintf();
  45. extern char    *index(); /* defined in general.c */
  46. extern char     xxtemp[200];
  47. extern int     io_type; /* normal or reverse video */
  48.  
  49. #else
  50. #include <strings.h>
  51. #ifndef hpux
  52. #ifndef __STDC__
  53. char   *sprintf ();
  54. #endif
  55. #endif hpux
  56. #endif MSDOS
  57. #include "display.h"
  58.  
  59. #ifdef hpux
  60. #define  index   strchr
  61. #define  rindex  strrchr
  62. #endif hpux
  63.  
  64. #define    FALSE    (0)
  65. #define TRUE    (1)
  66. #define BREAK        (1)
  67. #define CONTINUE    (0)
  68. #define POP        (2)
  69.  
  70. #define UPDATE    0
  71. #define CYCLE   1
  72. #define NCYCLES 2
  73. #define PATTERN 3
  74. #define EPOCH   4
  75. #define NEPOCHS    5
  76.  
  77. #define LINE_SIZE BUFSIZ
  78.  
  79. extern  char err_string[LINE_SIZE];
  80. typedef int boolean;
  81.  
  82. int     quit ();
  83. char   *malloc ();
  84. char   *emalloc ();
  85. char   *erealloc ();
  86. char   *realloc ();
  87. char   *strsave ();
  88. double  atof ();
  89.  
  90. int     rand ();
  91.  
  92. #ifdef MSDOS
  93.  
  94. #define strindex strchr
  95. /* #define rnd() ((float)rand()/32767.0) faster to multiply -- jlm */
  96. #define rnd()    ((float)rand()*3.0518507e-5) 
  97.  
  98. #else
  99.  
  100. /* #define rnd() ((float)rand()/2147483647.0) faster to multiply -- jlm */
  101. #define rnd() ((float)rand()*0.4656612875e-9) 
  102.  
  103. #define strindex index
  104.  
  105. #endif
  106.  
  107. #define STRINGLENGTH    40
  108.  
  109. extern  FILE * in_stream;    /* the general input stream */
  110. extern int  Interrupt_flag;
  111. extern int  single_flag;
  112. extern int  random_seed;
  113. extern char step_string[STRINGLENGTH];
  114. extern char *Default_step_string;
  115. extern int  step_size;
  116. extern boolean  start_up;
  117.