heraia.c File Reference

This is the main program file. More...

#include "heraia_types.h"
Include dependency graph for heraia.c:

Go to the source code of this file.

Functions

static gboolean version (void)
 prints program name, version, author, date and licence to the standard output
static gboolean usage (int status)
 Function that informs the user about the command line options available with heraia.
static window_prop_tinit_window_properties (gint x, gint y, guint height, guint width, gboolean displayed)
 Inits the properties of a window with defined values.
static heraia_struct_tinit_window_property_struct (heraia_struct_t *main_struct)
 Inits the window property structure.
static heraia_struct_theraia_init_main_struct (gchar *heraia_path)
 Initialize the main structure (main_struct).
static HERAIA_ERROR init_heraia_plugin_system (heraia_struct_t *main_struct)
 Function that initializes the plugin system if any :

  • loads any plugin where expected to be found
  • inits the plugin window.

static GList * init_heraia_location_list (gchar *heraia_path)
 Here we want to init the location list where we might look for in the future.
static gboolean manage_command_line_options (Options *opt, int argc, char **argv)
 Manages all the command line options and populates the Options *opt structure accordingly.
heraia_struct_tget_main_struct (void)
 This is intended to be called by the library or any program that will use the library in order to get the pointer to the main structure heraia_struct_t.
