Move some debugging code from targ.c to var.c where it actually belongs.

Patch:		7.192
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
This commit is contained in:
harti 2005-05-10 08:14:26 +00:00
parent 59c2113e23
commit aa97603f28
3 changed files with 14 additions and 10 deletions

View File

@ -480,11 +480,7 @@ Targ_PrintGraph(int pass)
printf("#\t%s [%s]\n", gn->name,
gn->path ? gn->path : gn->name);
}
printf("#*** Global Variables:\n");
Var_Dump(VAR_GLOBAL);
printf("#*** Command-line Variables:\n");
Var_Dump(VAR_CMD);
Var_Dump();
printf("\n");
Dir_PrintDirectories();
printf("\n");

View File

@ -182,8 +182,8 @@ VarCreate(const char name[], const char value[], int flags)
* Destroy a Var object.
*
* Params:
* v Object to destroy.
* f True if internal buffer in Buffer object is to be removed.
* v Object to destroy.
* f True if internal buffer in Buffer object is to be removed.
*/
static void
VarDestroy(Var *v, Boolean f)
@ -2029,13 +2029,21 @@ Var_Init(char **env)
*-----------------------------------------------------------------------
*/
void
Var_Dump(const GNode *ctxt)
Var_Dump(void)
{
const LstNode *ln;
const Var *v;
LST_FOREACH(ln, &ctxt->context) {
printf("#*** Global Variables:\n");
LST_FOREACH(ln, &VAR_GLOBAL->context) {
v = Lst_Datum(ln);
printf("%-16s = %s\n", v->name, Buf_Data(v->val));
}
printf("#*** Command-line Variables:\n");
LST_FOREACH(ln, &VAR_CMD->context) {
v = Lst_Datum(ln);
printf("%-16s = %s\n", v->name, Buf_Data(v->val));
}
}

View File

@ -91,7 +91,7 @@ typedef Boolean VarModifyProc(const char *, Boolean, struct Buffer *, void *);
void VarREError(int, regex_t *, const char *);
void Var_Append(const char *, const char *, struct GNode *);
void Var_Delete(const char *, struct GNode *);
void Var_Dump(const struct GNode *);
void Var_Dump(void);
Boolean Var_Exists(const char *, struct GNode *);
void Var_Init(char **);
size_t Var_Match(const char [], struct GNode *);