#ifdef HAVE_NCURSES
#include "mtr-curses.h"
-#else
-// No support for curses mode, allow the calls to remain in the code.
-#define mtr_curses_open()
-#define mtr_curses_close()
-#define mtr_curses_redraw()
-#define mtr_curses_keyaction() 0
-#define mtr_curses_clear()
#endif
#ifdef HAVE_GTK
#include "mtr-gtk.h"
-#else
-// No support for gtk mode, allow the calls to remain in the code.
-#define gtk_open()
-#define gtk_close()
-#define gtk_redraw()
-#define gtk_keyaction() 0
-#define gtk_loop() {fprintf (stderr, "No GTK support. Sorry.\n"); exit(EXIT_FAILURE); }
#endif
#include "split.h"
-#ifndef HAVE_IPINFO
-// No support for IPINFO allow the calls to remain in the main code.
-#define asn_open()
-#define asn_close()
-#endif
-
#ifdef HAVE_NCURSES
#define DEFAULT_DISPLAY DisplayCurses
#else
case DisplayCSV:
csv_open();
break;
+#ifdef HAVE_NCURSES
case DisplayCurses:
mtr_curses_open();
+#ifdef HAVE_IPINFO
asn_open();
+#endif
break;
+#endif
case DisplaySplit:
split_open();
break;
+#ifdef HAVE_GTK
case DisplayGTK:
gtk_open();
+#ifdef HAVE_IPINFO
asn_open();
+#endif
break;
+#endif
}
}
case DisplayCSV:
csv_close(now);
break;
+#ifdef HAVE_NCURSES
case DisplayCurses:
+#ifdef HAVE_IPINFO
asn_close();
+#endif
mtr_curses_close();
break;
+#endif
case DisplaySplit:
split_close();
break;
+#ifdef HAVE_GTK
case DisplayGTK:
gtk_close();
break;
+#endif
}
}
{
switch(DisplayMode) {
+#ifdef HAVE_NCURSES
case DisplayCurses:
mtr_curses_redraw();
break;
+#endif
case DisplaySplit:
split_redraw();
break;
+#ifdef HAVE_GTK
case DisplayGTK:
gtk_redraw();
break;
+#endif
}
}
int display_keyaction(void)
{
switch(DisplayMode) {
+#ifdef HAVE_NCURSES
case DisplayCurses:
return mtr_curses_keyaction();
+#endif
case DisplaySplit:
return split_keyaction();
+#ifdef HAVE_GTK
case DisplayGTK:
return gtk_keyaction();
+#endif
}
return 0;
}
case DisplayXML:
case DisplayCSV:
case DisplaySplit:
+#ifdef HAVE_NCURSES
case DisplayCurses:
+#endif
+#ifdef HAVE_GTK
case DisplayGTK:
+#endif
break;
case DisplayRaw:
raw_rawping (host, msec, seq);
case DisplayXML:
case DisplayCSV:
case DisplaySplit:
+#ifdef HAVE_NCURSES
case DisplayCurses:
+#endif
+#ifdef HAVE_GTK
case DisplayGTK:
+#endif
break;
case DisplayRaw:
raw_rawhost (host, ip_addr);
case DisplayXML:
case DisplayCSV:
case DisplaySplit:
+#ifdef HAVE_NCURSES
case DisplayCurses:
+#endif
case DisplayRaw:
select_loop();
break;
+#ifdef HAVE_GTK
case DisplayGTK:
gtk_loop();
break;
+#endif
}
}
void display_clear(void)
{
switch(DisplayMode) {
+#ifdef HAVE_NCURSES
case DisplayCurses:
mtr_curses_clear();
break;
+#endif
case DisplayReport:
case DisplayTXT:
case DisplayJSON:
case DisplayRaw:
break;
+#ifdef HAVE_GTK
case DisplayGTK:
break;
+#endif
}
}
ActionII, ActionAS,
#endif
ActionScrollDown, ActionScrollUp };
-enum { DisplayReport, DisplayCurses, DisplayGTK, DisplaySplit,
- DisplayRaw, DisplayXML, DisplayCSV, DisplayTXT, DisplayJSON};
+
+enum {
+ DisplayReport,
+#ifdef HAVE_NCURSES
+ DisplayCurses,
+#endif
+#ifdef HAVE_GTK
+ DisplayGTK,
+#endif
+ DisplaySplit,
+ DisplayRaw,
+ DisplayXML,
+ DisplayCSV,
+ DisplayTXT,
+ DisplayJSON
+};
/* Prototypes for display.c */
void display_detect(int *argc, char ***argv);