Lines Matching defs:line
13 USE_GREP(NEWTOY(grep, "(line-buffered)(color):;(exclude-dir)*S(exclude)*M(include)*ZzEFHIab(byte-offset)h(no-filename)ino(only-matching)rRsvwcl(files-with-matches)q(quiet)(silent)e*f*C#B#A#m#x[!wx][!EFw]", TOYFLAG_BIN|TOYFLAG_ARGFAIL(2)))
44 -x whole line -z input NUL terminated
46 display modes: (default: matched line)
53 -h hide filename -n line number of match
93 // Emit line with various potential prefixes and delimiter
94 static void outline(char *line, char dash, char *name, long lcount, long bcount,
104 if (line) {
107 xputsl(line, trim);
148 char *line = 0, *start;
154 // get next line, check and trim delimiter
157 ulen = len = getdelim(&line, &ulen, TT.indelim, file);
160 if (line[ulen-1] == TT.indelim) line[--ulen] = 0;
162 // Prepare for next line
163 start = line;
167 // Loop to handle multiple matches in same line
178 if (!(FLAG(i) ? strcasecmp : strcmp)(seek->arg, line)) s = line;
180 // No need to set fseek.next because this will match every line.
182 fseek.arg = s = line;
208 shoe->rc = regexec0(&shoe->r, start, ulen-(start-line), 1,
209 &shoe->m, start==line ? 0 : REG_NOTBOL);
223 if (mm->rm_so || line[mm->rm_eo]) rc = 1;
228 if ((start+mm->rm_so)!=line) {
246 mm->rm_eo = ulen-(start-line);
253 mm->rm_eo = ulen-(start-line);
258 // At least one line we didn't print since match while -ABC active
271 free(line);
277 long bcount = 1 + offset + (start-line) + (FLAG(o) ? mm->rm_so : 0);
295 outline(FLAG(color) ? 0 : line, ':', name, lcount, bcount, ulen);
298 if (mm->rm_so) xputsl(line, mm->rm_so);
300 xputsl(line+mm->rm_so, mm->rm_eo-mm->rm_so);
314 // Finish off pending line color fragment.
317 if (ulen > start-line) xputsl(start, ulen-(start-line));
325 outline(line, '-', name, lcount, 0, ulen);
331 line = xrealloc(line, ul+8);
332 uu = (void *)(line+ul);
335 dlist_add(&dlb, line);
336 line = 0;
346 // If we discarded a line while displaying context, show bars before next
347 // line (but don't show them now in case that was last match in file)
350 free(line);