📄 csapi.pas
字号:
//#define sccSuggestMore 4
//#define sccHyphInfo 5
//#define sccWildcard 6
//#define sccAnagram 7
sccVerifyWord = 1;
sccVerifyBuffer = 2;
sccSuggest = 3;
sccSuggestMore = 4;
sccHyphInfo = 5;
sccWildCard = 6;
sccAnagram = 7;
///* Flag values for SpellState field in Sib. */
//#define fssIsContinued 0x0001
// /* Call is continuing from where last call returned. Must be cleared
// for first call into SpellCheck().
// */
fssIsContinued = $0001;
//#define fssStartsSentence 0x0002
// /* First word in buffer is known to be start of
// sentence/paragraph/document. This is only used if the
// fSibIsContinued bit is not set. It should not be needed if the
// fSibIsContinued bit is being used. If this bit is set during a
// suggestion request, suggestions will be capitalized.
// */
fssStartsSentence = $0002;
//#define fssIsEditedChange 0x0004
// /* The run of text represented in the SIB is a change from either
// a change pair (change always or change once) edit, or from a
// user specified change, possibly from a suggestion list presented
// to the user. This text should be checked for repeat word
// problems, and possibly sentence status, but should not be subject
// to subsequent spell verification or change pair substitutions.
// Note that if an app is not using the fSibIsContinued support,
// they do not need to pass in these edited changes, thus bypassing
// the potential problem, and working faster.
// */
fssIsEditedChange = $0004;
//#define fssNoStateInfo 0x0000
// /* App is responsible for checking for all repeat word and sentence
// punctuation, and avoiding processing loops such as change always
// can=can can.
// */
///* End of Sib Spell State flag definitions. */
fssNoStateInfo = $0000;
///* Spell Check return status identifiers */
//#define scrsNoErrors 0 /* All buffer processed. */
//#define scrsUnknownInputWord 1 /* Unknown word. */
//#define scrsReturningChangeAlways 2 /* Returning a Change Always word in SRB. */
//#define scrsReturningChangeOnce 3 /* Returning a Change Once word in SRB. */
//#define scrsInvalidHyphenation 4 /* Error in hyphenation point.*/
//#define scrsErrorCapitalization 5 /* Cap pattern not valid. */
//#define scrsWordConsideredAbbreviation 6 /* Word is considered an abbreviation. */
//#define scrsHyphChangesSpelling 7 /* Word changes spelling when not hyphenated. */
//#define scrsNoMoreSuggestions 8 /* All methods used. */
//#define scrsMoreInfoThanBufferCouldHold 9 /* More return data than fit in buffer */
//#define scrsNoSentenceStartCap 10 /* Start of sentence was not capitalized. */
//#define scrsRepeatWord 11 /* Repeat word found. */
//#define scrsExtraSpaces 12 /* Too many spaces for context.*/
//#define scrsMissingSpace 13 /* Too few space(s) between words or sentences. */
//#define scrsInitialNumeral 14 /* Word starts with numeral & soFlagInitialNumeral set */
scrsNoErrors = 0;
scrsUnknownInputWord = 1;
scrsReturningChangeAlways = 2;
scrsReturningChangeOnce = 3;
scrsInvalidHyphenation = 4;
scrsErrorCapitalization = 5;
scrsWordConsideredAbbreviation = 6;
scrsHyphChangesSpelling = 7;
scrsNoMoreSuggestions = 8;
scrsMoreInfoThanBufferCouldHold = 9;
scrsNoSentenceStartCap =10;
scrsRepeatWord =11;
scrsExtraSpaces =12;
scrsMissingSpace =13;
scrsInitialNumeral =14;
///* Spell Error Codes */
//#define secNOERRORS 0
secNoErrors = 0;
///* Major Error Codes. Low Byte of SEC*/
//#define secOOM 1
//#define secModuleError 2 /* Something wrong with parameters, or state of spell module. */
//#define secIOErrorMdr 3 /* Read,write,or share error with Mdr. */
//#define secIOErrorUdr 4 /* Read,write,or share error with Udr. */
secOOM = 1;
secModuleError = 2;
secIOErrorMdr = 3;
secIOErrorUdr = 4;
///* Minor Error Codes. Not set unless major code also set. */
///* High Byte of SEC word var. */
//#define secModuleAlreadyBusy (128<<8) /* For non-reentrant code */
//#define secInvalidID (129<<8) /* Not yet inited or already terminated.*/
//#define secInvalidWsc (130<<8) /* Illegal values in WSC struct */
//#define secInvalidMdr (131<<8) /* Mdr not registered with spell session */
//#define secInvalidUdr (132<<8) /* Udr not registered with spell session */
//#define secInvalidSCC (133<<8) /* SCC unknown (spellcheck() only ) */
//#define secInvalidMainDict (134<<8) /* Specified dictionary not correct format */
//#define secOperNotMatchedUserDict (135<<8) /* Illegal operation for user dictionary type. */
//#define secFileReadError (136<<8) /* Generic read error */
//#define secFileWriteError (137<<8) /* Generic write error */
//#define secFileCreateError (138<<8) /* Generic create error */
//#define secFileShareError (139<<8) /* Generic share error */
//#define secModuleNotTerminated (140<<8) /* Module not able to be terminated completely.*/
//#define secUserDictFull (141<<8) /* Could not update Udr without exceeding limit.*/
//#define secInvalidUdrEntry (142<<8) /* invalid chars in string(s) */
//#define secUdrEntryTooLong (143<<8) /* Entry too long, or invalid chars in string(s) */
//#define secMdrCountExceeded (144<<8) /* Too many Mdr references */
//#define secUdrCountExceeded (145<<8) /* Too many udr references */
//#define secFileOpenError (146<<8) /* Generic Open error */
//#define secFileTooLargeError (147<<8) /* Generic file too large error */
//#define secUdrReadOnly (148<<8) /* Attempt to add to or write RO udr */
secModuleAlreadyBusy =(128 shl 8);
secInvalidID =(129 shl 8);
secInvalidWsc =(130 shl 8);
secInvalidMdr =(131 shl 8);
secInvalidUdr =(132 shl 8);
secInvalidSCC =(133 shl 8);
secInvalidMainDict =(134 shl 8);
secOperNotMatchedUserDict=(135 shl 8);
secFileReadError =(136 shl 8);
secFileWriteError =(137 shl 8);
secFileCreateError =(138 shl 8);
secFileShareError =(139 shl 8);
secModuleNotTerminated =(140 shl 8);
secUserDictFull =(141 shl 8);
secInvalidUdrEntry =(142 shl 8);
secUdrEntryTooLong =(143 shl 8);
secMdrCountExceeded =(144 shl 8);
secUdrCountExceeded =(145 shl 8);
secFileOpenError =(146 shl 8);
secFileTooLargeError =(147 shl 8);
secUdrReadOnly =(148 shl 8);
///* Spell Options bitfield definitions */
//#define soSuggestFromUserDict 0x0001 /* Scan Udr's as well as Mdr(s) */
//#define soIgnoreAllCaps 0x0002 /* Ignore a word if all upppercase.*/
//#define soIgnoreMixedDigits 0x0004 /* Ignore word if has any numbers in it.*/
//#define soIgnoreRomanNumerals 0x0008 /* Ignore word composed of all roman numerals.*/
//#define soFindUncappedSentences 0x0010 /* Flag sentences which don't start with a cap.*/
//#define soFindMissingSpaces 0x0020 /* Find missing spaces between words/sentences. */
//#define soFindRepeatWord 0x0040 /* CSAPI to flag repeated words. */
//#define soFindExtraSpaces 0x0080 /* CSAPI to flag extra spaces between words.*/
//#define soFindSpacesBeforePunc 0x0100 /* CSAPI to flag space preceeding certain
// punc. ex. (the ) is flagged.
// the following chars are flagged.
// ) ] } > , ; % . ? !
// */
//#define soFindSpacesAfterPunc 0x0200 /* CSAPI to flag space after certain
// punc. ex. ( the) is flagged. The
// following chars are flagged.
// ( [ { $
// */
//#define soRateSuggestions 0x0400
// /* All suggestions returned should be given some scaled value
// corresponding to liklihood of being correct alternative.
// Scale is 1..255, 255 most likely correction and 1 least likely
// */
//#define soFindInitialNumerals 0x0800 /* Flag words starting with number(s) */
//#define soReportUDHits 0x1000 /* Report (via scrsNoErrorsUDHit) where
// * user dict was used during verification
// */
//#define soQuickSuggest 0x2000 /* Don't use typo suggest code (Soft-Art only) */
//#define soUseAllOpenUdr 0x4000 /* Automatically use all udr's opened
// * after this option is set, or all opened udr's
// * with mdr's opened after this option is set.
// * This option does not allow exclusion dicts to
// * be edited.
// * (HM only)
// */
//#define soSwapMdr 0x8000 /* Keep the most recent 2 mdr's around.
// * swap between them instead of actually closing
// * and reopening mdr's.
// * (HM only)
// */
//#define soSglStepSugg 0x10000 /* Break after each suggestion task for faster
// * return of control to the application.
// * (HM only)
// */
//
//#define soLangMode 0xF0000000L /* Language Mode mask */
///* Hebrew Language Modes -- (CT only) */
//#define soHebrewFullScript 0x00000000L
//#define soHebrewPartialScript 0x10000000L
//#define soHebrewMixedScript 0x20000000L
//#define soHebrewMixedAuthorizedScript 0x30000000L
///* French Language Modes -- (HM only) */
//#define soFrenchDialectDefault 0x00000000L
//#define soFrenchUnaccentedUppercase 0x10000000L
//#define soFrenchAccentedUppercase 0x20000000L
///* Russian Language Modes -- (HM only) */
//#define soRussianDialectDefault 0x00000000L
//#define soRussianIE 0x10000000L
//#define soRussianIO 0x20000000L
soSuggestFromUserDict = $0001;
soIgnoreAllCaps = $0002;
soIgnoreMixedDigits = $0004;
soIgnoreRomanNumerals = $0008;
soFindUncappedSentences= $0010;
soFindMissingSpaces = $0020;
soFindRepeatWord = $0040;
soFindExtraSpaces = $0080;
soFindSpacesBeforePunc = $0100;
soFindSpacesAfterPunc = $0200;
soRateSuggestions = $0400;
soFindInitialNumerals = $0800;
soReportUDHits = $1000;
soQuickSuggest = $2000;
soUseAllOpenUdr = $4000;
soSwapMdr = $8000;
soSglStepSugg = $10000;
soLangMode = $F0000000;
soHebrewFullScript = $00000000;
soHebrewPartialScript = $10000000;
soHebrewMixedScript = $20000000;
soHebrewMixedAuthorizedScript = $30000000;
soFrenchDialectDefault = $00000000;
soFrenchUnaccentedUppercase = $10000000;
soFrenchAccentedUppercase = $20000000;
soRussianDialectDefault = $00000000;
soRussianIE = $10000000;
soRussianIO = $20000000;
//#ifdef DEBUG
//
//#define sdcDumpRCAll 200
//#define sdcDumpRCIgnore 201
//#define sdcDumpRCOnce 202
//#define sdcDumpRCAlways 203
//
//#define sdcDumpUdrAll 300
//#define sdcDumpUdr1 301
//#define sdcDumpUdr2 302
//#define sdcDumpUdr3 303
//#define sdcDumpUdr4 304
//
//#define sdcDumpMdrAll 400
//#define sdcDumpMdr1 401
//#endif /* DEBUG */
sdcDumpRCAll = 200;
sdcDumpRCIgnore= 201;
sdcDumpRCOnce = 202;
sdcDumpRCAlways= 203;
sdcDumpUdrAll = 300;
sdcDumpUdr1 = 301;
sdcDumpUdr2 = 302;
sdcDumpUdr3 = 303;
sdcDumpUdr4 = 304;
sdcDumpMdrAll = 400;
sdcDumpMdr1 = 401;
//#ifndef PASCAL
//#define PASCAL pascal
//#endif
type
//#define GLOBAL FAR PASCAL
//#define GLOBALSEC SEC FAR PASCAL
//#ifdef MAC
///******************* Exported function prototypes **********************/
//extern GLOBALSEC SpellVer( WORD FAR *lpwVer,
// WORD FAR *lpwIdEngine,
// WORD FAR *lpwSpellType);
TSpellVerFunc = function (var Ver, IdEngine, SpellType: Word): TSEC; cdecl;
//extern GLOBALSEC SpellInit( SPLID FAR *lpSid,
// WSC FAR *lpWsc);
TSpellInitFunc = function (var Sid: TSPLID; var Wsc: TWSC): TSEC; cdecl;
//extern GLOBALSEC SpellOptions( SPLID splid,
// long lSpellOptions);
TSpellOptionsFunc = function (splid: TSPLID; SpellOptions: Integer): TSEC; cdecl;
//extern GLOBALSEC SpellCheck( SPLID splid,
// SCCC iScc,
// LPSIB lpSib,
// LPSRB lpSrb);
TSpellCheckFunc = function (splid: TSPLID; Scc: TSCCC; var Sib: TSIB;
var Srb: TSRB): TSEC; cdecl;
//extern GLOBALSEC SpellTerminate( SPLID splid,
// BOOL fForce);
TSpellTerminateFunc = function(splid: TSPLID; Force: Boolean): TSEC; cdecl;
//extern GLOBALSEC SpellVerifyMdr( LPSPATH lpspathMdr,
// LID lidExpected,
// LID FAR *lpLid);
TSpellVerifyMdrFunc = function(PathMdr: PChar; LidExpected: TLID; var Lid: TLID): TSEC; cdecl;
//extern GLOBALSEC SpellOpenMdr( SPLID splid,
// LPSPATH lpspathMain,
// LPSPATH lpspathExc,
// BOOL fCreateUdrExc,
// BOOL fCache,
// LID lidExpected,
// LPMDRS lpMdrs);
TSpellOpenMdrFunc = function(splid: TSPLID; PathMain, PathExc: PChar; CreateUdrExc,
Cache: Boolean; lidExpected: TLID; var Mdrs: TMDRS): TSEC; cdecl;
//extern GLOBALSEC SpellOpenUdr( SPLID splid,
// LPSPATH lpspathUdr,
// BOOL fCreateUdr,
// WORD udrpropType,
// UDR FAR *lpUdr,
// BOOL FAR *lpfReadonly);
TSpellOpenUdrFunc = function(splid: TSPLID; PathUdr: PChar; CreateUdr: Boolean;
udrPropType: Word; var Udr: TUDR; var ReadOnly: Boolean): TSEC; cdecl;
//extern GLOBALSEC SpellAddUdr( SPLID splid,
// UDR udr,
// CHAR FAR *lpszAdd);
TSpellAddUdrFunc = function(splid: TSPLID; udr: TUDR; Add: PChar): TSEC; cdecl;
//extern GLOBALSEC SpellAddChangeUdr(SPLID splid,
// UDR udr,
// CHAR FAR *lpszAdd,
// CHAR FAR *lpszChange);
TSpellAddChangeUdrFunc = function(splid: TSPLID; udr: TUDR; Add, Change: PChar): TSEC; cdecl;
//extern GLOBALSEC SpellDelUdr( SPLID splid,
// UDR udr,
// CHAR FAR *lpszDel);
TSpellDelUdrFunc = function(splid: TSPLID; udr: TUDR; Del: PChar): TSEC; cdecl;
//extern GLOBALSEC SpellClearUdr( SPLID splid,
// UDR udr);
TSpellClearUdrFunc = function(splid: TSPLID; udr: TUDR): TSEC; cdecl;
//extern GLOBALSEC SpellGetSizeUdr( SPLID splid,
// UDR udr,
// WORD FAR *lpcWords);
TSpellGetSizeUdrFunc = function(splid: TSPLID; udr: TUDR; var Words): TSEC; cdecl;
//extern GLOBALSEC SpellGetListUdr( SPLID splid,
// UDR udr,
// WORD iszStart,
// LPSRB lpSrb);
TSpellGetListUdrFunc = function(splid: TSPLID; udr: TUDR; Start: Word; var Srb: TSRB): TSEC; cdecl;
//extern GLOBALSEC SpellCloseMdr( SPLID splid,
// LPMDRS lpMdrs);
TSpellCloseMdrFunc = function(splif: TSPLID; var Mdrs: TMDRS): TSEC; cdecl;
//extern GLOBALSEC SpellCloseUdr( SPLID splid,
// UDR udr,
// BOOL fForce);
TSpellCloseUdrFunc = function(splid: TSPLID; udr: TUDR; Force: Boolean): TSEC; cdecl;
//extern Handle HCsapiResInit(char *stzFileName, short vRef, long dirId);
THCsapiResInit = function(FileName: PChar; vRef: SmallInt; dirId: Integer): THandle; cdecl;
//extern void CsapiResTerm(void);
TCsapiResTermProc = procedure; cdecl;
//extern void CsapiResFlush(void);
TCsapiResFlushProc = procedure; cdecl;
implementation
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -