public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/openrc:master commit in: src/test/, src/, man/, src/libeinfo/, src/rc/, pkgconfig/
@ 2013-09-27  3:57 William Hubbs
  0 siblings, 0 replies; 2+ messages in thread
From: William Hubbs @ 2013-09-27  3:57 UTC (permalink / raw
  To: gentoo-commits

commit:     de88aff0a839844526ae262f8961ec4372fed238
Author:     William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Mon Sep 23 01:23:56 2013 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Fri Sep 27 03:18:21 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=de88aff0

Make einfo routines private

The libeinfo library has no consumers other than OpenRC, so there is no
reason for it to be maintained as a library. The einfo routines are now
an object that links with the rc binary.

---
 man/Makefile                            |   2 +-
 man/einfo.3                             | 210 --------------------------------
 pkgconfig/Makefile                      |   4 +-
 pkgconfig/einfo.pc.in                   |   9 --
 src/Makefile                            |   2 +-
 src/libeinfo/.gitignore                 |   1 -
 src/libeinfo/Makefile                   |  12 --
 src/libeinfo/einfo.map                  |  35 ------
 src/rc/Makefile                         |  27 ++--
 src/{libeinfo/libeinfo.c => rc/einfo.c} | 110 +++++------------
 src/{libeinfo => rc}/einfo.h            |  68 ++++-------
 src/test/einfo.data.list                |   1 -
 src/test/einfo.funcs.list               |  52 --------
 src/test/runtests.sh                    |  18 ---
 14 files changed, 79 insertions(+), 472 deletions(-)

diff --git a/man/Makefile b/man/Makefile
index 4110c8f..6a106e7 100644
--- a/man/Makefile
+++ b/man/Makefile
@@ -1,4 +1,4 @@
-MAN3=		einfo.3 \
+MAN3=		\
 		rc_config.3 rc_deptree.3 rc_find_pids.3 rc_plugin_hook.3 \
 		rc_runlevel.3 rc_service.3 rc_stringlist.3
 MAN8=		rc-service.8 rc-status.8 rc-update.8 rc.8 runscript.8 \

diff --git a/man/einfo.3 b/man/einfo.3
deleted file mode 100644
index f7b1fd2..0000000
--- a/man/einfo.3
+++ /dev/null
@@ -1,210 +0,0 @@
-.\" Copyright (c) 2007-2008 Roy Marples
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\"    notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\"    notice, this list of conditions and the following disclaimer in the
-.\"    documentation and/or other materials provided with the distribution.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.Dd Mar 16, 2008
-.Dt EINFO 3 SMM
-.Os OpenRC
-.Sh NAME
-.Nm einfo , ewarn , eerror , ebegin ,
-.Nm einfon , ewarnn , eerrorn , ebeginn ,
-.Nm einfov , ewarnv , ebeginv ,
-.Nm einfovn , ewarnvn , ebeginvn ,
-.Nm ewarnx , eerrorx ,
-.Nm eend , ewend ,
-.Nm eendv , ewendv ,
-.Nm ebracket ,
-.Nm eindent , eoutdent ,
-.Nm eindentv , eoutdentv ,
-.Nm eprefix
-.Nd colorful informational output
-.Sh LIBRARY
-Enhanced Information output library (libeinfo, -leinfo)
-.Sh SYNOPSIS
-.In einfo.h
-.Ft int Fn einfo "const char * restrict format" ...
-.Ft int Fn ewarn "const char * restrict format" ...
-.Ft int Fn eerror "const char * restrict format" ...
-.Ft int Fn ebegin "const char * restrict format" ...
-.Ft int Fn einfon "const char * restrict format" ...
-.Ft int Fn ewarnn "const char * restrict format" ...
-.Ft int Fn eerrorn "const char * restrict format" ...
-.Ft int Fn ebeginn "const char * restrict format" ...
-.Ft int Fn einfov "const char * restrict format" ...
-.Ft int Fn ewarnv "const char * restrict format" ...
-.Ft int Fn ebeginv "const char * restrict format" ...
-.Ft int Fn einfovn "const char * restrict format" ...
-.Ft int Fn ewarnvn "const char * restrict format" ...
-.Ft int Fn ebeginvn "const char * restrict format" ...
-.Ft int Fn ewarnx "const char * restrict format" ...
-.Ft int Fn eerrorx "const char * restrict format" ...
-.Ft int Fn eend "int retval" "const char * restrict format" ...
-.Ft int Fn ewend "int retval" "const char * restrict format" ...
-.Ft int Fn eendv "int retval" "const char * restrict format" ...
-.Ft int Fn ewendv "int retval" "const char * restrict format" ...
-.Ft void Fn ebracket "int col" "ECOLOR color" "const char * restrict msg"
-.Ft void Fn eindent void
-.Ft void Fn eoutdent void
-.Ft void Fn eindentv void
-.Ft void Fn eoutdentv void
-.Ft void Fn eprefix "const char * prefix"
-.Sh DESCRIPTION
-The
-.Fn einfo
-family of functions provide a simple informational output that is colorised.
-Basically
-.Fn einfo ,
-.Fn ewarn
-and
-.Fn eerror
-behave exactly like
-.Fn printf
-but prefix the output with a colored *. The function called denotes the color
-used with
-.Fn einfo
-being green,
-.Fn ewarn
-being yellow and
-.Fn eerror
-being red.
-einfo goes to stdout and the others go to stderr.
-The number of real characters printed is returned.
-.Fn ebegin
-is identical to
-.Fn einfo
-except that 3 dots are appended to the output.
-.Pp
-.Fn einfov ,
-.Fn ewarnv
-and
-.Fn ebeginv
-work the same way to
-.Fn einfo ,
-.Fn ewarn ,
-and
-.Fn ebegin
-respectively, but only work when
-.Va EINFO_VERBOSE
-is true. You can also make the
-.Fn einfo ,
-.Fn ewarn ,
-and
-.Fn ebegin
-functions silent by setting
-.Va EINFO_QUIET
-to true.
-.Pp
-These functions are designed to output a whole line, so they also
-append a newline to the string. To stop this behaviour, you can use the
-functions
-.Fn einfon ,
-.Fn ewarnn ,
-.Fn eerrorn ,
-.Fn einfovn ,
-.Fn ewarnvn ,
-and
-.Fn ebeginvn .
-.Pp
-.Fn eend ,
-.Fn ewend ,
-.Fn eendv
-and
-.Fn ewendv
-are the counterparts to the above functions. If
-.Fa retval
-is zero then ok in green is printed in a bracket at the end of the prior
-line. Otherwise we print the formatted string using
-.Fn error
-(or
-.Fn ewarn
-if
-.Fn ewend
-is called) !! in red (or yellow if
-.Fn ewend
-is called) is printed in a bracket at the end of the line.
-The value of
-.Fa retval
-is returned.
-.Pp
-.Fn ebracket
-does the same as
-.Fn eend
-but prints
-.Fa msg
-instead of ok or !! in the color
-.Fa color
-at the column
-.Fa col .
-.Pp
-.Fn eindent
-indents subsequent calls to the above functions by 3 characters.
-.Fn eoutdent
-removes an
-.Fn eindent .
-.Fn eindentv
-and
-.Fn eoutdentv
-only work when
-.Va EINFO_VERBOSE
-is true.
-.Pp
-.Fn eprefix
-prefixes the string
-.Fa prefix
-to the above functions.
-.Sh IMPLEMENTATION NOTES
-einfo can optionally be linked against the
-.Lb libtermcap
-so that we can correctly query the connected console for our color and
-cursor escape codes.
-If not, then we have a hard coded list of terminals we know about that support
-the commonly used codes for color and cursor position.
-.Sh ENVIRONMENT
-.Va EINFO_QUIET
-when set to true makes the
-.Fn einfo
-and
-.Fn einfon
-family of functions quiet, so nothing is printed.
-.Va EERROR_QUIET
-when set to true makes the
-.Fn eerror
-and
-.Fn eerrorn
-family of functions quiet, so nothing is printed.
-.Pp
-.Va EINFO_VERBOSE
-when set to true makes the
-.Fn einfov
-and
-.Fn einfovn
-family of functions work, so they do print.
-.Sh FILES
-.Pa /etc/init.d/functions.sh
-is provided by OpenRC, which allows shell scripts to use the above functions.
-For historical reasons our verbose functions are prefixed with v instead of
-suffixed. So einfov becomes veinfo, einfovn becomes veinfon.
-Rinse and repeat for the other verbose functions.
-.Sh SEE ALSO
-.Xr printf 3 ,
-.Sh AUTHORS
-.An Roy Marples <roy@marples.name>

diff --git a/pkgconfig/Makefile b/pkgconfig/Makefile
index 4bf28cf..d1dc550 100644
--- a/pkgconfig/Makefile
+++ b/pkgconfig/Makefile
@@ -1,6 +1,6 @@
 DIR=	${LIBDIR}/pkgconfig
-SRCS=	einfo.pc.in openrc.pc.in
-INC=	einfo.pc openrc.pc
+SRCS=	openrc.pc.in
+INC=	openrc.pc
 
 .DEFAULT:
 	${SED} -n -e 's/^VERSION=[[:space:]]*\([^[:space:]]*\).*/#define VERSION "\1${GITVER}\"/p' ../../Makefile > version.h

diff --git a/pkgconfig/einfo.pc.in b/pkgconfig/einfo.pc.in
deleted file mode 100644
index b5242a6..0000000
--- a/pkgconfig/einfo.pc.in
+++ /dev/null
@@ -1,9 +0,0 @@
-prefix=@PREFIX@
-exec_prefix=${prefix}
-libdir=${prefix}/@LIB@
-includedir=/usr/include
-
-Name: einfo
-Description: Pretty console informational display
-Version: @VERSION@
-Libs: -L${libdir} -leinfo

diff --git a/src/Makefile b/src/Makefile
index ffbf8d6..f4cd512 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,7 +1,7 @@
 # Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
 # Released under the 2-clause BSD license.
 
-SUBDIR=		test libeinfo librc rc
+SUBDIR=		test librc rc
 
 ifeq (${MKTOOLS},yes)
 SUBDIR+= tools

diff --git a/src/libeinfo/.gitignore b/src/libeinfo/.gitignore
deleted file mode 100644
index 373284d..0000000
--- a/src/libeinfo/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-libeinfo.so.1

diff --git a/src/libeinfo/Makefile b/src/libeinfo/Makefile
deleted file mode 100644
index ec756b4..0000000
--- a/src/libeinfo/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-LIB=			einfo
-SHLIB_MAJOR=		1
-SRCS=			libeinfo.c
-INCS=			einfo.h
-VERSION_MAP=		einfo.map
-
-CPPFLAGS+=		-I../includes
-
-MK=			../../mk
-include ${MK}/lib.mk
-include ${MK}/cc.mk
-include ${MK}/termcap.mk

diff --git a/src/libeinfo/einfo.map b/src/libeinfo/einfo.map
deleted file mode 100644
index 428a895..0000000
--- a/src/libeinfo/einfo.map
+++ /dev/null
@@ -1,35 +0,0 @@
-EINFO_1.0 {
-global:
-	ecolor;
-	elog;
-	einfon;
-	ewarnn;
-	eerrorn;
-	einfo;
-	ewarn;
-	ewarnx;
-	eerror;
-	eerrorx;
-	einfovn;
-	ewarnvn;
-	ebeginvn;
-	eendvn;
-	ewendvn;
-	einfov;
-	ewarnv;
-	ebeginv;
-	ebegin;
-	eend;
-	ewend;
-	ebracket;
-	eendv;
-	ewendv;
-	eindent;
-	eoutdent;
-	eindentv;
-	eoutdentv;
-	eprefix;
-
-local:
-	*;
-};

diff --git a/src/rc/Makefile b/src/rc/Makefile
index a2e638e..6490826 100644
--- a/src/rc/Makefile
+++ b/src/rc/Makefile
@@ -1,8 +1,21 @@
 PROG=		rc
-SRCS=		checkpath.c fstabinfo.c mountinfo.c start-stop-daemon.c \
-		rc-applets.c rc-depend.c rc-logger.c \
-		rc-misc.c rc-plugin.c rc-service.c rc-status.c rc-update.c \
-		runscript.c rc.c swclock.c
+SRCS=	\
+	checkpath.c \
+	einfo.c \
+	fstabinfo.c \
+	mountinfo.c \
+	rc-applets.c \
+	rc-depend.c \
+	rc-logger.c \
+	rc-misc.c \
+	rc-plugin.c \
+	rc-service.c \
+	rc-status.c \
+	rc-update.c \
+	rc.c \
+	runscript.c \
+	start-stop-daemon.c \
+	swclock.c
 
 CLEANFILES=	version.h
 
@@ -30,9 +43,9 @@ RC_SBINLINKS=	mark_service_starting mark_service_started \
 ALL_LINKS=	${BINLINKS} ${SBINLINKS} ${RC_BINLINKS} ${RC_SBINLINKS}
 CLEANFILES+=	${ALL_LINKS}
 
-CPPFLAGS+=	-I../includes -I../librc -I../libeinfo
-LDFLAGS+=	-L../librc -L../libeinfo
-LDADD+=		-lutil -lrc -leinfo
+CPPFLAGS+=	-I../includes -I../librc
+LDFLAGS+=	-L../librc
+LDADD+=		-lutil -lrc
 
 include ../../Makefile.inc
 MK=		../../mk

diff --git a/src/libeinfo/libeinfo.c b/src/rc/einfo.c
similarity index 87%
rename from src/libeinfo/libeinfo.c
rename to src/rc/einfo.c
index 9791051..306e788 100644
--- a/src/libeinfo/libeinfo.c
+++ b/src/rc/einfo.c
@@ -52,34 +52,6 @@ const char libeinfo_copyright[] = "Copyright (c) 2007-2008 Roy Marples";
 
 #include "einfo.h"
 #include "helpers.h"
-#include "hidden-visibility.h"
-
-hidden_proto(ecolor)
-hidden_proto(ebegin)
-hidden_proto(ebeginv)
-hidden_proto(ebracket)
-hidden_proto(eend)
-hidden_proto(eendv)
-hidden_proto(eerror)
-hidden_proto(eerrorn)
-hidden_proto(eerrorx)
-hidden_proto(eindent)
-hidden_proto(eindentv)
-hidden_proto(einfo)
-hidden_proto(einfon)
-hidden_proto(einfov)
-hidden_proto(einfovn)
-hidden_proto(elog)
-hidden_proto(eoutdent)
-hidden_proto(eoutdentv)
-hidden_proto(eprefix)
-hidden_proto(ewarn)
-hidden_proto(ewarnn)
-hidden_proto(ewarnv)
-hidden_proto(ewarnvn)
-hidden_proto(ewarnx)
-hidden_proto(ewend)
-hidden_proto(ewendv)
 
 /* Incase we cannot work out how many columns from ioctl, supply a default */
 #define DEFAULT_COLS		 80
@@ -352,7 +324,7 @@ tgoto(const char *cap, int col, int line)
 #endif
 
 static bool
-colour_terminal(FILE * EINFO_RESTRICT f)
+colour_terminal(FILE *f)
 {
 	static int in_colour = -1;
 	char *e, *ee, *end, *d, *p;
@@ -499,7 +471,7 @@ colour_terminal(FILE * EINFO_RESTRICT f)
 }
 
 static int
-get_term_columns(FILE * EINFO_RESTRICT stream)
+get_term_columns(FILE *stream)
 {
 	struct winsize ws;
 	char *env = getenv("COLUMNS");
@@ -519,14 +491,13 @@ get_term_columns(FILE * EINFO_RESTRICT stream)
 }
 
 void
-eprefix(const char *EINFO_RESTRICT prefix)
+eprefix(const char *prefix)
 {
 	_eprefix = prefix;
 }
-hidden_def(eprefix)
 
 static void EINFO_PRINTF(2, 0)
-elogv(int level, const char *EINFO_RESTRICT fmt, va_list ap)
+elogv(int level, const char *fmt, va_list ap)
 {
 	char *e = getenv("EINFO_LOG");
 	va_list apc;
@@ -542,7 +513,7 @@ elogv(int level, const char *EINFO_RESTRICT fmt, va_list ap)
 }
 
 void
-elog(int level, const char *EINFO_RESTRICT fmt, ...)
+elog(int level, const char *fmt, ...)
 {
 	va_list ap;
 
@@ -550,10 +521,9 @@ elog(int level, const char *EINFO_RESTRICT fmt, ...)
 	elogv(level, fmt, ap);
 	va_end(ap);
 }
-hidden_def(elog)
 
 static int
-_eindent(FILE * EINFO_RESTRICT stream)
+_eindent(FILE *stream)
 {
 	char *env = getenv("EINFO_INDENT");
 	int amount = 0;
@@ -577,7 +547,7 @@ _eindent(FILE * EINFO_RESTRICT stream)
 }
 
 static const char *
-_ecolor(FILE * EINFO_RESTRICT f, ECOLOR color)
+_ecolor(FILE *f, ECOLOR color)
 {
 	unsigned int i;
 
@@ -589,7 +559,6 @@ _ecolor(FILE * EINFO_RESTRICT f, ECOLOR color)
 			return ecolors_str[i];
 	return "";
 }
-hidden_def(ecolor)
 
 const char *
 ecolor(ECOLOR color)
@@ -615,7 +584,7 @@ ecolor(ECOLOR color)
 	}
 
 static int EINFO_PRINTF(3, 0)
