File: options.c

package info (click to toggle)
xtrojka 123-14
  • links: PTS
  • area: non-free
  • in suites: potato
  • size: 492 kB
  • ctags: 443
  • sloc: ansic: 3,087; makefile: 135; sh: 19
file content (54 lines) | stat: -rw-r--r-- 818 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
 *	xtrojka (c) 1994,1995,1996 Maarten Los
 *
 *	#include "COPYRIGHT"	
 *
 *	created:	26.xi.1995
 *	modified:
 *
 *	The options scanning module
 */

#include <stdio.h>
#include "xtrojka.h"
#include "debug.h"

extern flag	is_debug_info;


/*
 *	implementation
 */
void get_options(argc, argv)
int argc;
char **argv;
/*
 * parse the arguments
 */
{
	DEBUG("options.c","get_options");

	while(--argc) {
		if((!strcmp(argv[argc], "-debug")) 
		|| (!strcmp(argv[argc], "-d"))) {
#ifdef DEBUG_INFO
			is_debug_info = True;
#else
			show_no_debug();
#endif
		}
		if((!strcmp(argv[argc], "-help")) 
		|| (!strcmp(argv[argc], "-h"))
		|| (!strcmp(argv[argc], "-?"))) {
			show_help();
			exit(0);
		}
		if((!strcmp(argv[argc], "-scores")) 
		|| (!strcmp(argv[argc], "-s"))) {
			show_scores_offline();
			exit(0);
		}
	}
}