Merge commit 'grg' into HEAD
[oweals/opkg-lede.git] / libopkg / args.h
1 /* args.h - parse command-line args
2
3   Carl D. Worth
4
5   Copyright 2001 University of Southern California
6  
7   This program is free software; you can redistribute it and/or modify
8   it under the terms of the GNU General Public License as published by
9   the Free Software Foundation; either version 2, or (at your option)
10   any later version.
11  
12   This program is distributed in the hope that it will be useful,
13   but WITHOUT ANY WARRANTY; without even the implied warranty of
14   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15   GNU General Public License for more details.
16 */
17
18 #ifndef ARGS_H
19 #define ARGS_H
20
21 struct args
22 {
23     char *conf_file;
24     char *dest;
25
26     int nocheckfordirorfile;
27     int noreadfeedsfile;
28 };
29 typedef struct args args_t;
30
31 #define ARGS_DEFAULT_CONF_FILE_DIR OPKGETCDIR"/opkg"
32 #define ARGS_DEFAULT_CONF_FILE_NAME "opkg.conf"
33 #define ARGS_DEFAULT_DEST NULL
34 #define ARGS_DEFAULT_VERBOSITY 1
35
36 void args_init(args_t *args);
37 void args_deinit(args_t *args);
38 int args_parse(args_t *args, int argc, char *argv[]);
39 void args_usage(const char *complaint);
40
41 #endif