-	_einfo(FILE *f, ECOLOR color, const char *EINFO_RESTRICT fmt, va_list va)
+	_einfo(FILE *f, ECOLOR color, const char *fmt, va_list va)
 {
 	int retval = 0;
 	char *last = getenv("EINFO_LASTCMD");
@@ -643,7 +612,7 @@ static int EINFO_PRINTF(3, 0)
 #define _eerrorvn(fmt, ap) _einfo(stderr, ECOLOR_BAD, fmt, ap)
 
 int
-einfon(const char *EINFO_RESTRICT fmt, ...)
+einfon(const char *fmt, ...)
 {
 	int retval;
 	va_list ap;
@@ -656,10 +625,9 @@ einfon(const char *EINFO_RESTRICT fmt, ...)
 	LASTCMD("einfon");
 	return retval;
 }
-hidden_def(einfon)
 
 int
-ewarnn(const char *EINFO_RESTRICT fmt, ...)
+ewarnn(const char *fmt, ...)
 {
 	int retval;
 	va_list ap;
@@ -672,10 +640,9 @@ ewarnn(const char *EINFO_RESTRICT fmt, ...)
 	LASTCMD("ewarnn");
 	return retval;
 }
-hidden_def(ewarnn)
 
 int
-eerrorn(const char *EINFO_RESTRICT fmt, ...)
+eerrorn(const char *fmt, ...)
 {
 	int retval;
 	va_list ap;
@@ -688,10 +655,9 @@ eerrorn(const char *EINFO_RESTRICT fmt, ...)
 	LASTCMD("errorn");
 	return retval;
 }
-hidden_def(eerrorn)
 
 int
-einfo(const char *EINFO_RESTRICT fmt, ...)
+einfo(const char *fmt, ...)
 {
 	int retval;
 	va_list ap;
@@ -705,10 +671,9 @@ einfo(const char *EINFO_RESTRICT fmt, ...)
 	LASTCMD("einfo");
 	return retval;
 }
-hidden_def(einfo)
 
 int
-ewarn(const char *EINFO_RESTRICT fmt, ...)
+ewarn(const char *fmt, ...)
 {
 	int retval;
 	va_list ap;
@@ -723,10 +688,9 @@ ewarn(const char *EINFO_RESTRICT fmt, ...)
 	LASTCMD("ewarn");
 	return retval;
 }
-hidden_def(ewarn)
 
 void
-ewarnx(const char *EINFO_RESTRICT fmt, ...)
+ewarnx(const char *fmt, ...)
 {
 	int retval;
 	va_list ap;
@@ -740,10 +704,9 @@ ewarnx(const char *EINFO_RESTRICT fmt, ...)
 	}
 	exit(EXIT_FAILURE);
 }
