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