]> git.ipfire.org Git - thirdparty/git.git/commit - grep.h
builtin-grep: make pieces of it available as library.
authorJunio C Hamano <junkio@cox.net>
Sun, 17 Sep 2006 23:02:52 +0000 (16:02 -0700)
committerJunio C Hamano <junkio@cox.net>
Wed, 20 Sep 2006 18:14:38 +0000 (11:14 -0700)
commit83b5d2f5b0c95fe102bc3d1cc2947abbdf5e5c5b
tree16348287b2cb6ebdba2e5068467b6b592b3ec3c7
parent62e27f273d66afa996cb7aee6cdb25fbedc053f6
builtin-grep: make pieces of it available as library.

This makes three functions and associated option structures from
builtin-grep available from other parts of the system.

 * options to drive built-in grep engine is stored in struct
   grep_opt;

 * pattern strings and extended grep expressions are added to
   struct grep_opt with append_grep_pattern();

 * when finished calling append_grep_pattern(), call
   compile_grep_patterns() to prepare for execution;

 * call grep_buffer() to find matches in the in-core buffer.

This also adds an internal option "status_only" to grep_opt,
which suppresses any output from grep_buffer().  Callers of the
function as library can use it to check if there is a match
without producing any output.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Makefile
builtin-grep.c
grep.c [new file with mode: 0644]
grep.h [new file with mode: 0644]