wmclockmon: fix global variables causing linkage failure
[dockapps.git] / wmclockmon / wmclockmon-cal / main.c
blob0a1b4042114ae24fdc314475e80ed0f37d2be465
1 /* WMMaiLoad-Config
2 * Configuration window for wmmaiload dockapp, Thomas Nemeth 2002.
3 */
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <gtk/gtk.h>
8 #include <string.h>
9 #include <time.h>
10 #include <sys/time.h>
11 #include <locale.h>
12 #include "../config.h"
13 #include "defines.h"
14 #include "tools.h"
15 #include "mainwindow.h"
16 #include "main.h"
19 struct tm *timeinfos;
21 void Usage () {
22 printf("Usage: "PACKAGE"-cal [-h] [-v]\n"
23 " -h : short usage help\n"
24 " -v : show version\n\n");
25 exit(1);
29 void quit_app() {
30 gtk_main_quit();
34 void app_init(int argc, char *argv[]) {
35 int ind = 1;
36 time_t tnow;
38 while (ind < argc) {
39 if (argv[ind][0] == '-') {
40 switch (argv[ind][1]) {
41 case 'h' :
42 printf(PACKAGE"-cal by Thomas Nemeth - v "VERSION"\n");
43 Usage();
44 break;
45 case 'v' :
46 printf(PACKAGE"-cal by Thomas Nemeth - v "VERSION"\n");
47 exit(1);
48 break;
49 default:
50 printf("Unknown option: %s\n", argv[ind]);
51 Usage();
52 break;
54 } else {
55 fprintf(stderr, "Unknown option: %s\n", argv[ind]);
56 Usage();
58 ind++;
60 time(&tnow);
61 timeinfos = localtime(&tnow);
65 int main(int argc, char *argv[]) {
66 setlocale(LC_ALL, "");
67 gtk_init(&argc, &argv);
68 app_init(argc, argv);
69 create_mainwindow();
71 gtk_main();
73 return 0;