wmifs: Delete trailing whitespace.

This commit is contained in:
Doug Torrance 2014-10-22 16:34:41 -05:00 committed by Carlos R. Mafra
parent 44300ffec2
commit a62dcaebc7
12 changed files with 163 additions and 163 deletions

View file

@ -6,7 +6,7 @@ WMiFS-1.3b
* First initial BETA release, WMiFS is now a separate
package, due to the mayor rewrite, there probably
will be some ;-)
WMPPP/WMiFS 1.2p1
--------------------------------------------------------------
@ -21,26 +21,26 @@ WMPPP/WMiFS 1.2p1
one, but we're looking into this.
* WMPPP: ppp0 is still hardcoded (sigh), will be fixed.
* WMiFS: SEGV with the dummy interface, we're looking
into this (needs to be ignored like lo).
into this (needs to be ignored like lo).
* WMiFS: Manages to get X CPU usage way to high on
some systems somehow (reported myself) :)
* Special thanks to Marcelo <mmagallo@efis.ucr.ac.cr>
for providing some real usefull patches for WMPPP,
they will be in the next update for sure!
they will be in the next update for sure!
WMPPP/WMiFS 1.2
--------------------------------------------------------------
* The pixmap 'shift' in AfterStep's Wharf seems
not to be our fault, but a bug in Wharf!
Please notify the authors of AfterStep about
this if you like to see this fixed, Wharf can't
handle pixmaps that are larger than 60x60 pixels
very well :(
* Most code is yet again quite rewritten, but we
think all previous annoyances are gone now ;-)

View file

@ -1,22 +1,22 @@
Version Description
--------------------------------------------------------------
1.3b * Released 980513
* Splitted up WMPPP and WMiFS into separate programs.
* WMiFS now uses our 'newstyle' shared dockapps code,
it's quite rewritten again.
* WMiFS now reads /proc/dev/net instead of /proc/net/route.
* Changed the RC file parsing and handling again.
* Now ignores DUMMY interface too :)
* Fixed the 'Zombie' bug :)
* Better 'execvp' code :)
* Vastly reduced X CPU usage :)
@ -31,72 +31,72 @@ Version Description
* Updated the WMPPP rc files, again, due to some last
minute changes in the code, WMPPP's rc files where
no longer working properly.
no longer working properly.
1.2 * Released 980429
* Completely revamped the WMPPP & WMiFS GUI :)
* Added 'forceleft, forcemiddle and forceright'
options in WMiFS for 'real' multiuser systems,
when 'force*' is detected in /etc/wmifsrc the
user settings in ~/.wmifsrc are overridden
(usefull for sites where users may not fiddle
with pppd's options :)
* WMPPP: Ditto, added 'force' facility here too
* WMPPP: now correctly redisplays time when killed
and restarted
* WMPPP: timer now starts to run when the actual
connection is made
* WMPPP: added BAUD CONNECT value display
* WMPPP: added 'getmodemspeed', a SUID proggie to
read the CONNECT value from /var/log/messages
* WMPPP: dropped the config GUI and added an
.wmppprc file instead > motivation to do so:
this way, WMPPP is much more platform and
distribution independant :)
* WMPPP: enhanced the status LED, yellow means
dialing, green means online, red means error
* WMPPP: added -display commandline option
* WMPPP: added -t commandline option, default
the timer will display HH:MM, -t will display
MM:SS and switch to HH:MM after 60 minutes
* WMiFS: added support for all interfaces in
/proc/net/, now all interfaces are supported :)
* WMiFS: added -display commandline option
* WMiFS: added -w commandline option, this will
draw the graph in our new 'waveform' look :)
* WMiFS: fixed the coredump problems that occured
on some systems with or without .wmifsrc file
typo's, errors, etc. in the .wmifsrc file are
typo's, errors, etc. in the .wmifsrc file are
now also being ignored/rejected, the worst
thing that can happen now is that the scripts
do not execute (i.e. luser error) ;-)
* WMiFS: when monitoring a ppp interface, bytes
are used to draw the graph, otherwise packets
* WMiFS: made the RX/TX/Status LED box identical
to the one in WMPPP, the right LED is the status
LED, green means interface is working, red means
error (interface down, NIC broken, etc.)
1.1 - Released 980407
1.1 - Released 980407
- Added WMiFS, the no button more stats version
- All ppp/eth load graphs are now autoscaling
- Autosensing of all active ppp/eth interfaces
@ -118,7 +118,7 @@ Version Description
Bugfixes
1.0pre6 - Not released, developers release
Redesigned WMPPP's dock.app GUI
Redesigned WMPPP's dock.app GUI
Added failsave Yes/No disconnect
requester
Some code cleaning

