From 08375fa2bce124043954feb8c9cc8023004586bf Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Mon, 14 Apr 2008 15:58:10 +0300 Subject: [PATCH] Add argvNew() to create an empty argv array - yes it's silly ;) --- rpmio/argv.c | 6 ++++++ rpmio/argv.h | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/rpmio/argv.c b/rpmio/argv.c index 7a09e3e50..302f71d12 100644 --- a/rpmio/argv.c +++ b/rpmio/argv.c @@ -23,6 +23,12 @@ void argvPrint(const char * msg, ARGV_const_t argv, FILE * fp) } +ARGV_t argvNew(void) +{ + ARGV_t argv = xcalloc(1, sizeof(*argv)); + return argv; +} + ARGI_t argiFree(ARGI_t argi) { if (argi) { diff --git a/rpmio/argv.h b/rpmio/argv.h index 745a2c64b..6d5dc1f1a 100644 --- a/rpmio/argv.h +++ b/rpmio/argv.h @@ -37,6 +37,13 @@ void argvPrint(const char * msg, ARGV_const_t argv, FILE * fp); */ ARGI_t argiFree(ARGI_t argi); + +/** \ingroup rpmargv + * Create an empty argv array. + * @return pointer to empty argv + */ +ARGV_t argvNew(void); + /** \ingroup rpmargv * Destroy an argv array. * @param argv argv array