Lingua-Jspell

 view release on metacpan or  search on metacpan

src/correct.c  view on Meta::CPAN

      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] == '$') {

src/jspell.c  view on Meta::CPAN


    for (argno = 0; argno < argc; argno++) {
	if (access(argv[argno], R_OK) >= 0) break;
    }
    if (argno >= argc  &&  !lflag  &&  !aflag  &&  !eflag  &&  !dumpflag) {
	fprintf(stderr, argc == 1 ? ISPELL_C_NO_FILE : ISPELL_C_NO_FILES);
	exit(1);
    }
}

static void det_prefstringchar(char *preftype)
{
    if (preftype != NULL) {
	prefstringchar = findfiletype(preftype, 1, &deftflag);
	if (prefstringchar < 0              &&  
            strcmp(preftype, "tex") != 0    && 
            strcmp(preftype, "nroff") != 0)
        {
	    fprintf(stderr, ISPELL_C_BAD_TYPE, preftype);
	    exit(1);
	}
    }
}

static void process_LibDict(char *LibDict, char *cpd)

src/jspell.c  view on Meta::CPAN

    }

    if (!argc  &&  !lflag  &&  !aflag   &&  !eflag  &&  !dumpflag)
		usage(Cmd);

    verify_files(argc, argv);

    if (!oflag) strcpy(o_form, DEF_OUT);
	if (linit() < 0) exit(1); /* Force an error */

    det_prefstringchar(preftype);

    if (prefstringchar < 0)
		defdupchar = 0;
    else
		defdupchar = prefstringchar;

    if (missingspaceflag < 0)
		missingspaceflag = hashheader.defspaceflag;
    if (tryhardflag < 0)
		tryhardflag = hashheader.defhardflag;

    initckch(wchars);

    process_LibDict(LibDict, cpd);

src/jspell.c  view on Meta::CPAN

    char *cp;

    /* See if the file is a .tex file.  If so, set the appropriate flags. */
    tflag = deftflag;
    if ((cp = rindex(filename, '.')) != NULL  &&  strcmp(cp, ".tex") == 0)
        tflag = 1;
}

static void det_defdupchar(char *filename)
{
    if (prefstringchar < 0) {
        defdupchar = findfiletype(filename, 0, &tflag);
        if (defdupchar < 0) defdupchar = 0;
    }
}

static void det_readonly_access(char *filename)
{
    readonly = access(filename, W_OK) < 0;
    if (readonly) {
        fprintf(stderr, ISPELL_C_CANT_WRITE, filename);

src/jspell.h  view on Meta::CPAN

INIT (int fflag, 0);                    /* NZ if -f specified */
INIT (int vflag, 0);                    /* NZ to display characters as M-xxx */
INIT (int Jflag, 0);                    /* NZ no Gclass by defaut */
INIT (int xflag, DEFNOBACKUPFLAG);      /* NZ to suppress backups */
INIT (int deftflag, DEFTEXFLAG);        /* NZ for TeX mode by default */
INIT (int tflag, DEFTEXFLAG);           /* NZ for TeX mode in current file */
INIT (int oflag, 0);                    /* NZ if -o specified */  /*CHANGE NEW */
INIT (int gflag, 0);                    /* display "good" options only */  /*CHANGE NEW */
INIT (int yflag, 0);                    /* suppress typing erros */  /*CHANGE NEW */
INIT (char signal_is_word, 1);          /* tells if jspell should consider a punctuation sign as a word */
INIT (int prefstringchar, -1);          /* Preferred string character type */

INIT (int terse, 0);                    /* NZ for "terse3" mode */

INIT (char tempfile[MAXPATHLEN], "");   /* Name of file we're spelling into */

INIT (int minword, MINWORD);            /* Longest always-legal word */
INIT (int sortit, 1);                   /* Sort suggestions alphabetically */
INIT (int missingspaceflag, -1);        /* Don't report missing spaces */
INIT (int tryhardflag, -1);             /* Always call tryveryhard */



( run in 2.063 seconds using v1.01-cache-2.11-cpan-0bb4e1dffa6 )