View file

@ -16,7 +16,7 @@ Without the -i option (wmifs &) WMiFS automagicly
grabs the default interface and will display the
name and statistics of that interface.
You can cycle in realtime through all available
You can cycle in realtime through all available
active interfaces by simply clicking with the left
mousebutton on the interface name gadget in the
upperleft corner of WMiFS...
@ -29,7 +29,7 @@ lo was mainly build in for testing purposes ;-)
WindowMaker
--------------------------------------------------------------
WindowMaker users simply drag and drop the WMiFS dock.app on
the WindowMaker Dock (preferred) or on the Fiend, and then
the WindowMaker Dock (preferred) or on the Fiend, and then
press the rightmouse button on the outer edges of WMiFS and
then enable 'Autolaunch' from the Dock/Fiend popup menu.
@ -52,16 +52,16 @@ shaped icon on your desktop.
p.s. FVWM can swallow it too, so we've heard ;-)
Dragging WMiFS
Dragging WMiFS
--------------------------------------------------------------
Be sure to drag WMIFS on it's outer edges, it's a bit
Be sure to drag WMIFS on it's outer edges, it's a bit
picky due to the large gfx pixmap it keeps ;-)
Setting up the WMiFS RC file
--------------------------------------------------------------
WMIFS can (optionally) launch your ppp scripts with a simple
left mouse click on the interface statistics display.
left mouse click on the interface statistics display.
You may define your settings in ~/.wmifsrc like:
@ -70,9 +70,9 @@ middle: /home/foobar/MyPPP-disconnect-script
right: /home/foobar/MyPPP-reconnect-script
Note: If you run a site where users may not fiddle with the
PPP scripts, read INSTALL > Info For Site Admins!
PPP scripts, read INSTALL > Info For Site Admins!
Creating PPP dialup scripts
--------------------------------------------------------------
Because a very good PPP HowTo already exists,
@ -86,7 +86,7 @@ very easy to create your own PPP scripts ;-)
Permissions to allow non-root WMPPP connections
--------------------------------------------------------------
WMiFS will connect just fine when run as root, but if you want
to run WMiFS as a non-root user, there are a few files and
to run WMiFS as a non-root user, there are a few files and
programs to make permissions changes to.
WMiFS needs access to the device file your modem is on, so if
@ -98,7 +98,7 @@ Change the permissions so that it is world read/writable:
The pppd daemon also makes calls to the kernel which require root
permissions. The pppd daemon must be owned by root, and then have
it's set-user-id bit turned on. This way, the pppd daemon will
always run as SUID root. Change the owner and SUID bit like:
always run as SUID root. Change the owner and SUID bit like:
chown root.root pppd
chmod +s pppd

View file

