82bae56fda03e73b11593e6e9f380814d1339f0e
[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 typedef struct args args_t;
27
28 #define ARGS_DEFAULT_CONF_FILE_DIR OPKGETCDIR"/opkg"
29 #define ARGS_DEFAULT_CONF_FILE_NAME "opkg.conf"
30 #define ARGS_DEFAULT_DEST NULL
31 #define ARGS_DEFAULT_VERBOSITY 1
32
33 void args_init(args_t *args);
34 void args_deinit(args_t *args);
35 int args_parse(args_t *args, int argc, char *argv[]);
36 void args_usage(const char *complaint);
37
38 #endif