home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / games / volume16 / nethck31 / part98 < prev    next >
Encoding:
Internet Message Format  |  1993-02-05  |  59.1 KB

  1. Path: uunet!news.tek.com!master!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v16i106:  nethack31 - display oriented dungeons & dragons (Ver. 3.1), Part98/108
  5. Message-ID: <4471@master.CNA.TEK.COM>
  6. Date: 5 Feb 93 22:03:18 GMT
  7. Sender: news@master.CNA.TEK.COM
  8. Lines: 2079
  9. Approved: billr@saab.CNA.TEK.COM
  10. Xref: uunet comp.sources.games:1657
  11.  
  12. Submitted-by: izchak@linc.cis.upenn.edu (Izchak Miller)
  13. Posting-number: Volume 16, Issue 106
  14. Archive-name: nethack31/Part98
  15. Supersedes: nethack3p9: Volume 10, Issue 46-108
  16. Environment: Amiga, Atari, Mac, MS-DOS, OS2, Unix, VMS, X11
  17.  
  18.  
  19.  
  20. #! /bin/sh
  21. # This is a shell archive.  Remove anything before this line, then unpack
  22. # it by saving it into a file and typing "sh file".  To overwrite existing
  23. # files, type "sh file -c".  You can also feed this as standard input via
  24. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  25. # will see the following message at the end:
  26. #        "End of archive 98 (of 108)."
  27. # Contents:  dat/castle.des dat/medusa.des include/unixconf.h
  28. #   sys/mac/mgetline.c sys/msdos/MakeGCC.utl sys/msdos/MakeMSC.utl
  29. #   sys/os2/nhpmico.uu sys/vms/vmsfiles.c
  30. # Wrapped by billr@saab on Wed Jan 27 16:09:28 1993
  31. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  32. if test -f 'dat/castle.des' -a "${1}" != "-c" ; then 
  33.   echo shar: Will not clobber existing file \"'dat/castle.des'\"
  34. else
  35. echo shar: Extracting \"'dat/castle.des'\" \(7662 characters\)
  36. sed "s/^X//" >'dat/castle.des' <<'END_OF_FILE'
  37. X#    SCCS Id: @(#)castle.des    3.1    90/02/26
  38. X#    Copyright (c) 1989 by Jean-Christophe Collet
  39. X# NetHack may be freely redistributed.  See license for details.
  40. X#
  41. X# This is the stronghold level :
  42. X# there are several ways to enter it :
  43. X#    - opening the drawbridge (wand of opening, knock spell, playing
  44. X#      the appropriate tune)
  45. X#
  46. X#    - enter via the back entry (this suppose a ring of levitation, boots
  47. X#      of water walking, etc.)
  48. X#
  49. X# Note : If you don't play the right tune, you get indications like in the
  50. X#     MasterMind game...
  51. X#
  52. X# To motivate the player : there are 4 storerooms (armors, weapons, food and
  53. X# gems) and a wand of wishing in one of the 4 towers...
  54. X
  55. XMAZE:"castle",random
  56. XFLAGS: noteleport
  57. XGEOMETRY:center,center
  58. XMAP
  59. X}}}}}}}}}.............................................}}}}}}}}}
  60. X}-------}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}-------}
  61. X}|.....|-----------------------------------------------|.....|}
  62. X}|.....+...............................................+.....|}
  63. X}-------------------------------+-----------------------------}
  64. X}}}}}}|........|..........+...........|.......S.S.......|}}}}}}
  65. X.....}|........|..........|...........|.......|.|.......|}.....
  66. X.....}|........------------...........---------S---------}.....
  67. X.....}|...{....+..........+.........\.S.................+......
  68. X.....}|........------------...........---------S---------}.....
  69. X.....}|........|..........|...........|.......|.|.......|}.....
  70. X}}}}}}|........|..........+...........|.......S.S.......|}}}}}}
  71. X}-------------------------------+-----------------------------}
  72. X}|.....+...............................................+.....|}
  73. X}|.....|-----------------------------------------------|.....|}
  74. X}-------}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}-------}
  75. X}}}}}}}}}.............................................}}}}}}}}}
  76. XENDMAP
  77. X
  78. X# Random registers initialisation
  79. XRANDOM_OBJECTS:'[',')','*','%'
  80. XRANDOM_PLACES:(04,02),(58,02),(04,14),(58,14)
  81. XRANDOM_MONSTERS:'L','N','E','H','M','O','R','T','X','Z'
  82. X
  83. XTELEPORT_REGION:levregion(01,00,10,20),(0,0,62,16),down
  84. XTELEPORT_REGION:levregion(69,00,79,20),(0,0,62,16),up
  85. XSTAIR:levregion(01,00,10,20),(0,0,62,16),up
  86. X# Doors
  87. XDOOR:closed,(07,03)
  88. XDOOR:closed,(55,03)
  89. XDOOR:locked,(32,04)
  90. XDOOR:locked,(26,05)
  91. XDOOR:locked,(46,05)
  92. XDOOR:locked,(48,05)
  93. XDOOR:locked,(47,07)
  94. XDOOR:closed,(15,08)
  95. XDOOR:closed,(26,08)
  96. XDOOR:locked,(38,08)
  97. XDOOR:locked,(56,08)
  98. XDOOR:locked,(47,09)
  99. XDOOR:locked,(26,11)
  100. XDOOR:locked,(46,11)
  101. XDOOR:locked,(48,11)
  102. XDOOR:locked,(32,12)
  103. XDOOR:closed,(07,13)
  104. XDOOR:closed,(55,13)
  105. X# The drawbridge
  106. XDRAWBRIDGE:(05,08),east,closed
  107. X# Storeroom number 1
  108. XOBJECT:object[0],random,(39,05)
  109. XOBJECT:object[0],random,(40,05)
  110. XOBJECT:object[0],random,(41,05)
  111. XOBJECT:object[0],random,(42,05)
  112. XOBJECT:object[0],random,(43,05)
  113. XOBJECT:object[0],random,(44,05)
  114. XOBJECT:object[0],random,(45,05)
  115. XOBJECT:object[0],random,(39,06)
  116. XOBJECT:object[0],random,(40,06)
  117. XOBJECT:object[0],random,(41,06)
  118. XOBJECT:object[0],random,(42,06)
  119. XOBJECT:object[0],random,(43,06)
  120. XOBJECT:object[0],random,(44,06)
  121. XOBJECT:object[0],random,(45,06)
  122. X# Storeroom number 2
  123. XOBJECT:object[1],random,(49,05)
  124. XOBJECT:object[1],random,(50,05)
  125. XOBJECT:object[1],random,(51,05)
  126. XOBJECT:object[1],random,(52,05)
  127. XOBJECT:object[1],random,(53,05)
  128. XOBJECT:object[1],random,(54,05)
  129. XOBJECT:object[1],random,(55,05)
  130. XOBJECT:object[1],random,(49,06)
  131. XOBJECT:object[1],random,(50,06)
  132. XOBJECT:object[1],random,(51,06)
  133. XOBJECT:object[1],random,(52,06)
  134. XOBJECT:object[1],random,(53,06)
  135. XOBJECT:object[1],random,(54,06)
  136. XOBJECT:object[1],random,(55,06)
  137. X# Storeroom number 3
  138. XOBJECT:object[2],random,(39,10)
  139. XOBJECT:object[2],random,(40,10)
  140. XOBJECT:object[2],random,(41,10)
  141. XOBJECT:object[2],random,(42,10)
  142. XOBJECT:object[2],random,(43,10)
  143. XOBJECT:object[2],random,(44,10)
  144. XOBJECT:object[2],random,(45,10)
  145. XOBJECT:object[2],random,(39,11)
  146. XOBJECT:object[2],random,(40,11)
  147. XOBJECT:object[2],random,(41,11)
  148. XOBJECT:object[2],random,(42,11)
  149. XOBJECT:object[2],random,(43,11)
  150. XOBJECT:object[2],random,(44,11)
  151. XOBJECT:object[2],random,(45,11)
  152. X# Storeroom number 4
  153. XOBJECT:object[3],random,(49,10)
  154. XOBJECT:object[3],random,(50,10)
  155. XOBJECT:object[3],random,(51,10)
  156. XOBJECT:object[3],random,(52,10)
  157. XOBJECT:object[3],random,(53,10)
  158. XOBJECT:object[3],random,(54,10)
  159. XOBJECT:object[3],random,(55,10)
  160. XOBJECT:object[3],random,(49,11)
  161. XOBJECT:object[3],random,(50,11)
  162. XOBJECT:object[3],random,(51,11)
  163. XOBJECT:object[3],random,(52,11)
  164. XOBJECT:object[3],random,(53,11)
  165. XOBJECT:object[3],random,(54,11)
  166. XOBJECT:object[3],random,(55,11)
  167. X# THE WAND OF WISHING in 1 of the 4 towers
  168. XOBJECT:'/',"wishing",place[0]
  169. X# Prevent monsters from eating it.  (@'s never eat objects)
  170. XENGRAVING:place[0],burn,"Elbereth"
  171. X# The treasure of the lord
  172. XOBJECT:'(',"chest",(37,08)
  173. X# Traps
  174. XTRAP:"trapdoor",(40,08)
  175. XTRAP:"trapdoor",(44,08)
  176. XTRAP:"trapdoor",(48,08)
  177. XTRAP:"trapdoor",(52,08)
  178. XTRAP:"trapdoor",(55,08)
  179. X# Soldiers guarding the entry hall
  180. XMONSTER:'@',"soldier",(08,06)
  181. XMONSTER:'@',"soldier",(09,05)
  182. XMONSTER:'@',"soldier",(11,05)
  183. XMONSTER:'@',"soldier",(12,06)
  184. XMONSTER:'@',"soldier",(08,10)
  185. XMONSTER:'@',"soldier",(09,11)
  186. XMONSTER:'@',"soldier",(11,11)
  187. XMONSTER:'@',"soldier",(12,10)
  188. XMONSTER:'@',"lieutenant",(09,08)
  189. X# Soldiers guarding the towers
  190. XMONSTER:'@',"soldier",(03,02)
  191. XMONSTER:'@',"soldier",(05,02)
  192. XMONSTER:'@',"soldier",(57,02)
  193. XMONSTER:'@',"soldier",(59,02)
  194. XMONSTER:'@',"soldier",(03,14)
  195. XMONSTER:'@',"soldier",(05,14)
  196. XMONSTER:'@',"soldier",(57,14)
  197. XMONSTER:'@',"soldier",(59,14)
  198. X# The four dragons that are guarding the storerooms
  199. XMONSTER:'D',random,(47,05)
  200. XMONSTER:'D',random,(47,06)
  201. XMONSTER:'D',random,(47,10)
  202. XMONSTER:'D',random,(47,11)
  203. X# Eels in the moat
  204. XMONSTER:';',"giant eel",(05,07)
  205. XMONSTER:';',"giant eel",(05,09)
  206. XMONSTER:';',"giant eel",(57,07)
  207. XMONSTER:';',"giant eel",(57,09)
  208. X# The throne room and the court monsters
  209. XMONSTER:monster[0],random,(27,05)
  210. XMONSTER:monster[1],random,(30,05)
  211. XMONSTER:monster[2],random,(33,05)
  212. XMONSTER:monster[3],random,(36,05)
  213. XMONSTER:monster[4],random,(28,06)
  214. XMONSTER:monster[5],random,(31,06)
  215. XMONSTER:monster[6],random,(34,06)
  216. XMONSTER:monster[7],random,(37,06)
  217. XMONSTER:monster[8],random,(27,07)
  218. XMONSTER:monster[9],random,(30,07)
  219. XMONSTER:monster[0],random,(33,07)
  220. XMONSTER:monster[1],random,(36,07)
  221. XMONSTER:monster[2],random,(28,08)
  222. XMONSTER:monster[3],random,(31,08)
  223. XMONSTER:monster[4],random,(34,08)
  224. XMONSTER:monster[5],random,(27,09)
  225. XMONSTER:monster[6],random,(30,09)
  226. XMONSTER:monster[7],random,(33,09)
  227. XMONSTER:monster[8],random,(36,09)
  228. XMONSTER:monster[9],random,(28,10)
  229. XMONSTER:monster[0],random,(31,10)
  230. XMONSTER:monster[1],random,(34,10)
  231. XMONSTER:monster[2],random,(37,10)
  232. XMONSTER:monster[3],random,(27,11)
  233. XMONSTER:monster[4],random,(30,11)
  234. XMONSTER:monster[5],random,(33,11)
  235. XMONSTER:monster[6],random,(36,11)
  236. X# MazeWalks
  237. XMAZEWALK:(00,10),west
  238. XMAZEWALK:(62,06),east
  239. X# Non diggable walls
  240. XNON_DIGGABLE:(00,00,62,16)
  241. X# Subrooms:
  242. X#   Entire castle area
  243. XREGION:(00,00,62,16),unlit,"ordinary"
  244. X#   Courtyards
  245. XREGION:(00,05,05,11),lit,"ordinary"
  246. XREGION:(57,05,62,11),lit,"ordinary"
  247. X#   Throne room
  248. XREGION:(27,05,37,11),lit,"throne",unfilled
  249. X#   Antechamber
  250. XREGION:(07,05,14,11),lit,"ordinary"
  251. X#   Storerooms
  252. XREGION:(39,05,45,06),lit,"ordinary"
  253. XREGION:(39,10,45,11),lit,"ordinary"
  254. XREGION:(49,05,55,06),lit,"ordinary"
  255. XREGION:(49,10,55,11),lit,"ordinary"
  256. X#   Corners
  257. XREGION:(02,02,06,03),lit,"ordinary"
  258. XREGION:(56,02,60,03),lit,"ordinary"
  259. XREGION:(02,13,06,14),lit,"ordinary"
  260. XREGION:(56,13,60,14),lit,"ordinary"
  261. X#   Barracks
  262. XREGION:(16,05,25,06),lit,"barracks"
  263. XREGION:(16,10,25,11),lit,"barracks"
  264. X#   Hallways
  265. XREGION:(08,03,54,03),unlit,"ordinary"
  266. XREGION:(08,13,54,13),unlit,"ordinary"
  267. XREGION:(16,08,25,08),unlit,"ordinary"
  268. XREGION:(39,08,55,08),unlit,"ordinary"
  269. X#   Storeroom alcoves
  270. XREGION:(47,05,47,06),unlit,"ordinary"
  271. XREGION:(47,10,47,11),unlit,"ordinary"
  272. END_OF_FILE
  273. if test 7662 -ne `wc -c <'dat/castle.des'`; then
  274.     echo shar: \"'dat/castle.des'\" unpacked with wrong size!
  275. fi
  276. # end of 'dat/castle.des'
  277. fi
  278. if test -f 'dat/medusa.des' -a "${1}" != "-c" ; then 
  279.   echo shar: Will not clobber existing file \"'dat/medusa.des'\"
  280. else
  281. echo shar: Extracting \"'dat/medusa.des'\" \(7452 characters\)
  282. sed "s/^X//" >'dat/medusa.des' <<'END_OF_FILE'
  283. X#       SCCS Id: @(#)medusa.des 3.1             91/10/30
  284. X#    Copyright (c) 1989 by Jean-Christophe Collet
  285. X#    Copyright (c) 1990, 1991 by M. Stephenson
  286. X# NetHack may be freely redistributed.  See license for details.
  287. X#
  288. X# These are the Medusa's levels :
  289. X#
  290. X
  291. XMAZE:"medusa-1",' '
  292. XFLAGS: noteleport
  293. XGEOMETRY:center,center
  294. XMAP
  295. X}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
  296. X}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
  297. X}}.}}}}}..}}}}}......}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}....}}}...}}}}}
  298. X}...}}.....}}}}}....}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}...............}
  299. X}....}}}}}}}}}}....}}}..}}}}}}}}}}}.......}}}}}}}}}}}}}}}}..}}.....}}}...}}
  300. X}....}}}}}}}}.....}}}}..}}}}}}.................}}}}}}}}}}}.}}}}.....}}...}}
  301. X}....}}}}}}}}}}}}.}}}}.}}}}}}.-----------------.}}}}}}}}}}}}}}}}}.........}
  302. X}....}}}}}}}}}}}}}}}}}}.}}}...|...............S...}}}}}}}}}}}}}}}}}}}....}}
  303. X}.....}.}}....}}}}}}}}}.}}....--------+--------....}}}}}}..}}}}}}}}}}}...}}
  304. X}......}}}}..}}}}}}}}}}}}}........|.......|........}}}}}....}}}}}}}}}}}}}}}
  305. X}.....}}}}}}}}}}}}}}}}}}}}........|.......|........}}}}}...}}}}}}}}}.}}}}}}
  306. X}.....}}}}}}}}}}}}}}}}}}}}....--------+--------....}}}}}}.}.}}}}}}}}}}}}}}}
  307. X}......}}}}}}}}}}}}}}}}}}}}...S...............|...}}}}}}}}}}}}}}}}}.}}}}}}}
  308. X}.......}}}}}}}..}}}}}}}}}}}}.-----------------.}}}}}}}}}}}}}}}}}....}}}}}}
  309. X}........}}.}}....}}}}}}}}}}}}.................}}}}}..}}}}}}}}}.......}}}}}
  310. X}.......}}}}}}}......}}}}}}}}}}}}}}.......}}}}}}}}}.....}}}}}}...}}..}}}}}}
  311. X}.....}}}}}}}}}}}.....}}}}}}}}}}}}}}}}}}}}}}.}}}}}}}..}}}}}}}}}}....}}}}}}}
  312. X}}..}}}}}}}}}}}}}....}}}}}}}}}}}}}}}}}}}}}}...}}..}}}}}}}.}}.}}}}..}}}}}}}}
  313. X}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
  314. X}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
  315. XENDMAP
  316. X# Initialize Random Registers
  317. XRANDOM_MONSTERS:';','S','g'
  318. X# Dungeon Description
  319. XREGION:(00,00,74,19),lit,"ordinary"
  320. XREGION:(31,07,45,07),unlit,"ordinary"
  321. XREGION:(35,09,41,10),lit,"ordinary"
  322. XREGION:(31,12,45,12),unlit,"ordinary"
  323. X# Teleport: down to up stairs island, up to Medusa's island
  324. XTELEPORT_REGION:(01,01,05,17),(0,0,0,0),down
  325. XTELEPORT_REGION:(26,04,50,15),(0,0,0,0),up
  326. X# Stairs
  327. XSTAIR:(05,14),up
  328. XSTAIR:(35,10),down
  329. X# Doors
  330. XDOOR:closed,(46,07)
  331. XDOOR:locked,(38,08)
  332. XDOOR:locked,(38,11)
  333. XDOOR:closed,(30,12)
  334. X# Branch, not allowed inside Medusa's building.
  335. XBRANCH:levregion(01,00,79,20),(30,06,46,13)
  336. X# Non diggable walls
  337. XNON_DIGGABLE:(30,06,46,13)
  338. X# Objects
  339. XOBJECT:'`',"statue",random
  340. XOBJECT:'`',"statue",random
  341. XOBJECT:'`',"statue",random
  342. XOBJECT:'`',"statue",random
  343. XOBJECT:'`',"statue",random
  344. XOBJECT:'`',"statue",random
  345. XOBJECT:'`',"statue",random
  346. XOBJECT:random,random,random
  347. XOBJECT:random,random,random
  348. XOBJECT:random,random,random
  349. XOBJECT:random,random,random
  350. XOBJECT:random,random,random
  351. XOBJECT:random,random,random
  352. XOBJECT:random,random,random
  353. XOBJECT:random,random,random
  354. X# Random traps
  355. XTRAP:random,random
  356. XTRAP:random,random
  357. XTRAP:random,random
  358. XTRAP:random,random
  359. XTRAP:random,random
  360. XTRAP:"board",(38,07)
  361. XTRAP:"board",(38,12)
  362. X# Random monsters
  363. XMONSTER:'@',"Medusa",(36,10),asleep
  364. XMONSTER:';',random,(11,06)
  365. XMONSTER:';',random,(23,13)
  366. XMONSTER:';',random,(29,02)
  367. XMONSTER:';',random,(52,04)
  368. XMONSTER:';',random,(64,11)
  369. XMONSTER:'S',random,(38,07)
  370. XMONSTER:'S',random,(38,12)
  371. XMONSTER:random,random,random
  372. XMONSTER:random,random,random
  373. XMONSTER:random,random,random
  374. XMONSTER:random,random,random
  375. XMONSTER:random,random,random
  376. XMONSTER:random,random,random
  377. XMONSTER:random,random,random
  378. XMONSTER:random,random,random
  379. XMONSTER:random,random,random
  380. XMONSTER:random,random,random
  381. X
  382. XMAZE:"medusa-2",' '
  383. XFLAGS: noteleport
  384. XGEOMETRY:center,center
  385. XMAP
  386. X}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
  387. X}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
  388. X}------}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}-------}}}}}}}}--------------}
  389. X}|....|}}}}}}}}}..}.}}..}}}}}}}}}}}}}..}}}}}}-.....--}}}}}}}|............|}
  390. X}|....|.}}}}}}}}}}}.}...}}..}}}}}}}}}}}}}}}}}---......}}}}}.|............|}
  391. X}S....|.}}}}}}---}}}}}}}}}}}}}}}}}}}}}}}}}}---...|..-}}}}}}.S..----------|}
  392. X}|....|.}}}}}}-...}}}}}}}}}.}}...}.}}}}.}}}......----}}}}}}.|............|}
  393. X}|....|.}}}}}}-....--}}}}}}}}}}}}}}}}}}}}}}----...--}}}}}}}.|..--------+-|}
  394. X}|....|.}}}}}}}......}}}}...}}}}}}.}}}}}}}}}}}---..---}}}}}.|..|..S...|..|}
  395. X}|....|.}}}}}}-....-}}}}}}}------}}}}}}}}}}}}}}-...|.-}}}}}.|..|..|...|..|}
  396. X}|....|.}}}}}}}}}---}}}}}}}........}}}}}}}}}}---.|....}}}}}.|..|..|...|..|}
  397. X}|....|.}}}}}}}}}}}}}}}}}}-....|...-}}}}}}}}--...----.}}}}}.|..|..|...|..|}
  398. X}|....|.}}}}}}..}}}}}}}}}}---..--------}}}}}-..---}}}}}}}}}.|..|..-------|}
  399. X}|...}|...}}}.}}}}}}...}}}}}--..........}}}}..--}}}}}}}}}}}.|..|.........|}
  400. X}|...}S...}}.}}}}}}}}}}}}}}}-..--------}}}}}}}}}}}}}}...}}}.|..--------..S}
  401. X}|...}|...}}}}}}}..}}}}}}----..|....-}}}}}}}}}}}}}}}}}..}}}.|............|}
  402. X}|....|}}}}}....}}}}..}}.-.......----}}......}}}}}}.......}}|............|}
  403. X}------}}}}}}}}}}}}}}}}}}---------}}}}}}}}}}}}}}}}}}}}}}}}}}--------------}
  404. X}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
  405. X}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
  406. XENDMAP
  407. X# Initialize Random Registers
  408. XRANDOM_MONSTERS:';','S','g'
  409. X# Dungeon Description
  410. XREGION:(00,00,74,19),lit,"ordinary"
  411. XREGION:(02,03,05,16),unlit,"ordinary"
  412. XREGION:(61,03,72,16),unlit,"ordinary",unfilled,true
  413. XREGION:(71,08,72,11),unlit,"ordinary"
  414. XREGION:(67,08,69,11),lit,"ordinary"
  415. X# Teleport: down to up stairs island, up to Medusa's island
  416. XTELEPORT_REGION:(02,03,05,16),(0,0,0,0),down
  417. XTELEPORT_REGION:(61,03,72,16),(0,0,0,0),up
  418. X# Stairs
  419. XSTAIR:(04,09),up
  420. XSTAIR:(68,10),down
  421. X# Doors
  422. XDOOR:locked,(71,07)
  423. X# Branch, not allowed on Medusa's island.
  424. XBRANCH:levregion(01,00,79,20),(59,01,73,17)
  425. X# Non diggable walls
  426. XNON_DIGGABLE:(01,02,06,17)
  427. XNON_DIGGABLE:(60,02,73,17)
  428. X# Objects
  429. XOBJECT:'`',"statue",(64,08)
  430. XOBJECT:'`',"statue",(65,08)
  431. XOBJECT:'`',"statue",(64,09)
  432. XOBJECT:'`',"statue",(65,09)
  433. XOBJECT:'`',"statue",(64,10)
  434. XOBJECT:'`',"statue",(65,10)
  435. XOBJECT:'`',"statue",(64,11)
  436. XOBJECT:'`',"statue",(65,11)
  437. XOBJECT:'`',"boulder",(04,04)
  438. XOBJECT:'/',random,(52,09)
  439. XOBJECT:'`',"boulder",(52,09)
  440. XOBJECT:random,random,random
  441. XOBJECT:random,random,random
  442. XOBJECT:random,random,random
  443. XOBJECT:random,random,random
  444. XOBJECT:random,random,random
  445. XOBJECT:random,random,random
  446. X# Traps
  447. XTRAP:"magic",(03,12)
  448. XTRAP:random,random
  449. XTRAP:random,random
  450. XTRAP:random,random
  451. XTRAP:random,random
  452. X# Monsters.
  453. XMONSTER:'@',"Medusa",(68,10),asleep
  454. XMONSTER:'g',"gremlin",(02,14)
  455. XMONSTER:'H',"titan",(02,05)
  456. XMONSTER:';',"electric eel",(10,13)
  457. XMONSTER:';',"electric eel",(11,13)
  458. XMONSTER:';',"electric eel",(10,14)
  459. XMONSTER:';',"electric eel",(11,14)
  460. XMONSTER:';',"electric eel",(10,15)
  461. XMONSTER:';',"electric eel",(11,15)
  462. XMONSTER:''',"stone golem",(64,08),asleep
  463. XMONSTER:''',"stone golem",(65,08),asleep
  464. XMONSTER:''',"stone golem",(64,09),asleep
  465. XMONSTER:''',"stone golem",(65,09),asleep
  466. XMONSTER:'S',"cobra",(64,10),asleep
  467. XMONSTER:'S',"cobra",(65,10),asleep
  468. XMONSTER:'A',random,(72,08)
  469. XMONSTER:'y',"yellow light",(72,11),asleep
  470. XMONSTER:random,random,(17,07)
  471. XMONSTER:random,random,(28,11)
  472. XMONSTER:random,random,(32,13)
  473. XMONSTER:random,random,(49,09)
  474. XMONSTER:random,random,(48,07)
  475. XMONSTER:random,random,(65,03)
  476. XMONSTER:random,random,(70,04)
  477. XMONSTER:random,random,(70,15)
  478. XMONSTER:random,random,(65,16)
  479. XMONSTER:random,random,random
  480. XMONSTER:random,random,random
  481. XMONSTER:random,random,random
  482. XMONSTER:random,random,random
  483. END_OF_FILE
  484. if test 7452 -ne `wc -c <'dat/medusa.des'`; then
  485.     echo shar: \"'dat/medusa.des'\" unpacked with wrong size!
  486. fi
  487. # end of 'dat/medusa.des'
  488. fi
  489. if test -f 'include/unixconf.h' -a "${1}" != "-c" ; then 
  490.   echo shar: Will not clobber existing file \"'include/unixconf.h'\"
  491. else
  492. echo shar: Extracting \"'include/unixconf.h'\" \(7669 characters\)
  493. sed "s/^X//" >'include/unixconf.h' <<'END_OF_FILE'
  494. X/*    SCCS Id: @(#)unixconf.h    3.1    90/22/02    */
  495. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  496. X/* NetHack may be freely redistributed.  See license for details. */
  497. X
  498. X#ifdef UNIX
  499. X#ifndef UNIXCONF_H
  500. X#define UNIXCONF_H
  501. X
  502. X/*
  503. X * Some include files are in a different place under SYSV
  504. X *    BSD           SYSV
  505. X * <sys/time.h>        <time.h>
  506. X * <sgtty.h>        <termio.h>
  507. X *
  508. X * Some routines are called differently
  509. X * index        strchr
  510. X * rindex        strrchr
  511. X *
  512. X */
  513. X
  514. X/* define exactly one of the following four choices */
  515. X#define BSD        /* define for 4.n BSD  */
  516. X            /* also for relatives like SunOS and DG/UX */
  517. X/* #define ULTRIX    /* define for Ultrix v3.0 or higher (but not lower) */
  518. X            /* Use BSD for < v3.0 */
  519. X            /* "ULTRIX" not to be confused with "ultrix" */
  520. X/* #define SYSV        /* define for System V */
  521. X/* #define HPUX        /* Hewlett-Packard's Unix, version 6.5 or higher */
  522. X            /* use SYSV for < v6.5 */
  523. X
  524. X
  525. X/* define any of the following that are appropriate */
  526. X/* #define SVR4        /* use in addition to SYSV for System V Release 4 */
  527. X#define NETWORK    /* if running on a networked system */
  528. X            /* e.g. Suns sharing a playground through NFS */
  529. X#define SUNOS4    /* SunOS 4.x */
  530. X/* #define GENIX    /* Yet Another Unix Clone */
  531. X/* #define HISX        /* Bull Unix for XPS Machines */
  532. X/* #define BOS        /* Bull Open Software - Unix for DPX/2 Machines */
  533. X/* #define UNIXPC    /* use in addition to SYSV for AT&T 7300/3B1 */
  534. X/* #define AIX_31    /* In AIX 3.1 (IBM RS/6000) use BSD ioctl's to gain
  535. X               job control (note that AIX is SYSV otherwise) */
  536. X/* #define TEXTCOLOR    /* Use System V r3.2 terminfo color support */
  537. X            /* or ANSI color support on termcap systems */
  538. X            /* or X11 color    */
  539. X/* #define POSIX_JOB_CONTROL    /* use System V POSIX job control */
  540. X/* #define POSIX_TYPES    /* use POSIX types for system calls and termios */
  541. X
  542. X
  543. X/* #define OPENWINBUG    /* avoid a problem using OpenWindows 3.0 for X11
  544. X               on SunOS 4.1.x, x>= 2 */
  545. X/* #define PYRAMID_BUG    /* avoid a bug on the Pyramid */
  546. X/* #define BSD_43_BUG    /* for real 4.3BSD cc's without schain botch fix */
  547. X/* #define MICROPORT_BUG /* problems with large arrays in structs */
  548. X/* #define MICROPORT_286_BUG /* Changes needed in termcap.c to get it to
  549. X               run with Microport Sys V/AT version 2.4.
  550. X               By Jay Maynard */
  551. X/* #define AIXPS_2BUG    /* avoid a problem with little_to_big() optimization */
  552. X
  553. X/* #define RANDOM    /* if neither random/srandom nor lrand48/srand48
  554. X               is available from your system */
  555. X
  556. X/* #define SYSV386MUSIC    /* Play real music through speaker on systems with
  557. X               music driver installed */
  558. X
  559. X
  560. X/*
  561. X * The next two defines are intended mainly for the Andrew File System,
  562. X * which does not allow hard links.  If NO_FILE_LINKS is defined, lock files
  563. X * will be created in LOCKDIR using open() instead of in the playground using
  564. X * link().
  565. X *        Ralf Brown, 7/26/89 (from v2.3 hack of 10/10/88)
  566. X */
  567. X
  568. X/* #define NO_FILE_LINKS    /* if no hard links */
  569. X/* #define LOCKDIR "/usr/games/lib/nethackdir"    /* where to put locks */
  570. X
  571. X
  572. X/*
  573. X * Define DEF_PAGER as your default pager, e.g. "/bin/cat" or "/usr/ucb/more"
  574. X * If defined, it can be overridden by the environment variable PAGER.
  575. X * Hack will use its internal pager if DEF_PAGER is not defined.
  576. X * (This might be preferable for security reasons.)
  577. X * #define DEF_PAGER    ".../mydir/mypager"
  578. X */
  579. X
  580. X
  581. X
  582. X/*
  583. X * Define PORT_HELP to be the name of the port-specfic help file.
  584. X * This file is found in HACKDIR. 
  585. X * Normally, you shouldn't need to change this.
  586. X * There is currently no port-specific help for Unix systems.
  587. X */
  588. X/* #define PORT_HELP "Unixhelp" */
  589. X
  590. X/*
  591. X * If you define MAIL, then the player will be notified of new mail
  592. X * when it arrives.  If you also define DEF_MAILREADER then this will
  593. X * be the default mail reader, and can be overridden by the environment
  594. X * variable MAILREADER; otherwise an internal pager will be used.
  595. X * A stat system call is done on the mailbox every MAILCKFREQ moves.
  596. X */
  597. X
  598. X#define MAIL            /* Deliver mail during the game */
  599. X
  600. X/* The Andrew Message System does mail a little differently from normal
  601. X * UNIX.  Mail is deposited in the user's own directory in ~/Mailbox
  602. X * (another directory).  MAILBOX is the element that will be added on to
  603. X * the user's home directory path to generate the Mailbox path - just in
  604. X * case other Andrew sites do it differently from CMU.
  605. X *
  606. X *        dan lovinger
  607. X *        dl2n+@andrew.cmu.edu (dec 19 1989)
  608. X */
  609. X
  610. X/* #define AMS            /* use Andrew message system for mail */
  611. X
  612. X/* NO_MAILREADER is for kerberos authentcating filesystems where it is
  613. X * essentially impossible to securely exec child processes, like mail
  614. X * readers, when the game is running under a special token.
  615. X *
  616. X *             dan
  617. X */
  618. X
  619. X/* #define NO_MAILREADER    /* have mail daemon just tell player of mail */
  620. X
  621. X#ifdef    MAIL
  622. X# if defined(BSD) || defined(ULTRIX)
  623. X#  ifdef AMS
  624. X#define AMS_MAILBOX    "/Mailbox"
  625. X#  else
  626. X#define DEF_MAILREADER    "/usr/ucb/Mail"
  627. X#  endif
  628. X#else
  629. X# if defined(SYSV) || defined(DGUX) || defined(HPUX)
  630. X#  ifdef M_XENIX
  631. X#define DEF_MAILREADER    "/usr/bin/mail"
  632. X#  else
  633. X#define DEF_MAILREADER    "/usr/bin/mailx"
  634. X#  endif
  635. X# else
  636. X#define DEF_MAILREADER    "/bin/mail"
  637. X# endif
  638. X#endif
  639. X
  640. X#define MAILCKFREQ    50
  641. X#endif    /* MAIL */
  642. X
  643. X
  644. X
  645. X#ifdef COMPRESS
  646. X/* Some implementations of compress need a 'quiet' option.
  647. X * If you've got one of these versions, put -q here.
  648. X * You can also include any other strange options your compress needs.
  649. X * If you have a normal compress, just leave it commented out.
  650. X */
  651. X/* #define COMPRESS_OPTIONS    "-q"    /* */
  652. X#endif
  653. X
  654. X#define FCMASK    0660    /* file creation mask */
  655. X
  656. X
  657. X/*
  658. X * The remainder of the file should not need to be changed.
  659. X */
  660. X
  661. X#ifdef _AUX_SOURCE
  662. X# ifdef AUX /* gcc ? */
  663. X#  define _SYSV_SOURCE
  664. X#  define _BSD_SOURCE
  665. X#else
  666. X#  define AUX
  667. X# endif
  668. X#endif /* _AUX_SOURCE */
  669. X
  670. X/*
  671. X * BSD/ULTRIX systems are normally the only ones that can suspend processes.
  672. X * Suspending NetHack processes cleanly should be easy to add to other systems
  673. X * that have SIGTSTP in the Berkeley sense.  Currently the only such systems
  674. X * known to work are HPUX and AIX 3.1; other systems will probably require
  675. X * tweaks to unixtty.c and ioctl.c.
  676. X *
  677. X * POSIX defines a slightly different type of job control, which should be
  678. X * equivalent for NetHack's purposes.  POSIX_JOB_CONTROL should work on
  679. X * various recent SYSV versions (with possibly tweaks to unixtty.c again).
  680. X */
  681. X#ifndef POSIX_JOB_CONTROL
  682. X# if defined(BSD) || defined(ULTRIX) || defined(HPUX) || defined(AIX_31)
  683. X#  define BSD_JOB_CONTROL
  684. X# else
  685. X#  if defined(SVR4)
  686. X#   define POSIX_JOB_CONTROL
  687. X#  endif
  688. X# endif
  689. X#endif
  690. X#if defined(BSD_JOB_CONTROL) || defined(POSIX_JOB_CONTROL) || defined(AUX)
  691. X#define SUSPEND        /* let ^Z suspend the game */
  692. X#endif
  693. X
  694. X
  695. X#if defined(BSD) || defined(ULTRIX)
  696. X#include    <sys/time.h>
  697. X#else
  698. X#include    <time.h>
  699. X#endif
  700. X
  701. X#define HLOCK    "perm"    /* an empty file used for locking purposes */
  702. X
  703. X#ifndef REDO
  704. X#define Getchar nhgetch
  705. X#endif
  706. X#define tgetch getchar
  707. X
  708. X#define SHELL        /* do not delete the '!' command */
  709. X
  710. X#include "system.h"
  711. X
  712. X#if defined(BSD) || defined(ULTRIX)
  713. X# if !defined(DGUX) && !defined(SUNOS4)
  714. X#define memcpy(d, s, n)        bcopy(s, d, n)
  715. X#define memcmp(s1, s2, n)    bcmp(s2, s1, n)
  716. X# endif
  717. X#else    /* therefore SYSV */
  718. X#define index    strchr
  719. X#define rindex    strrchr
  720. X#endif
  721. X
  722. X/* A safety check for BOS and AUX */
  723. X#if (defined(BOS) || defined(AUX)) && defined(NHSTDC)
  724. X# if defined(VISION_TABLES) && defined(BRACES)
  725. X#  undef BRACES
  726. X# endif
  727. X#endif
  728. X
  729. X/* Use the high quality random number routines. */
  730. X#if defined(BSD) || defined(ULTRIX) || defined(RANDOM)
  731. X#define Rand()    random()
  732. X#else
  733. X#define Rand()    lrand48()
  734. X#endif
  735. X
  736. X#ifdef hc    /* older versions of the MetaWare High-C compiler define this */
  737. X# ifdef __HC__
  738. X#  undef __HC__
  739. X# endif
  740. X# define __HC__ hc
  741. X# undef hc
  742. X#endif
  743. X
  744. X#endif /* UNIXCONF_H */
  745. X#endif /* UNIX */
  746. END_OF_FILE
  747. if test 7669 -ne `wc -c <'include/unixconf.h'`; then
  748.     echo shar: \"'include/unixconf.h'\" unpacked with wrong size!
  749. fi
  750. # end of 'include/unixconf.h'
  751. fi
  752. if test -f 'sys/mac/mgetline.c' -a "${1}" != "-c" ; then 
  753.   echo shar: Will not clobber existing file \"'sys/mac/mgetline.c'\"
  754. else
  755. echo shar: Extracting \"'sys/mac/mgetline.c'\" \(7071 characters\)
  756. sed "s/^X//" >'sys/mac/mgetline.c' <<'END_OF_FILE'
  757. X/*    SCCS Id: @(#)getline.c    3.1    90/22/02
  758. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  759. X/* NetHack may be freely redistributed.  See license for details. */
  760. X
  761. X#include "hack.h"
  762. X#include "Dialogs.h"
  763. X#ifdef THINK_C
  764. X#include "pascal.h"
  765. X#endif
  766. X#include <Packages.h>
  767. X
  768. X// void FDECL(getlin,(const char *, char *));
  769. X// void FDECL(get_ext_cmd,(char *));
  770. Xint FDECL ( try_key_queue , ( char * ) ) ;
  771. X
  772. Xchar * FDECL ( PtoCstr , ( unsigned char * ) ) ;
  773. Xunsigned char * FDECL ( CtoPstr , ( char * ) ) ;
  774. Xvoid SetFrameItem ( DialogPtr , short , short ) ;
  775. Xvoid FlashButton ( DialogPtr , short ) ;
  776. X
  777. Xvoid FDECL ( enter_topl_mode , ( char * ) ) ;
  778. Xvoid FDECL ( leave_topl_mode , ( char * ) ) ;
  779. XBoolean FDECL ( topl_key , ( unsigned char ) ) ;
  780. XBoolean FDECL ( topl_ext_key , ( unsigned char ) ) ;
  781. X
  782. Xtypedef Boolean FDECL ( ( * key_func ) , ( unsigned char ) ) ;
  783. X
  784. X
  785. Xint
  786. Xget_line_from_key_queue ( char * bufp )
  787. X{
  788. X    * bufp = 0 ;
  789. X    if ( try_key_queue ( bufp ) ) {
  790. X
  791. X        while ( * bufp ) {
  792. X
  793. X            if ( * bufp == 10 || * bufp == 13 ) {
  794. X
  795. X                * bufp = 0 ;
  796. X            }
  797. X            bufp ++ ;
  798. X        }
  799. X        return true ;
  800. X    }
  801. X    return false ;
  802. X}
  803. X
  804. X
  805. Xpascal Boolean
  806. XgetlinFilter ( DialogPtr dp , EventRecord * ev , short * itemHit )
  807. X{
  808. X    if (ev->what == keyDown) {
  809. X        int key = ev->message & keyCodeMask,
  810. X            ch    = ev->message & charCodeMask;
  811. X
  812. X        if (ch == 0x1b || key == 0x3500 || key == 0x4700) {
  813. X            *itemHit = 2;
  814. X            FlashButton(dp, 2);
  815. X            return true;
  816. X
  817. X        } else if (ch == CHAR_CR || ch == CHAR_ENTER) {
  818. X            *itemHit = 1;
  819. X            FlashButton(dp, 1);
  820. X            return true;
  821. X        }
  822. X    }
  823. X
  824. X    return false;
  825. X}
  826. X
  827. X
  828. Xvoid
  829. Xpopup_getlin(const char *query, char *bufp)
  830. X{
  831. X    ControlHandle    ctrl;
  832. X    DialogPtr        promptDialog;
  833. X    short            itemHit, type;
  834. X    Rect            box;
  835. X    Str255            pasStr;
  836. X
  837. X    if ( get_line_from_key_queue ( bufp ) )
  838. X        return ;
  839. X
  840. X    /*
  841. X    ** Make a copy of the prompt string and convert the copy to a Pascal string.
  842. X    */
  843. X    
  844. X    strcpy((char *) pasStr, query);
  845. X    CtoPstr((char *) pasStr);
  846. X    
  847. X    /*
  848. X    ** Set the query line as parameter text.
  849. X    */
  850. X    
  851. X    ParamText(pasStr, "\p", "\p", "\p");
  852. X    
  853. X    promptDialog = mv_get_new_dialog(130);
  854. X    ShowWindow(promptDialog);
  855. X
  856. X    InitCursor ( ) ;
  857. X    SetFrameItem ( promptDialog , 6 , 1 ) ;
  858. X    do {
  859. X        mv_modal_dialog(&getlinFilter, &itemHit);
  860. X    } while ((itemHit != 1) && (itemHit != 2));
  861. X    
  862. X    if (itemHit != 2) {
  863. X        /*
  864. X        ** Get the text from the text edit item.
  865. X        */
  866. X        
  867. X        GetDItem(promptDialog, 4, &type, (Handle *) &ctrl, &box);
  868. X        GetIText((Handle) ctrl, pasStr);
  869. X        
  870. X        /*
  871. X        ** Convert it to a 'C' string and copy it into the return value.
  872. X        */
  873. X        
  874. X        PtoCstr(pasStr);
  875. X        strcpy(bufp, (char *) pasStr);
  876. X    } else {
  877. X        /*
  878. X        ** Return a null-terminated string consisting of a single <ESC>.
  879. X        */
  880. X        
  881. X        bufp[0] = '\033';
  882. X        bufp[1] = '\0';
  883. X    }
  884. X    
  885. X    mv_close_dialog(promptDialog);
  886. X}
  887. X
  888. X
  889. Xvoid
  890. Xtopl_getlin(const char *query, char *bufp, key_func key)
  891. X{
  892. X    int q_len = strlen(query);
  893. X
  894. X    if ( get_line_from_key_queue ( bufp ) )
  895. X        return ;
  896. X
  897. X    enter_topl_mode(query);
  898. X    while ((*key)(nhgetch())) ;
  899. X    leave_topl_mode(bufp);
  900. X}
  901. X
  902. X
  903. X/*
  904. X * Read a line closed with '\n' into the array char bufp[BUFSZ].
  905. X * (The '\n' is not stored. The string is closed with a '\0'.)
  906. X * Reading can be interrupted by an escape ('\033') - now the
  907. X * resulting string is "\033".
  908. X */
  909. Xvoid
  910. Xmac_getlin(const char *query, char *bufp)
  911. X{
  912. X    if (flags.popup_dialog)
  913. X        popup_getlin(query, bufp);
  914. X    else
  915. X        topl_getlin(query, bufp, &topl_key);
  916. X}
  917. X
  918. X
  919. X#ifdef COM_COMPL
  920. X
  921. Xpascal Boolean
  922. XExtendedCommandDialogFilter ( DialogPtr dp , EventRecord * ev , short * item )
  923. X{
  924. X    int ix ;
  925. X    Handle h ;
  926. X    Rect r ;
  927. X    short k ;
  928. X    Str255 s ;
  929. X    unsigned char com [ 2 ] ;
  930. X
  931. X    if ( ev -> what != keyDown ) {
  932. X
  933. X        return 0 ;
  934. X    }
  935. X    com [ 0 ] = 1 ;
  936. X    com [ 1 ] = ev -> message & 0xff ;
  937. X
  938. X    if ( com [ 1 ] == 10 || com [ 1 ] == 13 || com [ 1 ] == 32 ||
  939. X        com [ 1 ] == 3 ) { // various "OK"
  940. X
  941. X        * item = 1 ;
  942. X        FlashButton ( dp , 1 ) ;
  943. X        return 1 ;
  944. X    }
  945. X    if ( com [ 1 ] == 27 || ( ev -> message & 0xff00 == 0x3500 ) ) { // escape
  946. X
  947. X        * item = 2 ;
  948. X        FlashButton ( dp , 2 ) ;
  949. X        return 1 ;
  950. X    }
  951. X    for ( ix = 3 ; ix ; ix ++ ) {
  952. X
  953. X        h = ( Handle ) NULL ;
  954. X        k = 0 ;
  955. X        GetDItem ( dp , ix , & k , & h , & r ) ;
  956. X        if ( ! k || ! h ) {
  957. X
  958. X            return 0 ;
  959. X        }
  960. X        if ( k == 6 ) {    //    Radio Button Item
  961. X
  962. X            GetCTitle ( ( ControlHandle ) h , s ) ;
  963. X            s [ 0 ] = 1 ;
  964. X            if ( ! IUEqualString ( com , s ) ) {
  965. X
  966. X                * item = ix ;
  967. X                return 1 ;
  968. X            }
  969. X        }
  970. X    }
  971. X/*NOTREACHED*/
  972. X    return 0 ;
  973. X}
  974. X
  975. X
  976. Xvoid
  977. Xpopup_get_ext_cmd(char *bufp)
  978. X{
  979. X    ControlHandle    ctrl;
  980. X    DialogPtr        extendedDialog;
  981. X    short            itemHit, type;
  982. X    Rect            box;
  983. X    char            *extendedCommand;
  984. X
  985. X    /*
  986. X    ** Default selection is the first item after the "Cancel" button.
  987. X    */
  988. X    static lastItemSelected = 3;
  989. X
  990. X    if ( get_line_from_key_queue ( bufp ) )
  991. X        return ;
  992. X
  993. X    extendedDialog = mv_get_new_dialog(131);
  994. X    ShowWindow(extendedDialog);
  995. X
  996. X    /*
  997. X    ** Mark the default selection.
  998. X    */
  999. X    
  1000. X    GetDItem(extendedDialog, lastItemSelected, &type, (Handle *) &ctrl, &box);
  1001. X    SetCtlValue(ctrl, 1);
  1002. X
  1003. X    InitCursor ( ) ;
  1004. X    SetFrameItem ( extendedDialog , 20 , 1 ) ;
  1005. X    do {
  1006. X        mv_modal_dialog((ModalFilterProcPtr) ExtendedCommandDialogFilter , &itemHit);
  1007. X        if ((itemHit != 1) && (itemHit != 2)) {
  1008. X            /*
  1009. X            ** If OK and Cancel (items 1 and 2) weren't selected then a radio button 
  1010. X            ** was pushed.  Unmark the previous selection.
  1011. X            */
  1012. X            
  1013. X            GetDItem(extendedDialog, lastItemSelected, &type, (Handle *) &ctrl, &box);
  1014. X            SetCtlValue(ctrl, 0);
  1015. X            
  1016. X            /*
  1017. X            ** Mark the current selection.
  1018. X            */
  1019. X            
  1020. X            GetDItem(extendedDialog, itemHit, &type, (Handle *) &ctrl, &box);
  1021. X            SetCtlValue(ctrl, 1);
  1022. X
  1023. X            /*
  1024. X            ** Save the item number for use later.
  1025. X            */
  1026. X            
  1027. X            lastItemSelected = itemHit;
  1028. X        }
  1029. X    } while ((itemHit != 1) && (itemHit != 2));
  1030. X    
  1031. X    if (itemHit == 2) {
  1032. X        /*
  1033. X        ** Return a null-terminated string consisting of a single <ESC>.
  1034. X        */
  1035. X        
  1036. X        bufp[0] = '\033';
  1037. X        bufp[1] = '\0';
  1038. X    } else {
  1039. X        switch (lastItemSelected) {
  1040. X        case 3:
  1041. X            extendedCommand = "adjust";
  1042. X            break;
  1043. X        case 4:
  1044. X            extendedCommand = "chat";
  1045. X            break;
  1046. X        case 5:
  1047. X            extendedCommand = "dip";
  1048. X            break;
  1049. X        case 6:
  1050. X            extendedCommand = "force";
  1051. X            break;
  1052. X        case 7:
  1053. X            extendedCommand = "jump";
  1054. X            break;
  1055. X        case 8:
  1056. X            extendedCommand = "loot";
  1057. X            break;
  1058. X        case 9:
  1059. X            extendedCommand = "monster";
  1060. X            break;
  1061. X        case 10:
  1062. X            extendedCommand = "name";
  1063. X            break;
  1064. X        case 11:
  1065. X            extendedCommand = "offer";
  1066. X            break;
  1067. X        case 12:
  1068. X            extendedCommand = "pray";
  1069. X            break;
  1070. X        case 13:
  1071. X            extendedCommand = "rub";
  1072. X            break;
  1073. X        case 14:
  1074. X            extendedCommand = "sit";
  1075. X            break;
  1076. X        case 15:
  1077. X            extendedCommand = "turn";
  1078. X            break;
  1079. X        case 16:
  1080. X            extendedCommand = "untrap";
  1081. X            break;
  1082. X        case 17:
  1083. X            extendedCommand = "version";
  1084. X            break;
  1085. X        case 18:
  1086. X            extendedCommand = "window";
  1087. X            break;
  1088. X        case 19:
  1089. X            extendedCommand = "wipe";
  1090. X            break;
  1091. X        }
  1092. X        
  1093. X        /*
  1094. X        ** Copy the text representing the last radio button selected into the buffer.
  1095. X        */
  1096. X        
  1097. X        strcpy(bufp, extendedCommand);
  1098. X    }
  1099. X    
  1100. X    mv_close_dialog(extendedDialog);
  1101. X}
  1102. X
  1103. X
  1104. X/* Read in an extended command - doing command line completion for
  1105. X * when enough characters have been entered to make a unique command.
  1106. X * This is just a modified getlin().   -jsb
  1107. X */
  1108. Xvoid
  1109. Xmac_get_ext_cmd(char *bufp)
  1110. X{
  1111. X    if (flags.popup_dialog)
  1112. X        popup_get_ext_cmd(bufp);
  1113. X    else
  1114. X        topl_getlin("# ", bufp, &topl_ext_key);
  1115. X}
  1116. X
  1117. X#endif /* COM_COMPL /* */
  1118. X
  1119. X/* macgetline.c */
  1120. END_OF_FILE
  1121. if test 7071 -ne `wc -c <'sys/mac/mgetline.c'`; then
  1122.     echo shar: \"'sys/mac/mgetline.c'\" unpacked with wrong size!
  1123. fi
  1124. # end of 'sys/mac/mgetline.c'
  1125. fi
  1126. if test -f 'sys/msdos/MakeGCC.utl' -a "${1}" != "-c" ; then 
  1127.   echo shar: Will not clobber existing file \"'sys/msdos/MakeGCC.utl'\"
  1128. else
  1129. echo shar: Extracting \"'sys/msdos/MakeGCC.utl'\" \(7504 characters\)
  1130. sed "s/^X//" >'sys/msdos/MakeGCC.utl' <<'END_OF_FILE'
  1131. X#       SCCS Id: @(#)MakeGCC.utl               3.1     93/01/18
  1132. X#    Copyright (c) NetHack PC Development Team 1992, 1993.
  1133. X#       PC NetHack 3.1 Utilities Makefile for djgpp
  1134. X#       Gnu gcc compiler for msdos
  1135. X#
  1136. X#       For questios or comments:  Kevins@ori.org
  1137. X#
  1138. X#  In addition to your C compiler,
  1139. X#
  1140. X#  if you want to change   you will need a
  1141. X#  files with suffix   workalike for
  1142. X#         .y         yacc
  1143. X#         .l         lex
  1144. X#
  1145. X#       Note that flex (lex) and bison (yacc) are included with the
  1146. X#       djgpp distribution and work quite well.  This makefile assumes
  1147. X#        you have them installed correctly.
  1148. X
  1149. X#
  1150. X#  Executables.
  1151. X#       gcc and go32 dos extender
  1152. X
  1153. XCC      = gcc
  1154. XSTUB    = f:\djgpp\bin\stub.exe   # Protected mode stub for go32. Either
  1155. XLINK    = gcc                     # stub.exe or go32.exe
  1156. XMAKEBIN  = make
  1157. X
  1158. X#
  1159. X# Special libraries and how to link them in.
  1160. X
  1161. XLIBS = -lpc
  1162. X
  1163. X#
  1164. X#  Yacc/Lex ... if you got 'em.
  1165. X#
  1166. X
  1167. XYACC  = bison -y
  1168. XLEX   = flex
  1169. X
  1170. XYTABC  = y_tab.c
  1171. XYTABH  = y_tab.h
  1172. XLEXYYC   = lexyy.c
  1173. X
  1174. X#
  1175. X#  Flags.
  1176. X#
  1177. X
  1178. X# Debugging
  1179. X# CFLAGS = -g -c -I../include
  1180. X
  1181. XCFLAGS = -I../include -c
  1182. XLFLAGS =
  1183. X
  1184. X
  1185. X#
  1186. X#       Directories, gcc likes unix style directory specs
  1187. X#
  1188. X
  1189. XINCL    = ../include
  1190. XDAT     = ../dat
  1191. X
  1192. X# But we must use dos directory specs to find src files, so....
  1193. XSRC     = ..\src
  1194. XDINCL   = ..\include
  1195. X
  1196. Xdefault: all
  1197. X
  1198. X
  1199. X#############################################################################
  1200. X#
  1201. X# nothing below this line should have to be changed
  1202. X#
  1203. X
  1204. X#
  1205. X#  Utility Objects.
  1206. X#
  1207. X
  1208. XMAKESRC     = makedefs.c
  1209. X
  1210. XSPLEVSRC    = lev_yacc.c  lev_$(LEX).c   lev_main.c  panic.c
  1211. X
  1212. XDGNCOMPSRC  = dgn_yacc.c  dgn_$(LEX).c   dgn_main.c
  1213. X
  1214. XMAKEOBJS    = makedefs.o  monst.o        objects.o
  1215. X
  1216. XSPLEVOBJS   = lev_yacc.o  lev_$(LEX).o  lev_main.o  alloc.o     \
  1217. X              monst.o     objects.o     panic.o  \
  1218. X              drawing.o   decl.o
  1219. X
  1220. XDGNCOMPOBJS = dgn_yacc.o  dgn_$(LEX).o  dgn_main.o  alloc.o      \
  1221. X              panic.o
  1222. X
  1223. XRECOVOBJS   =  recover.o
  1224. X
  1225. X#
  1226. X#  Header Objects.
  1227. X#
  1228. X
  1229. XDGN_FILE_H = $(INCL)\align.h    $(INCL)\dgn_file.h
  1230. XDUNGEON_H  = $(INCL)\align.h    $(INCL)\dungeon.h
  1231. XEMIN_H     = $(DUNGEON_H)       $(INCL)\emin.h
  1232. XEPRI_H     = $(DUNGEON_H)       $(INCL)\align.h     $(INCL)\epri.h
  1233. XESHK_H     = $(DUNGEON_H)       $(INCL)\eshk.h
  1234. XMONDATA_H  = $(INCL)\align.h    $(INCL)\mondata.h
  1235. XMONST_H    = $(INCL)\align.h    $(INCL)\monst.h
  1236. XPERMONST_H = $(INCL)\monattk.h  $(INCL)\monflag.h   $(INCL)\align.h   \
  1237. X             $(INCL)\permonst.h
  1238. XRM_H       = $(INCL)\align.h    $(INCL)\rm.h
  1239. XSP_LEV_H   = $(INCL)\align.h    $(INCL)\sp_lev.h
  1240. XVAULT_H    = $(DUNGEON_H)       $(INCL)\vault.h
  1241. XYOUPROP_H  = $(PERMONST_H)      $(MONDATA_H)        $(INCL)\prop.h    \
  1242. X             $(INCL)\pm.h       $(INCL)\youprop.h
  1243. XYOU_H      = $(MONST_H)         $(YOUPROP_H)        $(INCL)\align.h   \
  1244. X             $(INCL)\attrib.h   $(INCL)\you.h
  1245. XDISPLAY_H  = $(MONDATA_H)       $(INCL)\vision.h    $(INCL)\display.h
  1246. XPCCONF_H   = $(INCL)\micro.h    $(INCL)\system.h    $(INCL)\pcconf.h
  1247. XCONFIG_H   = $(GLOBAL_H)        $(INCL)\tradstdc.h  $(INCL)\config.h
  1248. XDECL_H     = $(YOU_H)           $(INCL)\spell.h     $(INCL)\color.h   \
  1249. X             $(INCL)\obj.h      $(INCL)\onames.h    $(INCL)\pm.h      \
  1250. X             $(INCL)\decl.h
  1251. XGLOBAL_H   = $(PCCONF_H)        $(INCL)\coord.h     $(INCL)\global.h
  1252. XHACK_H     = $(CONFIG_H)        $(DUNGEON_H)        $(DECL_H)         \
  1253. X             $(DISPLAY_H)       $(INCL)\monsym.h    $(INCL)\mkroom.h  \
  1254. X             $(INCL)\objclass.h $(INCL)\trap.h      $(INCL)\flag.h    \
  1255. X             $(RM_H)            $(INCL)\vision.h    $(INCL)\wintype.h \
  1256. X             $(INCL)\engrave.h  $(INCL)\rect.h      $(INCL)\extern.h \
  1257. X             $(INCL)\trampoli.h $(INCL)\hack.h
  1258. X
  1259. X
  1260. X
  1261. X#
  1262. X#  Make Rules.
  1263. X#
  1264. X
  1265. X.SUFFIXES:  .exe .o .c .y .l
  1266. X
  1267. X.c.o:
  1268. X     $(CC) $(CFLAGS) -o$*.o $*.c
  1269. X
  1270. X#
  1271. X#  Primary Targets.
  1272. X#
  1273. Xall:   utility.tag
  1274. X
  1275. Xutility.tag: $(INCL)\trap.h    $(INCL)\onames.h        \
  1276. X             $(INCL)\pm.h      $(SRC)\monstr.c   $(SRC)\vis_tab.c  \
  1277. X             lev_comp.exe      dgn_comp.exe    recover.exe
  1278. X    echo utilities made > utility.tag
  1279. X
  1280. Xclean:
  1281. X    del *.o
  1282. X    del *.map
  1283. X
  1284. Xspotless: clean
  1285. X    if exist utility.tag       del utility.tag
  1286. X    if exist makedefs.exe      del makedefs.exe
  1287. X    if exist lev_comp.exe      del lev_comp.exe
  1288. X    if exist dgn_comp.exe      del dgn_comp.exe
  1289. X    if exist recover.exe       del recover.exe
  1290. X    if exist $(INCL)\date.h    del $(INCL)\date.h
  1291. X    if exist $(INCL)\onames.h  del $(INCL)\onames.h
  1292. X    if exist $(INCL)\pm.h      del $(INCL)\pm.h
  1293. X    if exist $(INCL)\vis_tab.h del $(INCL)\vis_tab.h
  1294. X    if exist $(SRC)\monstr.c   del $(SRC)\monstr.c
  1295. X    if exist $(SRC)\vis_tab.c  del $(SRC)\vis_tab.c
  1296. X
  1297. X#
  1298. X#  Secondary Targets.
  1299. X#
  1300. X
  1301. X$(INCL)\onames.h: makedefs.exe
  1302. X    .\makedefs -o
  1303. X
  1304. X$(INCL)\pm.h: makedefs.exe
  1305. X    .\makedefs -p
  1306. X
  1307. X$(SRC)\monstr.c: makedefs.exe
  1308. X    .\makedefs -m
  1309. X
  1310. X$(SRC)\vis_tab.h: makedefs.exe
  1311. X    .\makedefs -z
  1312. X
  1313. X$(SRC)\vis_tab.c: makedefs.exe
  1314. X    .\makedefs -z
  1315. X
  1316. X#
  1317. X#  Makedefs Stuff
  1318. X#
  1319. X
  1320. Xmakedefs.exe:  $(MAKEOBJS)
  1321. X    $(CC) $(LFLAGS) $(MAKEOBJS)
  1322. X    copy /b $(STUB)+a.out $*.exe
  1323. X    del a.out
  1324. X
  1325. Xmakedefs.o:  $(CONFIG_H)        $(PERMONST_H)      $(INCL)\objclass.h \
  1326. X             $(INCL)\monsym.h   $(INCL)\qtext.h
  1327. X
  1328. X#
  1329. X#  Level Compiler Dependencies
  1330. X#
  1331. X
  1332. Xlev_comp.exe:  $(SPLEVOBJS)
  1333. X    $(CC) $(LFLAGS) $(SPLEVOBJS)
  1334. X    copy /b $(STUB)+a.out $*.exe
  1335. X    del a.out
  1336. X
  1337. Xlev_yacc.o:  $(HACK_H)   $(SP_LEV_H)    lev_yacc.c
  1338. X    $(CC) $(CFLAGS) -o$*.o $*.c
  1339. X
  1340. X
  1341. Xlev_$(LEX).o:  $(HACK_H)   $(SP_LEV_H)    $(INCL)\lev_comp.h \
  1342. X               lev_$(LEX).c
  1343. X    $(CC) $(CFLAGS) -o$*.o $*.c
  1344. X
  1345. Xlev_main.o:  $(HACK_H)
  1346. X
  1347. X$(INCL)\lev_comp.h: lev_yacc.c
  1348. X
  1349. Xlev_yacc.c:  lev_comp.y
  1350. X    $(YACC) -d lev_comp.y
  1351. X    copy $(YTABC) lev_yacc.c
  1352. X    copy $(YTABH) $(DINCL)\lev_comp.h
  1353. X    del $(YTABC)
  1354. X    del $(YTABH)
  1355. X
  1356. X
  1357. Xlev_$(LEX).c:  lev_comp.l
  1358. X    $(LEX) lev_comp.l
  1359. X    copy $(LEXYYC) lev_$(LEX).c
  1360. X    del $(LEXYYC)
  1361. X
  1362. X
  1363. X#
  1364. X#  Dungeon Dependencies
  1365. X#
  1366. X
  1367. Xdgn_comp.exe:  $(DGNCOMPOBJS)
  1368. X    $(CC) $(LFLAGS) $(DGNCOMPOBJS)
  1369. X    copy /b $(STUB)+a.out $*.exe
  1370. X    del a.out
  1371. X
  1372. Xdgn_yacc.o:  $(HACK_H)   $(DGN_FILE_H)  dgn_yacc.c
  1373. X    $(CC) $(CFLAGS) -o$*.o $*.c
  1374. X
  1375. Xdgn_$(LEX).o:  $(HACK_H)   $(DGN_FILE_H)  $(INCL)\dgn_comp.h \
  1376. X               dgn_$(LEX).c
  1377. X    $(CC) $(CFLAGS) -o$*.o $*.c
  1378. X
  1379. Xdgn_main.o:  $(HACK_H)
  1380. X
  1381. X$(INCL)\dgn_comp.h:  dgn_yacc.c
  1382. X
  1383. Xdgn_yacc.c: dgn_comp.y
  1384. X    $(YACC) -d dgn_comp.y
  1385. X    copy $(YTABC) dgn_yacc.c
  1386. X    copy $(YTABH) $(DINCL)\dgn_comp.h
  1387. X    del $(YTABC)
  1388. X    del $(YTABH)
  1389. X
  1390. Xdgn_$(LEX).c:  dgn_comp.l
  1391. X    $(LEX) dgn_comp.l
  1392. X    copy $(LEXYYC) dgn_$(LEX).c
  1393. X    del $(LEXYYC)
  1394. X
  1395. X#
  1396. X#  Recover Utility
  1397. X#
  1398. X
  1399. Xrecover.exe:   $(RECOVOBJS)
  1400. X    $(CC) $(LFLAGS) $*.o
  1401. X    copy /b $(STUB)+a.out $*.exe
  1402. X    del a.out
  1403. X
  1404. Xrecover.o:   $(CONFIG_H) recover.c
  1405. X    $(CC) $(CFLAGS) -o$*.o $*.c
  1406. X
  1407. X#
  1408. X#  Other Dependencies.
  1409. X#
  1410. X
  1411. Xalloc.c: $(SRC)\$*.c
  1412. X    copy $(SRC)\$*.c .
  1413. X
  1414. Xalloc.o: $(CONFIG_H)     alloc.c
  1415. X    $(CC) $(CFLAGS) -o$*.o $*.c
  1416. X
  1417. Xdrawing.c: $(SRC)\$*.c
  1418. X    copy $(SRC)\$*.c .
  1419. X
  1420. Xdrawing.o: $(CONFIG_H) drawing.c
  1421. X    $(CC) $(CFLAGS) -o$*.o $*.c
  1422. X
  1423. Xdecl.c: $(SRC)\$*.c
  1424. X    copy $(SRC)\$*.c .
  1425. X
  1426. Xdecl.o: $(CONFIG_H) decl.c
  1427. X    $(CC) $(CFLAGS) -o$*.o $*.c
  1428. X
  1429. Xmonst.c: $(SRC)\$*.c
  1430. X    copy $(SRC)\$*.c .
  1431. X
  1432. Xmonst.o: $(CONFIG_H)         $(PERMONST_H)      $(ESHK_H)          \
  1433. X         $(EPRI_H)           $(VAULT_H)         $(INCL)\monsym.h   \
  1434. X         $(INCL)\color.h     monst.c
  1435. X    $(CC) $(CFLAGS) -o$*.o $*.c
  1436. X
  1437. Xobjects.c: $(SRC)\$*.c
  1438. X    copy $(SRC)\$*.c .
  1439. X
  1440. Xobjects.o: $(CONFIG_H)        $(INCL)\obj.h      $(INCL)\objclass.h \
  1441. X           $(INCL)\prop.h     $(INCL)\color.h    objects.c
  1442. X    $(CC) $(CFLAGS) -o$*.o $*.c
  1443. X
  1444. Xpanic.o:   $(CONFIG_H)
  1445. END_OF_FILE
  1446. if test 7504 -ne `wc -c <'sys/msdos/MakeGCC.utl'`; then
  1447.     echo shar: \"'sys/msdos/MakeGCC.utl'\" unpacked with wrong size!
  1448. fi
  1449. # end of 'sys/msdos/MakeGCC.utl'
  1450. fi
  1451. if test -f 'sys/msdos/MakeMSC.utl' -a "${1}" != "-c" ; then 
  1452.   echo shar: Will not clobber existing file \"'sys/msdos/MakeMSC.utl'\"
  1453. else
  1454. echo shar: Extracting \"'sys/msdos/MakeMSC.utl'\" \(7482 characters\)
  1455. sed "s/^X//" >'sys/msdos/MakeMSC.utl' <<'END_OF_FILE'
  1456. X#    SCCS Id: @(#)MakeMSC.utl     3.1     93/01/18
  1457. X# Copyright (c) NetHack PC Development Team 1992, 1993.
  1458. X# NetHack may be freely redistributed.  See license for details.
  1459. X#
  1460. X# PC NetHack 3.1 Utilities Source Code Makefile for Microsoft(tm) "C" >= 6.0ax
  1461. X#
  1462. X#    In addition to your C compiler,
  1463. X#
  1464. X#    if you want to change        you will need a
  1465. X#    files with suffix        workalike for
  1466. X#           .y                yacc
  1467. X#           .l                lex
  1468. X
  1469. X#
  1470. X#    Executables.
  1471. X#
  1472. X
  1473. XCC    = cl
  1474. XLINK    = link
  1475. XMAKEBIN    = make45l
  1476. X
  1477. X#
  1478. X#    Yacc/Lex ... if you got 'em.
  1479. X#    (Note: if you don't, leave the top pair uncommented.)
  1480. X#
  1481. X
  1482. XYACC    = yacc
  1483. XLEX    = lex
  1484. X# YACC    = bison -y
  1485. X# LEX    = flex
  1486. X
  1487. XYTABC    = y_tab.c
  1488. XYTABH    = y_tab.h
  1489. XLEXYYC    = lexyy.c
  1490. X
  1491. X#
  1492. X#    Flags.
  1493. X#
  1494. X
  1495. X#
  1496. X#    + prepare for CodeView symbolic debugger.
  1497. X#
  1498. X
  1499. XCDFLAGS    =
  1500. X#CDFLAGS = /Zi
  1501. X
  1502. XLDFLAGS =
  1503. X#LDFLAGS = /CO
  1504. X
  1505. X#
  1506. X#    CC
  1507. X#
  1508. X
  1509. XCPPFLAGS = /E /AL /c /Os /Gs /Gt20 /Zp1 /W0 /I$(INCL) $(CDFLAGS)
  1510. XCFLAGS     = /AL /c /Os /Gs /Gt20 /Zp1 /W0 /I$(INCL) $(CDFLAGS)
  1511. X
  1512. X#
  1513. X#    Link
  1514. X#
  1515. X
  1516. XLFLAGS    = /noi /seg:512 /map /st:5120 $(LDFLAGS)
  1517. X
  1518. X#
  1519. X#    Directories
  1520. X#
  1521. X
  1522. XINCL    = ..\include
  1523. XDAT    = ..\dat
  1524. XSRC    = ..\src
  1525. XOBJ    = $(SRC)\o
  1526. X
  1527. Xdefault: all
  1528. X#
  1529. X#    If you have yacc and lex programs and make any changes, comment
  1530. X#    out the upper two targets and uncomment the lower two.
  1531. X#
  1532. X
  1533. Xdo_yacc: yacc_msg
  1534. Xdo_lex:  lex_msg
  1535. X# do_yacc: yacc_act
  1536. X# do_lex:  lex_act
  1537. X
  1538. X#
  1539. X#    Optional C library specifier for those with non-standard
  1540. X#    libraries or a multiple-target library setup.
  1541. X#
  1542. X
  1543. X# CLIB       = llibcer /nod
  1544. XCLIB     =
  1545. X
  1546. X#############################################################################
  1547. X#
  1548. X# nothing below this line should have to be changed
  1549. X#
  1550. X
  1551. X#
  1552. X#    Utility Objects.
  1553. X#
  1554. X
  1555. XMAKESRC     =    makedefs.c
  1556. X
  1557. XSPLEVSRC    =   lev_yacc.c  lev_$(LEX).c  lev_main.c  panic.c
  1558. X
  1559. XDGNCOMPSRC  =   dgn_yacc.c  dgn_$(LEX).c  dgn_main.c
  1560. X
  1561. XMAKEOBJS    =    makedefs.o      $(OBJ)\monst.o    $(OBJ)\objects.o
  1562. X
  1563. XSPLEVOBJS   =    lev_yacc.o      lev_$(LEX).o        lev_main.o \
  1564. X        $(OBJ)\alloc.o      $(OBJ)\decl.o     $(OBJ)\drawing.o \
  1565. X        $(OBJ)\monst.o    $(OBJ)\objects.o  panic.o
  1566. X
  1567. XDGNCOMPOBJS =    dgn_yacc.o      dgn_$(LEX).o        dgn_main.o \
  1568. X        $(OBJ)\alloc.o      panic.o
  1569. X
  1570. XRECOVOBJS   =    recover.o
  1571. X
  1572. X#
  1573. X#    Header Objects.
  1574. X#
  1575. X
  1576. XCONFIG_H   = $(GLOBAL_H)           $(INCL)\tradstdc.h $(INCL)\config.h
  1577. XDECL_H     = $(YOU_H)              $(INCL)\quest.h    $(INCL)\spell.h  \
  1578. X             $(INCL)\color.h       $(INCL)\obj.h      $(INCL)\onames.h \
  1579. X             $(INCL)\pm.h          $(INCL)\decl.h
  1580. XDGN_FILE_H = $(INCL)\align.h       $(INCL)\dgn_file.h
  1581. XDISPLAY_H  = $(MONDATA_H)          $(INCL)\vision.h   $(INCL)\display.h
  1582. XDUNGEON_H  = $(INCL)\align.h       $(INCL)\dungeon.h
  1583. XEMIN_H     = $(DUNGEON_H)          $(INCL)\emin.h
  1584. XEPRI_H     = $(DUNGEON_H)          $(INCL)\align.h    $(INCL)\epri.h
  1585. XESHK_H     = $(DUNGEON_H)          $(INCL)\eshk.h
  1586. XGLOBAL_H   = $(PCCONF_H)           $(INCL)\coord.h    $(INCL)\global.h
  1587. XHACK_H     = $(CONFIG_H)           $(DUNGEON_H)       $(DECL_H)          \
  1588. X             $(DISPLAY_H)          $(RM_H)            $(INCL)\monsym.h   \
  1589. X             $(INCL)\mkroom.h      $(INCL)\objclass.h $(INCL)\trap.h     \
  1590. X             $(INCL)\flag.h        $(INCL)\vision.h   $(INCL)\wintype.h  \
  1591. X             $(INCL)\engrave.h     $(INCL)\rect.h     $(INCL)\winprocs.h \
  1592. X             $(INCL)\trampoli.h    $(INCL)\hack.h
  1593. XMONDATA_H  = $(INCL)\align.h       $(INCL)\mondata.h
  1594. XMONST_H    = $(INCL)\align.h       $(INCL)\monst.h
  1595. XPCCONF_H   = $(INCL)\micro.h       $(INCL)\system.h   $(INCL)\pcconf.h
  1596. XPERMONST_H = $(INCL)\monattk.h     $(INCL)\monflag.h  $(INCL)\align.h \
  1597. X             $(INCL)\permonst.h
  1598. XRM_H       = $(INCL)\align.h       $(INCL)\rm.h
  1599. XSP_LEV_H   = $(INCL)\align.h       $(INCL)\sp_lev.h
  1600. XVAULT_H    = $(DUNGEON_H)          $(INCL)\vault.h
  1601. XYOU_H      = $(MONST_H)            $(YOUPROP_H)       $(INCL)\align.h \
  1602. X             $(INCL)\attrib.h      $(INCL)\you.h
  1603. XYOUPROP_H  = $(PERMONST_H)         $(MONDATA_H)       $(INCL)\prop.h \
  1604. X             $(INCL)\pm.h          $(INCL)\youprop.h
  1605. X
  1606. X#
  1607. X#    Make Rules.
  1608. X#
  1609. X
  1610. X.SUFFIXES:  .exe .o .c .y .l
  1611. X
  1612. X.c.o:
  1613. X    $(CC) $(CFLAGS) /Fo$*.o $*.c
  1614. X
  1615. X#
  1616. X#    Primary Targets.
  1617. X#
  1618. Xall:    utility.tag
  1619. X
  1620. Xutility.tag: $(OBJ)             $(INCL)\onames.h     $(INCL)\pm.h \
  1621. X             $(SRC)\monstr.c    $(SRC)\vis_tab.c     lev_comp.exe \
  1622. X             dgn_comp.exe       recover.exe
  1623. X             echo utilities made > utility.tag
  1624. X
  1625. X$(OBJ):
  1626. X    if not exist $(OBJ)\*.* mkdir $(OBJ)
  1627. X
  1628. Xclean:
  1629. X    del *.o
  1630. X    del *.map
  1631. X
  1632. Xspotless: clean
  1633. X    if exist utility.tag       del utility.tag
  1634. X    if exist makedefs.exe       del makedefs.exe
  1635. X    if exist lev_comp.exe       del lev_comp.exe
  1636. X    if exist dgn_comp.exe       del dgn_comp.exe
  1637. X    if exist recover.exe       del recover.exe
  1638. X    if exist $(INCL)\date.h       del $(INCL)\date.h
  1639. X    if exist $(INCL)\onames.h  del $(INCL)\onames.h
  1640. X    if exist $(INCL)\pm.h       del $(INCL)\pm.h
  1641. X    if exist $(INCL)\vis_tab.h del $(INCL)\vis_tab.h
  1642. X    if exist $(SRC)\monstr.c   del $(SRC)\monstr.c
  1643. X    if exist $(SRC)\vis_tab.c  del $(SRC)\vis_tab.c
  1644. X
  1645. X#
  1646. X#    Secondary Targets.
  1647. X#
  1648. X
  1649. X$(INCL)\onames.h: makedefs.exe
  1650. X    .\makedefs -o
  1651. X
  1652. X$(INCL)\pm.h: makedefs.exe
  1653. X    .\makedefs -p
  1654. X
  1655. X$(SRC)\monstr.c: makedefs.exe
  1656. X    .\makedefs -m
  1657. X
  1658. X$(SRC)\vis_tab.h: makedefs.exe
  1659. X    .\makedefs -z
  1660. X
  1661. X$(SRC)\vis_tab.c: makedefs.exe
  1662. X    .\makedefs -z
  1663. X
  1664. X#
  1665. X#    Makedefs Stuff
  1666. X#
  1667. X
  1668. Xmakedefs.exe:    $(MAKEOBJS)
  1669. X    $(LINK) $(LFLAGS) $(MAKEOBJS), $*.exe,, $(CLIB);
  1670. X
  1671. Xmakedefs.o:    $(CONFIG_H)        $(PERMONST_H)      $(INCL)\objclass.h \
  1672. X        $(INCL)\monsym.h    $(INCL)\qtext.h
  1673. X
  1674. X#
  1675. X#    Level Compiler Dependencies
  1676. X#
  1677. X
  1678. Xlev_comp.exe:    $(SPLEVOBJS)
  1679. X    $(LINK) $(LFLAGS) $(SPLEVOBJS),lev_comp.exe,, $(CLIB);
  1680. X
  1681. Xlev_yacc.o:    $(HACK_H)   $(SP_LEV_H)    lev_yacc.c
  1682. X    $(CC) $(CFLAGS) /Fo$*.o $*.c
  1683. X
  1684. Xlev_$(LEX).o:    $(HACK_H)   $(SP_LEV_H)    $(INCL)\lev_comp.h \
  1685. X        lev_$(LEX).c
  1686. X    $(CC) $(CFLAGS) /Fo$*.o $*.c
  1687. X
  1688. Xlev_main.o:    $(HACK_H)   $(SP_LEV_H)
  1689. X
  1690. X$(INCL)\lev_comp.h: lev_yacc.c
  1691. X
  1692. Xlev_yacc.c:    lev_comp.y
  1693. X    $(MAKEBIN) YY=lev do_yacc
  1694. X
  1695. Xlev_$(LEX).c:    lev_comp.l
  1696. X    $(MAKEBIN) YY=lev do_lex
  1697. X
  1698. X#
  1699. X#    Dungeon Dependencies
  1700. X#
  1701. X
  1702. Xdgn_comp.exe:    $(DGNCOMPOBJS)
  1703. X    $(LINK) $(LFLAGS) $(DGNCOMPOBJS),$*.exe,, $(CLIB);
  1704. X
  1705. Xdgn_yacc.o:    $(HACK_H)   $(DGN_FILE_H)  dgn_yacc.c
  1706. X    $(CC) $(CFLAGS) /Fo$*.o $*.c
  1707. X
  1708. Xdgn_$(LEX).o:    $(HACK_H)   $(DGN_FILE_H)  $(INCL)\dgn_comp.h \
  1709. X        dgn_$(LEX).c
  1710. X    $(CC) $(CFLAGS) /Fo$*.o $*.c
  1711. X
  1712. Xdgn_main.o:    $(HACK_H)
  1713. X
  1714. X$(INCL)\dgn_comp.h:    dgn_yacc.c
  1715. X
  1716. Xdgn_yacc.c: dgn_comp.y
  1717. X    $(MAKEBIN) YY=dgn do_yacc
  1718. X
  1719. Xdgn_$(LEX).c:  dgn_comp.l
  1720. X    $(MAKEBIN) YY=dgn do_lex
  1721. X
  1722. X#
  1723. X#    Yacc & Lex Magic.
  1724. X#
  1725. X
  1726. Xyacc_msg:
  1727. X    @echo $(YY)_comp.y has changed. To update $(YY)_yacc.c and $(YY)_comp.h run $(YACC).
  1728. X
  1729. Xyacc_act:
  1730. X    $(YACC) -d $(YY)_comp.y
  1731. X    copy $(YTABC) $(YY)_yacc.c
  1732. X    copy $(YTABH) $(INCL)\$(YY)_comp.h
  1733. X    del $(YTABC)
  1734. X    del $(YTABH)
  1735. X
  1736. Xlex_msg:
  1737. X    @echo $(YY)_comp.l has changed. To update $(YY)_$(LEX).c run $(LEX).
  1738. X
  1739. Xlex_act:
  1740. X    $(LEX) $(YY)_comp.l
  1741. X    copy $(LEXYYC) $(YY)_$(LEX).c
  1742. X    del $(LEXYYC)
  1743. X
  1744. X#
  1745. X#    Recover Utility
  1746. X#
  1747. X
  1748. Xrecover.exe:    $(RECOVOBJS)
  1749. X    $(LINK) $(LFLAGS) $*.o,$*.exe,, $(CLIB);
  1750. X
  1751. Xrecover.o:    $(CONFIG_H)    recover.c
  1752. X    $(CC) $(CFLAGS) /Fo$*.o $*.c
  1753. X
  1754. X#
  1755. X#    Other Dependencies.
  1756. X#
  1757. X
  1758. X$(OBJ)\alloc.o:    $(CONFIG_H)    $(SRC)\alloc.c
  1759. X    $(CC) $(CFLAGS) /Fo$(OBJ)\$*.o $(SRC)\$*.c
  1760. X
  1761. X$(OBJ)\decl.o:  $(HACK_H)       $(INCL)\quest.h   $(SRC)\decl.c
  1762. X    $(CC) $(CFLAGS) /Fo$(OBJ)\$*.o $(SRC)\$*.c
  1763. X
  1764. X$(OBJ)\drawing.o: $(HACK_H)     $(INCL)\termcap.h $(SRC)\drawing.c
  1765. X    $(CC) $(CFLAGS) /Fo$(OBJ)\$*.o $(SRC)\$*.c
  1766. X
  1767. X$(OBJ)\monst.o: $(CONFIG_H)         $(PERMONST_H)    $(ESHK_H)     \
  1768. X        $(EPRI_H)         $(VAULT_H)        $(INCL)\monsym.h \
  1769. X        $(INCL)\color.h    $(SRC)\monst.c
  1770. X    $(CC) $(CFLAGS) /Fo$(OBJ)\$*.o $(SRC)\$*.c
  1771. X
  1772. X$(OBJ)\objects.o: $(CONFIG_H)         $(INCL)\obj.h    $(INCL)\objclass.h \
  1773. X          $(INCL)\prop.h     $(INCL)\color.h    $(SRC)\objects.c
  1774. X    $(CC) $(CFLAGS) /Fo$(OBJ)\$*.o $(SRC)\$*.c
  1775. X
  1776. Xpanic.o:    $(CONFIG_H)
  1777. END_OF_FILE
  1778. if test 7482 -ne `wc -c <'sys/msdos/MakeMSC.utl'`; then
  1779.     echo shar: \"'sys/msdos/MakeMSC.utl'\" unpacked with wrong size!
  1780. fi
  1781. # end of 'sys/msdos/MakeMSC.utl'
  1782. fi
  1783. if test -f 'sys/os2/nhpmico.uu' -a "${1}" != "-c" ; then 
  1784.   echo shar: Will not clobber existing file \"'sys/os2/nhpmico.uu'\"
  1785. else
  1786. echo shar: Extracting \"'sys/os2/nhpmico.uu'\" \(1273 characters\)
  1787. sed "s/^X//" >'sys/os2/nhpmico.uu' <<'END_OF_FILE'
  1788. Xbegin 644 nethack.ico
  1789. XM0D$H``````````````!#21H`````````>`````P````@`$```0`!`````/___
  1790. XM_T-)&@````````!X`0``#````"``(``!``0```````"``(```("`@```@`"`L
  1791. XM@(``@("`P,#```#_`/\``/___P``_P#___\`____````````````````````!
  1792. XM`````````````````````````````````````````````````````````````
  1793. XM`````````````````````````````````````````````````````````````
  1794. XM`````````````````````````````````````````````````````````````
  1795. XM`````````````````````````````````````````````````````````````
  1796. XM`````````````````````````````````````````````````````````````
  1797. XM`````````````````````/9F9F9F9F9F9F9F9F9F9F;_9F9F9F9F9F9F9F9F7
  1798. XM9F9F_XB(B(B(B(B(B(B(B(AF9O^(B(B(B(B(B(B(B(B(9F;_B(B(B(5558B("
  1799. XMB(B(B&9F_XB(B(@`506(B(B(B(AF9O^(B(B(```%B(B(B(B(9F;_B(A555``@
  1800. XM55B(B(B(B&9F_XB+N[NP#N-5B(B(B(AF9O^(N[N[`+[N-5B(B(B(9F;_B[N[E
  1801. XMN[N[[N-8B(B(B&9F_XN[N[N[N[[N4XB(B(AF9O^+N[N9F9N[[N,XB(B(9F;_)
  1802. XMB[NYF9F9N[[N,XB(B&9F_XN[F9F9F9N[[N,XB(AF9O^+N9F9F9F9NU[N,XB(<
  1803. XM9F;_B[F9F9F9F;M8[N,XB&9F_XNYF9F9F9F[6([N,XAF9O^+N9F9F9F9NUB(]
  1804. XM[N.(9F;_B[F9F9F9F;M8B([NB&9F_XN[F9F9F9N[6(B([HAF9O^+N[F9F9F[#
  1805. XMNUB(B(B(9F;_B[N[F9F;N[M8B(B(B&9F_XN[N[N[N[N[6(B(B(AF9O^+N[N[)
  1806. XMN[N[NXB(B(B(9F;_B[N(B(B(B[N(B(B(B&9F_XNXB(B(B(B[B(B(B(AF9O^(/
  1807. XMB(B(B(B(B(B(B(B(9F;_B(B(B(B(B(B(B(B(B&9F_XB(B(B(B(B(B(B(B(AFN
  1808. XA9O__________________]F;_____________________?
  1809. X``
  1810. Xend
  1811. END_OF_FILE
  1812. if test 1273 -ne `wc -c <'sys/os2/nhpmico.uu'`; then
  1813.     echo shar: \"'sys/os2/nhpmico.uu'\" unpacked with wrong size!
  1814. fi
  1815. # end of 'sys/os2/nhpmico.uu'
  1816. fi
  1817. if test -f 'sys/vms/vmsfiles.c' -a "${1}" != "-c" ; then 
  1818.   echo shar: Will not clobber existing file \"'sys/vms/vmsfiles.c'\"
  1819. else
  1820. echo shar: Extracting \"'sys/vms/vmsfiles.c'\" \(7059 characters\)
  1821. sed "s/^X//" >'sys/vms/vmsfiles.c' <<'END_OF_FILE'
  1822. X/*    SCCS Id: @(#)vmsfiles.c    3.1    93/01/20    */
  1823. X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1824. X/* NetHack may be freely redistributed.  See license for details. */
  1825. X
  1826. X/*
  1827. X *  VMS-specific file manipulation routines to implement some missing
  1828. X *  routines or substitute for ones where we want behavior modification.
  1829. X */
  1830. X#include "config.h"
  1831. X
  1832. X#include <rms.h>
  1833. X#if 0
  1834. X#include <psldef.h>
  1835. X#else
  1836. X#define PSL$C_EXEC 1    /* executive mode, for priv'd logical name handling */
  1837. X#endif
  1838. X#ifndef C$$TRANSLATE    /* don't rely on VAXCRTL's internal routine */
  1839. X#include <errno.h>
  1840. X#define C$$TRANSLATE(status) (errno = EVMSERR,  vaxc$errno = (status))
  1841. X#else
  1842. Xint FDECL(c__translate, (int));
  1843. X#endif
  1844. Xextern unsigned long SYS$PARSE(), SYS$SEARCH(), SYS$ENTER(), SYS$REMOVE();
  1845. X
  1846. X#define vms_success(sts) ((sts)&1)        /* odd, */
  1847. X#define vms_failure(sts) (!vms_success(sts))    /* even */
  1848. X
  1849. X/* vms_link() -- create an additional directory for an existing file */
  1850. Xint vms_link(file, new)
  1851. Xconst char *file, *new;
  1852. X{
  1853. X    struct FAB fab;
  1854. X    struct NAM nam;
  1855. X    unsigned short fid[3];
  1856. X    char esa[NAM$C_MAXRSS];
  1857. X
  1858. X    fab = cc$rms_fab;    /* set block ID and length, zero the rest */
  1859. X    fab.fab$l_fop = FAB$M_OFP;
  1860. X    fab.fab$l_fna = (char *) file;
  1861. X    fab.fab$b_fns = strlen(file);
  1862. X    fab.fab$l_nam = &nam;
  1863. X    nam = cc$rms_nam;
  1864. X    nam.nam$l_esa = esa;
  1865. X    nam.nam$b_ess = sizeof esa;
  1866. X
  1867. X    if (vms_success(SYS$PARSE(&fab)) && vms_success(SYS$SEARCH(&fab))) {
  1868. X    fid[0] = nam.nam$w_fid[0];
  1869. X    fid[1] = nam.nam$w_fid[1];
  1870. X    fid[2] = nam.nam$w_fid[2];
  1871. X    fab.fab$l_fna = (char *) new;
  1872. X    fab.fab$b_fns = strlen(new);
  1873. X
  1874. X    if (vms_success(SYS$PARSE(&fab))) {
  1875. X        nam.nam$w_fid[0] = fid[0];
  1876. X        nam.nam$w_fid[1] = fid[1];
  1877. X        nam.nam$w_fid[2] = fid[2];
  1878. X        nam.nam$l_esa = nam.nam$l_name;
  1879. X        nam.nam$b_esl = nam.nam$b_name + nam.nam$b_type + nam.nam$b_ver;
  1880. X
  1881. X        (void) SYS$ENTER(&fab);
  1882. X    }
  1883. X    }
  1884. X
  1885. X    if (vms_failure(fab.fab$l_sts)) {
  1886. X    C$$TRANSLATE(fab.fab$l_sts);
  1887. X    return -1;
  1888. X    }
  1889. X    return 0;    /* success */
  1890. X}
  1891. X
  1892. X/*
  1893. X   vms_unlink() -- remove a directory entry for a file; should only be used
  1894. X   for files which have had extra directory entries added, not for deletion
  1895. X   (because the file won't be deleted, just made inaccessible!).
  1896. X */
  1897. Xint vms_unlink(file)
  1898. Xconst char *file;
  1899. X{
  1900. X    struct FAB fab;
  1901. X    struct NAM nam;
  1902. X    char esa[NAM$C_MAXRSS];
  1903. X
  1904. X    fab = cc$rms_fab;    /* set block ID and length, zero the rest */
  1905. X    fab.fab$l_fop = FAB$M_DLT;
  1906. X    fab.fab$l_fna = (char *) file;
  1907. X    fab.fab$b_fns = strlen(file);
  1908. X    fab.fab$l_nam = &nam;
  1909. X    nam = cc$rms_nam;
  1910. X    nam.nam$l_esa = esa;
  1911. X    nam.nam$b_ess = sizeof esa;
  1912. X
  1913. X    if (vms_failure(SYS$PARSE(&fab)) || vms_failure(SYS$REMOVE(&fab))) {
  1914. X    C$$TRANSLATE(fab.fab$l_sts);
  1915. X    return -1;
  1916. X    }
  1917. X    return 0;
  1918. X}
  1919. X
  1920. X/*
  1921. X   Substitute creat() routine -- if trying to create a specific version,
  1922. X   explicitly remove an existing file of the same name.  Since it's only
  1923. X   used when we expect exclusive access, add a couple RMS options for
  1924. X   optimization.  (Don't allow sharing--eliminates coordination overhead,
  1925. X   and use 32 block buffer for faster throughput; ~30% speedup measured.)
  1926. X */
  1927. X#undef creat
  1928. Xint vms_creat(file, mode)
  1929. Xconst char *file;
  1930. Xunsigned int mode;
  1931. X{
  1932. X    if (index(file, ';'))
  1933. X    (void) unlink(file);    /* assumes remove or delete, not vms_unlink */
  1934. X    return creat(file, mode, "shr=nil", "mbc=32");
  1935. X}
  1936. X
  1937. X/*
  1938. X   Similar substitute for open() -- can't disallow sharing, because we're
  1939. X   relying on deleting a file that we've got open, so must share it with
  1940. X   ourself!
  1941. X */
  1942. X#undef open
  1943. Xint vms_open(file, flags, mode)
  1944. Xconst char *file;
  1945. Xint flags;
  1946. Xunsigned int mode;
  1947. X{
  1948. X    return open(file, flags, mode, "mbc=32");
  1949. X}
  1950. X
  1951. X/*
  1952. X   Determine whether two strings contain the same directory name.
  1953. X   Used for deciding whether installed privileges should be disabled
  1954. X   when HACKDIR is defined in the environment (or specified via -d on
  1955. X   the command line).  This version doesn't handle Unix-style file specs.
  1956. X */
  1957. Xboolean
  1958. Xsame_dir(d1, d2)
  1959. Xconst char *d1, *d2;
  1960. X{
  1961. X    if (!d1 || !*d1 || !d2 || !*d2)
  1962. X    return FALSE;
  1963. X    else if (!strcmp(d1, d2))    /* strcmpi() would be better, but that leads */
  1964. X    return TRUE;        /* to linking problems for the utilities */
  1965. X    else {
  1966. X    struct FAB f1, f2;
  1967. X    struct NAM n1, n2;
  1968. X
  1969. X    f1 = f2 = cc$rms_fab;    /* initialize file access block */
  1970. X    n1 = n2 = cc$rms_nam;    /* initialize name block */
  1971. X    f1.fab$b_acmodes = PSL$C_EXEC << FAB$V_LNM_MODE;
  1972. X    f1.fab$b_fns = strlen( f1.fab$l_fna = (char *)d1 );
  1973. X    f2.fab$b_fns = strlen( f2.fab$l_fna = (char *)d2 );
  1974. X    f1.fab$l_nam = (genericptr_t)&n1;    /* link nam to fab */
  1975. X    f2.fab$l_nam = (genericptr_t)&n2;
  1976. X    n1.nam$b_nop = n2.nam$b_nop = NAM$M_NOCONCEAL; /* want true device name */
  1977. X
  1978. X    return (vms_success(SYS$PARSE(&f1)) && vms_success(SYS$PARSE(&f2))
  1979. X         && n1.nam$t_dvi[0] == n2.nam$t_dvi[0]
  1980. X         && !strncmp(&n1.nam$t_dvi[1], &n2.nam$t_dvi[1], n1.nam$t_dvi[0])
  1981. X         && !memcmp((genericptr_t)n1.nam$w_did,
  1982. X            (genericptr_t)n2.nam$w_did,
  1983. X            sizeof n1.nam$w_did));    /*{ short nam$w_did[3]; }*/
  1984. X    }
  1985. X}
  1986. X
  1987. X
  1988. X/*
  1989. X * c__translate -- substitute for VAXCRTL routine C$$TRANSLATE.
  1990. X *
  1991. X *    Try to convert a VMS status code into its Unix equivalent,
  1992. X *    then set `errno' to that value; use EVMSERR if there's no
  1993. X *    appropriate translation; set `vaxc$errno' to the original
  1994. X *    status code regardless.
  1995. X *
  1996. X *    These translations match only a subset of VAXCRTL's lookup
  1997. X *    table, but work even if the severity has been adjusted or
  1998. X *    the inhibit-message bit has been set.
  1999. X */
  2000. X#include <errno.h>
  2001. X#include <ssdef.h>
  2002. X#include <rmsdef.h>
  2003. X/* #include <libdef.h> */
  2004. X/* #include <mthdef.h> */
  2005. X
  2006. X#define VALUE(U)    trans = U; break
  2007. X#define CASE1(V)    case (V >> 3)
  2008. X#define CASE2(V,W)    CASE1(V): CASE1(W)
  2009. X
  2010. Xint c__translate(code)
  2011. X    int code;
  2012. X{
  2013. X    register int trans;
  2014. X
  2015. X    switch ((code & 0x0FFFFFF8) >> 3) {    /* strip upper 4 and bottom 3 bits */
  2016. X    CASE2(RMS$_PRV,SS$_NOPRIV):
  2017. X                VALUE(EPERM);    /* not owner */
  2018. X    CASE2(RMS$_DNF,RMS$_DIR):
  2019. X    CASE2(RMS$_FNF,RMS$_FND):
  2020. X    CASE1(SS$_NOSUCHFILE):
  2021. X                VALUE(ENOENT);    /* no such file or directory */
  2022. X    CASE2(RMS$_IFI,RMS$_ISI):
  2023. X                VALUE(EIO);    /* i/o error */
  2024. X    CASE1(RMS$_DEV):
  2025. X    CASE2(SS$_NOSUCHDEV,SS$_DEVNOTMOUNT):
  2026. X                VALUE(ENXIO);    /* no such device or address codes */
  2027. X    CASE1(RMS$_DME):
  2028. X     /* CASE1(LIB$INSVIRMEM): */
  2029. X    CASE2(SS$_VASFULL,SS$_INSFWSL):
  2030. X                VALUE(ENOMEM);    /* not enough core */
  2031. X    CASE1(SS$_ACCVIO):
  2032. X                VALUE(EFAULT);    /* bad address */
  2033. X    CASE2(RMS$_DNR,SS$_DEVASSIGN):
  2034. X    CASE2(SS$_DEVALLOC,SS$_DEVALRALLOC):
  2035. X    CASE2(SS$_DEVMOUNT,SS$_DEVACTIVE):
  2036. X                VALUE(EBUSY);    /* mount device busy codes to name a few */
  2037. X    CASE2(RMS$_FEX,SS$_FILALRACC):
  2038. X                VALUE(EEXIST);    /* file exists */
  2039. X    CASE2(RMS$_IDR,SS$_BADIRECTORY):
  2040. X                VALUE(ENOTDIR);    /* not a directory */
  2041. X    CASE1(SS$_NOIOCHAN):
  2042. X                VALUE(EMFILE);    /* too many open files */
  2043. X    CASE1(RMS$_FUL):
  2044. X    CASE2(SS$_DEVICEFULL,SS$_EXDISKQUOTA):
  2045. X                VALUE(ENOSPC);    /* no space left on disk codes */
  2046. X    CASE2(RMS$_WLK,SS$_WRITLCK):
  2047. X                VALUE(EROFS);    /* read-only file system */
  2048. X    default:
  2049. X                VALUE(EVMSERR);
  2050. X    };
  2051. X
  2052. X    errno = trans;
  2053. X    vaxc$errno = code;
  2054. X    return code;    /* (not very useful) */
  2055. X}
  2056. X
  2057. X#undef VALUE
  2058. X#undef CASE1
  2059. X#undef CASE2
  2060. X
  2061. X/*vmsfiles.c*/
  2062. END_OF_FILE
  2063. if test 7059 -ne `wc -c <'sys/vms/vmsfiles.c'`; then
  2064.     echo shar: \"'sys/vms/vmsfiles.c'\" unpacked with wrong size!
  2065. fi
  2066. # end of 'sys/vms/vmsfiles.c'
  2067. fi
  2068. echo shar: End of archive 98 \(of 108\).
  2069. cp /dev/null ark98isdone
  2070. MISSING=""
  2071. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 \
  2072. 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 \
  2073. 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 \
  2074. 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 \
  2075. 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 \
  2076. 101 102 103 104 105 106 107 108 ; do
  2077.     if test ! -f ark${I}isdone ; then
  2078.     MISSING="${MISSING} ${I}"
  2079.     fi
  2080. done
  2081. if test "${MISSING}" = "" ; then
  2082.     echo You have unpacked all 108 archives.
  2083.     echo "Now execute 'rebuild.sh'"
  2084.     rm -f ark10[0-8]isdone ark[1-9]isdone ark[1-9][0-9]isdone
  2085. else
  2086.     echo You still need to unpack the following archives:
  2087.     echo "        " ${MISSING}
  2088. fi
  2089. ##  End of shell archive.
  2090. exit 0
  2091.