@ -1,9 +1,9 @@
Installation instructions for WMiFS.
Installation instructions for WMiFS.
NOTE!
--------------------------------------------------------------
Installing this program requires root privileges, ask your
Installing this program requires root privileges, ask your
local system/network administrator kindly if she/he wants
to install this software for you ;-)
@ -22,7 +22,7 @@ Installation
--------------------------------------------------------------
1) % tar -zxvf wmifs-1.3b.tar.gz
2)* % cd wmifs.app/wmifs
3) % make
3) % make
4) % su root
5) # make install
6)* # vi ~/.wmifsrc and/or /etc/wmifsrc
@ -38,14 +38,14 @@ Installation
it's entirely up to you ;-)
Extra Install Info For Site Administrators!
--------------------------------------------------------------
For site administrators who don't want their users messing
up pppd's configuration files, WMiFS now supports an
/etc/wmifsrc.fixed file.
up pppd's configuration files, WMiFS now supports an
/etc/wmifsrc.fixed file.
The installation will install the normal user and global
The installation will install the normal user and global
wmifsrc files in $HOME and /etc, NOT the fixed one!
WMiFS scan for 3 files at startup, in the following order:
@ -53,16 +53,16 @@ WMiFS scan for 3 files at startup, in the following order:
1. /etc/wmifsrc
2. $HOME/.wmifsrc
3. /etc/wmifsrc.fixed
If no .wmifsrc file is found in the users home directory,
WMiFS will use the global one (/etc/wmifsrc, if present
WMiFS will use the global one (/etc/wmifsrc, if present
and valid).
When WMiFS finds a /etc/wmifs.fixed file, all settings
that WMiFS detected in /etc/wmifsrc and/or $HOME/.wmifsrc
will be discarted i.e. OVERRIDDEN!
will be discarted i.e. OVERRIDDEN!
If you want your users to be able to dialout, but you
If you want your users to be able to dialout, but you
don't want them to mess around, simply move or copy
the default /etc/wmifsrc to /etc/wmifsrc.fixed :)
@ -82,7 +82,7 @@ WMiFS support the following commandline options:
-i interface name, note: 'lo' can ONLY
be specified with '-i lo' ;-)
(default = default interface as it
appears in /proc/net/route)
appears in /proc/net/route)
-w draw the statistics graph in waveform
like mode, try it! (default = normal)
-v print wmifs version number
@ -95,5 +95,5 @@ Note 1: If "make install" fails on your system, please edit
"make install" defaults to /usr/local/bin, $HOME & /etc.
Note 2: Please DO read the HINTS, this file contains some
very usefull tips about WMiFS.
very usefull tips about WMiFS.

View file

@ -2,16 +2,16 @@ WMiFS-1.3b - The public BETA release
--------------------------------------------------------------
Authors...: Martijn Pieterse (pieterse@xs4all.nl)
Antoine Nulle (warp@xs4all.nl)
Note......: WMiFS has it's own mailbox, as our pop3 accounts
are already way too crowded :)
Please mail bugreports, comments, suggestions,
requests and flames to:
dockapps@windowmaker.mezaway.org
The official WMiFS support website address:
http://windowmaker.mezaway.org
Credits...: Bobby Mezaway (bobby@mezaway.org) for generously
@ -26,7 +26,7 @@ nice & nifty features like:
* Autosensing of *ALL* active network interfaces;
* Integrated autoscaling (per interface) transfer
statistics, tested upto 100Mbit;
statistics, tested upto 100Mbit;
* Displays a 'normal' xload style graph or our new
'waveform' like load graph;
* Realtime cycling through active interfaces by simply
@ -39,7 +39,7 @@ nice & nifty features like:
buttons which are read from ~/.wmifsrc (optional);
* Fixed rc file option, usefull for sites where users
are not allowed to mess with pppd;
WMiFS is developped on DEC Alpha machines running RedHat-5.0/Linux,
but, WMiFS has also been intensively tested on x86 and 68K RedHat/
Linux machines ;-)
@ -54,11 +54,11 @@ BUGS Things you don't want to know ;-)
CHANGES Description of changes.
TODO Things we've already planned for WMiFS.
COPYING GNU General Public License Version 2.
Bugs
--------------------------------------------------------------
If you discover any bugs in this software, please send a
If you discover any bugs in this software, please send a
bugreport to dockapps@windowmaker.mezaway.org and describe
the problem as detailed as you can.
@ -66,7 +66,7 @@ the problem as detailed as you can.
Copyright
--------------------------------------------------------------
WMiFS.app is copyright (c) 1997, 1998 by Martijn Pieterse and
Antoine Nulle and licensed through the GNU General Public License.
Antoine Nulle and licensed through the GNU General Public License.
Read the COPYING file for the complete GNU license.

