General

General — Library initialization

Stability Level

Unstable, unless otherwise indicated

Synopsis


#include <gami.h>

void                gami_init                           (int *argc,
                                                         char ***argv);
GOptionGroup *      gami_get_option_group               (void);
gboolean            gami_parse_args                     (int *argc,
                                                         char ***argv);

Description

This section describes the Libgami initialization functions

Details

gami_init ()

void                gami_init                           (int *argc,
                                                         char ***argv);

Call this function before using any other Gami functions in your application. It will initialize the underlying type system and parses some standard command line options. argc and argv are adjusted accordingly so your own code will never see those arguments.

Debug messages in the library will be disabled by default, to get them back, install a log handler using g_log_set_handler() for the domain "Gami".

On Windows, the network stack is initialized as well.

argc :

Address of the argc parameter of main(). Changed if any arguments were handled.

argv :

Address of the argv parameter of main(). Any parameters understood by gami_init() are stripped before return.

gami_get_option_group ()

GOptionGroup *      gami_get_option_group               (void);

Returns a GOptionGroup for the commandline arguments recognized by Gami. You should add this group to your GOptionContext with g_option_context_add_group(), if you are using g_option_context_parse() to parse your commandline arguments

Returns :

a GOptionGroup for the commandline arguments recognized by Gami

gami_parse_args ()

gboolean            gami_parse_args                     (int *argc,
                                                         char ***argv);

Parses command line arguments, and initializes global attributes of Gami. Any arguments used by Gami are removed from the array and argc and argv are updated accordingly.

argc :

a pointer to the number of command line arguments.

argv :

a pointer to the array of command line arguments.

Returns :

TRUE if initialization succeeded, otherwise FALSE.