next up previous contents
Next: Datafile Up: Controller Previous: GUI   Contents

Launching other modules

Launching modules which are separate executables (the Generator, the Validator, the Launcher) involves inter-process communication methods described in Section 5.5.

Launching the Generator is done by the on_generate_activate() call-back (see Section 5.10.1 and Table 5.1). The source code is given in Fig 5.4.

Figure 5.4: Launching Generator module, source code
\begin{figure}\begin{center}
\begin{verbatim}
void
on_generate_activate( GtkMe...
...
}
}
g_free(error);
g_free(command);
}\end{verbatim}\end{center}\end{figure}

First, there are two strings prepared. The first one is a command string, which will execute the given module (generator_fn) with the given parameters (input_filename and output_filename) later and the second one is the error string, a possible error message. They are allocated dynamically, so freeing of the occupied memory is needed. It is done by the last calls: g_free(). As one can notice for the memory allocation calls from GLib are used.

Then the pipe is created. If any error occurs the appropriate message is displayed on the Controller's status-bar, or in a separate window using quick_message() function which pops up a window and displays the given message in it.

Then there is the loop which reads the standard output of the created process and according to the internal communication methods (Section 5.7) if any data occurs it treats it as an error and displays an adequate message.


next up previous contents
Next: Datafile Up: Controller Previous: GUI   Contents
Igor Wojnicki 2001-02-21