Lines Matching +full:cs +full:- +full:3
1 /*-
2 * SPDX-License-Identifier: BSD-3-Clause
16 * 3. Neither the name of the University nor the names of its contributors
48 /* STRNCMP - like strncmp except that we convert the
58 if (*s2 - makelower(*s1)) in STRNCMP()
59 return (*s2 - makelower(*s1)); in STRNCMP()
64 while (--len); in STRNCMP()
67 if (*s2 - *s1) in STRNCMP()
68 return (*s2 - *s1); in STRNCMP()
73 while (--len); in STRNCMP()
114 #define ONEXT(A) (A+3) /* next character after the operation */
144 cre = malloc(4 * strlen(re) + 3); in convexp()
162 register char *cs; /* pointer to current symbol in converted exp */ in expconv() local
169 cs = NULL; in expconv()
178 if (cs == NULL || (*cs & STR) == 0) { in expconv()
179 cs = ccre; in expconv()
180 *cs = STR; in expconv()
181 SCNT(cs) = 1; in expconv()
184 SCNT(cs)++; in expconv()
193 if (acs != NULL && acs != cs) { in expconv()
196 OCNT(acs) = ccre - acs; in expconv()
197 acs -= temp; in expconv()
201 cs = ccre; in expconv()
202 *cs = META; in expconv()
203 MSYM(cs) = c; in expconv()
204 ccre = MNEXT(cs); in expconv()
212 if (acs != NULL && acs != cs) { in expconv()
215 OCNT(acs) = ccre - acs; in expconv()
216 acs -= temp; in expconv()
220 cs = ccre; in expconv()
221 *cs = META; in expconv()
222 MSYM(cs) = c; in expconv()
223 ccre = MNEXT(cs); in expconv()
228 if (cs) in expconv()
229 *cs = *cs | OPT; in expconv()
234 if (acs != NULL && acs != cs) { in expconv()
237 OCNT(acs) = ccre - acs; in expconv()
238 acs -= temp; in expconv()
242 cs = ccre; in expconv()
243 *cs = OPER; in expconv()
244 OSYM(cs) = '('; in expconv()
245 ccre = ONEXT(cs); in expconv()
247 OCNT(cs) = ccre - cs; /* offset to next symbol */ in expconv()
255 OCNT(acs) = ccre - acs; in expconv()
256 acs -= temp; in expconv()
260 cs = ccre; in expconv()
261 *cs = META; in expconv()
262 MSYM(cs) = c; in expconv()
263 ccre = MNEXT(cs); in expconv()
270 if (acs != NULL && acs != cs) in expconv()
271 OCNT(ccre) = ccre - acs; /* make a back pointer */ in expconv()
274 *cs |= ALT; in expconv()
275 cs = ccre; in expconv()
276 *cs = OPER; in expconv()
277 OSYM(cs) = '|'; in expconv()
278 ccre = ONEXT(cs); in expconv()
279 acs = cs; /* remember that the pointer is to be filles */ in expconv()
284 if (cs == NULL || (*cs & STR) == 0) { in expconv()
285 cs = ccre; in expconv()
286 *cs = STR; in expconv()
287 SCNT(cs) = 1; in expconv()
288 ccre = SSTR(cs); in expconv()
290 SCNT(cs)++; in expconv()
298 OCNT(acs) = ccre - acs; in expconv()
299 acs -= temp; in expconv()
312 * \? - means last match was optional
313 * \a - matches any number of characters
314 * \d - matches any number of spaces and tabs
315 * \p - matches any number of alphanumeric
319 * \| - alternation
320 * \( \) - grouping used mostly for alternation and
338 register char *cs; /* the current symbol */ in expmatch() local
345 cs = re; in expmatch()
349 while (*cs) { in expmatch()
350 switch (*cs & (OPER | STR | META)) { in expmatch()
354 matched = !STRNCMP (s, SSTR(cs), SCNT(cs)); in expmatch()
358 s += SCNT(cs); in expmatch()
359 cs = SNEXT(cs); in expmatch()
360 } else if (*cs & ALT) { in expmatch()
363 cs = SNEXT(cs); in expmatch()
364 } else if (*cs & OPT) { in expmatch()
367 cs = SNEXT(cs); in expmatch()
378 switch (OSYM(cs)) { in expmatch()
385 cs = OPTR(cs); in expmatch()
389 cs = ONEXT(cs); in expmatch()
394 ptr = expmatch(s, ONEXT(cs), mstring); in expmatch()
400 } else if (*cs & ALT) { in expmatch()
404 } else if (*cs & OPT) { in expmatch()
413 cs = OPTR(cs); in expmatch()
420 switch (MSYM(cs)) { in expmatch()
431 ptr = expmatch(s1, MNEXT(cs), mstring); in expmatch()
435 strncpy (mstring, s, s1 - s); in expmatch()
436 mstring[s1 - s] = '\0'; in expmatch()
438 } else if (ptr != NULL && (*cs & OPT)) { in expmatch()
470 ptr = expmatch(s1, MNEXT(cs), mstring); in expmatch()
475 } else if (ptr != NULL && (*cs & OPT)) { in expmatch()
495 cs = MNEXT(cs); in expmatch()
507 cs = MNEXT(cs); in expmatch()
512 cs = MNEXT(cs); in expmatch()
513 } else if (*cs & ALT) { in expmatch()
517 cs = MNEXT(cs); in expmatch()
518 } else if (*cs & OPT) { in expmatch()
522 cs = MNEXT(cs); in expmatch()
536 cs = MNEXT(cs); in expmatch()
537 } else if (*cs & ALT) { in expmatch()
541 cs = MNEXT(cs); in expmatch()
542 } else if (*cs & OPT) { in expmatch()
546 cs = MNEXT(cs); in expmatch()
559 cs = MNEXT(cs); in expmatch()
560 } else if (*cs & ALT) { in expmatch()
564 cs = MNEXT(cs); in expmatch()
565 } else if (*cs & OPT) { in expmatch()
569 cs = MNEXT(cs); in expmatch()