summaryrefslogtreecommitdiffstats
path: root/usr.bin/make/var.h
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2005-02-02 07:36:18 +0000
committerharti <harti@FreeBSD.org>2005-02-02 07:36:18 +0000
commite55f5e8b6f4c9cf6b01f539144a14d2f9680e575 (patch)
tree4825321dce7848eb1b15bd084d39df490dcc822d /usr.bin/make/var.h
parent4130080e12ab49a659e616322a16e9db22726595 (diff)
downloadFreeBSD-src-e55f5e8b6f4c9cf6b01f539144a14d2f9680e575.zip
FreeBSD-src-e55f5e8b6f4c9cf6b01f539144a14d2f9680e575.tar.gz
Convert several typedefs from beeing pointers to structs to be the structs
itself. This will ease constification (think of what 'const Ptr foo' means if Ptr is a pointer to a struct). Submitted by: Max Okumoto <okumoto@ucsd.edu>
Diffstat (limited to 'usr.bin/make/var.h')
-rw-r--r--usr.bin/make/var.h63
1 files changed, 33 insertions, 30 deletions
diff --git a/usr.bin/make/var.h b/usr.bin/make/var.h
index a52e684..5802ce1 100644
--- a/usr.bin/make/var.h
+++ b/usr.bin/make/var.h
@@ -44,22 +44,25 @@
#include <regex.h>
-#include "buf.h"
#include "config.h"
struct GNode;
+struct Buffer;
typedef struct Var {
- char *name; /* the variable's name */
- Buffer val; /* its value */
- int flags; /* miscellaneous status flags */
-#define VAR_IN_USE 1 /* Variable's value currently being used.
- * Used to avoid recursion */
-#define VAR_FROM_ENV 2 /* Variable comes from the environment */
-#define VAR_JUNK 4 /* Variable is a junk variable that
- * should be destroyed when done with
- * it. Used by Var_Parse for undefined,
- * modified variables */
+ char *name; /* the variable's name */
+ struct Buffer *val; /* its value */
+ int flags; /* miscellaneous status flags */
+
+#define VAR_IN_USE 1 /* Variable's value currently being used.
+ * Used to avoid recursion */
+
+#define VAR_FROM_ENV 2 /* Variable comes from the environment */
+
+#define VAR_JUNK 4 /* Variable is a junk variable that
+ * should be destroyed when done with
+ * it. Used by Var_Parse for undefined,
+ * modified variables */
} Var;
/* Var*Pattern flags */
@@ -71,19 +74,19 @@ typedef struct Var {
#define VAR_NOSUBST 0x20 /* don't expand vars in VarGetPattern */
typedef struct {
- char *lhs; /* String to match */
- size_t leftLen; /* Length of string */
- char *rhs; /* Replacement string (w/ &'s removed) */
- size_t rightLen; /* Length of replacement */
- int flags;
+ char *lhs; /* String to match */
+ size_t leftLen; /* Length of string */
+ char *rhs; /* Replacement string (w/ &'s removed) */
+ size_t rightLen; /* Length of replacement */
+ int flags;
} VarPattern;
typedef struct {
- regex_t re;
- int nsub;
- regmatch_t *matches;
- char *replace;
- int flags;
+ regex_t re;
+ int nsub;
+ regmatch_t *matches;
+ char *replace;
+ int flags;
} VarREPattern;
/*
@@ -94,17 +97,17 @@ void VarREError(int, regex_t *, const char *);
/*
* var_modify.c
*/
-Boolean VarHead(const char *, Boolean, Buffer, void *);
-Boolean VarTail(const char *, Boolean, Buffer, void *);
-Boolean VarSuffix(const char *, Boolean, Buffer, void *);
-Boolean VarRoot(const char *, Boolean, Buffer, void *);
-Boolean VarMatch(const char *, Boolean, Buffer, void *);
+Boolean VarHead(const char *, Boolean, struct Buffer *, void *);
+Boolean VarTail(const char *, Boolean, struct Buffer *, void *);
+Boolean VarSuffix(const char *, Boolean, struct Buffer *, void *);
+Boolean VarRoot(const char *, Boolean, struct Buffer *, void *);
+Boolean VarMatch(const char *, Boolean, struct Buffer *, void *);
#ifdef SYSVVARSUB
-Boolean VarSYSVMatch(const char *, Boolean, Buffer, void *);
+Boolean VarSYSVMatch(const char *, Boolean, struct Buffer *, void *);
#endif
-Boolean VarNoMatch(const char *, Boolean, Buffer, void *);
-Boolean VarRESubstitute(const char *, Boolean, Buffer, void *);
-Boolean VarSubstitute(const char *, Boolean, Buffer, void *);
+Boolean VarNoMatch(const char *, Boolean, struct Buffer *, void *);
+Boolean VarRESubstitute(const char *, Boolean, struct Buffer *, void *);
+Boolean VarSubstitute(const char *, Boolean, struct Buffer *, void *);
void Var_Delete(char *, struct GNode *);
void Var_Set(char *, char *, struct GNode *);
OpenPOWER on IntegriCloud