Lines Matching refs:mc
67 static void procmatch_match(struct mprintc *mc, struct parsec *pc);
68 static void procmatch_nomatch(struct mprintc *mc, struct parsec *pc);
69 static bool procmatches(struct mprintc *mc, struct parsec *pc, bool matched);
195 procmatch_match(struct mprintc *mc, struct parsec *pc) in procmatch_match() argument
198 if (mc->doctx) { in procmatch_match()
199 if (!first_match && (!mc->same_file || mc->last_outed > 0)) in procmatch_match()
203 mc->tail = Aflag; in procmatch_match()
207 if (mc->printmatch) { in procmatch_match()
218 mc->same_file = true; in procmatch_match()
219 mc->last_outed = 0; in procmatch_match()
224 procmatch_nomatch(struct mprintc *mc, struct parsec *pc) in procmatch_nomatch() argument
228 if (mc->tail > 0) { in procmatch_nomatch()
230 mc->tail--; in procmatch_nomatch()
240 ++mc->last_outed; in procmatch_nomatch()
249 procmatches(struct mprintc *mc, struct parsec *pc, bool matched) in procmatches() argument
258 mc->tail--; in procmatches()
259 return (mc->tail != 0); in procmatches()
268 procmatch_match(mc, pc); in procmatches()
275 return (mc->tail != 0); in procmatches()
277 } else if (mc->doctx) in procmatches()
278 procmatch_nomatch(mc, pc); in procmatches()
291 struct mprintc mc; in procfile() local
327 memset(&mc, 0, sizeof(mc)); in procfile()
328 mc.printmatch = true; in procfile()
331 mc.printmatch = false; in procfile()
332 if (mc.printmatch && (Aflag != 0 || Bflag != 0)) in procfile()
333 mc.doctx = true; in procfile()
334 if (mc.printmatch && (Aflag != 0 || Bflag != 0 || mflag || nflag)) in procfile()
372 if (!procmatches(&mc, &pc, false)) in procfile()
381 if (!procmatches(&mc, &pc, line_matched)) in procfile()