Lines Matching defs:wp
64 Wc_t* wp;
66 if (!(wp = (Wc_t*)stakalloc(sizeof(Wc_t))))
69 wp->mb = 0;
72 wp->mb = 1;
75 wp->mb = -1;
78 wp->type[n] = (w && isspace(n)) ? WC_SP : 0;
79 wp->type['\n'] = WC_SP|WC_NL;
80 if ((mode & (WC_MBYTE|WC_WORDS)) && wp->mb > 0)
84 wp->type[0x80+n] |= WC_MB;
86 wp->type[0xc0+n] |= WC_MB+1;
88 wp->type[0xc0+n] |= WC_MB+2;
90 wp->type[0xc0+n] |= WC_MB+3;
92 wp->type[0xc0+n] |= WC_MB+4;
94 wp->type[0xc0+n] |= WC_MB+5;
96 wp->type[0xc0] = WC_MB|WC_ERR;
97 wp->type[0xc1] = WC_MB|WC_ERR;
98 wp->type[0xfe] = WC_MB|WC_ERR;
99 wp->type[0xff] = WC_MB|WC_ERR;
101 wp->mode = mode;
102 return wp;
165 int wc_count(Wc_t *wp, Sfio_t *fd, const char* file)
167 register char* type = wp->type;
187 wp->longest = 0;
188 if (wp->mb < 0 && (wp->mode & (WC_MBYTE|WC_WORDS)))
208 if ((nchars - longest) > wp->longest)
209 wp->longest = nchars - longest;
233 if (x == -1 && eline != nlines && !(wp->mode & WC_QUIET))
240 if ((nchars - longest) > wp->longest)
241 wp->longest = nchars - longest;
255 if (!(wp->mode & WC_MBYTE))
258 else if (!wp->mb && !(wp->mode & WC_LONGEST) || wp->mb > 0 && !(wp->mode & (WC_MBYTE|WC_WORDS|WC_LONGEST)))
260 if (!(wp->mode & (WC_MBYTE|WC_WORDS|WC_LONGEST)))
393 if(wp->mode&WC_LONGEST)
469 if(eline!=nlines && !(wp->mode & WC_QUIET))
506 if ((wp->mode&WC_LONGEST) && ((endbuff + 1 - start) - adjust - (lastchar == '\n')) > longest)
508 wp->longest = longest;
513 if (wp->mode & WC_MBYTE)
518 wp->chars = nchars;
519 wp->words = nwords;
520 wp->lines = nlines;