main.c
17.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
/*
* "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270
* (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a
* aplicativos mainframe. Registro no INPI sob o nome G3270.
*
* Copyright (C) <2008> <Banco do Brasil S.A.>
*
* Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob
* os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela
* Free Software Foundation.
*
* Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER
* GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO
* A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para
* obter mais detalhes.
*
* Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este
* programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple
* Place, Suite 330, Boston, MA, 02111-1307, USA
*
* Este programa está nomeado como main.c e possui 502 linhas de código.
*
* Contatos:
*
* perry.werneck@gmail.com (Alexandre Perry de Souza Werneck)
* erico.mendonca@gmail.com (Erico Mascarenhas Mendonça)
* licinio@bb.com.br (Licínio Luis Branco)
* kraucer@bb.com.br (Kraucer Fernandes Mazuco)
* macmiranda@bb.com.br (Marco Aurélio Caldas Miranda)
*
*/
#include "gui.h"
#include "oia.h"
#include "actions.h"
#include <stdio.h>
#if defined( HAVE_LIBGNOME )
#include <gnome.h>
#endif
#include <glib/gstdio.h>
// #include "globals.h"
#if !defined(_WIN32)
#include <sys/wait.h>
#include <signal.h>
#endif
#include <errno.h>
#include <lib3270/toggle.h>
/*---[ Globals ]------------------------------------------------------------------------------------------------*/
#if defined( HAVE_IGEMAC )
GtkOSXApplication * osxapp = 0;
#elif defined( HAVE_LIBGNOME )
static GnomeClient * client = 0;
#endif
const char * on_lu_command = NULL;
H3270 * hSession = NULL;
static const char * cl_hostname = NULL;
static const char * startup_script = NULL;
static gchar * gtk_theme = NULL;
static gchar * log_filename = NULL;
/*---[ Implement ]----------------------------------------------------------------------------------------------*/
/* Callback for connection state changes. */
static void connect_main(H3270 *session, int status, void *dunno)
{
gboolean online = (CONNECTED) ? TRUE : FALSE;
Trace("%s: status: %d Connected: %d",__FUNCTION__,status,(int) online);
if(status)
{
cMode |= CURSOR_MODE_ENABLED;
}
else
{
SetStatusCode(session,LIB3270_STATUS_DISCONNECTED);
cMode &= ~CURSOR_MODE_ENABLED;
// ctlr_erase(1);
online = FALSE;
#ifdef X3270_FT
action_group_set_sensitive(ACTION_GROUP_FT,status);
#endif
}
if(terminal)
{
gtk_widget_set_sensitive(terminal,online);
update_oia_element(OIA_ELEMENT_CONNECTION_STATUS);
update_oia_element(OIA_ELEMENT_UNDERA);
gtk_widget_grab_focus(terminal);
}
action_group_set_sensitive(ACTION_GROUP_ONLINE,online);
action_group_set_sensitive(ACTION_GROUP_OFFLINE,!online);
if(online)
{
check_clipboard_contents();
}
else
{
unselect();
clear_clipboard_string();
action_group_set_sensitive(ACTION_GROUP_PASTE,FALSE);
}
#ifndef HAVE_MACUI
keypad_set_sensitive(topwindow,online);
#endif
#ifdef HAVE_IGEMAC
gtk_osxapplication_attention_request(osxapp,INFO_REQUEST);
#endif
}
static void connect_in3270(H3270 *session, int status, void *dunno)
{
#ifdef X3270_FT
action_group_set_sensitive(ACTION_GROUP_FT,status);
#else
action_group_set_sensitive(ACTION_GROUP_FT,FALSE);
#endif
}
static void log_callback(const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer id)
{
WriteLog(id, "%s %s", log_domain, message);
Trace("%s %s", log_domain, message);
}
static void set_fullscreen(H3270 *session, int value, LIB3270_TOGGLE_TYPE reason)
{
Trace("Fullscren mode toggled (value: %d",value);
if(value)
gtk_window_fullscreen(GTK_WINDOW(topwindow));
else
gtk_window_unfullscreen(GTK_WINDOW(topwindow));
}
static gboolean trylog(gchar *path)
{
gboolean rc = (Set3270Log(path) == 0);
#ifdef DEBUG
if(rc)
{
Trace("Writing log in %s",path);
}
else
{
Trace("Log in %s failed",path);
}
#endif
g_free(path);
return rc == 0;
}
static int show_lib3270_register_error(const gchar *msg)
{
int rc;
GtkWidget *dialog = gtk_message_dialog_new( NULL,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CANCEL,
"%s", msg);
gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),_( "Please, check if lib3270 version is %s" ),program_version);
gtk_window_set_title(GTK_WINDOW(dialog),_( "3270 library failed" ));
#if GTK_CHECK_VERSION(2,10,0)
gtk_window_set_deletable(GTK_WINDOW(dialog),FALSE);
#endif
rc = gtk_dialog_run(GTK_DIALOG (dialog));
gtk_widget_destroy(dialog);
return -1;
}
static int program_init(void)
{
static const gchar *logname = PROGRAM_NAME ".log";
gboolean has_log = FALSE;
const gchar *msg = gtk_check_version(GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
gchar *ptr;
int f;
for(f=0;f<POPUP_MENU_COUNT;f++)
popup_menu[f] = NULL;
if(msg)
{
// Invalid GTK version, notify user and exit
int rc;
GtkWidget *dialog = gtk_message_dialog_new( NULL,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_OK_CANCEL,
_( "This program requires GTK version %d.%d.%d" ),GTK_MAJOR_VERSION,GTK_MINOR_VERSION,GTK_MICRO_VERSION );
gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),"%s",msg);
gtk_window_set_title(GTK_WINDOW(dialog),_( "GTK Version mismatch" ));
#if GTK_CHECK_VERSION(2,10,0)
gtk_window_set_deletable(GTK_WINDOW(dialog),FALSE);
#endif
rc = gtk_dialog_run(GTK_DIALOG (dialog));
gtk_widget_destroy(dialog);
if(rc != GTK_RESPONSE_OK)
return EINVAL;
}
/* Try command-line defined log */
if(log_filename)
has_log = (Set3270Log(log_filename) == 0);
Trace("Log is %s",has_log ? "set" : "unset");
/* If running on win32 try to save log in program path */
#if defined(_WIN32) || defined( DEBUG ) /*[*/
if(!has_log)
has_log = trylog(g_build_filename(program_data, G_DIR_SEPARATOR_S, logname, NULL));
#endif
/* Init Log system */
if(!has_log)
has_log = trylog(g_build_filename(G_DIR_SEPARATOR_S, "var","log",logname,NULL));
if(!has_log)
has_log = trylog(g_build_filename(g_get_home_dir(),"var","log",logname,NULL));
if(!has_log)
has_log = trylog(g_build_filename(g_get_home_dir(),"log",logname,NULL));
if(!has_log)
has_log = trylog(g_build_filename(g_get_home_dir(),PROGRAM_NAME,logname,NULL));
if(!has_log)
has_log = trylog(g_build_filename(g_get_home_dir(),PACKAGE_NAME,logname,NULL));
if(!has_log)
has_log = trylog(g_build_filename(g_get_tmp_dir(),logname,NULL));
g_log_set_default_handler(log_callback,"GLog");
/* Start */
Trace("%s","Opening configuration file");
OpenConfigFile();
if(gtk_theme)
ptr = g_strdup(gtk_theme);
else
{
#if defined(WIN32)
ptr = GetString( "gtk", "theme", "themes/MS-Windows/gtk-2.0/gtkrc");
#else
ptr = GetString( "gtk", "theme", "");
#endif
}
if(ptr)
{
Trace("Parsing theme \"%s\"",ptr);
if(*ptr && g_file_test(ptr,G_FILE_TEST_IS_REGULAR))
gtk_rc_parse(ptr);
g_free(ptr);
}
// Trace("%s","Opening configuration file");
if(Register3270IOCallbacks(&program_io_callbacks))
return show_lib3270_register_error(_( "Can't register as I/O manager." ));
// Trace("%s","Setting screen callbacks");
if(Register3270ScreenCallbacks(&program_screen_callbacks))
return show_lib3270_register_error(_( "Can't register as screen manager." ));
#ifdef X3270_FT
// Trace("%s","Starting FT feature");
if(initft())
return show_lib3270_register_error(_( "Can't register as file-transfer manager." ));
#endif
Trace("%s completed!",__FUNCTION__);
return 0;
}
#ifdef HAVE_LIBGNOME
static gint save_session (GnomeClient *client, gint phase, GnomeSaveStyle save_style,
gint is_shutdown, GnomeInteractStyle interact_style,
gint is_fast, gpointer client_data)
{
gchar** argv;
guint argc;
action_save(0);
/* allocate 0-filled, so it will be NULL-terminated */
argv = g_malloc0(sizeof(gchar*)*2);
argc = 0;
argv[argc++] = client_data;
argv[argc] = 0;
gnome_client_set_clone_command(client, argc, argv);
gnome_client_set_restart_command(client, argc, argv);
Trace("Session for \"%s\" saved (Argc=%d)",(char *) client_data,argc);
return TRUE;
}
static gint session_die(GnomeClient* client, gpointer client_data)
{
WriteLog("GNOME","Exiting by request");
gtk_main_quit();
return FALSE;
}
#else
static int parse_option_context(GOptionContext *context, int *argc, char ***argv)
{
GError *error = NULL;
if(!g_option_context_parse( context, argc, argv, &error ))
{
GtkWidget *dialog = gtk_message_dialog_new( NULL,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CANCEL,
"%s", _( "Option parsing failed." ));
gtk_window_set_title(GTK_WINDOW(dialog),_( "Parse error" ));
gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), "%s", error->message);
gtk_dialog_run(GTK_DIALOG (dialog));
gtk_widget_destroy(dialog);
return -1;
}
return 0;
}
#endif
static void load_options(GOptionContext *context)
{
static GOptionEntry entries[] =
{
{ "config-file", 'c', 0, G_OPTION_ARG_FILENAME, &program_config_filename_and_path, N_( "Fixed path and filename for load/save the configuration data" ), NULL },
{ "config", 'C', 0, G_OPTION_ARG_STRING, &program_config_file, N_( "Name of configuration file (auto-search)" ), PROGRAM_NAME ".conf" },
{ "host", 'h', 0, G_OPTION_ARG_STRING, &cl_hostname, N_( "Host identifier" ), NULL },
{ "startup-script", 's', 0, G_OPTION_ARG_FILENAME, &startup_script, N_( "Run scripts on startup (Example: script1(arg1,arg2);script2(arg)" ), NULL },
{ "program-data", 'd', 0, G_OPTION_ARG_STRING, &program_data, N_( "Path to search for data and configuration files" ), NULL },
{ "icon", 'i', 0, G_OPTION_ARG_FILENAME, &program_logo, N_( "Path to an image file for program icon" ), NULL },
{ "window-title", 't', 0, G_OPTION_ARG_STRING, &window_title, N_( "Main window title" ), PROGRAM_NAME },
{ "theme", 'T', 0, G_OPTION_ARG_FILENAME, >k_theme, N_( "Theme file (gtkrc)" ), NULL },
{ "log", 'l', 0, G_OPTION_ARG_FILENAME, &log_filename, N_( "Log file" ), NULL },
{ "on-lu", 'L', 0, G_OPTION_ARG_STRING, &on_lu_command, N_( "Command to run when LU name is available" ), NULL },
#ifdef HAVE_PLUGINS
{ "plugins", 'p', 0, G_OPTION_ARG_STRING, &plugin_list, N_( "Full path of plugins to load" ), NULL },
{ "plugin-path", 'P', 0, G_OPTION_ARG_STRING, &plugin_path, N_( "Path to search for plugins" ), NULL },
#endif
{ NULL }
};
const struct lib3270_option *opt = get_3270_option_table(sizeof(struct lib3270_option));
int f;
GOptionEntry entry[2];
GOptionGroup *group;
g_option_context_add_main_entries(context, entries, NULL);
// Trace("%s","Setting default options");
group = g_option_group_new( "lib3270", N_( "3270 options" ), N_( "Show lib3270 options" ), NULL, NULL);
for(f=0;opt[f].name;f++)
{
memset(entry,0,sizeof(GOptionEntry) *2);
entry->long_name = opt[f].name;
switch(opt[f].type)
{
case OPT_BOOLEAN: // FIXME (perry#1#): How can I set a boolean option?
entry->arg = G_OPTION_ARG_NONE;
break;
case OPT_STRING:
entry->arg = G_OPTION_ARG_STRING;
entry->arg_description = *((const gchar **) opt[f].aoff);
break;
case OPT_INTEGER:
entry->arg = G_OPTION_ARG_INT;
break;
default: // Ignore other options.
entry->long_name = NULL;
}
if(entry->long_name)
{
while(*entry->long_name && *entry->long_name == '-')
entry->long_name++;
entry->arg_data = opt[f].aoff;
entry->description = gettext( opt[f].description );
// entry->arg_description;
g_option_group_add_entries(group, entry);
}
}
g_option_context_add_group(context,group);
}
#if defined( HAVE_IGEMAC )
static gboolean ApplicationBlockTermination(GtkOSXApplication *app, gpointer user_data)
{
Trace("%s called",__FUNCTION__);
action_quit(0);
return TRUE;
}
#endif // defined( HAVE_IGEMAC )
int main(int argc, char *argv[])
{
static GOptionContext *context;
int rc = 0;
#ifdef HAVE_LIBGNOME
static GnomeProgram *gnome_program;
#endif
#ifdef LC_ALL
setlocale( LC_ALL, "" );
#endif
#if ! defined( HAVE_IGEMAC )
#if defined( LOCALEDIR )
// http://bo.majewski.name/bluear/gnu/GTK/i18n/
Trace("Localedir: %s",LOCALEDIR);
bindtextdomain(PACKAGE_NAME, LOCALEDIR);
#else
Trace("Localedir: %s",DATAROOTDIR G_DIR_SEPARATOR_S "locale");
bindtextdomain(PACKAGE_NAME, DATAROOTDIR G_DIR_SEPARATOR_S "locale" );
#endif
bind_textdomain_codeset(PACKAGE_NAME, "UTF-8");
textdomain(PACKAGE_NAME);
#endif
#if defined( HAVE_IGEMAC )
context = g_option_context_new (_("- 3270 Emulator for Gtk-OSX"));
load_options(context);
g_thread_init(NULL);
gtk_init(&argc, &argv);
osxapp = g_object_new(GTK_TYPE_OSX_APPLICATION, NULL);
{
gchar *ptr = g_build_filename(gtk_osxapplication_get_bundle_path(osxapp),"Contents","Resources",LOCALEDIR,NULL);
bindtextdomain(PACKAGE_NAME, ptr);
bind_textdomain_codeset(PACKAGE_NAME, "UTF-8");
textdomain(PACKAGE_NAME);
g_free(ptr);
}
if(parse_option_context(context,&argc, &argv))
return -1;
g_signal_connect(G_OBJECT(osxapp), "NSApplicationBlockTermination", GTK_SIGNAL_FUNC(ApplicationBlockTermination), 0);
#elif defined( HAVE_LIBGNOME )
context = g_option_context_new (_("- 3270 Emulator for Gnome"));
load_options(context);
gnome_program = gnome_program_init ( PACKAGE_NAME,
PACKAGE_VERSION,
LIBGNOMEUI_MODULE,
argc, argv,
GNOME_PARAM_GOPTION_CONTEXT, context,
GNOME_PARAM_HUMAN_READABLE_NAME, _("3270 Emulator"),
NULL
);
client = gnome_master_client();
gtk_signal_connect(GTK_OBJECT(client), "save_yourself", GTK_SIGNAL_FUNC(save_session), argv[0]);
gtk_signal_connect(GTK_OBJECT(client), "die", GTK_SIGNAL_FUNC(session_die), NULL);
Trace("Gnome session setup for client %p finished",client);
#else
context = g_option_context_new (_("- 3270 Emulator for GTK+"));
load_options(context);
g_thread_init(NULL);
gtk_init(&argc, &argv);
if(parse_option_context(context,&argc, &argv))
return -1;
#endif
if(!program_data)
{
#if defined( HAVE_IGEMAC )
program_data = g_build_filename(gtk_osxapplication_get_bundle_path(osxapp),"Contents","Resources",NULL);
printf("Program data: %s\n",program_data);
#elif defined( WIN32 )
gchar *ptr = g_path_get_dirname(argv[0]);
g_chdir(ptr);
g_free(ptr);
program_data = g_get_current_dir();
#elif defined( DATAROOTDIR )
program_data = DATAROOTDIR G_DIR_SEPARATOR_S PROGRAM_NAME;
g_chdir(program_data);
#else
#error DATAROOTDIR is undefined
#endif
}
Trace("Program data: \"%s\"",program_data);
if(program_init())
return -1;
Trace("%s","Loading plugins");
LoadPlugins();
Trace("Initializing library with %s...",argv[0]);
hSession = new_3270_session(GetString("Terminal","Model",""));
if(rc)
{
GtkWidget *dialog = gtk_message_dialog_new( NULL,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CANCEL,
"%s", _( "3270 library failed to start" ));
gtk_window_set_title(GTK_WINDOW(dialog),_( "Can't start" ));
gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), _( "Return code was %d" ), rc);
gtk_dialog_run(GTK_DIALOG (dialog));
gtk_widget_destroy(dialog);
return rc;
}
LoadColors();
init_gui_toggles();
if(CreateTopWindow())
{
GtkWidget *dialog = gtk_message_dialog_new( NULL,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CANCEL,
"%s", _( "Top window failed to start" ));
gtk_window_set_title(GTK_WINDOW(dialog),_( "Can't start" ));
gtk_dialog_run(GTK_DIALOG (dialog));
gtk_widget_destroy(dialog);
return -1;
}
connect_main(hSession,0,NULL);
connect_in3270(hSession,0,NULL);
register_schange(ST_CONNECT, connect_main);
register_schange(ST_3270_MODE, connect_in3270);
// Trace("Topwindow: %p (%d) terminal: %p (%d)",topwindow,GTK_IS_WIDGET(topwindow),terminal,GTK_IS_WIDGET(terminal));
register_tchange(FULL_SCREEN,set_fullscreen);
register_tchange(MONOCASE,set_monocase);
update_toggle_actions();
if(!startup_script)
{
// No startup script, show main window
gtk_widget_show(topwindow);
gtk_widget_grab_focus(terminal);
gtk_widget_grab_default(terminal);
}
while(gtk_events_pending())
gtk_main_iteration();
/* Connect to the host. */
screen_suspend(hSession);
if(cl_hostname != CN)
SetString("Network","Hostname",cl_hostname);
else
cl_hostname = GetString("Network","Hostname",CN);
if(TOGGLED_CONNECT_ON_STARTUP)
action_connect(0);
if(topwindow)
{
screen_resume(hSession);
screen_disp(hSession);
// Start plugins after the creation of main loop
g_timeout_add((guint) 10, (GSourceFunc) StartPlugins, (gpointer) startup_script);
// Run main loop
#if defined( HAVE_IGEMAC )
gtk_osxapplication_ready(osxapp);
#endif
gtk_main();
Trace("%s --- Loop de mensagems encerrou",__FUNCTION__);
}
else
{
GtkWidget *dialog = gtk_message_dialog_new( NULL,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CANCEL,
"%s", _( "Program window was destroyed" ));
gtk_window_set_title(GTK_WINDOW(dialog),_( "Program aborted" ));
gtk_dialog_run(GTK_DIALOG (dialog));
gtk_widget_destroy(dialog);
return -1;
}
Trace("%s","Stopping");
StopPlugins();
Trace("%s","Unloading");
UnloadPlugins();
Trace("%s","Releasing config");
CloseConfigFile();
Trace("%s finished (rc=%d)",argv[0],rc);
gtk_exit(rc);
return rc;
}