-hidden_def(ewarnx)
 
 int
-eerror(const char *EINFO_RESTRICT fmt, ...)
+eerror(const char *fmt, ...)
 {
 	int retval;
 	va_list ap;
@@ -758,10 +721,9 @@ eerror(const char *EINFO_RESTRICT fmt, ...)
 	LASTCMD("eerror");
 	return retval;
 }
-hidden_def(eerror)
 
 void
-eerrorx(const char *EINFO_RESTRICT fmt, ...)
+eerrorx(const char *fmt, ...)
 {
 	va_list ap;
 
@@ -774,10 +736,9 @@ eerrorx(const char *EINFO_RESTRICT fmt, ...)
 	}
 	exit(EXIT_FAILURE);
 }
-hidden_def(eerrorx)
 
 int
-ebegin(const char *EINFO_RESTRICT fmt, ...)
+ebegin(const char *fmt, ...)
 {
 	int retval;
 	va_list ap;
@@ -793,10 +754,9 @@ ebegin(const char *EINFO_RESTRICT fmt, ...)
 	LASTCMD("ebegin");
 	return retval;
 }
-hidden_def(ebegin)
 
 static void
-_eend(FILE * EINFO_RESTRICT fp, int col, ECOLOR color, const char *msg)
+_eend(FILE *fp, int col, ECOLOR color, const char *msg)
 {
 	int i;
 	int cols;
@@ -832,7 +792,7 @@ _eend(FILE * EINFO_RESTRICT fp, int col, ECOLOR color, const char *msg)
 
 static int EINFO_PRINTF(3, 0)
 _do_eend(const char *cmd, int retval,
-    const char *EINFO_RESTRICT fmt, va_list ap)
+    const char *fmt, va_list ap)
 {
 	int col = 0;
 	FILE *fp = stdout;
@@ -855,7 +815,7 @@ _do_eend(const char *cmd, int retval,
 }
 
 int
-eend(int retval, const char *EINFO_RESTRICT fmt, ...)
+eend(int retval, const char *fmt, ...)
 {
 	va_list ap;
 
@@ -867,10 +827,9 @@ eend(int retval, const char *EINFO_RESTRICT fmt, ...)
 	LASTCMD("eend");
 	return retval;
 }
-hidden_def(eend)
 
 int
-ewend(int retval, const char *EINFO_RESTRICT fmt, ...)
+ewend(int retval, const char *fmt, ...)
 {
 	va_list ap;
 
@@ -882,14 +841,12 @@ ewend(int retval, const char *EINFO_RESTRICT fmt, ...)
 	LASTCMD("ewend");
 	return retval;
 }
-hidden_def(ewend)
 
 void
 ebracket(int col, ECOLOR color, const char *msg)
 {
 	_eend(stdout, col, color, msg);
 }
-hidden_def(ebracket)
 
 void
 eindent(void)
@@ -910,7 +867,6 @@ eindent(void)
 	snprintf(num, 10, "%08d", amount);
 	setenv("EINFO_INDENT", num, 1);
 }
-hidden_def(eindent)
 
 void eoutdent(void)
 {
@@ -935,10 +891,9 @@ void eoutdent(void)
 	}
 	errno = serrno;
 }
-hidden_def(eoutdent)
 
 int
-einfovn(const char *EINFO_RESTRICT fmt, ...)
+einfovn(const char *fmt, ...)
 {
 	int retval;
 	va_list ap;
@@ -951,10 +906,9 @@ einfovn(const char *EINFO_RESTRICT fmt, ...)
 	LASTCMD("einfovn");
 	return retval;
 }
-hidden_def(einfovn)
 
 int
-ewarnvn(const char *EINFO_RESTRICT fmt, ...)
+ewarnvn(const char *fmt, ...)
 {
 	int retval;
 	va_list ap;
@@ -967,10 +921,9 @@ ewarnvn(const char *EINFO_RESTRICT fmt, ...)
 	LASTCMD("ewarnvn");
 	return retval;
 }
-hidden_def(ewarnvn)
 
 int
-einfov(const char *EINFO_RESTRICT fmt, ...)
+einfov(const char *fmt, ...)
 {
 	int retval;
 	va_list ap;
@@ -984,10 +937,9 @@ einfov(const char *EINFO_RESTRICT fmt, ...)
 	LASTCMD("einfov");
 	return retval;
 }
-hidden_def(einfov)
 
 int
-ewarnv(const char *EINFO_RESTRICT fmt, ...)
+ewarnv(const char *fmt, ...)
 {
 	int retval;
 	va_list ap;
@@ -1001,10 +953,9 @@ ewarnv(const char *EINFO_RESTRICT fmt, ...)
 	LASTCMD("ewarnv");
 	return retval;
 }
-hidden_def(ewarnv)
 
 int
-ebeginv(const char *EINFO_RESTRICT fmt, ...)
+ebeginv(const char *fmt, ...)
 {
 	int retval;
 	va_list ap;
@@ -1021,10 +972,9 @@ ebeginv(const char *EINFO_RESTRICT fmt, ...)
 	LASTCMD("ebeginv");
 	return retval;
 }
-hidden_def(ebeginv)
 
 int
-eendv(int retval, const char *EINFO_RESTRICT fmt, ...)
+eendv(int retval, const char *fmt, ...)
 {
 	va_list ap;
 
@@ -1036,10 +986,9 @@ eendv(int retval, const char *EINFO_RESTRICT fmt, ...)
 	LASTCMD("eendv");
 	return retval;
 }
-hidden_def(eendv)
 
 int
-ewendv(int retval, const char *EINFO_RESTRICT fmt, ...)
+ewendv(int retval, const char *fmt, ...)
 {
 	va_list ap;
 
@@ -1051,7 +1000,6 @@ ewendv(int retval, const char *EINFO_RESTRICT fmt, ...)
 	LASTCMD("ewendv");
 	return retval;
 }
-hidden_def(ewendv)
 
 void
 eindentv(void)
@@ -1059,7 +1007,6 @@ eindentv(void)
 	if (is_verbose())
 		eindent();
 }
-hidden_def(eindentv)
 
 void
 eoutdentv(void)
@@ -1067,4 +1014,3 @@ eoutdentv(void)
 	if (is_verbose())
 		eoutdent();
 }
-hidden_def(eoutdentv)

diff --git a/src/libeinfo/einfo.h b/src/rc/einfo.h
similarity index 61%
rename from src/libeinfo/einfo.h
rename to src/rc/einfo.h
index 31a891f..5764569 100644
--- a/src/libeinfo/einfo.h
+++ b/src/rc/einfo.h
@@ -37,19 +37,6 @@
 #include <sys/types.h>
 #include <stdbool.h>
 
