]> git.ipfire.org Git - thirdparty/mtr.git/commitdiff
mtr v0.54 v0.54
authorRoger Wolff <r.e.wolff@bitwizard.nl>
Sat, 3 May 2003 00:00:00 +0000 (00:00 +0000)
committerTravis Cross <tc@traviscross.com>
Sun, 3 Feb 2013 20:45:37 +0000 (20:45 +0000)
 - Added "scrolling" patch from Roland Illig, to allow scrolling in
   text mode. I've always wanted this......

source: ftp://ftp.bitwizard.nl/mtr/mtr-0.54.tar.gz

AUTHORS
NEWS
configure.in
curses.c
display.h
select.c

diff --git a/AUTHORS b/AUTHORS
index 746b50d74cf664f555b1263379d4d6b39dc179e0..ff20499e629810a2d46c055b7d64a7857eb65dff 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -37,6 +37,7 @@
         Christophe Kalt
         Steve Kann (stevek@spheara.horizonlive.com)
         Brett Johnson (brett@jdacareers.com)
+        Roland Illig (roland.illig@gmx.de)
         Damian Gryski (dgryski@uwaterloo.ca)
         Mircea Damian
         Cougar (cougar@random.ee)
diff --git a/NEWS b/NEWS
index 20d194d006ca0814038a2c0616145ef27ab45e07..66ac13e3ae331db26f6c39660870e2cf02dc8d17 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,8 @@
 WHAT'S NEW?
+  v0.54 Added "scrolling" patch from Roland Illig, to allow 
+        scrolling in text mode. I've always wanted this......
+  v0.53 Added fix for raw mode. 
 
   v0.52 Mostly cleanups from Brett Johnson on MacOS X. It may 
         clean up some compilation problems on MacOS X as well. 
index 260b34799a07cc2fdc10b93bf443915be40375b7..08f5499d634d2f2139c808351001cfd7f4b9539c 100644 (file)
@@ -1,5 +1,5 @@
 AC_INIT(mtr.c)
-AM_INIT_AUTOMAKE(mtr, 0.53)
+AM_INIT_AUTOMAKE(mtr, 0.54)
 
 AC_SUBST(GTK_OBJ)
 AC_SUBST(CURSES_OBJ)
index ab6cc3920e61f1ee6c0a89848ba3b411a9272d3b..d9bd20d71d1c24dbe1e38a00035f066de822fdfc 100644 (file)
--- a/curses.c
+++ b/curses.c
@@ -61,6 +61,7 @@
 #include <time.h>
 extern char LocalHostname[];
 
+
 void pwcenter(char *str) {
   int maxx, maxy;
   int cx;
@@ -73,7 +74,7 @@ void pwcenter(char *str) {
 }
 
 int mtr_curses_keyaction() {
-  char c = getch();
+  int c = getch();
 
   if(tolower(c) == 'q')
     return ActionQuit;
@@ -91,6 +92,10 @@ int mtr_curses_keyaction() {
     return ActionDisplay;
   if (tolower(c) == 'n')
     return ActionDNS;
+  if (c == '+')
+    return ActionScrollDown;
+  if (c == '-')
+    return ActionScrollUp;
 
   return 0;
 }
@@ -104,7 +109,7 @@ void mtr_curses_hosts(int startstat) {
 
   max = net_max();
 
-  for(at = 0; at < max; at++) {
+  for(at = display_offset; at < max; at++) {
     printw("%2d. ", at + 1);
     addr = net_addr(at);
 
@@ -154,7 +159,7 @@ void mtr_gen_scale(void) {
                scale[i] = 0;
        }
        max = net_max();
-       for (at = 0; at < max; at++) {
+       for (at = display_offset; at < max; at++) {
                saved = net_saved_pings(at);
                for (i = 0; i < SAVED_PINGS; i++) {
                        if (saved[i] < 0) continue;
@@ -218,7 +223,7 @@ void mtr_curses_graph(int startstat, int cols) {
 
        max = net_max();
 
-       for (at = 0; at < max; at++) {
+       for (at = display_offset; at < max; at++) {
                printw("%2d. ", at+1);
 
                addr = net_addr(at);
index 99131d9fffc4923547a36b7fc95e7c2c7a22f09f..0c4bdd6ce9493abc16532d26deded379aede766a 100644 (file)
--- a/display.h
+++ b/display.h
@@ -18,7 +18,7 @@
 */
 
 enum { ActionNone, ActionQuit, ActionReset, ActionDisplay, ActionClear,
-       ActionPause, ActionResume, ActionDNS };
+       ActionPause, ActionResume, ActionDNS, ActionScrollDown, ActionScrollUp };
 enum { DisplayReport, DisplayCurses, DisplayGTK, DisplaySplit, DisplayRaw };
 
 /*  Prototypes for display.c  */
@@ -35,3 +35,4 @@ void display_clear();
 extern int display_mode;
 extern int use_dns;
 extern int dns;
+extern int display_offset; /* only used in text mode */
index 04dad82613c6f576b0834a18844393523ceb00e2..1ce0d86d7bbd4adefd1da5ccbf9826ff8d405a63 100644 (file)
--- a/select.c
+++ b/select.c
@@ -39,6 +39,7 @@ extern float WaitTime;
 double dnsinterval;
 
 static struct timeval intervaltime;
+int display_offset = 0;
 
 
 void select_loop() {
@@ -164,6 +165,15 @@ void select_loop() {
        display_clear();
       }
 
+      if (action == ActionScrollDown) {
+        display_offset += 5;
+      } else if (action == ActionScrollUp) {
+        display_offset -= 5;
+       if (display_offset < 0) {
+         display_offset = 0;
+       }
+      }
+
       anyset = 1;
     }