home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / SW Demo / Demo Source / SpellWright.h < prev    next >
Encoding:
Text File  |  1994-11-09  |  3.7 KB  |  113 lines  |  [TEXT/MPCC]

  1. // ----------------------------------------------------------------------------------
  2. // SpellWright.h
  3. // ----------------------------------------------------------------------------------
  4. // Header File for SpellWright Spelling Checker Library
  5. //
  6. // Copyright 1994 LexTek International
  7. // 2255 N. University Parkway, Suite 15
  8. // Provo, UT 84604
  9. // (801) 375.8332        (801) 377.7654 (fax)
  10.  
  11. #ifndef _SPELLWRIGHT_
  12. #define _SPELLWRIGHT_
  13.  
  14. #include <Files.h>
  15.  
  16. #ifndef FioParam
  17. #define FioParam FSSpec
  18. #endif
  19.  
  20. typedef struct {
  21.     short    Case;
  22.     short    Duplicate;
  23.     short    Replace;
  24. } WordInfo;
  25.  
  26. typedef void *SWChecker;
  27.  
  28. // ----------------------------------------------------------------------------------
  29. // Dicionary Constants
  30. // ----------------------------------------------------------------------------------
  31.  
  32.  
  33. #define AUTO_DICT          (1)
  34. #define SUGGEST_DICT       (2)
  35. #define DOCUMENT_DICT      (4)
  36. #define SKIP_DICT          (8)
  37. #define USER_DICT          (16)
  38. #define MAIN_DICT          (32)
  39.  
  40. #define IS_SPELLED_CORRECTLY     (1)
  41. #define IS_NOT_SPELLED_CORRECTLY (0)
  42.  
  43. #define UPPER_UPPER_lower (1)
  44. #define lower_UPPER_lower (2)
  45. #define lower_UPPER_UPPER (3)
  46. #define lower_lower_UPPER (4)
  47. #define lower_UPPER       (5)
  48. #define lower_case        (6)
  49. #define UPPER_CASE        (7)
  50. #define UPPER_lower          (8)
  51.  
  52. #define WORD_DUPLICATED     (1)
  53. #define WORD_NOT_DUPLICATED (0)
  54.  
  55. #define FOUND  1                // Found word in search
  56. #define NOTFOUND  0                // Didn't find word in search
  57.  
  58.  
  59. // ----------------------------------------------------------------------------------
  60. // Spell Error Codes
  61. // ----------------------------------------------------------------------------------
  62.  
  63. #define eNo_Err                    (0)
  64. #define eNo_Mem                  (-1)
  65. #define eOpening_File              (-2)
  66. #define eNot_Dictionary          (-3)
  67. #define eUser_Dict_Corrupted      (-4)
  68. #define eNot_Done                  (-5)
  69. #define eDone                      (-6)
  70. #define eGeneral                 (-7)
  71. #define eReading_File            (-8)
  72. #define eWriting_File            (-9)
  73. #define eUnusableDict            (-10)
  74. #define eNotSpeller                (-11)
  75. #define eIllegalCmd                (-12)
  76.     
  77.  
  78.  
  79. // ----------------------------------------------------------------------------------
  80. // Functions
  81. // ----------------------------------------------------------------------------------
  82.  
  83. #ifdef __cplusplus
  84. extern    "C" {
  85. #endif
  86.  
  87. extern SWChecker StartSpellCheckSession();
  88. extern void      EndSpellCheckSession(SWChecker Speller);
  89. extern short     DictOpen(SWChecker Speller, unsigned long *DictNum, short DictType, 
  90.                         long Size, FioParam *theFile);
  91. extern void      DictClose(SWChecker Speller, unsigned long DictNum);
  92. extern short    Select(SWChecker Speller, char *Word);
  93. extern short     CheckWord(SWChecker Speller, unsigned long DictNum,short DictType,
  94.                         char *Word, WordInfo *Info);
  95. extern short    FindFirstSuggestion(SWChecker Speller, unsigned long DictNum, short DictType, 
  96.                         char *Word, char *Suggestion, char *Comment, short *AutoReplace);
  97. extern short    FindNextSuggestion(SWChecker Speller, unsigned long DictNum, short DictType, 
  98.                         char *Word, char *Suggestion, char *Comment, short *AutoReplace);
  99. extern short    AddToDictionary(SWChecker Speller, unsigned long DictNum, char *Word, 
  100.                         char *Suggestion, char *Comment);
  101. extern short    FindFirstRegex(SWChecker Speller, unsigned long DictNum, short DictType, char *Word);
  102. extern short    FindNextRegex(SWChecker Speller, unsigned long DictNum, short DictType, char *Word);
  103. extern short    LocateWord(SWChecker Speller, unsigned long DictNum, short DictType, char *Word);
  104. extern short    NextWord(SWChecker Speller, unsigned long DictNum, short DictType, char *Word);
  105. extern short    CurrentWord(SWChecker Speller, unsigned long DictNum, short DictType, char *Word);
  106. extern short    GetSpellError();
  107. extern void        FixCase(SWChecker Speller, char *Word, short CaseCode);
  108.  
  109. #ifdef __cplusplus
  110.     }
  111. #endif
  112.  
  113. #endif