comparison mcabber/src/main.c @ 1359:7daf906fbcdc

The command /quit can be used in bindings, hooks and sourced files (It used to work in bindings only)
author Mikael Berthe <mikael@lilotux.net>
date Sun, 11 Nov 2007 13:05:57 +0100
parents d1d12a09b04a
children 6d4770f35ddd
comparison
equal deleted inserted replaced
1358:005df14df743 1359:7daf906fbcdc
48 #endif 48 #endif
49 49
50 #ifndef WAIT_ANY 50 #ifndef WAIT_ANY
51 # define WAIT_ANY -1 51 # define WAIT_ANY -1
52 #endif 52 #endif
53
54 static unsigned int terminate_ui;
53 55
54 static struct termios *backup_termios; 56 static struct termios *backup_termios;
55 57
56 char *mcabber_version(void) 58 char *mcabber_version(void)
57 { 59 {
334 #else /* not HAVE_GPGME */ 336 #else /* not HAVE_GPGME */
335 scr_LogPrint(LPRINT_LOGNORM, "WARNING: not compiled with PGP support"); 337 scr_LogPrint(LPRINT_LOGNORM, "WARNING: not compiled with PGP support");
336 #endif /* HAVE_GPGME */ 338 #endif /* HAVE_GPGME */
337 } 339 }
338 340
341 void mcabber_set_terminate_ui(void)
342 {
343 terminate_ui = TRUE;
344 }
345
339 int main(int argc, char **argv) 346 int main(int argc, char **argv)
340 { 347 {
341 char *configFile = NULL; 348 char *configFile = NULL;
342 const char *optstring; 349 const char *optstring;
343 int optval, optval2; 350 int optval, optval2;
470 mcabber_connect(); 477 mcabber_connect();
471 } 478 }
472 479
473 scr_LogPrint(LPRINT_DEBUG, "Entering into main loop..."); 480 scr_LogPrint(LPRINT_DEBUG, "Entering into main loop...");
474 481
475 for (ret = 0 ; ret != 255 ; ) { 482 while (!terminate_ui) {
476 scr_DoUpdate(); 483 scr_DoUpdate();
477 scr_Getch(&kcode); 484 scr_Getch(&kcode);
478 485
479 if (kcode.value != ERR) { 486 if (kcode.value != ERR) {
480 ret = process_key(kcode); 487 process_key(kcode);
481 } else { 488 } else {
482 scr_CheckAutoAway(FALSE); 489 scr_CheckAutoAway(FALSE);
483 490
484 if (update_roster) 491 if (update_roster)
485 scr_DrawRoster(); 492 scr_DrawRoster();