home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / cug / softt-7.lbr / RATDEF.QQQ / RATDEF.
Text File  |  1984-07-05  |  9KB  |  334 lines

  1. #-h-  ratdef         8633  local  09/22/80  15:38:26
  2. #================= GENERAL SYMBOL DEFINITIONS =================
  3.  
  4. # General definitions for software tools
  5. # Should be put on a file named 'ratdef'
  6. # Used by all the tools; read automatically by preprocessor
  7.  
  8.  
  9. #   Many of these symbols may change for your particular machine.
  10. #   The values provided are intended as guidelines, and may
  11. #   well serve you adequately, but don't hesitate to change them if
  12. #   necessary.
  13.  
  14. # In particular, the following might have to change for your system:
  15. #         TERMINAL_IN
  16. #         TERMINAL_OUT
  17. #         MAXLINE
  18. #         FILENAMESIZE
  19. #         DRIVER    and    DRETURN
  20. #         MAXOFILES
  21. #         character
  22.  
  23. #   Also, watch out for the following definitions, which
  24. #   may conflict with the Fortran operators on your system:
  25. #       AND         OR        NOT
  26.  
  27.  
  28. #  Many of the definitions will be used in character variables.
  29. #  They must be defined to be something other than a valid ascii
  30. #  character--such as a number > 255 or a negative number.
  31. #  If you have defined "character" to be "integer", then you may
  32. #  use either a very large number or a small negative number.
  33. #  If you have defined "character" to be something like an 8-bit
  34. #  signed field, you'll need to use negative numbers.
  35. #  Use of a standard integer (whatever is the default size on your
  36. #  machine) is STRONGLY recommended, despite the apparent waste of
  37. #  storage.
  38.  
  39.  
  40. # ASCII control character definitions:
  41.  
  42. define(NUL,8%00)
  43. define(SOH,8%01)
  44. define(STX,8%02)
  45. define(ETX,8%03)
  46. define(EOT,8%04)
  47. define(ENQ,8%05)
  48. define(ACK,8%06)
  49. define(BEL,8%07)
  50. define(BS,8%10)
  51. define(HT,8%11)
  52. define(LF,8%12)
  53. define(VT,8%13)
  54. define(FF,8%14)
  55. define(CR,8%15)
  56. define(SO,8%16)
  57. define(SI,8%17)
  58. define(DLE,8%20)
  59. define(DC1,8%21)
  60. define(DC2,8%22)
  61. define(DC3,8%23)
  62. define(DC4,8%24)
  63. define(NAK,8%25)
  64. define(SYN,8%26)
  65. define(ETB,8%27)
  66. define(CAN,8%30)
  67. define(EM,8%31)
  68. define(SUB,8%32)
  69. define(ESC,8%33)
  70. define(FS,8%34)
  71. define(GS,8%35)
  72. define(RS,8%36)
  73. define(US,8%37)
  74. define(SP,8%40)
  75. define(DEL,8%177)
  76.  
  77.  
  78. # Synonyms for important non-printing ASCII characters:
  79.  
  80. define(BACKSPACE,8%10)
  81. define(BELL,8%07)
  82. define(BLANK,8%40)
  83. define(NEWLINE,8%12)
  84. define(RUBOUT,8%177)
  85. define(TAB,8%11)
  86.  
  87.  
  88. # Printable ASCII characters:
  89.  
  90. define(ACCENT,96)
  91. define(AMPER,38)           # ampersand
  92. define(AMPERSAND,AMPER)
  93. define(AND,AMPER)
  94. define(ATSIGN,64)
  95. define(BACKSLASH,92)
  96. define(BANG,33)            # exclamation mark
  97. define(BAR,124)
  98. define(BIGA,65)
  99. define(BIGB,66)
  100. define(BIGC,67)
  101. define(BIGD,68)
  102. define(BIGE,69)
  103. define(BIGF,70)
  104. define(BIGG,71)
  105. define(BIGH,72)
  106. define(BIGI,73)
  107. define(BIGJ,74)
  108. define(BIGK,75)
  109. define(BIGL,76)
  110. define(BIGM,77)
  111. define(BIGN,78)
  112. define(BIGO,79)
  113. define(BIGP,80)
  114. define(BIGQ,81)
  115. define(BIGR,82)
  116. define(BIGS,83)
  117. define(BIGT,84)
  118. define(BIGU,85)
  119. define(BIGV,86)
  120. define(BIGW,87)
  121. define(BIGX,88)
  122. define(BIGY,89)
  123. define(BIGZ,90)
  124. define(CARET,94)
  125. define(COLON,58)
  126. define(COMMA,44)
  127. define(DASH,45)            #same as MINUS
  128. define(DIG0,48)
  129. define(DIG1,49)
  130. define(DIG2,50)
  131. define(DIG3,51)
  132. define(DIG4,52)
  133. define(DIG5,53)
  134. define(DIG6,54)
  135. define(DIG7,55)
  136. define(DIG8,56)
  137. define(DIG9,57)
  138. define(DOLLAR,36)
  139. define(DQUOTE,34)
  140. define(EQUALS,61)
  141. define(ESCAPE,ATSIGN)      #escape character for ch, find, tr, ed, and sh
  142. define(GREATER,62)
  143. define(LBRACE,123)
  144. define(LBRACK,91)
  145. define(LESS,60)
  146. define(LETA,97)
  147. define(LETB,98)
  148. define(LETC,99)
  149. define(LETD,100)
  150. define(LETE,101)
  151. define(LETF,102)
  152. define(LETG,103)
  153. define(LETH,104)
  154. define(LETI,105)
  155. define(LETJ,106)
  156. define(LETK,107)
  157. define(LETL,108)
  158. define(LETM,109)
  159. define(LETN,110)
  160. define(LETO,111)
  161. define(LETP,112)
  162. define(LETQ,113)
  163. define(LETR,114)
  164. define(LETS,115)
  165. define(LETT,116)
  166. define(LETU,117)
  167. define(LETV,118)
  168. define(LETW,119)
  169. define(LETX,120)
  170. define(LETY,121)
  171. define(LETZ,122)
  172. define(LPAREN,40)
  173. define(MINUS,45)
  174. define(NOT,TILDE)  # used in pattern matching; choose ~, ^, or !
  175. define(OR,BAR)
  176. define(PERCENT,37)
  177. define(PERIOD,46)
  178. define(PLUS,43)
  179. define(QMARK,63)
  180. define(RBRACE,125)
  181. define(RBRACK,93)
  182. define(RPAREN,41)
  183. define(SEMICOL,59)
  184. define(SHARP,35)
  185. define(SLASH,47)
  186. define(SQUOTE,39)
  187. define(STAR,42)
  188. define(TAB,9)
  189. define(TILDE,126)
  190. define(UNDERLINE,95)
  191.  
  192.  
  193. # Ratfor language extensions:
  194.  
  195. define(andif,if)
  196. define(ARB,100)
  197. define(character,integer)  # define character data type
  198. define(CHARACTER,character)
  199. define(DS_DECL,integer $1($2);common/cdsmem/$1)
  200. define(elif,else if)
  201. define(filedes,integer)    # file descriptor/designator data type
  202. define(FILEDES,filedes)
  203. define(IS_DIGIT,(DIG0<=$1&$1<=DIG9))   # valid only for ASCII!
  204. define(IS_LETTER,(IS_UPPER($1)|IS_LOWER($1)))
  205. define(IS_LOWER,(LETA<=$1&$1<=LETZ))
  206. define(IS_UPPER,(BIGA<=$1&$1<=BIGZ))
  207. define(long_real,double precision)
  208. define(max,max0)
  209. define(MAX,max0)
  210. define(min,min0)
  211. define(MIN,min0)
  212. define(pointer,integer)
  213. define(POINTER,integer)
  214.  
  215.  
  216.  
  217. # Input/output modes:
  218.  
  219. define(APPEND,4)
  220. define(READ,1)
  221. define(READWRITE,3)
  222. define(WRITE,2)
  223.  
  224.  
  225. # Standard input/output ports:
  226.  
  227. define(ERROUT,3)           # standard error file
  228. define(STDERR,ERROUT)
  229. define(STDIN,1)            # standard input file
  230. define(STDOUT,2)           # standard output file
  231.  
  232.  
  233. # TERMINAL_IN and TERMINAL_OUT are the names of the I/O channels
  234. # from and to the user's terminal, respectively.  It's highly likely
  235. # there is no such thing on your system; in this case, simply invent
  236. # a name that is not likely to conflict with any file name.
  237. # For example, the VAX/VMS version of the tools uses "TT:", the RSX/11M
  238. # version uses "TT0:", the DEC 10 version uses "tty:", and the Prime
  239. # version uses "/dev/tty".
  240. # Note that you must make the 'open' primitive recognize this name
  241. # and provide access to the terminal accordingly.
  242.  
  243. define(TERMINAL_IN,"tty")
  244. define(TERMINAL_OUT,"tty")
  245.  
  246.  
  247. # Manifest constants included for readability and modifiability:
  248.  
  249. define(ALPHA,-9)
  250. define(ASCII,12)             # flag for ascii character file
  251. define(BEGINNING_OF_FILE,-2) # flag to seek for positioning at
  252.                              # the beginning of a file
  253. define(BINARY,60)            # flag for indicating binary file
  254. define(DIGIT,DIG0)
  255. define(END_OF_FILE,-1)       # flag to seek for positioning at
  256.                              # end of file
  257. define(EOF,-1)
  258. define(EOS,-2)
  259. define(ERR,-3)
  260. define(HUGE,30000)           # some arbitrarily large number
  261. define(LAMBDA,0)             # end of list marker
  262. define(LETTER,LETA)
  263. define(LOCAL,6)              # flag for local-type character file
  264. define(NO,0)
  265. define(NOERR,0)              # flag for successful completion
  266. define(OK,-2)                # success flag
  267. define(YES,1)
  268.  
  269.  
  270. # Size limiting definitions for important objects:
  271.  
  272. define(FILENAMESIZE,30)    # max characters in file name
  273.                            # (including EOS)
  274. define(MAXARG,128)         # max size of command line argument
  275. define(MAXCARD,80)         # "card" size
  276. define(MAXCHARS,20)        # max nbr of chars when converting
  277.                            # from integers to characters
  278.                            # (used by putint, outnum, etc.)
  279. define(MAXLINE,128)        # normal size of line buffers;
  280.                            # must be at least 1 more than MAXCARD
  281. define(MAXNAME,FILENAMESIZE)  # max size of file name
  282. define(MAXOFILES,6)        # max nbr opened files allowed at a time
  283. define(MAXPAT,128)         # max size of encoded patterns
  284.                            # (used in string matching)
  285. define(NCHARS,33)          # number of special characters
  286.  
  287.  
  288. # Machine-dependent parameters:
  289.  
  290. define(BITS_PER_CHAR,8)
  291. define(BITS_PER_WORD,16)
  292. define(CHARS_PER_WORD,2)
  293. define(MAX_INTEGER,32767)
  294. define(MIN_INTEGER,-32768)
  295. define(MAX_REAL_EXP,38)
  296. define(MIN_REAL_EXP,-38)
  297. define(REAL_PRECISION,6)
  298.  
  299.  
  300. # DRIVER is defined as those things you need to do to start a Software
  301. # Tools program running.  The following is a common approach, but you
  302. # may have to change it (for example, by adding a "program" card).
  303. # Many machines will require no special driver procedure other than
  304. # the call to 'initst'.
  305.  
  306. define(DRIVER,
  307.    call initst
  308.    ifelse($1,,   call main,   call $1)
  309.    call endst
  310.    end
  311.    ifelse($1,,   subroutine main,   subroutine $1)
  312.    )
  313.  
  314.  
  315. # DRETURN is used to finish up a Software Tools program:
  316.  
  317. define(DRETURN,return)   # (returning from subroutine defined in DRIVER)
  318.  
  319.  
  320. # Definitions for 'spawn' primitive (if implemented):
  321.  
  322. define(WAIT,LETW)              # wait for subprocess to complete
  323. define(NOWAIT,LETN)            # control returns as soon as
  324.                                # subprocess starts
  325. define(BACKGR,LETB)            # spawning a background process
  326.  
  327.  
  328. # It may be necessary to add special definitions; for example
  329. # names of important directories, substitute routine names for
  330. # Software Tools primitives that conflict with local subprograms,
  331. # etc.
  332. #-t-  ratdef         8633  local  09/22/80  15:38:26
  333. ou
  334. # may have to