antoine-source/appleworksgs/Spell/Inc/SCDEF.H
2023-03-04 03:45:20 +01:00

1 line
4.1 KiB
C
Executable File

/***********************************************************************\
Product Number: SC-02-5.7
Version: rev5.7
Product Name: Spelling Components basic code
Filename: scdef.h
This document contains private and confidential information and
its disclosure does not constitute publication. Some of the
information herein also may appear in United States and or
Foreign Patents Pending. All rights are reserved by Proximity
Technology Inc., except those specifically granted by license.
\***********************************************************************/
#ifndef SC_SCDEF
#define SC_SCDEF
/* Things that may be static are marked STATIC instead. This allows makeing
everything global, for compilers that cannot handle static correctly, or
for debuggers that ignore static definitions. */
#ifndef STATIC
#define STATIC static
#endif
/* Word type flags, computed by doflags. Zero is not a valid flag value, it
is a special code for word not found. */
#define IW_COMMON 0x1 /* "misspell" */
#define IW_PROPER 0x2 /* "Florida" */
#define IW_ACRONYM 0x3 /* "USA" */
#define IW_CASE 0x3 /* mask for all case flags */
#define IW_NODOTS 0x0 /* "misspell" */
#define IW_ENDDOT 0x4 /* "etc." */
#define IW_ALLDOT 0x8 /* "i.e." "e.g." */
#define IW_DOTS 0xC /* mask for all dots flags */
#define IW_SPECIAL 0x10 /* "MHz" "Ph.D." "PF474" */
/* Location codes for isword. */
#define IW_NOTFOUND 0x0000 /* not found (note: same as IW_BAD) */
#define IW_CACHE 0x0100 /* found in cache */
#define IW_CORELEX 0x0200 /* found in corelex */
#define IW_LEX 0x0400 /* found in main lexicon */
#define IW_CLAM 0x0800 /* found in custom lexicon */
#define IW_ACCEPT 0x1000 /* word is translation of a word */
#define IW_CONSTR 0x2000 /* word is constructed, probably correct */
#define IW_COMBIN 0x4000 /* word is made up of valid words, but
combination may be incorrect */
/* common string sizes */
#define MAXWORD 32 /* maximum input length, includes null. */
/* for German this must not exceed the size */
/* of a long */
#define LONGWORD (2*MAXWORD) /* max length ofter doflags */
#define MAXPHWORD (5*MAXWORD) /* max length of encoded word */
#define MAXFLAGS 11 /* total number of different flags */
/* These codes are for hyphenation characters passed to/from SC. */
#define E_HYNORM 0x04 /* ordinary hyphenation point symbol */
#define E_HYPREF 0x05 /* preferred hyphenation point symbol */
#define E_HYUNPREF 0x06 /* unpreferred hyphenation point symbol */
/* Searchpath control flags */
#define SP_CORRECT 0x1 /* Word list can be used for correction */
#define SP_DETECT 0x2 /* Word list can be used for detection */
#define SP_HYPHEN 0x4 /* Use this word list for hyphen verify */
#define SP_STOP 0x8 /* Stop if word in list but flags mismatch */
#define SP_MASK 0xF /* Mask for the Searchpath flags */
/* Codes for where an error occurs. */
#define ERR_CACHE (1 << 8)
#define ERR_CORELEX (2 << 8)
#define ERR_LEX (3 << 8)
#define ERR_CLAM (4 << 8)
#define ERR_CORRECT (5 << 8)
#define ERR_HYPHEN (6 << 8)
#define ERR_ISWORD (7 << 8)
#define ERR_THES (8 << 8)
/* Codes for the error type. */
#define ERR_ENV 0 /* environment mismatch */
#define ERR_ALLOC 1 /* core memory allocation failure */
#define ERR_ACCESS 2 /* file access error (e.g., fopen failure) */
#define ERR_IO 3 /* read/write failure (CLAM or lexicon) */
#define ERR_WLEN 4 /* bad input word length */
#define ERR_PATH 5 /* search path error (full, or bad args) */
#define ERR_COMPAT 6 /* incompatible file format (clam or lex) */
#define ERR_FULL 7 /* cache is full */
/* Error return variable. The high byte indicates where the error occured;
the low byte, the kind of error. */
extern int Scerror;
#endif