-/* Although OpenRC requires C99, linking to us should not. */
-#ifdef restrict
-# define EINFO_RESTRICT restrict
-#else
-# ifdef __restrict
-#  define EINFO_RESTRICT __restrict
-# else
-#  define EINFO_RESTRICT
-# endif
-#endif
-
-__BEGIN_DECLS
-
 /*! @brief Color types to use */
 typedef enum
 {
@@ -65,14 +52,14 @@ typedef enum
 const char *ecolor(ECOLOR);
 
 /*! @brief Writes to syslog. */
-void elog(int, const char * EINFO_RESTRICT, ...) EINFO_PRINTF(2, 3);
+void elog(int, const char *, ...) EINFO_PRINTF(2, 3);
 
 /*!
  * @brief Display informational messages.
  *
  * The einfo family of functions display messages in a consistent manner
- * across applications. Basically they prefix the message with
- * " * ". If the terminal can handle color then we color the * based on
+ * Basically they prefix the message with " * ".
+ * If the terminal can handle color then we color the * based on
  * the command used. Otherwise we are identical to the printf function.
  *
  * - einfo  - green
@@ -83,22 +70,22 @@ void elog(int, const char * EINFO_RESTRICT, ...) EINFO_PRINTF(2, 3);
  * The v suffix means only print if EINFO_VERBOSE is yes.
  */
 /*@{*/
-int einfon(const char * __EINFO_RESTRICT, ...) EINFO_PRINTF(1, 2);
-int ewarnn(const char * __EINFO_RESTRICT, ...) EINFO_PRINTF(1, 2);
-int eerrorn(const char * __EINFO_RESTRICT, ...) EINFO_PRINTF(1, 2);
-int einfo(const char * __EINFO_RESTRICT, ...) EINFO_PRINTF(1, 2);
-int ewarn(const char * __EINFO_RESTRICT, ...) EINFO_PRINTF(1, 2);
-void ewarnx(const char * __EINFO_RESTRICT, ...) EINFO_XPRINTF(1, 2);
-int eerror(const char * __EINFO_RESTRICT, ...) EINFO_PRINTF(1, 2);
-void eerrorx(const char * __EINFO_RESTRICT, ...) EINFO_XPRINTF(1, 2);
-
-int einfovn(const char * __EINFO_RESTRICT, ...) EINFO_PRINTF(1, 2);
-int ewarnvn(const char * __EINFO_RESTRICT, ...) EINFO_PRINTF(1, 2);
-int ebeginvn(const char * __EINFO_RESTRICT, ...) EINFO_PRINTF(1, 2);
-int eendvn(int, const char * __EINFO_RESTRICT, ...) EINFO_PRINTF(2, 3);
-int ewendvn(int, const char * __EINFO_RESTRICT, ...) EINFO_PRINTF(2, 3);
-int einfov(const char * __EINFO_RESTRICT, ...) EINFO_PRINTF(1, 2);
-int ewarnv(const char * __EINFO_RESTRICT, ...) EINFO_PRINTF(1, 2);
+int einfon(const char *, ...) EINFO_PRINTF(1, 2);
+int ewarnn(const char *, ...) EINFO_PRINTF(1, 2);
+int eerrorn(const char *, ...) EINFO_PRINTF(1, 2);
+int einfo(const char *, ...) EINFO_PRINTF(1, 2);
+int ewarn(const char *, ...) EINFO_PRINTF(1, 2);
+void ewarnx(const char *, ...) EINFO_XPRINTF(1, 2);
+int eerror(const char *, ...) EINFO_PRINTF(1, 2);
+void eerrorx(const char *, ...) EINFO_XPRINTF(1, 2);
+
+int einfovn(const char *, ...) EINFO_PRINTF(1, 2);
+int ewarnvn(const char * , ...) EINFO_PRINTF(1, 2);
+int ebeginvn(const char *, ...) EINFO_PRINTF(1, 2);
+int eendvn(int, const char *, ...) EINFO_PRINTF(2, 3);
+int ewendvn(int, const char *, ...) EINFO_PRINTF(2, 3);
+int einfov(const char *, ...) EINFO_PRINTF(1, 2);
+int ewarnv(const char *, ...) EINFO_PRINTF(1, 2);
 /*@}*/
 
 /*! @ingroup ebegin
@@ -106,8 +93,8 @@ int ewarnv(const char * __EINFO_RESTRICT, ...) EINFO_PRINTF(1, 2);
  *
  * Similar to einfo, but we add ... to the end of the message */
 /*@{*/
-int ebeginv(const char * EINFO_RESTRICT, ...) EINFO_PRINTF(1, 2);
-int ebegin(const char * EINFO_RESTRICT, ...) EINFO_PRINTF(1, 2);
+int ebeginv(const char *, ...) EINFO_PRINTF(1, 2);
+int ebegin(const char *, ...) EINFO_PRINTF(1, 2);
 /*@}*/
 
 /*! @ingroup eend
@@ -119,12 +106,12 @@ int ebegin(const char * EINFO_RESTRICT, ...) EINFO_PRINTF(1, 2);
  *
  * ebracket allows you to specifiy the position, color and message */
 /*@{*/
-int eend(int, const char * EINFO_RESTRICT, ...) EINFO_PRINTF(2, 3);
-int ewend(int, const char * EINFO_RESTRICT, ...) EINFO_PRINTF(2, 3);
-void ebracket(int, ECOLOR, const char * EINFO_RESTRICT);
+int eend(int, const char *, ...) EINFO_PRINTF(2, 3);
+int ewend(int, const char *, ...) EINFO_PRINTF(2, 3);
+void ebracket(int, ECOLOR, const char *);
 
-int eendv(int, const char * EINFO_RESTRICT, ...) EINFO_PRINTF(2, 3);
-int ewendv(int, const char * EINFO_RESTRICT, ...) EINFO_PRINTF(2, 3);
+int eendv(int, const char *, ...) EINFO_PRINTF(2, 3);
+int ewendv(int, const char *, ...) EINFO_PRINTF(2, 3);
 /*@}*/
 
 /*! @ingroup eindent
@@ -138,7 +125,6 @@ void eindentv(void);
 void eoutdentv(void);
 
 /*! @brief Prefix each einfo line with something */
-void eprefix(const char * EINFO_RESTRICT);
+void eprefix(const char *);
 
-__END_DECLS
 #endif

diff --git a/src/test/einfo.data.list b/src/test/einfo.data.list
deleted file mode 100644
index c638b2f..0000000
--- a/src/test/einfo.data.list
+++ /dev/null
@@ -1 +0,0 @@
-EINFO_1.0

diff --git a/src/test/einfo.funcs.list b/src/test/einfo.funcs.list
deleted file mode 100644
index 5dbbd96..0000000
--- a/src/test/einfo.funcs.list
+++ /dev/null
@@ -1,52 +0,0 @@
-ebegin
-ebegin@@EINFO_1.0
-ebeginv
-ebeginv@@EINFO_1.0
-ebracket
-ebracket@@EINFO_1.0
-ecolor
-ecolor@@EINFO_1.0
-eend
-eend@@EINFO_1.0
-eendv
-eendv@@EINFO_1.0
-eerror
-eerror@@EINFO_1.0
-eerrorn
-eerrorn@@EINFO_1.0
-eerrorx
-eerrorx@@EINFO_1.0
-eindent
-eindent@@EINFO_1.0
-eindentv
-eindentv@@EINFO_1.0
-einfo
-einfo@@EINFO_1.0
-einfon
-einfon@@EINFO_1.0
-einfov
-einfov@@EINFO_1.0
-einfovn
-einfovn@@EINFO_1.0
-elog
-elog@@EINFO_1.0
-eoutdent
-eoutdent@@EINFO_1.0
-eoutdentv
-eoutdentv@@EINFO_1.0
-eprefix
-eprefix@@EINFO_1.0
-ewarn
-ewarn@@EINFO_1.0
-ewarnn
-ewarnn@@EINFO_1.0
-ewarnv
-ewarnv@@EINFO_1.0
-ewarnvn
-ewarnvn@@EINFO_1.0
-ewarnx
-ewarnx@@EINFO_1.0
-ewend
-ewend@@EINFO_1.0
-ewendv
-ewendv@@EINFO_1.0

diff --git a/src/test/runtests.sh b/src/test/runtests.sh
index 5a87c84..b5b053f 100755
--- a/src/test/runtests.sh
+++ b/src/test/runtests.sh
@@ -3,8 +3,6 @@
 top_srcdir=${top_srcdir:-../..}
 . ${top_srcdir}/test/setup_env.sh
 
-libeinfo_srcdir="${srcdir}/../libeinfo"
-libeinfo_builddir="${builddir}/../libeinfo"
 librc_srcdir="${srcdir}/../librc"
 librc_builddir="${builddir}/../librc"
 rc_srcdir="${srcdir}/../rc"
@@ -20,22 +18,6 @@ checkit() {
 
 ret=0
 
-ebegin "Checking exported symbols in libeinfo.so (data)"
-checkit einfo.data $(
-readelf -Ws ${libeinfo_builddir}/libeinfo.so \
-	| awk '$4 == "OBJECT" && $5 == "GLOBAL" && $7 != "UND" {print $NF}' \
-	| LC_ALL=C sort -u
-)
-
-ebegin "Checking exported symbols in libeinfo.so (functions)"
-checkit einfo.funcs $(
-readelf -Ws ${libeinfo_builddir}/libeinfo.so \
-	| awk '$4 == "FUNC" && $5 == "GLOBAL" && $7 != "UND" {print $NF}' \
-	| LC_ALL=C sort -u \
-	| egrep -v \
-		-e '^_(init|fini)$'
-)
-
 ebegin "Checking exported symbols in librc.so (data)"
 checkit rc.data $(
 readelf -Ws ${librc_builddir}/librc.so \


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] proj/openrc:master commit in: src/test/, src/, man/, src/libeinfo/, src/rc/, pkgconfig/
@ 2013-10-21 18:52 William Hubbs
  0 siblings, 0 replies; 2+ messages in thread
From: William Hubbs @ 2013-10-21 18:52 UTC (permalink / raw
  To: gentoo-commits

commit:     48981be8a872c7a0191d2519793205276fdc423a
Author:     William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Wed Oct 16 17:55:37 2013 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Mon Oct 21 18:49:41 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=48981be8

Revert "Make einfo routines private"

This reverts commit de88aff0a839844526ae262f8961ec4372fed238.
I was advised that splashutils links to libeinfo, so we do have a
consumer for this library.

---
 man/Makefile                            |   2 +-
 man/einfo.3                             | 210 ++++++++++++++++++++++++++++++++
 pkgconfig/Makefile                      |   4 +-
 pkgconfig/einfo.pc.in                   |   9 ++
 src/Makefile                            |   2 +-
 src/libeinfo/.gitignore                 |   1 +
 src/libeinfo/Makefile                   |  12 ++
 src/{rc => libeinfo}/einfo.h            |  68 +++++++----
 src/libeinfo/einfo.map                  |  35 ++++++
 src/{rc/einfo.c => libeinfo/libeinfo.c} | 110 ++++++++++++-----
 src/rc/Makefile                         |  27 ++--
 src/test/einfo.data.list                |   1 +
 src/test/einfo.funcs.list               |  52 ++++++++
 src/test/runtests.sh                    |  18 +++
 14 files changed, 472 insertions(+), 79 deletions(-)

diff --git a/man/Makefile b/man/Makefile
index 6a106e7..4110c8f 100644
--- a/man/Makefile
+++ b/man/Makefile
@@ -1,4 +1,4 @@
-MAN3=		\
+MAN3=		einfo.3 \
 		rc_config.3 rc_deptree.3 rc_find_pids.3 rc_plugin_hook.3 \
 		rc_runlevel.3 rc_service.3 rc_stringlist.3
 MAN8=		rc-service.8 rc-status.8 rc-update.8 rc.8 runscript.8 \

diff --git a/man/einfo.3 b/man/einfo.3
new file mode 100644
index 0000000..f7b1fd2
--- /dev/null
+++ b/man/einfo.3
@@ -0,0 +1,210 @@
+.\" Copyright (c) 2007-2008 Roy Marples
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.Dd Mar 16, 2008
+.Dt EINFO 3 SMM
+.Os OpenRC
+.Sh NAME
+.Nm einfo , ewarn , eerror , ebegin ,
+.Nm einfon , ewarnn , eerrorn , ebeginn ,
+.Nm einfov , ewarnv , ebeginv ,
+.Nm einfovn , ewarnvn , ebeginvn ,
+.Nm ewarnx , eerrorx ,
+.Nm eend , ewend ,
+.Nm eendv , ewendv ,
+.Nm ebracket ,
+.Nm eindent , eoutdent ,
+.Nm eindentv , eoutdentv ,
+.Nm eprefix
+.Nd colorful informational output
+.Sh LIBRARY
+Enhanced Information output library (libeinfo, -leinfo)
+.Sh SYNOPSIS
+.In einfo.h
+.Ft int Fn einfo "const char * restrict format" ...
+.Ft int Fn ewarn "const char * restrict format" ...
+.Ft int Fn eerror "const char * restrict format" ...
+.Ft int Fn ebegin "const char * restrict format" ...
+.Ft int Fn einfon "const char * restrict format" ...
+.Ft int Fn ewarnn "const char * restrict format" ...
+.Ft int Fn eerrorn "const char * restrict format" ...
+.Ft int Fn ebeginn "const char * restrict format" ...
+.Ft int Fn einfov "const char * restrict format" ...
+.Ft int Fn ewarnv "const char * restrict format" ...
+.Ft int Fn ebeginv "const char * restrict format" ...
+.Ft int Fn einfovn "const char * restrict format" ...
+.Ft int Fn ewarnvn "const char * restrict format" ...
+.Ft int Fn ebeginvn "const char * restrict format" ...
+.Ft int Fn ewarnx "const char * restrict format" ...
+.Ft int Fn eerrorx "const char * restrict format" ...
+.Ft int Fn eend "int retval" "const char * restrict format" ...
+.Ft int Fn ewend "int retval" "const char * restrict format" ...
+.Ft int Fn eendv "int retval" "const char * restrict format" ...
+.Ft int Fn ewendv "int retval" "const char * restrict format" ...
+.Ft void Fn ebracket "int col" "ECOLOR color" "const char * restrict msg"
+.Ft void Fn eindent void
+.Ft void Fn eoutdent void
+.Ft void Fn eindentv void
+.Ft void Fn eoutdentv void
+.Ft void Fn eprefix "const char * prefix"
+.Sh DESCRIPTION
+The
+.Fn einfo
+family of functions provide a simple informational output that is colorised.
+Basically
+.Fn einfo ,
+.Fn ewarn
+and
+.Fn eerror
+behave exactly like
+.Fn printf
+but prefix the output with a colored *. The function called denotes the color
+used with
+.Fn einfo
+being green,
+.Fn ewarn
+being yellow and
+.Fn eerror
+being red.
+einfo goes to stdout and the others go to stderr.
+The number of real characters printed is returned.
+.Fn ebegin
+is identical to
+.Fn einfo
+except that 3 dots are appended to the output.
+.Pp
+.Fn einfov ,
+.Fn ewarnv
+and
+.Fn ebeginv
+work the same way to
+.Fn einfo ,
+.Fn ewarn ,
+and
+.Fn ebegin
+respectively, but only work when
+.Va EINFO_VERBOSE
+is true. You can also make the
+.Fn einfo ,
+.Fn ewarn ,
+and
+.Fn ebegin
+functions silent by setting
+.Va EINFO_QUIET
+to true.
+.Pp
+These functions are designed to output a whole line, so they also
+append a newline to the string. To stop this behaviour, you can use the
+functions
+.Fn einfon ,
+.Fn ewarnn ,
+.Fn eerrorn ,
+.Fn einfovn ,
+.Fn ewarnvn ,
+and
+.Fn ebeginvn .
+.Pp
+.Fn eend ,
+.Fn ewend ,
+.Fn eendv
+and
+.Fn ewendv
+are the counterparts to the above functions. If
+.Fa retval
+is zero then ok in green is printed in a bracket at the end of the prior
+line. Otherwise we print the formatted string using
+.Fn error
+(or
+.Fn ewarn
+if
+.Fn ewend
+is called) !! in red (or yellow if
+.Fn ewend
+is called) is printed in a bracket at the end of the line.
+The value of
+.Fa retval
+is returned.
+.Pp
+.Fn ebracket
+does the same as
+.Fn eend
+but prints
+.Fa msg
+instead of ok or !! in the color
+.Fa color
+at the column
+.Fa col .
+.Pp
+.Fn eindent
+indents subsequent calls to the above functions by 3 characters.
+.Fn eoutdent
+removes an
+.Fn eindent .
+.Fn eindentv
+and
+.Fn eoutdentv
+only work when
+.Va EINFO_VERBOSE
+is true.
+.Pp
+.Fn eprefix
+prefixes the string
+.Fa prefix
+to the above functions.
+.Sh IMPLEMENTATION NOTES
+einfo can optionally be linked against the
+.Lb libtermcap
+so that we can correctly query the connected console for our color and
+cursor escape codes.
+If not, then we have a hard coded list of terminals we know about that support
+the commonly used codes for color and cursor position.
+.Sh ENVIRONMENT
+.Va EINFO_QUIET
+when set to true makes the
+.Fn einfo
+and
+.Fn einfon
+family of functions quiet, so nothing is printed.
+.Va EERROR_QUIET
+when set to true makes the
+.Fn eerror
+and
+.Fn eerrorn
+family of functions quiet, so nothing is printed.
+.Pp
+.Va EINFO_VERBOSE
+when set to true makes the
+.Fn einfov
+and
+.Fn einfovn
+family of functions work, so they do print.
+.Sh FILES
+.Pa /etc/init.d/functions.sh
+is provided by OpenRC, which allows shell scripts to use the above functions.
+For historical reasons our verbose functions are prefixed with v instead of
+suffixed. So einfov becomes veinfo, einfovn becomes veinfon.
+Rinse and repeat for the other verbose functions.
+.Sh SEE ALSO
+.Xr printf 3 ,
+.Sh AUTHORS
+.An Roy Marples <roy@marples.name>

diff --git a/pkgconfig/Makefile b/pkgconfig/Makefile
index d1dc550..4bf28cf 100644
--- a/pkgconfig/Makefile
+++ b/pkgconfig/Makefile
@@ -1,6 +1,6 @@
 DIR=	${LIBDIR}/pkgconfig
-SRCS=	openrc.pc.in
-INC=	openrc.pc
+SRCS=	einfo.pc.in openrc.pc.in
+INC=	einfo.pc openrc.pc
 
 .DEFAULT:
 	${SED} -n -e 's/^VERSION=[[:space:]]*\([^[:space:]]*\).*/#define VERSION "\1${GITVER}\"/p' ../../Makefile > version.h

diff --git a/pkgconfig/einfo.pc.in b/pkgconfig/einfo.pc.in
new file mode 100644
index 0000000..b5242a6
--- /dev/null
+++ b/pkgconfig/einfo.pc.in
@@ -0,0 +1,9 @@
+prefix=@PREFIX@
+exec_prefix=${prefix}
+libdir=${prefix}/@LIB@
+includedir=/usr/include
+
+Name: einfo
+Description: Pretty console informational display
+Version: @VERSION@
+Libs: -L${libdir} -leinfo

diff --git a/src/Makefile b/src/Makefile
index f4cd512..ffbf8d6 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,7 +1,7 @@
 # Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
 # Released under the 2-clause BSD license.
 
-SUBDIR=		test librc rc
+SUBDIR=		test libeinfo librc rc
 
 ifeq (${MKTOOLS},yes)
 SUBDIR+= tools

diff --git a/src/libeinfo/.gitignore b/src/libeinfo/.gitignore
new file mode 100644
index 0000000..373284d
--- /dev/null
+++ b/src/libeinfo/.gitignore
@@ -0,0 +1 @@
+libeinfo.so.1

diff --git a/src/libeinfo/Makefile b/src/libeinfo/Makefile
new file mode 100644
index 0000000..ec756b4
--- /dev/null
+++ b/src/libeinfo/Makefile
@@ -0,0 +1,12 @@
+LIB=			einfo
+SHLIB_MAJOR=		1
+SRCS=			libeinfo.c
+INCS=			einfo.h
+VERSION_MAP=		einfo.map
+
+CPPFLAGS+=		-I../includes
+
+MK=			../../mk
+include ${MK}/lib.mk
+include ${MK}/cc.mk
+include ${MK}/termcap.mk

diff --git a/src/rc/einfo.h b/src/libeinfo/einfo.h
similarity index 61%
rename from src/rc/einfo.h
rename to src/libeinfo/einfo.h
index 5764569..31a891f 100644
--- a/src/rc/einfo.h
+++ b/src/libeinfo/einfo.h
@@ -37,6 +37,19 @@
 #include <sys/types.h>
 #include <stdbool.h>
 
+/* Although OpenRC requires C99, linking to us should not. */
+#ifdef restrict
+# define EINFO_RESTRICT restrict
+#else
+# ifdef __restrict
+#  define EINFO_RESTRICT __restrict
+# else
+#  define EINFO_RESTRICT
+# endif
+#endif
+
+__BEGIN_DECLS
+
 /*! @brief Color types to use */
 typedef enum
 {
@@ -52,14 +65,14 @@ typedef enum
 const char *ecolor(ECOLOR);
 
 /*! @brief Writes to syslog. */
-void elog(int, const char *, ...) EINFO_PRINTF(2, 3);
+void elog(int, const char * EINFO_RESTRICT, ...) EINFO_PRINTF(2, 3);
 
 /*!
  * @brief Display informational messages.
  *
  * The einfo family of functions display messages in a consistent manner
- * Basically they prefix the message with " * ".
- * If the terminal can handle color then we color the * based on
+ * across applications. Basically they prefix the message with
+ * " * ". If the terminal can handle color then we color the * based on
  * the command used. Otherwise we are identical to the printf function.
  *
  * - einfo  - green
@@ -70,22 +83,22 @@ void elog(int, const char *, ...) EINFO_PRINTF(2, 3);
  * The v suffix means only print if EINFO_VERBOSE is yes.
  */
 /*@{*/
-int einfon(const char *, ...) EINFO_PRINTF(1, 2);
-int ewarnn(const char *, ...) EINFO_PRINTF(1, 2);
-int eerrorn(const char *, ...) EINFO_PRINTF(1, 2);
-int einfo(const char *, ...) EINFO_PRINTF(1, 2);
-int ewarn(const char *, ...) EINFO_PRINTF(1, 2);
-void ewarnx(const char *, ...) EINFO_XPRINTF(1, 2);
-int eerror(const char *, ...) EINFO_PRINTF(1, 2);
-void eerrorx(const char *, ...) EINFO_XPRINTF(1, 2);
-
-int einfovn(const char *, ...) EINFO_PRINTF(1, 2);
-int ewarnvn(const char * , ...) EINFO_PRINTF(1, 2);
-int ebeginvn(const char *, ...) EINFO_PRINTF(1, 2);
-int eendvn(int, const char *, ...) EINFO_PRINTF(2, 3);
-int ewendvn(int, const char *, ...) EINFO_PRINTF(2, 3);
-int einfov(const char *, ...) EINFO_PRINTF(1, 2);
-int ewarnv(const char *, ...) EINFO_PRINTF(1, 2);
+int einfon(const char * __EINFO_RESTRICT, ...) EINFO_PRINTF(1, 2);
+int ewarnn(const char * __EINFO_RESTRICT, ...) EINFO_PRINTF(1, 2);
+int eerrorn(const char * __EINFO_RESTRICT, ...) EINFO_PRINTF(1, 2);
+int einfo(const char * __EINFO_RESTRICT, ...) EINFO_PRINTF(1, 2);
+int ewarn(const char * __EINFO_RESTRICT, ...) EINFO_PRINTF(1, 2);
+void ewarnx(const char * __EINFO_RESTRICT, ...) EINFO_XPRINTF(1, 2);
+int eerror(const char * __EINFO_RESTRICT, ...) EINFO_PRINTF(1, 2);
+void eerrorx(const char * __EINFO_RESTRICT, ...) EINFO_XPRINTF(1, 2);
+
+int einfovn(const char * __EINFO_RESTRICT, ...) EINFO_PRINTF(1, 2);
+int ewarnvn(const char * __EINFO_RESTRICT, ...) EINFO_PRINTF(1, 2);
+int ebeginvn(const char * __EINFO_RESTRICT, ...) EINFO_PRINTF(1, 2);
+int eendvn(int, const char * __EINFO_RESTRICT, ...) EINFO_PRINTF(2, 3);
+int ewendvn(int, const char * __EINFO_RESTRICT, ...) EINFO_PRINTF(2, 3);
+int einfov(const char * __EINFO_RESTRICT, ...) EINFO_PRINTF(1, 2);
+int ewarnv(const char * __EINFO_RESTRICT, ...) EINFO_PRINTF(1, 2);
 /*@}*/
 
 /*! @ingroup ebegin
@@ -93,8 +106,8 @@ int ewarnv(const char *, ...) EINFO_PRINTF(1, 2);
  *
  * Similar to einfo, but we add ... to the end of the message */
 /*@{*/
-int ebeginv(const char *, ...) EINFO_PRINTF(1, 2);
-int ebegin(const char *, ...) EINFO_PRINTF(1, 2);
+int ebeginv(const char * EINFO_RESTRICT, ...) EINFO_PRINTF(1, 2);
+int ebegin(const char * EINFO_RESTRICT, ...) EINFO_PRINTF(1, 2);
 /*@}*/
 
 /*! @ingroup eend
@@ -106,12 +119,12 @@ int ebegin(const char *, ...) EINFO_PRINTF(1, 2);
  *
  * ebracket allows you to specifiy the position, color and message */
 /*@{*/
-int eend(int, const char *, ...) EINFO_PRINTF(2, 3);
-int ewend(int, const char *, ...) EINFO_PRINTF(2, 3);
-void ebracket(int, ECOLOR, const char *);
+int eend(int, const char * EINFO_RESTRICT, ...) EINFO_PRINTF(2, 3);
+int ewend(int, const char * EINFO_RESTRICT, ...) EINFO_PRINTF(2, 3);
+void ebracket(int, ECOLOR, const char * EINFO_RESTRICT);
 
-int eendv(int, const char *, ...) EINFO_PRINTF(2, 3);
-int ewendv(int, const char *, ...) EINFO_PRINTF(2, 3);
+int eendv(int, const char * EINFO_RESTRICT, ...) EINFO_PRINTF(2, 3);
+int ewendv(int, const char * EINFO_RESTRICT, ...) EINFO_PRINTF(2, 3);
 /*@}*/
 
 /*! @ingroup eindent
@@ -125,6 +138,7 @@ void eindentv(void);
 void eoutdentv(void);
 
 /*! @brief Prefix each einfo line with something */
-void eprefix(const char *);
+void eprefix(const char * EINFO_RESTRICT);
 
+__END_DECLS
 #endif

diff --git a/src/libeinfo/einfo.map b/src/libeinfo/einfo.map
new file mode 100644
index 0000000..428a895
--- /dev/null
+++ b/src/libeinfo/einfo.map
@@ -0,0 +1,35 @@
+EINFO_1.0 {
+global:
+	ecolor;
+	elog;
+	einfon;
+	ewarnn;
+	eerrorn;
+	einfo;
+	ewarn;
+	ewarnx;
+	eerror;
+	eerrorx;
+	einfovn;
+	ewarnvn;
+	ebeginvn;
+	eendvn;
+	ewendvn;
+	einfov;
+	ewarnv;
+	ebeginv;
+	ebegin;
+	eend;
+	ewend;
+	ebracket;
+	eendv;
+	ewendv;
+	eindent;
+	eoutdent;
+	eindentv;
+	eoutdentv;
+	eprefix;
+
+local:
+	*;
+};

diff --git a/src/rc/einfo.c b/src/libeinfo/libeinfo.c
similarity index 87%
rename from src/rc/einfo.c
rename to src/libeinfo/libeinfo.c
index 306e788..9791051 100644
--- a/src/rc/einfo.c
+++ b/src/libeinfo/libeinfo.c
@@ -52,6 +52,34 @@ const char libeinfo_copyright[] = "Copyright (c) 2007-2008 Roy Marples";
 
 #include "einfo.h"
 #include "helpers.h"
+#include "hidden-visibility.h"
+
+hidden_proto(ecolor)
+hidden_proto(ebegin)
+hidden_proto(ebeginv)
+hidden_proto(ebracket)
+hidden_proto(eend)
+hidden_proto(eendv)
+hidden_proto(eerror)
+hidden_proto(eerrorn)
+hidden_proto(eerrorx)
+hidden_proto(eindent)
+hidden_proto(eindentv)
+hidden_proto(einfo)
+hidden_proto(einfon)
+hidden_proto(einfov)
+hidden_proto(einfovn)
+hidden_proto(elog)
+hidden_proto(eoutdent)
+hidden_proto(eoutdentv)
+hidden_proto(eprefix)
+hidden_proto(ewarn)
+hidden_proto(ewarnn)
+hidden_proto(ewarnv)
+hidden_proto(ewarnvn)
+hidden_proto(ewarnx)
+hidden_proto(ewend)
+hidden_proto(ewendv)
 
 /* Incase we cannot work out how many columns from ioctl, supply a default */
 #define DEFAULT_COLS		 80
@@ -324,7 +352,7 @@ tgoto(const char *cap, int col, int line)
 #endif
 
 static bool
-colour_terminal(FILE *f)
+colour_terminal(FILE * EINFO_RESTRICT f)
 {
 	static int in_colour = -1;
 	char *e, *ee, *end, *d, *p;
@@ -471,7 +499,7 @@ colour_terminal(FILE *f)
 }
 
 static int
-get_term_columns(FILE *stream)
+get_term_columns(FILE * EINFO_RESTRICT stream)
 {
 	struct winsize ws;
 	char *env = getenv("COLUMNS");
@@ -491,13 +519,14 @@ get_term_columns(FILE *stream)
 }
 
 void
-eprefix(const char *prefix)
+eprefix(const char *EINFO_RESTRICT prefix)
 {
 	_eprefix = prefix;
 }
+hidden_def(eprefix)
 
 static void EINFO_PRINTF(2, 0)
-elogv(int level, const char *fmt, va_list ap)
+elogv(int level, const char *EINFO_RESTRICT fmt, va_list ap)
 {
 	char *e = getenv("EINFO_LOG");
 	va_list apc;
@@ -513,7 +542,7 @@ elogv(int level, const char *fmt, va_list ap)
 }
 
 void
-elog(int level, const char *fmt, ...)
+elog(int level, const char *EINFO_RESTRICT fmt, ...)
 {
 	va_list ap;
 
@@ -521,9 +550,10 @@ elog(int level, const char *fmt, ...)
 	elogv(level, fmt, ap);
 	va_end(ap);
 }
+hidden_def(elog)
 
 static int
-_eindent(FILE *stream)
+_eindent(FILE * EINFO_RESTRICT stream)
 {
 	char *env = getenv("EINFO_INDENT");
 	int amount = 0;
@@ -547,7 +577,7 @@ _eindent(FILE *stream)
 }
 
 static const char *
-_ecolor(FILE *f, ECOLOR color)
+_ecolor(FILE * EINFO_RESTRICT f, ECOLOR color)
 {
 	unsigned int i;
 
@@ -559,6 +589,7 @@ _ecolor(FILE *f, ECOLOR color)
 			return ecolors_str[i];
 	return "";
 }
+hidden_def(ecolor)
 
 const char *
 ecolor(ECOLOR color)
@@ -584,7 +615,7 @@ ecolor(ECOLOR color)
 	}
 
 static int EINFO_PRINTF(3, 0)
-	_einfo(FILE *f, ECOLOR color, const char *fmt, va_list va)
+	_einfo(FILE *f, ECOLOR color, const char *EINFO_RESTRICT fmt, va_list va)
 {
 	int retval = 0;
 	char *last = getenv("EINFO_LASTCMD");
@@ -612,7 +643,7 @@ static int EINFO_PRINTF(3, 0)
 #define _eerrorvn(fmt, ap) _einfo(stderr, ECOLOR_BAD, fmt, ap)
 
 int
-einfon(const char *fmt, ...)
+einfon(const char *EINFO_RESTRICT fmt, ...)
 {
 	int retval;
 	va_list ap;
@@ -625,9 +656,10 @@ einfon(const char *fmt, ...)
 	LASTCMD("einfon");
 	return retval;
 }
+hidden_def(einfon)
 
 int
-ewarnn(const char *fmt, ...)
+ewarnn(const char *EINFO_RESTRICT fmt, ...)
 {
 	int retval;
 	va_list ap;
@@ -640,9 +672,10 @@ ewarnn(const char *fmt, ...)
 	LASTCMD("ewarnn");
 	return retval;
 }
+hidden_def(ewarnn)
 
 int
-eerrorn(const char *fmt, ...)
+eerrorn(const char *EINFO_RESTRICT fmt, ...)
 {
 	int retval;
 	va_list ap;
@@ -655,9 +688,10 @@ eerrorn(const char *fmt, ...)
 	LASTCMD("errorn");
 	return retval;
 }
+hidden_def(eerrorn)
 
 int
-einfo(const char *fmt, ...)
+einfo(const char *EINFO_RESTRICT fmt, ...)
 {
 	int retval;
 	va_list ap;
@@ -671,9 +705,10 @@ einfo(const char *fmt, ...)
 	LASTCMD("einfo");
 	return retval;
 }
+hidden_def(einfo)
 
 int
-ewarn(const char *fmt, ...)
+ewarn(const char *EINFO_RESTRICT fmt, ...)
 {
 	int retval;
 	va_list ap;
@@ -688,9 +723,10 @@ ewarn(const char *fmt, ...)
 	LASTCMD("ewarn");
 	return retval;
 }
+hidden_def(ewarn)
 
 void
-ewarnx(const char *fmt, ...)
+ewarnx(const char *EINFO_RESTRICT fmt, ...)
 {
 	int retval;
 	va_list ap;
@@ -704,9 +740,10 @@ ewarnx(const char *fmt, ...)
 	}
 	exit(EXIT_FAILURE);
 }
+hidden_def(ewarnx)
 
 int
-eerror(const char *fmt, ...)
+eerror(const char *EINFO_RESTRICT fmt, ...)
 {
 	int retval;
 	va_list ap;
@@ -721,9 +758,10 @@ eerror(const char *fmt, ...)
 	LASTCMD("eerror");
 	return retval;
 }
+hidden_def(eerror)
 
 void
-eerrorx(const char *fmt, ...)
+eerrorx(const char *EINFO_RESTRICT fmt, ...)
 {
 	va_list ap;
 
@@ -736,9 +774,10 @@ eerrorx(const char *fmt, ...)
 	}
 	exit(EXIT_FAILURE);
 }
+hidden_def(eerrorx)
 
 int
-ebegin(const char *fmt, ...)
+ebegin(const char *EINFO_RESTRICT fmt, ...)
 {
 	int retval;
 	va_list ap;
@@ -754,9 +793,10 @@ ebegin(const char *fmt, ...)
 	LASTCMD("ebegin");
 	return retval;
 }
+hidden_def(ebegin)
 
 static void
-_eend(FILE *fp, int col, ECOLOR color, const char *msg)
+_eend(FILE * EINFO_RESTRICT fp, int col, ECOLOR color, const char *msg)
 {
 	int i;
 	int cols;
@@ -792,7 +832,7 @@ _eend(FILE *fp, int col, ECOLOR color, const char *msg)
 
 static int EINFO_PRINTF(3, 0)
 _do_eend(const char *cmd, int retval,
-    const char *fmt, va_list ap)
+    const char *EINFO_RESTRICT fmt, va_list ap)
 {
 	int col = 0;
 	FILE *fp = stdout;
@@ -815,7 +855,7 @@ _do_eend(const char *cmd, int retval,
 }
 
 int
-eend(int retval, const char *fmt, ...)
+eend(int retval, const char *EINFO_RESTRICT fmt, ...)
 {
 	va_list ap;
 
@@ -827,9 +867,10 @@ eend(int retval, const char *fmt, ...)
 	LASTCMD("eend");
 	return retval;
 }
+hidden_def(eend)
 
 int
-ewend(int retval, const char *fmt, ...)
+ewend(int retval, const char *EINFO_RESTRICT fmt, ...)
 {
 	va_list ap;
 
@@ -841,12 +882,14 @@ ewend(int retval, const char *fmt, ...)
 	LASTCMD("ewend");
 	return retval;
 }
+hidden_def(ewend)
 
 void
 ebracket(int col, ECOLOR color, const char *msg)
 {
 	_eend(stdout, col, color, msg);
 }
+hidden_def(ebracket)
 
 void
 eindent(void)
@@ -867,6 +910,7 @@ eindent(void)
 	snprintf(num, 10, "%08d", amount);
 	setenv("EINFO_INDENT", num, 1);
 }
+hidden_def(eindent)
 
 void eoutdent(void)
 {
@@ -891,9 +935,10 @@ void eoutdent(void)
 	}
 	errno = serrno;
 }
+hidden_def(eoutdent)
 
 int
-einfovn(const char *fmt, ...)
+einfovn(const char *EINFO_RESTRICT fmt, ...)
 {
 	int retval;
 	va_list ap;
@@ -906,9 +951,10 @@ einfovn(const char *fmt, ...)
 	LASTCMD("einfovn");
 	return retval;
 }
+hidden_def(einfovn)
 
 int
-ewarnvn(const char *fmt, ...)
+ewarnvn(const char *EINFO_RESTRICT fmt, ...)
 {
 	int retval;
 	va_list ap;
@@ -921,9 +967,10 @@ ewarnvn(const char *fmt, ...)
 	LASTCMD("ewarnvn");
 	return retval;
 }
+hidden_def(ewarnvn)
 
 int
-einfov(const char *fmt, ...)
+einfov(const char *EINFO_RESTRICT fmt, ...)
 {
 	int retval;
 	va_list ap;
@@ -937,9 +984,10 @@ einfov(const char *fmt, ...)
 	LASTCMD("einfov");
 	return retval;
 }
+hidden_def(einfov)
 
 int
-ewarnv(const char *fmt, ...)
+ewarnv(const char *EINFO_RESTRICT fmt, ...)
 {
 	int retval;
 	va_list ap;
@@ -953,9 +1001,10 @@ ewarnv(const char *fmt, ...)
 	LASTCMD("ewarnv");
 	return retval;
 }
+hidden_def(ewarnv)
 
 int
-ebeginv(const char *fmt, ...)
+ebeginv(const char *EINFO_RESTRICT fmt, ...)
 {
 	int retval;
 	va_list ap;
@@ -972,9 +1021,10 @@ ebeginv(const char *fmt, ...)
 	LASTCMD("ebeginv");
 	return retval;
 }
+hidden_def(ebeginv)
 
 int
-eendv(int retval, const char *fmt, ...)
+eendv(int retval, const char *EINFO_RESTRICT fmt, ...)
 {
 	va_list ap;
 
@@ -986,9 +1036,10 @@ eendv(int retval, const char *fmt, ...)
 	LASTCMD("eendv");
 	return retval;
 }
+hidden_def(eendv)
 
 int
-ewendv(int retval, const char *fmt, ...)
+ewendv(int retval, const char *EINFO_RESTRICT fmt, ...)
 {
 	va_list ap;
 
@@ -1000,6 +1051,7 @@ ewendv(int retval, const char *fmt, ...)
 	LASTCMD("ewendv");
 	return retval;
 }
+hidden_def(ewendv)
 
 void
 eindentv(void)
@@ -1007,6 +1059,7 @@ eindentv(void)
 	if (is_verbose())
 		eindent();
 }
