Lines Matching defs:patshift
40 int pattern_check(char *buf, int buflen, char *pat, int patlen, int patshift)
46 patshift = patshift % patlen;
53 * bytes of buf. We need 2 checks if patshift is > 0 since we
54 * must check the last (patlen - patshift) bytes, and then the
55 * first (patshift) bytes.
58 nb = patlen - patshift;
60 return (memcmp(cp, pat + patshift, nleft) ? -1 : 0);
62 if (memcmp(cp, pat + patshift, nb))
69 if (patshift > 0) {
70 nb = patshift;
101 int pattern_fill(char *buf, int buflen, char *pat, int patlen, int patshift)
107 patshift = patshift % patlen;
114 * bytes of buf. We need 2 sections if patshift is > 0 since we
115 * must first copy the last (patlen - patshift) bytes into buf[0]...,
116 * and then the first (patshift) bytes of pattern following them.
119 trans = patlen - patshift;
121 memcpy(cp, pat + patshift, nleft);
124 memcpy(cp, pat + patshift, trans);
129 if (patshift > 0) {
130 trans = patshift;