home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / Games / NeXTGo-3.0-MIS / godict.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-07-06  |  3.3 KB  |  147 lines

  1. #ifndef _GODICT_PROTOS_
  2. #define _GODICT_PROTOS_
  3.  
  4. #include "comment.header"
  5.  
  6. /* $Id: godict.h,v 1.3 1997/07/06 19:38:23 ergo Exp $ */
  7.  
  8. /*
  9.  * $Log: godict.h,v $
  10.  * Revision 1.3  1997/07/06 19:38:23  ergo
  11.  * actual version
  12.  *
  13.  * Revision 1.2  1997/05/04 18:57:20  ergo
  14.  * added time control for moves
  15.  *
  16.  */
  17.  
  18. /* #[info:        */
  19. /************************************************************************
  20.  *                                    *
  21.  *               intergo --- An online Go Dictionary            *
  22.  *                                    *
  23.  *                Jan van der Steen                *
  24.  *               Amsterdam, the Netherlands            *
  25.  *                                    *
  26.  *----------------------------------------------------------------------*
  27.  * File    : godict.h                         *
  28.  * Purpose : Define datatypes to implement a Go dictionary        *
  29.  * Version : 1.5                         *
  30.  * Modified: 1/14/93 23:43:08                        *
  31.  * Author  : Jan van der Steen (jansteen@cwi.nl)             *
  32.  ************************************************************************/
  33. /* #]info:        */ 
  34. /* #[define:        */
  35.  
  36. /*  Define the following when comiling the test program  */
  37. #define _TEST_COMPILE_
  38.  
  39. /*
  40.  * Default dictionary (full pathname to file)
  41.  */
  42. #ifndef DEFDICT
  43. #define DEFDICT    "intergo.dct"
  44. #endif
  45.  
  46. /*
  47.  * Special input characters
  48.  */
  49. #define COMMENT '#'             /* Comment indicator */
  50.  
  51. /*
  52.  * Dictionary codes
  53.  */
  54. #define    CD_MISC    0x01
  55. #define    CD_NAME    0x02
  56. #define    CD_CHAM    0x04
  57. #define    CD_TECH    0x08
  58. #define    CD_POLI    0x10
  59. #define    CD_DIGI    0x20
  60.  
  61. /*
  62.  * Dictionary languages
  63.  */
  64. #define    LANG_DG    0x0001
  65. #define    LANG_CP    0x0002
  66. #define    LANG_JP    0x0004
  67. #define    LANG_CH    0x0008
  68. #define    LANG_RK    0x0010
  69. #define    LANG_GB    0x0020
  70. #define    LANG_NL    0x0040
  71. #define    LANG_GE    0x0080
  72. #define    LANG_FR    0x0100
  73. #define LANG_SV 0x0200
  74.  
  75. /*
  76.  * Type messages
  77.  */
  78. #define MSG_MISC    "Unclassified"
  79. #define MSG_NAME       "Player name"
  80. #define MSG_CHAM       "Championship title"
  81. #define MSG_TECH       "Technical term"
  82. #define MSG_POLI       "Conversation"
  83. #define MSG_DIGI       "Number"
  84.  
  85. /*
  86.  * Language specifiers (while writing)
  87.  */
  88. #define LB_CD        "Type:  "
  89. #define LB_JP        "Japanese:  "
  90. #define LB_CH        "Chinese:  "
  91. #define LB_RK        "Korean:  "
  92. #define LB_GB        "English:  "
  93. #define LB_NL        "Dutch:  "
  94. #define LB_GE        "German:  "
  95. #define LB_FR        "French:  "
  96. #define LB_SV        "Swedish:  "
  97. #define LB_DG        "Diagram:  "
  98. #define LB_CP        "Caption:  "
  99. #define LB_EOT        "EOT"    /* end of search */
  100.  
  101. /*
  102.  * Language specifiers (while reading)
  103.  */
  104. #   define RD_CD    "CD="
  105. #   define RD_JP    "JP="
  106. #   define RD_CH    "CH="
  107. #   define RD_RK    "RK="
  108. #   define RD_GB    "GB="
  109. #   define RD_NL    "NL="
  110. #   define RD_GE    "GE="
  111. #   define RD_FR    "FR="
  112. #   define RD_SV        "SV="
  113. #   define RD_DG    "DG="
  114. #   define RD_CP    "CP="
  115.  
  116. #define MAXDICTLINE    1024
  117.  
  118. /* #]define:        */ 
  119. /* #[typedef:        */
  120.  
  121. typedef struct dict_node {
  122.     struct dict_node *    dct_next;
  123.     char *        dct_jp;        /* Japanese        */
  124.     char *        dct_gb;        /* English        */
  125.     char *        dct_ch;        /* Chinese        */
  126.     char *        dct_rk;        /* Korean        */
  127.     char *        dct_nl;        /* Dutch        */
  128.     char *        dct_ge;        /* German        */
  129.     char *        dct_fr;        /* French        */
  130.     char *              dct_sv;         /* Swedish              */
  131.     char *        dct_dg;        /* Diagram        */
  132.     char *        dct_cp;        /* Caption        */
  133.     char *        dct_spec;    /* Only for clients    */
  134.     int            dct_type;    /* See defines        */
  135. } GODICT;
  136.  
  137. /*
  138.  * Loading and Searching routines.
  139.  */
  140. extern GODICT* load_dict(char* filename);
  141. extern void store_dict(char **f, char *s);
  142. extern char* lstr(char *s);
  143. extern GODICT* search_dict(GODICT* gd, char* term);
  144.  
  145. #endif
  146.  
  147.