static void init_international_languages (void)
 Inits internationalisation (don't know wether it works or not!).
static gboolean do_heraia_coverage_tests (heraia_struct_t *main_struct)
 Does some self tests for code coverage in heraia.
static gboolean do_heraia_loading_tests (heraia_struct_t *main_struct)
 Does some loading tests in heraia.
static Optionsinit_options_struct (void)
 Inits the Options struct that contains all stuff needed to managed command line options within heraia.
int main (int argc, char **argv)
 main program options :

  • --version
  • --help
  • --tests

Variables

static heraia_struct_tlibheraia_main_struct = NULL
 libheraia_main_struct is a global variable that points to the main structure and is intended for the library use ONLY ! It should not be used anywhere else or for any other purpose

Detailed Description

This is the main program file.

Initialization is done here and then hand is passed to gtk's main thread

Definition in file heraia.c.


Function Documentation

static gboolean do_heraia_coverage_tests ( heraia_struct_t main_struct  )  [static]

Does some self tests for code coverage in heraia.

This function does some calls to functions that are not called on a normal test procedure

Parameters:
main_struct : main structure (heraia_struct_t *)
Returns:
gboolean as an exit value for the program

Definition at line 388 of file heraia.c.

References get_main_struct(), test_decode_functions(), usage(), and version().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static gboolean do_heraia_loading_tests ( heraia_struct_t main_struct  )  [static]

Does some loading tests in heraia.

Parameters:
main_struct : main structure (heraia_struct_t *)
Returns:
gboolean as an exit value for the program

Definition at line 418 of file heraia.c.

Referenced by main().

Here is the caller graph for this function:

heraia_struct_t* get_main_struct ( void   ) 

This is intended to be called by the library or any program that will use the library in order to get the pointer to the main structure heraia_struct_t.

Returns:
heraia_struct_t *, a pointer to the main structure

Definition at line 63 of file heraia.c.

Referenced by do_heraia_coverage_tests().

Here is the caller graph for this function:

static heraia_struct_t * heraia_init_main_struct ( gchar *  heraia_path  )  [static]

Initialize the main structure (main_struct).

Parameters:
heraia_path is the path used to invoke heraia : '/usr/bin/heraia' invocation would lead to '/usr/bin'
Returns:
a pointer to a newly initialized main structure

First, in this early stage of the development we want to toggle debugging mode ON which is enabled by default in the configure.ac file !

Definition at line 207 of file heraia.c.

References heraia_struct_t::current_doc, heraia_struct_t::current_DW, heraia_struct_t::debug, data_window_t::diw, heraia_struct_t::documents, ENABLE_DEBUG, heraia_struct_t::fdft, heraia_struct_t::find_doc, heraia_struct_t::fr_find_doc, heraia_struct_t::fr_replace_doc, init_heraia_location_list(), init_preference_struct(), init_window_property_struct(), heraia_struct_t::location_list, xml_t::main, heraia_struct_t::plugins_list, heraia_struct_t::prefs, heraia_struct_t::results, data_window_t::tab_displayed, verify_preference_file(), and heraia_struct_t::xmls.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static GList * init_heraia_location_list ( gchar *  heraia_path  )  [static]

Here we want to init the location list where we might look for in the future.

These can be viewed as default paths

Warning:
when adding new locations, keep in ming that the list is a prepended list in reverse order.
Returns:
a new allocatde GList containing all locations

Definition at line 303 of file heraia.c.

Referenced by heraia_init_main_struct().

Here is the caller graph for this function:

static HERAIA_ERROR init_heraia_plugin_system ( heraia_struct_t main_struct  )  [static]

Function that initializes the plugin system if any :

  • loads any plugin where expected to be found
  • inits the plugin window.

Parameters:
main_struct : main structure (heraia_struct_t *)
Returns:
HERAIA_NO_PLUGINS if no plugins where found or HERAIA_NOERR in case of no errors

Definition at line 273 of file heraia.c.

References HERAIA_NO_PLUGINS, HERAIA_NOERR, load_plugins(), log_message(), plugin_capable(), and plugin_list_window_init_interface().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void init_international_languages ( void   )  [static]

Inits internationalisation (don't know wether it works or not!).

Definition at line 357 of file heraia.c.

References ENABLE_DEBUG, and GETTEXT_PACKAGE.

Referenced by main().

Here is the caller graph for this function:

static Options* init_options_struct ( void   )  [static]

Inits the Options struct that contains all stuff needed to managed command line options within heraia.

Returns:
returns a newly allocated Options structure initialized to default values

< Structure to manage prgram's options

Definition at line 501 of file heraia.c.

References Options::filenames, NO_TESTS, Options::tests, and Options::usage.

Referenced by main().

Here is the caller graph for this function:

static window_prop_t * init_window_properties ( gint  x,
gint  y,
guint  height,
guint  width,
gboolean  displayed 
) [static]

Inits the properties of a window with defined values.

Parameters:
x,y are x,y coordinates on the screen
height represents the height of the window
width represents the width of the window. x+height,y+width is window's right bottom corner
displayed says wether the window is displayed or not
Returns:
a new allocated window_prop_t * structure.

Definition at line 124 of file heraia.c.

References window_prop_t::displayed, window_prop_t::height, window_prop_t::width, window_prop_t::x, and window_prop_t::y.

Referenced by init_window_property_struct().

Here is the caller graph for this function:

static heraia_struct_t * init_window_property_struct ( heraia_struct_t main_struct  )  [static]

Inits the window property structure.

Parameters:
main_struct : main structure
Returns:
main structure with an initiated window property structure

Definition at line 147 of file heraia.c.

References all_window_prop_t::about_box, all_window_prop_t::data_interpretor, all_window_prop_t::fdft_window, all_window_prop_t::find_window, all_window_prop_t::fr_window, all_window_prop_t::goto_window, H_DI_DISPLAYED, init_window_properties(), all_window_prop_t::ldt, all_window_prop_t::log_box, all_window_prop_t::main_dialog, all_window_prop_t::main_pref_window, all_window_prop_t::plugin_list, all_window_prop_t::result_window, heraia_struct_t::win_prop, WPT_DEFAULT_HEIGHT, and WPT_DEFAULT_WIDTH.

Referenced by heraia_init_main_struct().

Here is the call graph for this function:

Here is the caller graph for this function:

int main ( int  argc,
char **  argv 
)
static gboolean manage_command_line_options ( Options opt,
int  argc,
char **  argv 
) [static]

Manages all the command line options and populates the Options *opt structure accordingly.

Parameters:
opt (Options *opt) filled here with the parameters found in **argv
argc : number of command line arguments
argv : array of string (char *) that contains arguments
Returns:
gboolean that seems to always be TRUE

Definition at line 432 of file heraia.c.

References COVERAGE_TESTS, Options::filenames, long_options, Options::tests, usage(), Options::usage, and version().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static gboolean usage ( int  status  )  [static]

Function that informs the user about the command line options available with heraia.

Parameters:
status : integer that indicate wether to display help (!=0) or an error message (0)
Returns:
  • TRUE -> help message has been printed
  • FALSE -> error message has been printed

Definition at line 89 of file heraia.c.

References COVERAGE_TESTS, LOADING_TESTS, and version().

Referenced by do_heraia_coverage_tests(), and manage_command_line_options().

Here is the call graph for this function:

Here is the caller graph for this function:

static gboolean version ( void   )  [static]

prints program name, version, author, date and licence to the standard output

Author:
Olivier DELHOMME, Sébastien TRICAUD, Grégory AUDET, Aurélie DERAISME.
Version:
0.1.7
Date:
2005-2011

Definition at line 73 of file heraia.c.

References HERAIA_AUTHORS, HERAIA_DATE, HERAIA_LICENSE, and HERAIA_VERSION.

Referenced by do_heraia_coverage_tests(), manage_command_line_options(), and usage().

Here is the caller graph for this function:


Variable Documentation

libheraia_main_struct is a global variable that points to the main structure and is intended for the library use ONLY ! It should not be used anywhere else or for any other purpose

Definition at line 55 of file heraia.c.

Generated on Mon May 2 21:06:24 2011 for Heraia by  doxygen 1.6.3