diff options
author | Paolo Bonzini <bonzini@gnu.org> | 2012-01-03 09:01:24 +0100 |
---|---|---|
committer | Paolo Bonzini <bonzini@gnu.org> | 2012-01-03 09:25:39 +0100 |
commit | 9871ae65430b46710f6bccf732672d4b439aa60c (patch) | |
tree | 9b2b5bdc768663320fb80c6fca30d340ac4082f7 | |
parent | 3f99160691ffee1356ff3757d91a389564270578 (diff) | |
download | grep-9871ae65430b46710f6bccf732672d4b439aa60c.tar.gz |
unify colorize.h headers
* lib/Makefile.am (EXTRA_DIST): Adjust.
* lib/colorize.h: Remove inline functions.
* lib/colorize-impl.c: Move them here as functions.
* lib/ms/colorize.h: Remove.
* src/Makefile.am (DEFAULT_HEADERS): Remove.
-rw-r--r-- | lib/Makefile.am | 2 | ||||
-rw-r--r-- | lib/colorize-impl.c | 18 | ||||
-rw-r--r-- | lib/colorize.h | 21 | ||||
-rw-r--r-- | lib/ms/colorize.h | 4 | ||||
-rw-r--r-- | src/Makefile.am | 1 |
5 files changed, 22 insertions, 24 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am index 485f5ef3..91277848 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -23,7 +23,7 @@ AM_CFLAGS += $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS) libgreputils_a_SOURCES += \ colorize.c colorize.h savedir.c savedir.h -EXTRA_DIST += colorize-impl.c ms/colorize.h ms/colorize-impl.c +EXTRA_DIST += colorize-impl.c ms/colorize-impl.c libgreputils_a_LIBADD += $(LIBOBJS) $(ALLOCA) libgreputils_a_DEPENDENCIES += $(LIBOBJS) $(ALLOCA) diff --git a/lib/colorize-impl.c b/lib/colorize-impl.c index e9d5c730..37bc6400 100644 --- a/lib/colorize-impl.c +++ b/lib/colorize-impl.c @@ -20,6 +20,7 @@ #include "colorize.h" +#include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> @@ -32,3 +33,20 @@ should_colorize (void) char const *t = getenv ("TERM"); return t && strcmp (t, "dumb") != 0; } + +void init_colorize (void) { } + +/* Start a colorized text attribute on stdout using the SGR_START + format; the attribute is specified by SGR_SEQ. */ +void +print_start_colorize (char const *sgr_start, char const *sgr_seq) +{ + printf (sgr_start, sgr_seq); +} + +/* Restore the normal text attribute using the SGR_END string. */ +void +print_end_colorize (char const *sgr_end) +{ + fputs (sgr_end, stdout); +} diff --git a/lib/colorize.h b/lib/colorize.h index 93f3b10f..23687d08 100644 --- a/lib/colorize.h +++ b/lib/colorize.h @@ -16,22 +16,7 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <stdio.h> - -static inline void init_colorize (void) { } extern int should_colorize (void); - -/* Start a colorized text attribute on stdout using the SGR_START - format; the attribute is specified by SGR_SEQ. */ -static inline void -print_start_colorize (char const *sgr_start, char const *sgr_seq) -{ - printf (sgr_start, sgr_seq); -} - -/* Restore the normal text attribute using the SGR_END string. */ -static inline void -print_end_colorize (char const *sgr_end) -{ - fputs (sgr_end, stdout); -} +extern void init_colorize (void); +extern void print_start_colorize (char const *sgr_start, char const *sgr_seq); +extern void print_end_colorize (char const *sgr_end); diff --git a/lib/ms/colorize.h b/lib/ms/colorize.h deleted file mode 100644 index bb94e763..00000000 --- a/lib/ms/colorize.h +++ /dev/null @@ -1,4 +0,0 @@ -extern void colorize_init (void); -extern int should_colorize (void); -extern void print_start_colorize (char const *, char const *); -extern void print_end_colorize (char const *); diff --git a/src/Makefile.am b/src/Makefile.am index 53f8ae65..4543f625 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -42,7 +42,6 @@ LDADD = \ grep_LDADD = $(LDADD) $(LIB_PCRE) localedir = $(datadir)/locale -DEFAULT_INCLUDES = $(GREP_SRC_INCLUDES) -I.@am__isrc@ -I$(top_builddir) AM_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib EXTRA_DIST = dosbuf.c |