wmclockmon: import version 0.8.1
[dockapps.git] / wmclockmon / wmclockmon-cal / main.c
blobee0e3dfb5e93fc1b569c66af2e279f05686f6109
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 void Usage () {
20 printf("Usage: "PACKAGE"-cal [-h] [-v]\n"
21 " -h : short usage help\n"
22 " -v : show version\n\n");
23 exit(1);
27 void quit_app() {
28 gtk_main_quit();
32 void app_init(int argc, char *argv[]) {
33 int ind = 1;
34 time_t tnow;
36 while (ind < argc) {
37 if (argv[ind][0] == '-') {
38 switch (argv[ind][1]) {
39 case 'h' :
40 printf(PACKAGE"-cal by Thomas Nemeth - v "VERSION"\n");
41 Usage();
42 break;
43 case 'v' :
44 printf(PACKAGE"-cal by Thomas Nemeth - v "VERSION"\n");
45 exit(1);
46 break;
47 default:
48 printf("Unknown option: %s\n", argv[ind]);
49 Usage();
50 break;
52 } else {
53 fprintf(stderr, "Unknown option: %s\n", argv[ind]);
54 Usage();
56 ind++;
58 time(&tnow);
59 timeinfos = localtime(&tnow);
63 int main(int argc, char *argv[]) {
64 setlocale(LC_ALL, "");
65 gtk_init(&argc, &argv);
66 app_init(argc, argv);
67 create_mainwindow();
69 gtk_main();
71 return 0;