[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 4/9] grep: make egrep/fgrep use struct matcher
From: |
Jim Meyering |
Subject: |
Re: [PATCH 4/9] grep: make egrep/fgrep use struct matcher |
Date: |
Fri, 19 Mar 2010 15:05:32 +0100 |
Paolo Bonzini wrote:
> * Makefile.am (grep_SOURCES): Add gsearch.c.
> (EXTRA_DIST): Add search.c.
> * esearch.c (matchers): New.
> * fsearch.c (matchers): New.
> * gsearch.c: New.
> * search.c (matchers): Remove.
> * grep.c: Always compile most !GREP_PROGRAM sections.
> (main): Use first matcher if none is explicitly provided. Remove
> "default" matcher.
> * grep.h (struct matcher): Adjust comments.
...
ACK with one nit:
> diff --git a/src/grep.h b/src/grep.h
> index 8a0ca3b..1277b61 100644
> --- a/src/grep.h
> +++ b/src/grep.h
> @@ -38,32 +38,21 @@
> (char const *buf, size_t size, size_t *match_size, char const *start_ptr)
> /* start_ptr == NULL means the caller is not looking for an exact match.
> */
>
> -#ifdef GREP_PROGRAM
> -/* Function definitions. */
> # define COMPILE_FCT(f) static COMPILE_RET f COMPILE_ARGS
> # define EXECUTE_FCT(f) static EXECUTE_RET f EXECUTE_ARGS
> +
> /* Function pointer types. */
> typedef COMPILE_RET (*compile_fp_t) COMPILE_ARGS;
> typedef EXECUTE_RET (*execute_fp_t) EXECUTE_ARGS;
>
> -/* grep.c expects the matchers vector to be terminated
> - by an entry with a NULL name, and to contain at least
> - an entry named "default". */
> +/* grep.c expects the matchers vector to be terminated by an entry
> + * with a NULL name, and to contain at least an entry. */
s/an/one/
Also, s/^ \*/ /, to be consistent with commenting style.
- [PATCH 0/9] remove most {,E,F}GREP_PROGRAM occurrences, Paolo Bonzini, 2010/03/19
- [PATCH 1/9] grep: remove getpagesize.h, Paolo Bonzini, 2010/03/19
- [PATCH 2/9] grep: remove one #ifdef, Paolo Bonzini, 2010/03/19
- [PATCH 3/9] grep: change struct matcher termination, Paolo Bonzini, 2010/03/19
- [PATCH 4/9] grep: make egrep/fgrep use struct matcher, Paolo Bonzini, 2010/03/19
- Re: [PATCH 4/9] grep: make egrep/fgrep use struct matcher,
Jim Meyering <=
- [PATCH 5/9] grep: eliminate {COMPILE,EXECUTE}_{RET,ARGS,FCT}, Paolo Bonzini, 2010/03/19
- [PATCH 6/9] grep: remove one #ifdef, Paolo Bonzini, 2010/03/19
- [PATCH 8/9] grep: prepare for libification of *search.c, Paolo Bonzini, 2010/03/19
- [PATCH 9/9] grep: libify *search.c, Paolo Bonzini, 2010/03/19