Fawkes API
Fawkes Development Version
|
00001 00002 /*************************************************************************** 00003 * main.cpp - Fawkes main application 00004 * 00005 * Created: Thu Nov 2 16:44:48 2006 00006 * Copyright 2006-2011 Tim Niemueller [www.niemueller.de] 00007 * 00008 ****************************************************************************/ 00009 00010 /* This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. A runtime exception applies to 00014 * this software (see LICENSE.GPL_WRE file mentioned below for details). 00015 * 00016 * This program is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU Library General Public License for more details. 00020 * 00021 * Read the full text in the LICENSE.GPL_WRE file in the doc directory. 00022 */ 00023 00024 #include <baseapp/run.h> 00025 #include <core/exception.h> 00026 #include <cstdio> 00027 00028 00029 /** Fawkes application. 00030 * @param argc argument count 00031 * @param argv array of arguments 00032 */ 00033 int 00034 main(int argc, char **argv) 00035 { 00036 try { 00037 int rv = 0; 00038 if ((rv = fawkes::runtime::init(argc, argv)) != 0) { 00039 return rv; 00040 } 00041 fawkes::runtime::run(); 00042 fawkes::runtime::cleanup(); 00043 } catch (fawkes::Exception &e) { 00044 printf("Fawkes execution ended unexpectedly, exception follows.\n"); 00045 e.print_trace(); 00046 return 1; 00047 } 00048 00049 return 0; 00050 }