From 8f30b68871bde8687c7fcff8bac66e2b5765129e Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Wed, 16 Sep 2009 17:07:01 +0000 Subject: - Add xcalloc() and call it - Fix memory errors found by valgrind - Remove multi_glob() and empower parse_file_seq() to do its job: the goal here is to remove the confusing reverse/re-reverse we do on the file lists: needed for future fixes. - Add a prefix arg to parse_file_seq() - Make concat() variadic so it can take arbitrary #'s of strings --- dep.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'dep.h') diff --git a/dep.h b/dep.h index ec2420e..67dac33 100644 --- a/dep.h +++ b/dep.h @@ -55,22 +55,30 @@ struct nameseq }; -struct nameseq *multi_glob (struct nameseq *chain, unsigned int size, int exists_only); +#define PARSEFS_NONE (0x0000) +#define PARSEFS_NOSTRIP (0x0001) +#define PARSEFS_NOGLOB (0x0002) +#define PARSEFS_EXISTS (0x0004) +#define PARSEFS_NOCACHE (0x0008) + #ifdef VMS struct nameseq *parse_file_seq (); #else -struct nameseq *parse_file_seq (char **stringp, int stopchar, unsigned int size, int strip); +struct nameseq *parse_file_seq (char **stringp, unsigned int size, + int stopchar, const char *prefix, int flags); #endif + char *tilde_expand (const char *name); #ifndef NO_ARCHIVES struct nameseq *ar_glob (const char *arname, const char *member_pattern, unsigned int size); #endif -#define dep_name(d) ((d)->name == 0 ? (d)->file->name : (d)->name) +#define dep_name(d) ((d)->name == 0 ? (d)->file->name : (d)->name) + +#define alloc_dep() (xcalloc (sizeof (struct dep))) +#define free_dep(_d) free (_d) -struct dep *alloc_dep (void); -void free_dep (struct dep *d); struct dep *copy_dep_chain (const struct dep *d); void free_dep_chain (struct dep *d); void free_ns_chain (struct nameseq *n); -- cgit v1.2.3