View file

@ -3,7 +3,7 @@ TODO list for WMiFS.
* Commandline option for LED colors;
* Optional LCD GUI, either compile or runtime;
* Make the status LED also display collisions;
Your feedback! If you have nice suggestions, ideas, whatever,
that aren't on this list, feel free to mail them to:

View file

@ -1,11 +1,11 @@
/* Generic single linked list to keep various information
/* Generic single linked list to keep various information
Copyright (C) 1993, 1994 Free Software Foundation, Inc.
Author: Kresten Krab Thorup
Many modifications by Alfredo K. Kojima
This file is part of GNU CC.
@ -38,7 +38,7 @@ Boston, MA 02111-1307, USA. */
/* Return a cons cell produced from (head . tail) */
INLINE LinkedList*
INLINE LinkedList*
list_cons(void* head, LinkedList* tail)
{
LinkedList* cell;
@ -63,7 +63,7 @@ list_length(LinkedList* list)
return i;
}
/* Return the Nth element of LIST, where N count from zero. If N
/* Return the Nth element of LIST, where N count from zero. If N
larger than the list length, NULL is returned */
INLINE void*
@ -84,7 +84,7 @@ list_nth(int index, LinkedList* list)
INLINE void
list_remove_head(LinkedList** list)
{
if (!*list) return;
if (!*list) return;
if ((*list)->tail)
{
LinkedList* tail = (*list)->tail; /* fetch next */
@ -116,7 +116,7 @@ INLINE LinkedList *
list_remove_elem(LinkedList* list, void* elem)
{
LinkedList *tmp;
if (list) {
if (list->head == elem) {
tmp = list->tail;

View file

@ -1,4 +1,4 @@
/* Generic single linked list to keep various information
/* Generic single linked list to keep various information
Copyright (C) 1993, 1994 Free Software Foundation, Inc.
Author: Kresten Krab Thorup

View file

@ -1,9 +1,9 @@
/* dock.c- built-in Dock module for WindowMaker
*
*
* WindowMaker window manager
*
*
* Copyright (c) 1997 Alfredo K. Kojima
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@ -28,7 +28,7 @@
*----------------------------------------------------------------------
* parse_command--
* Divides a command line into a argv/argc pair.
*----------------------------------------------------------------------
*----------------------------------------------------------------------
*/
#define PRC_ALPHA 0
#define PRC_BLANK 1
@ -64,11 +64,11 @@ next_token(char *word, char **next)
t = ret = malloc(strlen(word)+1);
ptr = word;
state = 0;
*t = 0;
while (1) {
if (*ptr==0)
if (*ptr==0)
ctype = PRC_EOS;
else if (*ptr=='\\')
ctype = PRC_ESCAPE;
@ -98,12 +98,12 @@ next_token(char *word, char **next)
t = strdup(ret);
free(ret);
if (ctype==PRC_EOS)
*next = NULL;
else
*next = ptr;
return t;
}
@ -118,7 +118,7 @@ parse_command(char *command, char ***argv, int *argc)
line = command;
do {
token = next_token(line, &line);
if (token) {
if (token) {
list = list_cons(token, list);
}
} while (token!=NULL && line!=NULL);
@ -141,15 +141,15 @@ execCommand(char *command)
int argc;
parse_command(command, &argv, &argc);
if (argv==NULL) {
return 0;
}
if ((pid=fork())==0) {
char **args;
int i;
args = malloc(sizeof(char*)*(argc+1));
if (!args)
exit(10);

View file

@ -124,7 +124,7 @@ static void GetXPM(XpmIcon *wmgen, char *pixmap_bytes[]) {
err = XpmCreatePixmapFromData(display, Root, pixmap_bytes, &(wmgen->pixmap),
&(wmgen->mask), &(wmgen->attributes));
if (err != XpmSuccess) {
fprintf(stderr, "Not enough free colorcells.\n");
exit(1);
@ -171,9 +171,9 @@ static int flush_expose(Window w) {
\*******************************************************************************/
void RedrawWindow(void) {
flush_expose(iconwin);
XCopyArea(display, wmgen.pixmap, iconwin, NormalGC,
XCopyArea(display, wmgen.pixmap, iconwin, NormalGC,
0,0, wmgen.attributes.width, wmgen.attributes.height, 0,0);
flush_expose(win);
XCopyArea(display, wmgen.pixmap, win, NormalGC,
@ -185,9 +185,9 @@ void RedrawWindow(void) {
\*******************************************************************************/
void RedrawWindowXY(int x, int y) {
flush_expose(iconwin);
XCopyArea(display, wmgen.pixmap, iconwin, NormalGC,
XCopyArea(display, wmgen.pixmap, iconwin, NormalGC,
x,y, wmgen.attributes.width, wmgen.attributes.height, 0,0);
flush_expose(win);
XCopyArea(display, wmgen.pixmap, win, NormalGC,
@ -281,12 +281,12 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
int i;
for (i=1; argv[i]; i++) {
if (!strcmp(argv[i], "-display"))
if (!strcmp(argv[i], "-display"))
display_name = argv[i+1];
}
if (!(display = XOpenDisplay(display_name))) {
fprintf(stderr, "%s: can't open display %s\n",
fprintf(stderr, "%s: can't open display %s\n",
wname, XDisplayName(display_name));
exit(1);
}
@ -311,10 +311,10 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
mysizehints.width = 64;
mysizehints.height = 64;
win = XCreateSimpleWindow(display, Root, mysizehints.x, mysizehints.y,
mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
iconwin = XCreateSimpleWindow(display, win, mysizehints.x, mysizehints.y,
mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
@ -335,7 +335,7 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit
XSetWMName(display, win, &name);
/* Create GC for drawing */
gcm = GCForeground | GCBackground | GCGraphicsExposures;
gcv.foreground = fore_pix;
gcv.background = back_pix;

View file

@ -13,7 +13,7 @@
How do I create a not so solid window?
How do I open a window?
How do I use pixmaps?
pppstats
A program that prints the amount of data that
is transferred over a ppp-line.
@ -36,40 +36,40 @@
* only ppp0 will be read
use wmifs if you want to read more than one ppp connection
not sure about this.
* the leds won't be reliable with
* the leds won't be reliable with
more than 1 ppp connection
* there is an iconwin, and win variable.
I have no clue why only win shouldn't
be enough. Will check it out later.
* The afterstep what seems the shift the
pixmap a bit. Don't know how and why.
pixmap a bit. Don't know how and why.
It works in the WindowManager.
Things to do:
Split up main()
----
Thanks
----
Most of the ideas, and jumpstarting it:
#linuxnl, without this irc-channel wmppp would've never seen the light!
CCC (Constructive Code Criticism):
Marcelo E. Magallon
Thanks a LOT! It takes a while to get me convinced... :)
Minor bugs and ideas:
Marc De Scheemaecker / David Mihm / Chris Soghoian /
Alessandro Usseglio Viretta / Dan Pascu
and ofcourse numerous ppl who send us bug reports.
and ofcourse numerous ppl who send us bug reports.
(numerous? hmm.. todo: rephrase this :) )
----
Changes:
@ -78,7 +78,7 @@
* Made wmifs.c libc5 compatible version
04/05/1998 (Martijn Pieterse, pieterse@xs4all.nl)
* Changed the "middle of the waveform" line color
* Moved the RedrawWindow out of the main loop.
* Moved the RedrawWindow out of the main loop.
Lightens the system load
02/05/1998 (Martijn Pieterse, pieterse@xs4all.nl)
* Torn wmppp and wmifs apart.
@ -252,14 +252,14 @@ void get_ppp_stats(struct ppp_stats *cur);
void main(int argc, char *argv[]) {
int i;
/* Parse Command Line */
ProgName = argv[0];
if (strlen(ProgName) >= 5)
ProgName += (strlen(ProgName) - 5);
for (i=1; i<argc; i++) {
char *arg = argv[i];
@ -305,7 +305,7 @@ typedef struct {
int his[55][2];
long istatlast;
long ostatlast;
} stat_dev;
stat_dev stat_devices[MAX_STAT_DEVICES];
@ -362,7 +362,7 @@ void wmifs_routine(int argc, char **argv) {
stat_current = i;
}
}
if (LEFT_ACTION) left_action = strdup(LEFT_ACTION);
if (MIDDLE_ACTION) middle_action = strdup(MIDDLE_ACTION);
if (RIGHT_ACTION) right_action = strdup(RIGHT_ACTION);
@ -417,18 +417,18 @@ void wmifs_routine(int argc, char **argv) {
SetOffLED(LED_NET_RX);
else
SetOnLED(LED_NET_RX);
if (stat_devices[i].ostatlast == ostat)
SetOffLED(LED_NET_TX);
else
SetOnLED(LED_NET_TX);
}
stat_devices[i].istatlast = istat;
stat_devices[i].ostatlast = ostat;
RedrawWindow();
}
if (curtime >= nexttime) {
nexttime+=5;
@ -444,11 +444,11 @@ void wmifs_routine(int argc, char **argv) {
}
stat_devices[i].his[53][0] = 0;
stat_devices[i].his[53][1] = 0;
}
}
}
RedrawWindow();
}
while (XPending(display)) {
XNextEvent(display, &Event);
switch (Event.type) {
@ -479,12 +479,12 @@ void wmifs_routine(int argc, char **argv) {
stat_current = i;
}
}
stat_current++;
if (stat_current == stat_online) stat_current = 0;
DrawActiveIFS(stat_devices[stat_current].name);
DrawStats(&stat_devices[stat_current].his[0][0], 54, 40, 5, 58);
break;
case 1:
@ -503,7 +503,7 @@ void wmifs_routine(int argc, char **argv) {
break;
}
break;
}
}
but_stat = -1;
@ -573,12 +573,12 @@ int get_statistics(char *devname, long *ip, long *op, long *is, long *os) {
struct ppp_stats ppp_cur, ppp_old;
static int ppp_opened = 0;
if (!strncmp(devname, "ppp", 3)) {
if (!ppp_opened) {
/* Open the ppp device. */
memset(&ppp_cur, 0, sizeof(ppp_cur));
if ((ppp_h = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
if ((ppp_h = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
return -1;
get_ppp_stats(&ppp_cur);
ppp_old = ppp_cur;
@ -691,15 +691,15 @@ int checknetdevs(void) {
fgets(temp, 128, fd);
while (fgets(temp, 128, fd)) {
p = strtok(temp, tokens);
/* Skip dummy code */
if (!strncmp(p, "dummy", 5))
continue;
/* If p == "lo", and active_interface (as given on the cmd line) != "lo",
skip it! */
if (strcmp(p, "lo") || (active_interface && !strcmp(active_interface, "lo"))) {
strcpy(foundbuffer[devsfound], p);
devsfound++;
@ -733,16 +733,16 @@ int checknetdevs(void) {
if (j < MAX_STAT_DEVICES && i != j) {
stat_devices[i] = stat_devices[j];
}
j++;
}
i--;
for (j=0; j<MAX_STAT_DEVICES; j++) {
if (foundbuffer[j][0]) {
strcpy(stat_devices[i].name, foundbuffer[j]);
for (k=0; k<48; k++) {
stat_devices[i].his[k][0] = 0;
stat_devices[i].his[k][1] = 0;
@ -793,7 +793,7 @@ void DrawStats(int *his, int num, int size, int x_left, int y_bottom) {
copyXPMArea(100+1, 68, 1, 1, k+x_left, y_bottom-size/2+p2/2);
else
copyXPMArea(100+0, 68, 1, 1, k+x_left, y_bottom-size/2+p2/2);
p2 = (p2 + p3);
p3 *= -1;
p2 *= -1;
@ -862,11 +862,11 @@ void get_ppp_stats(struct ppp_stats *cur) {
#define LED_SZE_X (4)
#define LED_SZE_Y (4)
#define LED_ON_NET_X (87)
#define LED_ON_NET_X (87)
#define LED_ON_NET_Y (66)
#define LED_OFF_NET_X (93)
#define LED_OFF_NET_X (93)
#define LED_OFF_NET_Y (66)
#define LED_ERR_NET_X (81)
#define LED_ERR_NET_X (81)
#define LED_ERR_NET_Y (66)
#define LED_ON_SW_NET_X (49)
#define LED_ON_SW_NET_Y (85)

View file

@ -13,7 +13,7 @@
How do I create a not so solid window?
How do I open a window?
How do I use pixmaps?
pppstats
A program that prints the amount of data that
is transferred over a ppp-line.
@ -36,40 +36,40 @@
* only ppp0 will be read
use wmifs if you want to read more than one ppp connection
not sure about this.
* the leds won't be reliable with
* the leds won't be reliable with
more than 1 ppp connection
* there is an iconwin, and win variable.
I have no clue why only win shouldn't
be enough. Will check it out later.
* The afterstep what seems the shift the
pixmap a bit. Don't know how and why.
pixmap a bit. Don't know how and why.
It works in the WindowManager.
Things to do:
Split up main()
----
Thanks
----
Most of the ideas, and jumpstarting it:
#linuxnl, without this irc-channel wmppp would've never seen the light!
CCC (Constructive Code Criticism):
Marcelo E. Magallon
Thanks a LOT! It takes a while to get me convinced... :)
Minor bugs and ideas:
Marc De Scheemaecker / David Mihm / Chris Soghoian /
Alessandro Usseglio Viretta
and ofcourse numerous ppl who send us bug reports.
and ofcourse numerous ppl who send us bug reports.
(numerous? hmm.. todo: rephrase this :) )
----
Changes:
@ -100,7 +100,7 @@
one line of /proc/net/dev was longer than 128 bytes
04/05/1998 (Martijn Pieterse, pieterse@xs4all.nl)
* Changed the "middle of the waveform" line color
* Moved the RedrawWindow out of the main loop.
* Moved the RedrawWindow out of the main loop.
Lightens the system load
02/05/1998 (Martijn Pieterse, pieterse@xs4all.nl)
* Torn wmppp and wmifs apart.
@ -293,7 +293,7 @@ void get_ppp_stats(struct ppp_stats *cur);
int main(int argc, char *argv[]) {
int i;
/* Parse Command Line */
@ -354,7 +354,7 @@ typedef struct {
int his[55][2];
long istatlast;
long ostatlast;
} stat_dev;
stat_dev stat_devices[MAX_STAT_DEVICES];
@ -415,7 +415,7 @@ void wmifs_routine(int argc, char **argv) {
}
}
}
if (LEFT_ACTION) left_action = strdup(LEFT_ACTION);
if (MIDDLE_ACTION) middle_action = strdup(MIDDLE_ACTION);
if (RIGHT_ACTION) right_action = strdup(RIGHT_ACTION);
@ -447,7 +447,7 @@ void wmifs_routine(int argc, char **argv) {
while (1) {
gettimeofday(&tv, NULL);
curtime = (tv.tv_sec - tv2.tv_sec) * 1000
curtime = (tv.tv_sec - tv2.tv_sec) * 1000
+ (tv.tv_usec - tv2.tv_usec) / 1000;
waitpid(0, NULL, WNOHANG);
@ -469,18 +469,18 @@ void wmifs_routine(int argc, char **argv) {
SetOffLED(LED_NET_RX);
else
SetOnLED(LED_NET_RX);
if (stat_devices[i].ostatlast == ostat)
SetOffLED(LED_NET_TX);
else
SetOnLED(LED_NET_TX);
}
stat_devices[i].istatlast = istat;
stat_devices[i].ostatlast = ostat;
}
RedrawWindow();
if (curtime >= nexttime) {
nexttime=curtime+ScrollSpeed;
@ -493,11 +493,11 @@ void wmifs_routine(int argc, char **argv) {
}
stat_devices[i].his[53][0] = 0;
stat_devices[i].his[53][1] = 0;
}
}
}
RedrawWindow();
}
while (XPending(display)) {
XNextEvent(display, &Event);
switch (Event.type) {
@ -526,12 +526,12 @@ void wmifs_routine(int argc, char **argv) {
stat_current = i;
}
}
stat_current++;
if (stat_current == stat_online) stat_current = 0;
DrawActiveIFS(stat_devices[stat_current].name);
DrawStats(&stat_devices[stat_current].his[0][0], 54, 40, 5, 58);
break;
case 1:
@ -550,7 +550,7 @@ void wmifs_routine(int argc, char **argv) {
break;
}
break;
}
}
but_stat = -1;
@ -631,12 +631,12 @@ int get_statistics(char *devname, long *ip, long *op, long *is, long *os) {
struct ppp_stats ppp_cur, ppp_old;
static int ppp_opened = 0;
if (!strncmp(devname, "ppp", 3)) {
if (!ppp_opened) {
/* Open the ppp device. */
memset(&ppp_cur, 0, sizeof(ppp_cur));
if ((ppp_h = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
if ((ppp_h = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
return -1;
get_ppp_stats(&ppp_cur);
ppp_old = ppp_cur;
@ -755,13 +755,13 @@ int checknetdevs(void) {
break;
}
/* Skip dummy code */
if (!strncmp(p, "dummy", 5))
continue;
/* If p == "lo", and active_interface (as given on the cmd line) != "lo",
skip it! */
if (strcmp(p, "lo") || (active_interface && !strcmp(active_interface, "lo"))) {
strcpy(foundbuffer[devsfound], p);
devsfound++;
@ -802,9 +802,9 @@ int checknetdevs(void) {
for (j=0; j<MAX_STAT_DEVICES; j++) {
if (foundbuffer[j][0]) {
strcpy(stat_devices[i].name, foundbuffer[j]);
for (k=0; k<48; k++) {
stat_devices[i].his[k][0] = 0;
stat_devices[i].his[k][1] = 0;
@ -870,7 +870,7 @@ void DrawStats(int *his, int num, int size, int x_left, int y_bottom) {
copyXPMArea(100+1, 68, 1, 1, k+x_left, y_bottom-size/2+p2/2);
else
copyXPMArea(100+0, 68, 1, 1, k+x_left, y_bottom-size/2+p2/2);
p2 = (p2 + p3);
p3 *= -1;
p2 *= -1;
@ -941,11 +941,11 @@ void get_ppp_stats(struct ppp_stats *cur) {
#define LED_SZE_X (4)
#define LED_SZE_Y (4)
#define LED_ON_NET_X (87)
#define LED_ON_NET_X (87)
#define LED_ON_NET_Y (66)
#define LED_OFF_NET_X (93)
#define LED_OFF_NET_X (93)
#define LED_OFF_NET_Y (66)
#define LED_ERR_NET_X (81)
#define LED_ERR_NET_X (81)
#define LED_ERR_NET_Y (66)
#define LED_ON_SW_NET_X (49)
#define LED_ON_SW_NET_Y (85)