Lingua-Jspell

 view release on metacpan or  search on metacpan

src/correct.c  view on Meta::CPAN

	    break;
	case 'Z': /* default */
	    showflags = 0;
	    break; 
	}
    }
}

/*---------------------------------------------------------------------------*/

void askmode()
{
   register char *cp1, *cp2;
   ichar_t *itok;                /* Ichar version of current word */

   if (fflag) {
      if (freopen(askfilename, "w", stdout) == NULL) {
         fprintf(stderr, CANT_CREATE, askfilename);
         exit(1);
      }
   }

   printf("%s\n", Version_ID[0]);

   while (fflush(stdout),
      xgets(contextbufs[0], sizeof contextbufs[0], stdin) != NULL) {
      /*
      ** *line is like `i', 
      ** @line is like `a', 
      ** &line is like 'u'
      ** $... init options do Ulisses
      ** $"... jj
      ** `#' is like `Q' (writes personal dictionary)
      ** `+' sets tflag, 
      ** `-' clears tflag
      ** `!' sets terse mode, 
      ** `%' clears terse
      ** `~' followed by a filename sets parameters according to file name
      ** `^' causes rest of line to be checked after stripping 1st char
      */
      if (contextbufs[0][0] == '*'  ||  contextbufs[0][0] == '@')
         treeinsert(ichartosstr(strtosichar(contextbufs[0] + 1, 0), 1),
                    ICHARTOSSTR_SIZE, contextbufs[0][0] == '*');
      else if (contextbufs[0][0] == '&') {
             itok = strtosichar(contextbufs[0] + 1, 0);
             lowcase(itok);
             treeinsert(ichartosstr(itok, 1), ICHARTOSSTR_SIZE, 1);
         }
      else if (contextbufs[0][0] == '#' && contextbufs[0][1] == '#')
              save_pers_dic();
      else if (contextbufs[0][0] == '#')   /* JJoao 2002 */
              printf("%s\n\n",contextbufs[0]);
      else if (contextbufs[0][0] == '!')
          terse = 1;
      else if (contextbufs[0][0] == '%')
          terse = 0;
      else if (contextbufs[0][0] == '+' || contextbufs[0][0] == '-') {
          math_mode = 0;
          LaTeX_Mode = 'P';
          tflag = (contextbufs[0][0] == '+');
          prefstringchar =
            findfiletype(tflag ? "tex" : "nroff", 1, (int *) NULL);
          if (prefstringchar < 0)
             prefstringchar = 0;
          defdupchar = prefstringchar;
      }
      else if (contextbufs[0][0] == '~') {
          defdupchar = findfiletype(&contextbufs[0][1], 1, &tflag);
          if (defdupchar < 0)
             defdupchar = 0;
      }
      else if (contextbufs[0][0] == '$' && contextbufs[0][1] == '"') {
          jjflags(contextbufs[0] + 2);
      }
      else if (contextbufs[0][0] == '$') {
          init_modes(contextbufs[0] + 1);
      }
      else {
         if (contextbufs[0][0] == '^') {
            /* Strip off leading uparrow */
            for (cp1 = contextbufs[0], cp2 = contextbufs[0] + 1;
                 (*cp1++ = *cp2++) != '\0'; )
              ;
         }
         checkline(stdout);
      }
   }
}



/**
 * @brief Copy/ignore "cnt" number of characters pointed to by *cc.
 * 
 */
void copyout(register char **cc, register int  cnt)
{
    while (--cnt >= 0) {
        if (**cc == '\0')
            break;
        if (!aflag && !lflag)
            putc(**cc, outfile);
        (*cc)++;
    }
}



( run in 0.619 second using v1.01-cache-2.11-cpan-0bb4e1dffa6 )