home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume18 / notation / part01 / notation.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-04-13  |  3.3 KB  |  142 lines

  1. /* notation program */
  2. #ifndef _NOTATION_HEADERS
  3. #define _NOTATION_HEADERS
  4.  
  5.  
  6. /* ---- KEYWORDS ----  */
  7.  
  8. /* prefix for keywords */
  9. #define PREFIX '@'
  10.  
  11. #define NBKEYWORD 10
  12.  
  13. #define START     0
  14. #define CLEAR     1
  15. #define SHOWBOARD 2
  16. #define TOWHITE   3
  17. #define TOBLACK   4
  18. #define CONFIGWH  5
  19. #define CONFIGBL  6
  20. #define DEFAULTP  7
  21. #define SPECIAL   8
  22. #define KNULL     9
  23.  
  24.  
  25. /* ---- LANGUAGES ---- */
  26.  
  27. #define FRENCH  0
  28. #define ENGLISH 1
  29. #define ITALIAN 2
  30. #define SPANISH 3
  31. #define GERMAN  4
  32. #define DUTCH   5
  33. #define RUSSIAN 6
  34.  
  35. #define NBLANGUAGE 6
  36.  
  37. #ifndef DEFAULT_INPUT_LANGUAGE
  38. #define DEFAULT_INPUT_LANGUAGE  FRENCH
  39. #endif
  40.  
  41. #ifndef DEFAULT_OUTPUT_LANGUAGE
  42. #define DEFAULT_OUTPUT_LANGUAGE FRENCH
  43. #endif
  44.  
  45. /* ---- MISC TABLES ---- */
  46.  
  47. /* roque ascii table */
  48. #define NBROQUE     6
  49. #define SPETITROQUE 0
  50. #define SGRANDROQUE 1
  51.  
  52.  
  53. /* ---- DRIVERS ---- */
  54.  
  55. /* output drivers name table */
  56. #define DEFAULT_DRIVER D_ASCII
  57.  
  58. /* ---- IO ---- */
  59.  
  60. #ifndef LIB_DIR
  61. #define LIB_DIR    "./lib/"
  62. #endif
  63.  
  64. #define HELP_FILE  "HELPFILE"
  65.  
  66. extern FILE * infile;
  67.  
  68. /* ------------- service routines -------------------*/
  69.  
  70. /* Output an error message and exit */
  71. #define fatal(A) (void) fprintf A , close_files() , exit(1)
  72.  
  73. /* Output an error message and set the error flag */
  74. #define error(A) (void) fprintf A , error_flag = TRUE , (void)fflush(stderr)
  75.  
  76. /* Output an error message and set the error flag */
  77. #define message(A) (void) fprintf A 
  78.  
  79. #define MALLOC(T)  (T *)malloc((unsigned)sizeof(T))
  80. #define ALLOCP(P)  if ( (P) == NULL ) { fatal(("malloc failed")) ; };
  81.  
  82. /* ------- conversion of input character --------------------- */
  83.  
  84. #define lettertocol(c)  ((c)-'a'+1)
  85. #define lettertolig(c)  ((c)-'1'+1)
  86. #define coltoletter(n)  ((n)-1+'a')
  87. #define ligtoletter(n)  ((n)-1+'1')
  88.  
  89.  
  90. /* ------- variables and functions --------------------------- */
  91. extern char *version_string;
  92. extern int configuring;
  93. extern int configside;
  94. extern char *in_table;
  95. extern char *out_table;
  96. extern char *c_roque[];
  97. extern char *c_en_passant[];
  98. extern char c_prise;
  99. extern char *c_comments[];
  100. extern int error_flag;
  101.  
  102. /* ---------- service routines ---------- */
  103.  
  104. extern void clear_board(/*game *g*/);
  105. extern game *new_board(/*void*/);
  106. extern void init_board(/*game *tgm*/);
  107. extern depl *new_move(/*void*/);
  108. extern void init_move(/*depl *m*/);
  109.  
  110.  
  111. /* ------ parse and analysis routines ------ */
  112.  
  113. extern int in_board(/*int l, int c*/);
  114. extern int path_free(/*int l1, int c1, int l2, int c2*/);
  115. extern int check_roque(/*void*/);
  116. extern int guess_piece(/*void*/);
  117. extern int guess_depl(/*int nb, int tab[][2], int *pl1, int *pc1, int l2, int c2, int path*/);
  118. extern int ambiguity(/*int frompiece, int l2, int c2*/);
  119. extern int check_move(/*depl *m*/);
  120. extern int guess_move(/*void*/);
  121. extern int clear_pos(/*int lig, int col*/);
  122. extern int configure(/*void*/);
  123. extern int execute_move(/*void*/);
  124. extern int typechar(/*char c*/);
  125. extern int execute(/*int num, char c*/);
  126. extern int parse_number(/*char *token*/);
  127. extern int parse_keyword(/*char *token*/);
  128. extern int parse_roque(/*char *token*/);
  129. extern int parse_move(/*char *token*/);
  130. extern void init_parse(/*depl *m*/);
  131.  
  132.  
  133. /* ------ top-level interface functions -------- */
  134.  
  135. extern int parse_options(/*int argc, char *argv[]*/);
  136. extern void close_files(/*void*/);
  137. extern int associe_traduction(/*char **table, int langage*/);
  138. extern int main(/*int argc, char *argv[]*/);
  139.  
  140.  
  141. #endif
  142.