[AS_HELP_STRING([--without-ncurses], [Build without the ncurses interface])],
[], [with_ncurses=yes])
AS_IF([test "x$with_ncurses" = "xyes"],
- [PKG_CHECK_MODULES([NCURSES], [ncurses], [
- AC_DEFINE([HAVE_NCURSES], [1], [Define if ncurses library available])
- AC_CHECK_LIB([ncurses],
- [use_default_colors],
- [AC_DEFINE([HAVE_USE_DEFAULT_COLORS], [1],
- [Define this if your curses library has the use_default_colors() command.]
- )
- ])
- ],
- [with_ncurses=no])
+ [AC_CHECK_LIB([ncurses], [initscr], [], [with_ncurses=no])
])
AM_CONDITIONAL([WITH_NCURSES], [test "x$with_ncurses" = xyes])
raw();
noecho();
start_color();
-#ifdef HAVE_USE_DEFAULT_COLORS
if (use_default_colors() == OK)
bg_col = -1;
-#endif
for (i = 0; i < NUM_FACTORS; i++)
init_pair(i+1, i, bg_col);
#include "dns.h"
#include "asn.h"
-#ifdef HAVE_NCURSES
+#ifdef HAVE_LIBNCURSES
# include "mtr-curses.h"
#endif
#include "split.h"
-#ifdef HAVE_NCURSES
+#ifdef HAVE_LIBNCURSES
# define DEFAULT_DISPLAY DisplayCurses
#else
# define DEFAULT_DISPLAY DisplayReport
case DisplayCSV:
csv_open();
break;
-#ifdef HAVE_NCURSES
+#ifdef HAVE_LIBNCURSES
case DisplayCurses:
mtr_curses_open(ctl);
# ifdef HAVE_IPINFO
case DisplayCSV:
csv_close(ctl, now);
break;
-#ifdef HAVE_NCURSES
+#ifdef HAVE_LIBNCURSES
case DisplayCurses:
# ifdef HAVE_IPINFO
asn_close(ctl);
{
switch(ctl->DisplayMode) {
-#ifdef HAVE_NCURSES
+#ifdef HAVE_LIBNCURSES
case DisplayCurses:
mtr_curses_redraw(ctl);
break;
extern int display_keyaction(struct mtr_ctl *ctl)
{
switch(ctl->DisplayMode) {
-#ifdef HAVE_NCURSES
+#ifdef HAVE_LIBNCURSES
case DisplayCurses:
return mtr_curses_keyaction(ctl);
#endif
extern void display_clear(struct mtr_ctl *ctl)
{
-#ifdef HAVE_NCURSES
+#ifdef HAVE_LIBNCURSES
if (ctl->DisplayMode == DisplayCurses)
mtr_curses_clear(ctl);
#endif
enum {
DisplayReport,
-#ifdef HAVE_NCURSES
+#ifdef HAVE_LIBNCURSES
DisplayCurses,
#endif
#ifdef HAVE_GTK
fputs(" -C, --csv output comma separated values\n", out);
fputs(" -l, --raw output raw format\n", out);
fputs(" -p, --split split output\n", out);
-#ifdef HAVE_NCURSES
+#ifdef HAVE_LIBNCURSES
fputs(" -t, --curses use curses terminal interface\n", out);
#endif
fputs(" --displaymode MODE select initial display mode\n", out);
{ "report", 0, NULL, 'r' },
{ "report-wide", 0, NULL, 'w' },
{ "xml", 0, NULL, 'x' },
-#ifdef HAVE_NCURSES
+#ifdef HAVE_LIBNCURSES
{ "curses", 0, NULL, 't' },
#endif
#ifdef HAVE_GTK
ctl->reportwide = 1;
ctl->DisplayMode = DisplayReport;
break;
-#ifdef HAVE_NCURSES
+#ifdef HAVE_LIBNCURSES
case 't':
ctl->DisplayMode = DisplayCurses;
break;
#include "split.h"
#include "utils.h"
-#ifdef HAVE_NCURSES
+#ifdef HAVE_LIBNCURSES
# if defined(HAVE_NCURSES_H)
# include <ncurses.h>
# elif defined(HAVE_NCURSES_CURSES_H)
extern int split_keyaction(void)
{
-#ifdef HAVE_NCURSES
+#ifdef HAVE_LIBNCURSES
char c = getch();
#else
fd_set readfds;