From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Feb 26 23:20:02 2008 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4A3E106567B for ; Tue, 26 Feb 2008 23:20:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 9AA9613C4DD for ; Tue, 26 Feb 2008 23:20:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m1QNK258046790 for ; Tue, 26 Feb 2008 23:20:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m1QNK2Zq046789; Tue, 26 Feb 2008 23:20:02 GMT (envelope-from gnats) Resent-Date: Tue, 26 Feb 2008 23:20:02 GMT Resent-Message-Id: <200802262320.m1QNK2Zq046789@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Benjamin Close Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFAF6106566C for ; Tue, 26 Feb 2008 23:14:12 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id C98BC13C478 for ; Tue, 26 Feb 2008 23:14:12 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m1QNBR5S051744 for ; Tue, 26 Feb 2008 23:11:27 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.2/8.14.1/Submit) id m1QNBRFR051743; Tue, 26 Feb 2008 23:11:27 GMT (envelope-from nobody) Message-Id: <200802262311.m1QNBRFR051743@www.freebsd.org> Date: Tue, 26 Feb 2008 23:11:27 GMT From: Benjamin Close To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/121130: [Patch] sysutils/wmwave : Fix broken port, take maintainership X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2008 23:20:03 -0000 >Number: 121130 >Category: ports >Synopsis: [Patch] sysutils/wmwave : Fix broken port, take maintainership >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Tue Feb 26 23:20:02 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Benjamin Close >Release: 8.0-CURRENT >Organization: ClearChain >Environment: FreeBSD wolf.clearchain.com 8.0-CURRENT FreeBSD 8.0-CURRENT #1: Fri Dec 14 14:23:25 CST 2007 root@wolf.clearchain.com:/usr/src-local/sys/amd64/compile/GENERIC amd64 >Description: sysutils/wmwave is marked broken (gcc 4.2 compile issues) and also still used the old wi_req framework. The attached patch fixes the compilation issues and also brings the port up to date with the current state of play. The app now makes use of the net80211 framework so the port will work with any wireless driver. At the same time take maintainership for the port to make sure it doesn't creep into the dark ages again. Please note however I've only a src commit bit. >How-To-Repeat: Port is currently marked as BROKEN >Fix: Apply attached patch Patch attached with submission follows: Index: Makefile =================================================================== RCS file: /devel/FreeBSD/ncvs/ports/net/wmwave/Makefile,v retrieving revision 1.11 diff -u -r1.11 Makefile --- Makefile 1 Oct 2007 06:22:24 -0000 1.11 +++ Makefile 26 Feb 2008 23:05:01 -0000 @@ -7,14 +7,14 @@ PORTNAME= wmwave PORTVERSION= 0.4 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= net MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= ${PORTNAME} DISTNAME= ${PORTNAME}-${PORTVERSION:S/./-/} EXTRACT_SUFX= .tgz -MAINTAINER= ports@FreeBSD.org +MAINTAINER= benjsc@FreeBSD.org COMMENT= Display 802.11 status in the WindowMaker Dock MAKEFILE= ${FILESDIR}/Makefile @@ -30,9 +30,4 @@ do-configure: .include - -.if ${OSVERSION} >= 700042 -BROKEN= Does not compile with GCC 4.2 -.endif - .include Index: files/patch-wmwave.c =================================================================== RCS file: /devel/FreeBSD/ncvs/ports/net/wmwave/files/patch-wmwave.c,v retrieving revision 1.5 diff -u -r1.5 patch-wmwave.c --- files/patch-wmwave.c 30 Aug 2003 06:55:15 -0000 1.5 +++ files/patch-wmwave.c 26 Feb 2008 23:02:30 -0000 @@ -1,45 +1,12 @@ ---- wmwave.c.orig Fri Aug 29 23:52:38 2003 -+++ wmwave.c Fri Aug 29 23:52:43 2003 -@@ -1,38 +1,23 @@ - /* -- * wmtop.c -- WindowMaker process view dock app -- * Derived by Carsten Schuermann carsten@schuermann.org -- * http://www.schuermann.org/~carsten -- * from -- * Dan Piponi dan@tanelorn.demon.co.uk -- * http://www.tanelorn.demon.co.uk -- * who derived it -- * from code originally contained in wmsysmon by Dave Clark (clarkd@skynet.ca) -+ * $Id$ -+ * -+ * wmwave.c -- WindowMaker IEEE802.11 status dock app -+ * based on wmtop.c from Dan Piponi -+ * - * This software is licensed through the GNU General Public License. -- * $Log: wmwave.c,v $ -- * Revision 1.7 1999/08/20 13:44:21 carsten -- * version 0.4 complete -- * -- * Revision 1.6 1999/08/19 17:58:52 carsten -- * Almost final version -- * -- * Revision 1.5 1999/08/19 13:54:30 carsten -- * done -- * -- * Revision 1.4 1999/08/19 11:14:50 carsten -- * hookup to /proc/net/wirless complete -- * -- * Revision 1.3 1999/08/19 02:39:07 carsten -- * improved design and hooked it up -- * -- * Revision 1.2 1999/08/16 03:45:34 carsten -- * Added dots -- * -- * Revision 1.1 1999/08/15 15:39:18 carsten -- * Added wmwave project to repository -- * +--- wmwave.c.orig 2008-02-27 09:24:06.628732284 +1030 ++++ wmwave.c 2008-02-27 09:32:07.088117765 +1030 +@@ -29,6 +29,18 @@ + * + * Revision 1.1 1999/08/15 15:39:18 carsten + * Added wmwave project to repository + * + * Authors (in reverse chronological order): ++ * Benjamin Close + * Hendrik Scholz + * Bruce M. Simpson + * Carsten Schuermann @@ -49,188 +16,54 @@ + * The FreeBSD version of this software is released under the GNU GPL, and + * forms part of the Consume Project . + * + * */ -- - #include - #include - #include -@@ -45,313 +30,384 @@ - #include - #include - #include -+#include +@@ -57,6 +69,22 @@ + #include + #include -+#include - #include - #include - #include --#include - #include - #include +#include +#include -+ +#include +#include +#include +#include +#include -+ +#include +#include +#include +#include +#include +#include -+ -+#include ++#include ++#include ++#include - #include - #include - #include - -- #include "wmgeneral.h" -- - #include "wmwave-master.xpm" --char wmwave_mask_bits[64*64]; --int wmwave_mask_width = 64; --int wmwave_mask_height = 64; -- +@@ -66,7 +94,9 @@ + int wmwave_mask_width = 64; + int wmwave_mask_height = 64; + -#define WMWAVE_VERSION "0.4" -+char wmwave_mask_bits[64 * 64]; -+int wmwave_mask_width = 64; -+int wmwave_mask_height = 64; -+ -+#define WMWAVE_DEFAULT_INTERFACE "wi0" +#define WMWAVE_VERSION "0.4_FreeBSD-2" -+ -+int update_rate = 100000; -+char *ProgName; ++#define WMWAVE_DEFAULT_INTERFACE "wi0" +char *iface = WMWAVE_DEFAULT_INTERFACE; -+time_t curtime; -+time_t prevtime; -+int mode = 0; /* default: no card detected */ -+int screen = 0; /* default: Quality screen is displayed */ -+ -+void usage(void); -+void printversion(void); -+void BlitString(char *name, int x, int y); -+void BlitNum(int num, int x, int y); -+void wmwave_routine(int, char **); -+void DrawBar(float percent, int dx, int dy); -+void DrawGreenBar(float percent, int dx, int dy); - --int update_rate=100000; -- --char *ProgName; -- --time_t curtime; --time_t prevtime; -- --int mode = 0; // default: no card detected --int screen = 0; // default: Quality screen is displayed -- --void usage(void); --void printversion(void); --void BlitString(char *name, int x, int y); --void BlitNum(int num, int x, int y); --void wmwave_routine(int, char **); --void DrawBar(float percent, int dx, int dy); --void DrawGreenBar(float percent, int dx, int dy); -+inline void -+DrawBar(float percent, int dx, int dy) -+{ -+ int tx; - --inline void DrawBar(float percent, int dx, int dy) { -- int tx; -- -- tx = (float)((float)54 * ((float)percent / (float)100.0)); -- copyXPMArea(67, 36, tx, 4, dx, dy); -- copyXPMArea(67, 43, 54-tx, 4, dx+tx, dy); -+ tx = (float)((float)54 * ((float)percent / (float)100.0)); -+ copyXPMArea(67, 36, tx, 4, dx, dy); -+ copyXPMArea(67, 43, 54 - tx, 4, dx + tx, dy); - } - - --inline void DrawGreenBar(float percent, int dx, int dy) { -- int tx; -- -- tx = (float)((float)54 * ((float)percent / (float)100.0)); -- copyXPMArea(67, 58, tx, 4, dx, dy); -- copyXPMArea(67, 43, 54-tx, 4, dx+tx, dy); -+inline void -+DrawGreenBar(float percent, int dx, int dy) -+{ -+ int tx; -+ -+ tx = (float)((float)54 * ((float)percent / (float)100.0)); -+ copyXPMArea(67, 58, tx, 4, dx, dy); -+ copyXPMArea(67, 43, 54 - tx, 4, dx + tx, dy); - } - --inline void DrawRedDot() { -- copyXPMArea(80, 65, 6, 6, 52, 5); -+inline void -+DrawRedDot() -+{ -+ copyXPMArea(80, 65, 6, 6, 52, 5); - } - --inline void DrawYellowDot() { -- copyXPMArea(86, 65, 6, 6, 52, 5); -+inline void -+DrawYellowDot() -+{ -+ copyXPMArea(86, 65, 6, 6, 52, 5); - } --inline void DrawGreenDot() { -- copyXPMArea(92, 65, 6, 6, 52, 5); -+inline void -+DrawGreenDot() -+{ -+ copyXPMArea(92, 65, 6, 6, 52, 5); - } + int update_rate=100000; --inline void DrawEmptyDot() { -- copyXPMArea(98, 65, 6, 6, 52, 5); -+inline void -+DrawEmptyDot() -+{ -+ copyXPMArea(98, 65, 6, 6, 52, 5); - } - --float min (float x, float y) { -- if (x < y) {return x;} -- else {return y;} -+/* -+ * XXX: redefining min() to operate on floats is a bad idea; -+ * changed to _fmin(). -+ */ -+float -+_fmin(float x, float y) -+{ -+ if (x < y) { -+ return x; -+ } else { -+ return y; -+ } +@@ -125,65 +155,100 @@ } /* - * Find CPU times for all processes + * XXX: Fetch OS-specific wireless statistics. + * -+ * These are: quality, signal, noise. On NetBSD, the ++ * These are: quality, signal, noise. On NetBSD, the + * statistics kept on an AP-basis for the driver are valid. -+ * On FreeBSD, it is necessary to interrogate the WICACHE. -+ * For the purposes of keeping things simple, this code will only -+ * look at the first slot in the WICACHE table. ++ * On FreeBSD, we make use of the net80211 layer to display the ++ * required stats. */ -void DisplayWireless(void) { - FILE *wireless; // File handle for /proc/net/wireless @@ -284,410 +117,117 @@ - DrawGreenBar(0.0, 4, 55); - break; - }; -+void -+DisplayWireless(void) ++void DisplayWireless(void) +{ -+ struct ifreq ifr; -+ struct wi_req wireq; -+ struct wi_sigcache *wisigsp; -+ int *wisigsnp, s, mode, err; -+ float link, level, noise; -+ enum { -+ MODE_NO_CARD = 0, -+ MODE_HAVE_CARD = 1 -+ }; ++ struct ifreq ifr; ++ struct ieee80211req ireq; ++ union { ++ struct ieee80211req_sta_req stareq; ++ uint8_t buf[24*1024]; ++ } u; ++ int s, mode, err; ++ float link, level, noise; ++ enum { ++ MODE_NO_CARD = 0, ++ MODE_HAVE_CARD = 1 ++ }; + + s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); -+ if (s == -1) -+ errx(errno, "socket"); ++ if (s == -1) ++ errx(errno, "socket"); + bzero(&ifr, sizeof(ifr)); + strncpy(ifr.ifr_name, iface, strlen(iface)); -+ bzero(&wireq, sizeof(wireq)); -+ wireq.wi_type = WI_RID_COMMS_QUALITY; -+ wireq.wi_len = WI_MAX_DATALEN; -+ ifr.ifr_data = (void *) &wireq; + -+ err = ioctl(s, SIOCGWAVELAN, (caddr_t)&ifr); -+ if (err < 0) { -+ mode = MODE_NO_CARD; -+ goto draw; ++ memset(&ireq, 0, sizeof(ireq)); ++ strncpy(ireq.i_name, iface, sizeof(ireq.i_name)); ++ ++ // Get the currently associated ap ++ ireq.i_type = IEEE80211_IOC_BSSID; ++ ireq.i_data = u.stareq.is_u.macaddr; ++ ireq.i_len = IEEE80211_ADDR_LEN; ++ err = ioctl(s, SIOCG80211, &ireq); ++ if ( err >= 0 ){ ++ ++ // Get the station info for the ap ++ memset(&ireq, 0, sizeof(ireq)); ++ strncpy(ireq.i_name, iface, sizeof(ireq.i_name)); ++ ireq.i_type = IEEE80211_IOC_STA_INFO; ++ ireq.i_data = &u; ++ ireq.i_len = sizeof(u); ++ err = ioctl(s, SIOCG80211, &ireq); ++ if ( err >= 0 ){ ++ const struct ieee80211req_sta_info *si = u.stareq.info; ++ mode = MODE_HAVE_CARD; ++ // net80211 doesn't have a link quality field so we base it on the ++ // noise/signal level ++ link = (si->isi_rssi-si->isi_noise)/2; ++ level = si->isi_rssi/2; ++ noise = abs(si->isi_noise); ++ } } - else { - printf ("Wirless device /proc/net/wireless not found\nEnable radio networking and recompile your kernel\n"); - exit (0); - } --} -- --/* SIGCHLD handler */ --void sig_chld(int signo) --{ -- waitpid((pid_t) -1, NULL, WNOHANG); -- signal(SIGCHLD, sig_chld); --} -- --int main(int argc, char *argv[]) { -- int i; -- -- /* Parse Command Line */ -- -- signal(SIGCHLD, sig_chld); -- ProgName = argv[0]; -- if (strlen(ProgName) >= 5) -- ProgName += (strlen(ProgName) - 5); -- -- for (i=1; i (i+1)) { -- update_rate = (atoi(argv[i+1]) * 1000); -- i++; + -+ mode = MODE_HAVE_CARD; -+ link = wireq.wi_val[0]; -+ level = wireq.wi_val[1]; -+ noise = wireq.wi_val[2]; ++ if (err < 0) { ++ mode = MODE_NO_CARD; ++ } + +draw: -+ /* -+ * Print channel information, and signal ratio -+ */ -+ switch (mode) { ++ /* ++ * Print channel information, and signal ratio ++ */ ++ switch (mode) { + case MODE_HAVE_CARD: -+ BlitString("Quality", 4, 4); -+ if (link <= 10) { -+ DrawRedDot(); -+ } else if (link <= 20) { -+ DrawYellowDot(); -+ } else { -+ DrawGreenDot(); -+ }; -+ BlitString("Quality ", 4, 18); -+ DrawBar(_fmin((int)(link * 1.8), 100.0), 4, 27); -+ BlitString("Signal ", 4, 32); -+ DrawGreenBar(_fmin((int)(level * 0.3), 100.0), 4, 41); -+ BlitString("Noise ", 4, 46); -+ DrawGreenBar(_fmin((int)(noise * 0.3), 100.0), 4, 55); -+ break; ++ BlitString("Quality", 4, 4); ++ if (link <= 10) { ++ DrawRedDot(); ++ } else if (link <= 20) { ++ DrawYellowDot(); ++ } else { ++ DrawGreenDot(); ++ }; ++ BlitString("Quality ", 4, 18); ++ DrawBar(min((int)(link * 1.8), 100.0), 4, 27); ++ BlitString("Signal ", 4, 32); ++ DrawGreenBar(min((int)(level * 0.3), 100.0), 4, 41); ++ BlitString("Noise ", 4, 46); ++ DrawGreenBar(min((int)(noise * 0.3), 100.0), 4, 55); ++ break; + case MODE_NO_CARD: + default: -+ BlitString("NO CARD", 4, 4); -+ DrawEmptyDot(); -+ BlitString(" ", 4, 18); -+ DrawBar(0.0, 4, 27); -+ BlitString(" ", 4, 32); -+ DrawGreenBar(0.0, 4, 41); -+ BlitString(" ", 4, 46); -+ DrawGreenBar(0.0, 4, 55); -+ break; -+ }; -+ close(s); -+} -+ -+void -+sig_chld(int signo) -+{ -+ waitpid((pid_t) - 1, NULL, WNOHANG); -+ signal(SIGCHLD, sig_chld); -+} -+ -+int -+main(int argc, char *argv[]) -+{ -+ int i; -+ -+ -+ signal(SIGCHLD, sig_chld); -+ -+ ProgName = argv[0]; -+ if (strlen(ProgName) >= 5) -+ ProgName += (strlen(ProgName) - 5); -+ -+ for (i = 1; i < argc; i++) { -+ char *arg = argv[i]; -+ -+ if (*arg == '-') { -+ switch (arg[1]) { -+ case 'i': -+ if (argc > (i + 1)) { -+ iface = argv[i+1]; -+ if (strncmp("wi", iface, 2) != 0) { -+ fprintf(stderr, "error: you " -+ "must specify a wiX interface.\n"); -+ usage(); -+ exit(EX_USAGE); -+ } -+ } -+ break; -+ case 'd': -+ if (strcmp(arg + 1, "display")) { -+ usage(); -+ exit(EX_USAGE); -+ } -+ break; -+ case 'g': -+ if (strcmp(arg + 1, "geometry")) { -+ usage(); -+ exit(EX_USAGE); -+ } -+ break; -+ case 'v': -+ printversion(); -+ exit(EX_OK); -+ break; -+ case 'r': -+ if (argc > (i + 1)) { -+ update_rate = (atoi(argv[i+1]) * 1000); -+ i++; -+ } -+ break; -+ default: -+ usage(); -+ exit(EX_USAGE); -+ break; -+ } -+ } - } -- break; -- default: -- usage(); -- exit(0); -- break; -- } -- } -- } -- -- wmwave_routine(argc, argv); -- -- return 0; -+ -+ wmwave_routine(argc, argv); -+ -+ exit(EX_OK); - } - - /* - * Main loop - */ --void wmwave_routine(int argc, char **argv) { -- XEvent Event; -- struct timeval tv={0,0}; -- struct timeval last={0,0}; -- -- createXBMfromXPM(wmwave_mask_bits, wmwave_master_xpm, wmwave_mask_width, wmwave_mask_height); -- -- openXwindow(argc, argv, wmwave_master_xpm, wmwave_mask_bits, wmwave_mask_width, wmwave_mask_height); -- -- RedrawWindow(); -- -- -- while (1) { -- -- curtime = time(0); -- -- if (1) { -- memcpy(&last, &tv, sizeof(tv)); -- -- /* -- * Update display -- */ -- DisplayWireless(); -- -- RedrawWindow(); -- } -- -- /* -- * X Events -- */ -- while (XPending(display)) { -- XNextEvent(display, &Event); -- switch (Event.type) { -- case Expose: -+void -+wmwave_routine(int argc, char **argv) -+{ -+ XEvent Event; -+ struct timeval tv = {0, 0}; -+ struct timeval last = {0, 0}; -+ -+ createXBMfromXPM(wmwave_mask_bits, wmwave_master_xpm, wmwave_mask_width, wmwave_mask_height); -+ -+ openXwindow(argc, argv, wmwave_master_xpm, wmwave_mask_bits, wmwave_mask_width, wmwave_mask_height); -+ - RedrawWindow(); -- break; -- case DestroyNotify: -- XCloseDisplay(display); -- exit(0); -- case ButtonPress: -- switch (screen) { -- case 0: screen=1; break; -- case 1: screen=0; break; -- }; -- break; -- } -- } -- -- usleep(update_rate); -- } -+ -+ for (;;) { -+ curtime = time(0); -+ memcpy(&last, &tv, sizeof(tv)); -+ -+ /* -+ * Update display -+ */ -+ DisplayWireless(); -+ RedrawWindow(); -+ -+ /* -+ * X Events -+ */ -+ while (XPending(display)) { -+ XNextEvent(display, &Event); -+ switch (Event.type) { -+ case Expose: -+ RedrawWindow(); -+ break; -+ case DestroyNotify: -+ XCloseDisplay(display); -+ exit(EX_OK); -+ case ButtonPress: -+ switch (screen) { -+ case 0: -+ screen = 1; -+ break; -+ case 1: -+ screen = 0; -+ break; -+ }; -+ break; -+ } -+ } -+ usleep(update_rate); -+ } - } - - /* - * Blits a string at given co-ordinates - */ --void BlitString(char *name, int x, int y) { -- int i; -- int c; -- int k; -- -- k = x; -- for (i=0; name[i]; i++) -- { -- -- c = toupper(name[i]); -- if (c >= 'A' && c <= 'Z') -- { // its a letter -- c -= 'A'; -- copyXPMArea(c * 6, 74, 6, 8, k, y); -- k += 6; -- } else -- if (c>='0' && c<='9') { // its a number or symbol -- c -= '0'; -- copyXPMArea(c * 6, 64, 6, 8, k, y); -- k += 6; -- } else { -- copyXPMArea(5, 84, 6, 8, k, y); -- k += 6; -- -- } -- } -+void -+BlitString(char *name, int x, int y) -+{ -+ int i; -+ int c; -+ int k; -+ -+ k = x; -+ for (i = 0; name[i]; i++) { -+ -+ c = toupper(name[i]); -+ if (c >= 'A' && c <= 'Z') { /* its a letter */ -+ c -= 'A'; -+ copyXPMArea(c * 6, 74, 6, 8, k, y); -+ k += 6; -+ } else if (c >= '0' && c <= '9') { -+ /* its a number or symbol */ -+ c -= '0'; -+ copyXPMArea(c * 6, 64, 6, 8, k, y); -+ k += 6; -+ } else { -+ copyXPMArea(5, 84, 6, 8, k, y); -+ k += 6; -+ -+ } -+ } - } - --void BlitNum(int num, int x, int y) { -- char buf[1024]; -- int newx=x; -- -- sprintf(buf, "%03i", num); -- -- BlitString(buf, newx, y); -+void -+BlitNum(int num, int x, int y) -+{ -+ char buf[1024]; -+ int newx = x; -+ -+ sprintf(buf, "%03i", num); -+ BlitString(buf, newx, y); - } - - /* - * Usage - */ --void usage(void) { -- fprintf(stderr, "\nWmwave - Carsten Schuermann http://www.schuermann.org/~dockapps\n\n"); -- fprintf(stderr, "usage:\n"); -- fprintf(stderr, " -display \n"); -- fprintf(stderr, " -r update rate in milliseconds (default:100)\n"); -- fprintf(stderr, "\n"); -+void -+usage(void) -+{ -+ fprintf(stderr, "\rwmwave 0.4 - by Bruce M Simpson et al. \n"); -+ fprintf(stderr, "usage:\n"); -+ fprintf(stderr, " -display \n"); -+ fprintf(stderr, " -i interface to use (default to wi0)\n"); -+ fprintf(stderr, " -r update rate in milliseconds (default:100)\n"); -+ fprintf(stderr, "\n"); - } - - /* - * printversion - */ --void printversion(void) { -- fprintf(stderr, "wmwave v%s\n", WMWAVE_VERSION); -+void -+printversion(void) -+{ -+ fprintf(stderr, "wmwave v%s\n", WMWAVE_VERSION); ++ BlitString("NO CARD", 4, 4); ++ DrawEmptyDot(); ++ BlitString(" ", 4, 18); ++ DrawBar(0.0, 4, 27); ++ BlitString(" ", 4, 32); ++ DrawGreenBar(0.0, 4, 41); ++ BlitString(" ", 4, 46); ++ DrawGreenBar(0.0, 4, 55); ++ break; ++ }; ++ close(s); + } + + /* SIGCHLD handler */ +@@ -208,6 +273,11 @@ + + if (*arg=='-') { + switch (arg[1]) { ++ case 'i': ++ if (argc > (i + 1)) { ++ iface = argv[i+1]; ++ } ++ break; + case 'd' : + if (strcmp(arg+1, "display")) { + usage(); +@@ -345,6 +415,7 @@ + fprintf(stderr, "\nWmwave - Carsten Schuermann http://www.schuermann.org/~dockapps\n\n"); + fprintf(stderr, "usage:\n"); + fprintf(stderr, " -display \n"); ++ fprintf(stderr, " -i interface to use (default to wi0)\n"); + fprintf(stderr, " -r update rate in milliseconds (default:100)\n"); + fprintf(stderr, "\n"); } >Release-Note: >Audit-Trail: >Unformatted: