]> git.cworth.org Git - grrobot/blob - src/args.h
408c13d4d51626a0cdb57b78278783f805fc3291
[grrobot] / src / args.h
1 /* args.h - Parse command-line arguments for grrobot using argp
2  *
3  * Copyright © 2003 Carl Worth
4  *
5  * Permission to use, copy, modify, distribute, and sell this software
6  * and its documentation for any purpose is hereby granted without
7  * fee, provided that the above copyright notice appear in all copies
8  * and that both that copyright notice and this permission notice
9  * appear in supporting documentation, and that the name of Carl Worth
10  * not be used in advertising or publicity pertaining to distribution
11  * of the software without specific, written prior permission.
12  * Carl Worth makes no representations about the suitability of this
13  * software for any purpose.  It is provided "as is" without express
14  * or implied warranty.
15  * 
16  * CARL WORTH DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
18  * NO EVENT SHALL CARL WORTH BE LIABLE FOR ANY SPECIAL, INDIRECT OR
19  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
20  * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
21  * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
22  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23  *
24  * Author: Carl Worth <carl@theworths.org>
25  */
26
27 #ifndef ARGS_H
28 #define ARGS_H
29
30 #ifdef HAVE_CONFIG_H
31 #include "config.h"
32 #endif
33
34 #include <argp.h>
35
36 #define ARGS_HOST_DEFAULT "rr.nickle.org"
37 #define ARGS_PORT_DEFAULT "5252"
38 #define ARGS_USER_DEFAULT "grrobot"
39 #define ARGS_GAME_DEFAULT "game"
40
41 typedef struct args
42 {
43     char *host;
44     char *port;
45     char *user;
46     char *game;
47
48     char *file;
49     int watch;
50 } args_t;
51
52 error_t
53 args_parse(args_t *args, int argc, char *argv[]);
54
55 #endif