diff options
author | harti <harti@FreeBSD.org> | 2005-05-18 14:50:35 +0000 |
---|---|---|
committer | harti <harti@FreeBSD.org> | 2005-05-18 14:50:35 +0000 |
commit | e6b2d317a96aecaf351b34c86989a87480496591 (patch) | |
tree | 3e8049c3572286310644109c58b11ff0e0ea83b4 /usr.bin/make/str.h | |
parent | c355fa8659de0fe742763123445875b6ae9bbd32 (diff) | |
download | FreeBSD-src-e6b2d317a96aecaf351b34c86989a87480496591.zip FreeBSD-src-e6b2d317a96aecaf351b34c86989a87480496591.tar.gz |
Get rid of global variables for argument vectors produced by brk_string()
introduce a struct that holds all the information about an argument
vector and pass that around.
Author: Max Okumoto <okumoto@ucsd.edu>
Obtained from: DragonFlyBSD
Diffstat (limited to 'usr.bin/make/str.h')
-rw-r--r-- | usr.bin/make/str.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/usr.bin/make/str.h b/usr.bin/make/str.h index b50ed6c..8f74f76 100644 --- a/usr.bin/make/str.h +++ b/usr.bin/make/str.h @@ -45,6 +45,18 @@ struct Buffer; +/** + * An array of c-strings. The pointers stored in argv, point to + * strings stored in buffer. + */ +typedef struct ArgArray { + int size; /* size of argv array */ + int argc; /* strings referenced in argv */ + char **argv; /* array of string pointers */ + size_t len; /* size of buffer */ + char *buffer; /* data buffer */ +} ArgArray; + /* * These constants are all used by the Str_Concat function to decide how the * final string should look. If STR_ADDSPACE is given, a space will be @@ -55,11 +67,12 @@ struct Buffer; #define STR_ADDSPACE 0x01 /* add a space when Str_Concat'ing */ #define STR_ADDSLASH 0x04 /* add a slash when Str_Concat'ing */ -void str_init(void); +void ArgArray_Done(ArgArray *); + char *str_concat(const char *, const char *, int); -char **brk_string(const char *, int *, Boolean); +void brk_string(ArgArray *, const char [], Boolean); char *MAKEFLAGS_quote(const char *); -char **MAKEFLAGS_break(const char *, int *); +void MAKEFLAGS_break(ArgArray *, const char []); int Str_Match(const char *, const char *); const char *Str_SYSVMatch(const char *, const char *, int *); void Str_SYSVSubst(struct Buffer *, const char *, const char *, int); |