1 /*
2  * Copyright (C) 1990 Regents of the University of California.
3  *
4  * Permission to use, copy, modify, distribute, and sell this software and
5  * its documentation for any purpose is hereby granted without fee,
6  * provided that the above copyright notice appear in all copies and that
7  * both that copyright notice and this permission notice appear in
8  * supporting documentation, and that the name of the University of
9  * California not be used in advertising or publicity pertaining to
10  * distribution of the software without specific, written prior
11  * permission.  the University of California makes no representations
12  * about the suitability of this software for any purpose.  It is provided
13  * "as is" without express or implied warranty.
14  */
15 
16 # include <stdio.h>
17 
18 # include <X11/Intrinsic.h>
19 # include <X11/StringDefs.h>
20 
21 # include "debug.h"
22 # include "cdrom_globs.h"
23 
24 Widget		top_form;
25 
26 extern AppData app_data;
27 
28 static void	chk_debug();
29 
30 int
31 main(argc, argv)
32 	int		argc;
33 	char		**argv;
34 {
35 
36 	chk_debug(argc, argv);
37 
38 	/* gets resources, & creates main form */
39 	top_form = top_setup(argc, argv);
40 
41 #if 0
42 	if (cdrom_open() == -1) /* (uses a resource, so done after top_setup) */
43 		exit(1); /* perhaps a bit drastic */
44 #endif
45 	cdrom_open();
46 
47 	logo_setup(top_form);
48 
49 	button_setup(top_form);
50 
51 	program_form_setup(top_form);
52 
53 	top_start();
54 
55 	update_status(NULL, NULL);
56 
57 	XtAppMainLoop(appc);
58 
59 	exit(0);
60 }
61 
62 static void
63 chk_debug(argc, argv)
64 	int	argc;
65 	char	**argv;
66 {
67 	int	i;
68 
69 	/* ugly hack */
70 	for (i = 1; i < argc; i++) {
71 		if (strcmp(argv[i], "-debug") == 0) {
72 			app_data.debug = True;
73 			break;
74 		}
75 	}
76 }
77 
78 void
79 usage() {
80 	(void) fprintf(stderr, "usage: xcdplayer [-debug]\n");
81 
82 	exit(1);
83 }
84