[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/3] unify colorize.h headers
From: |
Paolo Bonzini |
Subject: |
[PATCH 2/3] unify colorize.h headers |
Date: |
Tue, 3 Jan 2012 09:28:29 +0100 |
* 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.
---
lib/Makefile.am | 2 +-
lib/colorize-impl.c | 18 ++++++++++++++++++
lib/colorize.h | 21 +++------------------
lib/ms/colorize.h | 4 ----
src/Makefile.am | 1 -
5 files changed, 22 insertions(+), 24 deletions(-)
delete mode 100644 lib/ms/colorize.h
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 485f5ef..9127784 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 e9d5c73..37bc640 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 93f3b10..23687d0 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 bb94e76..0000000
--- 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 53f8ae6..4543f62 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) address@hidden@ -I$(top_builddir)
AM_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib
EXTRA_DIST = dosbuf.c
--
1.7.7.1
[PATCH 2/3] unify colorize.h headers,
Paolo Bonzini <=
[PATCH 3/3] remove lib/ms/, Paolo Bonzini, 2012/01/03