+hidden_def(eindentv)
 
 void
 eoutdentv(void)
@@ -1014,3 +1067,4 @@ eoutdentv(void)
 	if (is_verbose())
 		eoutdent();
 }
+hidden_def(eoutdentv)

diff --git a/src/rc/Makefile b/src/rc/Makefile
index 6490826..a2e638e 100644
--- a/src/rc/Makefile
+++ b/src/rc/Makefile
@@ -1,21 +1,8 @@
 PROG=		rc
-SRCS=	\
-	checkpath.c \
-	einfo.c \
-	fstabinfo.c \
-	mountinfo.c \
-	rc-applets.c \
-	rc-depend.c \
-	rc-logger.c \
-	rc-misc.c \
-	rc-plugin.c \
-	rc-service.c \
-	rc-status.c \
-	rc-update.c \
-	rc.c \
-	runscript.c \
-	start-stop-daemon.c \
-	swclock.c
+SRCS=		checkpath.c fstabinfo.c mountinfo.c start-stop-daemon.c \
+		rc-applets.c rc-depend.c rc-logger.c \
+		rc-misc.c rc-plugin.c rc-service.c rc-status.c rc-update.c \
+		runscript.c rc.c swclock.c
 
 CLEANFILES=	version.h
 
@@ -43,9 +30,9 @@ RC_SBINLINKS=	mark_service_starting mark_service_started \
 ALL_LINKS=	${BINLINKS} ${SBINLINKS} ${RC_BINLINKS} ${RC_SBINLINKS}
 CLEANFILES+=	${ALL_LINKS}
 
