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)
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.
AC_INIT(mtr.c)
-AM_INIT_AUTOMAKE(mtr, 0.53)
+AM_INIT_AUTOMAKE(mtr, 0.54)
AC_SUBST(GTK_OBJ)
AC_SUBST(CURSES_OBJ)
#include <time.h>
extern char LocalHostname[];
+
void pwcenter(char *str) {
int maxx, maxy;
int cx;
}
int mtr_curses_keyaction() {
- char c = getch();
+ int c = getch();
if(tolower(c) == 'q')
return ActionQuit;
return ActionDisplay;
if (tolower(c) == 'n')
return ActionDNS;
+ if (c == '+')
+ return ActionScrollDown;
+ if (c == '-')
+ return ActionScrollUp;
return 0;
}
max = net_max();
- for(at = 0; at < max; at++) {
+ for(at = display_offset; at < max; at++) {
printw("%2d. ", at + 1);
addr = net_addr(at);
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;
max = net_max();
- for (at = 0; at < max; at++) {
+ for (at = display_offset; at < max; at++) {
printw("%2d. ", at+1);
addr = net_addr(at);
*/
enum { ActionNone, ActionQuit, ActionReset, ActionDisplay, ActionClear,
- ActionPause, ActionResume, ActionDNS };
+ ActionPause, ActionResume, ActionDNS, ActionScrollDown, ActionScrollUp };
enum { DisplayReport, DisplayCurses, DisplayGTK, DisplaySplit, DisplayRaw };
/* Prototypes for display.c */
extern int display_mode;
extern int use_dns;
extern int dns;
+extern int display_offset; /* only used in text mode */
double dnsinterval;
static struct timeval intervaltime;
+int display_offset = 0;
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;
}