2011-09-14 01:57:57 +04:00
|
|
|
#ifndef ARGV_ARRAY_H
|
|
|
|
#define ARGV_ARRAY_H
|
|
|
|
|
2012-04-19 01:08:49 +04:00
|
|
|
extern const char *empty_argv[];
|
2011-09-14 01:57:57 +04:00
|
|
|
|
|
|
|
struct argv_array {
|
|
|
|
const char **argv;
|
|
|
|
int argc;
|
|
|
|
int alloc;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define ARGV_ARRAY_INIT { empty_argv, 0, 0 }
|
|
|
|
|
|
|
|
void argv_array_init(struct argv_array *);
|
|
|
|
void argv_array_push(struct argv_array *, const char *);
|
|
|
|
__attribute__((format (printf,2,3)))
|
|
|
|
void argv_array_pushf(struct argv_array *, const char *fmt, ...);
|
2012-04-19 01:10:05 +04:00
|
|
|
void argv_array_pushl(struct argv_array *, ...);
|
2012-09-01 15:25:27 +04:00
|
|
|
void argv_array_pop(struct argv_array *);
|
2011-09-14 01:57:57 +04:00
|
|
|
void argv_array_clear(struct argv_array *);
|
2012-09-19 19:21:18 +04:00
|
|
|
const char **argv_array_detach(struct argv_array *array, int *argc);
|
|
|
|
void argv_array_free_detached(const char **argv);
|
2011-09-14 01:57:57 +04:00
|
|
|
|
|
|
|
#endif /* ARGV_ARRAY_H */
|