-CPPFLAGS+=	-I../includes -I../librc
-LDFLAGS+=	-L../librc
-LDADD+=		-lutil -lrc
+CPPFLAGS+=	-I../includes -I../librc -I../libeinfo
+LDFLAGS+=	-L../librc -L../libeinfo
+LDADD+=		-lutil -lrc -leinfo
 
 include ../../Makefile.inc
 MK=		../../mk

diff --git a/src/test/einfo.data.list b/src/test/einfo.data.list
new file mode 100644
index 0000000..c638b2f
--- /dev/null
+++ b/src/test/einfo.data.list
@@ -0,0 +1 @@
+EINFO_1.0

diff --git a/src/test/einfo.funcs.list b/src/test/einfo.funcs.list
new file mode 100644
index 0000000..5dbbd96
--- /dev/null
+++ b/src/test/einfo.funcs.list
@@ -0,0 +1,52 @@
+ebegin
+ebegin@@EINFO_1.0
+ebeginv
+ebeginv@@EINFO_1.0
+ebracket
+ebracket@@EINFO_1.0
+ecolor
+ecolor@@EINFO_1.0
+eend
+eend@@EINFO_1.0
+eendv
+eendv@@EINFO_1.0
+eerror
+eerror@@EINFO_1.0
+eerrorn
+eerrorn@@EINFO_1.0
+eerrorx
+eerrorx@@EINFO_1.0
+eindent
+eindent@@EINFO_1.0
+eindentv
+eindentv@@EINFO_1.0
+einfo
+einfo@@EINFO_1.0
+einfon
+einfon@@EINFO_1.0
+einfov
+einfov@@EINFO_1.0
+einfovn
+einfovn@@EINFO_1.0
+elog
+elog@@EINFO_1.0
+eoutdent
+eoutdent@@EINFO_1.0
+eoutdentv
+eoutdentv@@EINFO_1.0
+eprefix
+eprefix@@EINFO_1.0
+ewarn
+ewarn@@EINFO_1.0
+ewarnn
+ewarnn@@EINFO_1.0
+ewarnv
+ewarnv@@EINFO_1.0
+ewarnvn
+ewarnvn@@EINFO_1.0
+ewarnx
+ewarnx@@EINFO_1.0
+ewend
+ewend@@EINFO_1.0
+ewendv
+ewendv@@EINFO_1.0

