ularn_ask.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /* =============================================================================
  2. * PROGRAM: ularn
  3. * FILENAME: ularn_ask.h
  4. *
  5. * DESCRIPTION:
  6. * This module provides functions for getting answers to common questions
  7. * in the game from teh player.
  8. *
  9. * =============================================================================
  10. * EXPORTED VARIABLES
  11. *
  12. * None
  13. *
  14. * =============================================================================
  15. * EXPORTED FUNCTIONS
  16. *
  17. * more - Asks press space to continue
  18. * clearpager - resets pagination calculations for paged text output
  19. * pager - Call to perform pagination ofter each line of text is output
  20. * getyn - ASks for a yess no answer
  21. * getpassword - Get the password for wizard
  22. * dirsub - Asks for a direction
  23. *
  24. * =============================================================================
  25. */
  26. #ifndef __ULARN_ASK_H
  27. #define __ULARN_ASK_H
  28. /* =============================================================================
  29. * FUNCTION: more
  30. *
  31. * DESCRIPTION:
  32. * Function to ask --more-- then the user must enter a space.
  33. *
  34. * PARAMETERS:
  35. *
  36. * None.
  37. *
  38. * RETURN VALUE:
  39. *
  40. * None.
  41. */
  42. void more(void);
  43. /* =============================================================================
  44. * FUNCTION: clearpager
  45. *
  46. * DESCRIPTION:
  47. * Function to initialise text pagination.
  48. *
  49. * PARAMETERS:
  50. *
  51. * None.
  52. *
  53. * RETURN VALUE:
  54. *
  55. * None.
  56. */
  57. void clearpager(void);
  58. /* =============================================================================
  59. * FUNCTION: Pager
  60. *
  61. * DESCRIPTION:
  62. * Pagination function to be called for each line of text added to the
  63. * display.
  64. * When a full page of text has been displayed the more() function is called
  65. * to halt further output until the player has pressed space.
  66. *
  67. * PARAMETERS:
  68. *
  69. * None.
  70. *
  71. * RETURN VALUE:
  72. *
  73. * None.
  74. */
  75. void pager(void);
  76. /* =============================================================================
  77. * FUNCTION: getyn
  78. *
  79. * DESCRIPTION:
  80. * Function to get a yes or no response from the user.
  81. *
  82. * PARAMETERS:
  83. *
  84. * None.
  85. *
  86. * RETURN VALUE:
  87. *
  88. * 'y' or 'Y' if the player selected yes
  89. * 'n' or 'N' if the player selected no.
  90. */
  91. int getyn(void);
  92. /* =============================================================================
  93. * FUNCTION: getpassword
  94. *
  95. * DESCRIPTION:
  96. * Function to ask user for a password (does not echo characters entered)
  97. *
  98. * PARAMETERS:
  99. *
  100. * None.
  101. *
  102. * RETURN VALUE:
  103. *
  104. * 1 if the password was entered correctly or 0 if not.
  105. */
  106. int getpassword(void);
  107. /* =============================================================================
  108. * FUNCTION: dirsub
  109. *
  110. * DESCRIPTION:
  111. * Function to ask for a direction and modify an x,y for that direction
  112. * Enter with the origination coordinates in (x,y). Returns index into diroffx[]
  113. * (0-8).
  114. * NOTE: x,y may be outside the map after calling this function.
  115. *
  116. * PARAMETERS:
  117. *
  118. * x : This is the X coord to be modified by the selected direction.
  119. *
  120. * y : This is the Y coord to be modified by the selected direction.
  121. *
  122. * RETURN VALUE:
  123. *
  124. * The index into diroff of the direction selected.
  125. */
  126. int dirsub(int *x, int *y);
  127. #endif