aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/make/util.c
diff options
context:
space:
mode:
authorHartmut Brandt <harti@FreeBSD.org>2005-03-11 13:24:08 +0000
committerHartmut Brandt <harti@FreeBSD.org>2005-03-11 13:24:08 +0000
commitc2d34cc331dbaaae52d689a69bd4a2da5013d504 (patch)
treed7a72118acaac8f01559518c6d55a24514af1049 /usr.bin/make/util.c
parentd64ac531acb0f81be1d56e10b36556e6689fbe19 (diff)
Notes
Diffstat (limited to 'usr.bin/make/util.c')
-rw-r--r--usr.bin/make/util.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/usr.bin/make/util.c b/usr.bin/make/util.c
index e0dbfdc7ffab5..70e814a126ee3 100644
--- a/usr.bin/make/util.c
+++ b/usr.bin/make/util.c
@@ -292,3 +292,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, ")");
+}