argv.h
Go to the documentation of this file.
#ifndef _H_ARGV_
#define _H_ARGV_
#include <stdio.h>
#include <rpm/rpmtypes.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef char ** ARGV_t;
typedef char * const *ARGV_const_t;
typedef int * ARGint_t;
struct ARGI_s {
unsigned nvals;
ARGint_t vals;
};
typedef struct ARGI_s * ARGI_t;
typedef struct ARGI_s const * const ARGI_const_t;
void argvPrint(const char * msg, ARGV_const_t argv, FILE * fp);
ARGI_t argiFree(ARGI_t argi);
ARGV_t argvNew(void);
ARGV_t argvFree(ARGV_t argv);
int argiCount(ARGI_const_t argi);
ARGint_t argiData(ARGI_const_t argi);
int argvCount(ARGV_const_t argv);
ARGV_t argvData(ARGV_t argv);
int argvCmp(const void * a, const void * b);
int argvSort(ARGV_t argv, int (*compar)(const void *, const void *));
ARGV_t argvSearch(ARGV_const_t argv, const char *val,
int (*compar)(const void *, const void *));
int argiAdd(ARGI_t * argip, int ix, int val);
int argvAdd(ARGV_t * argvp, const char *val);
int argvAddNum(ARGV_t * argvp, int val);
int argvAppend(ARGV_t * argvp, ARGV_const_t av);
enum argvFlags_e {
ARGV_NONE = 0,
ARGV_SKIPEMPTY = (1 << 0), /* omit empty strings from result */
};
typedef rpmFlags argvFlags;
ARGV_t argvSplitString(const char * str, const char * seps, argvFlags flags);
int argvSplit(ARGV_t * argvp, const char * str, const char * seps);
char *argvJoin(ARGV_const_t argv, const char *sep);
#ifdef __cplusplus
}
#endif
#endif /* _H_ARGV_ */
ARGV_t
char ** ARGV_t
Definition: argv.h:17
argiFree
ARGI_t argiFree(ARGI_t argi)
Destroy an argi array.
ARGI_s::vals
ARGint_t vals
Definition: argv.h:23
argvFlags_e
argvFlags_e
Definition: argv.h:144
ARGI_s::nvals
unsigned nvals
Definition: argv.h:22
argvSort
int argvSort(ARGV_t argv, int(*compar)(const void *, const void *))
Sort an argv array.
argvCount
int argvCount(ARGV_const_t argv)
Return no.
ARGI_t
struct ARGI_s * ARGI_t
Definition: argv.h:25
ARGI_const_t
struct ARGI_s const *const ARGI_const_t
Definition: argv.h:26
ARGint_t
int * ARGint_t
Definition: argv.h:20
argvFree
ARGV_t argvFree(ARGV_t argv)
Destroy an argv array.
argvAdd
int argvAdd(ARGV_t *argvp, const char *val)
Add a string to an argv array.
rpmFlags
uint32_t rpmFlags
Definition: rpmtypes.h:42
argvCmp
int argvCmp(const void *a, const void *b)
Compare argv arrays (qsort/bsearch).
argvNew
ARGV_t argvNew(void)
Create an empty argv array.
argvAddNum
int argvAddNum(ARGV_t *argvp, int val)
Add a number to an argv array (converting to a string).
argvSplitString
ARGV_t argvSplitString(const char *str, const char *seps, argvFlags flags)
Split a string into an argv array.
ARGV_NONE
Definition: argv.h:145
argiData
ARGint_t argiData(ARGI_const_t argi)
Return data from argi array.
ARGV_const_t
char *const * ARGV_const_t
Definition: argv.h:18
argiCount
int argiCount(ARGI_const_t argi)
Return no.
argiAdd
int argiAdd(ARGI_t *argip, int ix, int val)
Add an int to an argi array.
argvData
ARGV_t argvData(ARGV_t argv)
Return data from argv array.
argvSearch
ARGV_t argvSearch(ARGV_const_t argv, const char *val, int(*compar)(const void *, const void *))
Find an element in an argv array.
argvAppend
int argvAppend(ARGV_t *argvp, ARGV_const_t av)
Append one argv array to another.
argvPrint
void argvPrint(const char *msg, ARGV_const_t argv, FILE *fp)
Print argv array elements.
argvSplit
int argvSplit(ARGV_t *argvp, const char *str, const char *seps)
Split a string into an argv array.
ARGI_s
Definition: argv.h:21
argvFlags
rpmFlags argvFlags
Definition: argv.h:149
ARGV_SKIPEMPTY
Definition: argv.h:146
argvJoin
char * argvJoin(ARGV_const_t argv, const char *sep)
Join an argv array into a string.