--- src/usr.bin/make/suff.c 2005/04/28 18:50:57 1.53 +++ src/usr.bin/make/suff.c 2005/05/05 09:06:23 1.54 @@ -158,6 +158,11 @@ typedef struct Src { #endif } Src; +struct flag2str { + u_int flag; + const char *str; +}; + /* The NULL suffix for this run */ static Suff *suffNull; @@ -2157,6 +2162,27 @@ 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) {