home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / wp_dtp / ispell.lha / ispell.h < prev    next >
C/C++ Source or Header  |  1991-01-05  |  9KB  |  305 lines

  1. struct dent {
  2.     struct dent *next;
  3.     char *word;
  4.  
  5.     unsigned int used : 1;
  6.  
  7. /* bit fields for all of the flags */
  8.     unsigned int v_flag : 1;
  9.         /*
  10.             "V" flag:
  11.                 ...E --> ...IVE  as in CREATE --> CREATIVE
  12.                 if # .ne. E, ...# --> ...#IVE  as in PREVENT --> PREVENTIVE
  13.         */
  14.     unsigned int n_flag : 1;
  15.         /*
  16.             "N" flag:
  17.                     ...E --> ...ION  as in CREATE --> CREATION
  18.                     ...Y --> ...ICATION  as in MULTIPLY --> MULTIPLICATION
  19.                     if # .ne. E or Y, ...# --> ...#EN  as in FALL --> FALLEN
  20.         */
  21.     unsigned int x_flag : 1;
  22.         /*
  23.             "X" flag:
  24.                     ...E --> ...IONS  as in CREATE --> CREATIONS
  25.                     ...Y --> ...ICATIONS  as in MULTIPLY --> MULTIPLICATIONS
  26.                     if # .ne. E or Y, ...# --> ...#ENS  as in WEAK --> WEAKENS
  27.         */
  28.     unsigned int h_flag : 1;
  29.         /*
  30.             "H" flag:
  31.                     ...Y --> ...IETH  as in TWENTY --> TWENTIETH
  32.                     if # .ne. Y, ...# --> ...#TH  as in HUNDRED --> HUNDREDTH
  33.         */
  34.     unsigned int y_flag : 1;
  35.         /*
  36.             "Y" FLAG:
  37.                     ... --> ...LY  as in QUICK --> QUICKLY
  38.         */
  39.     unsigned int g_flag : 1;
  40.         /*
  41.             "G" FLAG:
  42.                     ...E --> ...ING  as in FILE --> FILING
  43.                     if # .ne. E, ...# --> ...#ING  as in CROSS --> CROSSING
  44.         */
  45.     unsigned int j_flag : 1;
  46.         /*
  47.             "J" FLAG"
  48.                     ...E --> ...INGS  as in FILE --> FILINGS
  49.                     if # .ne. E, ...# --> ...#INGS  as in CROSS --> CROSSINGS
  50.         */
  51.     unsigned int d_flag : 1;
  52.         /*
  53.             "D" FLAG:
  54.                     ...E --> ...ED  as in CREATE --> CREATED
  55.                     if @ .ne. A, E, I, O, or U,
  56.                             ...@Y --> ...@IED  as in IMPLY --> IMPLIED
  57.                     if # .ne. E or Y, or (# = Y and @ = A, E, I, O, or U)
  58.                             ...@# --> ...@#ED  as in CROSS --> CROSSED
  59.                                             or CONVEY --> CONVEYED
  60.         */
  61.     unsigned int t_flag : 1;
  62.         /*
  63.             "T" FLAG:
  64.                     ...E --> ...EST  as in LATE --> LATEST
  65.                     if @ .ne. A, E, I, O, or U,
  66.                             ...@Y --> ...@IEST  as in DIRTY --> DIRTIEST
  67.                     if # .ne. E or Y, or (# = Y and @ = A, E, I, O, or U)
  68.                             ...@# --> ...@#EST  as in SMALL --> SMALLEST
  69.                                             or GRAY --> GRAYEST
  70.         */
  71.     unsigned int r_flag : 1;
  72.         /*
  73.             "R" FLAG:
  74.                     ...E --> ...ER  as in SKATE --> SKATER
  75.                     if @ .ne. A, E, I, O, or U,
  76.                             ...@Y --> ...@IER  as in MULTIPLY --> MULTIPLIER
  77.                     if # .ne. E or Y, or (# = Y and @ = A, E, I, O, or U)
  78.                             ...@# --> ...@#ER  as in BUILD --> BUILDER
  79.                                             or CONVEY --> CONVEYER
  80.         */
  81.     unsigned int z_flag : 1;
  82.         /*
  83.             "Z FLAG:
  84.                     ...E --> ...ERS  as in SKATE --> SKATERS
  85.                     if @ .ne. A, E, I, O, or U,
  86.                             ...@Y --> ...@IERS  as in MULTIPLY --> MULTIPLIERS
  87.                     if # .ne. E or Y, or (# = Y and @ = A, E, I, O, or U)
  88.                             ...@# --> ...@#ERS  as in BUILD --> BUILDERS
  89.                                             or SLAY --> SLAYERS
  90.         */
  91.     unsigned int s_flag : 1;
  92.         /*
  93.             "S" FLAG:
  94.                     if @ .ne. A, E, I, O, or U,
  95.                             ...@Y --> ...@IES  as in IMPLY --> IMPLIES
  96.                     if # .eq. S, X, Z, or H,
  97.                             ...# --> ...#ES  as in FIX --> FIXES
  98.                     if # .ne. S,X,Z,H, or Y, or (# = Y and @ = A, E, I, O, or U)
  99.                             ...# --> ...#S  as in BAT --> BATS
  100.                                             or CONVEY --> CONVEYS
  101.         */
  102.     unsigned int p_flag : 1;
  103.         /*
  104.             "P" FLAG:
  105.                     if @ .ne. A, E, I, O, or U,
  106.                             ...@Y --> ...@INESS  as in CLOUDY --> CLOUDINESS
  107.                     if # .ne. Y, or @ = A, E, I, O, or U,
  108.                             ...@# --> ...@#NESS  as in LATE --> LATENESS
  109.                                             or GRAY --> GRAYNESS
  110.         */
  111.     unsigned int m_flag : 1;
  112.         /*
  113.             "M" FLAG:
  114.                     ... --> ...'S  as in DOG --> DOG'S
  115.         */
  116.  
  117.     unsigned int keep : 1;
  118.  
  119. #ifdef CAPITALIZE
  120.     /*
  121.     ** if followcase is set, the actual word entry (dent->word)
  122.     ** is followed by one or more further strings giving exact
  123.     ** capitalizations.   The first byte after the uppercase word
  124.     ** gives the number of capitalizations.  Each capitalization
  125.     ** is preceded by the character "+" if it is to be kept, or
  126.     ** "-" if it is to be discarded from the personal dictionary.
  127.     ** For example, the entry "ITCORP\0\3+ITcorp\0+ITCorp\0+ItCorp\0"
  128.     ** gives various ways of writing my e-mail address.  If all-lowercase
  129.     ** is acceptable, an all-lower entry must appear.  Simple
  130.     ** capitalization, on the other hand, is signified by the "capitalize"
  131.     ** flag.
  132.     **
  133.     ** Suffixes always match the case of the final character of a word.
  134.     **
  135.     ** If "allcaps" is set, the other two flags must be clear.
  136.     */
  137.     unsigned int allcaps : 1;    /* Word must be all capitals */
  138.     unsigned int capitalize : 1;    /* Capitalize the word */
  139.     unsigned int followcase : 1;    /* Follow capitalization exactly */
  140.     /*
  141.     ** The following entries denote the flag values that are actually
  142.     ** to be kept for this dictionary entry.  They may differ if the
  143.     ** "a" command is used for a word that differs only in capitalization.
  144.     */
  145.     unsigned int k_allcaps : 1;
  146.     unsigned int k_capitalize : 1;
  147.     unsigned int k_followcase : 1;
  148. #endif
  149.  
  150. };
  151.  
  152. #define WORDLEN 30
  153.  
  154. struct hashheader {
  155.     int magic;
  156.     int stringsize;
  157.     int tblsize;
  158. };
  159.  
  160. /* hash table magic number */
  161. #define MAGIC 2
  162.  
  163.  
  164. extern int aflag;
  165. extern int lflag;
  166.  
  167. extern int li, co;    /* lines, columns */
  168.  
  169. extern char rootword[BUFSIZ];
  170. extern struct dent *lastdent;
  171.  
  172. extern char *hashstrings;
  173. extern struct hashheader hashheader;
  174.  
  175. extern char tempfile[200];
  176.  
  177. /* In ispell.c */
  178. void servermode (void);
  179. void disp (struct RexxMsg *msg, struct rexxCommandList *dat, char *p);
  180. void rexxadd (struct RexxMsg *msg, char *p);
  181. void rexxquickadd (struct RexxMsg *msg, char *p);
  182. void rexxcheck (struct RexxMsg *msg, char *p);
  183. void rexxquickcheck (struct RexxMsg *msg, char *p);
  184. void rexxlookup (struct RexxMsg *msg, char *p);
  185. void rexxfilecheck (struct RexxMsg *msg, char *p);
  186. void rexxversion (struct RexxMsg *msg, char *p);
  187. void rexxexit (struct RexxMsg *msg, char *p);
  188.  
  189. void givehelp (void);
  190. void usage (void);
  191. void initckch (void);
  192. void main (int argc, char **argv);
  193. void dofile (char *filename);
  194. void checkfile (void);
  195. void correct (char *token, char **currentchar);
  196. void show_line (char *line, char *invstart, int invlen);
  197. int show_char (int ch, int linew);
  198. int line_size (char *buf, char *bufend);
  199. void inserttoken (char *buf, char *start, char *token, char **currentchar);
  200. int casecmp (char *a, char *b);
  201. void makepossibilities (char *word);
  202. int insert (char *word);
  203. int wrongcapital (char *word);
  204. void wrongletter (char *word);
  205. void extraletter (char *word);
  206. void missingletter (char *word);
  207. void transposedletter (char *word);
  208. int ins_cap (char *word, char *pattern);
  209. char *getline (char *s);
  210. void askmode (void);
  211. void copyout (char **cc, int cnt);
  212. void lookharder (char *string);
  213. void regex_dict_lookup (char *cmd, char *grepstr);
  214.  
  215. /* In amiga.c */
  216. void setcolors (char *style, char *fg, char *bg);
  217. void printcon (char *fmt,...);
  218. void putccon (char ch);
  219. int getccon (void);
  220. long rawmode (int flag);
  221. LONG sendpkt (struct MsgPort *pid, LONG action, LONG args[], LONG nargs);
  222. void terminit (void);
  223. void done (void);
  224. void erase (void);
  225. void move (int row, int col);
  226. void inverse (void);
  227. void normal (void);
  228. void backup (void);
  229. void onstop (int signo);
  230. void stop (void);
  231. void sleep (int n);
  232.  
  233. /* In good.c */
  234. int good (char *w);
  235. int cap_ok (char *word, struct dent * dent);
  236. void flagpr (char *w, int flag, char *modpoint);
  237. void g_ending (char *w, int n);
  238. void d_ending (char *w, int n);
  239. void t_ending (char *w, int n);
  240. void r_ending (char *w, int n);
  241. void h_ending (char *w, int n);
  242. void s_ending (char *w, int n);
  243. void n_ending (char *w, int n);
  244. void e_ending (char *w, int n);
  245. void y_ending (char *w, int n);
  246. int vowel (int c);
  247.  
  248. /* In hash.c */
  249. unsigned int hash (char *s, int n, int hashsize);
  250.  
  251. /* In local.c */
  252. void lldump (void);
  253. void llinsert (char *s);
  254.  
  255. /* In lookup.c */
  256. int linit (void);
  257. struct dent *lookup (char *s, int n, int dotree);
  258. char *do_regex_lookup (char *regex, int whence);
  259.  
  260. /* In minrexx.c */
  261. long upRexxPort (char *s, struct rexxCommandList *rcl, char *exten, void(*uf)(struct RexxMsg *, struct rexxCommandList *, char *));
  262. void closeRexxLib (void);
  263. void dnRexxPort (void);
  264. void dispRexxPort (void);
  265. int cmdcmp (char *c, char *m);
  266. int openRexxLib (void);
  267. struct RexxMsg *sendRexxCmd (char *s, void (*f)(struct RexxMsg *msg), STRPTR p1, STRPTR p2, STRPTR p3);
  268. struct RexxMsg *asyncRexxCmd (char *s);
  269. void replytoit (struct RexxMsg *msg);
  270. struct RexxMsg *syncRexxCmd (char *s, struct RexxMsg *msg);
  271. void replyRexxCmd (struct RexxMsg *msg, long primary, long secondary, char *string);
  272.  
  273. /* In regex.c */
  274. void re_fail (char *s, char c);
  275. void chset (char c);
  276. char *re_comp (char *pat);
  277. char *pmatch (char *lp, char *ap);
  278. int re_exec (char *lp);
  279. void re_modw (char *s);
  280. int re_subs (char *src, char *dst);
  281. int dfadump (char *ap);
  282.  
  283. /* In tree.c */
  284. void treeinit (char *p);
  285. struct dent *treeinsert (char *word, int keep);
  286. struct dent *tinsert (char *word, struct dent *proto, int keep);
  287. struct dent *treelookup (char *word);
  288. int pdictcmp (struct dent **enta, struct dent **entb);
  289. void treeoutput (void);
  290. void toutent (struct dent *cent);
  291. void toutword (char *word, struct dent *cent);
  292. void flagout (int flag);
  293. char *upcase (char *s);
  294. char *lowcase (char *s);
  295.  
  296. /* In xgets.c */
  297. char *xgets (char *str);
  298.  
  299. /* In buildhash.c */
  300. void output (void);
  301. void filltable (void);
  302. void readdict (void);
  303. int makedent (char *lbuf, struct dent *d);
  304. void newcount (void);
  305.