From 81ef6b736d38e4c0400de1592156667d5ba0634a Mon Sep 17 00:00:00 2001 From: Max Okumoto Date: Sun, 15 May 2005 17:49:29 +0000 Subject: [PATCH] Move print_flags() back into utils. Since harti decided to start working on it after I moved it. --- usr.bin/make/GNode.h | 3 ++- usr.bin/make/suff.c | 28 +--------------------------- usr.bin/make/util.c | 22 +++++++++++++++++++++- usr.bin/make/util.h | 8 +++++++- 4 files changed, 31 insertions(+), 30 deletions(-) diff --git a/usr.bin/make/GNode.h b/usr.bin/make/GNode.h index bf044a0887..0be0a04540 100644 --- a/usr.bin/make/GNode.h +++ b/usr.bin/make/GNode.h @@ -35,13 +35,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/usr.bin/make/GNode.h,v 1.5 2005/05/05 09:06:23 okumoto Exp $ + * $DragonFly: src/usr.bin/make/GNode.h,v 1.6 2005/05/15 17:49:29 okumoto Exp $ */ #ifndef GNode_h_39503bf2 #define GNode_h_39503bf2 #include "lst.h" +#include "util.h" struct Suff; diff --git a/usr.bin/make/suff.c b/usr.bin/make/suff.c index bc684c9cf3..af1242a22b 100644 --- a/usr.bin/make/suff.c +++ b/usr.bin/make/suff.c @@ -37,7 +37,7 @@ * * @(#)suff.c 8.4 (Berkeley) 3/21/94 * $FreeBSD: src/usr.bin/make/suff.c,v 1.43 2005/02/04 13:23:39 harti Exp $ - * $DragonFly: src/usr.bin/make/suff.c,v 1.55 2005/05/05 09:08:42 okumoto Exp $ + * $DragonFly: src/usr.bin/make/suff.c,v 1.56 2005/05/15 17:49:29 okumoto Exp $ */ /*- @@ -158,11 +158,6 @@ typedef struct Src { #endif } Src; -struct flag2str { - u_int flag; - const char *str; -}; - /* The NULL suffix for this run */ static Suff *suffNull; @@ -2160,27 +2155,6 @@ Suff_Init(void) /********************* DEBUGGING FUNCTIONS **********************/ -/* - * Convert a flag word to a printable thing and print it - */ -static void -print_flags(FILE *fp, const struct flag2str *tab, u_int flags) -{ - int first = 1; - - fprintf(fp, "("); - while (tab->str != NULL) { - if (flags & tab->flag) { - if (!first) - fprintf(fp, "|"); - first = 0; - fprintf(fp, "%s", tab->str); - } - tab++; - } - fprintf(fp, ")"); -} - void Suff_PrintAll(void) { diff --git a/usr.bin/make/util.c b/usr.bin/make/util.c index 2575e0be16..0deb1b5c86 100644 --- a/usr.bin/make/util.c +++ b/usr.bin/make/util.c @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/make/util.c,v 1.16 2005/02/04 13:23:39 harti Exp $ - * $DragonFly: src/usr.bin/make/util.c,v 1.21 2005/05/05 09:07:28 okumoto Exp $ + * $DragonFly: src/usr.bin/make/util.c,v 1.22 2005/05/15 17:49:29 okumoto Exp $ */ /*- @@ -279,3 +279,23 @@ eunlink(const char *file) return (unlink(file)); } +/* + * Convert a flag word to a printable thing and print it + */ +void +print_flags(FILE *fp, const struct flag2str *tab, u_int flags) +{ + int first = 1; + + fprintf(fp, "("); + while (tab->str != NULL) { + if (flags & tab->flag) { + if (!first) + fprintf(fp, "|"); + first = 0; + fprintf(fp, "%s", tab->str); + } + tab++; + } + fprintf(fp, ")"); +} diff --git a/usr.bin/make/util.h b/usr.bin/make/util.h index 1f06a3b033..9863624108 100644 --- a/usr.bin/make/util.h +++ b/usr.bin/make/util.h @@ -35,7 +35,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/usr.bin/make/util.h,v 1.9 2005/05/05 09:06:23 okumoto Exp $ + * $DragonFly: src/usr.bin/make/util.h,v 1.10 2005/05/15 17:49:29 okumoto Exp $ */ #ifndef util_h_b7020fdb @@ -62,6 +62,11 @@ typedef int ReturnStatus; #define CONCAT(a,b) a##b +struct flag2str { + u_int flag; + const char *str; +}; + /* * debug control: * There is one bit per module. It is up to the module what debug @@ -111,5 +116,6 @@ char *estrdup(const char *); void *emalloc(size_t); void *erealloc(void *, size_t); int eunlink(const char *); +void print_flags(FILE *, const struct flag2str *, u_int); #endif /* util_h_b7020fdb */ -- 2.41.0