/Users/huttone/Devel/sedflux-new/sedflux/trunk/ew/sedflux/main.c

Go to the documentation of this file.
00001 //---
00002 //
00003 // This file is part of sedflux.
00004 //
00005 // sedflux is free software; you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License as published by
00007 // the Free Software Foundation; either version 2 of the License, or
00008 // (at your option) any later version.
00009 //
00010 // sedflux is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU General Public License
00016 // along with sedflux; if not, write to the Free Software
00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 //
00019 //---
00020 
00021 #include <stdio.h>
00022 #include <limits.h>
00023 #include <signal.h>
00024 #include <time.h>
00025 #include <unistd.h>
00026 #include <errno.h>
00027 
00028 #include <utils/utils.h>
00029 #include <sed/sed_sedflux.h>
00030 #include "sedflux.h"
00031 
00032 int
00033 main( int argc , char *argv[] )
00034 {
00035    gboolean          success     = TRUE;
00036    Sedflux_param_st* p           = NULL;
00037    GError*           error       = NULL;
00038    gchar*            command_str = NULL;
00039 
00040    g_thread_init( NULL );
00041    eh_init_glib();
00042    g_log_set_handler( NULL , G_LOG_LEVEL_MASK , &eh_logger , NULL );
00043 
00044    command_str = eh_render_command_str( argc , argv );
00045 
00046    /* Parse command line arguments */
00047    p = sedflux_parse_command_line( argc , argv , &error );
00048    eh_exit_on_error( error , "Error parsing command line arguments" );
00049 
00050    /* Create the project directory and check permissions */
00051    sedflux_setup_project_dir( &p->init_file , &p->working_dir , &error );
00052    eh_exit_on_error( error , "Error setting up project directory" );
00053 
00054    sedflux_print_info_file( p->init_file , p->working_dir , command_str , p->run_desc );
00055 
00056    /* Setup the signal handling */
00057    sed_signal_set_action();
00058 
00059    /* Run sedflux!!! */
00060    success = sedflux( p->init_file );
00061 
00062    eh_free( p );
00063 
00064    if ( g_getenv("SED_MEM_CHECK") ) eh_heap_dump( "heap_dump.txt" );
00065 
00066    if ( success ) eh_exit( EXIT_SUCCESS );
00067    else           eh_exit( EXIT_FAILURE );
00068 
00069    return EXIT_SUCCESS;
00070 }
00071 
00072 

Generated on Fri Jan 4 18:04:15 2008 for sedflux by  doxygen 1.5.2