funcs.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /* funcs.h -- functions for dungeon */
  2. #ifndef FUNCS_H
  3. #define FUNCS_H
  4. /* If __STDC__ is not defined, don't use function prototypes, void, or
  5. * const.
  6. */
  7. #ifdef __STDC__
  8. #define P(x) x
  9. #else
  10. #define P(x) ()
  11. #define void int
  12. #define const
  13. #endif
  14. /* Try to guess whether we need "rb" to open files in binary mode.
  15. * If this is unix, it doesn't matter. Otherwise, assume that if
  16. * __STDC__ is defined we can use "rb". Otherwise, assume that we
  17. * had better use "r" or fopen will fail.
  18. */
  19. #ifdef unix
  20. #define BINREAD "r"
  21. #define BINWRITE "w"
  22. #else /* ! unix */
  23. #ifdef __STDC__
  24. #define BINREAD "rb"
  25. #define BINWRITE "wb"
  26. #else /* ! __STDC__ */
  27. #define BINREAD "r"
  28. #define BINWRITE "w"
  29. #endif /* ! __STDC__ */
  30. #endif /* ! unix */
  31. typedef int integer;
  32. typedef int logical;
  33. #define TRUE_ (1)
  34. #define FALSE_ (0)
  35. #define abs(x) ((x) >= 0 ? (x) : -(x))
  36. #define min(a,b) ((a) <= (b) ? (a) : (b))
  37. #define max(a,b) ((a) >= (b) ? (a) : (b))
  38. extern logical
  39. protected P((void)),
  40. wizard P((void));
  41. extern void
  42. more_init P((void)),
  43. more_output P((const char *)),
  44. more_input P((void));
  45. extern void
  46. bug_ P((integer, integer)),
  47. cevapp_ P((integer)),
  48. cpgoto_ P((integer)),
  49. cpinfo_ P((integer, integer)),
  50. encryp_ P((const char *, char *)),
  51. exit_ P((void)),
  52. fightd_ P((void)),
  53. game_ P((void)),
  54. gdt_ P((void)),
  55. gttime_ P((integer *)),
  56. invent_ P((integer)),
  57. itime_ P((integer *, integer *, integer *)),
  58. jigsup_ P((integer)),
  59. newsta_ P((integer, integer, integer, integer, integer)),
  60. orphan_ P((integer, integer, integer, integer, integer)),
  61. princo_ P((integer, integer)),
  62. princr_ P((logical, integer)),
  63. rdline_ P((char *, integer)),
  64. rspeak_ P((integer)),
  65. rspsb2_ P((integer, integer, integer)),
  66. rspsub_ P((integer, integer)),
  67. rstrgm_ P((void)),
  68. savegm_ P((void)),
  69. score_ P((logical)),
  70. scrupd_ P((integer)),
  71. swordd_ P((void)),
  72. thiefd_ P((void)),
  73. valuac_ P((integer));
  74. extern integer
  75. blow_ P((integer, integer, integer, logical, integer)),
  76. fights_ P((integer, logical)),
  77. fwim_ P((integer, integer, integer, integer, integer, logical)),
  78. getobj_ P((integer, integer, integer)),
  79. schlst_ P((integer, integer, integer, integer, integer, integer)),
  80. mrhere_ P((integer)),
  81. oactor_ P((integer)),
  82. rnd_ P((integer)),
  83. robadv_ P((integer, integer, integer, integer)),
  84. robrm_ P((integer, integer, integer, integer, integer)),
  85. sparse_ P((const integer *, integer, logical)),
  86. vilstr_ P((integer)),
  87. weight_ P((integer, integer, integer));
  88. extern logical
  89. aappli_ P((integer)),
  90. ballop_ P((integer)),
  91. clockd_ P((void)),
  92. cyclop_ P((integer)),
  93. drop_ P((logical)),
  94. findxt_ P((integer, integer)),
  95. ghere_ P((integer, integer)),
  96. init_ P((void)),
  97. lightp_ P((integer)),
  98. lit_ P((integer)),
  99. moveto_ P((integer, integer)),
  100. nobjs_ P((integer, integer)),
  101. oappli_ P((integer, integer)),
  102. objact_ P((void)),
  103. opncls_ P((integer, integer, integer)),
  104. parse_ P((char *, logical)),
  105. prob_ P((integer, integer)),
  106. put_ P((logical)),
  107. rappli_ P((integer)),
  108. rappl1_ P((integer)),
  109. rappl2_ P((integer)),
  110. rmdesc_ P((integer)),
  111. sobjs_ P((integer, integer)),
  112. sverbs_ P((integer)),
  113. synmch_ P((void)),
  114. take_ P((logical)),
  115. thiefp_ P((integer)),
  116. trollp_ P((integer)),
  117. qempty_ P((integer)),
  118. qhere_ P((integer, integer)),
  119. vappli_ P((integer)),
  120. walk_ P((void)),
  121. winnin_ P((integer, integer)),
  122. yesno_ P((integer, integer, integer));
  123. #endif