diff --git a/src/test/runtests.sh b/src/test/runtests.sh
index b5b053f..5a87c84 100755
--- a/src/test/runtests.sh
+++ b/src/test/runtests.sh
@@ -3,6 +3,8 @@
 top_srcdir=${top_srcdir:-../..}
 . ${top_srcdir}/test/setup_env.sh
 
+libeinfo_srcdir="${srcdir}/../libeinfo"
+libeinfo_builddir="${builddir}/../libeinfo"
 librc_srcdir="${srcdir}/../librc"
 librc_builddir="${builddir}/../librc"
 rc_srcdir="${srcdir}/../rc"
@@ -18,6 +20,22 @@ checkit() {
 
 ret=0
 
+ebegin "Checking exported symbols in libeinfo.so (data)"
+checkit einfo.data $(
+readelf -Ws ${libeinfo_builddir}/libeinfo.so \
+	| awk '$4 == "OBJECT" && $5 == "GLOBAL" && $7 != "UND" {print $NF}' \
+	| LC_ALL=C sort -u
+)
+
+ebegin "Checking exported symbols in libeinfo.so (functions)"
+checkit einfo.funcs $(
+readelf -Ws ${libeinfo_builddir}/libeinfo.so \
+	| awk '$4 == "FUNC" && $5 == "GLOBAL" && $7 != "UND" {print $NF}' \
+	| LC_ALL=C sort -u \
+	| egrep -v \
+		-e '^_(init|fini)$'
+)
+
 ebegin "Checking exported symbols in librc.so (data)"
 checkit rc.data $(
 readelf -Ws ${librc_builddir}/librc.so \


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-10-21 18:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-27  3:57 [gentoo-commits] proj/openrc:master commit in: src/test/, src/, man/, src/libeinfo/, src/rc/, pkgconfig/ William Hubbs
  -- strict thread matches above, loose matches on Subject: below --
2013-10-21 18:52 William Hubbs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox