/*
 *  main.c
 *
 *  Hauptprogramm
 *
 *  (C) 9/1995 Tilman Kuepper (tilman@tilli.tng.oche.de)
 */


#include "forms.h"
#include "stopwatch.h"


/* RCS-Infos */
static char RCSdat[]="$Date: 1995/09/06 16:27:35 $";
static char RCSrev[]="$Revision: 1.0 $"; 
static char RCSsta[]="$State: Released $";


/* (C)-Meldung */
#define COPYRIGHT "(C) 9/1995 Tilman Kuepper (tilman@tilli.tng.oche.de)"


/*
 *  Hauptprogramm
 */
void main(int argc, char *argv[])
{
    FD_f_stopwatch *f_stopwatch;

    /* Toolkit initialisieren */
    fl_initialize(argv[0],argv[0],0,0,&argc,argv);

    /* Vielleicht moechte jemand die Version wissen? */
    if(argc!=1)
    {
        /* RCS-Infos ausgeben */
        fprintf(stderr,"%s\n\n",COPYRIGHT);
        fprintf(stderr,"%s\n%s\n%s\n",RCSrev,RCSsta,RCSdat);

        fl_finish();
        exit(0);
    }

    /* Form erzeugen */
    f_stopwatch=create_form_f_stopwatch();
    f_stopwatch->b_start->u_vdata=f_stopwatch; /* Form merken fuer Start-Callback */

    /* Uhr starten */
    fl_show_form(f_stopwatch->f_stopwatch,FL_PLACE_FREE,FL_FULLBORDER,argv[0]);
    fl_do_forms();

    /* 
     * Die folgende Zeile sollte nie zur Ausfuehrung kommen, da das Programm
     * ueber einen Callback verlassen wird.
     */
    fl_hide_form(f_stopwatch->f_stopwatch);
}
