Category : C Source Code
Archive   : MSPELL1_.ZIP
Filename : USER.C

 
Output of file : USER.C contained in archive : MSPELL1_.ZIP
/* USER: User word list processing for MicroSPELL 1.0
Spell Checker and Corrector

(C)opyright May 1987 by Daniel Lawrence
All Rights Reserved
*/

#include
#include "dopt.h"
#include "dstruct.h"
#include "ddef.h"

uread(fname) /* open and read in a user dictionary */

char *fname; /* name of dictionary to open */

{
register char *sp; /* temp string pointer */
register FILE *ufp; /* user word list file handle */
char buf[NSTRING]; /* bufer to hold user word */

/* first, try to open it up..... */
ufp = fopen(fname, "r");
if (ufp == NULL) {
printf("%%Can not find user word list %s\n", fname);
return(FALSE);
}

/* if this is the first one, remember the name for later */
if (*userlist == 0)
strcpy(userlist, fname);

/* and now, dump the words into the common word list */
while (numfiltr < MAXCOM) {
if (fgets(buf, NSTRING - 1, ufp) == NULL)
break;
buf[strlen(buf)-1] = 0; /* get rid of the newline */

/* if it's a blank line, ignore it */
if (buf[0] == 0)
continue;

/* get room for it...*/
if ((sp = malloc(strlen(buf)+1)) == NULL) {
fclose(ufp);
return(FALSE);
}

/* and store it */
strcpy(sp, buf);
cword[numfiltr++] = sp;
}

/* complain if the list is full */
if (numfiltr == MAXCOM)
printf("%%User word list space filled\n");
fclose(ufp);
return(TRUE);
}


  3 Responses to “Category : C Source Code
Archive   : MSPELL1_.ZIP
Filename : USER.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/