Lines Matching defs:wp
61 Wc_t* wp;
63 if (!(wp = (Wc_t*)stakalloc(sizeof(Wc_t))))
66 wp->mb = 0;
69 wp->mb = 1;
72 wp->mb = -1;
75 wp->type[n] = (w && isspace(n)) ? WC_SP : 0;
76 wp->type['\n'] = WC_SP|WC_NL;
77 if ((mode & (WC_MBYTE|WC_WORDS)) && wp->mb > 0)
81 wp->type[0x80+n] |= WC_MB;
83 wp->type[0xc0+n] |= WC_MB+1;
85 wp->type[0xc0+n] |= WC_MB+2;
87 wp->type[0xc0+n] |= WC_MB+3;
89 wp->type[0xc0+n] |= WC_MB+4;
91 wp->type[0xc0+n] |= WC_MB+5;
93 wp->type[0xc0] = WC_MB|WC_ERR;
94 wp->type[0xc1] = WC_MB|WC_ERR;
95 wp->type[0xfe] = WC_MB|WC_ERR;
96 wp->type[0xff] = WC_MB|WC_ERR;
98 wp->mode = mode;
99 return wp;
162 int wc_count(Wc_t *wp, Sfio_t *fd, const char* file)
164 register char* type = wp->type;
184 wp->longest = 0;
185 if (wp->mb < 0 && (wp->mode & (WC_MBYTE|WC_WORDS)))
205 if ((nchars - longest) > wp->longest)
206 wp->longest = nchars - longest;
230 if (x == -1 && eline != nlines && !(wp->mode & WC_QUIET))
237 if ((nchars - longest) > wp->longest)
238 wp->longest = nchars - longest;
252 if (!(wp->mode & WC_MBYTE))
255 else if (!wp->mb && !(wp->mode & WC_LONGEST) || wp->mb > 0 && !(wp->mode & (WC_MBYTE|WC_WORDS|WC_LONGEST)))
257 if (!(wp->mode & (WC_MBYTE|WC_WORDS|WC_LONGEST)))
387 if(wp->mode&WC_LONGEST)
451 if(eline!=nlines && !(wp->mode & WC_QUIET))
488 if ((wp->mode&WC_LONGEST) && ((endbuff + 1 - start) - adjust - (lastchar == '\n')) > longest)
490 wp->longest = longest;
495 if (wp->mode & WC_MBYTE)
500 wp->chars = nchars;
501 wp->words = nwords;
502 wp->lines = nlines;