Heraia  0.1.8
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 More...
 
static gboolean usage (int status)
 Function that informs the user about the command line options available with heraia. More...
 
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. More...
 
static heraia_struct_tinit_window_property_struct (heraia_struct_t *main_struct)
 Inits the window property structure. More...
 
static heraia_struct_theraia_init_main_struct (gchar *heraia_path)
 Initialize the main structure (main_struct) More...
 
static HERAIA_ERROR init_heraia_plugin_system (heraia_struct_t *main_struct)
 Function that initializes the plugin system if any : More...
 
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. More...
 
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. More...
 
static void print_lirairies_versions (void)
 Prints on stdout the librairies versions. More...
 
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. More...
 
static void init_international_languages (void)
 Inits internationalisation (don't know wether it works or not!) More...
 
static gboolean do_heraia_coverage_tests (heraia_struct_t *main_struct)
 Does some self tests for code coverage in heraia. More...
 
static gboolean do_heraia_loading_tests (heraia_struct_t *main_struct)
 Does some loading tests in heraia. More...
 
static Optionsinit_options_struct (void)
 Inits the Options struct that contains all stuff needed to managed command line options within heraia. More...
 
int main (int argc, char **argv)
 main program options : More...
 

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 More...
 

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 399 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 429 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 64 of file heraia.c.

References libheraia_main_struct.

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_pathis 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 208 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 304 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 274 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 368 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 512 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,yare x,y coordinates on the screen
heightrepresents the height of the window
widthrepresents the width of the window. x+height,y+width is window's right bottom corner
displayedsays wether the window is displayed or not
Returns
a new allocated window_prop_t * structure.

Definition at line 125 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
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 443 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 void print_lirairies_versions ( void  )
static

Prints on stdout the librairies versions.

To be used for debugging. Takes no parameters and returns nothing.

Definition at line 530 of file heraia.c.

Referenced by main().

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 90 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.8
Date
2005-2018

Definition at line 74 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

heraia_struct_t* libheraia_main_struct = NULL
static

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 56 of file heraia.c.

Referenced by get_main_struct().