Lines Matching refs:decode
368 fp->decode.ignorecase = 1;
381 sfsprintf(fp->decode.path, sizeof(fp->decode.path), "%s/%s", path, findnames[k]);
382 if (fp->fp = sfopen(NiL, fp->decode.path, "r"))
384 path = fp->decode.path;
395 else if ((path = pathpath(path, "", PATH_REGULAR|PATH_READ, fp->decode.path, sizeof(fp->decode.path))) && (fp->fp = sfopen(NiL, path, "r")))
413 b = (s = fp->decode.temp) + 1;
414 for (i = 0; i < elementsof(fp->decode.bigram1); i++)
418 if (!(*s++ = fp->decode.bigram1[i] = j) && i)
425 if (!(*s++ = fp->decode.bigram2[i] = j) && (i || fp->decode.bigram1[0] >= '0' && fp->decode.bigram1[0] <= '1'))
432 type = (const char*)typefix(fp->decode.bigram2, sizeof(fp->decode.bigram2), type);
433 memset(fp->decode.bigram1, 0, sizeof(fp->decode.bigram1));
461 if (j == EOF || fp->decode.count >= sizeof(fp->decode.path))
463 fp->decode.path[fp->decode.count++] = j;
473 fp->decode.bigram2[i = -i] = j;
475 while (++i < elementsof(fp->decode.bigram1))
479 fp->decode.bigram1[i] = j;
482 fp->decode.bigram2[i] = j;
484 if ((fp->decode.peek = sfgetc(fp->fp)) != FF_OFF)
507 b = fp->decode.temp;
520 sfsprintf(b, sizeof(fp->decode.temp) - 1, "%s", s);
521 else if (!p && !(p = getcwd(fp->decode.path, sizeof(fp->decode.path))))
524 sfsprintf(b, sizeof(fp->decode.temp) - 1, "%s/%s", p, s);
525 s = pathcanon(b, sizeof(fp->decode.temp), 0);
534 s = pathcanon(b, sizeof(fp->decode.temp), PATH_PHYSICAL);
570 b = fp->decode.pattern;
624 fp->decode.match = 1;
625 if (i = regcomp(&fp->decode.re, pattern, REG_SHELL|REG_AUGMENTED|(fp->decode.ignorecase?REG_ICASE:0)))
629 regerror(i, &fp->decode.re, fp->decode.temp, sizeof(fp->decode.temp));
630 (*fp->disc->errorf)(fp, fp->disc, 2, "%s: %s", pattern, fp->decode.temp);
641 fp->decode.end = b;
642 if (fp->decode.ignorecase)
643 for (s = fp->decode.pattern; s <= b; s++)
665 if (!fp->generate && fp->decode.match)
666 regfree(&fp->decode.re);
696 if (fp->decode.restore)
698 *fp->decode.restore = '/';
699 fp->decode.restore = 0;
701 ignorecase = fp->decode.ignorecase ? STR_ICASE : 0;
702 c = fp->decode.peek;
734 p = fp->decode.path + (fp->decode.count += n);
745 fp->decode.peek = c;
752 if (fp->decode.swap >= 0)
755 if (!fp->decode.swap)
774 fp->decode.swap = 1;
777 fp->decode.swap = -1;
785 fp->decode.count += c - FF_OFF;
786 for (p = fp->decode.path + fp->decode.count; (c = sfgetc(fp->fp)) > FF_ESC;)
789 *p++ = fp->decode.bigram1[c & ((1<<(CHAR_BIT-1))-1)];
790 *p++ = fp->decode.bigram2[c & ((1<<(CHAR_BIT-1))-1)];
798 b = fp->decode.path;
799 if (fp->decode.found)
800 fp->decode.found = 0;
802 b += fp->decode.count;
816 if ((n = p - fp->decode.path + 1) > (m = *fp->lens))
820 if (!strncasecmp(*fp->dirs, fp->decode.path, m))
827 if (!(n = strcasecmp(*fp->dirs, fp->decode.path)) && (ignorecase || !strcmp(*fp->dirs, fp->decode.path)))
848 if ((n = p - fp->decode.path))
853 n = (*fp->verifyf)(fp, fp->decode.path, n, fp->disc);
854 else if (stat(fp->decode.path, &st))
872 if (fp->decode.end)
876 if (*fp->decode.pattern == '/' && b > fp->decode.path)
879 if (*s == *fp->decode.end || ignorecase && tolower(*s) == *fp->decode.end)
882 for (e = fp->decode.end - 1, q = s - 1; *e && (*q == *e || tolower(*q) == *e); e--, q--);
884 for (e = fp->decode.end - 1, q = s - 1; *e && *q == *e; e--, q--);
887 fp->decode.found = 1;
888 if (!fp->decode.match || strgrpmatch(fp->decode.path, fp->decode.pattern, NiL, 0, STR_MAXIMAL|STR_LEFT|STR_RIGHT|ignorecase))
890 fp->decode.peek = c;
892 *(fp->decode.restore = p) = 0;
893 if (!fp->secure || !access(fp->decode.path, F_OK))
894 return fp->decode.path;
900 else if (!fp->decode.match || !(n = regexec(&fp->decode.re, fp->decode.path, 0, NiL, 0)))
902 fp->decode.peek = c;
903 if (*p == '/' && p > fp->decode.path)
904 *(fp->decode.restore = p) = 0;
905 if (!fp->secure || !access(fp->decode.path, F_OK))
906 return fp->decode.path;
912 regerror(n, &fp->decode.re, fp->decode.temp, sizeof(fp->decode.temp));
913 (*fp->disc->errorf)(fp, fp->disc, 2, "%s: %s", fp->decode.pattern, fp->decode.temp);
1274 if (fp->decode.match)
1275 regfree(&fp->decode.re);