summaryrefslogtreecommitdiff
path: root/usr.bin/make
diff options
context:
space:
mode:
authorrillig <rillig@NetBSD.org>2020-07-19 12:26:17 +0000
committerrillig <rillig@NetBSD.org>2020-07-19 12:26:17 +0000
commit61752e2e38f3ca4c2cfd2d424b922b7b183c4964 (patch)
tree0ce9bcd5b8da7d68f118d521e5622df1f656ecbd /usr.bin/make
parent3fdb8e2b801a59cfed8d90fc10f1af3fcf0af9f0 (diff)
make(1): rename Varf_Flags to VarEvalFlags
In var.c there are lots of different flag types. To make any accidental mixture obvious, each flag group gets its own prefix. The only flag group that is visible outside of var.c is concerned with evaluating variables, therefore the "e", which replaces the former "f" that probably just meant "flag".
Diffstat (limited to 'usr.bin/make')
-rw-r--r--usr.bin/make/arch.c14
-rw-r--r--usr.bin/make/compat.c8
-rw-r--r--usr.bin/make/cond.c16
-rw-r--r--usr.bin/make/for.c8
-rw-r--r--usr.bin/make/job.c12
-rw-r--r--usr.bin/make/main.c30
-rw-r--r--usr.bin/make/make.c8
-rw-r--r--usr.bin/make/meta.c20
-rw-r--r--usr.bin/make/nonints.h14
-rw-r--r--usr.bin/make/parse.c22
-rw-r--r--usr.bin/make/suff.c10
-rw-r--r--usr.bin/make/var.c86
12 files changed, 124 insertions, 124 deletions
diff --git a/usr.bin/make/arch.c b/usr.bin/make/arch.c
index 11d0bd22ae6..31d90fd3f21 100644
--- a/usr.bin/make/arch.c
+++ b/usr.bin/make/arch.c
@@ -1,4 +1,4 @@
-/* $NetBSD: arch.c,v 1.73 2020/07/03 08:02:55 rillig Exp $ */
+/* $NetBSD: arch.c,v 1.74 2020/07/19 12:26:17 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: arch.c,v 1.73 2020/07/03 08:02:55 rillig Exp $";
+static char rcsid[] = "$NetBSD: arch.c,v 1.74 2020/07/19 12:26:17 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94";
#else
-__RCSID("$NetBSD: arch.c,v 1.73 2020/07/03 08:02:55 rillig Exp $");
+__RCSID("$NetBSD: arch.c,v 1.74 2020/07/19 12:26:17 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -259,7 +259,7 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode *ctxt)
void *freeIt;
char *result;
- result = Var_Parse(cp, ctxt, VARF_UNDEFERR|VARF_WANTRES,
+ result = Var_Parse(cp, ctxt, VARE_UNDEFERR|VARE_WANTRES,
&length, &freeIt);
free(freeIt);
@@ -275,7 +275,7 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode *ctxt)
*cp++ = '\0';
if (subLibName) {
- libName = Var_Subst(NULL, libName, ctxt, VARF_UNDEFERR|VARF_WANTRES);
+ libName = Var_Subst(NULL, libName, ctxt, VARE_UNDEFERR|VARE_WANTRES);
}
@@ -301,7 +301,7 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode *ctxt)
void *freeIt;
char *result;
- result = Var_Parse(cp, ctxt, VARF_UNDEFERR|VARF_WANTRES,
+ result = Var_Parse(cp, ctxt, VARE_UNDEFERR|VARE_WANTRES,
&length, &freeIt);
free(freeIt);
@@ -356,7 +356,7 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode *ctxt)
size_t sz;
memName = Var_Subst(NULL, memName, ctxt,
- VARF_UNDEFERR|VARF_WANTRES);
+ VARE_UNDEFERR|VARE_WANTRES);
/*
* Now form an archive spec and recurse to deal with nested
diff --git a/usr.bin/make/compat.c b/usr.bin/make/compat.c
index 6941b7cfd58..dd9d63c2825 100644
--- a/usr.bin/make/compat.c
+++ b/usr.bin/make/compat.c
@@ -1,4 +1,4 @@
-/* $NetBSD: compat.c,v 1.113 2020/07/03 08:13:23 rillig Exp $ */
+/* $NetBSD: compat.c,v 1.114 2020/07/19 12:26:17 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: compat.c,v 1.113 2020/07/03 08:13:23 rillig Exp $";
+static char rcsid[] = "$NetBSD: compat.c,v 1.114 2020/07/19 12:26:17 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: compat.c,v 1.113 2020/07/03 08:13:23 rillig Exp $");
+__RCSID("$NetBSD: compat.c,v 1.114 2020/07/19 12:26:17 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -235,7 +235,7 @@ CompatRunCommand(void *cmdp, void *gnp)
doIt = FALSE;
cmdNode = Lst_Member(gn->commands, cmd);
- cmdStart = Var_Subst(NULL, cmd, gn, VARF_WANTRES);
+ cmdStart = Var_Subst(NULL, cmd, gn, VARE_WANTRES);
/*
* brk_string will return an argv with a NULL in av[0], thus causing
diff --git a/usr.bin/make/cond.c b/usr.bin/make/cond.c
index 321d9a92e75..871e3f4aaf7 100644
--- a/usr.bin/make/cond.c
+++ b/usr.bin/make/cond.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cond.c,v 1.79 2020/07/09 22:34:08 sjg Exp $ */
+/* $NetBSD: cond.c,v 1.80 2020/07/19 12:26:17 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: cond.c,v 1.79 2020/07/09 22:34:08 sjg Exp $";
+static char rcsid[] = "$NetBSD: cond.c,v 1.80 2020/07/19 12:26:17 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)cond.c 8.2 (Berkeley) 1/2/94";
#else
-__RCSID("$NetBSD: cond.c,v 1.79 2020/07/09 22:34:08 sjg Exp $");
+__RCSID("$NetBSD: cond.c,v 1.80 2020/07/19 12:26:17 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -287,8 +287,8 @@ CondGetArg(Boolean doEval, char **linePtr, char **argPtr, const char *func)
int len;
void *freeIt;
- cp2 = Var_Parse(cp, VAR_CMD, VARF_UNDEFERR|
- (doEval ? VARF_WANTRES : 0),
+ cp2 = Var_Parse(cp, VAR_CMD, VARE_UNDEFERR|
+ (doEval ? VARE_WANTRES : 0),
&len, &freeIt);
Buf_AddBytes(&buf, strlen(cp2), cp2);
free(freeIt);
@@ -574,8 +574,8 @@ CondGetString(Boolean doEval, Boolean *quoted, void **freeIt, Boolean strictLHS)
case '$':
/* if we are in quotes, then an undefined variable is ok */
str = Var_Parse(condExpr, VAR_CMD,
- ((!qt && doEval) ? VARF_UNDEFERR : 0) |
- (doEval ? VARF_WANTRES : 0), &len, freeIt);
+ ((!qt && doEval) ? VARE_UNDEFERR : 0) |
+ (doEval ? VARE_WANTRES : 0), &len, freeIt);
if (str == var_Error) {
if (*freeIt) {
free(*freeIt);
@@ -830,7 +830,7 @@ get_mpt_arg(Boolean doEval, char **linePtr, char **argPtr, const char *func MAKE
/* We do all the work here and return the result as the length */
*argPtr = NULL;
- val = Var_Parse(cp - 1, VAR_CMD, doEval ? VARF_WANTRES : 0, &length, &freeIt);
+ val = Var_Parse(cp - 1, VAR_CMD, doEval ? VARE_WANTRES : 0, &length, &freeIt);
/*
* Advance *linePtr to beyond the closing ). Note that
* we subtract one because 'length' is calculated from 'cp - 1'.
diff --git a/usr.bin/make/for.c b/usr.bin/make/for.c
index f20a0f58b06..c55c9d1290e 100644
--- a/usr.bin/make/for.c
+++ b/usr.bin/make/for.c
@@ -1,4 +1,4 @@
-/* $NetBSD: for.c,v 1.54 2020/07/03 08:13:23 rillig Exp $ */
+/* $NetBSD: for.c,v 1.55 2020/07/19 12:26:17 rillig Exp $ */
/*
* Copyright (c) 1992, The Regents of the University of California.
@@ -30,14 +30,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: for.c,v 1.54 2020/07/03 08:13:23 rillig Exp $";
+static char rcsid[] = "$NetBSD: for.c,v 1.55 2020/07/19 12:26:17 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)for.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: for.c,v 1.54 2020/07/03 08:13:23 rillig Exp $");
+__RCSID("$NetBSD: for.c,v 1.55 2020/07/19 12:26:17 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -216,7 +216,7 @@ For_Eval(char *line)
* We can't do the escapes here - because we don't know whether
* we are substuting into ${...} or $(...).
*/
- sub = Var_Subst(NULL, ptr, VAR_GLOBAL, VARF_WANTRES);
+ sub = Var_Subst(NULL, ptr, VAR_GLOBAL, VARE_WANTRES);
/*
* Split into words allowing for quoted strings.
diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c
index 328a9916426..7a0bfbd02a0 100644
--- a/usr.bin/make/job.c
+++ b/usr.bin/make/job.c
@@ -1,4 +1,4 @@
-/* $NetBSD: job.c,v 1.201 2020/07/03 08:13:23 rillig Exp $ */
+/* $NetBSD: job.c,v 1.202 2020/07/19 12:26:17 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: job.c,v 1.201 2020/07/03 08:13:23 rillig Exp $";
+static char rcsid[] = "$NetBSD: job.c,v 1.202 2020/07/19 12:26:17 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: job.c,v 1.201 2020/07/03 08:13:23 rillig Exp $");
+__RCSID("$NetBSD: job.c,v 1.202 2020/07/19 12:26:17 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -729,7 +729,7 @@ JobPrintCommand(void *cmdp, void *jobp)
numCommands += 1;
- cmdStart = cmd = Var_Subst(NULL, cmd, job->node, VARF_WANTRES);
+ cmdStart = cmd = Var_Subst(NULL, cmd, job->node, VARE_WANTRES);
cmdTemplate = "%s\n";
@@ -917,7 +917,7 @@ JobPrintCommand(void *cmdp, void *jobp)
static int
JobSaveCommand(void *cmd, void *gn)
{
- cmd = Var_Subst(NULL, (char *)cmd, (GNode *)gn, VARF_WANTRES);
+ cmd = Var_Subst(NULL, (char *)cmd, (GNode *)gn, VARE_WANTRES);
(void)Lst_AtEnd(postCommands->commands, cmd);
return 0;
}
@@ -2249,7 +2249,7 @@ Job_SetPrefix(void)
}
targPrefix = Var_Subst(NULL, "${" MAKE_JOB_PREFIX "}",
- VAR_GLOBAL, VARF_WANTRES);
+ VAR_GLOBAL, VARE_WANTRES);
}
/*-
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c
index e986192a1b3..32cc18695f0 100644
--- a/usr.bin/make/main.c
+++ b/usr.bin/make/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.280 2020/07/18 21:37:38 sjg Exp $ */
+/* $NetBSD: main.c,v 1.281 2020/07/19 12:26:17 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: main.c,v 1.280 2020/07/18 21:37:38 sjg Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.281 2020/07/19 12:26:17 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
@@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993\
#if 0
static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: main.c,v 1.280 2020/07/18 21:37:38 sjg Exp $");
+__RCSID("$NetBSD: main.c,v 1.281 2020/07/19 12:26:17 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -772,7 +772,7 @@ Main_SetVarObjdir(const char *var, const char *suffix)
/* expand variable substitutions */
if (strchr(path, '$') != 0)
- xpath = Var_Subst(NULL, path, VAR_GLOBAL, VARF_WANTRES);
+ xpath = Var_Subst(NULL, path, VAR_GLOBAL, VARE_WANTRES);
else
xpath = path;
@@ -839,7 +839,7 @@ MakeMode(const char *mode)
if (!mode)
mode = mp = Var_Subst(NULL, "${" MAKE_MODE ":tl}",
- VAR_GLOBAL, VARF_WANTRES);
+ VAR_GLOBAL, VARE_WANTRES);
if (mode && *mode) {
if (strstr(mode, "compat")) {
@@ -876,7 +876,7 @@ doPrintVars(void)
if (strchr(var, '$')) {
value = p1 = Var_Subst(NULL, var, VAR_GLOBAL,
- VARF_WANTRES);
+ VARE_WANTRES);
} else if (expandVars) {
char tmp[128];
int len = snprintf(tmp, sizeof(tmp), "${%s}", var);
@@ -885,7 +885,7 @@ doPrintVars(void)
Fatal("%s: variable name too big: %s",
progname, var);
value = p1 = Var_Subst(NULL, tmp, VAR_GLOBAL,
- VARF_WANTRES);
+ VARE_WANTRES);
} else {
value = Var_Value(var, VAR_GLOBAL, &p1);
}
@@ -1349,7 +1349,7 @@ main(int argc, char **argv)
(char *)Lst_Datum(ln));
} else {
p1 = Var_Subst(NULL, "${" MAKEFILE_PREFERENCE "}",
- VAR_CMD, VARF_WANTRES);
+ VAR_CMD, VARE_WANTRES);
if (p1) {
(void)str2Lst_Append(makefiles, p1, NULL);
(void)Lst_Find(makefiles, NULL, ReadMakefile);
@@ -1360,7 +1360,7 @@ main(int argc, char **argv)
/* In particular suppress .depend for '-r -V .OBJDIR -f /dev/null' */
if (!noBuiltins || !printVars) {
makeDependfile = Var_Subst(NULL, "${.MAKE.DEPENDFILE:T}",
- VAR_CMD, VARF_WANTRES);
+ VAR_CMD, VARE_WANTRES);
doing_depend = TRUE;
(void)ReadMakefile(makeDependfile, NULL);
doing_depend = FALSE;
@@ -1379,7 +1379,7 @@ main(int argc, char **argv)
char *value;
int n;
- value = Var_Subst(NULL, "${.MAKE.JOBS}", VAR_GLOBAL, VARF_WANTRES);
+ value = Var_Subst(NULL, "${.MAKE.JOBS}", VAR_GLOBAL, VARE_WANTRES);
n = strtol(value, NULL, 0);
if (n < 1) {
(void)fprintf(stderr, "%s: illegal value for .MAKE.JOBS -- must be positive integer!\n",
@@ -1429,7 +1429,7 @@ main(int argc, char **argv)
*/
static char VPATH[] = "${VPATH}";
- vpath = Var_Subst(NULL, VPATH, VAR_CMD, VARF_WANTRES);
+ vpath = Var_Subst(NULL, VPATH, VAR_CMD, VARE_WANTRES);
path = vpath;
do {
/* skip to end of directory */
@@ -2063,7 +2063,7 @@ PrintOnError(GNode *gn, const char *s)
}
strncpy(tmp, "${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'\n@}",
sizeof(tmp) - 1);
- cp = Var_Subst(NULL, tmp, VAR_GLOBAL, VARF_WANTRES);
+ cp = Var_Subst(NULL, tmp, VAR_GLOBAL, VARE_WANTRES);
if (cp) {
if (*cp)
printf("%s", cp);
@@ -2094,7 +2094,7 @@ Main_ExportMAKEFLAGS(Boolean first)
strncpy(tmp, "${.MAKEFLAGS} ${.MAKEOVERRIDES:O:u:@v@$v=${$v:Q}@}",
sizeof(tmp));
- s = Var_Subst(NULL, tmp, VAR_CMD, VARF_WANTRES);
+ s = Var_Subst(NULL, tmp, VAR_CMD, VARE_WANTRES);
if (s && *s) {
#ifdef POSIX
setenv("MAKEFLAGS", s, 1);
@@ -2117,7 +2117,7 @@ getTmpdir(void)
* Ensure it ends with /.
*/
tmpdir = Var_Subst(NULL, "${TMPDIR:tA:U" _PATH_TMP "}/", VAR_GLOBAL,
- VARF_WANTRES);
+ VARE_WANTRES);
if (stat(tmpdir, &st) < 0 || !S_ISDIR(st.st_mode)) {
free(tmpdir);
tmpdir = bmake_strdup(_PATH_TMP);
@@ -2210,7 +2210,7 @@ getBoolean(const char *name, Boolean bf)
char *cp;
if (snprintf(tmp, sizeof(tmp), "${%s:U:tl}", name) < (int)(sizeof(tmp))) {
- cp = Var_Subst(NULL, tmp, VAR_GLOBAL, VARF_WANTRES);
+ cp = Var_Subst(NULL, tmp, VAR_GLOBAL, VARE_WANTRES);
if (cp) {
bf = s2Boolean(cp, bf);
diff --git a/usr.bin/make/make.c b/usr.bin/make/make.c
index 9472a045c26..3ed1f94be01 100644
--- a/usr.bin/make/make.c
+++ b/usr.bin/make/make.c
@@ -1,4 +1,4 @@
-/* $NetBSD: make.c,v 1.99 2020/07/03 08:13:23 rillig Exp $ */
+/* $NetBSD: make.c,v 1.100 2020/07/19 12:26:17 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: make.c,v 1.99 2020/07/03 08:13:23 rillig Exp $";
+static char rcsid[] = "$NetBSD: make.c,v 1.100 2020/07/19 12:26:17 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)make.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: make.c,v 1.99 2020/07/03 08:13:23 rillig Exp $");
+__RCSID("$NetBSD: make.c,v 1.100 2020/07/19 12:26:17 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -484,7 +484,7 @@ Make_HandleUse(GNode *cgn, GNode *pgn)
} else {
free(gn->name);
}
- gn->name = Var_Subst(NULL, gn->uname, pgn, VARF_WANTRES);
+ gn->name = Var_Subst(NULL, gn->uname, pgn, VARE_WANTRES);
if (gn->name && gn->uname && strcmp(gn->name, gn->uname) != 0) {
/* See if we have a target for this node. */
tgn = Targ_FindNode(gn->name, TARG_NOCREATE);
diff --git a/usr.bin/make/meta.c b/usr.bin/make/meta.c
index 434b1e7f194..676c8c4e9f4 100644
--- a/usr.bin/make/meta.c
+++ b/usr.bin/make/meta.c
@@ -1,4 +1,4 @@
-/* $NetBSD: meta.c,v 1.86 2020/07/11 00:39:53 sjg Exp $ */
+/* $NetBSD: meta.c,v 1.87 2020/07/19 12:26:17 rillig Exp $ */
/*
* Implement 'meta' mode.
@@ -329,7 +329,7 @@ is_submake(void *cmdp, void *gnp)
}
cp = strchr(cmd, '$');
if ((cp)) {
- mp = Var_Subst(NULL, cmd, gn, VARF_WANTRES);
+ mp = Var_Subst(NULL, cmd, gn, VARE_WANTRES);
cmd = mp;
}
cp2 = strstr(cmd, p_make);
@@ -371,7 +371,7 @@ printCMD(void *cmdp, void *mfpp)
char *cp = NULL;
if (strchr(cmd, '$')) {
- cmd = cp = Var_Subst(NULL, cmd, mfp->gn, VARF_WANTRES);
+ cmd = cp = Var_Subst(NULL, cmd, mfp->gn, VARE_WANTRES);
}
fprintf(mfp->fp, "CMD %s\n", cmd);
free(cp);
@@ -484,7 +484,7 @@ meta_create(BuildMon *pbm, GNode *gn)
char *mp;
/* Describe the target we are building */
- mp = Var_Subst(NULL, "${" MAKE_META_PREFIX "}", gn, VARF_WANTRES);
+ mp = Var_Subst(NULL, "${" MAKE_META_PREFIX "}", gn, VARE_WANTRES);
if (*mp)
fprintf(stdout, "%s\n", mp);
free(mp);
@@ -627,7 +627,7 @@ meta_mode_init(const char *make_mode)
*/
metaBailiwick = Lst_Init(FALSE);
metaBailiwickStr = Var_Subst(NULL, "${.MAKE.META.BAILIWICK:O:u:tA}",
- VAR_GLOBAL, VARF_WANTRES);
+ VAR_GLOBAL, VARE_WANTRES);
if (metaBailiwickStr) {
str2Lst_Append(metaBailiwick, metaBailiwickStr, NULL);
}
@@ -639,7 +639,7 @@ meta_mode_init(const char *make_mode)
"/dev /etc /proc /tmp /var/run /var/tmp ${TMPDIR}", VAR_GLOBAL);
metaIgnorePathsStr = Var_Subst(NULL,
"${" MAKE_META_IGNORE_PATHS ":O:u:tA}", VAR_GLOBAL,
- VARF_WANTRES);
+ VARE_WANTRES);
if (metaIgnorePathsStr) {
str2Lst_Append(metaIgnorePaths, metaIgnorePathsStr, NULL);
}
@@ -819,7 +819,7 @@ meta_job_output(Job *job, char *cp, const char *nl)
char *cp2;
meta_prefix = Var_Subst(NULL, "${" MAKE_META_PREFIX "}",
- VAR_GLOBAL, VARF_WANTRES);
+ VAR_GLOBAL, VARE_WANTRES);
if ((cp2 = strchr(meta_prefix, '$')))
meta_prefix_len = cp2 - meta_prefix;
else
@@ -1016,7 +1016,7 @@ meta_ignore(GNode *gn, const char *p)
Var_Set(".p.", p, gn);
pm = Var_Subst(NULL,
"${" MAKE_META_IGNORE_PATTERNS ":@m@${.p.:M$m}@}",
- gn, VARF_WANTRES);
+ gn, VARE_WANTRES);
if (*pm) {
#ifdef DEBUG_META_MODE
if (DEBUG(META))
@@ -1036,7 +1036,7 @@ meta_ignore(GNode *gn, const char *p)
snprintf(fname, sizeof(fname),
"${%s:L:${%s:ts:}}",
p, MAKE_META_IGNORE_FILTER);
- fm = Var_Subst(NULL, fname, gn, VARF_WANTRES);
+ fm = Var_Subst(NULL, fname, gn, VARE_WANTRES);
if (*fm == '\0') {
#ifdef DEBUG_META_MODE
if (DEBUG(META))
@@ -1535,7 +1535,7 @@ meta_oodate(GNode *gn, Boolean oodate)
if (DEBUG(META))
fprintf(debug_file, "%s: %d: cannot compare command using .OODATE\n", fname, lineno);
}
- cmd = Var_Subst(NULL, cmd, gn, VARF_WANTRES|VARF_UNDEFERR);
+ cmd = Var_Subst(NULL, cmd, gn, VARE_WANTRES|VARE_UNDEFERR);
if ((cp = strchr(cmd, '\n'))) {
int n;
diff --git a/usr.bin/make/nonints.h b/usr.bin/make/nonints.h
index d9fb9b479b1..81d49056420 100644
--- a/usr.bin/make/nonints.h
+++ b/usr.bin/make/nonints.h
@@ -1,4 +1,4 @@
-/* $NetBSD: nonints.h,v 1.79 2020/07/19 09:26:18 rillig Exp $ */
+/* $NetBSD: nonints.h,v 1.80 2020/07/19 12:26:17 rillig Exp $ */
/*-
* Copyright (c) 1988, 1989, 1990, 1993
@@ -178,18 +178,18 @@ void Targ_Propagate_Wait(void);
/* var.c */
typedef enum {
- VARF_UNDEFERR = 1,
- VARF_WANTRES = 2,
- VARF_ASSIGN = 4
-} Varf_Flags;
+ VARE_UNDEFERR = 1,
+ VARE_WANTRES = 2,
+ VARE_ASSIGN = 4
+} VarEvalFlags;
void Var_Delete(const char *, GNode *);
void Var_Set(const char *, const char *, GNode *);
void Var_Append(const char *, const char *, GNode *);
Boolean Var_Exists(const char *, GNode *);
char *Var_Value(const char *, GNode *, char **);
-char *Var_Parse(const char *, GNode *, Varf_Flags, int *, void **);
-char *Var_Subst(const char *, const char *, GNode *, Varf_Flags);
+char *Var_Parse(const char *, GNode *, VarEvalFlags, int *, void **);
+char *Var_Subst(const char *, const char *, GNode *, VarEvalFlags);
char *Var_GetTail(const char *);
char *Var_GetHead(const char *);
void Var_Init(void);
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c
index 8ee3b47d538..90b135ae661 100644
--- a/usr.bin/make/parse.c
+++ b/usr.bin/make/parse.c
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.236 2020/07/03 08:13:23 rillig Exp $ */
+/* $NetBSD: parse.c,v 1.237 2020/07/19 12:26:17 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.236 2020/07/03 08:13:23 rillig Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.237 2020/07/19 12:26:17 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: parse.c,v 1.236 2020/07/03 08:13:23 rillig Exp $");
+__RCSID("$NetBSD: parse.c,v 1.237 2020/07/19 12:26:17 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -825,7 +825,7 @@ ParseMessage(char *line)
while (isspace((unsigned char)*line))
line++;
- line = Var_Subst(NULL, line, VAR_CMD, VARF_WANTRES);
+ line = Var_Subst(NULL, line, VAR_CMD, VARE_WANTRES);
Parse_Error(mtype, "%s", line);
free(line);
@@ -1242,7 +1242,7 @@ ParseDoDependency(char *line)
int length;
void *freeIt;
- (void)Var_Parse(cp, VAR_CMD, VARF_UNDEFERR|VARF_WANTRES,
+ (void)Var_Parse(cp, VAR_CMD, VARE_UNDEFERR|VARE_WANTRES,
&length, &freeIt);
free(freeIt);
cp += length-1;
@@ -1967,7 +1967,7 @@ Parse_DoVar(char *line, GNode *ctxt)
if (!Var_Exists(line, ctxt))
Var_Set(line, "", ctxt);
- cp = Var_Subst(NULL, cp, ctxt, VARF_WANTRES|VARF_ASSIGN);
+ cp = Var_Subst(NULL, cp, ctxt, VARE_WANTRES|VARE_ASSIGN);
oldVars = oldOldVars;
freeCp = TRUE;
@@ -1982,7 +1982,7 @@ Parse_DoVar(char *line, GNode *ctxt)
* expansion on the whole thing. The resulting string will need
* freeing when we're done, so set freeCmd to TRUE.
*/
- cp = Var_Subst(NULL, cp, VAR_CMD, VARF_UNDEFERR|VARF_WANTRES);
+ cp = Var_Subst(NULL, cp, VAR_CMD, VARE_UNDEFERR|VARE_WANTRES);
freeCp = TRUE;
}
@@ -2323,7 +2323,7 @@ ParseDoInclude(char *line)
* Substitute for any variables in the file name before trying to
* find the thing.
*/
- file = Var_Subst(NULL, file, VAR_CMD, VARF_WANTRES);
+ file = Var_Subst(NULL, file, VAR_CMD, VARE_WANTRES);
Parse_include_file(file, endc == '>', (*line == 'd'), silent);
free(file);
@@ -2617,7 +2617,7 @@ ParseTraditionalInclude(char *line)
* Substitute for any variables in the file name before trying to
* find the thing.
*/
- all_files = Var_Subst(NULL, file, VAR_CMD, VARF_WANTRES);
+ all_files = Var_Subst(NULL, file, VAR_CMD, VARE_WANTRES);
if (*file == '\0') {
Parse_Error(PARSE_FATAL,
@@ -2686,7 +2686,7 @@ ParseGmakeExport(char *line)
/*
* Expand the value before putting it in the environment.
*/
- value = Var_Subst(NULL, value, VAR_CMD, VARF_WANTRES);
+ value = Var_Subst(NULL, value, VAR_CMD, VARE_WANTRES);
setenv(variable, value, 1);
free(value);
}
@@ -3230,7 +3230,7 @@ Parse_File(const char *name, int fd)
* variables expanded before being parsed. Tell the variable
* module to complain if some variable is undefined...
*/
- line = Var_Subst(NULL, line, VAR_CMD, VARF_UNDEFERR|VARF_WANTRES);
+ line = Var_Subst(NULL, line, VAR_CMD, VARE_UNDEFERR|VARE_WANTRES);
/*
* Need a non-circular list for the target nodes
diff --git a/usr.bin/make/suff.c b/usr.bin/make/suff.c
index 5a40b73d788..4c6d779320a 100644
--- a/usr.bin/make/suff.c
+++ b/usr.bin/make/suff.c
@@ -1,4 +1,4 @@
-/* $NetBSD: suff.c,v 1.88 2020/07/03 08:02:55 rillig Exp $ */
+/* $NetBSD: suff.c,v 1.89 2020/07/19 12:26:17 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: suff.c,v 1.88 2020/07/03 08:02:55 rillig Exp $";
+static char rcsid[] = "$NetBSD: suff.c,v 1.89 2020/07/19 12:26:17 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94";
#else
-__RCSID("$NetBSD: suff.c,v 1.88 2020/07/03 08:02:55 rillig Exp $");
+__RCSID("$NetBSD: suff.c,v 1.89 2020/07/19 12:26:17 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -1557,7 +1557,7 @@ SuffExpandChildren(LstNode cln, GNode *pgn)
if (DEBUG(SUFF)) {
fprintf(debug_file, "Expanding \"%s\"...", cgn->name);
}
- cp = Var_Subst(NULL, cgn->name, pgn, VARF_UNDEFERR|VARF_WANTRES);
+ cp = Var_Subst(NULL, cgn->name, pgn, VARE_UNDEFERR|VARE_WANTRES);
if (cp != NULL) {
Lst members = Lst_Init(FALSE);
@@ -1610,7 +1610,7 @@ SuffExpandChildren(LstNode cln, GNode *pgn)
int len;
void *freeIt;
- junk = Var_Parse(cp, pgn, VARF_UNDEFERR|VARF_WANTRES,
+ junk = Var_Parse(cp, pgn, VARE_UNDEFERR|VARE_WANTRES,
&len, &freeIt);
if (junk != var_Error) {
cp += len - 1;
diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c
index 9a8727cc46b..c970da97b0f 100644
--- a/usr.bin/make/var.c
+++ b/usr.bin/make/var.c
@@ -1,4 +1,4 @@
-/* $NetBSD: var.c,v 1.258 2020/07/19 10:38:02 rillig Exp $ */
+/* $NetBSD: var.c,v 1.259 2020/07/19 12:26:17 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.258 2020/07/19 10:38:02 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.259 2020/07/19 12:26:17 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: var.c,v 1.258 2020/07/19 10:38:02 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.259 2020/07/19 12:26:17 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -153,7 +153,7 @@ char **savedEnv = NULL;
char var_Error[] = "";
/*
- * Similar to var_Error, but returned when the 'VARF_UNDEFERR' flag for
+ * Similar to var_Error, but returned when the 'VARE_UNDEFERR' flag for
* Var_Parse is not set. Why not just use a constant? Well, gcc likes
* to condense identical string instances...
*/
@@ -277,7 +277,7 @@ typedef struct {
int tvarLen;
char *str; /* string to expand */
int strLen;
- Varf_Flags flags;
+ VarEvalFlags flags;
} VarLoop;
#ifndef NO_REGEX
@@ -513,7 +513,7 @@ Var_Delete(const char *name, GNode *ctxt)
char *cp;
if (strchr(name, '$') != NULL) {
- cp = Var_Subst(NULL, name, VAR_GLOBAL, VARF_WANTRES);
+ cp = Var_Subst(NULL, name, VAR_GLOBAL, VARE_WANTRES);
} else {
cp = UNCONST(name);
}
@@ -601,7 +601,7 @@ Var_Export1(const char *name, int flags)
}
n = snprintf(tmp, sizeof(tmp), "${%s}", name);
if (n < (int)sizeof(tmp)) {
- val = Var_Subst(NULL, tmp, VAR_GLOBAL, VARF_WANTRES);
+ val = Var_Subst(NULL, tmp, VAR_GLOBAL, VARE_WANTRES);
setenv(name, val, 1);
free(val);
}
@@ -666,7 +666,7 @@ Var_ExportVars(void)
int ac;
int i;
- val = Var_Subst(NULL, tmp, VAR_GLOBAL, VARF_WANTRES);
+ val = Var_Subst(NULL, tmp, VAR_GLOBAL, VARE_WANTRES);
if (*val) {
av = brk_string(val, &ac, FALSE, &as);
for (i = 0; i < ac; i++)
@@ -708,7 +708,7 @@ Var_Export(char *str, int isExport)
} else {
flags |= VAR_EXPORT_PARENT;
}
- val = Var_Subst(NULL, str, VAR_GLOBAL, VARF_WANTRES);
+ val = Var_Subst(NULL, str, VAR_GLOBAL, VARE_WANTRES);
if (*val) {
av = brk_string(val, &ac, FALSE, &as);
for (i = 0; i < ac; i++) {
@@ -797,7 +797,7 @@ Var_UnExport(char *str)
if (!vlist) {
/* Using .MAKE.EXPORTED */
vlist = Var_Subst(NULL, "${" MAKE_EXPORTED ":O:u}", VAR_GLOBAL,
- VARF_WANTRES);
+ VARE_WANTRES);
}
if (vlist) {
Var *v;
@@ -827,7 +827,7 @@ Var_UnExport(char *str)
n = snprintf(tmp, sizeof(tmp),
"${" MAKE_EXPORTED ":N%s}", v->name);
if (n < (int)sizeof(tmp)) {
- cp = Var_Subst(NULL, tmp, VAR_GLOBAL, VARF_WANTRES);
+ cp = Var_Subst(NULL, tmp, VAR_GLOBAL, VARE_WANTRES);
Var_Set(MAKE_EXPORTED, cp, VAR_GLOBAL);
free(cp);
}
@@ -855,7 +855,7 @@ Var_Set_with_flags(const char *name, const char *val, GNode *ctxt,
* point in searching them all just to save a bit of memory...
*/
if (strchr(name, '$') != NULL) {
- expanded_name = Var_Subst(NULL, name, ctxt, VARF_WANTRES);
+ expanded_name = Var_Subst(NULL, name, ctxt, VARE_WANTRES);
if (expanded_name[0] == '\0') {
if (DEBUG(VAR)) {
fprintf(debug_file, "Var_Set(\"%s\", \"%s\", ...) "
@@ -998,7 +998,7 @@ Var_Append(const char *name, const char *val, GNode *ctxt)
char *expanded_name = NULL;
if (strchr(name, '$') != NULL) {
- expanded_name = Var_Subst(NULL, name, ctxt, VARF_WANTRES);
+ expanded_name = Var_Subst(NULL, name, ctxt, VARE_WANTRES);
if (expanded_name[0] == '\0') {
if (DEBUG(VAR)) {
fprintf(debug_file, "Var_Append(\"%s\", \"%s\", ...) "
@@ -1063,7 +1063,7 @@ Var_Exists(const char *name, GNode *ctxt)
char *cp;
if ((cp = strchr(name, '$')) != NULL)
- cp = Var_Subst(NULL, name, ctxt, VARF_WANTRES);
+ cp = Var_Subst(NULL, name, ctxt, VARE_WANTRES);
v = VarFind(cp ? cp : name, ctxt, FIND_CMD|FIND_GLOBAL|FIND_ENV);
free(cp);
if (v == NULL)
@@ -1321,7 +1321,7 @@ VarSYSVMatch(GNode *ctx, Var_Parse_State *vpstate,
Buf_AddByte(buf, vpstate->varSpace);
if ((ptr = Str_SYSVMatch(word, pat->lhs, &len, &hasPercent)) != NULL) {
- char *varexp = Var_Subst(NULL, pat->rhs, ctx, VARF_WANTRES);
+ char *varexp = Var_Subst(NULL, pat->rhs, ctx, VARE_WANTRES);
Str_SYSVSubst(buf, varexp, ptr, len, hasPercent);
free(varexp);
} else {
@@ -2049,7 +2049,7 @@ VarGetPattern(GNode *ctxt, Var_Parse_State *vpstate MAKE_ATTR_UNUSED,
char *rstr;
Buffer buf;
int junk;
- int errnum = flags & VARF_UNDEFERR;
+ int errnum = flags & VARE_UNDEFERR;
Buf_Init(&buf, 0);
if (length == NULL)
@@ -2090,7 +2090,7 @@ VarGetPattern(GNode *ctxt, Var_Parse_State *vpstate MAKE_ATTR_UNUSED,
* delimiter, assume it's a variable
* substitution and recurse.
*/
- cp2 = Var_Parse(cp, ctxt, errnum | (flags & VARF_WANTRES),
+ cp2 = Var_Parse(cp, ctxt, errnum | (flags & VARE_WANTRES),
&len, &freeIt);
Buf_AddBytes(&buf, strlen(cp2), cp2);
free(freeIt);
@@ -2337,7 +2337,7 @@ ApplyModifier_At(ApplyModifiersState *st) {
st->termc = *st->cp;
st->delim = '\0';
- loop.flags = st->flags & (VARF_UNDEFERR | VARF_WANTRES);
+ loop.flags = st->flags & (VARE_UNDEFERR | VARE_WANTRES);
loop.ctxt = st->ctxt;
st->newStr = VarModify(
st->ctxt, &st->parsestate, st->nstr, VarLoopExpand, &loop);
@@ -2354,15 +2354,15 @@ ApplyModifier_Defined(ApplyModifiersState *st)
Buffer buf; /* Buffer for patterns */
int nflags;
- if (st->flags & VARF_WANTRES) {
+ if (st->flags & VARE_WANTRES) {
int wantres;
if (*st->tstr == 'U')
wantres = ((st->v->flags & VAR_JUNK) != 0);
else
wantres = ((st->v->flags & VAR_JUNK) == 0);
- nflags = st->flags & ~VARF_WANTRES;
+ nflags = st->flags & ~VARE_WANTRES;
if (wantres)
- nflags |= VARF_WANTRES;
+ nflags |= VARE_WANTRES;
} else
nflags = st->flags;
@@ -2404,7 +2404,7 @@ ApplyModifier_Defined(ApplyModifiersState *st)
if (st->v->flags & VAR_JUNK)
st->v->flags |= VAR_KEEP;
- if (nflags & VARF_WANTRES) {
+ if (nflags & VARE_WANTRES) {
st->newStr = Buf_Destroy(&buf, FALSE);
} else {
st->newStr = st->nstr;
@@ -2509,7 +2509,7 @@ ApplyModifier_Exclam(ApplyModifiersState *st)
NULL, &pattern.rightLen, NULL);
if (pattern.rhs == NULL)
return FALSE;
- if (st->flags & VARF_WANTRES)
+ if (st->flags & VARE_WANTRES)
st->newStr = Cmd_Exec(pattern.rhs, &emsg);
else
st->newStr = varNoError;
@@ -3048,7 +3048,7 @@ ApplyModifier_IfElse(ApplyModifiersState *st)
VarPattern_Flags then_flags, else_flags;
/* find ':', and then substitute accordingly */
- if (st->flags & VARF_WANTRES) {
+ if (st->flags & VARE_WANTRES) {
cond_rc = Cond_EvalExpression(NULL, st->v->name, &value, 0, FALSE);
then_flags = cond_rc != COND_INVALID && value ? 0 : VAR_NOSUBST;
else_flags = cond_rc != COND_INVALID && !value ? 0 : VAR_NOSUBST;
@@ -3144,7 +3144,7 @@ ApplyModifier_Assign(ApplyModifiersState *st)
st->delim = st->startc == PROPEN ? PRCLOSE : BRCLOSE;
pattern.flags = 0;
- vflags = (st->flags & VARF_WANTRES) ? 0 : VAR_NOSUBST;
+ vflags = (st->flags & VARE_WANTRES) ? 0 : VAR_NOSUBST;
pattern.rhs = VarGetPattern(
st->ctxt, &st->parsestate, st->flags, &st->cp, st->delim,
&vflags, &pattern.rightLen, NULL);
@@ -3159,7 +3159,7 @@ ApplyModifier_Assign(ApplyModifiersState *st)
st->termc = *--st->cp;
st->delim = '\0';
- if (st->flags & VARF_WANTRES) {
+ if (st->flags & VARE_WANTRES) {
switch (how) {
case '+':
Var_Append(st->v->name, pattern.rhs, v_ctxt);
@@ -3417,7 +3417,7 @@ ApplyModifiers(char *nstr, const char *tstr,
st.nstr = ApplyModifiers(st.nstr, rval, 0, 0, st.v,
st.ctxt, st.flags, &used, st.freePtr);
if (st.nstr == var_Error
- || (st.nstr == varNoError && (st.flags & VARF_UNDEFERR) == 0)
+ || (st.nstr == varNoError && (st.flags & VARE_UNDEFERR) == 0)
|| strlen(rval) != (size_t) used) {
free(freeIt);
goto out; /* error already reported */
@@ -3586,7 +3586,7 @@ ApplyModifiers(char *nstr, const char *tstr,
case 's':
if (st.tstr[1] == 'h' && (st.tstr[2] == st.endc || st.tstr[2] == ':')) {
const char *emsg;
- if (st.flags & VARF_WANTRES) {
+ if (st.flags & VARE_WANTRES) {
st.newStr = Cmd_Exec(st.nstr, &emsg);
if (emsg)
Error(emsg, st.nstr);
@@ -3671,9 +3671,9 @@ cleanup:
* Input:
* str The string to parse
* ctxt The context for the variable
- * flags VARF_UNDEFERR if undefineds are an error
- * VARF_WANTRES if we actually want the result
- * VARF_ASSIGN if we are in a := assignment
+ * flags VARE_UNDEFERR if undefineds are an error
+ * VARE_WANTRES if we actually want the result
+ * VARE_ASSIGN if we are in a := assignment
* lengthPtr OUT: The length of the specification
* freePtr OUT: Non-NULL if caller should free *freePtr
*
@@ -3692,7 +3692,7 @@ cleanup:
*/
/* coverity[+alloc : arg-*4] */
char *
-Var_Parse(const char *str, GNode *ctxt, Varf_Flags flags,
+Var_Parse(const char *str, GNode *ctxt, VarEvalFlags flags,
int *lengthPtr, void **freePtr)
{
const char *tstr; /* Pointer into str */
@@ -3758,7 +3758,7 @@ Var_Parse(const char *str, GNode *ctxt, Varf_Flags flags,
return UNCONST("$(.ARCHIVE)");
}
}
- return (flags & VARF_UNDEFERR) ? var_Error : varNoError;
+ return (flags & VARE_UNDEFERR) ? var_Error : varNoError;
} else {
haveModifier = FALSE;
tstr = &str[1];
@@ -3896,7 +3896,7 @@ Var_Parse(const char *str, GNode *ctxt, Varf_Flags flags,
return pstr;
} else {
Buf_Destroy(&buf, TRUE);
- return (flags & VARF_UNDEFERR) ? var_Error : varNoError;
+ return (flags & VARE_UNDEFERR) ? var_Error : varNoError;
}
} else {
/*
@@ -3929,7 +3929,7 @@ Var_Parse(const char *str, GNode *ctxt, Varf_Flags flags,
* return.
*/
nstr = Buf_GetAll(&v->val, NULL);
- if (strchr(nstr, '$') != NULL && (flags & VARF_WANTRES) != 0) {
+ if (strchr(nstr, '$') != NULL && (flags & VARE_WANTRES) != 0) {
nstr = Var_Subst(NULL, nstr, ctxt, flags);
*freePtr = nstr;
}
@@ -3988,7 +3988,7 @@ Var_Parse(const char *str, GNode *ctxt, Varf_Flags flags,
nstr = bmake_strndup(start, *lengthPtr);
*freePtr = nstr;
} else {
- nstr = (flags & VARF_UNDEFERR) ? var_Error : varNoError;
+ nstr = (flags & VARE_UNDEFERR) ? var_Error : varNoError;
}
}
if (nstr != Buf_GetAll(&v->val, NULL))
@@ -4003,16 +4003,16 @@ Var_Parse(const char *str, GNode *ctxt, Varf_Flags flags,
*-----------------------------------------------------------------------
* Var_Subst --
* Substitute for all variables in the given string in the given context.
- * If flags & VARF_UNDEFERR, Parse_Error will be called when an undefined
+ * If flags & VARE_UNDEFERR, Parse_Error will be called when an undefined
* variable is encountered.
*
* Input:
* var Named variable || NULL for all
* str the string which to substitute
* ctxt the context wherein to find variables
- * flags VARF_UNDEFERR if undefineds are an error
- * VARF_WANTRES if we actually want the result
- * VARF_ASSIGN if we are in a := assignment
+ * flags VARE_UNDEFERR if undefineds are an error
+ * VARE_WANTRES if we actually want the result
+ * VARE_ASSIGN if we are in a := assignment
*
* Results:
* The resulting string.
@@ -4022,7 +4022,7 @@ Var_Parse(const char *str, GNode *ctxt, Varf_Flags flags,
*-----------------------------------------------------------------------
*/
char *
-Var_Subst(const char *var, const char *str, GNode *ctxt, Varf_Flags flags)
+Var_Subst(const char *var, const char *str, GNode *ctxt, VarEvalFlags flags)
{
Buffer buf; /* Buffer for forming things */
char *val; /* Value to substitute for a variable */
@@ -4046,7 +4046,7 @@ Var_Subst(const char *var, const char *str, GNode *ctxt, Varf_Flags flags)
* In such a case, we skip over the escape character and store the
* dollar sign into the buffer directly.
*/
- if (save_dollars && (flags & VARF_ASSIGN))
+ if (save_dollars && (flags & VARE_ASSIGN))
Buf_AddByte(&buf, *str);
str++;
Buf_AddByte(&buf, *str);
@@ -4134,7 +4134,7 @@ Var_Subst(const char *var, const char *str, GNode *ctxt, Varf_Flags flags)
*/
if (oldVars) {
str += length;
- } else if ((flags & VARF_UNDEFERR) || val == var_Error) {
+ } else if ((flags & VARE_UNDEFERR) || val == var_Error) {
/*
* If variable is undefined, complain and skip the
* variable. The complaint will stop us from doing anything