diff mcabber/src/main.c @ 1426:a64778f5f26b

Implement FIFO named command pipe
author Mikael Berthe <mikael@lilotux.net>
date Mon, 18 Feb 2008 22:59:37 +0100
parents b0cfd9ab4b9f
children 071c8170b7de
line wrap: on
line diff
--- a/mcabber/src/main.c	Sun Feb 17 21:19:58 2008 +0100
+++ b/mcabber/src/main.c	Mon Feb 18 22:59:37 2008 +0100
@@ -43,6 +43,10 @@
 #include "pgp.h"
 #include "otr.h"
 
+#ifdef ENABLE_FIFO
+# include "fifo.h"
+#endif
+
 #ifdef ENABLE_HGCSET
 # include "hgcset.h"
 #endif
@@ -291,6 +295,9 @@
 #ifdef WITH_ASPELL
   puts("Compiled with Aspell support.");
 #endif
+#ifdef ENABLE_FIFO
+  puts("Compiled with FIFO support.");
+#endif
 #ifdef ENABLE_DEBUG
   puts("Compiled with debugging support.");
 #endif
@@ -487,6 +494,11 @@
 
   chatstates_disabled = settings_opt_get_int("disable_chatstates");
 
+#ifdef ENABLE_FIFO
+  /* Initialize FIFO named pipe */
+  fifo_init(settings_opt_get("fifo_name"));
+#endif
+
   if (ret < 0) {
     scr_LogPrint(LPRINT_NORMAL, "No configuration file has been found.");
     scr_ShowBuddyWindow();
@@ -515,6 +527,9 @@
   }
 
   scr_TerminateCurses();
+#ifdef ENABLE_FIFO
+  fifo_deinit();
+#endif
 #ifdef HAVE_LIBOTR
   otr_terminate();
 #endif