[PATCH 3/9] Remove trailing whitespace in recently added dockapps.
Doug Torrance <[email protected]>
| Newsgroups | gmane.compw.window-managers.windowmaker.devel |
|---|---|
| Message-ID | <[email protected]> |
--- asbeats/README | 4 +- asbeats/README.asclock | 24 +- asbeats/asbeats.c | 40 +-- ascd/README | 2 +- ascd/ascd/Imakefile | 2 +- ascd/ascd/README | 18 +- ascd/ascd/ascd.c | 102 +++---- ascd/ascd/ascd.man | 10 +- ascd/ascd/cdcontrol.c | 34 +-- ascd/ascd/configure | 14 +- ascd/ascd/doc/CHANGES | 66 ++-- ascd/ascd/doc/NEWS | 14 +- ascd/ascd/faktory.c | 408 ++++++++++++------------- ascd/ascd/faktory_prot.h | 6 +- ascd/ascd/handlers.c | 20 +- ascd/ascd/misc.c | 26 +- ascd/ascd/mixer_handlers.c | 12 +- ascd/ascd/wings_main.c | 38 +-- ascd/ascd/workman/wm_cdda.h | 6 +- ascd/ascd/workman/wm_cddb.h | 2 +- ascd/ascd/workman/wm_cdinfo.h | 4 +- ascd/ascd/workman/wm_cdrom.h | 4 +- ascd/ascd/workman/wm_config.h | 14 +- ascd/ascd/workman/wm_database.h | 6 +- ascd/ascd/workman/wm_helpers.h | 8 +- ascd/ascd/workman/wm_index.h | 4 +- ascd/ascd/workman/wm_platform.h | 4 +- ascd/ascd/workman/wm_scsi.h | 6 +- ascd/ascd/workman/wm_struct.h | 14 +- ascd/ascd/workman/wm_version.h | 2 +- ascd/ascd/workman/workman.h | 22 +- ascd/ascd/workman/workman_defs.h | 4 +- ascd/libworkman/COPYING.LIB | 2 +- ascd/libworkman/Config | 2 +- ascd/libworkman/Imakefile | 6 +- ascd/libworkman/buildindex.c | 8 +- ascd/libworkman/cddaslave.c | 6 +- ascd/libworkman/cddb.c | 74 ++--- ascd/libworkman/cdinfo.c | 24 +- ascd/libworkman/cdrom.c | 20 +- ascd/libworkman/database.c | 46 +-- ascd/libworkman/drv_sony.c | 4 +- ascd/libworkman/drv_toshiba.c | 4 +- ascd/libworkman/include/wm_cdda.h | 6 +- ascd/libworkman/include/wm_cddb.h | 2 +- ascd/libworkman/include/wm_cdinfo.h | 4 +- ascd/libworkman/include/wm_cdrom.h | 4 +- ascd/libworkman/include/wm_config.h | 14 +- ascd/libworkman/include/wm_database.h | 6 +- ascd/libworkman/include/wm_helpers.h | 8 +- ascd/libworkman/include/wm_index.h | 4 +- ascd/libworkman/include/wm_platform.h | 4 +- ascd/libworkman/include/wm_scsi.h | 6 +- ascd/libworkman/include/wm_struct.h | 14 +- ascd/libworkman/include/wm_version.h | 2 +- ascd/libworkman/include/workman.h | 22 +- ascd/libworkman/include/workman_defs.h | 4 +- ascd/libworkman/index.c | 10 +- ascd/libworkman/plat_aix.c | 36 +-- ascd/libworkman/plat_bsd386.c | 6 +- ascd/libworkman/plat_freebsd.c | 14 +- ascd/libworkman/plat_hpux.c | 6 +- ascd/libworkman/plat_irix.c | 6 +- ascd/libworkman/plat_linux.c | 56 ++-- ascd/libworkman/plat_linux_audio.c | 12 +- ascd/libworkman/plat_linux_cdda.c | 6 +- ascd/libworkman/plat_news.c | 4 +- ascd/libworkman/plat_openbsd.c | 8 +- ascd/libworkman/plat_osf1.c | 4 +- ascd/libworkman/plat_sun.c | 32 +- ascd/libworkman/plat_sun_audio.c | 14 +- ascd/libworkman/plat_sun_cdda.c | 4 +- ascd/libworkman/plat_svr4.c | 14 +- ascd/libworkman/plat_template.c | 18 +- ascd/libworkman/plat_ultrix.c | 4 +- ascd/libworkman/scsi.c | 22 +- ascd/libworkman/wm_helpers.c | 14 +- pclock/demos/rolexgmt | 2 +- pclock/src/Graphics.c | 4 +- washerdryer/README | 4 +- washerdryer/washerDryer/Makefile | 2 +- washerdryer/washerDryer/washerDryer.c | 18 +- washerdryer/wmgeneral/list.c | 4 +- washerdryer/wmgeneral/list.h | 2 +- washerdryer/wmgeneral/misc.c | 6 +- washerdryer/wmgeneral/wmgeneral.c | 2 +- wmail/README | 4 +- wmail/configure | 8 +- wmail/src/common.c | 8 +- wmail/src/common.h | 4 +- wmail/src/config.c | 44 +-- wmail/src/config.h | 4 +- wmail/src/wmail.c | 64 ++-- wmappkill/ChangeLog | 2 +- wmappkill/INSTALL | 2 +- wmappkill/Makefile | 8 +- wmappkill/README | 6 +- wmappkill/wmAppKill.c | 244 +++++++-------- wmappkill/wmAppKill.h | 2 +- wmcalc/readln.c | 8 +- wmcapshare/INSTALL | 2 +- wmcapshare/obex_io.c | 34 +-- wmcapshare/obex_put_common.c | 28 +- wmcapshare/obex_put_common.h | 28 +- wmcapshare/wmcapshare.c | 70 ++--- wmcdplay/ARTWORK | 4 +- wmcdplay/cdctl_freebsd.h | 4 +- wmcdplay/wmcdplay.cc | 6 +- wmcpufreq/Makefile | 10 +- wmcpufreq/README | 12 +- wmcpufreq/wmcpufreq/wmcpufreq.c | 64 ++-- wmcpufreq/wmcpufreq/xy.txt | 4 +- wmfortune/dockapp.c | 28 +- wmfortune/dockapp.h | 22 +- wmfortune/wmfortune.c | 20 +- wmget/NEWS | 2 +- wmget/configure.c | 2 +- wmget/dockapp/Makefile | 8 +- wmget/dockapp/da_run.c | 4 +- wmget/dockapp/da_x.c | 2 +- wmget/server.c | 4 +- wmget/wmget.1.in | 2 +- wmget/wmget.h | 2 +- wmgrabimage/CHANGES | 2 +- wmgrabimage/HINTS | 4 +- wmgrabimage/INSTALL | 4 +- wmgrabimage/TODO | 2 +- wmgrabimage/wmGrabImage/Makefile | 4 +- wmgrabimage/wmGrabImage/wmGrabImage.1 | 4 +- wmgrabimage/wmGrabImage/wmGrabImage.c | 84 ++--- wmgrabimage/wmgeneral/wmgeneral.c | 20 +- wmhdplop/ChangeLog | 20 +- wmhdplop/README | 8 +- wmhdplop/devnames.c | 52 ++-- wmhdplop/dockapp_imlib2.c | 34 +-- wmhdplop/gkrellm_hdplop.c | 34 +-- wmhdplop/global.h | 4 +- wmhdplop/procstat.c | 20 +- wmhdplop/util.c | 20 +- wmhdplop/wmhdplop.c | 120 ++++---- wmhdplop/wmhdplop.h | 4 +- wmhexaclock/INSTALL | 2 +- wmhexaclock/Makefile | 6 +- wmhexaclock/README | 4 +- wmhexaclock/src/main.c | 38 +-- wmhexaclock/src/wmgeneral.h | 6 +- wmix/mixer-alsa.c | 2 +- wmjmail/CHANGES | 2 +- wmjmail/CREDITS | 8 +- wmjmail/src/Andre.Merzky.audio.patch | 22 +- wmjmail/src/Andre.Merzky.patch | 30 +- wmjmail/src/Jet.post-andre.patch | 20 +- wmjmail/src/Jet.stat.patch | 14 +- wmjmail/src/jDockApp/jDockApp.c | 6 +- wmjmail/src/jDockApp/jprintf.c | 4 +- wmjmail/src/jenglish.h | 2 +- wmjmail/src/wmjmail.jet | 4 +- wmjmail/src/xutils/xutils.c | 48 +-- wmjmail/src/xutils/xutils.h | 4 +- wmlongrun/README | 2 +- wmlongrun/configure.ac | 4 +- wmlongrun/doc/wmlongrun.1 | 2 +- wmlongrun/src/Makefile.am | 4 +- wmmp3/AUTHORS | 4 +- wmmp3/COPYING | 80 ++--- wmmp3/ChangeLog | 1 - wmmp3/INSTALL | 4 +- wmmp3/Makefile.in | 12 +- wmmp3/README | 12 +- wmmp3/buttons.c | 6 +- wmmp3/buttons.h | 6 +- wmmp3/configure | 2 +- wmmp3/install-sh | 16 +- wmmp3/main.c | 16 +- wmmp3/main.h | 6 +- wmmp3/mpg123ctl.c | 40 +-- wmmp3/mpg123ctl.h | 6 +- wmmp3/song_hash.c | 14 +- wmmp3/wmgeneral.c | 2 +- wmpop3/CHANGE_LOG | 2 +- wmpop3/INSTALL | 8 +- wmpop3/README | 20 +- wmpop3/wmgeneral/list.c | 12 +- wmpop3/wmgeneral/list.h | 2 +- wmpop3/wmgeneral/misc.c | 24 +- wmpop3/wmgeneral/wmgeneral.c | 26 +- wmpop3/wmpop3/Makefile | 18 +- wmpop3/wmpop3/Pop3Client.c | 8 +- wmpop3/wmpop3/wmpop3.c | 42 +-- wmpop3/wmpop3/wmpop3rc | 6 +- wmpop3lb/CHANGE_LOG | 42 +-- wmpop3lb/INSTALL | 8 +- wmpop3lb/README | 66 ++-- wmpop3lb/wmgeneral/list.c | 12 +- wmpop3lb/wmgeneral/list.h | 2 +- wmpop3lb/wmgeneral/misc.c | 24 +- wmpop3lb/wmgeneral/wmgeneral.c | 26 +- wmpop3lb/wmpop3/.wmpop3rc_test | 4 +- wmpop3lb/wmpop3/Makefile | 18 +- wmpop3lb/wmpop3/Pop3Client.c | 88 +++--- wmpop3lb/wmpop3/Pop3Client.h | 10 +- wmpop3lb/wmpop3/wmpop3.c | 254 +++++++-------- wmradio/Makefile | 2 +- wmradio/config.h | 10 +- wmradio/config.h.in | 10 +- wmradio/config.log | 16 +- wmradio/config/wmradio-config.py | 20 +- wmradio/config/wmradio-config.py.in | 20 +- wmradio/configure.in | 2 +- wmradio/doc/wmradio.1 | 16 +- wmradio/fifo.c | 14 +- wmradio/fifo.h | 10 +- wmradio/gnome_applet_envelope.c | 48 +-- wmradio/gnome_applet_envelope.h | 10 +- wmradio/ini.c | 54 ++-- wmradio/ini.h | 10 +- wmradio/lists.c | 30 +- wmradio/lists.h | 10 +- wmradio/osd.c | 12 +- wmradio/osd.h | 10 +- wmradio/radio.c | 12 +- wmradio/radio.h | 10 +- wmradio/rc.c | 20 +- wmradio/rc.h | 10 +- wmradio/skin.c | 28 +- wmradio/skin.h | 10 +- wmradio/stationnames.c | 28 +- wmradio/stationnames.h | 10 +- wmradio/wm_envelope.c | 28 +- wmradio/wm_envelope.h | 10 +- wmradio/wmradio-remote | 2 +- wmradio/wmradio.c | 16 +- wmradio/wmradio.h | 10 +- wmradio/wmradio.spec | 1 - wmradio/x_envelope.c | 30 +- wmradio/xor.c | 10 +- wmspaceweather/CHANGES | 8 +- wmspaceweather/HINTS | 2 +- wmspaceweather/INSTALL | 4 +- wmspaceweather/README | 8 +- wmspaceweather/wmSpaceWeather/GetKp | 10 +- wmspaceweather/wmSpaceWeather/Makefile | 4 +- wmspaceweather/wmSpaceWeather/wmSpaceWeather.1 | 8 +- wmspaceweather/wmSpaceWeather/wmSpaceWeather.c | 70 ++--- wmspaceweather/wmgeneral/wmgeneral.c | 20 +- wmtop/wmtop.1 | 6 +- wmtop/wmtop.c | 14 +- wmwork/src/install-sh | 16 +- wmwork/src/wmgeneral.c | 22 +- wmxss/Src/Makefile | 4 +- wmxss/Src/Makefile.sgi | 4 +- wmxss/Src/Makefile.solaris | 4 +- wmxss/Src/wmxss.c | 44 +-- wmxss/Src/xutils.c | 48 +-- wmxss/Src/xutils.h | 4 +- wmymail/README.old | 2 +- wmymail/wmymail.c | 18 +- 257 files changed, 2410 insertions(+), 2412 deletions(-) diff --git a/asbeats/README b/asbeats/README index 58828d5..40d3660 100644 --- a/asbeats/README +++ b/asbeats/README @@ -1,4 +1,4 @@ -asbeats 0.2 by Martin Dahl <[email protected]> +asbeats 0.2 by Martin Dahl <[email protected]> and Karl-Martin Skontorp <[email protected]> WHAT IS IT? @@ -19,7 +19,7 @@ windowmaker dock. INSTALLING ---------- -To install, just do a 'make' and copy the generated 'asbeats' +To install, just do a 'make' and copy the generated 'asbeats' program anywhere you like. diff --git a/asbeats/README.asclock b/asbeats/README.asclock index 2ee471b..115b3a9 100644 --- a/asbeats/README.asclock +++ b/asbeats/README.asclock @@ -6,7 +6,7 @@ the best clock for the best X-windowmanager! RELEASE 10 26 August 1996 - by Beat Christen, [email protected] + by Beat Christen, [email protected] VERSION 1.0 @@ -26,9 +26,9 @@ INSTALL HINTS - - If you are using 'Wharf', and only a part (48x48) of the clock is + - If you are using 'Wharf', and only a part (48x48) of the clock is visible, then - you need AfterStep 0.98Beta Prerelease 4 and you have to set the + you need AfterStep 0.98Beta Prerelease 4 and you have to set the 'MaxSwallow' keyword for 'asclock'. @@ -48,8 +48,8 @@ CONTRIBUTORS Shape Extensions Dan Weeks and man page - language specific Carlos Canau - files Frank Larsen + language specific Carlos Canau + files Frank Larsen Andy Lo A Foe Dan Weeks Emanuele Caratti @@ -60,9 +60,9 @@ CHANGES 26-Aug-96 - czech added 13-Aug-96 - french added 6-Aug-96 - spanish added (thanks to David Lazaro Saz [email protected]) - - hungarian added + - hungarian added (thanks to Gyula Matics [email protected]) - - breton added (thanks to [email protected]) + - breton added (thanks to [email protected]) 30-Jul-96 - ClassHints added (patch by Peter Parnes [email protected]) @@ -72,9 +72,9 @@ CHANGES - improved configure 21-Jun-96 - '-iconic' state added - - usleep did not exist on Solaris 2.4: changed to poll() - - better error messages - + - usleep did not exist on Solaris 2.4: changed to poll() + - better error messages + 8-Jun-96 - '-noblink' feature added - final switch to imake @@ -86,12 +86,12 @@ CHANGES - in AM/PM mode, no leading one was visible... - '-led' command line option added - 24-May-96 - asclock can start an executable: as default you get a + 24-May-96 - asclock can start an executable: as default you get a message on console - command line options added (-exe, -geometry, -shape, -12, -24) - Shape-Extension (by Dan Weeks) - now it's a Build script - - dutch added (by Andy Lo A Foe <[email protected]>) + - dutch added (by Andy Lo A Foe <[email protected]>) - norwegian added (by Frank Larsen <[email protected]>) 22-May-96 - obscure, not necessary XRaiseWindow removed :) diff --git a/asbeats/asbeats.c b/asbeats/asbeats.c index 14f8075..34a700c 100644 --- a/asbeats/asbeats.c +++ b/asbeats/asbeats.c @@ -46,7 +46,7 @@ int main(int argc,char *argv[]) { int i; unsigned int borderwidth; - char *display_name=NULL; + char *display_name=NULL; char *wname="asbeats"; XGCValues gcv; unsigned long gcm; @@ -55,12 +55,12 @@ int main(int argc,char *argv[]) XClassHint classHint; Pixmap pixmask; char *Geometry=""; - if (!(dpy = XOpenDisplay(display_name))) - { - fprintf(stderr,"asbeats: can't open display %s\n", - XDisplayName(display_name)); - exit (1); - } + if (!(dpy = XOpenDisplay(display_name))) + { + fprintf(stderr,"asbeats: can't open display %s\n", + XDisplayName(display_name)); + exit (1); + } screen=DefaultScreen(dpy); Root=RootWindow(dpy,screen); d_depth=DefaultDepth(dpy,screen); @@ -73,7 +73,7 @@ int main(int argc,char *argv[]) fore_pix=GetColor("black"); XWMGeometry(dpy,screen,Geometry,NULL,(borderwidth =1), &mysizehints,&mysizehints.x,&mysizehints.y, - &mysizehints.width,&mysizehints.height,&i); + &mysizehints.width,&mysizehints.height,&i); mysizehints.width=wmclock.attributes.width; mysizehints.height=wmclock.attributes.height; win=XCreateSimpleWindow(dpy,Root,mysizehints.x,mysizehints.y, @@ -98,8 +98,8 @@ int main(int argc,char *argv[]) gcv.foreground = fore_pix; gcv.background = back_pix; gcv.graphics_exposures = FALSE; - NormalGC = XCreateGC(dpy, Root, gcm, &gcv); - pixmask = XCreateBitmapFromData(dpy, win, mask_bits, mask_width, + NormalGC = XCreateGC(dpy, Root, gcm, &gcv); + pixmask = XCreateBitmapFromData(dpy, win, mask_bits, mask_width, mask_height); XShapeCombineMask(dpy, win, ShapeBounding, 0, 0, pixmask, ShapeSet); XShapeCombineMask(dpy, iconwin, ShapeBounding, 0, 0, pixmask, ShapeSet); @@ -110,7 +110,7 @@ int main(int argc,char *argv[]) mywmhints.window_group = win; mywmhints.flags = StateHint | IconWindowHint | IconPositionHint | WindowGroupHint; - XSetWMHints(dpy, win, &mywmhints); + XSetWMHints(dpy, win, &mywmhints); XSetCommand(dpy, win, argv, argc); XMapWindow(dpy,win); InsertTime(); @@ -134,9 +134,9 @@ int main(int argc,char *argv[]) break; case DestroyNotify: XCloseDisplay(dpy); - exit(0); + exit(0); default: - break; + break; } } XFlush(dpy); @@ -158,7 +158,7 @@ void GetXPM(void) char led2[22]; int ret; XGetWindowAttributes(dpy,Root,&attributes); - if(!XParseColor(dpy,attributes.colormap,LedColor,&col)) + if(!XParseColor(dpy,attributes.colormap,LedColor,&col)) { nocolor("parse",LedColor); } @@ -178,7 +178,7 @@ void GetXPM(void) CreatePixmap(dpy,Root,mask_xpm,&wmclock); CreatePixmap(dpy,Root,mask_xpm,&visible); CreatePixmap(dpy,Root,led_xpm,&led); -} +} static void CreatePixmap(Display *dpy, Window Root, char **data, XpmIcon* icon) { @@ -221,9 +221,9 @@ Pixel GetColor(char *name) XWindowAttributes attributes; XGetWindowAttributes(dpy,Root,&attributes); color.pixel=0; - if (!XParseColor(dpy,attributes.colormap,name,&color)) + if (!XParseColor(dpy,attributes.colormap,name,&color)) nocolor("parse",name); - else if(!XAllocColor (dpy,attributes.colormap,&color)) + else if(!XAllocColor (dpy,attributes.colormap,&color)) nocolor("alloc",name); return color.pixel; } @@ -242,7 +242,7 @@ void Beat() else if (fTime < 0) fTime+=1000; - + XCopyArea(dpy,led.pixmap,visible.pixmap,NormalGC, 90,0,9,11,posx[0],15); XCopyArea(dpy,led.pixmap,visible.pixmap,NormalGC, @@ -253,7 +253,7 @@ void Beat() 9*((int)fTime % 10),0,9,11,posx[3],15); fTime = abs(((fTime - abs(fTime)) * 1000) + 0.5); - + XCopyArea(dpy,led.pixmap,visible.pixmap,NormalGC, 99,0,9,11,posx[0],32); XCopyArea(dpy,led.pixmap,visible.pixmap,NormalGC, @@ -262,7 +262,7 @@ void Beat() 9*((((int)fTime) / 10) % 10),0,9,11,posx[2],32); XCopyArea(dpy,led.pixmap,visible.pixmap,NormalGC, 9*((int)fTime % 10),0,9,11,posx[3],32); - + return; } diff --git a/ascd/README b/ascd/README index f810fc8..5d438da 100644 --- a/ascd/README +++ b/ascd/README @@ -14,7 +14,7 @@ Important note: I changed two things in libworkman: -1) I added #under OSS_SUPPORT in plat_linux.c in order to definitly +1) I added #under OSS_SUPPORT in plat_linux.c in order to definitly prevent libworkman to use the mixer. 2) I added wm_cddb.h in installed files as it was missing in the diff --git a/ascd/ascd/Imakefile b/ascd/ascd/Imakefile index b032d30..f6787df 100644 --- a/ascd/ascd/Imakefile +++ b/ascd/ascd/Imakefile @@ -43,7 +43,7 @@ OBJS = cdcontrol.o misc.o faktory.o handlers.o \ #ifdef WMK WM_LIB = -lm -lz -lpng -ljpeg -ltiff -lgif -lPropList -lwraster -lWINGs #else -WM_LIB = +WM_LIB = #endif AllTarget($(NAME)) diff --git a/ascd/ascd/README b/ascd/ascd/README index 609ab50..619ca78 100644 --- a/ascd/ascd/README +++ b/ascd/ascd/README @@ -31,7 +31,7 @@ AScd 0.1 -> 0.6 The original code was taken by Rob Malda from asclock (Afterstep wharf module, by Beat Christen <[email protected]>) and from workbone (CD -driver). +driver). AScd 0.7 -> 0.9 --------------- @@ -52,7 +52,7 @@ AScd's archive. WorkMan's maintainer is Dirk Foersterling AScd >= 0.12 ------------ -AScd no longer includes the pixmaps in the source files. It is now possible +AScd no longer includes the pixmaps in the source files. It is now possible to change the pixmaps theme at run time. AScd now needs a directory where to store the pixmaps. The default is /usr/local/share/AScd. @@ -68,7 +68,7 @@ installed by default in /usr/local/share/AScd/Themes. You need to download, compile and install the WorkMan library. Please use the 99/05/05 snapshot wish can be found on the AScd's home page or -on the primary ftp site for WorkMan: +on the primary ftp site for WorkMan: ftp://ftp.midwinter.com/WorkMan/snapshots/ @@ -91,16 +91,16 @@ everything in the AScd default directory (/usr/local/share/AScd) as the theme files are *not* compatible. make - + - If you want to try the program, just type - + ./ascd - + (try './ascd -help' to see the commandline options) If everything is ok, you can install the program and the man page: - + make install make install.man @@ -113,7 +113,7 @@ theme files are *not* compatible. *Wharf - - Swallow "ascd" /usr/local/bin/ascd -device /dev/wcd0a & (customized to your system settings of course!) - + * installation for Window Maker ----------------------------- @@ -131,7 +131,7 @@ theme files are *not* compatible. clock applet for Window Maker. Wmitime was written by Dave Clark ([email protected]) More info at: http://www.neotokyo.org. I added the lower case letters. - + The new 0.13 default font is fully 8bit compatible! It has been drawn by Stefan Zeiger ([email protected]). ======================================================================== diff --git a/ascd/ascd/ascd.c b/ascd/ascd/ascd.c index 394cf95..6af12bc 100644 --- a/ascd/ascd/ascd.c +++ b/ascd/ascd/ascd.c @@ -24,12 +24,12 @@ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL DENIS BOUREZ, ROB MALDA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * =========================================================================== */ @@ -179,7 +179,7 @@ char th_alpha2[FAK_CMAX]; char th_background[FAK_CMAX]; char th_icon_window[FAK_CMAX]; -int th_no_minus = FALSE; +int th_no_minus = FALSE; int th_no_icon_window = FALSE; struct fak_button thdata[FAK_BMAX]; @@ -200,7 +200,7 @@ struct fak_button thdata[FAK_BMAX]; /*****************************************************************************/ -void mouse_events(XEvent Event) +void mouse_events(XEvent Event) { int i; int j; @@ -244,13 +244,13 @@ void mouse_events(XEvent Event) } } -} +} /* ------------------------------------------------------------------------ GUI control ------------------------------------------------------------------------ */ -Pixel get_color(char *ColorName) +Pixel get_color(char *ColorName) { XColor Color; XWindowAttributes Attributes; @@ -264,9 +264,9 @@ Pixel get_color(char *ColorName) fprintf(stderr,"ascd: can't allocate %s\n", ColorName); return Color.pixel; -} +} -void create_window(int argc, char **argv) +void create_window(int argc, char **argv) { int i; unsigned int borderwidth ; @@ -345,7 +345,7 @@ void create_window(int argc, char **argv) fore_pix, back_pix); } else { - Iconwin = XCreateSimpleWindow(Disp, Win, + Iconwin = XCreateSimpleWindow(Disp, Win, SizeHints.x, SizeHints.y, iconXPM.attributes.width, @@ -366,7 +366,7 @@ void create_window(int argc, char **argv) XSelectInput(Disp, Iconwin, (ExposureMask | ButtonPressMask | StructureNotifyMask)); - + if (XStringListToTextProperty(&wname, 1, &name) ==0) { fprintf(stderr, "ascd: can't allocate window name\n"); exit(-1); @@ -389,21 +389,21 @@ void create_window(int argc, char **argv) WmHints.icon_y = SizeHints.y; XSetWMHints(Disp, Win, &WmHints); XSetCommand(Disp, Win, argv, argc); - + XMapWindow(Disp, Win); - + if (debug) fprintf(stderr, "-> calling fak_maskset() from create_window()...\n"); fak_maskset(); if (debug) fprintf(stderr, "-> calling fak_redraw() from create_window()...\n"); fak_redraw(); if (debug) fprintf(stderr, "-> Leaving create_window()\n"); -} +} -void newtext(char *txt) { +void newtext(char *txt) { strcpy(led_text, txt); text_start = 0; -} +} void show_icon_db_f() { /* scroll the song title */ @@ -434,7 +434,7 @@ void show_icon_db_f() { } if (track > cur_ntracks - 1) return; - + if (cd->trk[track].songname != NULL) { if (show_artist) { if (cd->artist != NULL) { @@ -483,10 +483,10 @@ void show_db_f() { if ((theme_select == 0) || (where == DB_PANEL)) { - /* + /* there is a message to display, we'll wait for the message to time-out before handling the track title... (but only if - there is no separate areas) + there is no separate areas) */ if ((strlen(led_text) > 0) && (where == MSG_PANEL)) return; @@ -505,7 +505,7 @@ void show_db_f() { if (track > cur_ntracks - 1) return; if (track < 0) return; - + if (debug > 1) fprintf(stderr, "** Show DB TRACK = %d\n", track); if (cd->trk[track].songname != NULL) { @@ -542,20 +542,20 @@ void show_db_f() { Loooooooooooooooooping......... ------------------------------------------------------------------------ */ -void main_loop() +void main_loop() { unsigned int no_disk = 0; long int dodo = RDTIME; XEvent Event; while(1) { - + if (debug > 1) fprintf(stderr, "** [Main Loop] mode = %02d track = %02d \n", cur_cdmode, cur_track); - + if (cur_cdmode == WM_CDM_EJECTED) no_disk = 1; slow_down++; - + if (slow_down > 10) { #ifdef WMK @@ -589,13 +589,13 @@ void main_loop() fak_redraw(); } } - + /* The Loop Mode : */ if ( (cur_track == loop_end_track ) && (cur_pos_rel >= loop_2) && (loop_mode) ) { cd_control(LOOP); fak_redraw(); } - + /* The Intro Scan Mode : */ if ( (cur_pos_rel > cue_time) && (intro_mode) ) { cd_control(INTRONEXT); @@ -608,19 +608,19 @@ void main_loop() } /* Check events */ - + while (XPending(Disp)) { - + XNextEvent(Disp, &Event); - -#ifdef WMK + +#ifdef WMK if (!WMHandleEvent(&Event)) { #endif switch(Event.type) { - + /* ---------------------- Redraw Window --------------------- */ - + case Expose: if(Event.xexpose.count == 0) { lasttime=01; @@ -630,17 +630,17 @@ void main_loop() if (debug > 1) fprintf(stderr, "** XEVent - expose, not handled, count = %d\n", Event.xexpose.count); } break; - + /* ----------------------- Mouse Click ---------------------- */ - + case ButtonPress: - + wm_cd_status(); mouse_events(Event); break; - + /* ------------------------ Destroy Window ------------------- */ - + case DestroyNotify: XFreeGC(Disp, WinGC); XDestroyWindow(Disp, Win); @@ -653,34 +653,34 @@ void main_loop() break; } -#ifdef WMK +#ifdef WMK } #endif XFlush(Disp); } /* check event */ - + usleep(dodo); - + /* ----------------- now we have to redraw the screen: ---------------- */ - + if ((slow_down > 10) || (has_clicked)) { fak_redraw(); slow_down = 0; has_clicked = FALSE; } } -} +} /* ------------------------------------------------------------------------ So... let's go! ------------------------------------------------------------------------ */ -int main(int argc, char *argv[]) +int main(int argc, char *argv[]) { - extern char *rcfile, *dbfiles; + extern char *rcfile, *dbfiles; /*printf("AScd %s\n", VERSION);*/ - + /* CD device: */ #ifndef NO_D_DEVICE @@ -691,7 +691,7 @@ int main(int argc, char *argv[]) strcpy(led_text, ""); strcpy(theme, "default"); strcpy(xv, "xv"); - + /* the WorkMan database. It's still not used in ascd, but we need this to start the WorkMan code */ @@ -723,7 +723,7 @@ int main(int argc, char *argv[]) create_window(argc, argv); if (debug) fprintf(stderr, "** checking CD status...\n"); wm_cd_status(); - + if (cur_cdmode != WM_CDM_EJECTED) { if (debug) fprintf(stderr, "** reading CD initial volume...\n"); volume = wm_cd_read_initial_volume(max_volume); @@ -749,12 +749,12 @@ int main(int argc, char *argv[]) } if (debug) fprintf(stderr, "** checking current CD volume in database\n"); - + if (((cur_cdmode == WM_CDM_PLAYING) || (cur_cdmode == WM_CDM_PAUSED)) && (cd->volume > 0)) { volume=cd->volume; cd_volume(volume, 10, max_volume); } - + fak_maskset(); if (debug) fprintf(stderr, "** Init passed. Entering main loop.\n"); diff --git a/ascd/ascd/ascd.man b/ascd/ascd/ascd.man index 3aa208f..29c0413 100644 --- a/ascd/ascd/ascd.man +++ b/ascd/ascd/ascd.man @@ -94,7 +94,7 @@ .SH DESCRIPTION \fBascd\fP is CD player written to play audio CD's integrated in -afterstep's Wharf module or WindowMaker's dock. +afterstep's Wharf module or WindowMaker's dock. \fBascd\fP handles mounted volumes, and opens and closes the tray. .SH CONFIGURATION OPTIONS @@ -120,7 +120,7 @@ afterstep's Wharf module or WindowMaker's dock. you use ascd with WindowMaker. .B -device <device> - specifies the CDROM device which should be used by + specifies the CDROM device which should be used by ascd. If "-DNO_DEFAULT_DEVICE" was set at compilation time this option will have no effect. @@ -138,7 +138,7 @@ afterstep's Wharf module or WindowMaker's dock. .B +/-autoplay, +/-a Turn on or off \fBautoplay mode\fP. When this is - turned on, ascd always wait for a CD, and play it + turned on, ascd always wait for a CD, and play it automatically when inserted. .B +/-autoprobe, +/-p @@ -161,7 +161,7 @@ afterstep's Wharf module or WindowMaker's dock. .B -volume <value> Set the CD driver volume, between 0 and maxvolume. - Note that the -volume option in independant from + Note that the -volume option in independant from the mixer. It controls the drive, not the sound card. @@ -199,7 +199,7 @@ afterstep's Wharf module or WindowMaker's dock. .B -save Save all the settings and exit. Usefull to 'make' a new configuration file: set all the stuff you want - to set and put -save as last commandline option. + to set and put -save as last commandline option. Example: ascd +w +a -device /dev/cd0c -save diff --git a/ascd/ascd/cdcontrol.c b/ascd/ascd/cdcontrol.c index b8daeff..a10c242 100644 --- a/ascd/ascd/cdcontrol.c +++ b/ascd/ascd/cdcontrol.c @@ -1,6 +1,6 @@ /* =========================================================================== * AScd: cdcontrol.c - * This is cd_control() function: accept orders from the ui player and send + * This is cd_control() function: accept orders from the ui player and send * the appropriate commands to libworkman. * * Please do *not* modify this function as it is used without changes by @@ -28,20 +28,20 @@ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL DENIS BOUREZ, ROB MALDA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * =========================================================================== */ - + #define CD_C_VERSION "1.4" #include "ext.h" -void +void cd_control(int order) { static int pos_changed = FALSE; @@ -61,7 +61,7 @@ cd_control(int order) if ((cur_ntracks == 1) && (cd->trk[cur_track - 1].data)) { - /* only one track, and it's a data track. We ignore + /* only one track, and it's a data track. We ignore all commands to avoid some funny things. Only the EJECT commands are allowed */ @@ -70,7 +70,7 @@ cd_control(int order) return; } } - + switch(order) { case PLAY: @@ -85,7 +85,7 @@ cd_control(int order) if (cur_track < 1) cur_track = 1; /* don't play data tracks: */ - + if (! cd->trk[cur_track - 1].data) { if (cur_cdmode != WM_CDM_EJECTED) { if (cur_cdmode != WM_CDM_PAUSED) { @@ -226,7 +226,7 @@ cd_control(int order) /* if it's a data track, skip it */ while ((cd->trk[cur_track - 1].data) && (cur_track <= cur_ntracks)) cur_track++; - + if (cur_cdmode == WM_CDM_PLAYING) { wanna_play = TRUE; wm_cd_play(cur_track, 0, cur_ntracks + 1); @@ -280,17 +280,17 @@ cd_control(int order) case LOOP: if ( (loop_2 > loop_1) || (loop_end_track > loop_start_track) ) { - + if (loop_start_track == 0) loop_start_track = 1; intro_mode = 0; - if ( ( loop_2 > loop_1 ) + if ( ( loop_2 > loop_1 ) || ( loop_start_track != loop_end_track ) ) currenttrack = loop_start_track; else { loop_end_track = cur_ntracks; currenttrack = loop_start_track = 1; loop_1 = 0; - loop_2 = + loop_2 = thiscd.trk[ loop_end_track - 1 ].length - 1; } wm_cd_play(loop_start_track, loop_1, cur_ntracks + 1); @@ -327,7 +327,7 @@ cd_control(int order) intro_mode = 0; } break; - + case INTRONEXT: wm_cd_pause(); currenttrack = cur_track; @@ -337,7 +337,7 @@ cd_control(int order) cur_pos_rel = 0; wm_cd_play(currenttrack, 0, cur_ntracks + 1); break; - + case LOCACCESS: if ( (loop_1 > 0) && (loop_start_track > 0) ) { intro_mode = 0; diff --git a/ascd/ascd/configure b/ascd/ascd/configure index fe032bc..41c6825 100755 --- a/ascd/ascd/configure +++ b/ascd/ascd/configure @@ -64,7 +64,7 @@ printf "Bin directory? " read BINDIR echo -case $BINDIR in +case $BINDIR in "") echo "#define CBINDIR /usr/local/bin" > dirs.h echo "** Ascd will be /usr/local/bin/ascd" ;; @@ -85,9 +85,9 @@ echo "default value (/usr/local/man/man1)." echo printf "Man directory? " read MANDIR -echo +echo -case $MANDIR in +case $MANDIR in "") echo "#define CMANDIR /usr/local/man/man1" >> dirs.h echo "** Man page will be installed in /usr/local/man/man1." ;; @@ -110,7 +110,7 @@ printf "Themes pixmaps directory? " read THDIR echo -case $THDIR in +case $THDIR in "") echo "#define THDIR \"/usr/local/share/AScd\"" >> config.h echo "#define CTHDIR /usr/local/share/AScd" >> dirs.h echo "** Theme dir: /usr/local/share/AScd." @@ -139,9 +139,9 @@ echo "2) no WINGs support (DEFAULT)" echo printf "Type 1 or 2: " read WINGS -echo +echo -case $WINGS in +case $WINGS in 1) echo "#define WMK" >> config.h echo "** Compiling with WINGs support." ;; @@ -167,7 +167,7 @@ printf "Type 1 or 2: " read WINGS echo -case $WINGS in +case $WINGS in 1) echo "#define MIXER" >> config.h echo "** Compiling with mixer support." ;; diff --git a/ascd/ascd/doc/CHANGES b/ascd/ascd/doc/CHANGES index e114e93..afe210f 100644 --- a/ascd/ascd/doc/CHANGES +++ b/ascd/ascd/doc/CHANGES @@ -55,13 +55,13 @@ - added "quick ref" support with quick_ref command and a button in the WINGs main window -------------- 05/16/99: +------------- 05/16/99: - added support for vertical sliders (CD direct access, volume and mixer) via vprogress_bar, vvolume_bar and vmixer_bar. - added support for inverted vertical sliders via iprogress_bar, ivolume_bar and imixer_bar. -- mixer support (FreeBSD and Linux only. Please send me a mail if +- mixer support (FreeBSD and Linux only. Please send me a mail if you compile mixer support on other platforms.) - added -mixer commandline option to specify the mixer device - themes manual updated @@ -79,21 +79,21 @@ - better WINGs handling. The WINGs window is no longer closed by the program when CD is ejected. - [fix] WINGs windows crashed when CD was stopped -- [fix] big bug in database code that oftent crashed the +- [fix] big bug in database code that oftent crashed the program at startup time (cd_curtrack = -1) - [fix] bug in the song title scrolling (hardcoded length) ------------- 05/11/99: 0.13pr6 - small updates in the man page (so outdated...) -- the theme manual (in PostScript) is now in the archive and +- the theme manual (in PostScript) is now in the archive and installed in /usr/local/share/AScd - added alt pixmap support for eject command - added database panel which can now be different from message one - changed the themes loading mechanism: themes are now installed in /usr/local/share/AScd/Themes. There's also a Default/ dir that can contain pixmaps. If a pixmap is not found in the theme dir, AScd - also search in the Default dir. By default, this dir contains + also search in the Default dir. By default, this dir contains digits.xpm and digits2.xpm. - the theme selectors now use dirent instead of the '.dir' file - added alt pixmap support for mute command @@ -147,7 +147,7 @@ New features and fixes since 0.12.1: 0.13 fixes and additions: -- the buttons containing no command are no longuer parsed in +- the buttons containing no command are no longuer parsed in case of mouse events - support for introscan - support for fade in/out @@ -158,11 +158,11 @@ New features and fixes since 0.12.1: ------------- 05/07/99: 0.13pr1 **** BACK TO ALPHA STAGE **** -It's the biggest change since I begun working on ascd. Everything +It's the biggest change since I begun working on ascd. Everything that appears on the screen is now 100% configurable. Put the buttons you want, where you want! -- major rewrite of AScd. The source code has been splitted in +- major rewrite of AScd. The source code has been splitted in several smaller C files. - [bug] the WINGs support shall *not* compile. I didn't have time to update this code with the new features. @@ -178,7 +178,7 @@ pre-releases. ===================================================================== -------------- 05/02/99: 0.12.1 +------------- 05/02/99: 0.12.1 - [fix WINGs] the themes popup didn't display the selected theme - multiple-mask shape mode, to allow transparent background with @@ -193,7 +193,7 @@ pre-releases. - added runtime visual themes management, with -theme cl option - added a popup menu in configuration window to change the visual theme *without* restarting the program -- [fix] there was a bug in the mouse routine that could eject CD +- [fix] there was a bug in the mouse routine that could eject CD if the mouse click was outside the buttons - [fix] a couple of typos in the WINGs windows. @@ -219,13 +219,13 @@ pre-releases. ------------- 04/14/99: 0.11.1 -- added lowercase letters in (r)digits.xpm. I had to make a few +- added lowercase letters in (r)digits.xpm. I had to make a few changes in the background pixmap to display the new letters. I also added a conversion that remove accents. - added 2 buttons in WINGs window to switch on/off song name and artist scrolling in main window. - added a field to edit the cd device in WINGs window -- [fix] with a songname <= 8 cars, the artist was not shown +- [fix] with a songname <= 8 cars, the artist was not shown - [fix?] autorepeat ------------- 04/13/99: 0.11.0 RELEASE @@ -331,7 +331,7 @@ is gone again! - [fix] 0.9 didn't compile if NO_D_DEVICE was defined. Thanks to Gus Hartmann who found the bug. -- [fix] 0.9 entered a crazy loop at CD end when autorepeat +- [fix] 0.9 entered a crazy loop at CD end when autorepeat was off. ------------- 01/27/99: 0.9 RELEASE @@ -346,7 +346,7 @@ is gone again! - [fix] ascd crashed on launch with no cd in tray (since 01/22) - [fix] up/down buttons didn't work when paused (since 01/22) -- [fix] track nbr was not properly redrawn when using up/down +- [fix] track nbr was not properly redrawn when using up/down buttons when stopped (since 01/21) - [fix] window was not properly redrawn when stopped (since 0.8-R) - [fix] it was not possible to access the last track when stopped @@ -364,13 +364,13 @@ is gone again! * Ascd: -- 100% new mixer section, with access to all the 17 mixing "sliders" +- 100% new mixer section, with access to all the 17 mixing "sliders" of OSS. -- the back and foreground colors may now be different for the CD +- the back and foreground colors may now be different for the CD player and the mixer. - all the mixer settings can be saved in a ~/.ascdrc file. This file can be loaded at startup. -- Total rewrite of the command line parse function. Added several +- Total rewrite of the command line parse function. Added several new commands. See ascd -help for further details. * Lib: @@ -385,25 +385,25 @@ is gone again! - Almost total rewrite of cd_control() function. The code should be more reliable (I hope!). Some clean-ups two. -- no more uses old ascd variables (currenttrack, maxtracks, playing, +- no more uses old ascd variables (currenttrack, maxtracks, playing, paused). Only the WorkMan ones (cur_track, cur_ntracks, cur_cdmode) are used. - on launch, if autoplay is disabled, the track nbr panel displays how tracks are on the CD instead of "01". -- when the time panel displays the global remaining time of the CD, +- when the time panel displays the global remaining time of the CD, the track nbr panel displays the number of remaining tracks. - new alpha pixmaps. - adjusted timing for checking inserted CD in autoplay mode. -- Middle click on the display switch the mute mode. Muted/Unmuted +- Middle click on the display switch the mute mode. Muted/Unmuted volumes can be set with 'm' and 'v' command line parameters. - [fix] in autoplay mode, launching ascd with an inserted audio CD in - drive didn't play this one automatically. + drive didn't play this one automatically. ------------- 01/21/99: PR2 * Ascd: -- The mixer code was removed once again, due to the big XPM code +- The mixer code was removed once again, due to the big XPM code changes. - XPM code redesigned: each button has its own XPM file. @@ -412,15 +412,15 @@ is gone again! * Lib: - added O_RDONLY | O_NONBLOCK flagsto the cd_device opening function - in plat_linux.c and plat_freebsd.c. Thanks to Jens Axboe + in plat_linux.c and plat_freebsd.c. Thanks to Jens Axboe ([email protected]) - + ------------- 12/20/98: PR1 * Lib: - using WorkMan 1.3b (BETA) code instead of WorkMan 1.3a -- patched plat_freebsd.c to compile under FreeBSD 3.0. Thanks to +- patched plat_freebsd.c to compile under FreeBSD 3.0. Thanks to Stephane Marzloff ([email protected]) - plat_openbsd.c added (WorkMan) @@ -456,7 +456,7 @@ is gone again! ------------- 11/29/98: - lib should now compile on Solaris 7 with gcc, using a specific - Makefile. + Makefile. - added NO_D_DEVICE option for Solaris Volume Manager. ------------- 12/01/97: @@ -472,13 +472,13 @@ is gone again! - 'Config' file where all compilation options can be changed. can be changed. -- now recognize WorkMan splited tracks. Try it with Prince's +- now recognize WorkMan splited tracks. Try it with Prince's Lovesexy's album !! * Ascd: - ascd now includes asmixer! -- added a "mixer screen" based on asmixer 0.5: clic on +- added a "mixer screen" based on asmixer 0.5: clic on time display with right button to switch to it. - added -v, -1, -2, -3 command line parameters for the mixer screen (same as asmixer). Removed the old -v option. @@ -490,12 +490,12 @@ is gone again! - changed "-l" option to "-f" ([F]oreground color) - when CD is ejected, track nbr shows "--". - all the XPMs are now included in ascd.c, to allow to - define the bg color. I also fixed a few things in the + define the bg color. I also fixed a few things in the "old and quick made" ascd+ buttons. - when global time is displayed, clicking on the progress bar give access to the whole disk. - added a "#define VERSION" in ascd.c -- added the new options (since 0.7) in the man page +- added the new options (since 0.7) in the man page ===================================================================== @@ -524,7 +524,7 @@ from ascd 0.6 v0.6 - Most important: WindowMaker Dock support with the -w flag! - + ===================================================================== 03/25/97: 0.4+ release @@ -555,7 +555,7 @@ database code) - added: 4th digit for songs longer than 10 minutes. - added: -a command line option. Activates the autoplay mode: ascd automatically plays the CD when it is inserted. -- added: -c command line option which sets the value, in seconds, +- added: -c command line option which sets the value, in seconds, for the intro scan mode and the cue/review function. - changed the indentation in the source code with the auto- indentation in jed. Sorry ;-) @@ -594,4 +594,4 @@ v0.2 useful with ascdc. - Now includes the correct README file. Thanks to the Hundreds of you who caught that. It's nice to know - someone reads these files. + someone reads these files. diff --git a/ascd/ascd/doc/NEWS b/ascd/ascd/doc/NEWS index 8ae59a9..dc3e17e 100644 --- a/ascd/ascd/doc/NEWS +++ b/ascd/ascd/doc/NEWS @@ -7,8 +7,8 @@ considering this code as beta stage one.) * Visual Themes: - Visual themes are now 100% configurable. A theme consist in a description - file and various pixmaps. You can place any screen element anywhere in the + Visual themes are now 100% configurable. A theme consist in a description + file and various pixmaps. You can place any screen element anywhere in the window and the icon. Available screen elements: - pixmaps @@ -24,8 +24,8 @@ considering this code as beta stage one.) buttons. AScd provides commands to control the general options, the CD player and the mixer. - AScd is no longer restricted to a "dockable" size. More: In -w mode, it's - now possible to have different screen layouts for the main window and the + AScd is no longer restricted to a "dockable" size. More: In -w mode, it's + now possible to have different screen layouts for the main window and the icon one * Mixer support is back (FreeBSD and Linux are the only supported platforms) @@ -115,13 +115,13 @@ New features in ascd 0.9: * REWRITE of the command line parsing function. Added a few new options. See the man page or type ascd -help. * ascd can save and load its settings in ~/.ascdrc file. It - is also possible to save the 17 mixer settings in this file. The + is also possible to save the 17 mixer settings in this file. The .ascdrc settings can be overidden with the commandline options. * added drive volume control with a "mute" switch (values can be changed with commandline options). Note that mute - function controls the CD Drive Volume, and is independant + function controls the CD Drive Volume, and is independant from the mixer module. -* The LED colors can be changed for the mixer (Config file, +* The LED colors can be changed for the mixer (Config file, commandline & ~/.ascdrc) * Autoplay and autorepeat modes redesigned. They should ok now. (still a few little problems with autoplay detecting) diff --git a/ascd/ascd/faktory.c b/ascd/ascd/faktory.c index 79973e3..5edd5f4 100644 --- a/ascd/ascd/faktory.c +++ b/ascd/ascd/faktory.c @@ -24,16 +24,16 @@ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL DENIS BOUREZ, ROB MALDA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * =========================================================================== */ - + #include "ext.h" #define MAX_LINE_NAME 16 @@ -150,10 +150,10 @@ void fak_validate_pixmap(char *string, char *name) } } -void fak_init_theme(int upgrade) +void fak_init_theme(int upgrade) { /* re-init all the buttons structure and globals */ - + int i; if (debug) fprintf(stderr, "** Init theme variables.\n Buttons...\n"); @@ -163,7 +163,7 @@ void fak_init_theme(int upgrade) thdata[i].panel = 0; thdata[i].left = 0; thdata[i].mid = 0; - thdata[i].right = 0; + thdata[i].right = 0; thdata[i].x = 0; thdata[i].y = 0; thdata[i].w = 0; @@ -226,7 +226,7 @@ void fak_init_theme(int upgrade) } -int fak_load_theme(char *th, int upgrade) +int fak_load_theme(char *th, int upgrade) { char txt[256]; char key[256]; @@ -308,7 +308,7 @@ struct { } } else if (key[0] == '}') { button = FALSE; - + /* update the pointers to msg, counter and tracknbr: */ switch(thdata[but_max].type) { @@ -387,9 +387,9 @@ struct { } i = 0; - if ((strcmp(key, "left") == 0) || - (strcmp(key, "middle") ==0) || - (strcmp(key, "mid") ==0) || + if ((strcmp(key, "left") == 0) || + (strcmp(key, "middle") ==0) || + (strcmp(key, "mid") ==0) || (strcmp(key, "right") == 0)) { /* --------------- available commands: ---------------- */ @@ -519,7 +519,7 @@ struct { if ((Ret != XpmSuccess) && (debug)) fprintf(stderr, "*!* "); /* the fonts: */ - + if (debug) fprintf(stderr, "alpha 1 "); fak_validate_pixmap(txt, th_alpha1); @@ -533,7 +533,7 @@ struct { Ret = XpmReadFileToPixmap(Disp, Root, txt, &ralphaXPM.pixmap, &ralphaXPM.mask, &ralphaXPM.attributes); if ((Ret != XpmSuccess) && (debug)) fprintf(stderr, "*!* "); - + if (debug) fprintf(stderr, "\n-> Loading buttons pixmaps... "); for (i = 1; i <= but_max; i++) { if (strlen(thdata[i].xpm_file) > 0) { @@ -569,7 +569,7 @@ struct { } } -void fak_icon_text(char *string, unsigned int where, unsigned int col, unsigned int red) +void fak_icon_text(char *string, unsigned int where, unsigned int col, unsigned int red) { unsigned int x = 0; unsigned int offset = 0; @@ -614,15 +614,15 @@ void fak_icon_text(char *string, unsigned int where, unsigned int col, unsigned if ((strlen(txt) > thdata[icon_msg].w) && (where == MSG_PANEL)) { txt[thdata[icon_msg].w] = 0; - + } - + if ((strcmp(txt, "") == 0) && (where == MSG_PANEL)) { for (x = 1; x <= thdata[icon_msg].w; x++) { strcat(txt, " "); } } - + if (red) { char_max = alphaXPM.attributes.width / 6; @@ -660,16 +660,16 @@ void fak_icon_text(char *string, unsigned int where, unsigned int col, unsigned if (red) { XCopyArea(Disp, ralphaXPM.pixmap, Iconwin, WinGC, - 6 * offset, 0, 6, 9, - hoffset + (col * 6) + (x * 6), + 6 * offset, 0, 6, 9, + hoffset + (col * 6) + (x * 6), voffset); } else { XCopyArea(Disp, alphaXPM.pixmap, Iconwin, WinGC, - 6 * offset, 0, 6, 9, - hoffset + (col * 6) + (x * 6), + 6 * offset, 0, 6, 9, + hoffset + (col * 6) + (x * 6), voffset); } - + } } @@ -736,20 +736,20 @@ void fak_text(char *string, unsigned int where, unsigned int col, unsigned int r if ((strlen(txt) > thdata[but_msg].w) && (where == MSG_PANEL)) { txt[thdata[but_msg].w] = 0; - + } if ((strlen(txt) > thdata[but_db].w) && (where == DB_PANEL)) { txt[thdata[but_msg].w] = 0; - + } - + if ((strcmp(txt, "") == 0) && (where == MSG_PANEL)) { for (x = 1; x <= thdata[but_msg].w; x++) { strcat(txt, " "); } } - + if ((strcmp(txt, "") == 0) && (where == DB_PANEL)) { for (x = 1; x <= thdata[but_db].w; x++) { strcat(txt, " "); @@ -792,41 +792,41 @@ void fak_text(char *string, unsigned int where, unsigned int col, unsigned int r if (red) { XCopyArea(Disp, ralphaXPM.pixmap, Win, WinGC, - 6 * offset, 0, 6, 9, - hoffset + (col * 6) + (x * 6), + 6 * offset, 0, 6, 9, + hoffset + (col * 6) + (x * 6), voffset); if (!th_no_icon_window) { XCopyArea(Disp, ralphaXPM.pixmap, Iconwin, WinGC, - 6 * offset, 0, 6, 9, - hoffset + (col * 6) + (x * 6), + 6 * offset, 0, 6, 9, + hoffset + (col * 6) + (x * 6), voffset); } } else { XCopyArea(Disp, alphaXPM.pixmap, Win, WinGC, - 6 * offset, 0, 6, 9, - hoffset + (col * 6) + (x * 6), + 6 * offset, 0, 6, 9, + hoffset + (col * 6) + (x * 6), voffset); if (!th_no_icon_window) { XCopyArea(Disp, alphaXPM.pixmap, Iconwin, WinGC, - 6 * offset, 0, 6, 9, - hoffset + (col * 6) + (x * 6), + 6 * offset, 0, 6, 9, + hoffset + (col * 6) + (x * 6), voffset); } } - + } } -int fak_flush_expose(Window w) +int fak_flush_expose(Window w) { XEvent dummy; int i=0; while (XCheckTypedWindowEvent (Disp, w, Expose, &dummy))i++; return i; -} +} void fak_minus(void) { if (th_no_minus) return; @@ -835,20 +835,20 @@ void fak_minus(void) { if (!th_no_icon_window) { if (but_counter == 0) return; XCopyArea(Disp, alphaXPM.pixmap, Win, WinGC, - 6 * (45 - 32), 0, 6, 7, + 6 * (45 - 32), 0, 6, 7, thdata[but_counter].x, thdata[but_counter].y); XCopyArea(Disp, alphaXPM.pixmap, Iconwin, WinGC, - 6 * (45 - 32), 0, 6, 7, + 6 * (45 - 32), 0, 6, 7, thdata[but_counter].x, thdata[but_counter].y); } else { if (but_counter > 0) { XCopyArea(Disp, alphaXPM.pixmap, Win, WinGC, - 6 * (45 - 32), 0, 6, 7, + 6 * (45 - 32), 0, 6, 7, thdata[but_counter].x, thdata[but_counter].y); } if (icon_counter > 0) { XCopyArea(Disp, alphaXPM.pixmap, Iconwin, WinGC, - 6 * (45 - 32), 0, 6, 7, + 6 * (45 - 32), 0, 6, 7, thdata[icon_counter].x, thdata[icon_counter].y); } } @@ -856,20 +856,20 @@ void fak_minus(void) { if (!th_no_icon_window) { if (but_counter == 0) return; XCopyArea(Disp, alphaXPM.pixmap, Win, WinGC, - 588, 0, 4, 7, + 588, 0, 4, 7, thdata[but_counter].x, thdata[but_counter].y); XCopyArea(Disp, alphaXPM.pixmap, Iconwin, WinGC, - 588, 0, 4, 7, + 588, 0, 4, 7, thdata[but_counter].x, thdata[but_counter].y); } else { if (but_counter > 0) { XCopyArea(Disp, alphaXPM.pixmap, Win, WinGC, - 588, 0, 4, 7, + 588, 0, 4, 7, thdata[but_counter].x, thdata[but_counter].y); } if (icon_counter > 0) { XCopyArea(Disp, alphaXPM.pixmap, Iconwin, WinGC, - 588, 0, 4, 7, + 588, 0, 4, 7, thdata[icon_counter].x, thdata[icon_counter].y); } } @@ -897,7 +897,7 @@ void fak_minus(void) { 582, 0, 4, 4, thdata[icon_counter].x, thdata[icon_counter].y); } - } + } } } @@ -908,16 +908,16 @@ void fak_singlemask(int i) if (strlen(thdata[i].xpm_file) > 0) { if (!th_no_icon_window) { - XShapeCombineMask(Disp, Win, ShapeBounding, thdata[i].x, thdata[i].y, + XShapeCombineMask(Disp, Win, ShapeBounding, thdata[i].x, thdata[i].y, thdata[i].xpm.mask, ShapeSubtract); - XShapeCombineMask(Disp, Iconwin, ShapeBounding, thdata[i].x, thdata[i].y, + XShapeCombineMask(Disp, Iconwin, ShapeBounding, thdata[i].x, thdata[i].y, thdata[i].xpm.mask, ShapeSubtract); } else { if (thdata[i].icon) { - XShapeCombineMask(Disp, Iconwin, ShapeBounding, thdata[i].x, thdata[i].y, + XShapeCombineMask(Disp, Iconwin, ShapeBounding, thdata[i].x, thdata[i].y, thdata[i].xpm.mask, ShapeSubtract); } else { - XShapeCombineMask(Disp, Win, ShapeBounding, thdata[i].x, thdata[i].y, + XShapeCombineMask(Disp, Win, ShapeBounding, thdata[i].x, thdata[i].y, thdata[i].xpm.mask, ShapeSubtract); } } @@ -925,16 +925,16 @@ void fak_singlemask(int i) if (strlen(thdata[i].altxpm_file) > 0) { if (!th_no_icon_window) { - XShapeCombineMask(Disp, Win, ShapeBounding, thdata[i].x, thdata[i].y, + XShapeCombineMask(Disp, Win, ShapeBounding, thdata[i].x, thdata[i].y, thdata[i].altxpm.mask, ShapeSubtract); - XShapeCombineMask(Disp, Iconwin, ShapeBounding, thdata[i].x, thdata[i].y, + XShapeCombineMask(Disp, Iconwin, ShapeBounding, thdata[i].x, thdata[i].y, thdata[i].altxpm.mask, ShapeSubtract); } else { if (thdata[i].icon) { - XShapeCombineMask(Disp, Iconwin, ShapeBounding, thdata[i].x, thdata[i].y, + XShapeCombineMask(Disp, Iconwin, ShapeBounding, thdata[i].x, thdata[i].y, thdata[i].altxpm.mask, ShapeSubtract); } else { - XShapeCombineMask(Disp, Win, ShapeBounding, thdata[i].x, thdata[i].y, + XShapeCombineMask(Disp, Win, ShapeBounding, thdata[i].x, thdata[i].y, thdata[i].altxpm.mask, ShapeSubtract); } } @@ -944,31 +944,31 @@ void fak_singlemask(int i) if ((fak_use_alt(i)) && (strlen(thdata[i].altxpm_file) > 0)) { if (!th_no_icon_window) { - XShapeCombineMask(Disp, Win, ShapeBounding, thdata[i].x, thdata[i].y, + XShapeCombineMask(Disp, Win, ShapeBounding, thdata[i].x, thdata[i].y, thdata[i].altxpm.mask, ShapeUnion); - XShapeCombineMask(Disp, Iconwin, ShapeBounding, thdata[i].x, thdata[i].y, + XShapeCombineMask(Disp, Iconwin, ShapeBounding, thdata[i].x, thdata[i].y, thdata[i].altxpm.mask, ShapeUnion); } else { if (thdata[i].icon) { - XShapeCombineMask(Disp, Iconwin, ShapeBounding, thdata[i].x, thdata[i].y, + XShapeCombineMask(Disp, Iconwin, ShapeBounding, thdata[i].x, thdata[i].y, thdata[i].altxpm.mask, ShapeUnion); } else { - XShapeCombineMask(Disp, Win, ShapeBounding, thdata[i].x, thdata[i].y, + XShapeCombineMask(Disp, Win, ShapeBounding, thdata[i].x, thdata[i].y, thdata[i].altxpm.mask, ShapeUnion); } } } else { if (!th_no_icon_window) { - XShapeCombineMask(Disp, Win, ShapeBounding, thdata[i].x, thdata[i].y, + XShapeCombineMask(Disp, Win, ShapeBounding, thdata[i].x, thdata[i].y, thdata[i].xpm.mask, ShapeUnion); - XShapeCombineMask(Disp, Iconwin, ShapeBounding, thdata[i].x, thdata[i].y, + XShapeCombineMask(Disp, Iconwin, ShapeBounding, thdata[i].x, thdata[i].y, thdata[i].xpm.mask, ShapeUnion); } else { if (thdata[i].icon) { - XShapeCombineMask(Disp, Iconwin, ShapeBounding, thdata[i].x, thdata[i].y, + XShapeCombineMask(Disp, Iconwin, ShapeBounding, thdata[i].x, thdata[i].y, thdata[i].xpm.mask, ShapeUnion); } else { - XShapeCombineMask(Disp, Win, ShapeBounding, thdata[i].x, thdata[i].y, + XShapeCombineMask(Disp, Win, ShapeBounding, thdata[i].x, thdata[i].y, thdata[i].xpm.mask, ShapeUnion); } } @@ -982,15 +982,15 @@ void fak_maskset() if (debug) fprintf(stderr, "** Setting pixmaps mask\n"); if (debug) fprintf(stderr, "-> background\n"); - XShapeCombineMask(Disp, Win, ShapeBounding, 0, 0, + XShapeCombineMask(Disp, Win, ShapeBounding, 0, 0, backXPM.mask, ShapeSet); if (!th_no_icon_window) { - XShapeCombineMask(Disp, Iconwin, ShapeBounding, 0, 0, + XShapeCombineMask(Disp, Iconwin, ShapeBounding, 0, 0, backXPM.mask, ShapeSet); } else { if (strlen(th_icon_window) > 0) { - XShapeCombineMask(Disp, Iconwin, ShapeBounding, 0, 0, + XShapeCombineMask(Disp, Iconwin, ShapeBounding, 0, 0, iconXPM.mask, ShapeSet); } } @@ -1001,31 +1001,31 @@ void fak_maskset() if (debug) fprintf(stderr, "%d ", i); if ((fak_use_alt(i)) && (strlen(thdata[i].altxpm_file) > 0)) { if (!th_no_icon_window) { - XShapeCombineMask(Disp, Win, ShapeBounding, thdata[i].x, thdata[i].y, + XShapeCombineMask(Disp, Win, ShapeBounding, thdata[i].x, thdata[i].y, thdata[i].altxpm.mask, ShapeUnion); - XShapeCombineMask(Disp, Iconwin, ShapeBounding, thdata[i].x, thdata[i].y, + XShapeCombineMask(Disp, Iconwin, ShapeBounding, thdata[i].x, thdata[i].y, thdata[i].altxpm.mask, ShapeUnion); } else { if (thdata[i].icon) { - XShapeCombineMask(Disp, Iconwin, ShapeBounding, thdata[i].x, thdata[i].y, + XShapeCombineMask(Disp, Iconwin, ShapeBounding, thdata[i].x, thdata[i].y, thdata[i].altxpm.mask, ShapeUnion); } else { - XShapeCombineMask(Disp, Win, ShapeBounding, thdata[i].x, thdata[i].y, + XShapeCombineMask(Disp, Win, ShapeBounding, thdata[i].x, thdata[i].y, thdata[i].altxpm.mask, ShapeUnion); } } } else { if (!th_no_icon_window) { - XShapeCombineMask(Disp, Win, ShapeBounding, thdata[i].x, thdata[i].y, + XShapeCombineMask(Disp, Win, ShapeBounding, thdata[i].x, thdata[i].y, thdata[i].xpm.mask, ShapeUnion); - XShapeCombineMask(Disp, Iconwin, ShapeBounding, thdata[i].x, thdata[i].y, + XShapeCombineMask(Disp, Iconwin, ShapeBounding, thdata[i].x, thdata[i].y, thdata[i].xpm.mask, ShapeUnion); } else { if (thdata[i].icon) { - XShapeCombineMask(Disp, Iconwin, ShapeBounding, thdata[i].x, thdata[i].y, + XShapeCombineMask(Disp, Iconwin, ShapeBounding, thdata[i].x, thdata[i].y, thdata[i].xpm.mask, ShapeUnion); } else { - XShapeCombineMask(Disp, Win, ShapeBounding, thdata[i].x, thdata[i].y, + XShapeCombineMask(Disp, Win, ShapeBounding, thdata[i].x, thdata[i].y, thdata[i].xpm.mask, ShapeUnion); } } @@ -1061,7 +1061,7 @@ void fak_redraw() /* ============================================================== */ if (debug) fprintf(stderr, "** Entering redraw routine\n"); - + if (!blind_mode) { if ((cur_cdmode == WM_CDM_PLAYING) || (wanna_play)) wm_cd_status(); } @@ -1089,7 +1089,7 @@ void fak_redraw() cur_track = 0; redraw = TRUE; fak_maskset(); - } + } } /* ======================================================= */ @@ -1118,7 +1118,7 @@ void fak_redraw() } /* ====================================================================== - Do we *really* need to update the counter? If the cur time is the same + Do we *really* need to update the counter? If the cur time is the same as last time, we simply exit the redraw function ====================================================================== */ @@ -1146,7 +1146,7 @@ void fak_redraw() /* draw the text if we have a query */ /* ================================ */ - /* but but but... If we see a "redraw" query, + /* but but but... If we see a "redraw" query, we skip the text! It will be displayed next time the function is called... 0.13 */ @@ -1157,13 +1157,13 @@ void fak_redraw() fak_text("", MSG_PANEL, 0, FALSE); fak_text(led_text, MSG_PANEL, 0, FALSE); } - + if (time(NULL) - text_start > text_timeout) { text_start = 0; redraw = TRUE; strcpy(led_text, ""); fak_text("", MSG_PANEL, 0, FALSE); - } else { + } else { if (!fade_out) return; } } @@ -1201,43 +1201,43 @@ void fak_redraw() } } } - + /* the buttons: */ - + for (i = 1; i <= but_max; i++) { - + use_alt = FALSE; - + if ((thdata[i].panel == panel) || (thdata[i].panel == 0)) { if (thdata[i].type == FAK_VCD_BAR) { if ( (cur_cdmode != WM_CDM_STOPPED) && (cur_cdmode != WM_CDM_EJECTED) ) { if ((time_mode == 2) || (time_mode == 3)) { if (cur_cdlen > 0) { - XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0, - thdata[i].xpm.attributes.width, - 0 + (int)((float)cur_pos_abs / (float)cur_cdlen * (float)thdata[i].xpm.attributes.height), - thdata[i].x, + XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0, + thdata[i].xpm.attributes.width, + 0 + (int)((float)cur_pos_abs / (float)cur_cdlen * (float)thdata[i].xpm.attributes.height), + thdata[i].x, thdata[i].y); if (!th_no_icon_window) { - XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0, - thdata[i].xpm.attributes.width, - 0 + (int)((float)cur_pos_abs / (float)cur_cdlen * (float)thdata[i].xpm.attributes.height), - thdata[i].x, + XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0, + thdata[i].xpm.attributes.width, + 0 + (int)((float)cur_pos_abs / (float)cur_cdlen * (float)thdata[i].xpm.attributes.height), + thdata[i].x, thdata[i].y); } } } else { if (cur_tracklen > 0) { - XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0, - thdata[i].xpm.attributes.width, - 0 + (int)((float)cur_pos_rel / (float)cur_tracklen * (float)thdata[i].xpm.attributes.height), - thdata[i].x, + XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0, + thdata[i].xpm.attributes.width, + 0 + (int)((float)cur_pos_rel / (float)cur_tracklen * (float)thdata[i].xpm.attributes.height), + thdata[i].x, thdata[i].y); if (!th_no_icon_window) { - XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0, - thdata[i].xpm.attributes.width, - 0 + (int)((float)cur_pos_rel / (float)cur_tracklen * (float)thdata[i].xpm.attributes.height), - thdata[i].x, + XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0, + thdata[i].xpm.attributes.width, + 0 + (int)((float)cur_pos_rel / (float)cur_tracklen * (float)thdata[i].xpm.attributes.height), + thdata[i].x, thdata[i].y); } } @@ -1251,17 +1251,17 @@ void fak_redraw() offset = (int)((float)cur_pos_abs / (float)cur_cdlen * (float)thdata[i].xpm.attributes.height); offset = thdata[i].xpm.attributes.height - offset; - XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0, - thdata[i].xpm.attributes.width, + XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0, + thdata[i].xpm.attributes.width, thdata[i].xpm.attributes.height - offset, - thdata[i].x, + thdata[i].x, thdata[i].y +offset); - + if (!th_no_icon_window) { - XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0, - thdata[i].xpm.attributes.width, + XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0, + thdata[i].xpm.attributes.width, thdata[i].xpm.attributes.height - offset, - thdata[i].x, + thdata[i].x, thdata[i].y +offset); } } @@ -1270,17 +1270,17 @@ void fak_redraw() offset = (int)((float)cur_pos_rel / (float)cur_tracklen * (float)thdata[i].xpm.attributes.height); offset = thdata[i].xpm.attributes.height - offset; - XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0, - thdata[i].xpm.attributes.width, + XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0, + thdata[i].xpm.attributes.width, thdata[i].xpm.attributes.height - offset, - thdata[i].x, + thdata[i].x, thdata[i].y +offset); - + if (!th_no_icon_window) { - XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0, - thdata[i].xpm.attributes.width, + XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0, + thdata[i].xpm.attributes.width, thdata[i].xpm.attributes.height - offset, - thdata[i].x, + thdata[i].x, thdata[i].y +offset); } } @@ -1291,23 +1291,23 @@ void fak_redraw() if ( (cur_cdmode != WM_CDM_STOPPED) && (cur_cdmode != WM_CDM_EJECTED) ) { if ((time_mode == 2) || (time_mode == 3)) { if (cur_cdlen > 0) { - XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0, - 0 + (int)((float)cur_pos_abs / (float)cur_cdlen * (float)thdata[i].xpm.attributes.width), + XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0, + 0 + (int)((float)cur_pos_abs / (float)cur_cdlen * (float)thdata[i].xpm.attributes.width), thdata[i].xpm.attributes.height, thdata[i].x, thdata[i].y); if (!th_no_icon_window) { - XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0, - 0 + (int)((float)cur_pos_abs / (float)cur_cdlen * (float)thdata[i].xpm.attributes.width), + XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0, + 0 + (int)((float)cur_pos_abs / (float)cur_cdlen * (float)thdata[i].xpm.attributes.width), thdata[i].xpm.attributes.height, thdata[i].x, thdata[i].y); } } } else { if (cur_tracklen > 0) { - XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0, - 0 + (int)((float)cur_pos_rel / (float)cur_tracklen * (float)thdata[i].xpm.attributes.width), + XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0, + 0 + (int)((float)cur_pos_rel / (float)cur_tracklen * (float)thdata[i].xpm.attributes.width), thdata[i].xpm.attributes.height, thdata[i].x, thdata[i].y); if (!th_no_icon_window) { - XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0, - 0 + (int)((float)cur_pos_rel / (float)cur_tracklen * (float)thdata[i].xpm.attributes.width), + XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0, + 0 + (int)((float)cur_pos_rel / (float)cur_tracklen * (float)thdata[i].xpm.attributes.width), thdata[i].xpm.attributes.height, thdata[i].x, thdata[i].y); } } @@ -1320,17 +1320,17 @@ void fak_redraw() /* erase the old position : */ if (thdata[i].ox > 0) { - XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, - 0, thdata[i].oy, + XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, + 0, thdata[i].oy, thdata[i].altxpm.attributes.width, thdata[i].altxpm.attributes.height, - thdata[i].x, + thdata[i].x, thdata[i].oy + thdata[i].y); - + if (!th_no_icon_window) { - XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, + XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, thdata[i].oy, thdata[i].altxpm.attributes.width, thdata[i].altxpm.attributes.height, - thdata[i].x, + thdata[i].x, thdata[i].oy + thdata[i].y); } } @@ -1345,17 +1345,17 @@ void fak_redraw() /* and show it: */ - XCopyArea(Disp, thdata[i].altxpm.pixmap, Win, WinGC, - 0, 0, + XCopyArea(Disp, thdata[i].altxpm.pixmap, Win, WinGC, + 0, 0, thdata[i].altxpm.attributes.width, thdata[i].altxpm.attributes.height, - thdata[i].x, + thdata[i].x, thdata[i].y + fx); if (!th_no_icon_window) { - XCopyArea(Disp, thdata[i].altxpm.pixmap, Iconwin, WinGC, - 0, 0, + XCopyArea(Disp, thdata[i].altxpm.pixmap, Iconwin, WinGC, + 0, 0, thdata[i].altxpm.attributes.width, thdata[i].altxpm.attributes.height, - thdata[i].x, + thdata[i].x, thdata[i].y + fx); } @@ -1367,17 +1367,17 @@ void fak_redraw() /* erase the old position : */ if (thdata[i].ox > 0) { - XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, - thdata[i].ox, 0, + XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, + thdata[i].ox, 0, thdata[i].altxpm.attributes.width, thdata[i].altxpm.attributes.height, - thdata[i].ox + thdata[i].x, + thdata[i].ox + thdata[i].x, thdata[i].y); - + if (!th_no_icon_window) { - XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, - thdata[i].ox, 0, + XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, + thdata[i].ox, 0, thdata[i].altxpm.attributes.width, thdata[i].altxpm.attributes.height, - thdata[i].ox + thdata[i].x, + thdata[i].ox + thdata[i].x, thdata[i].y); } } @@ -1392,17 +1392,17 @@ void fak_redraw() /* and show it: */ - XCopyArea(Disp, thdata[i].altxpm.pixmap, Win, WinGC, - 0, 0, + XCopyArea(Disp, thdata[i].altxpm.pixmap, Win, WinGC, + 0, 0, thdata[i].altxpm.attributes.width, thdata[i].altxpm.attributes.height, - thdata[i].x + fx, + thdata[i].x + fx, thdata[i].y); if (!th_no_icon_window) { - XCopyArea(Disp, thdata[i].altxpm.pixmap, Iconwin, WinGC, - 0, 0, + XCopyArea(Disp, thdata[i].altxpm.pixmap, Iconwin, WinGC, + 0, 0, thdata[i].altxpm.attributes.width, thdata[i].altxpm.attributes.height, - thdata[i].x + fx, + thdata[i].x + fx, thdata[i].y); } @@ -1411,12 +1411,12 @@ void fak_redraw() } } else if (thdata[i].type == FAK_VOL_BAR) { if ( (cur_cdmode != WM_CDM_STOPPED) && (cur_cdmode != WM_CDM_EJECTED) ) { - XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0, - 0 + (int)((float)volume / (float)max_volume * (float)thdata[i].xpm.attributes.width), + XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0, + 0 + (int)((float)volume / (float)max_volume * (float)thdata[i].xpm.attributes.width), thdata[i].xpm.attributes.height, thdata[i].x, thdata[i].y); if (!th_no_icon_window) { - XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0, - 0 + (int)((float)volume / (float)max_volume * (float)thdata[i].xpm.attributes.width), + XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0, + 0 + (int)((float)volume / (float)max_volume * (float)thdata[i].xpm.attributes.width), thdata[i].xpm.attributes.height, thdata[i].x, thdata[i].y); } } @@ -1426,17 +1426,17 @@ void fak_redraw() /* first erase the old position : */ if (thdata[i].ox > 0) { - XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, - thdata[i].ox, 0, + XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, + thdata[i].ox, 0, thdata[i].altxpm.attributes.width, thdata[i].altxpm.attributes.height, - thdata[i].ox + thdata[i].x, + thdata[i].ox + thdata[i].x, thdata[i].y); - + if (!th_no_icon_window) { - XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, - thdata[i].ox, 0, + XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, + thdata[i].ox, 0, thdata[i].altxpm.attributes.width, thdata[i].altxpm.attributes.height, - thdata[i].ox + thdata[i].x, + thdata[i].ox + thdata[i].x, thdata[i].y); } } @@ -1450,17 +1450,17 @@ void fak_redraw() /* and show it: */ - XCopyArea(Disp, thdata[i].altxpm.pixmap, Win, WinGC, - 0, 0, + XCopyArea(Disp, thdata[i].altxpm.pixmap, Win, WinGC, + 0, 0, thdata[i].altxpm.attributes.width, thdata[i].altxpm.attributes.height, - thdata[i].x + fx, + thdata[i].x + fx, thdata[i].y); if (!th_no_icon_window) { - XCopyArea(Disp, thdata[i].altxpm.pixmap, Iconwin, WinGC, - 0, 0, + XCopyArea(Disp, thdata[i].altxpm.pixmap, Iconwin, WinGC, + 0, 0, thdata[i].altxpm.attributes.width, thdata[i].altxpm.attributes.height, - thdata[i].x + fx, + thdata[i].x + fx, thdata[i].y); } @@ -1469,16 +1469,16 @@ void fak_redraw() } } else if (thdata[i].type == FAK_VVOL_BAR) { if ( (cur_cdmode != WM_CDM_STOPPED) && (cur_cdmode != WM_CDM_EJECTED) ) { - XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0, - thdata[i].xpm.attributes.width, - 0 + (int)((float)volume / (float)max_volume * (float)thdata[i].xpm.attributes.height), - thdata[i].x, + XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0, + thdata[i].xpm.attributes.width, + 0 + (int)((float)volume / (float)max_volume * (float)thdata[i].xpm.attributes.height), + thdata[i].x, thdata[i].y); if (!th_no_icon_window) { - XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0, - thdata[i].xpm.attributes.width, - 0 + (int)((float)volume / (float)max_volume * (float)thdata[i].xpm.attributes.height), - thdata[i].x, + XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0, + thdata[i].xpm.attributes.width, + 0 + (int)((float)volume / (float)max_volume * (float)thdata[i].xpm.attributes.height), + thdata[i].x, thdata[i].y); } } @@ -1486,42 +1486,42 @@ void fak_redraw() if ( (cur_cdmode != WM_CDM_STOPPED) && (cur_cdmode != WM_CDM_EJECTED) ) { offset = (int)((float)volume / (float)max_volume * (float)thdata[i].xpm.attributes.height); offset = thdata[i].xpm.attributes.height - offset; - XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, offset, - thdata[i].xpm.attributes.width, + XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, offset, + thdata[i].xpm.attributes.width, thdata[i].xpm.attributes.height - offset, - thdata[i].x, + thdata[i].x, thdata[i].y +offset); if (!th_no_icon_window) { - XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, offset, - thdata[i].xpm.attributes.width, + XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, offset, + thdata[i].xpm.attributes.width, thdata[i].xpm.attributes.height - offset, - thdata[i].x, + thdata[i].x, thdata[i].y +offset); } } } else if (thdata[i].type == FAK_MIXER_BAR) { #ifdef MIXER - XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0, - 0 + (int)((float)getvol(thdata[i].arg) / 100.0 * (float)thdata[i].xpm.attributes.width), + XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0, + 0 + (int)((float)getvol(thdata[i].arg) / 100.0 * (float)thdata[i].xpm.attributes.width), thdata[i].xpm.attributes.height, thdata[i].x, thdata[i].y); if (!th_no_icon_window) { - XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0, - 0 + (int)((float)getvol(thdata[i].arg) / 100.0 * (float)thdata[i].xpm.attributes.width), + XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0, + 0 + (int)((float)getvol(thdata[i].arg) / 100.0 * (float)thdata[i].xpm.attributes.width), thdata[i].xpm.attributes.height, thdata[i].x, thdata[i].y); } #endif } else if (thdata[i].type == FAK_VMIXER_BAR) { #ifdef MIXER - XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0, - thdata[i].xpm.attributes.width, - 0 + (int)((float)getvol(thdata[i].arg) / 100.0 * (float)thdata[i].xpm.attributes.height), - thdata[i].x, + XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0, + thdata[i].xpm.attributes.width, + 0 + (int)((float)getvol(thdata[i].arg) / 100.0 * (float)thdata[i].xpm.attributes.height), + thdata[i].x, thdata[i].y); if (!th_no_icon_window) { - XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0, - thdata[i].xpm.attributes.width, - 0 + (int)((float)getvol(thdata[i].arg) / 100.0 * (float)thdata[i].xpm.attributes.height), - thdata[i].x, + XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0, + thdata[i].xpm.attributes.width, + 0 + (int)((float)getvol(thdata[i].arg) / 100.0 * (float)thdata[i].xpm.attributes.height), + thdata[i].x, thdata[i].y); } #endif @@ -1529,18 +1529,18 @@ void fak_redraw() #ifdef MIXER offset = (int)((float)getvol(thdata[i].arg) / 100.0 * (float)thdata[i].xpm.attributes.height); offset = thdata[i].xpm.attributes.height - offset; - XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, - 0, - offset, - thdata[i].xpm.attributes.width, + XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, + 0, + offset, + thdata[i].xpm.attributes.width, thdata[i].xpm.attributes.height - offset, - thdata[i].x, + thdata[i].x, thdata[i].y + offset); if (!th_no_icon_window) { - XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, offset, - thdata[i].xpm.attributes.width, + XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, offset, + thdata[i].xpm.attributes.width, thdata[i].xpm.attributes.height - offset, - thdata[i].x, + thdata[i].x, thdata[i].y + offset); } #endif @@ -1549,7 +1549,7 @@ void fak_redraw() if (strlen(thdata[i].xpm_file) > 0) { if (strlen(thdata[i].altxpm_file) == 0) use_alt = FALSE; else use_alt = fak_use_alt(i); - + if (use_alt) { if (!th_no_icon_window) { XCopyArea(Disp, thdata[i].altxpm.pixmap, Win, WinGC, 0, 0, thdata[i].xpm.attributes.width, thdata[i].altxpm.attributes.height, thdata[i].x, thdata[i].y); @@ -1578,9 +1578,9 @@ void fak_redraw() } } } - + redraw = FALSE; - + if (debug) fprintf(stderr, "-> Display [last section]\n"); /* The Track number */ @@ -1611,7 +1611,7 @@ void fak_redraw() fak_text("THEME", COUNTER_PANEL, 0, TRUE); sprintf(cdtime, "%02d", theme_select); fak_text(cdtime, TRACK_PANEL, 0, FALSE); - + i = 0; sprintf(txt, "%s/Themes", THDIR); diff --git a/ascd/ascd/faktory_prot.h b/ascd/ascd/faktory_prot.h index 5dc4912..2a48d47 100644 --- a/ascd/ascd/faktory_prot.h +++ b/ascd/ascd/faktory_prot.h @@ -3,9 +3,9 @@ extern char *tes_xgets(char *, int , FILE *); extern int fak_parse_line(char *, char *, char *); extern int fak_use_alt(int); extern void fak_validate_pixmap(char *, char *); -extern void fak_init_theme(int); -extern int fak_load_theme(char *, int); -extern void fak_icon_text(char *, unsigned int, unsigned int, unsigned int); +extern void fak_init_theme(int); +extern int fak_load_theme(char *, int); +extern void fak_icon_text(char *, unsigned int, unsigned int, unsigned int); extern void fak_text(char *, unsigned int, unsigned int, unsigned int); extern int fak_flush_expose(Window); extern void fak_minus(void); diff --git a/ascd/ascd/handlers.c b/ascd/ascd/handlers.c index 303817f..9dbcb5f 100644 --- a/ascd/ascd/handlers.c +++ b/ascd/ascd/handlers.c @@ -24,16 +24,16 @@ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL DENIS BOUREZ, ROB MALDA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * =========================================================================== */ - + #include "ext.h" #include "faktory_prot.h" @@ -52,7 +52,7 @@ void theme_select_init() while((dir_pt = readdir(dir_fd)) != NULL) if (dir_pt->d_name[0] != '.') theme_select_nbr++; closedir(dir_fd); } - + sprintf(txt, "%s/Themes", THDIR); if ((dir_fd = opendir(txt)) != NULL) { i = 0; @@ -290,7 +290,7 @@ void cd_event_handle(int event, XEvent Event) newtext("Eject"); cd_control(EJECT); redraw = TRUE; - fak_redraw(); + fak_redraw(); break; case FAK_CD_EJECTQUIT: fast_track = 0; @@ -325,9 +325,9 @@ void cd_event_handle(int event, XEvent Event) /* Direct Access: we have to compute the offset to pass it to cd_control. We also have to check if we want to move inside the current track or in the whole CD */ - + if (cur_track < 1) cur_track = 1; - + if ((time_mode == 2) || (time_mode == 3)) { if ((thdata[but_current].type == FAK_CD_BAR) || (thdata[but_current].type == FAK_CD_PIX)) { direct_access = (int)((float)(Event.xbutton.x - thdata[but_current].x) / (float)thdata[but_current].xpm.attributes.width * (float)cur_cdlen); diff --git a/ascd/ascd/misc.c b/ascd/ascd/misc.c index 80fca37..ef999ec 100644 --- a/ascd/ascd/misc.c +++ b/ascd/ascd/misc.c @@ -24,12 +24,12 @@ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL DENIS BOUREZ, ROB MALDA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * =========================================================================== */ @@ -105,7 +105,7 @@ void save_rc_file() fprintf(out, "#### generated by AScd version %s ####\n", VERSION); #ifndef NO_D_DEVICE fprintf(out, "CD_DEVICE=%s\n", cd_device); -#endif +#endif fprintf(out, "THEME=%s\n", theme); fprintf(out, "VISU=%s\n", xv); fprintf(out, "AUTOREPEAT=%d\n", autorepeat); @@ -141,7 +141,7 @@ void save_rc_file() } } -void command_line_help() +void command_line_help() { fprintf(stderr, "ascd %s ", VERSION); #ifdef WMK @@ -183,14 +183,14 @@ void command_line_help() fprintf(stderr, "-debug Enable debug (verbose) messages on stderr\n"); fprintf(stderr, "-save Save settings and exit. Should be *last* command.\n\n"); exit(0); -} +} -void command_line_err() +void command_line_err() { fprintf(stderr, "ascd: bad command line syntax.\n"); fprintf(stderr, "Type 'ascd -help' for a list of command line options.\n"); exit(-1); -} +} void themes_help() { @@ -269,7 +269,7 @@ void command_line_parse(int argc, char *argv[]) { if(++i >= argc) command_line_err(); Geometry = argv[i]; } - + else if ((strcmp(Argument + 1, "d") == 0) || (strcmp(Argument + 1, "device") == 0)) { if(++i >= argc) command_line_err(); cd_device = malloc(strlen(argv[i]) + 1); @@ -402,8 +402,8 @@ void command_line_parse(int argc, char *argv[]) { } } - -} + +} void quick_reference(int nbr) { diff --git a/ascd/ascd/mixer_handlers.c b/ascd/ascd/mixer_handlers.c index 258ff69..5f8f94d 100644 --- a/ascd/ascd/mixer_handlers.c +++ b/ascd/ascd/mixer_handlers.c @@ -24,16 +24,16 @@ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL DENIS BOUREZ, ROB MALDA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * =========================================================================== */ - + #include "ext.h" #ifdef MIXER diff --git a/ascd/ascd/wings_main.c b/ascd/ascd/wings_main.c index 37cbb25..9d467dc 100644 --- a/ascd/ascd/wings_main.c +++ b/ascd/ascd/wings_main.c @@ -24,12 +24,12 @@ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL DENIS BOUREZ, ROB MALDA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * =========================================================================== */ @@ -64,7 +64,7 @@ void close_dbwin(WMWidget *self, void *data) { strcpy(cd->cdname, WMGetTextFieldText(db_title)); if (strlen(WMGetTextFieldText(db_track)) > 0) { cd->trk[db_curtrack - 1].songname = malloc(strlen(WMGetTextFieldText(db_track)) + 1); - strcpy(cd->trk[db_curtrack - 1].songname, WMGetTextFieldText(db_track)); + strcpy(cd->trk[db_curtrack - 1].songname, WMGetTextFieldText(db_track)); } save(); @@ -76,19 +76,19 @@ void close_dbwin(WMWidget *self, void *data) { } else { strcpy(txt, "unknown artist"); } - + strcat(txt, "\n"); - + if (cd->cdname != NULL) { strcpy(txt2, cd->cdname); if (strcmp(txt2, "") == 0) strcpy(txt2, "unknown album"); } else { strcpy(txt2, "unknown album"); } - + strcat(txt, txt2); WMSetButtonText(b_title, txt); - + db_en_vue = FALSE; } @@ -424,8 +424,8 @@ void db_prev_cb(WMWidget *self, void *data) { WMSetButtonSelected(db_avoid, TRUE); } else { WMSetButtonSelected(db_avoid, FALSE); - } - + } + WMRealizeWidget(dbwin); } @@ -460,7 +460,7 @@ void db_next_cb(WMWidget *self, void *data) { } else { WMSetButtonSelected(db_avoid, FALSE); } - + WMRealizeWidget(dbwin); } @@ -682,7 +682,7 @@ void create_big_window(WMScreen *scr) { WMSetPopUpButtonPullsDown(pop, True); WMSetPopUpButtonText(pop, "Tracks"); WMAddPopUpButtonItem(pop, "1"); - WMSetPopUpButtonAction(pop, track_select, NULL); + WMSetPopUpButtonAction(pop, track_select, NULL); fr = WMCreateFrame(win); WMMoveWidget(fr, 10, 75); @@ -750,7 +750,7 @@ void create_big_window(WMScreen *scr) { WMMoveWidget(pop2, 140, 185); WMSetPopUpButtonText(pop2, theme); WMAddPopUpButtonItem(pop2, "1"); - WMSetPopUpButtonAction(pop2, theme_pick, NULL); + WMSetPopUpButtonAction(pop2, theme_pick, NULL); b_help = WMCreateButton(win, 0); WMResizeWidget(b_help, 80, 18); @@ -887,7 +887,7 @@ void update_track() { } else { strcpy(txt, "unknown artist"); } - + strcat(txt, "\n"); if (cd->cdname != NULL) { @@ -911,7 +911,7 @@ void update_track() { } pistes = cur_ntracks; - + if (cur_track >= 1) { if (cd->trk[cur_track - 1].songname != NULL) { sprintf(txt, "%s", cd->trk[cur_track - 1].songname); @@ -955,7 +955,7 @@ void big_window(WMScreen *scr) { WMSetTextFieldText(b_mutedvol, txt); WMSetTextFieldText(b_device, cd_device); - + WMSetSliderMinValue(b_volume, min_volume); WMSetSliderMaxValue(b_volume, max_volume); WMSetSliderValue(b_volume, volume); @@ -970,7 +970,7 @@ void big_window(WMScreen *scr) { WMRemovePopUpButtonItem(pop2, i); } - /* update the database stuff. AScd 0.13: I deleted all this + /* update the database stuff. AScd 0.13: I deleted all this stuff from this function as update_track() do the same! */ update_track(); diff --git a/ascd/ascd/workman/wm_cdda.h b/ascd/ascd/workman/wm_cdda.h index 831b19e..03689d7 100644 --- a/ascd/ascd/workman/wm_cdda.h +++ b/ascd/ascd/workman/wm_cdda.h @@ -7,7 +7,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -102,7 +102,7 @@ struct cdda_block { #endif /* - * The following code shouldn't take effect now. + * The following code shouldn't take effect now. * In 1998, the WorkMan platforms don't support __PDP_ENDIAN * architectures. * @@ -111,7 +111,7 @@ struct cdda_block { #if !WM_LITTLE_ENDIAN # if !WM_BIG_ENDIAN # error yet unsupported architecture - foo bar this is to stop the compiler. + foo bar this is to stop the compiler. # endif #endif #endif /* WM_CDDA_H */ diff --git a/ascd/ascd/workman/wm_cddb.h b/ascd/ascd/workman/wm_cddb.h index bd5b4f9..a03d5b0 100644 --- a/ascd/ascd/workman/wm_cddb.h +++ b/ascd/ascd/workman/wm_cddb.h @@ -7,7 +7,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public diff --git a/ascd/ascd/workman/wm_cdinfo.h b/ascd/ascd/workman/wm_cdinfo.h index f783465..dc1204a 100644 --- a/ascd/ascd/workman/wm_cdinfo.h +++ b/ascd/ascd/workman/wm_cdinfo.h @@ -7,7 +7,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -24,7 +24,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Prototypes from cdinfo.c - * + * * This is just one more step to a more modular and understandable code. */ diff --git a/ascd/ascd/workman/wm_cdrom.h b/ascd/ascd/workman/wm_cdrom.h index 7d0dca4..e2e3f19 100644 --- a/ascd/ascd/workman/wm_cdrom.h +++ b/ascd/ascd/workman/wm_cdrom.h @@ -7,7 +7,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -24,7 +24,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Prototypes from cdrom.c - * + * * This is just one more step to a more modular and understandable code. */ diff --git a/ascd/ascd/workman/wm_config.h b/ascd/ascd/workman/wm_config.h index c04a0e5..41847e3 100644 --- a/ascd/ascd/workman/wm_config.h +++ b/ascd/ascd/workman/wm_config.h @@ -7,7 +7,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -31,7 +31,7 @@ * names listed below and then set your OS specific options there. * Don't be surprised, if there are no options for your OS. They aren't * needed in any case. - * + * * The default values should produce a functional WorkMan on every * platform. * @@ -72,7 +72,7 @@ #define WORKMAN_NAME "LibWorkMan" #define WORKMAN_VERSION "1.4.0" - + /* * If your CD-ROM drive closes its tray if the device is opened, then * the next define can make WorkMans "Eject" button an "open/close" @@ -182,7 +182,7 @@ /* * Uncomment the following line to have WorkMan send SCSI commands - * directly to the CD-ROM drive. If you have a SCSI drive you + * directly to the CD-ROM drive. If you have a SCSI drive you * probably want this, but it will cause WorkMan to not work on IDE * drives. */ @@ -210,7 +210,7 @@ */ /* #define CURVED_VOLUME */ - + /* * Uncomment the following if you want to try out a better responding * WorkMan, especially with IDE drives. This may work with non-IDE @@ -229,7 +229,7 @@ * fstat() should be used, but I'm too dumb to do so. */ -#define BSD_MOUNTTEST +#define BSD_MOUNTTEST #endif /* linux */ @@ -353,5 +353,5 @@ #endif /* IBM AIX */ -/******************************************************************/ +/******************************************************************/ #endif /* WM_CONFIG_H */ diff --git a/ascd/ascd/workman/wm_database.h b/ascd/ascd/workman/wm_database.h index aaea086..0a5296c 100644 --- a/ascd/ascd/workman/wm_database.h +++ b/ascd/ascd/workman/wm_database.h @@ -7,7 +7,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -24,14 +24,14 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Prototypes for WorkMan database - * + * * This is just one more step to a more modular and understandable code. */ #define WM_DB_SAVE_ERROR 1 #define WM_DB_SAVE_DISABLED 2 - + int wm_db_get_playnew( void ); void split_workmandb( void ); int save( void ); diff --git a/ascd/ascd/workman/wm_helpers.h b/ascd/ascd/workman/wm_helpers.h index 0a3763b..60d0e92 100644 --- a/ascd/ascd/workman/wm_helpers.h +++ b/ascd/ascd/workman/wm_helpers.h @@ -7,7 +7,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -32,7 +32,7 @@ /* * LibWorkMan message levels. I'm not sure how to call them all and which * use they should fulfill. This is not very urgent now, because there - * aren't many messages in LibWorkMan now. + * aren't many messages in LibWorkMan now. */ #define WM_MSG_LEVEL_NONE 0 #define WM_MSG_LEVEL_ERROR 1 @@ -49,7 +49,7 @@ * Message classes. This is somehow a definition of * the message's source. */ - + #define WM_MSG_CLASS_PLATFORM 0x010 #define WM_MSG_CLASS_SCSI 0x020 #define WM_MSG_CLASS_CDROM 0x040 @@ -66,7 +66,7 @@ extern int wm_lib_verbosity; #ifdef DEBUG #define CHECKPOINT(t) fprintf(stderr, "%s (%d): %s\n", __FILE__, __LINE__, t ); #else -#define CHECKPOINT(t) +#define CHECKPOINT(t) #endif #ifndef TRUE diff --git a/ascd/ascd/workman/wm_index.h b/ascd/ascd/workman/wm_index.h index ce14ac3..9e6734c 100644 --- a/ascd/ascd/workman/wm_index.h +++ b/ascd/ascd/workman/wm_index.h @@ -7,7 +7,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -24,7 +24,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Prototypes for wm_index.c - * + * * This is just one more step to a more modular and understandable code. */ diff --git a/ascd/ascd/workman/wm_platform.h b/ascd/ascd/workman/wm_platform.h index 03f957d..a7c58af 100644 --- a/ascd/ascd/workman/wm_platform.h +++ b/ascd/ascd/workman/wm_platform.h @@ -7,7 +7,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -24,7 +24,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * The platform interface - * + * * This is just one more step to a more modular and understandable code. */ diff --git a/ascd/ascd/workman/wm_scsi.h b/ascd/ascd/workman/wm_scsi.h index 8763a62..4bf84fc 100644 --- a/ascd/ascd/workman/wm_scsi.h +++ b/ascd/ascd/workman/wm_scsi.h @@ -7,7 +7,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -24,11 +24,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * SCSI prototypes (scsi.c) - * + * * This is just one more step to a more modular and understandable code. */ -#include "wm_struct.h" +#include "wm_struct.h" #define WM_ERR_SCSI_INQUIRY_FAILED -1 diff --git a/ascd/ascd/workman/wm_struct.h b/ascd/ascd/workman/wm_struct.h index ae1b72a..6137520 100644 --- a/ascd/ascd/workman/wm_struct.h +++ b/ascd/ascd/workman/wm_struct.h @@ -7,7 +7,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -31,7 +31,7 @@ * Structure for a single track. This is pretty much self-explanatory -- * one of these exists for each track on the current CD. */ -struct wm_trackinfo +struct wm_trackinfo { char *songname; /* Name of song, dynamically allocated */ char *otherdb; /* Unrecognized info for this track */ @@ -62,7 +62,7 @@ struct wm_trackinfo * the total playing time of the playlist (which will usually be overestimated, * since we don't play leadouts in some cases.) */ -struct wm_play +struct wm_play { int start; /* Start track, or 0 if end of list */ int end; /* last track plus 1 */ @@ -74,7 +74,7 @@ struct wm_play * followed by a zero-terminated list of track numbers to play. The list * is terminated by a NULL name. */ -struct wm_playlist +struct wm_playlist { char *name; /* Name of this playlist */ int *list; /* List of tracks */ @@ -104,7 +104,7 @@ extern struct wm_cdinfo *cd; struct wm_playlist *new_list(); -enum wm_cd_modes +enum wm_cd_modes { WM_CDM_UNKNOWN = -1, WM_CDM_BACK = 0, WM_CDM_TRACK_DONE = 0, @@ -118,7 +118,7 @@ enum wm_cd_modes /* * Drive descriptor structure. Used for access to low-level routines. */ -struct wm_drive +struct wm_drive { int fd; /* File descriptor, if used by platform */ char vendor[32]; /* Vendor name */ @@ -126,7 +126,7 @@ struct wm_drive char revision[32]; /* Revision of the drive */ void *aux; /* Pointer to optional platform-specific info */ void *daux; /* Pointer to optional drive-specific info */ - + int (*init)(); int (*get_trackcount)(); int (*get_cdlen)(); diff --git a/ascd/ascd/workman/wm_version.h b/ascd/ascd/workman/wm_version.h index b18a2e2..43f9b88 100644 --- a/ascd/ascd/workman/wm_version.h +++ b/ascd/ascd/workman/wm_version.h @@ -7,7 +7,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public diff --git a/ascd/ascd/workman/workman.h b/ascd/ascd/workman/workman.h index 2172b9f..3bef014 100644 --- a/ascd/ascd/workman/workman.h +++ b/ascd/ascd/workman/workman.h @@ -7,7 +7,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -31,21 +31,21 @@ /* * wm_config should always be included first */ -#include "wm_config.h" +#include "wm_config.h" #include "workman_defs.h" #ifdef BUILD_CDDA #include "wm_cdda.h" -#endif +#endif #include "wm_cddb.h" -#include "wm_cdinfo.h" -#include "wm_cdrom.h" -#include "wm_database.h" -#include "wm_helpers.h" -#include "wm_index.h" -#include "wm_platform.h" -#include "wm_scsi.h" -#include "wm_struct.h" +#include "wm_cdinfo.h" +#include "wm_cdrom.h" +#include "wm_database.h" +#include "wm_helpers.h" +#include "wm_index.h" +#include "wm_platform.h" +#include "wm_scsi.h" +#include "wm_struct.h" #endif /* WORKMAN_H */ diff --git a/ascd/ascd/workman/workman_defs.h b/ascd/ascd/workman/workman_defs.h index 712a414..99ff1b6 100644 --- a/ascd/ascd/workman/workman_defs.h +++ b/ascd/ascd/workman/workman_defs.h @@ -7,7 +7,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * 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 @@ -20,7 +20,7 @@ * GNU General Public License for more details. * * #defined CONSTANTS - * + * * Too bad this file seems to be so empty... * */ diff --git a/ascd/libworkman/COPYING.LIB b/ascd/libworkman/COPYING.LIB index 92b8903..066a80a 100644 --- a/ascd/libworkman/COPYING.LIB +++ b/ascd/libworkman/COPYING.LIB @@ -133,7 +133,7 @@ such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. - + 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an diff --git a/ascd/libworkman/Config b/ascd/libworkman/Config index 7db9048..95e0141 100644 --- a/ascd/libworkman/Config +++ b/ascd/libworkman/Config @@ -6,7 +6,7 @@ XCOMM This file is part of LibWorkMan, the civilized CD player library XCOMM (c) 1991-1997 by Steven Grimm (original author) XCOMM (c) by Dirk Försterling (current 'author' = maintainer) XCOMM The maintainer can be contacted by his e-mail address: -XCOMM [email protected] +XCOMM [email protected] XCOMM XCOMM This library is free software; you can redistribute it and/or XCOMM modify it under the terms of the GNU Library General Public diff --git a/ascd/libworkman/Imakefile b/ascd/libworkman/Imakefile index c0f26ac..2c8e614 100644 --- a/ascd/libworkman/Imakefile +++ b/ascd/libworkman/Imakefile @@ -6,7 +6,7 @@ XCOMM This file is part of LibWorkMan, the civilized CD player library XCOMM (c) 1991-1997 by Steven Grimm (original author) XCOMM (c) by Dirk Försterling (current 'author' = maintainer) XCOMM The maintainer can be contacted by his e-mail address: -XCOMM [email protected] +XCOMM [email protected] XCOMM XCOMM This library is free software; you can redistribute it and/or XCOMM modify it under the terms of the GNU Library General Public @@ -58,8 +58,8 @@ HEADERS= \ include/wm_struct.h \ include/wm_version.h \ include/workman.h \ - include/workman_defs.h - + include/workman_defs.h + #include <Library.tmpl> diff --git a/ascd/libworkman/buildindex.c b/ascd/libworkman/buildindex.c index 05a042c..ac49c12 100644 --- a/ascd/libworkman/buildindex.c +++ b/ascd/libworkman/buildindex.c @@ -5,7 +5,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -27,7 +27,7 @@ */ static char buildindex_id[] = "$Id: buildindex.c,v 1.2 1999/02/14 09:50:42 dirk Exp $"; - + #include <stdio.h> #include <db.h> #include <fcntl.h> @@ -140,7 +140,7 @@ main(argc, argv) /* End of file? */ if (feof(fp)) break; - + /* Nope. A read error. Unlink the database. */ perror(argv[i]); (void) unlink(indname); @@ -149,7 +149,7 @@ main(argc, argv) if (strncmp(buf, "tracks ", 7)) continue; - + /* * Found the start of a record. Figure out the start * time of the last track and put an entry in the diff --git a/ascd/libworkman/cddaslave.c b/ascd/libworkman/cddaslave.c index bd85084..492ceeb 100644 --- a/ascd/libworkman/cddaslave.c +++ b/ascd/libworkman/cddaslave.c @@ -5,7 +5,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -45,7 +45,7 @@ #include "config.h" #ifdef BUILD_CDDA - + static char cddaslave_id[] = "$Id: cddaslave.c,v 1.3 1999/02/14 22:10:24 dirk Exp $"; #include <stdio.h> @@ -509,7 +509,7 @@ main(argc, argv) */ continue; } - + if (playing) { result = wmcdda_read(cd_fd, cddabuf, cddabuflen, diff --git a/ascd/libworkman/cddb.c b/ascd/libworkman/cddb.c index 75e891b..6351607 100644 --- a/ascd/libworkman/cddb.c +++ b/ascd/libworkman/cddb.c @@ -5,7 +5,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -124,14 +124,14 @@ cddb_discid(void) /* For backward compatibility this algorithm must not change */ for (i = 0; i < thiscd.ntracks; i++) { - + n += cddb_sum(thiscd.trk[i].start / 75); - /* + /* * Just for demonstration (See below) - * + * * t += (thiscd.trk[i+1].start / 75) - * (thiscd.trk[i ].start / 75); - */ + */ } /* @@ -174,10 +174,10 @@ void string_makehello(char *line,char delim) { char mail[84],*host; - + strcpy(mail,cddb.mail_adress); host=string_split(mail,'@'); - + sprintf(line,"%shello%c%s%c%s%c%s%c%s", delim == ' ' ? "cddb " : "&", delim == ' ' ? ' ' : '=', @@ -197,13 +197,13 @@ connect_open(void) struct hostent *hp; struct sockaddr_in soc_in; int port; - + if(cddb.protocol == 3) /* http proxy */ host = strdup(cddb.proxy_server); else host = strdup(cddb.cddb_server); - /* - * t=string_split(host,':'); + /* + * t=string_split(host,':'); */ port=atoi(string_split(host,':')); if(!port) @@ -211,7 +211,7 @@ connect_open(void) printf("%s:%d\n",host,port); hp =gethostbyname(host); - + if (hp == NULL) { static struct hostent def; @@ -219,9 +219,9 @@ connect_open(void) static char *alist[1]; static char namebuf[128]; int inet_addr(); - + defaddr.s_addr = inet_addr(host); - if (defaddr.s_addr == -1) + if (defaddr.s_addr == -1) { printf("unknown host: %s\n", host); return (-1); @@ -238,19 +238,19 @@ connect_open(void) bcopy(hp->h_addr, (char *)&soc_in.sin_addr, hp->h_length); soc_in.sin_port = htons(port); Socket = socket(hp->h_addrtype, SOCK_STREAM, 0); - if (Socket < 0) - { + if (Socket < 0) + { perror("socket"); return (-1); } fflush(stdout); - if (connect(Socket, (struct sockaddr *)&soc_in, sizeof (soc_in)) < 0) - { + if (connect(Socket, (struct sockaddr *)&soc_in, sizeof (soc_in)) < 0) + { perror("connect"); close(Socket); return (-1); } - + Connection = fdopen(Socket, "r"); return (0); } /* connect_open() */ @@ -261,7 +261,7 @@ connect_open(void) */ void connect_close(void) -{ +{ (void)fclose(Connection); close(Socket); } /* connect_close() */ @@ -273,7 +273,7 @@ void connect_getline(char *line) { char c; - + while ((c = getc(Connection)) != '\n') { *line = c; @@ -291,21 +291,21 @@ connect_read_entry(void) { char type; int trknr; - + char *t,*t2,tempbuf[2000]; - + while(strcmp(tempbuf,".")) { connect_getline(tempbuf); - + t=string_split(tempbuf,'='); if(t != NULL) { type=tempbuf[0]; - + if(strncmp("TITLE",tempbuf+1,5)) continue; - + if('D' == type) { /* @@ -318,7 +318,7 @@ connect_read_entry(void) if(*t2 == ' ') t2++; strcpy(cd->cdname,t2); - + for(t2=t;*t2;t2++) { if((*t2 == ' ') && (*(t2+1) == 0)) @@ -326,7 +326,7 @@ connect_read_entry(void) } strcpy(cd->artist,t); } - + if('T' == type) { trknr=atoi(tempbuf+6); @@ -370,7 +370,7 @@ void http_send(char* line) { char tempbuf[2000]; - + write(Socket, "GET ", 4); printf("GET "); if(cddb.protocol == 3) @@ -413,18 +413,18 @@ cddb_request(void) int i; char tempbuf[2000]; extern int cur_ntracks; - + int status; char category[20]; unsigned int id; - + strcpy(cddb.cddb_server,"localhost:888"); strcpy(cddb.mail_adress,"[email protected]"); /* * cddb.protocol = 1; */ wipe_cdinfo(); - + switch(cddb.protocol) { case 1: /* cddbp */ @@ -445,7 +445,7 @@ cddb_request(void) cddbp_send(tempbuf); connect_getline(tempbuf); printf("[%s]\n",tempbuf); - + printf("query\n"); sprintf(tempbuf, "cddb query %08x %d",thiscd.cddbid,thiscd.ntracks); for (i = 0; i < cur_ntracks; i++) @@ -457,7 +457,7 @@ cddb_request(void) cddbp_send(tempbuf); connect_getline(tempbuf); printf("[%s]\n",tempbuf); - + status=atoi(tempbuf); /* * fprintf(stderr, "status:%d\n",status); @@ -470,7 +470,7 @@ cddb_request(void) cddbp_read(category,id); connect_read_entry(); } - + if(status == 211) /* Unexact match, multiple possible * Hack: always use first. */ { @@ -481,7 +481,7 @@ cddb_request(void) cddbp_read(category,id); connect_read_entry(); } - + cddbp_send("quit"); connect_close(); printf("close\n"); @@ -502,7 +502,7 @@ cddb_request(void) http_send(tempbuf); connect_getline(tempbuf); printf("[%s]\n",tempbuf); - + status=atoi(tempbuf); /* * fprintf(stderr, "status:%d\n",status); @@ -518,7 +518,7 @@ cddb_request(void) http_read(category,id); connect_read_entry(); } - + if(status == 211) /* Unexact match, multiple possible * Hack: always use first. */ { diff --git a/ascd/libworkman/cdinfo.c b/ascd/libworkman/cdinfo.c index 525e227..a75749a 100644 --- a/ascd/libworkman/cdinfo.c +++ b/ascd/libworkman/cdinfo.c @@ -1,11 +1,11 @@ /* * $Id: cdinfo.c,v 1.6 1999/02/14 16:47:40 dirk Exp $ - * + * * This file is part of WorkMan, the civilized CD player library * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -169,7 +169,7 @@ split_trackinfo( int pos ) if (playlist[i].end > num) playlist[i].end++; } - + /* Now adjust the information in cd->trk[]. */ cd->trk[num].start = pos; if (num == cur_ntracks) @@ -194,7 +194,7 @@ split_trackinfo( int pos ) for (i = num + 1; i < cur_ntracks; i++) if (cd->trk[i].track == cd->trk[num].track) cd->trk[i].section++; - + return (1); } @@ -214,7 +214,7 @@ remove_trackinfo( int num ) if (num < 1 || num >= cur_ntracks || cd->trk[num].section < 2) return (0); - + cd->trk[num - 1].length += cd->trk[num].length; for (i = num; i < cur_ntracks - 1; i++) @@ -226,7 +226,7 @@ remove_trackinfo( int num ) cur_firsttrack--; if (cur_lasttrack > num) cur_lasttrack--; - + /* Update the user-defined playlists. */ if (cd->lists != NULL) for (l = 0; cd->lists[l].name != NULL; l++) @@ -234,7 +234,7 @@ remove_trackinfo( int num ) for (i = 0; cd->lists[l].list[i]; i++) if (cd->lists[l].list[i] > num) cd->lists[l].list[i]--; - + /* Update the internal playlist. */ if (playlist != NULL) for (i = 0; playlist[i].start; i++) @@ -244,7 +244,7 @@ remove_trackinfo( int num ) if (playlist[i].end > num) playlist[i].end--; } - + cur_ntracks--; cur_nsections--; @@ -297,12 +297,12 @@ listentry( int num ) digits = 2; sdigits = cur_nsections < 9 ? -1 : -2; - + name = cd->trk[num].songname ? cd->trk[num].songname : ""; if (cur_nsections) { - if (cd->trk[num].section > 9) + if (cd->trk[num].section > 9) { sprintf(tracknum, "%*d.%d", digits, cd->trk[num].track, @@ -348,7 +348,7 @@ listentry( int num ) char * trackname( int num ) { - if (num >= 0 && num < cur_ntracks) + if (num >= 0 && num < cur_ntracks) { if (cd->trk[num].songname) { @@ -861,7 +861,7 @@ pl_find_track( int track ) cur_lasttrack = playlist[i].end - 1; return; } - + /* * Couldn't find the track in question. Make a special entry with * just that track. diff --git a/ascd/libworkman/cdrom.c b/ascd/libworkman/cdrom.c index bbc0181..8eea47e 100644 --- a/ascd/libworkman/cdrom.c +++ b/ascd/libworkman/cdrom.c @@ -5,7 +5,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -152,7 +152,7 @@ find_drive_struct(char *vendor, char *model, char *rev) ( (d->mod != NULL) && strncmp(d->mod, model, strlen(d->mod)) ) || ( (d->rev != NULL) && strncmp(d->rev, rev, strlen(d->rev)) ) ) continue; - + if (d->proto->vendor[0] == '\0') strcpy(d->proto->vendor, vendor); if (d->proto->model[0] == '\0') @@ -255,7 +255,7 @@ read_toc() thiscd.length = thiscd.trk[thiscd.ntracks].length; thiscd.cddbid = cddb_discid(drive); - + return (&thiscd); } @@ -404,13 +404,13 @@ wm_cd_status( void ) break; case WM_CDM_FORWARD: case WM_CDM_EJECTED: - break; + break; } return (ret); } -#undef CLIF_VOL +#undef CLIF_VOL #ifdef CLIF_VOL /* * cd_volume(vol, bal, max) @@ -432,7 +432,7 @@ cd_volume(vol, bal, max) /* printf("Vol = %d, Bal = %d, Max = %d\n", vol, bal, max); */ - vol = (vol * 100 + max - 16) / max; + vol = (vol * 100 + max - 16) / max; scale = (vol + 5) / 10; if (bal < 9) @@ -446,7 +446,7 @@ cd_volume(vol, bal, max) } else if (bal > 11) { -#ifdef SYMETRIC_BALANCE +#ifdef SYMETRIC_BALANCE right = vol + scale * (bal - 10); #else right = vol; @@ -536,7 +536,7 @@ wm_cd_pause( void ) wm_cd_play(cur_track, paused_pos, playlist[cur_listno-1].end); default: /* */ - break; + break; } } /* wm_cd_pause() */ @@ -559,7 +559,7 @@ wm_cd_stop( void ) cur_track = 1; } } /* wm_cd_stop() */ - + /* * wm_cd_play_chunk(start, end) * @@ -641,7 +641,7 @@ wm_cd_eject( void ) return (1); } } - + if (exit_on_eject) exit(0); diff --git a/ascd/libworkman/database.c b/ascd/libworkman/database.c index 6bb50b8..927679a 100644 --- a/ascd/libworkman/database.c +++ b/ascd/libworkman/database.c @@ -5,7 +5,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -107,7 +107,7 @@ split_workmandb( void ) int ndbs, i; char *home, *wmdb; int no_rc = 0, no_db = 0; - + if (rcfile == NULL) { if ((home = getenv("HOME")) != NULL) @@ -115,7 +115,7 @@ split_workmandb( void ) rcfile = malloc(strlen(home) + sizeof(RCFILE)); if (rcfile == NULL) { - + nomem: perror("split_workmandb()"); exit(1); @@ -149,7 +149,7 @@ nomem: else { static char *emptydb = NULL; - + databases = &emptydb; no_db = 1; } @@ -163,11 +163,11 @@ nomem: *home = '\0'; ndbs++; } - + databases = malloc((ndbs + 1) * sizeof(databases[0])); if (databases == NULL) goto nomem; - + for (i = 0; i < ndbs; i++) { databases[i] = wmdb; @@ -571,7 +571,7 @@ chomp: if (scratch != cd->trk[track].start) { sizediff = abs(scratch - cd->trk[track].start); - if (sizediff > fuzz_frames || + if (sizediff > fuzz_frames || (sizediff && scan)) break; fudge += sizediff; @@ -615,7 +615,7 @@ chomp: { getc(fp); i = getc(fp); /* only first letter is used */ - cddb.protocol = i == 'c' ? 1 : + cddb.protocol = i == 'c' ? 1 : i == 'h' ? 2 : 3 ; do i = getc(fp); @@ -631,7 +631,7 @@ chomp: while (i != '\n' && i != EOF); else { - fgets(cddb.cddb_server, + fgets(cddb.cddb_server, sizeof(cddb.cddb_server), fp); if ((i = strlen(cddb.cddb_server))) cddb.cddb_server[i - 1] = '\0'; @@ -647,7 +647,7 @@ chomp: while (i != '\n' && i != EOF); else { - fgets(cddb.mail_adress, + fgets(cddb.mail_adress, sizeof(cddb.mail_adress), fp); if ((i = strlen(cddb.mail_adress))) cddb.mail_adress[i - 1] = '\0'; @@ -663,7 +663,7 @@ chomp: while (i != '\n' && i != EOF); else { - fgets(cddb.path_to_cgi, + fgets(cddb.path_to_cgi, sizeof(cddb.path_to_cgi), fp); if ((i = strlen(cddb.path_to_cgi))) cddb.path_to_cgi[i - 1] = '\0'; @@ -679,7 +679,7 @@ chomp: while (i != '\n' && i != EOF); else { - fgets(cddb.proxy_server, + fgets(cddb.proxy_server, sizeof(cddb.proxy_server), fp); if ((i = strlen(cddb.proxy_server))) cddb.proxy_server[i - 1] = '\0'; @@ -705,7 +705,7 @@ chomp: } /* If we're searching, skip to the next "tracks" line. */ - else if (((searching & 1)|| scan) + else if (((searching & 1)|| scan) && !(prefs && firstpos == -1)) SWALLOW_LINE(fp) @@ -759,7 +759,7 @@ chomp: trackmap[i++] = track++; else trackmap[i++] = -1; - + if (track == cur_ntracks) break; } @@ -838,7 +838,7 @@ chomp: /* * nasty bug was here. Was it? BUGBUGBUG * - * wipe_cdinfo(); + * wipe_cdinfo(); */ trackmap = reset_tracks(); getc(fp); /* lose the space */ @@ -853,11 +853,11 @@ chomp: { strcpy(cd->cdname, "Probably://"); fgets(cd->cdname + strlen(cd->cdname), sizeof(cd->cdname), fp); - } - else + } + else { fgets(cd->cdname, sizeof(cd->cdname), fp); - } + } if ( (i = strlen(cd->cdname)) ) cd->cdname[i - 1] = '\0'; } @@ -1092,7 +1092,7 @@ load( void ) time(&t1); printf("%s (%d): search start = %ld\n", __FILE__, __LINE__, t1); fflush(stdout); - } + } #endif dbfile = databases; @@ -1139,7 +1139,7 @@ load( void ) time(&t2); printf("%s (%d): db search end = %ld, elapsed = %ld\n", __FILE__, __LINE__, t2, t2 - t1); fflush(stdout); - } + } #endif fp = rcfile ? open_rcfile(rcfile, "r") : NULL; @@ -1173,7 +1173,7 @@ load( void ) time(&t2); printf("%s (%d): search end = %ld, elapsed = %ld\n", __FILE__, __LINE__, t2, t2 - t1); fflush(stdout); - } + } #endif } /* load() */ @@ -1242,7 +1242,7 @@ save_globals(FILE *fp) break; } wm_strmcat(&globes, temp); - + if(cddb.mail_adress[0]) { sprintf(temp,"cddbmailadress %s\n", @@ -1340,7 +1340,7 @@ save_globals(FILE *fp) wm_strmcat(&cdentry, temp); curpos += strlen(temp); } - } + } if (cdentry != NULL) { diff --git a/ascd/libworkman/drv_sony.c b/ascd/libworkman/drv_sony.c index 338ecc5..ba9e28f 100644 --- a/ascd/libworkman/drv_sony.c +++ b/ascd/libworkman/drv_sony.c @@ -5,7 +5,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -128,7 +128,7 @@ unscale_volume(cd_vol, max) else bot = vol + 1; } - + /* Might have looked down too far for repeated scaled values */ if (cd_vol < scaled) vol++; diff --git a/ascd/libworkman/drv_toshiba.c b/ascd/libworkman/drv_toshiba.c index 3412182..d535f3e 100644 --- a/ascd/libworkman/drv_toshiba.c +++ b/ascd/libworkman/drv_toshiba.c @@ -5,7 +5,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -123,7 +123,7 @@ unscale_volume(cd_vol, max) else bot = vol + 1; } - + /* Might have looked down too far for repeated scaled values */ if (cd_vol < scaled) vol++; diff --git a/ascd/libworkman/include/wm_cdda.h b/ascd/libworkman/include/wm_cdda.h index 831b19e..03689d7 100644 --- a/ascd/libworkman/include/wm_cdda.h +++ b/ascd/libworkman/include/wm_cdda.h @@ -7,7 +7,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -102,7 +102,7 @@ struct cdda_block { #endif /* - * The following code shouldn't take effect now. + * The following code shouldn't take effect now. * In 1998, the WorkMan platforms don't support __PDP_ENDIAN * architectures. * @@ -111,7 +111,7 @@ struct cdda_block { #if !WM_LITTLE_ENDIAN # if !WM_BIG_ENDIAN # error yet unsupported architecture - foo bar this is to stop the compiler. + foo bar this is to stop the compiler. # endif #endif #endif /* WM_CDDA_H */ diff --git a/ascd/libworkman/include/wm_cddb.h b/ascd/libworkman/include/wm_cddb.h index bd5b4f9..a03d5b0 100644 --- a/ascd/libworkman/include/wm_cddb.h +++ b/ascd/libworkman/include/wm_cddb.h @@ -7,7 +7,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public diff --git a/ascd/libworkman/include/wm_cdinfo.h b/ascd/libworkman/include/wm_cdinfo.h index f783465..dc1204a 100644 --- a/ascd/libworkman/include/wm_cdinfo.h +++ b/ascd/libworkman/include/wm_cdinfo.h @@ -7,7 +7,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -24,7 +24,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Prototypes from cdinfo.c - * + * * This is just one more step to a more modular and understandable code. */ diff --git a/ascd/libworkman/include/wm_cdrom.h b/ascd/libworkman/include/wm_cdrom.h index 7d0dca4..e2e3f19 100644 --- a/ascd/libworkman/include/wm_cdrom.h +++ b/ascd/libworkman/include/wm_cdrom.h @@ -7,7 +7,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -24,7 +24,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Prototypes from cdrom.c - * + * * This is just one more step to a more modular and understandable code. */ diff --git a/ascd/libworkman/include/wm_config.h b/ascd/libworkman/include/wm_config.h index c04a0e5..41847e3 100644 --- a/ascd/libworkman/include/wm_config.h +++ b/ascd/libworkman/include/wm_config.h @@ -7,7 +7,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -31,7 +31,7 @@ * names listed below and then set your OS specific options there. * Don't be surprised, if there are no options for your OS. They aren't * needed in any case. - * + * * The default values should produce a functional WorkMan on every * platform. * @@ -72,7 +72,7 @@ #define WORKMAN_NAME "LibWorkMan" #define WORKMAN_VERSION "1.4.0" - + /* * If your CD-ROM drive closes its tray if the device is opened, then * the next define can make WorkMans "Eject" button an "open/close" @@ -182,7 +182,7 @@ /* * Uncomment the following line to have WorkMan send SCSI commands - * directly to the CD-ROM drive. If you have a SCSI drive you + * directly to the CD-ROM drive. If you have a SCSI drive you * probably want this, but it will cause WorkMan to not work on IDE * drives. */ @@ -210,7 +210,7 @@ */ /* #define CURVED_VOLUME */ - + /* * Uncomment the following if you want to try out a better responding * WorkMan, especially with IDE drives. This may work with non-IDE @@ -229,7 +229,7 @@ * fstat() should be used, but I'm too dumb to do so. */ -#define BSD_MOUNTTEST +#define BSD_MOUNTTEST #endif /* linux */ @@ -353,5 +353,5 @@ #endif /* IBM AIX */ -/******************************************************************/ +/******************************************************************/ #endif /* WM_CONFIG_H */ diff --git a/ascd/libworkman/include/wm_database.h b/ascd/libworkman/include/wm_database.h index aaea086..0a5296c 100644 --- a/ascd/libworkman/include/wm_database.h +++ b/ascd/libworkman/include/wm_database.h @@ -7,7 +7,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -24,14 +24,14 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Prototypes for WorkMan database - * + * * This is just one more step to a more modular and understandable code. */ #define WM_DB_SAVE_ERROR 1 #define WM_DB_SAVE_DISABLED 2 - + int wm_db_get_playnew( void ); void split_workmandb( void ); int save( void ); diff --git a/ascd/libworkman/include/wm_helpers.h b/ascd/libworkman/include/wm_helpers.h index 0a3763b..60d0e92 100644 --- a/ascd/libworkman/include/wm_helpers.h +++ b/ascd/libworkman/include/wm_helpers.h @@ -7,7 +7,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -32,7 +32,7 @@ /* * LibWorkMan message levels. I'm not sure how to call them all and which * use they should fulfill. This is not very urgent now, because there - * aren't many messages in LibWorkMan now. + * aren't many messages in LibWorkMan now. */ #define WM_MSG_LEVEL_NONE 0 #define WM_MSG_LEVEL_ERROR 1 @@ -49,7 +49,7 @@ * Message classes. This is somehow a definition of * the message's source. */ - + #define WM_MSG_CLASS_PLATFORM 0x010 #define WM_MSG_CLASS_SCSI 0x020 #define WM_MSG_CLASS_CDROM 0x040 @@ -66,7 +66,7 @@ extern int wm_lib_verbosity; #ifdef DEBUG #define CHECKPOINT(t) fprintf(stderr, "%s (%d): %s\n", __FILE__, __LINE__, t ); #else -#define CHECKPOINT(t) +#define CHECKPOINT(t) #endif #ifndef TRUE diff --git a/ascd/libworkman/include/wm_index.h b/ascd/libworkman/include/wm_index.h index ce14ac3..9e6734c 100644 --- a/ascd/libworkman/include/wm_index.h +++ b/ascd/libworkman/include/wm_index.h @@ -7,7 +7,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -24,7 +24,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Prototypes for wm_index.c - * + * * This is just one more step to a more modular and understandable code. */ diff --git a/ascd/libworkman/include/wm_platform.h b/ascd/libworkman/include/wm_platform.h index 03f957d..a7c58af 100644 --- a/ascd/libworkman/include/wm_platform.h +++ b/ascd/libworkman/include/wm_platform.h @@ -7,7 +7,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -24,7 +24,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * The platform interface - * + * * This is just one more step to a more modular and understandable code. */ diff --git a/ascd/libworkman/include/wm_scsi.h b/ascd/libworkman/include/wm_scsi.h index 8763a62..4bf84fc 100644 --- a/ascd/libworkman/include/wm_scsi.h +++ b/ascd/libworkman/include/wm_scsi.h @@ -7,7 +7,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -24,11 +24,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * SCSI prototypes (scsi.c) - * + * * This is just one more step to a more modular and understandable code. */ -#include "wm_struct.h" +#include "wm_struct.h" #define WM_ERR_SCSI_INQUIRY_FAILED -1 diff --git a/ascd/libworkman/include/wm_struct.h b/ascd/libworkman/include/wm_struct.h index ae1b72a..6137520 100644 --- a/ascd/libworkman/include/wm_struct.h +++ b/ascd/libworkman/include/wm_struct.h @@ -7,7 +7,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -31,7 +31,7 @@ * Structure for a single track. This is pretty much self-explanatory -- * one of these exists for each track on the current CD. */ -struct wm_trackinfo +struct wm_trackinfo { char *songname; /* Name of song, dynamically allocated */ char *otherdb; /* Unrecognized info for this track */ @@ -62,7 +62,7 @@ struct wm_trackinfo * the total playing time of the playlist (which will usually be overestimated, * since we don't play leadouts in some cases.) */ -struct wm_play +struct wm_play { int start; /* Start track, or 0 if end of list */ int end; /* last track plus 1 */ @@ -74,7 +74,7 @@ struct wm_play * followed by a zero-terminated list of track numbers to play. The list * is terminated by a NULL name. */ -struct wm_playlist +struct wm_playlist { char *name; /* Name of this playlist */ int *list; /* List of tracks */ @@ -104,7 +104,7 @@ extern struct wm_cdinfo *cd; struct wm_playlist *new_list(); -enum wm_cd_modes +enum wm_cd_modes { WM_CDM_UNKNOWN = -1, WM_CDM_BACK = 0, WM_CDM_TRACK_DONE = 0, @@ -118,7 +118,7 @@ enum wm_cd_modes /* * Drive descriptor structure. Used for access to low-level routines. */ -struct wm_drive +struct wm_drive { int fd; /* File descriptor, if used by platform */ char vendor[32]; /* Vendor name */ @@ -126,7 +126,7 @@ struct wm_drive char revision[32]; /* Revision of the drive */ void *aux; /* Pointer to optional platform-specific info */ void *daux; /* Pointer to optional drive-specific info */ - + int (*init)(); int (*get_trackcount)(); int (*get_cdlen)(); diff --git a/ascd/libworkman/include/wm_version.h b/ascd/libworkman/include/wm_version.h index b18a2e2..43f9b88 100644 --- a/ascd/libworkman/include/wm_version.h +++ b/ascd/libworkman/include/wm_version.h @@ -7,7 +7,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public diff --git a/ascd/libworkman/include/workman.h b/ascd/libworkman/include/workman.h index 2172b9f..3bef014 100644 --- a/ascd/libworkman/include/workman.h +++ b/ascd/libworkman/include/workman.h @@ -7,7 +7,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -31,21 +31,21 @@ /* * wm_config should always be included first */ -#include "wm_config.h" +#include "wm_config.h" #include "workman_defs.h" #ifdef BUILD_CDDA #include "wm_cdda.h" -#endif +#endif #include "wm_cddb.h" -#include "wm_cdinfo.h" -#include "wm_cdrom.h" -#include "wm_database.h" -#include "wm_helpers.h" -#include "wm_index.h" -#include "wm_platform.h" -#include "wm_scsi.h" -#include "wm_struct.h" +#include "wm_cdinfo.h" +#include "wm_cdrom.h" +#include "wm_database.h" +#include "wm_helpers.h" +#include "wm_index.h" +#include "wm_platform.h" +#include "wm_scsi.h" +#include "wm_struct.h" #endif /* WORKMAN_H */ diff --git a/ascd/libworkman/include/workman_defs.h b/ascd/libworkman/include/workman_defs.h index 712a414..99ff1b6 100644 --- a/ascd/libworkman/include/workman_defs.h +++ b/ascd/libworkman/include/workman_defs.h @@ -7,7 +7,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * 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 @@ -20,7 +20,7 @@ * GNU General Public License for more details. * * #defined CONSTANTS - * + * * Too bad this file seems to be so empty... * */ diff --git a/ascd/libworkman/index.c b/ascd/libworkman/index.c index e27cc0f..668e011 100644 --- a/ascd/libworkman/index.c +++ b/ascd/libworkman/index.c @@ -1,11 +1,11 @@ /* * $Id: index.c,v 1.2 1999/02/14 09:50:42 dirk Exp $ - * + * * This file is part of WorkMan, the civilized CD player library * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -143,7 +143,7 @@ idx_find_entry( char *file, int ntracks, int *tracks, dbpos = ntohl(*((unsigned long *) data.data)); if (fseek(text, dbpos, 0)) break; - + fgets(tracksline, sizeof(tracksline), text); if (strncmp(tracksline, "tracks ", 7)) break; @@ -155,7 +155,7 @@ idx_find_entry( char *file, int ntracks, int *tracks, break; if (atoi(s) != ntracks) continue; - + for (i = 0; i < ntracks; i++) { s = strtok(NULL, " \t"); @@ -174,7 +174,7 @@ idx_find_entry( char *file, int ntracks, int *tracks, val = atoi(s); if (val + fuzz / 75 < len / 75 || val + fuzz / 75 > len / 75) continue; - + /* XXX - add to sorted list! */ *pos = dbpos; (index->close)(index); diff --git a/ascd/libworkman/plat_aix.c b/ascd/libworkman/plat_aix.c index 980bb50..deb37f9 100644 --- a/ascd/libworkman/plat_aix.c +++ b/ascd/libworkman/plat_aix.c @@ -5,7 +5,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -24,7 +24,7 @@ * * plat_aix - AIX 4.x IDE and SCSI support 16 Dec 1998 * - * AIX 4.x Port: Erik O'Shaughnessy + * AIX 4.x Port: Erik O'Shaughnessy * Original AIX IDE Code: Cloyce Spradling (xmcd libdi_d/aixioc.c ) * * Taken from the ascd distribution. @@ -64,7 +64,7 @@ int max_volume = 255; * * FUNCTION: * - * RETURNS: + * RETURNS: */ int gen_init(struct wm_drive *d){ @@ -79,7 +79,7 @@ int gen_init(struct wm_drive *d){ * RETURNS: */ -int gen_get_trackcount(struct wm_drive *d,int *tracks){ +int gen_get_trackcount(struct wm_drive *d,int *tracks){ struct cd_audio_cmd cmd; cmd.audio_cmds = CD_TRK_INFO_AUDIO; @@ -103,7 +103,7 @@ int gen_get_trackcount(struct wm_drive *d,int *tracks){ * RETURNS: */ -int gen_get_cdlen(struct wm_drive *d,int *frames){ +int gen_get_cdlen(struct wm_drive *d,int *frames){ int tmp; return gen_get_trackinfo(d,LEADOUT,&tmp,frames); @@ -123,10 +123,10 @@ int gen_get_trackinfo(struct wm_drive *d,int track,int *data,int *startframe){ cmd.msf_flag = 1; cmd.indexing.track_msf.track = track; - + if( ioctl(d->fd,DKAUDIO,&cmd) < 0) return -1; - + *startframe = cmd.indexing.track_msf.mins * 60 * 75 + cmd.indexing.track_msf.secs * 75 + cmd.indexing.track_msf.frames; @@ -148,7 +148,7 @@ int gen_get_drive_status(struct wm_drive *d, enum wm_cd_modes *mode, int *pos, int *track, - int *index){ + int *index){ struct cd_audio_cmd cmd; *mode = WM_CDM_EJECTED; @@ -216,7 +216,7 @@ int unscale_volume(int vol,int max){ * RETURNS: */ -int gen_get_volume(struct wm_drive *d,int *left,int *right){ +int gen_get_volume(struct wm_drive *d,int *left,int *right){ struct cd_audio_cmd cmd; int l,r; @@ -239,12 +239,12 @@ int gen_get_volume(struct wm_drive *d,int *left,int *right){ * RETURNS: */ -int gen_set_volume(struct wm_drive *d,int left,int right){ +int gen_set_volume(struct wm_drive *d,int left,int right){ struct cd_audio_cmd cmd; cmd.audio_cmds = CD_SET_VOLUME; cmd.volume_type = CD_VOLUME_CHNLS; - + cmd.out_port_0_vol = scale_volume(left,100); cmd.out_port_1_vol = scale_volume(right,100); @@ -263,9 +263,9 @@ int gen_set_volume(struct wm_drive *d,int left,int right){ * RETURNS: */ -int gen_pause(struct wm_drive *d){ +int gen_pause(struct wm_drive *d){ struct cd_audio_cmd cmd; - + cmd.audio_cmds = CD_PAUSE_AUDIO; return ioctl(d->fd,DKAUDIO,&cmd); @@ -278,7 +278,7 @@ int gen_pause(struct wm_drive *d){ * RETURNS: */ -int gen_resume(struct wm_drive *d){ +int gen_resume(struct wm_drive *d){ struct cd_audio_cmd cmd; cmd.audio_cmds = CD_RESUME_AUDIO; @@ -292,7 +292,7 @@ int gen_resume(struct wm_drive *d){ * RETURNS: */ -int gen_stop(struct wm_drive *d){ +int gen_stop(struct wm_drive *d){ struct cd_audio_cmd cmd; cmd.audio_cmds = CD_STOP_AUDIO; @@ -306,7 +306,7 @@ int gen_stop(struct wm_drive *d){ * RETURNS: */ -int gen_play(struct wm_drive *d,int start,int end){ +int gen_play(struct wm_drive *d,int start,int end){ struct cd_audio_cmd cmd; cmd.audio_cmds = CD_PLAY_AUDIO; @@ -335,7 +335,7 @@ int gen_play(struct wm_drive *d,int start,int end){ * RETURNS: */ -int gen_eject(struct wm_drive *d){ +int gen_eject(struct wm_drive *d){ return ioctl(d->fd,DKEJECT,NULL); } @@ -408,7 +408,7 @@ int wmcd_open(struct wm_drive *d){ *d = *(find_drive_struct(vendor, model, rev)); wm_drive_settype(vendor, model, rev); - + d->fd = fd; d->init(d); diff --git a/ascd/libworkman/plat_bsd386.c b/ascd/libworkman/plat_bsd386.c index 9a58e84..0e97e34 100644 --- a/ascd/libworkman/plat_bsd386.c +++ b/ascd/libworkman/plat_bsd386.c @@ -5,7 +5,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -49,7 +49,7 @@ static char plat_bsd386_id[] = "$Id: plat_bsd386.c,v 1.5 1999/03/07 08:36:40 dir #else /* * this is for glibc 2.x which defines ust structure in - * ustat.h not stat.h. + * ustat.h not stat.h. */ #ifdef __GLIBC__ #include <sys/ustat.h> @@ -377,7 +377,7 @@ unscale_volume(int cd_vol, int max) else bot = vol + 1; } - + if (vol < 0) vol = 0; else if (vol > max) diff --git a/ascd/libworkman/plat_freebsd.c b/ascd/libworkman/plat_freebsd.c index 945b316..010b2bc 100644 --- a/ascd/libworkman/plat_freebsd.c +++ b/ascd/libworkman/plat_freebsd.c @@ -5,7 +5,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -370,15 +370,15 @@ gen_eject( struct wm_drive *d ) return (-3); rval = ioctl(d->fd, CDIOCALLOW); - + if (rval == 0) rval = ioctl(d->fd, CDIOCEJECT); - + if (rval == 0) rval = ioctl(d->fd, CDIOCPREVENT); - + (void) close(d->fd); - + return rval; } @@ -428,7 +428,7 @@ unscale_volume( int cd_vol, int max ) else bot = vol + 1; } - + if (vol < 0) vol = 0; else if (vol > max) @@ -529,7 +529,7 @@ wmcd_open( struct wm_drive *d ) *d = *(find_drive_struct(vendor, model, rev)); wm_drive_settype(vendor, model, rev); - + (d->init)(d); d->fd = fd; diff --git a/ascd/libworkman/plat_hpux.c b/ascd/libworkman/plat_hpux.c index 0175401..b199cb0 100644 --- a/ascd/libworkman/plat_hpux.c +++ b/ascd/libworkman/plat_hpux.c @@ -5,7 +5,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -266,7 +266,7 @@ wmcd_open( struct wm_drive *d ) if (d->fd >= 0) /* Device already open? */ return (0); - + if (cd_device == NULL) cd_device = DEFAULT_CD_DEVICE; @@ -317,7 +317,7 @@ wmcd_open( struct wm_drive *d ) wm_scsi_get_drive_type(d, vendor, model, rev); *d = *(find_drive_struct(vendor, model, rev)); wm_drive_settype(vendor, model, rev); - + d->fd = fd; (d->init)(d); diff --git a/ascd/libworkman/plat_irix.c b/ascd/libworkman/plat_irix.c index 9019588..149cc0a 100644 --- a/ascd/libworkman/plat_irix.c +++ b/ascd/libworkman/plat_irix.c @@ -5,7 +5,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -32,7 +32,7 @@ */ #ifdef sgi - + static char plat_irix_id[] = "$Id: plat_irix.c,v 1.6 1999/03/07 08:36:40 dirk Exp $"; #include "include/wm_config.h" @@ -440,7 +440,7 @@ wmcd_reopen( struct wm_drive *d ) /*----------------------------------* * Send a SCSI command out the bus. *----------------------------------*/ -int +int wm_scsi(d, xcdb, cdblen, retbuf, retbuflen, getreply) struct wm_drive *d; unsigned char *xcdb; diff --git a/ascd/libworkman/plat_linux.c b/ascd/libworkman/plat_linux.c index 4b674a8..e61e898 100644 --- a/ascd/libworkman/plat_linux.c +++ b/ascd/libworkman/plat_linux.c @@ -5,7 +5,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -75,7 +75,7 @@ static char plat_linux_id[] = "$Id: plat_linux.c,v 1.8 1999/06/17 06:48:03 dirk #define max(a,b) ((a) > (b) ? (a) : (b)) #define WM_MSG_CLASS WM_MSG_CLASS_PLATFORM - + #ifdef LINUX_SCSI_PASSTHROUGH /* this is from <scsi/scsi_ioctl.h> */ # define SCSI_IOCTL_SEND_COMMAND 1 @@ -218,10 +218,10 @@ gen_get_trackcount(struct wm_drive *d, int *tracks) if (ioctl(d->fd, CDROMREADTOCHDR, &hdr)) return (-1); - + *tracks = hdr.cdth_trk1; return (0); -} +} /*---------------------------------------------------------* * Get the start time and mode (data or audio) of a track. @@ -236,12 +236,12 @@ gen_get_trackinfo(struct wm_drive *d, int track, int *data, int *startframe) if (ioctl(d->fd, CDROMREADTOCENTRY, &entry)) return (-1); - + *startframe = entry.cdte_addr.msf.minute * 60 * 75 + entry.cdte_addr.msf.second * 75 + entry.cdte_addr.msf.frame; *data = entry.cdte_ctrl & CDROM_DATA_TRACK ? 1 : 0; - + return (0); } @@ -257,7 +257,7 @@ gen_get_cdlen(struct wm_drive *d, int *frames) } -/* Alarm signal handler. +/* Alarm signal handler. static void do_nothing(int x) { x++; } */ @@ -275,7 +275,7 @@ gen_get_drive_status( struct wm_drive *d, enum wm_cd_modes oldmode, #ifdef SBPCD_HACK static int prevpos = 0; #endif - + /* If we can't get status, the CD is ejected, so default to that. */ *mode = WM_CDM_EJECTED; @@ -314,7 +314,7 @@ gen_get_drive_status( struct wm_drive *d, enum wm_cd_modes oldmode, *mode = WM_CDM_TRACK_DONE; } } - + prevpos = *pos; #endif break; @@ -361,10 +361,10 @@ scale_volume( int vol, int max ) { #ifdef CURVED_VOLUME return ((max * max - (max - vol) * (max - vol)) * - (max_volume - min_volume) / (max * max) + min_volume); + (max_volume - min_volume) / (max * max) + min_volume); #else return ((vol * (max_volume - min_volume)) / max + min_volume); -#endif +#endif } /* scale_volume() */ #endif @@ -391,7 +391,7 @@ gen_set_volume( struct wm_drive *d, int left, int right ) perror( "MIXER_WRITE" ); return ( -1 ); } - return ( 0 ); + return ( 0 ); #else /* Adjust the volume to make up for the CD-ROM drive's weirdness. */ @@ -400,9 +400,9 @@ gen_set_volume( struct wm_drive *d, int left, int right ) v.channel0 = v.channel2 = left < 0 ? 0 : left > 255 ? 255 : left; v.channel1 = v.channel3 = right < 0 ? 0 : right > 255 ? 255 : right; - + return (ioctl(d->fd, CDROMVOLCTRL, &v)); -# endif +# endif } /*---------------* @@ -451,10 +451,10 @@ gen_play(struct wm_drive *d, int start, int end) #ifndef FAST_IDE if (ioctl(d->fd, CDROMSTART)) return (-1); -#endif +#endif if (ioctl(d->fd, CDROMPLAYMSF, &msf)) return (-2); - + return (0); } @@ -471,7 +471,7 @@ gen_eject(struct wm_drive *d) struct mntent *mnt; FILE *fp; #endif - + if (fstat(d->fd, &stbuf) != 0) return (-2); @@ -484,7 +484,7 @@ gen_eject(struct wm_drive *d) * This is the same test as in the WorkBone interface. * I should eliminate it there, because there is no need * for it in the UI - */ + */ /* check if drive is mounted (from Mark Buckaway's cdplayer code) */ /* Changed it again (look at XPLAYCD from ???? */ /* It's better to check the device name rather than one device is */ @@ -517,7 +517,7 @@ gen_eject(struct wm_drive *d) * (The tray closed just after ejecting because re-opening the * device causes the tray to close) *------------------*/ -#ifdef foobar_one +#ifdef foobar_one extern int intermittent_dev /* * Some drives (drivers?) won't recognize a new CD if we leave the @@ -527,9 +527,9 @@ extern int intermittent_dev { close(d->fd); d->fd = -1; - } + } #endif - + return (0); } /* gen_eject() */ @@ -634,7 +634,7 @@ gen_get_volume( struct wm_drive *d, int *left, int *right ) *left = *right = -1; } *right = 0x007f & ( vol >> 8 ); - *left = 0x007f & vol; + *left = 0x007f & vol; #else /* Suns, HPs, Linux, NEWS can't read the volume; oh well */ @@ -738,7 +738,7 @@ wm_scsi( struct wm_drive *d, unsigned char *cdb, int cdblen, else cmdsize += (cdblen + retbuflen); } else cmdsize += cdblen; - + cmd = malloc(cmdsize); if (cmd == NULL) return (-1); @@ -749,7 +749,7 @@ wm_scsi( struct wm_drive *d, unsigned char *cdb, int cdblen, memcpy(cmd + 2*sizeof(int), cdb, cdblen); if (retbuf && !getreply) memcpy(cmd + 2*sizeof(int) + cdblen, retbuf, retbuflen); - + if (ioctl(d->fd, SCSI_IOCTL_SEND_COMMAND, cmd)) { wm_lib_message(WM_MSG_LEVEL_DEBUG|WM_MSG_CLASS, "%s: ioctl() failure\n", __FILE__); @@ -759,7 +759,7 @@ wm_scsi( struct wm_drive *d, unsigned char *cdb, int cdblen, free(cmd); return (-1); } - + if (retbuf && getreply) memcpy(retbuf, cmd + 2*sizeof(int), retbuflen); @@ -781,7 +781,7 @@ wmcd_open( struct wm_drive *d ) static int warned = 0; int retval = 0; char vendor[32], model[32], rev[32]; - + if (cd_device == NULL) cd_device = DEFAULT_CD_DEVICE; @@ -790,7 +790,7 @@ wmcd_open( struct wm_drive *d ) wm_lib_message(WM_MSG_LEVEL_DEBUG|WM_MSG_CLASS, "wmcd_open(): [device is open (fd=%d)]\n", d->fd); return (0); } - + d->fd = open(cd_device, O_RDONLY | O_NONBLOCK); if (d->fd < 0) { @@ -830,7 +830,7 @@ wmcd_open( struct wm_drive *d ) /* Can we figure out the drive type? */ wm_scsi_get_drive_type(d, vendor, model, rev); #endif - *d = *(find_drive_struct(vendor, model, rev)); + *d = *(find_drive_struct(vendor, model, rev)); wm_drive_settype(vendor, model, rev); d->fd = fd; diff --git a/ascd/libworkman/plat_linux_audio.c b/ascd/libworkman/plat_linux_audio.c index c761e9f..4a7cdf3 100644 --- a/ascd/libworkman/plat_linux_audio.c +++ b/ascd/libworkman/plat_linux_audio.c @@ -5,7 +5,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -77,7 +77,7 @@ extern int playing; static int aufd, aucfd; static int raw_audio = 1; /* Can /dev/audio take 44.1KHz stereo? */ -/* +/* * For fast linear-to-ulaw mapping, we use a lookup table that's generated * at startup. */ @@ -408,7 +408,7 @@ wmaudio_state(struct cdda_block *blk) #define ZEROTRAP /* turn on the trap as per the MIL-STD */ #define BIAS 0x84 /* define the add-in bias for 16 bit samples */ #define CLIP 32635 - + unsigned char linear_to_ulaw( sample ) int sample; @@ -431,12 +431,12 @@ int sample; 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7}; int sign, exponent, mantissa; unsigned char ulawbyte; - + /* Get the sample into sign-magnitude. */ sign = (sample >> 8) & 0x80; /* set aside the sign */ if ( sign != 0 ) sample = -sample; /* get magnitude */ if ( sample > CLIP ) sample = CLIP; /* clip the magnitude */ - + /* Convert from 16 bit linear to ulaw. */ sample = sample + BIAS; exponent = exp_lut[( sample >> 7 ) & 0xFF]; @@ -445,7 +445,7 @@ int sample; #ifdef ZEROTRAP if ( ulawbyte == 0 ) ulawbyte = 0x02; /* optional CCITT trap */ #endif - + return ulawbyte; } diff --git a/ascd/libworkman/plat_linux_cdda.c b/ascd/libworkman/plat_linux_cdda.c index babd4dd..70a3d39 100644 --- a/ascd/libworkman/plat_linux_cdda.c +++ b/ascd/libworkman/plat_linux_cdda.c @@ -5,7 +5,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -26,7 +26,7 @@ */ #include "include/wm_config.h" - + #if defined(linux) && defined(BUILD_CDDA) /* { */ static char plat_linux_cdda_id[] = "$Id: plat_linux_cdda.c,v 1.3 1999/03/07 08:36:40 dirk Exp $"; @@ -133,7 +133,7 @@ wmcdda_open(char *devname) { int fd; - fd = open(devname, 0); + fd = open(devname, 0); if (fd == -1) fd = open("/dev/rdsk/c0t6d0s2", 0); diff --git a/ascd/libworkman/plat_news.c b/ascd/libworkman/plat_news.c index 6736cd7..cad7bb9 100644 --- a/ascd/libworkman/plat_news.c +++ b/ascd/libworkman/plat_news.c @@ -5,7 +5,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -438,7 +438,7 @@ wmcd_open(d) wm_scsi_get_drive_type(d, vendor, model, rev); *d = *(find_drive_struct(vendor, model, rev)); wm_drive_settype(vendor, model, rev); - + d->fd = fd; (d->init)(d); diff --git a/ascd/libworkman/plat_openbsd.c b/ascd/libworkman/plat_openbsd.c index bdc2fb7..9f752b6 100644 --- a/ascd/libworkman/plat_openbsd.c +++ b/ascd/libworkman/plat_openbsd.c @@ -5,7 +5,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -21,7 +21,7 @@ * License along with this library; if not, write to the Free * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * + * * OpenBSD-specific drive control routines. (Based on plat_freebsd.c) * * Michael Shalayeff, 7/24/96 @@ -398,7 +398,7 @@ unscale_volume(int cd_vol, int max) else bot = vol + 1; } - + if (vol < 0) vol = 0; else if (vol > max) @@ -494,7 +494,7 @@ wmcd_open(struct wm_drive *d) *d = *(find_drive_struct(vendor, model, rev)); wm_drive_settype(vendor, model, rev); - + (d->init)(d); d->fd = fd; diff --git a/ascd/libworkman/plat_osf1.c b/ascd/libworkman/plat_osf1.c index 538871c..14825a9 100644 --- a/ascd/libworkman/plat_osf1.c +++ b/ascd/libworkman/plat_osf1.c @@ -3,7 +3,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -475,7 +475,7 @@ unscale_volume(cd_vol, max) else bot = vol + 1; } - + if (vol < 0) vol = 0; else if (vol > max) diff --git a/ascd/libworkman/plat_sun.c b/ascd/libworkman/plat_sun.c index 784ae5f..14005de 100644 --- a/ascd/libworkman/plat_sun.c +++ b/ascd/libworkman/plat_sun.c @@ -5,7 +5,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -267,7 +267,7 @@ gen_get_trackcount( struct wm_drive *d, int *tracks ) if (ioctl(d->fd, CDROMREADTOCHDR, &hdr)) return (-1); - + *tracks = hdr.cdth_trk1; return (0); } @@ -285,12 +285,12 @@ gen_get_trackinfo( struct wm_drive *d, int track, int *data, int *startframe) if (ioctl(d->fd, CDROMREADTOCENTRY, &entry)) return (-1); - + *startframe = entry.cdte_addr.msf.minute * 60 * 75 + entry.cdte_addr.msf.second * 75 + entry.cdte_addr.msf.frame; *data = entry.cdte_ctrl & CDROM_DATA_TRACK ? 1 : 0; - + return (0); } @@ -487,7 +487,7 @@ gen_get_drive_status( struct wm_drive *d, *mode = WM_CDM_TRACK_DONE; /* waiting for next track. */ break; - default: + default: *mode = WM_CDM_UNKNOWN; break; } @@ -509,7 +509,7 @@ gen_set_volume( struct wm_drive *d, int left, int right ) last_right = right; thecd = d; #endif - + if (cdda_slave > -1) { int bal, vol; @@ -854,13 +854,13 @@ wm_scsi( struct wm_drive *d, cmd.uscsi_flags = USCSI_ISOLATE | USCSI_SILENT; if (getreply) cmd.uscsi_flags |= USCSI_READ; - + if (ioctl(d->fd, USCSICMD, &cmd)) return (-1); - + if (cmd.uscsi_status) return (-1); - + return (0); } #else @@ -886,7 +886,7 @@ wmcd_open( struct wm_drive *d ) if (d->fd >= 0) /* Device already open? */ return (0); - + d->fd = open(cd_device, 0); if (d->fd < 0) { @@ -1050,7 +1050,7 @@ codec_init( void ) ctl_fd = -1; return(0); } - + if (!(devname = getenv("AUDIODEV"))) devname = "/dev/audio"; ctlname = strcat(strcpy(malloc(strlen(devname) + 4), devname), "ctl"); if ((ctl_fd = open(ctlname, O_WRONLY, 0)) < 0) { @@ -1099,7 +1099,7 @@ codec_init( void ) /* * now set it up to use it. See audio(7I) */ - + AUDIO_INITINFO(&foo); foo.record.port = port; foo.record.balance = foo.play.balance = AUDIO_MID_BALANCE; @@ -1119,7 +1119,7 @@ codec_init( void ) */ foo.record.gain = (AUDIO_MAX_GAIN * 80) / 100; foo.play.gain = (AUDIO_MAX_GAIN * 40) / 100; - + ioctl(ctl_fd, AUDIO_SETINFO, &foo); return 0; } @@ -1133,7 +1133,7 @@ static kick_codec( void ) { * Open the audio device, not the control device. This * will fail if someone else has taken it. */ - + if ((dev_fd = open(devname, O_WRONLY|O_NDELAY, 0)) < 0) { perror(devname); return -1; @@ -1142,13 +1142,13 @@ static kick_codec( void ) { AUDIO_INITINFO(&foo); foo.record.port = port; foo.monitor_gain = AUDIO_MAX_GAIN; - + /* These can only be set on the real device */ foo.play.sample_rate = 44100; foo.play.channels = 2; foo.play.precision = 16; foo.play.encoding = AUDIO_ENCODING_LINEAR; - + if ((retval = ioctl(dev_fd, AUDIO_SETINFO, &foo)) < 0) perror(devname); diff --git a/ascd/libworkman/plat_sun_audio.c b/ascd/libworkman/plat_sun_audio.c index 7d6a4bc..075edf8 100644 --- a/ascd/libworkman/plat_sun_audio.c +++ b/ascd/libworkman/plat_sun_audio.c @@ -5,7 +5,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -26,7 +26,7 @@ */ #include "include/wm_config.h" -#if defined(sun) && defined(SYSV) && defined(BUILD_CDDA) +#if defined(sun) && defined(SYSV) && defined(BUILD_CDDA) static char plat_sun_audio_id[] = "$Id: plat_sun_audio.c,v 1.3 1999/03/07 08:36:41 dirk Exp $"; @@ -76,7 +76,7 @@ extern int playing; static int aufd, aucfd; static int raw_audio = 1; /* Can /dev/audio take 44.1KHz stereo? */ -/* +/* * For fast linear-to-ulaw mapping, we use a lookup table that's generated * at startup. */ @@ -407,7 +407,7 @@ wmaudio_state(struct cdda_block *blk) #define ZEROTRAP /* turn on the trap as per the MIL-STD */ #define BIAS 0x84 /* define the add-in bias for 16 bit samples */ #define CLIP 32635 - + unsigned char linear_to_ulaw( sample ) int sample; @@ -430,12 +430,12 @@ int sample; 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7}; int sign, exponent, mantissa; unsigned char ulawbyte; - + /* Get the sample into sign-magnitude. */ sign = (sample >> 8) & 0x80; /* set aside the sign */ if ( sign != 0 ) sample = -sample; /* get magnitude */ if ( sample > CLIP ) sample = CLIP; /* clip the magnitude */ - + /* Convert from 16 bit linear to ulaw. */ sample = sample + BIAS; exponent = exp_lut[( sample >> 7 ) & 0xFF]; @@ -444,7 +444,7 @@ int sample; #ifdef ZEROTRAP if ( ulawbyte == 0 ) ulawbyte = 0x02; /* optional CCITT trap */ #endif - + return ulawbyte; } diff --git a/ascd/libworkman/plat_sun_cdda.c b/ascd/libworkman/plat_sun_cdda.c index 4d9f758..90c5759 100644 --- a/ascd/libworkman/plat_sun_cdda.c +++ b/ascd/libworkman/plat_sun_cdda.c @@ -5,7 +5,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -133,7 +133,7 @@ wmcdda_open(char *devname) { int fd; - fd = open(devname, 0); + fd = open(devname, 0); if (fd == -1) fd = open("/dev/rdsk/c0t6d0s2", 0); diff --git a/ascd/libworkman/plat_svr4.c b/ascd/libworkman/plat_svr4.c index 8f01739..374cf28 100644 --- a/ascd/libworkman/plat_svr4.c +++ b/ascd/libworkman/plat_svr4.c @@ -5,7 +5,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -222,7 +222,7 @@ create_cdrom_node(char *dev_name) } ccode = access(pass_through, F_OK); - + if (ccode < 0) { if ((file_des = open(dev_name, O_RDONLY)) < 0) @@ -258,7 +258,7 @@ create_cdrom_node(char *dev_name) return -1; } } - + file_des = open( pass_through, O_RDWR); err = errno; @@ -286,7 +286,7 @@ wmcd_open(d) if (d->fd >= 0) /* Device already open? */ return (0); - + if (cd_device == NULL) cd_device = DEFAULT_CD_DEVICE; @@ -329,7 +329,7 @@ wmcd_open(d) } *d = *(find_drive_struct(vendor, model, rev)); wm_drive_settype(vendor, model, rev); - + d->fd = fd; return (0); @@ -366,7 +366,7 @@ wmcd_reopen( struct wm_drive *d ) /* * Send a SCSI command out the bus. */ -int +int wm_scsi(d, xcdb, cdblen, retbuf, retbuflen, getreply) struct wm_drive *d; unsigned char *xcdb; @@ -382,7 +382,7 @@ wm_scsi(d, xcdb, cdblen, retbuf, retbuflen, getreply) int errno_save; /* getreply == 1 is read, == 0 is write */ - + struct sb sb; struct scs scs; diff --git a/ascd/libworkman/plat_template.c b/ascd/libworkman/plat_template.c index 3e7467a..956b98b 100644 --- a/ascd/libworkman/plat_template.c +++ b/ascd/libworkman/plat_template.c @@ -5,7 +5,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -51,7 +51,7 @@ int gen_init(struct wm_drive *d) */ int gen_get_trackcount(struct wm_drive *d,int *tracks) -{ +{ return (0); } @@ -66,7 +66,7 @@ int gen_get_cdlen(struct wm_drive *d,int *frames) return (0); } -/* +/* * gen_get_trackinfo() * */ @@ -77,7 +77,7 @@ gen_get_trackinfo(struct wm_drive *d,int track,int *data,int *startframe) return (0); } -/* +/* * gen_get_drive_status() * */ @@ -88,7 +88,7 @@ int gen_get_drive_status(struct wm_drive *d, int *pos, int *track, int *index) -{ +{ return (0); } @@ -115,7 +115,7 @@ int gen_get_volume(struct wm_drive *d,int *left,int *right) return (0); } -/* +/* * gen_set_volume() * */ @@ -125,7 +125,7 @@ int gen_set_volume(struct wm_drive *d,int left,int right) return (0); } -/* +/* * gen_pause() * */ @@ -150,7 +150,7 @@ int gen_resume(struct wm_drive *d) * */ -int gen_stop(struct wm_drive *d){ +int gen_stop(struct wm_drive *d){ return (0); } @@ -234,7 +234,7 @@ int wmcd_open(struct wm_drive *d) *d = *(find_drive_struct(vendor, model, rev)); wm_drive_settype(vendor, model, rev); - + d->fd = fd; d->init(d); diff --git a/ascd/libworkman/plat_ultrix.c b/ascd/libworkman/plat_ultrix.c index d74af38..049ca9a 100644 --- a/ascd/libworkman/plat_ultrix.c +++ b/ascd/libworkman/plat_ultrix.c @@ -5,7 +5,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -473,7 +473,7 @@ unscale_volume(cd_vol, max) else bot = vol + 1; } - + if (vol < 0) vol = 0; else if (vol > max) diff --git a/ascd/libworkman/scsi.c b/ascd/libworkman/scsi.c index 292f744..0e3539f 100644 --- a/ascd/libworkman/scsi.c +++ b/ascd/libworkman/scsi.c @@ -5,7 +5,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -101,7 +101,7 @@ sendscsi( struct wm_drive *d, void *buf, case 0: cdblen = 6; break; - + case 5: cdb[10] = a10; cdb[11] = a11; @@ -140,7 +140,7 @@ wm_scsi_mode_sense( struct wm_drive *d, unsigned char page, unsigned char *buf ) page, 0, sizeof(pagebuf), 0,0,0,0,0,0,0); if (status < 0) return (status); - + /* * The first byte of the returned data is the transfer length. Then * two more bytes and the length of whatever header blocks are in @@ -218,7 +218,7 @@ wm_scsi_get_drive_type( struct wm_drive *d, char *vendor, rev[4] = '\0'; wm_lib_message(WM_MSG_LEVEL_DEBUG|WM_MSG_CLASS, "SCSI Inquiry result: [%s|%s|%s]\n", vendor, model, rev); - + /* Remove "CD-ROM " from the model. */ if (! strncmp(model, "CD-ROM", 6)) { @@ -288,7 +288,7 @@ wm_scsi2_get_trackinfo(d, track, data, startframe) 0, 0, 0, 0, track, sizeof(buf) / 256, sizeof(buf) % 256, 0,0,0)) return (-1); - + *data = buf[5] & 4 ? 1 : 0; *startframe = buf[9] * 60 * 75 + buf[10] * 75 + buf[11]; @@ -329,12 +329,12 @@ wm_scsi2_get_drive_status(d, oldmode, mode, pos, track, index) { /* * stupid somehow, but necessary this time - */ + */ switch( wmcd_open( d ) ) { case -1: /* error */ return (-1); - + case 1: /* retry */ return (0); } @@ -345,7 +345,7 @@ wm_scsi2_get_drive_status(d, oldmode, mode, pos, track, index) if (sendscsi(d, buf, sizeof(buf), 1, SCMD_READ_SUBCHANNEL, 2, 64, 1, 0, 0, 0, sizeof(buf) / 256, sizeof(buf) % 256, 0,0,0)) return (0); - + switch (buf[1]) { case SUBQ_STATUS_PLAY: *mode = WM_CDM_PLAYING; @@ -399,11 +399,11 @@ wm_scsi2_get_drive_status(d, oldmode, mode, pos, track, index) default: *mode = WM_CDM_UNKNOWN; -#ifdef DEBUG +#ifdef DEBUG if( getenv( "WORKMAN_DEBUG" ) != NULL ) printf("wm_scsi2_get_drive_status: status is 0x%x\n", buf[1]); -#endif +#endif break; } @@ -521,7 +521,7 @@ wm_scsi2_set_volume(d, left, right) /* Get the current audio parameters first. */ if (wm_scsi_mode_sense(d, PAGE_AUDIO, mode)) return (-1); - + /* Tweak the volume part of the parameters. */ mode[9] = (left * 255) / 100; mode[11] = (right * 255) / 100; diff --git a/ascd/libworkman/wm_helpers.c b/ascd/libworkman/wm_helpers.c index c36e464..ab1e2c2 100644 --- a/ascd/libworkman/wm_helpers.c +++ b/ascd/libworkman/wm_helpers.c @@ -5,7 +5,7 @@ * (c) 1991-1997 by Steven Grimm (original author) * (c) by Dirk Försterling (current 'author' = maintainer) * The maintainer can be contacted by his e-mail address: - * [email protected] + * [email protected] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -41,7 +41,7 @@ static char wm_helpers_id[] = "$Id: wm_helpers.c,v 1.7 1999/03/07 08:36:41 dirk int wm_lib_verbosity = WM_MSG_LEVEL_NONE; -/* +/* * Some seleced functions of version reporting follow... */ @@ -52,7 +52,7 @@ int wm_libver_pl( void ){return WM_LIBVER_PL;} char *wm_libver_name( void ) { char *s = NULL; - + wm_strmcat(&s, WM_LIBVER_NAME); return s; } /* wm_libver_name() */ @@ -78,9 +78,9 @@ char *wm_libver_string( void ) { char *s = NULL; - wm_strmcat( &s, wm_libver_name() ); - wm_strmcat( &s, " " ); - wm_strmcat( &s, wm_libver_number() ); + wm_strmcat( &s, wm_libver_name() ); + wm_strmcat( &s, " " ); + wm_strmcat( &s, wm_libver_number() ); return s; } /* wm_libver_string() */ @@ -203,7 +203,7 @@ void wm_lib_message( unsigned int level, char *fmt, ... ) } /* * print it only if level and class are allowed. - */ + */ if( (level <= vlevel) && (vclass != 0) ) { va_start(ap, fmt); diff --git a/pclock/demos/rolexgmt b/pclock/demos/rolexgmt index 51c07bc..820aec1 100755 --- a/pclock/demos/rolexgmt +++ b/pclock/demos/rolexgmt @@ -1,5 +1,5 @@ #!/bin/sh -echo "Image courtesy of Clemens Krammer <[email protected]>" +echo "Image courtesy of Clemens Krammer <[email protected]>" echo cmd='../src/pclock -B../XPM/rolexgmt.xpm -H grey80 --hands-width=2 --hour-hand-length=12 --second-hand-length=18' diff --git a/pclock/src/Graphics.c b/pclock/src/Graphics.c index 46aaf7d..4c0aac4 100644 --- a/pclock/src/Graphics.c +++ b/pclock/src/Graphics.c @@ -101,9 +101,9 @@ CreateWindow(int ac, char *av[]) attributes.valuemask = XpmSize; result = XpmReadFileToPixmap(display, root, option.background_pixmap, &back_pm, &mask_pm, &attributes); - + if (result != XpmSuccess) - fprintf(stderr, "ERR: trouble loading pixmap\n"); + fprintf(stderr, "ERR: trouble loading pixmap\n"); else if (attributes.width != SIZE || attributes.height != SIZE) fprintf(stderr, "ERR: pixmap must be %dx%d\n", SIZE, SIZE); else diff --git a/washerdryer/README b/washerdryer/README index df28919..2246c79 100644 --- a/washerdryer/README +++ b/washerdryer/README @@ -16,7 +16,7 @@ Some features are: * Command line options (-h for help) * Customize the program through config file, command line options, or on the fly - + Files -------------------------------------------------------------- @@ -24,7 +24,7 @@ README This file. INSTALL Installation instructions. Changelog Description of changes. COPYING GNU General Public License Version 2. - + Program Usage -------------------------------------------------------------- diff --git a/washerdryer/washerDryer/Makefile b/washerdryer/washerDryer/Makefile index 71e8674..49205ce 100644 --- a/washerdryer/washerDryer/Makefile +++ b/washerdryer/washerDryer/Makefile @@ -1,5 +1,5 @@ LIBDIR = -L/usr/X11R6/lib -L/usr/lib -L/opt/gnome/lib -LIBS = -lXpm -lXext -lX11 -lm -lgtk -lgdk -rdynamic -lgmodule -lglib -ldl +LIBS = -lXpm -lXext -lX11 -lm -lgtk -lgdk -rdynamic -lgmodule -lglib -ldl CFLAGS = -I/usr/X11R6/include -I/usr/lib/glib/include -I/opt/gnome/include/gtk-1.2 -I/opt/gnome/include/glib-1.2 -I/opt/gnome/lib/glib/include OBJS = washerDryer.o \ ../wmgeneral/wmgeneral.o \ diff --git a/washerdryer/washerDryer/washerDryer.c b/washerdryer/washerDryer/washerDryer.c index 89eed3a..607b007 100644 --- a/washerdryer/washerDryer/washerDryer.c +++ b/washerdryer/washerDryer/washerDryer.c @@ -43,7 +43,7 @@ int wdryer_mask_width = 64; int wdryer_mask_height = 64; int wInCommandMode = 0; // 0 = default/bell 1 = command -int dInCommandMode = 0; +int dInCommandMode = 0; int tmp_wInCmdMode = 0; int tmp_dInCmdMode = 0; @@ -184,7 +184,7 @@ int main (int argc, char *argv[]) //clickable regions AddMouseRegion (0, 8, 6, 28, 24); //0: washer - AddMouseRegion (1, 32, 6, 52, 24); //1: dryer + AddMouseRegion (1, 32, 6, 52, 24); //1: dryer AddMouseRegion (2, 6, 26, 57, 57); //2: main area starttime = time (0); @@ -209,7 +209,7 @@ int main (int argc, char *argv[]) //decrement timer, draw status if (oldsec < time_struct->tm_sec) DecrementTimer (); - oldsec = (time_struct->tm_sec); + oldsec = (time_struct->tm_sec); RedrawWindow (); @@ -275,7 +275,7 @@ int main (int argc, char *argv[]) break; /*************** * click on main - ***************/ + ***************/ case 2: // main area //open GUI configure_washerdryer (); @@ -354,7 +354,7 @@ void DrawStatus(int intProcNum, int intStatus) copyXPMArea (intXPMx, 64, 3, 30, 8 + intProcNum*5, 27); - + intPrevStatus[intProcNum] = intXPMx; } } @@ -668,7 +668,7 @@ void destroyAndReloadConfig(GtkWidget* widget) configure_washerdryer(); } -//destroys window +//destroys window void destroy (GtkWidget * widget, gpointer data) { gtk_main_quit (); @@ -786,7 +786,7 @@ int configure_washerdryer () // Add vertical box to main window gtk_container_add (GTK_CONTAINER (frame), sub_vbox); gtk_widget_show (sub_vbox); - + box2 = gtk_hbox_new (FALSE, 0); gtk_box_pack_start (GTK_BOX (sub_vbox), box2, TRUE, TRUE, 2); @@ -897,7 +897,7 @@ int configure_washerdryer () gtk_box_pack_start (GTK_BOX(innerHbox), buttonChange, FALSE, FALSE, 2); gtk_widget_show (buttonChange); - sprintf(buffer, " min remaining"); + sprintf(buffer, " min remaining"); label = gtk_label_new (buffer); gtk_misc_set_alignment (GTK_MISC (label), 2, 2); gtk_box_pack_start (GTK_BOX (innerHbox), label, FALSE, FALSE, 2); @@ -964,7 +964,7 @@ int configure_washerdryer () gtk_box_pack_start (GTK_BOX (innerHbox), button, FALSE, FALSE, 4); gtk_widget_show (button); - + } } //end for diff --git a/washerdryer/wmgeneral/list.c b/washerdryer/wmgeneral/list.c index 1342aab..ba1434a 100644 --- a/washerdryer/wmgeneral/list.c +++ b/washerdryer/wmgeneral/list.c @@ -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. @@ -61,7 +61,7 @@ INLINE int 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 * list_nth (int index, LinkedList * list) diff --git a/washerdryer/wmgeneral/list.h b/washerdryer/wmgeneral/list.h index de4b9fe..3271d65 100644 --- a/washerdryer/wmgeneral/list.h +++ b/washerdryer/wmgeneral/list.h @@ -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 diff --git a/washerdryer/wmgeneral/misc.c b/washerdryer/wmgeneral/misc.c index 90a43d9..d917917 100644 --- a/washerdryer/wmgeneral/misc.c +++ b/washerdryer/wmgeneral/misc.c @@ -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 diff --git a/washerdryer/wmgeneral/wmgeneral.c b/washerdryer/wmgeneral/wmgeneral.c index 2d4b2fb..de11505 100644 --- a/washerdryer/wmgeneral/wmgeneral.c +++ b/washerdryer/wmgeneral/wmgeneral.c @@ -17,7 +17,7 @@ * Now supports >256 colors 11/09/1998 (Martijn Pieterse, [email protected]) * Removed a bug from parse_rcfile. You could - not use "start" in a command if a label was + not use "start" in a command if a label was also start. * Changed the needed geometry string. We don't use window size, and don't support diff --git a/wmail/README b/wmail/README index 485b634..e52b161 100644 --- a/wmail/README +++ b/wmail/README @@ -166,7 +166,7 @@ Description: cmd-line option : -c <string> rc-file statement: Window.Button.Command = "<string>" default value : "xterm -e mail" - + item : your mailbox (file => mbox, directory => Maildir) cmd-line option : -mb <string> rc-file statement: Mail.MailBox = "<string>" @@ -308,7 +308,7 @@ Porting: - Sun Solaris 4.0 on Sparc Station 4 and 10 - Sun Solaris 6, 7 and 8 (thanx to Kristian Borum!) - SunOs 5.7 on Ultra Sparc 5 (thanx to Alessandro!) - + ...together with Window Maker v0.60.0 or better (or standalone of course) and libdockapp v0.4.0. diff --git a/wmail/configure b/wmail/configure index 1f51cba..a080483 100755 --- a/wmail/configure +++ b/wmail/configure @@ -1,7 +1,7 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 +# Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation @@ -1122,7 +1122,7 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then cat >> confdefs.h <<EOF #define $ac_tr_hdr 1 EOF - + else echo "$ac_t""no" 1>&6 fi @@ -2088,7 +2088,7 @@ fi echo "$ac_t""$ac_cv_c_const" 1>&6 if test $ac_cv_c_const = no; then cat >> confdefs.h <<\EOF -#define const +#define const EOF fi @@ -2331,7 +2331,7 @@ if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then cat >> confdefs.h <<EOF #define $ac_tr_func 1 EOF - + else echo "$ac_t""no" 1>&6 fi diff --git a/wmail/src/common.c b/wmail/src/common.c index 4f564ae..59acec4 100644 --- a/wmail/src/common.c +++ b/wmail/src/common.c @@ -4,7 +4,7 @@ // // Copyright 2000~2002, Sven Geisenhainer <[email protected]>. // All rights reserved. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: @@ -15,7 +15,7 @@ // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. -// +// // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. @@ -46,7 +46,7 @@ void TRACE( const char *fmt, ... ) } #endif -void ABORT( const char *fmt, ... ) +void ABORT( const char *fmt, ... ) { va_list args; va_start( args, fmt ); @@ -78,7 +78,7 @@ char *MakePathName( const char *dir, const char *file ) fullName = malloc( len1 + len2 + 2 ); else fullName = malloc( len1 + len2 + 1 ); - + memcpy( fullName, dir, len1 ); if( dir[len1-1] != '/' ) fullName[len1++] = '/'; diff --git a/wmail/src/common.h b/wmail/src/common.h index 7074365..06d38f5 100644 --- a/wmail/src/common.h +++ b/wmail/src/common.h @@ -4,7 +4,7 @@ // // Copyright 2000~2002, Sven Geisenhainer <[email protected]>. // All rights reserved. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: @@ -15,7 +15,7 @@ // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. -// +// // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. diff --git a/wmail/src/config.c b/wmail/src/config.c index b73d29f..80df0f2 100644 --- a/wmail/src/config.c +++ b/wmail/src/config.c @@ -4,7 +4,7 @@ // // Copyright 2000~2002, Sven Geisenhainer <[email protected]>. // All rights reserved. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: @@ -15,7 +15,7 @@ // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. -// +// // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. @@ -38,7 +38,7 @@ /////////////////////////////////////////////////////////////////////////////// // wmailrc file format -// +// // # - comment-lines // Window.Display = "string" // Window.NonShaped = On|Off @@ -107,7 +107,7 @@ config_t config = { }; // enumeration names for ticker mode -enumList_t tickerEnum[] = +enumList_t tickerEnum[] = { { "address", TICKER_ADDRESS }, { "familyname", TICKER_FAMILYNAME }, @@ -134,7 +134,7 @@ bool Tokenize( const char *line, const char **id, const char **value ) { *id = token1; *value = token2; - + return true; } } @@ -153,7 +153,7 @@ void AddSenderToSkipList( char *sender ) { if( !strcmp( *skipName, sender )) return; - + numNames++; } @@ -228,7 +228,7 @@ void PostProcessConfiguration() config.display = strdup( WMAIL_DISPLAY ); if( config.runCmd == NULL ) - config.runCmd = strdup( WMAIL_CLIENT_CMD ); + config.runCmd = strdup( WMAIL_CLIENT_CMD ); if( config.mailBox == NULL ) { @@ -245,12 +245,12 @@ void ReadConfigFile( bool resetConfigStrings ) // free all config strings and reset their pointers if required if( resetConfigStrings ) ResetConfigStrings(); - + if(( usersHome = getenv( "HOME" )) != NULL ) { char *fileName = MakePathName( usersHome, WMAIL_RC_FILE ); FILE *f = fopen( fileName, "rt" ); - + if( f != NULL ) { char buf[1024]; @@ -260,7 +260,7 @@ void ReadConfigFile( bool resetConfigStrings ) { const char *id, *value; unsigned int len; - + if( fgets( buf, 1024, f ) == NULL ) break; @@ -268,7 +268,7 @@ void ReadConfigFile( bool resetConfigStrings ) for( len = strlen( buf ); len > 0 && IsWhiteSpace(buf+(--len)); ) *(buf+len) = '\0'; - + if( !Tokenize( buf, &id, &value )) continue; @@ -332,7 +332,7 @@ void ReadConfigFile( bool resetConfigStrings ) } else WARNING( "cfg-file(%i): unrecognized: \"%s\"\n", line, buf ); } - + fclose( f ); } else { TRACE( "unable to open config-file \"%s\"\n", fileName ); @@ -355,7 +355,7 @@ bool ReadString( const char *from, unsigned int line, char **to ) { if( *(trailingQuote-1) != '\\' ) break; - + ++trailingQuote; } @@ -367,7 +367,7 @@ bool ReadString( const char *from, unsigned int line, char **to ) // disposing of "to" is up to the caller... *to = malloc( trailingQuote - from + 1 ); to_c = *to; - + for( c = from; c != trailingQuote; ++c ) { if( *c == '\\' ) { switch( *(++c) ) { @@ -394,17 +394,17 @@ bool ReadString( const char *from, unsigned int line, char **to ) } } else *to_c = *c; - + ++to_c; } - + *to_c = '\0'; TRACE( "ReadString read \"%s\"\n", *to ); return true; } } - + WARNING( "cfg-file(%i): invalid string\n" ); return false; } @@ -428,7 +428,7 @@ bool ReadBool( const char *from, unsigned int line, bool *to ) bool ReadInt( const char *from, unsigned int line, int *to ) { int value = 0; - + if( *from == '0' && (*(from+1) == 'x' || *(from+1) == 'X') ) { for( from += 2; *from != '\0' && !IsWhiteSpace( from ); ++from ) { @@ -460,7 +460,7 @@ bool ReadInt( const char *from, unsigned int line, int *to ) return false; } } - + *to = value; TRACE( "ReadInt read \"%i\"\n", *to ); @@ -482,7 +482,7 @@ bool ReadEnum( const char *from, unsigned int line, int *to, const enumList_t *e } WARNING( "cfg-file(%i): unknown modifier: \"%s\"\n", line, from ); - + return false; } @@ -494,9 +494,9 @@ bool IsWhiteSpace( const char *chr ) const char *SkipWhiteSpaces( const char *str ) { const char *c; - + for( c = str; IsWhiteSpace( c ); ++c ) ; - + return c; } diff --git a/wmail/src/config.h b/wmail/src/config.h index ff33f91..d69a6f1 100644 --- a/wmail/src/config.h +++ b/wmail/src/config.h @@ -4,7 +4,7 @@ // // Copyright 2000~2002, Sven Geisenhainer <[email protected]>. // All rights reserved. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: @@ -15,7 +15,7 @@ // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. -// +// // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. diff --git a/wmail/src/wmail.c b/wmail/src/wmail.c index 1ef93b3..bd2752a 100644 --- a/wmail/src/wmail.c +++ b/wmail/src/wmail.c @@ -7,7 +7,7 @@ // // Copyright 2000~2002, Sven Geisenhainer <[email protected]>. // All rights reserved. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: @@ -18,7 +18,7 @@ // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. -// +// // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. @@ -226,7 +226,7 @@ int main( int argc, char **argv ) if(( usersHome = getenv( "HOME" )) == NULL ) { WARNING( "HOME environment-variable is not set, placing %s in current directory!\n", WMAIL_CHECKSUM_FILE ); config.checksumFileName = WMAIL_CHECKSUM_FILE; - } else + } else config.checksumFileName = MakePathName( usersHome, WMAIL_CHECKSUM_FILE ); } @@ -312,7 +312,7 @@ int main( int argc, char **argv ) XStringListToTextProperty( &name, 1, &windowName ); XSetWMName( DADisplay, DAWindow, &windowName ); - + UpdatePixmap( false ); DAShow(); SetTimer(); @@ -421,7 +421,7 @@ void PreparePixmaps( bool freeMem ) DAMakePixmapFromData( chars_xpm, &charsPixmap, NULL, &dummy, &dummy ); DAMakePixmapFromData( numbers_xpm, &numbersPixmap, NULL, &dummy, &dummy ); DAMakePixmapFromData( button_xpm, &buttonPixmap, NULL, &dummy, &dummy ); - + if( config.useX11Font != NULL ) { XRectangle clipRect; @@ -445,7 +445,7 @@ void PreparePixmaps( bool freeMem ) XSetClipRectangles( DADisplay, tickerGC, 0, 0, &clipRect, 1, Unsorted ); } - + if( config.noshape ) // non-shaped dockapp ? DASetShape( None ); else @@ -455,7 +455,7 @@ void PreparePixmaps( bool freeMem ) void MarkName( unsigned long checksum ) { name_t *name; - + for( name = names; name != NULL; name = name->next ) { if( name->checksum == checksum ) { name->flag |= FLAG_READ; @@ -469,18 +469,18 @@ void MarkName( unsigned long checksum ) void DetermineState() { name_t *name; - + for( name = names; name != NULL; name = name->next ) if(!( name->flag & FLAG_READ )) { state = STATE_NEWMAIL; if( config.cmdOnMail != NULL ) { int ret = system( config.cmdOnMail ); - + if( ret == 127 || ret == -1 ) WARNING( "execution of command \"%s\" failed.\n", config.cmdOnMail ); } - + break; } } @@ -496,7 +496,7 @@ void ReadChecksumFile() MarkName( checksum ); } else return; - + fclose( f ); } @@ -517,15 +517,15 @@ void WriteChecksumFile( bool writeAll ) return; TRACE( "\n" ); - - fclose( f ); + + fclose( f ); } void UpdateChecksum( unsigned long *checksum, const char *buf ) { if( buf != NULL ) { unsigned int i, len = strlen( buf ); - + for( i = 0; i < len; ++i ) *checksum += buf[i] << (( i % sizeof(long) ) * 8 ); } @@ -558,7 +558,7 @@ void TimerHandler( int dummy ) else CheckMBox(); } - + UpdatePixmap( checkMail % config.fps < config.fps/2 ); if( ++checkMail >= config.fps * config.checkInterval ) @@ -727,7 +727,7 @@ char *FileNameConcat( const char *path, const char *fileName ) name_t *GetMail( unsigned long checksum ) { name_t *name; - + for( name = names; name != NULL; name = name->next ) if( name->checksum == checksum ) return name; @@ -746,7 +746,7 @@ void UpdatePixmap( bool flashMailSymbol ) XCopyArea( DADisplay, mainPixmap, outPixmap, DAGC, 0, 0, 64, 64, 0, 0 ); - + if( numMails > 999 ) { XCopyArea( DADisplay, numbersPixmap, outPixmap, DAGC, @@ -879,7 +879,7 @@ void ParseMaildirFile( const char *fileName, unsigned long checksum, timeStruct.actime = fileStat->st_atime; timeStruct.modtime = fileStat->st_mtime; - utime( fileName, &timeStruct ); + utime( fileName, &timeStruct ); } char *ParseFromField( char *buf ) @@ -918,7 +918,7 @@ char *ParseFromField( char *buf ) state = STATE_QUOTED_FULLNAME; continue; case '<': - if( fullName[0] != '\0' && + if( fullName[0] != '\0' && fullName[ strlen( fullName ) - 1 ] == ' ' ) fullName[ strlen( fullName ) - 1 ] = '\0'; state = STATE_ADDRESS; @@ -941,9 +941,9 @@ char *ParseFromField( char *buf ) fullName[ strlen( fullName ) ] = *c; } continue; - + case STATE_QUOTED_FULLNAME: - + switch( *c ) { case '\\': fullName[ strlen( fullName ) ] = *(++c); @@ -1064,7 +1064,7 @@ bool SkipSender( char *address ) skipName != NULL && *skipName != NULL; skipName++ ) { TRACE( "comparing \"%s\" and \"%s\"\n", *skipName, address ); - + // call libc-fnmatch (wildcard-match :-) ! if( !fnmatch( *skipName, address, 0 )) { TRACE( "skipping sender \"%s\"\n", *skipName ); @@ -1103,7 +1103,7 @@ void RemoveLastName() void ClearAllNames() { name_t *name, *nextName; - + for( name = names; name != NULL; name = nextName ) { nextName = name->next; @@ -1120,7 +1120,7 @@ void ClearAllNames() void SetMailFlags( flag_t flag ) { name_t *name; - + for( name = names; name != NULL; name = name->next ) name->flag |= flag; } @@ -1174,7 +1174,7 @@ void DrawTickerBuildinFont() int leftSpace; int drawTo; unsigned char *currentChar; - + if( names == NULL ) return; @@ -1201,13 +1201,13 @@ void DrawTickerBuildinFont() int outChar = (*currentChar < 32 || *currentChar >= 128) ? '?' : *currentChar; int charWidth = 57-drawTo >= 14 ? 14 - leftSpace : 57-drawTo; - + XCopyArea( DADisplay, charsPixmap, outPixmap, DAGC, (outChar-32)*14+leftSpace, 0, charWidth, 21, drawTo, 20 ); leftSpace = 0; drawTo += charWidth; - + if( drawTo > 57 ) break; } @@ -1229,7 +1229,7 @@ void DrawTickerBuildinFont() } } } - + void ButtonPressed( int button, int state, int x, int y ) { if( x >= 35 && x <= 59 && y >= 47 && y <= 59 ) { @@ -1247,7 +1247,7 @@ void ButtonReleased( int button, int state, int x, int y ) if( x >= 35 && x <= 59 && y >= 47 && y <= 59 ) { int ret = system( config.runCmd ); - + if( ret == 127 || ret == -1 ) WARNING( "execution of command \"%s\" failed.\n", config.runCmd ); } @@ -1271,7 +1271,7 @@ char *XpmColorLine( const char *colorName, char *colorLine, bool disposeLine ) { char *newLine = strdup( colorLine ); char *from = strrchr( newLine, '#' ); - + if( from == NULL && !strcasecmp( &colorLine[ strlen( colorLine ) - 4 ], "none" )) { // if no # found, it should be a None-color line free( newLine ); @@ -1283,9 +1283,9 @@ char *XpmColorLine( const char *colorName, char *colorLine, bool disposeLine ) if( disposeLine ) free( colorLine ); - + GetHexColorString( colorName, from+1 ); - + return newLine; } diff --git a/wmappkill/ChangeLog b/wmappkill/ChangeLog index 3a3edf1..0779e37 100644 --- a/wmappkill/ChangeLog +++ b/wmappkill/ChangeLog @@ -5,6 +5,6 @@ wmAppKill - Changelog added support for mouse wheel (thanks to Mathieu) some code cleaning -- 09/28/2000 - v0.1 +- 09/28/2000 - v0.1 initial release diff --git a/wmappkill/INSTALL b/wmappkill/INSTALL index 921542a..fc381db 100644 --- a/wmappkill/INSTALL +++ b/wmappkill/INSTALL @@ -1,5 +1,5 @@ -wmAppKill requires the libGtop. +wmAppKill requires the libGtop. Download it at: http://www.home-of-linux.org/gnome/libgtop/ To install wmAppKill : diff --git a/wmappkill/Makefile b/wmappkill/Makefile index 318b058..8b18e03 100644 --- a/wmappkill/Makefile +++ b/wmappkill/Makefile @@ -12,9 +12,9 @@ wmAppKill : wmAppKill.c install: wmAppKill install -m 755 wmAppKill /usr/bin/wmAppKill - + clean: $(RM) *.o core tst *~ \#* - - - + + + diff --git a/wmappkill/README b/wmappkill/README index 0d36903..5e47264 100644 --- a/wmappkill/README +++ b/wmappkill/README @@ -2,7 +2,7 @@ wmAppKill v0.2 -------------- -wmAppKill is a Window Maker dock applet that lists all your running processes. +wmAppKill is a Window Maker dock applet that lists all your running processes. You can kill any of them by doubleclicking on their names. You can specify wich process will be the oldest one of the list. @@ -11,10 +11,10 @@ Type "wmAppKill -h" to get command line options. Please send comments, bugs, modifications to : [email protected] -Future releases will be holded at: +Future releases will be holded at: http://internettrash.com/users/beuz/wmappkill.html -Hope you'll enjoy it... +Hope you'll enjoy it... You might want to check this other cool dockapp from which i started : wmNetscapeKiller at http://pblumo.free.fr/wmNetscapeKiller diff --git a/wmappkill/wmAppKill.c b/wmappkill/wmAppKill.c index bd2cfd3..f38a89b 100644 --- a/wmappkill/wmAppKill.c +++ b/wmappkill/wmAppKill.c @@ -1,7 +1,7 @@ -/* +/* * wmAppKill v0.2 - S.Rozange - * + * * 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, or (at your option) @@ -14,19 +14,19 @@ * * You should have received a copy of the GNU General Public License * along with this program (see the file COPYING); if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA * */ #include <unistd.h> -#include <stdio.h> +#include <stdio.h> #include <string.h> #include <stdlib.h> #include <X11/Xlib.h> -#include <X11/xpm.h> +#include <X11/xpm.h> #include <X11/Xutil.h> #include <X11/extensions/shape.h> @@ -43,15 +43,15 @@ #include <time.h> #include <signal.h> -#include "fond.xbm" -#include "wmAppKill.xpm" +#include "fond.xbm" +#include "wmAppKill.xpm" #include "wmAppKill.h" Display *dpy; /* xlib global vars */ GC gc; Window win; Window iconWin; -Pixmap XPM; +Pixmap XPM; int screen; _zone *fZone = NULL; @@ -69,7 +69,7 @@ struct timeval timev; /* to detect double-click */ void ZoneCreate(int x, int y, int width, int height, char no) { _zone *last; - + if (!fZone) { fZone = (_zone *)malloc(sizeof(_zone)); last = fZone; @@ -93,23 +93,23 @@ char CheckZone(void) unsigned int mask; Window root_ret, child_ret; _zone *curseur = fZone; - + XQueryPointer(dpy, iconWin, &root_ret, &child_ret, &popo, &popo, &x, &y, &mask); /* mouse position */ - + do { if ((x >= curseur -> x) && (x <= curseur -> x + curseur -> width) && (y >= curseur -> y) && (y <= curseur -> y + curseur -> height)) return curseur -> no; } while ((curseur = curseur -> next)); - + return 0; } - + void GarbageCollector(_desc *garb) { _desc *next; - + while (garb) { next = garb -> next; free(garb); @@ -121,12 +121,12 @@ int CheckProc(pid_t pid) { glibtop_proclist bof; unsigned int *n; - + if ((n = glibtop_get_proclist (&bof, GLIBTOP_KERN_PROC_PID , (int64_t)pid)) == NULL) { glibtop_free(n); return -1; } - + glibtop_free(n); return 0; } @@ -140,43 +140,43 @@ _desc *GetProcList(void) /* create a double linked list */ _desc *lastOne; _desc *glump; _desc *res; - + if ((n = glibtop_get_proclist (&buf, GLIBTOP_KERN_PROC_UID, (int64_t)getuid())) == NULL) { fprintf(stderr, "Problem using libgtop\n"); exit(1); }; - + nbPr = (int)buf.number; - + glump = (_desc *)malloc(sizeof(_desc)); res = glump; lastOne = NULL; - + for (i = nbPr; i; i--){ char *bof; glibtop_proc_state buf; glump -> previous = lastOne; glump -> next = (_desc *)malloc(sizeof(_desc)); - + glibtop_get_proc_state(&buf, glump -> pid = n[i - 1]); strcpy(glump -> name, bof = buf.cmd); - if (strlen(glump -> name) > MAX_CHAR) + if (strlen(glump -> name) > MAX_CHAR) glump -> name[MAX_CHAR] = 0; - + lastOne = glump; glump = glump -> next; - + if (procBaseName && !strcmp(bof, procBaseName)) { procBasePos = i - 1; procBasePid = n[i - 1]; - break; + break; } } - + lastOne -> next = NULL; - lastProcPid = n[nbPr - 1]; + lastProcPid = n[nbPr - 1]; glibtop_free(n); - + if (procBaseName && i) gNbProc = nbPr - i + 1; /* procBase has been found */ else { /* procBaseName is null or hasn't been found */ procBaseName = NULL; @@ -184,9 +184,9 @@ _desc *GetProcList(void) /* create a double linked list */ procBasePid = n[0]; gNbProc = nbPr; } - + gNbProcTotal = nbPr; - + return res; } @@ -194,21 +194,21 @@ int CheckProcToRemove(unsigned int *procList, unsigned int procListSize) { _desc *curseur = pList, *temp; int nbProcRemoved = 0, i; - + while (curseur) { for (i = procListSize; i; i--) if (curseur -> pid == procList[i - 1]) break; - + temp = curseur; curseur = curseur -> next; - + if (!i) { /* we didn't find it in proclist, let's remove it */ - RemoveProc(temp); + RemoveProc(temp); gNbProc--; nbProcRemoved++; } } - + return nbProcRemoved; } @@ -217,73 +217,73 @@ int CheckProcToAdd(int pos, unsigned int *procList, unsigned int procListSize) _desc *glump; int i, compteur = 0; glibtop_proc_state buf; - + for (i = pos; i < procListSize ; i++){ - + compteur++; glump = (_desc *)malloc(sizeof(_desc)); usleep(20000); /* libgtop seems to need a little bit of time */ if (CheckProc(procList[i])) continue; /* checking if the process isn't already dead */ - + glibtop_get_proc_state(&buf, glump -> pid = procList[i]); strcpy(glump -> name, buf.cmd); - if (strlen(glump -> name) > MAX_CHAR) + if (strlen(glump -> name) > MAX_CHAR) glump -> name[MAX_CHAR] = 0; - + pList -> previous = glump; glump -> next = pList; glump -> previous = NULL; if (posProc == pList) posProc = glump; pList = glump; - gNbProc++; + gNbProc++; gNbProcTotal++; - + lastProcPid = glump -> pid; } return compteur; } - + int CheckProcChange(void) { glibtop_proclist buf; unsigned int *n; unsigned int nbPr; int diffNbProc; - + if ((n = glibtop_get_proclist (&buf, GLIBTOP_KERN_PROC_UID, (int64_t)getuid())) == NULL) return -1; nbPr = (int)buf.number; - + if ((nbPr == gNbProcTotal) && (n[nbPr - 1] == lastProcPid)) return 0; /* nothing changed */ - + if (procBaseName && (n[procBasePos] != procBasePid)) /* some proc killed before the baseproc (=oldest proc) */ - { + { if (CheckProc(procBasePid)) { /* baseproc doesn't exist anymore */ GarbageCollector(pList); pList = GetProcList(); /* so we create a whole new list */ posProc = pList; return 1; } - else + else while (n[--procBasePos] != procBasePid); /* here we find what's the new pos. of baseproc */ } - - + + diffNbProc = (nbPr - procBasePos) - gNbProc; /* nb of changes after baseproc */ - + if (diffNbProc == 0 && (n[nbPr - 1] == lastProcPid)){ /* only changes before baseproc */ gNbProcTotal = nbPr; glibtop_free(n); return 0; } - + if (diffNbProc > 0 && n[nbPr - diffNbProc - 1] == lastProcPid) /* only proc to add */ CheckProcToAdd(nbPr - diffNbProc, n, nbPr); - + else { /* to remove [and to add] */ int nb; nb = CheckProcToRemove(n, nbPr); - if (nb != -diffNbProc) + if (nb != -diffNbProc) CheckProcToAdd(nbPr - diffNbProc - 1, n, nbPr); } @@ -294,15 +294,15 @@ int CheckProcChange(void) void RemoveProc(_desc *cible) { _desc *temp1, *temp2; - + _desc *curseur; int i; - + temp1 = cible -> previous; temp2 = cible -> next; - - for (curseur = cible, i = 0; curseur && i != NB_LINE + 1; curseur = curseur -> next, ++i); - + + for (curseur = cible, i = 0; curseur && i != NB_LINE + 1; curseur = curseur -> next, ++i); + if (!(gNbProc - 1 < NB_LINE) && (i == 2 || i == 3)) { /* the killed proc is near the start of the list */ for (--i, curseur = posProc; i && curseur -> previous; curseur = curseur -> previous, --i); posProc = curseur; @@ -310,11 +310,11 @@ void RemoveProc(_desc *cible) else if ((cible == posProc) && (cible -> previous)) { posProc = cible -> previous; } - else if ((cible == posProc) && (cible -> next)) { + else if ((cible == posProc) && (cible -> next)) { posProc = cible -> next; } - - if (temp1) temp1 -> next = temp2; + + if (temp1) temp1 -> next = temp2; else { pList = temp2; temp2 -> previous = NULL; @@ -323,14 +323,14 @@ void RemoveProc(_desc *cible) free(cible); return; } - + if (temp2) temp2 -> previous = temp1; - else + else temp1 -> next = NULL; - + free(cible); gNbProcTotal--; - + } void ShowString (int x, int y, char *doudou) @@ -339,7 +339,7 @@ void ShowString (int x, int y, char *doudou) char c; while ((c = tolower(doudou[i++]))){ - if (c >= 'a' && c <= 'z') { + if (c >= 'a' && c <= 'z') { XCopyArea(dpy,XPM, win,gc, 1 + (c - 'a') * 6, 10, 5, 8, x, y) ; XCopyArea(dpy,XPM, iconWin,gc, 1 + (c - 'a') * 6, 10, 5, 8, x, y) ; x += 6; @@ -348,10 +348,10 @@ void ShowString (int x, int y, char *doudou) } void DoExp(){ - + XClearWindow(dpy, win); XClearWindow(dpy, iconWin); - + XCopyArea(dpy, XPM ,win, gc, 1 + (26) * 6, 10, 6, 8, 5, 51); XCopyArea(dpy, XPM, iconWin, gc, 1 + (26) * 6, 10, 6, 8, 5, 51); XCopyArea(dpy, XPM, win, gc, 1 + (27) * 6, 10, 6, 8, 53, 51); @@ -359,12 +359,12 @@ void DoExp(){ XCopyArea(dpy, XPM, win, gc, 106, 0, 28, 8, 17, 50); XCopyArea(dpy, XPM, iconWin, gc, 106, 0, 28, 8, 17, 50); - + DoExpose(); } void DoExpose() { - + int i; _desc *curseur; @@ -379,7 +379,7 @@ void DoExpose() { for (y = NB_LINE; y != gNbProc; y--) tabNoProc[y - 1] = -1; } else i = NB_LINE; - + for (curseur = posProc; i; curseur = curseur -> next, i--) { ShowString(X_PROC + 1, Y_PROC + (i - 1) * 10, curseur -> name); @@ -393,36 +393,36 @@ void DoClick(XEvent ev) static unsigned char firstClick = 0; _desc *curseur; char zone, i; - + zone = CheckZone(); - - if (ev.xbutton.button == CLICK_TWO) { + + if (ev.xbutton.button == CLICK_TWO) { DoExpose() ; } /* Mouse wheel patch by Mathieu Cuny */ - + if (ev.xbutton.button == WHEEL_UP && gNbProc > NB_LINE) { for (i = NB_LINE, curseur = posProc; i; curseur = curseur -> next, i--); if (curseur) posProc = posProc -> next; DoExpose(); } - + if (ev.xbutton.button == WHEEL_DOWN && posProc -> previous && gNbProc > NB_LINE) { posProc = posProc -> previous; DoExpose(); } - + /* Mouse wheel patch end */ - + if (ev.xbutton.button == CLICK_ONE) { - + struct timeval temp; long long nms1; - + gettimeofday(&temp, NULL); nms1 = temp.tv_sec - timev.tv_sec; /* nb sec since last click */ - + if ((!nms1 || nms1 == 1)){ long long yop = (nms1 * 1000000L) + (temp.tv_usec - timev.tv_usec); /* nb mlsec since last click */ if (firstClick && (yop < DOUBLE_CLICK_DELAY)){ /* we got double click */ @@ -430,62 +430,62 @@ void DoClick(XEvent ev) firstClick = 0; } else firstClick = 1; } else firstClick = 1; - + timev = temp; - + if (zone == UP && !doubleClick && gNbProc > NB_LINE) { for (i = NB_LINE, curseur = posProc; i; curseur = curseur -> next, i--); if (curseur) posProc = posProc -> next; DoExpose(); } - + else if (zone == DOWN && posProc -> previous && !doubleClick && gNbProc > NB_LINE) { posProc = posProc -> previous; DoExpose(); } - - else if (zone == UP && doubleClick && gNbProc > NB_LINE) + + else if (zone == UP && doubleClick && gNbProc > NB_LINE) { for (curseur = pList; curseur -> next; curseur = curseur -> next); /* curseur = end of list */ - + for (i = NB_LINE - 1; i; curseur = curseur -> previous, i--); posProc = curseur; DoExpose(); } - - else if (zone == DOWN && doubleClick && gNbProc > NB_LINE) + + else if (zone == DOWN && doubleClick && gNbProc > NB_LINE) { posProc = pList; DoExpose(); } - + else if (zone > 0 && zone <= NB_LINE && doubleClick && tabNoProc[zone - 1] != -1) { kill(tabNoProc[zone - 1], SIGKILL); /* let's kill the mofo */ waitpid(tabNoProc[zone - 1], NULL, 0); } - + if (doubleClick) doubleClick = 0; - + } } void DoEvents() { unsigned long long compteur = 0; - - XEvent ev ; + + XEvent ev ; for (;;){ if (!compteur){ if (CheckProcChange()) DoExpose(); compteur = UPDATE_NB * DELAY; } - while(XPending(dpy)){ - XNextEvent(dpy,&ev); + while(XPending(dpy)){ + XNextEvent(dpy,&ev); switch(ev.type) { case Expose : DoExp(); break; case ButtonPress : DoClick(ev); break; @@ -507,13 +507,13 @@ void PrintUsage(void) void GetArg(int argc, char *argv[]) { if (argc == 1) return; - + else if (argc == 3 && !strcmp(argv[1], "-n") && argv[2][0] != '-') procBaseName = strdup(argv[2]); - + else if (argc == 2 && !strcmp(argv[1], "-a")) procBaseName = NULL; - + else if (argc == 2 && !strcmp(argv[1], "-h")) { PrintUsage(); @@ -524,11 +524,11 @@ void GetArg(int argc, char *argv[]) exit(1); } } - + void CreateDock(int argc, char *argv[]) /* this part comes from http://www.linuxmag-france.org/ */ { Window root; - XWMHints wmHints; + XWMHints wmHints; XSizeHints sizeHints; XClassHint classHint; Pixmap pixmask; @@ -536,34 +536,34 @@ void CreateDock(int argc, char *argv[]) /* this part comes from http://www.li unsigned long p_noir; unsigned int borderWidth = 2; char *wname = argv[0] ; - + dpy = XOpenDisplay(NULL) ; - + if(dpy == NULL) { fprintf(stderr, "Can't open display\n") ; exit(1) ; } - + root = RootWindow(dpy,screen); p_blanc = WhitePixel(dpy,screen) ; p_noir = BlackPixel(dpy,screen) ; gc = XDefaultGC(dpy,screen) ; XSetForeground(dpy, gc, p_noir); XSetBackground(dpy, gc,p_noir); - + sizeHints.x = 0 ; sizeHints.y = 0 ; sizeHints.width = 64 ; sizeHints.height = 64 ; - + win = XCreateSimpleWindow(dpy,root,sizeHints.x,sizeHints.y , sizeHints.width, sizeHints.height, borderWidth, p_noir,p_noir) ; iconWin = XCreateSimpleWindow(dpy,root,sizeHints.x,sizeHints.y,sizeHints.width, sizeHints.height, borderWidth, p_noir,p_noir ) ; - + sizeHints.flags = USSize | USPosition ; XSetWMNormalHints(dpy,win,&sizeHints) ; wmHints.initial_state = WithdrawnState ; - wmHints.icon_window = iconWin ; + wmHints.icon_window = iconWin ; wmHints.icon_x = sizeHints.x ; wmHints.icon_y = sizeHints.y ; wmHints.window_group = win ; @@ -571,41 +571,41 @@ void CreateDock(int argc, char *argv[]) /* this part comes from http://www.li XSetWMHints(dpy, win, &wmHints) ; classHint.res_name = wname ; classHint.res_class = wname ; - + XSetClassHint(dpy, win, &classHint) ; XSetCommand(dpy,win, argv, argc) ; - + pixmask = XCreateBitmapFromData(dpy,win,fond_bits, fond_width, fond_height) ; XShapeCombineMask(dpy,win,ShapeBounding,0,0,pixmask,ShapeSet) ; XShapeCombineMask(dpy,iconWin,ShapeBounding, 0, 0, pixmask, ShapeSet) ; XpmCreatePixmapFromData(dpy,root,wmAppKill_xpm, &XPM, NULL,NULL) ; - + XSelectInput(dpy,win, ExposureMask | ButtonPressMask) ; XSelectInput(dpy,iconWin, ExposureMask | ButtonPressMask) ; - + XMapWindow(dpy,win) ; } int main(int argc, char *argv[]) { int i; - + GetArg(argc, argv); glibtop_init(); CreateDock(argc, argv); - gettimeofday(&timev, NULL); - - pList = GetProcList(); + gettimeofday(&timev, NULL); + + pList = GetProcList(); posProc = pList; - + ZoneCreate(4, 50, 8, 8, UP); ZoneCreate(54, 50, 8, 8, DOWN); - + for (i = NB_LINE; i; i--) ZoneCreate(X_PROC + 1, Y_PROC + (i - 1) * 10 + 2, 48, 7, i); - + DoEvents(); - + return 0; } - + diff --git a/wmappkill/wmAppKill.h b/wmappkill/wmAppKill.h index f5aa38c..186f108 100644 --- a/wmappkill/wmAppKill.h +++ b/wmappkill/wmAppKill.h @@ -1,4 +1,4 @@ -#define PROC_DEF "wmaker" +#define PROC_DEF "wmaker" #define MAX_CHAR 8 #define NB_LINE 4 diff --git a/wmcalc/readln.c b/wmcalc/readln.c index 23447e4..b9a9d10 100644 --- a/wmcalc/readln.c +++ b/wmcalc/readln.c @@ -1,6 +1,6 @@ /* readln.c - Edward H. Flora - [email protected] */ /* Last Modified: 2/24/98 */ -/* +/* * This function reads a string from a file pointed to by fp until a * new line (EOLN) or an end of file is encountered. It returns a pointer * to the string. The new line character is included in the string returned @@ -8,10 +8,10 @@ */ /* EXTERNALS: - ****************** + ****************** * Functions Called: * Standard Libraries. - * + * * Header Files Included: * Standard Includes only. */ @@ -34,7 +34,7 @@ char *readln(FILE *fp){ char *tmp, *t1, *t2; int count = 0, s1 = SIZE1; - + if((tmp = malloc(SIZE1*sizeof(char))) == NULL)return NULL; /* If cannot allocate memory */ if((t1 = fgets(tmp, SIZE1, fp)) == NULL){ diff --git a/wmcapshare/INSTALL b/wmcapshare/INSTALL index 6ceb706..1d9ce43 100644 --- a/wmcapshare/INSTALL +++ b/wmcapshare/INSTALL @@ -1,7 +1,7 @@ To Install wmcapshare just modify the Makefile to conform to your environment. And run make. make install. -wmcapshare depends on +wmcapshare depends on libdockapp 0.4 openobex 0.9.8 glib 1.2 diff --git a/wmcapshare/obex_io.c b/wmcapshare/obex_io.c index e9eb134..012ce1a 100644 --- a/wmcapshare/obex_io.c +++ b/wmcapshare/obex_io.c @@ -1,5 +1,5 @@ /********************************************************************* - * + * * Filename: obex_io.c * Version: 0.3 * Description: Some useful disk-IO functions @@ -10,24 +10,24 @@ * Modified by: Pontus Fuchs <[email protected]> * Modified at: Sun Oct 06 10:00:00 2001 * Modified by: Ben Moore <[email protected]> - * + * * Copyright (c) 1999 Dag Brattli, All Rights Reserved. - * - * 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 + * + * 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 (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA - * + * ********************************************************************/ #include <stdio.h> @@ -62,7 +62,7 @@ gint get_filesize(const char *filename) fh = CreateFile(filename, 0, 0, NULL, OPEN_EXISTING, 0, NULL); if(fh == INVALID_HANDLE_VALUE) { g_print("Cannot open %s\n", filename); - return -1; + return -1; } size = GetFileSize(fh, NULL); g_print("fize size was %d\n", size); @@ -99,13 +99,13 @@ guint8* easy_readfile(const char *filename, int *file_size) if (fd == -1) { return NULL; } - + if(! (buf = g_malloc(*file_size)) ) { return NULL; } actual = read(fd, buf, *file_size); - close(fd); + close(fd); #ifdef _WIN32 if(actual != *file_size) { @@ -139,7 +139,7 @@ obex_object_t *build_object_from_file(obex_t *handle, const char *filename) return NULL; /* Set Memopad as the default creator ID */ - creator_id = MEMO_PAD; + creator_id = MEMO_PAD; /* Find the . in the filename */ name = strchr(filename, '.'); @@ -231,7 +231,7 @@ gint safe_save_file(gchar *name, const guint8 *buf, gint len, gchar *savedir) perror( filename); return -1; } - + actual = write(fd, buf, len); close(fd); diff --git a/wmcapshare/obex_put_common.c b/wmcapshare/obex_put_common.c index e1eaf51..d050e2f 100644 --- a/wmcapshare/obex_put_common.c +++ b/wmcapshare/obex_put_common.c @@ -1,5 +1,5 @@ /********************************************************************* - * + * * Filename: obex_common.c * Version: 0.4 * Description: Utility-functions to act as a PUT server and client @@ -10,24 +10,24 @@ * Modified by: Pontus Fuchs <[email protected]> * Modified at: Sun Oct 06 10:00:00 2001 * Modified by: Ben Moore <[email protected]> - * + * * Copyright (c) 1999, 2000 Pontus Fuchs, All Rights Reserved. - * - * 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 + * + * 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 (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA - * + * ********************************************************************/ #include <stdio.h> @@ -62,7 +62,7 @@ void put_done(obex_object_t *object) gint body_len = 0; gchar *name = NULL; gchar *namebuf = NULL; - + while(OBEX_ObjectGetNextHeader(handle, object, &hi, &hv, &hlen)) { switch(hi) { case OBEX_HDR_BODY: @@ -83,7 +83,7 @@ void put_done(obex_object_t *object) case HEADER_CREATOR_ID: g_print("CREATORID = %#x\n", hv.bq4); break; - + default: g_print(G_GNUC_FUNCTION "() Skipped header %02x\n", hi); } diff --git a/wmcapshare/obex_put_common.h b/wmcapshare/obex_put_common.h index eb30408..b6e2416 100644 --- a/wmcapshare/obex_put_common.h +++ b/wmcapshare/obex_put_common.h @@ -1,31 +1,31 @@ /********************************************************************* - * + * * Filename: obex_put_common.h - * Version: - * Description: + * Version: + * Description: * Status: Experimental. * Author: Pontus Fuchs <[email protected]> * Created at: Sat Nov 20 10:54:14 1999 * Modified at: Sun Aug 13 09:23:57 PM CEST 2000 * Modified by: Pontus Fuchs <[email protected]> - * + * * Copyright (c) 1999, 2000 Pontus Fuchs, All Rights Reserved. - * - * 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 + * + * 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 (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA - * + * ********************************************************************/ #ifndef OBEX_PUT_COMMON_H diff --git a/wmcapshare/wmcapshare.c b/wmcapshare/wmcapshare.c index d862d47..8de0e19 100644 --- a/wmcapshare/wmcapshare.c +++ b/wmcapshare/wmcapshare.c @@ -1,5 +1,5 @@ /********************************************************************* - * + * * Filename: wmcapshare.c * Version: 0.1 * Description: Window Maker Dockapp to Control HP Capshare @@ -8,29 +8,29 @@ * Created at: Sun Oct 06 10:00:00 2001 * Modified at: Sun Oct 06 10:00:00 2001 * Modified by: Ben Moore <[email protected]> - * + * * Copyright (c) 2001 Ben Moore, All Rights Reserved. - * - * 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 + * + * 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 (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * - * + * * Start with --help to see available options * By default captured pages are put in /tmp - * + * ********************************************************************/ #include <stdio.h> @@ -99,7 +99,7 @@ static DAProgramOption options[] = { {"-d", "--dir", "Directory to save to", DOString, False, {&savedir}} } ; - + int charpos(char c) { @@ -115,7 +115,7 @@ int string2pixmap(char* str, Pixmap *p) { for (x = 0; x < strlen(str); x++) { XCopyArea(DADisplay, char_buf, *p, gc, charpos(str[x]),0, 6, 8, x*6, 0); } - + } void updateDisplay() { @@ -131,7 +131,7 @@ void updateDisplay() { case CAP_RECIEVE: /* recieve */ XCopyArea(DADisplay, plane_anim[planeanimpos], pixmap, gc, 0, 0, 60, 29, 0, 15); planeanimpos++; - if(planeanimpos==20) + if(planeanimpos==20) planeanimpos = 0; XCopyArea(DADisplay, connect_pic, pixmap, gc, 0, 0, 14, 15, 0, 45); string2pixmap("recieve", &tstatfld_buf); @@ -146,8 +146,8 @@ void updateDisplay() { DASetPixmap(pixmap); break; } - - + + } /* @@ -162,23 +162,23 @@ int main(int argc, char *argv[]) int ret; unsigned height,width; int i; - + DAParseArguments(argc, argv, options, sizeof(options)/sizeof(DAProgramOption), "CapShare Document Management Dock Applet\nBen Moore [email protected]\n", VERSION); - - + + DAInitialize(displayName, "wmcapshare", 60,60, argc, argv); DAMakePixmapFromData(lcdchars2_xpm, &char_buf, &char_mask, &height, &width); DAMakePixmapFromData(lcdnums_xpm, &num_buf, &num_mask, &height, &width); DAMakePixmapFromData(base_xpm, &pixmap, &mask, &height, &width); DAMakePixmapFromData(tstatfld_xpm, &tstatfld_buf, &tstatfld_mask, &height, &width); DAMakePixmapFromData(tstatfld_xpm, &blank_buf, &blank_mask, &height, &width); - DAMakePixmapFromData(capshare_xpm, &capshare_pic, &capshare_mask, &height, &width); - DAMakePixmapFromData(transfering_xpm, &transfer_pic, &transfer_mask, &height, &width); - DAMakePixmapFromData(connected_xpm, &connect_pic, &connect_mask, &height, &width); - DAMakePixmapFromData(disconnected_xpm, &disconnect_pic, &disconnect_mask, &height, &width); + DAMakePixmapFromData(capshare_xpm, &capshare_pic, &capshare_mask, &height, &width); + DAMakePixmapFromData(transfering_xpm, &transfer_pic, &transfer_mask, &height, &width); + DAMakePixmapFromData(connected_xpm, &connect_pic, &connect_mask, &height, &width); + DAMakePixmapFromData(disconnected_xpm, &disconnect_pic, &disconnect_mask, &height, &width); DAMakePixmapFromData( plane00_xpm, &plane_anim[0], &plane_animmask[1], &height, &width); DAMakePixmapFromData( plane01_xpm, &plane_anim[1], &plane_animmask[2], &height, &width); DAMakePixmapFromData( plane02_xpm, &plane_anim[2], &plane_animmask[3], &height, &width); @@ -199,11 +199,11 @@ int main(int argc, char *argv[]) DAMakePixmapFromData( plane17_xpm, &plane_anim[17], &plane_animmask[17], &height, &width); DAMakePixmapFromData( plane18_xpm, &plane_anim[18], &plane_animmask[18], &height, &width); DAMakePixmapFromData( plane19_xpm, &plane_anim[19], &plane_animmask[19], &height, &width); - + gc = DefaultGC(DADisplay, DefaultScreen(DADisplay)); - -/* + +/* string2pixmap("recieve", &tstatfld_buf); XCopyArea(DADisplay, plane_pic, pixmap, gc, 0, 0, 60, 29, 0, 15); XCopyArea(DADisplay, tstatfld_buf, pixmap, gc, 0, 0, 42, 8, 16, 48); @@ -211,23 +211,23 @@ int main(int argc, char *argv[]) XCopyArea(DADisplay, connect_pic, pixmap, gc, 0, 0, 14, 15, 0, 45); DASetPixmap(pixmap); */ - + XCopyArea(DADisplay, capshare_pic, pixmap, gc, 0, 0, 60, 29, 0, 15); - DAShow(); - + DAShow(); + while(1) { handle = OBEX_Init(OBEX_TRANS_IRDA, obex_event, 0); - + printf("Waiting for files\n"); OBEX_ServerRegister(handle, "OBEX"); - + while (!finished) { updateDisplay(); OBEX_HandleInput(handle, 1); } - + finished = FALSE; } - + return 0; } diff --git a/wmcdplay/ARTWORK b/wmcdplay/ARTWORK index 84bdfc6..9173f4a 100644 --- a/wmcdplay/ARTWORK +++ b/wmcdplay/ARTWORK @@ -113,7 +113,7 @@ symbols.xpm /* XPM */ static const char * symbols_xpm[] = { - + cdplayer.xpm ------------ This pixmap provides the basic background for wmcdplay @@ -194,7 +194,7 @@ What does each button do? A T L A O R T O A U A A P Y S C Y - P I E D + P I E D T E N D O R D G P K E diff --git a/wmcdplay/cdctl_freebsd.h b/wmcdplay/cdctl_freebsd.h index 0be07bc..1c07e40 100644 --- a/wmcdplay/cdctl_freebsd.h +++ b/wmcdplay/cdctl_freebsd.h @@ -310,7 +310,7 @@ private: cd_trklist=(struct CDTrack *)malloc(cd_tracks*sizeof(struct CDTrack)); #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) struct ioc_read_toc_entry te; - + te.data_len = (cd_tracks + 1) * sizeof(struct cd_toc_entry); te.data = (struct cd_toc_entry *)malloc(te.data_len); te.address_format = CD_LBA_FORMAT; @@ -327,7 +327,7 @@ private: #else struct cdrom_tocentry te; int prev_addr=0; - + for(int i=0;i<=cd_tracks;i++){ if(i==cd_tracks) te.cdte_track=CDROM_LEADOUT; diff --git a/wmcdplay/wmcdplay.cc b/wmcdplay/wmcdplay.cc index 8057142..46ae03a 100644 --- a/wmcdplay/wmcdplay.cc +++ b/wmcdplay/wmcdplay.cc @@ -99,7 +99,7 @@ GC gc_gc, gc_bitgc; unsigned long color[4]; -// Misc custom global variables +// Misc custom global variables // ---------------------------- // For artwork loading @@ -513,7 +513,7 @@ void pressEvent(XButtonEvent *xev){ } if(btn==-1){ if(art_showled[3]){ - if(x>=art_ledpos[3][0] && y>=art_ledpos[3][1] && x<=art_ledpos[3][0]+art_ledsize[4] && y<=art_ledpos[3][1]+art_ledsize[5]){ + if(x>=art_ledpos[3][0] && y>=art_ledpos[3][1] && x<=art_ledpos[3][0]+art_ledsize[4] && y<=art_ledpos[3][1]+art_ledsize[5]){ int tsels[] = { tsNone, tsNext, tsRepeat, tsRepeatCD, tsRandom }; tsel++; if(tsel>=5) @@ -525,7 +525,7 @@ void pressEvent(XButtonEvent *xev){ } } if(art_showled[0]){ - if(x>=art_ledpos[0][0] && y>=art_ledpos[0][1] && x<=art_ledpos[0][0]+(art_ledsize[0]+1)*9-1 && y<=art_ledpos[0][1]+art_ledsize[1]){ + if(x>=art_ledpos[0][0] && y>=art_ledpos[0][1] && x<=art_ledpos[0][0]+(art_ledsize[0]+1)*9-1 && y<=art_ledpos[0][1]+art_ledsize[1]){ tdisplay++; if(tdisplay>=2) tdisplay=0; diff --git a/wmcpufreq/Makefile b/wmcpufreq/Makefile index 9fa2868..8cb62ce 100644 --- a/wmcpufreq/Makefile +++ b/wmcpufreq/Makefile @@ -1,16 +1,16 @@ # PACK=wmcpufreq-3.0 -all: +all: cd wmcpufreq ; $(MAKE) $@ - + clean: cd wmcpufreq ; $(MAKE) $@ - + install: cd wmcpufreq ; $(MAKE) $@ - -package: + +package: tar -cvzf $(PACK).tar.gz ../$(PACK)/* diff --git a/wmcpufreq/README b/wmcpufreq/README index ff34deb..e350434 100644 --- a/wmcpufreq/README +++ b/wmcpufreq/README @@ -3,22 +3,22 @@ wmcpufreq 2.0 for single core cpu same behavior as wmcpufreq 1.0 for multi core cpu shows - - the frequency in use between the maximum and minimum of cpu0 + - the frequency in use between the maximum and minimum of cpu0 - the frequency in use between the maximum and minimum of cpu1 - the active governor in red for cpu0 on amd x2 3800 rev e4 both cpu has the same governor, freuency, -maximum and minimum freqyency. +maximum and minimum freqyency. -wmcpufreq 3.0 +wmcpufreq 3.0 *************** if 1 cpu wmcpufreq displays on a windowmaker dock application - - the frequency in use between the maximum and minimum + - the frequency in use between the maximum and minimum - the driver in green - - the active governor in red - + - the active governor in red + if >=2cpu wmcpufreq displays on a windowmaker dock application - the frequency in use between the maximum and minimum - the active governor in red diff --git a/wmcpufreq/wmcpufreq/wmcpufreq.c b/wmcpufreq/wmcpufreq/wmcpufreq.c index 4be5d3d..70d283a 100644 --- a/wmcpufreq/wmcpufreq/wmcpufreq.c +++ b/wmcpufreq/wmcpufreq/wmcpufreq.c @@ -1,12 +1,12 @@ -/*************************************************************************/ +/*************************************************************************/ /* piece of code and pixmaps from */ /* */ -/* wmspeedfreq ( Tom Kistner ) */ +/* wmspeedfreq ( Tom Kistner ) */ /* wmppp ( Martijn Pieterse, Antoine Nulle ) */ /* wmapkill (S.Rozange */ /* */ -/* This program is free software; you can redistribute it and/or modify */ +/* 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, or (at your option) */ /* any later version. */ @@ -20,11 +20,11 @@ /* along with this program (see the file COPYING); if not, write to the */ /* Free Software Foundation, Inc., 59 Temple Place - Suite 330, */ /* Boston, MA 02111-1307, USA */ -/* */ +/* */ /* you need libcpufreq for the libarary */ /* and libcpufreq-dev for cpufreq.h */ -/* */ -/* */ +/* */ +/* */ /*************************************************************************/ #include <stdio.h> #include <unistd.h> @@ -43,7 +43,7 @@ #include "wmcpufreq_mask_2.xbm" #include "wmcpufreq_mask_3.xbm" -#define DELAY 200000000 /*nano second */ +#define DELAY 200000000 /*nano second */ #define WMCPUFREQ_VERSION "VERSION 3.0 2009/05/14 \n" #define LN_PATH 40 #define MAX_CPU 4 @@ -57,7 +57,7 @@ static unsigned char *wm_bits; struct cpufreq_policy *policy; int cpu=0; unsigned long min,max,f_min,f_max; -int main(int argc, char *argv[]) +int main(int argc, char *argv[]) { struct timespec ts,ts1; int i,ncpu; @@ -76,7 +76,7 @@ int main(int argc, char *argv[]) freq[i]=0; if(argc >1) { - for (i=1; i<=argc; i++) + for (i=1; i<=argc; i++) { if (!strcmp(argv[i], "-v")) { @@ -93,7 +93,7 @@ int main(int argc, char *argv[]) { if(strlen(argv[i+1]) < LN_PATH ) idcpu=strtol(argv[i+1],&endptr,0); - printf("cpuid= %d \n",idcpu); + printf("cpuid= %d \n",idcpu); break; } printf("only -v, -exe, -cpuid supported \n"); @@ -120,7 +120,7 @@ int main(int argc, char *argv[]) /* get number of cpu (0=cpu0, 1=cpu1 ...) */ - + ncpu=-1; for(i=0;i<MAX_CPU;i++) @@ -168,11 +168,11 @@ int main(int argc, char *argv[]) wm_xpm, (char*)wm_bits, wmcpufreq_mask_width, - wmcpufreq_mask_height); - while(1) - { + wmcpufreq_mask_height); + while(1) + { /* Process any pending X events */ - while(XPending(display)) + while(XPending(display)) { XNextEvent(display, &event); switch(event.type) @@ -214,7 +214,7 @@ void show_driver( char *pt) a=(int)pt[i]; c=show_char(a); copyXPMArea(6+(6*c),64,6,9, 7+(6*i), 34); - } + } RedrawWindow(); return; } @@ -226,11 +226,11 @@ void show_governor(char *ptr) a=(int)ptr[i]; c=show_char(a); copyXPMArea(6+(6*c),78,6,9, 7+(6*i), 49); - } + } RedrawWindow(); return; } -void show_mhz(unsigned long *kHz,int nu) +void show_mhz(unsigned long *kHz,int nu) { int i,j,delta=0,ddelta=0,odelta=0; char buffer[5]; @@ -238,14 +238,14 @@ void show_mhz(unsigned long *kHz,int nu) switch (nu) { case 0: snprintf(buffer, 5, "%4ld", (kHz[0] / 1000)); - for (i=0;i<4;i++) + for (i=0;i<4;i++) { - if (buffer[i] == ' ') + if (buffer[i] == ' ') { /* blank zero */ copyXPMArea(75, 93, 6, 9, 7+(7*i), 7); } - else + else { /* a standard digit */ copyXPMArea(((buffer[i]-48)*7)+5,93, 6, 9, 7+(7*i), 7); @@ -256,22 +256,22 @@ void show_mhz(unsigned long *kHz,int nu) // // l,h // // dest x,y copyXPMArea(65, 40, ((kHz[0] - f_min) / ((f_max - f_min) / 49)), 9, 7, 18); - RedrawWindow(); + RedrawWindow(); } break; case 1: for(j=0;j<=nu;j++) { snprintf(buffer, 5, "%4ld", (kHz[j] / 1000)); - - for (i=0;i<4;i++) + + for (i=0;i<4;i++) { - if (buffer[i] == ' ') + if (buffer[i] == ' ') { /* blank zero */ copyXPMArea(75, 93, 6, 9, 7+(7*i), 7+delta); } - else + else { /* a standard digit */ copyXPMArea(((buffer[i]-48)*7)+5, 93, 6, 9, 7+(7*i), 7+delta); @@ -280,7 +280,7 @@ void show_mhz(unsigned long *kHz,int nu) /* update speed bar */ copyXPMArea(65, 18, 49, 4, 7, 18+delta); copyXPMArea(65, 40, ((kHz[j] - f_min) / ((f_max - f_min) / 49)), 4, 7, 18+delta); - + RedrawWindow(); delta=19; } @@ -293,15 +293,15 @@ void show_mhz(unsigned long *kHz,int nu) for(j=0;j<4;j++) { snprintf(buffer, 5, "%4ld", (kHz[j] / 1000)); - - for (i=0;i<4;i++) + + for (i=0;i<4;i++) { - if (buffer[i] == ' ') + if (buffer[i] == ' ') { /* blank zero */ copyXPMArea(126,6+odelta*j ,6,7, 6+(6*i),5+ddelta*j); } - else + else { /* a standard digit */ copyXPMArea(((buffer[i]-48)*6)+66,6+odelta*j, 6,7, 6+(6*i), 5+ddelta*j); @@ -311,7 +311,7 @@ void show_mhz(unsigned long *kHz,int nu) copyXPMArea(31,67,24,7,34,5+ddelta*j); /* update spped bar */ if( !(nu==2 && j==3) ) /* 3 cpu 4 bar nul */ - copyXPMArea(6,67 , ((kHz[j] - f_min) / ((f_max - f_min) / 24)),7, 34,5+ddelta*j); + copyXPMArea(6,67 , ((kHz[j] - f_min) / ((f_max - f_min) / 24)),7, 34,5+ddelta*j); RedrawWindow(); } break; diff --git a/wmcpufreq/wmcpufreq/xy.txt b/wmcpufreq/wmcpufreq/xy.txt index c05d379..261b345 100644 --- a/wmcpufreq/wmcpufreq/xy.txt +++ b/wmcpufreq/wmcpufreq/xy.txt @@ -1,6 +1,6 @@ - aff_d.xy aff_src.xy bar_d.xy bar_src.xy bar blanc + aff_d.xy aff_src.xy bar_d.xy bar_src.xy bar blanc cpu0 7,5 65,5 34,5 6,67 24,7 126,6 - + cpu1 7,15 65,19 34,15 6,67 24,7 126,20 cpu2 7,25 65,33 34,25 6,67 24,7 126,34 diff --git a/wmfortune/dockapp.c b/wmfortune/dockapp.c index 59850df..4aeeef4 100644 --- a/wmfortune/dockapp.c +++ b/wmfortune/dockapp.c @@ -1,7 +1,7 @@ /* - * + * * Copyright (c) 1999 Alfredo K. Kojima - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights @@ -18,7 +18,7 @@ * AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * */ @@ -104,7 +104,7 @@ iswmaker(Display *dpy) XFree(data); - win = (Window*)PropGetCheckProperty(dpy, DefaultRootWindow(dpy), + win = (Window*)PropGetCheckProperty(dpy, DefaultRootWindow(dpy), noticeboard, XA_WINDOW, 32, -1, &count); @@ -140,12 +140,12 @@ DAInitialize(char *display, char *name, unsigned width, unsigned height, d_width = width; d_height = height; - + progName = argv[0]; DADisplay = XOpenDisplay(display); if (!DADisplay) { - printf("%s: could not open display %s!\n", progName, + printf("%s: could not open display %s!\n", progName, XDisplayName(display)); exit(1); @@ -238,7 +238,7 @@ DAMakePixmapFromData(char **data, Pixmap *pixmap, Pixmap *mask, xpmat.valuemask = XpmCloseness; xpmat.closeness = 40000; - if (XpmCreatePixmapFromData(DADisplay, DAWindow, data, pixmap, mask, + if (XpmCreatePixmapFromData(DADisplay, DAWindow, data, pixmap, mask, &xpmat)!=0) { return False; } @@ -312,7 +312,7 @@ DAProcessEvent(XEvent *event) case MotionNotify: if (d_callbacks.motion) { - (*d_callbacks.motion)(event->xbutton.x, event->xbutton.y); + (*d_callbacks.motion)(event->xbutton.x, event->xbutton.y); } break; @@ -358,9 +358,9 @@ DAEventLoop() static DAProgramOption defaultOptions[]= { - {"-h", "--help", "shows this help text and exit", DONone, False, + {"-h", "--help", "shows this help text and exit", DONone, False, {NULL}}, - {"-v", "--version", "shows program version and exit", DONone, False, + {"-v", "--version", "shows program version and exit", DONone, False, {NULL}} }; @@ -428,7 +428,7 @@ DAParseArguments(int argc, char **argv, DAProgramOption *options, for (i = 1; i < argc; i++) { if (strcmp(argv[i], "-h")==0 || strcmp(argv[i], "--help")==0) { - + printHelp(argv[0], programDescription, options, count); exit(0); @@ -512,7 +512,7 @@ DAGetColor(char *colorName) { XColor color; - if (!XParseColor(DADisplay, + if (!XParseColor(DADisplay, DefaultColormap(DADisplay, DefaultScreen(DADisplay)), colorName, &color)) { printf("%s: could not parse color %s\n", progName, colorName); @@ -529,7 +529,7 @@ DAGetColor(char *colorName) } -void +void DASetTimeout(int milliseconds) { d_timeout = milliseconds; @@ -555,7 +555,7 @@ DANextEventOrTimeout(XEvent *event, unsigned long millisec) FD_ZERO(&rset); FD_SET(ConnectionNumber(DADisplay), &rset); - if (select(ConnectionNumber(DADisplay)+1, &rset, NULL, NULL, + if (select(ConnectionNumber(DADisplay)+1, &rset, NULL, NULL, &timeout) > 0) { XNextEvent(DADisplay, event); return True; diff --git a/wmfortune/dockapp.h b/wmfortune/dockapp.h index e8e313c..b95330a 100644 --- a/wmfortune/dockapp.h +++ b/wmfortune/dockapp.h @@ -1,7 +1,7 @@ /* - * + * * Copyright (c) 1999 Alfredo K. Kojima - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights @@ -18,7 +18,7 @@ * AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * */ #ifndef _DOCKAPP_H_ @@ -26,9 +26,9 @@ /* - * This is a simple (trivial) library for writing Window Maker dock + * This is a simple (trivial) library for writing Window Maker dock * applications, or dockapps (those that only show up in the dock), easily. - * + * * It is very limited and can be only used for dockapps that open a single * appicon for process in only one single display, but this seems to be * enough for most, if not all, dockapps. @@ -87,7 +87,7 @@ typedef struct { short type; /* type of argument */ - Bool used; /* if the argument was passed in the + Bool used; /* if the argument was passed in the cmd line */ /* the following are only set if the "used" field is True */ union { /* a ptr for the value that was passed @@ -109,7 +109,7 @@ typedef struct { * * -h, --help and --version are automatically handled (causing the program * to exit) - * + * */ void DAParseArguments(int argc, char **argv, DAProgramOption *options, int count, char *programDescription, @@ -131,7 +131,7 @@ void DAParseArguments(int argc, char **argv, DAProgramOption *options, * default value * name - the name of your dockapp, used as the class name for * the WM_CLASS hint. Like WMYAClock - * width, height - the size of the dockapp window. 48x48 is the + * width, height - the size of the dockapp window. 48x48 is the * preferred size * argc, argv - the program arguments. argv[0] will be used as the * instance name for the WM_CLASS hint. @@ -140,7 +140,7 @@ void DAInitialize(char *display, char *name, unsigned width, unsigned height, int argc, char **argv); /* - * DASetShape- + * DASetShape- * Sets the shape mask of the dockapp to the specified one. This is * optional. If you pass None as shapeMask, the dockapp will become * non-shaped. @@ -187,7 +187,7 @@ void DAShow(); /* * DASetCallbacks- * Register a set of callbacks for events like mouse clicks. - * + * * Only needed if you want to receive some event. */ void DASetCallbacks(DACallbacks *callbacks); @@ -213,7 +213,7 @@ Bool DANextEventOrTimeout(XEvent *event, unsigned long millisec); * DAProcessEvent- * Processes an event. Returns True if the event was handled and * False otherwise. - * + * * Must be called from your event loop, unless you use DAEventLoop() */ Bool DAProcessEvent(XEvent *event); diff --git a/wmfortune/wmfortune.c b/wmfortune/wmfortune.c index 2f00601..83f0b4f 100644 --- a/wmfortune/wmfortune.c +++ b/wmfortune/wmfortune.c @@ -67,7 +67,7 @@ GC gc; int c; char buff[BUFF_SIZE]; -/* +/* * i: used to count the number of letters in fill_buff(). * j: the number that points the message starting pixel. */ @@ -120,7 +120,7 @@ buttonReleaseCallback (int button, int state, int x, int y) x < (BUTTON_X + BUTTON_WIDTH) && BUTTON_Y < y && y < (BUTTON_Y + BUTTON_HEIGHT)) { - fill_buff(); + fill_buff(); } XCopyArea(DADisplay, panel_pixmap, pixmap, gc, BUTTON_X, BUTTON_Y, BUTTON_WIDTH, BUTTON_HEIGHT, @@ -149,16 +149,16 @@ main(int argc, char **argv) DACallbacks callbacks = {NULL,buttonPressCallback ,buttonReleaseCallback,NULL,NULL,NULL,NULL}; - + DAParseArguments(argc, argv, options, sizeof(options)/sizeof(DAProgramOption), "dockapp that shows the messages from fortune command.", "$Id: wmfortune.c,v 0.24 2000/03/28 01:49:58 sugano Exp $"); - fill_buff(); + fill_buff(); - DAInitialize(displayName, "wmfortune", 64, 64, argc, argv); + DAInitialize(displayName, "wmfortune", 64, 64, argc, argv); pixmap = DAMakePixmap(); - + /* making pixmap for the panel */ DAMakePixmapFromData(panel_xpm, &panel_pixmap, &panel_mask, &w, &h); @@ -181,24 +181,24 @@ main(int argc, char **argv) XCopyArea(DADisplay, panel_pixmap, pixmap, gc, BUTTON_X, BUTTON_Y, BUTTON_WIDTH, BUTTON_HEIGHT, BUTTON_X, BUTTON_Y); - + while (1) { XEvent ev; - + /* sets the foreground color green */ XSetForeground(DADisplay, gc, DAGetColor("green")); XCopyArea(DADisplay, panel_window_pixmap, pixmap, gc, WINDOW_X, WINDOW_Y, WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_X, WINDOW_Y); XDrawString(DADisplay, pixmap, gc, j, STRING_Y, buff, strlen(buff)); - + DASetPixmap(pixmap); /* scroll the message by a pixel to left */ i--; j = i + MESSAGE_LAG; - + /* * starts scrolling the messages from the beginning * if the message ends. diff --git a/wmget/NEWS b/wmget/NEWS index 90e24b8..63b3174 100644 --- a/wmget/NEWS +++ b/wmget/NEWS @@ -109,7 +109,7 @@ wmget 0.2.0 - Rewrite of the client/server ipc. Renaming. Also, with this version, I renamed it from ``wmcurl'' to ``wmget''. The old name was sorta a poor choice: while I still rely on, and want - to give full credit to, the cURL guys, the name ``wmcurl'' is + to give full credit to, the cURL guys, the name ``wmcurl'' is not very intuitive. Plus I didn't want people thinking it was part of the cURL project proper. Plus this saves me a keystroke when typing it :) diff --git a/wmget/configure.c b/wmget/configure.c index d271e00..73b44a3 100644 --- a/wmget/configure.c +++ b/wmget/configure.c @@ -351,7 +351,7 @@ static void read_rcfile (FILE *rcfp, ServerConfig *cfg) # undef O # undef ARG_yes # undef ARG_no - + error ("Unknown keyword in config file: %s", name); } } diff --git a/wmget/dockapp/Makefile b/wmget/dockapp/Makefile index 35af235..068433c 100644 --- a/wmget/dockapp/Makefile +++ b/wmget/dockapp/Makefile @@ -1,15 +1,15 @@ # Copyright (c) 2001-2003 Aaron Trickey <[email protected]> -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -30,6 +30,6 @@ dockapp.a: $(DAOBJS) unittest: unittest.o $(DAOBJS) -clean: +clean: rm -f unittest.o unittest dockapp.a $(DAOBJS) diff --git a/wmget/dockapp/da_run.c b/wmget/dockapp/da_run.c index 3c032ac..a0ff6b2 100644 --- a/wmget/dockapp/da_run.c +++ b/wmget/dockapp/da_run.c @@ -60,7 +60,7 @@ enum { static struct pollfd da_pollfds[da_max_pollfds]; static da_pollcb da_pollcbs[da_max_pollfds]; static int da_num_pollfds = 0; - + dockapp_rv_t dockapp_add_pollfd ( int fd, @@ -158,7 +158,7 @@ static long da_timer_msec_remaining (void) { struct timeval right_now; int rv; - + rv = gettimeofday (&right_now, 0); return diff --git a/wmget/dockapp/da_x.c b/wmget/dockapp/da_x.c index 7102e89..a4a6936 100644 --- a/wmget/dockapp/da_x.c +++ b/wmget/dockapp/da_x.c @@ -120,7 +120,7 @@ static dockapp_rv_t da_receive_selection (XEvent *event) rv = da_selection_cb (da_selection_cbdata, (const char *)data); - + XFree (data); return rv; diff --git a/wmget/server.c b/wmget/server.c index eddb386..f71ce8c 100644 --- a/wmget/server.c +++ b/wmget/server.c @@ -286,7 +286,7 @@ static int start_job (Job *j) j->status = J_EMPTY; exit (0); - } + } return 0; } @@ -883,7 +883,7 @@ static void process_request (FILE *fp) client_error (fp, "Argument missing closing )"); return; } - + *arg++ = 0; arg += strspn (arg, " \t"); diff --git a/wmget/wmget.1.in b/wmget/wmget.1.in index 1e7860f..3bae4a5 100644 --- a/wmget/wmget.1.in +++ b/wmget/wmget.1.in @@ -52,7 +52,7 @@ If you are running AfterStep, you can add it to your Wharf by adding the followi .nf *Wharf wmget \- Swallow "wmget" wmget dock & - + .fi .PP diff --git a/wmget/wmget.h b/wmget/wmget.h index f2f3381..d71d18c 100644 --- a/wmget/wmget.h +++ b/wmget/wmget.h @@ -42,7 +42,7 @@ #define WMGET_COPYRIGHT "Copyright (c) 2001-2003 " \ "Aaron Trickey <[email protected]>" \ "; ABSOLUTELY NO WARRANTY" - + #define DEFAULT_USER_AGENT \ "wmget/" WMGET_VERSION " (libcurl/" LIBCURL_VERSION ")" diff --git a/wmgrabimage/CHANGES b/wmgrabimage/CHANGES index ecaa95a..7c873d8 100644 --- a/wmgrabimage/CHANGES +++ b/wmgrabimage/CHANGES @@ -32,7 +32,7 @@ Version 0.61 - February 2, 1999. Version 0.6 - February 2, 1999. Some bug fixes. Added Double click support. Now, DoubleClick's do the following: - + Button1: display original size image via xv. Button2: send another URL (specified with the -http diff --git a/wmgrabimage/HINTS b/wmgrabimage/HINTS index dcdf40d..0c482e8 100644 --- a/wmgrabimage/HINTS +++ b/wmgrabimage/HINTS @@ -8,7 +8,7 @@ usage: wmGrabImage [-h] [-display <display>] -url <URL> -d <display> Use alternate display. -h Display help screen. - -url <URL> This option tells wmGrabImage + -url <URL> This option tells wmGrabImage which WWW image to monitor. @@ -27,7 +27,7 @@ Afterstep users put the following in their .steprc Note: AfterStep's Wharf has a problem with pixmaps that are larger than 60x60 pixels. Please tell the AfterStep authors to fix this, this is not our fault, but a Wharf problem! - + Other window managers. ---------------------- diff --git a/wmgrabimage/INSTALL b/wmgrabimage/INSTALL index 30f7dec..3e18907 100644 --- a/wmgrabimage/INSTALL +++ b/wmgrabimage/INSTALL @@ -17,8 +17,8 @@ Installation 1) gunzip wmGrabImage-1.0.tar.gz 1) tar -xvf wmGrabImage-1.0.tar 2) cd wmGrabImage-1.0/wmGrabImage/ -3) make -4) make install (must be root) +3) make +4) make install (must be root) 5) wmGrabImage & (or 'wmGrabImage -h' for help, or 'man wmGrabImage' for the man page) 6) You need to set the location of perl correctly in GrabImage if your perl is located in a place other than /usr/bin/ diff --git a/wmgrabimage/TODO b/wmgrabimage/TODO index 23c0b04..5e44a93 100644 --- a/wmgrabimage/TODO +++ b/wmgrabimage/TODO @@ -2,7 +2,7 @@ For version 0.80 ---------------- Allow user to specify command line options for imagemagick convert routine. This way, we immediatley buy into the impreesive cabablities -of convert. (E.g. limit colors,filtering, blurring, sharpening, annotating +of convert. (E.g. limit colors,filtering, blurring, sharpening, annotating and so on....). For version 0.90 diff --git a/wmgrabimage/wmGrabImage/Makefile b/wmgrabimage/wmGrabImage/Makefile index d4ef5a5..030fd40 100644 --- a/wmgrabimage/wmGrabImage/Makefile +++ b/wmgrabimage/wmGrabImage/Makefile @@ -18,7 +18,7 @@ OBJS = wmGrabImage.o \ all: wmGrabImage.o wmGrabImage wmGrabImage.o: wmGrabImage_master.xpm wmGrabImage_mask.xbm -wmGrabImage: $(OBJS) +wmGrabImage: $(OBJS) $(CC) $(CFLAGS) $(SYSTEM) -o wmGrabImage $^ $(INCDIR) $(LIBDIR) $(LIBS) clean: @@ -30,5 +30,5 @@ clean: install:: wmGrabImage install -s -m 0755 wmGrabImage $(DESTDIR)/bin install -m 0755 GrabImage $(DESTDIR)/bin - install -m 0644 wmGrabImage.1 $(DESTDIR)/man/man1 + install -m 0644 wmGrabImage.1 $(DESTDIR)/man/man1 diff --git a/wmgrabimage/wmGrabImage/wmGrabImage.1 b/wmgrabimage/wmGrabImage/wmGrabImage.1 index e8d53e7..1fde47d 100644 --- a/wmgrabimage/wmGrabImage/wmGrabImage.1 +++ b/wmgrabimage/wmGrabImage/wmGrabImage.1 @@ -1,4 +1,4 @@ -.TH WMGRABIMGAE 1 "16 December 1998" +.TH WMGRABIMGAE 1 "16 December 1998" .SH NAME WMGRABIMGAE \- Dockable WWW Image monitor. .SH SYNOPSIS @@ -39,7 +39,7 @@ The URL of the WWW image to monitor. The URL to send to netscape via a Middle double click. .TP .B \-c -Center the image vertically within the icon. +Center the image vertically within the icon. .TP .B \-delay <Time> The time between updates. The default is about 5 minutes. diff --git a/wmgrabimage/wmGrabImage/wmGrabImage.c b/wmgrabimage/wmGrabImage/wmGrabImage.c index 01afe8a..072fdfc 100644 --- a/wmgrabimage/wmGrabImage/wmGrabImage.c +++ b/wmgrabimage/wmGrabImage/wmGrabImage.c @@ -1,11 +1,11 @@ /* * * wmGrabImage-1.00 (C) 1999 Mike Henderson ([email protected]) - * + * * - Monitors an image on the WWW in a WindowMaker DockApp - * - * - * + * + * + * * * 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 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program (see the file COPYING); if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA * * @@ -41,8 +41,8 @@ * Fixed resource leak (XFreeColors) * * Version 0.71 - May 24, 2001 - * Added support for "zooming" the icon display - * on a region + * Added support for "zooming" the icon display + * on a region * * Version 0.70 - March 28, 1999. * Added support for local images (e.g. file:///home/mgh/junk.gif.) @@ -57,7 +57,7 @@ * Added command-line option for "Time between updates" * * Version 0.63 - February 9, 1999. - * Fixed (potential) memory leak in the ShapeMask Pixmap + * Fixed (potential) memory leak in the ShapeMask Pixmap * (gets returned only if color None is used in xpm file) * Added XFreeColors call. * @@ -79,7 +79,7 @@ * * Button2: send another URL (specified with the -http * command line option) to netscape. - * + * * Button3: Force Update. * * @@ -92,8 +92,8 @@ -/* - * Includes +/* + * Includes */ #include <stdio.h> #include <unistd.h> @@ -111,8 +111,8 @@ -/* - * Delay between refreshes (in microseconds) +/* + * Delay between refreshes (in microseconds) */ #define DELAY 10000L #define WMGRABIMAGE_VERSION "0.72" @@ -143,8 +143,8 @@ long int UpdateDELAY = 600; -/* - * main +/* + * main */ int main(int argc, char *argv[]) { @@ -171,12 +171,12 @@ int havePixmap= 0; - + /* * Parse any command line arguments. */ ParseCMDLine(argc, argv); - + /* * Figure out what the name of the image xpm file should be... @@ -187,13 +187,13 @@ int havePixmap= 0; sprintf(XpmFileName, "%s/.wmGrabImage/%s.xpm", getenv("HOME"), ImageName); sprintf(ImageFileName, "%s/.wmGrabImage/%s", getenv("HOME"), ImageName); - + openXwindow(argc, argv, wmGrabImage_master, wmGrabImage_mask_bits, wmGrabImage_mask_width, wmGrabImage_mask_height); cmap = DefaultColormap(display, DefaultScreen(display)); - + /* * Loop until we die */ @@ -218,19 +218,19 @@ int havePixmap= 0; * Keep track of # of seconds */ if (m > 100){ - + m = 0; ++dt1; ++dt2; ++dt3; - + } else { - + /* * Increment counter */ ++m; - + } @@ -242,12 +242,12 @@ int havePixmap= 0; * Double Click Delays * Keep track of click events. If Delay too long, set GotFirstClick's to False. */ - if (DblClkDelay > 15) { + if (DblClkDelay > 15) { - DblClkDelay = 0; - GotFirstClick1 = 0; GotDoubleClick1 = 0; - GotFirstClick2 = 0; GotDoubleClick2 = 0; - GotFirstClick3 = 0; GotDoubleClick3 = 0; + DblClkDelay = 0; + GotFirstClick1 = 0; GotDoubleClick1 = 0; + GotFirstClick2 = 0; GotDoubleClick2 = 0; + GotFirstClick3 = 0; GotDoubleClick3 = 0; } else { @@ -268,7 +268,7 @@ int havePixmap= 0; - /* + /* * Process any pending X events. */ while(XPending(display)){ @@ -293,14 +293,14 @@ int havePixmap= 0; - + /* * Draw window. */ if (ForceUpdate||Flag){ - + /* @@ -326,11 +326,11 @@ int havePixmap= 0; if (havePixmap) { - /* - * free up the colors, if we alloc'd some before + /* + * free up the colors, if we alloc'd some before */ - if (Attributes.nalloc_pixels > 0) - XFreeColors(display, cmap, Attributes.alloc_pixels, + if (Attributes.nalloc_pixels > 0) + XFreeColors(display, cmap, Attributes.alloc_pixels, Attributes.nalloc_pixels, 0); /* * Free last pixmap -- we dont need it anymore... @@ -338,7 +338,7 @@ int havePixmap= 0; * We could probably change Transparent to None to make use of this, but for now, * lets just ignore it... */ - if ( NewShapeMask != 0 ) + if ( NewShapeMask != 0 ) XFreePixmap(display, NewShapeMask); XFreePixmap(display, NewPixmap); @@ -440,8 +440,8 @@ int havePixmap= 0; - /* - * Wait for next update + /* + * Wait for next update */ usleep(DELAY); @@ -460,7 +460,7 @@ int havePixmap= 0; void ParseCMDLine(int argc, char *argv[]) { int i; - + ImageURL[0] = '\0'; for (i = 1; i < argc; i++) { @@ -568,9 +568,9 @@ double UT; /* - * This routine handles button presses. + * This routine handles button presses. * - * Double click on + * Double click on * Mouse Button 1: Display full size image with xv. * Mouse Button 2: Send HttpURL to netscape. * Mouse Button 3: Update image right away (i.e. grab a new one). @@ -589,7 +589,7 @@ void pressEvent(XButtonEvent *xev){ if ((xev->button == Button1) && (xev->type == ButtonPress)){ if (GotFirstClick1) GotDoubleClick1 = 1; else GotFirstClick1 = 1; - } else if ((xev->button == Button2) && (xev->type == ButtonPress)){ + } else if ((xev->button == Button2) && (xev->type == ButtonPress)){ if (GotFirstClick2) GotDoubleClick2 = 1; else GotFirstClick2 = 1; } else if ((xev->button == Button3) && (xev->type == ButtonPress)){ diff --git a/wmgrabimage/wmgeneral/wmgeneral.c b/wmgrabimage/wmgeneral/wmgeneral.c index c251fa2..441c955 100644 --- a/wmgrabimage/wmgeneral/wmgeneral.c +++ b/wmgrabimage/wmgeneral/wmgeneral.c @@ -121,7 +121,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); @@ -168,9 +168,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, @@ -182,9 +182,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, @@ -278,12 +278,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); } @@ -308,10 +308,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); @@ -332,7 +332,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; diff --git a/wmhdplop/ChangeLog b/wmhdplop/ChangeLog index cedec1d..14ab9dd 100644 --- a/wmhdplop/ChangeLog +++ b/wmhdplop/ChangeLog @@ -14,7 +14,7 @@ Fixed device lookup from /proc/partitions & /etc/mtab on feisty fawn. 2006-12-01 (v0.9.8) - + Added option -F to display hd temperatures in Farenheit degrees instead of Celsius. @@ -25,8 +25,8 @@ 2005-06-17 (v0.9.7) Should tolerate swapless configurations. - -2005-02-25 + +2005-02-25 Damned there was a leak in both wmforkplop and wmhdplop. @@ -37,36 +37,36 @@ Added options --32, --48 and --56 for user whose dock is smaller than 64x64. - + 2004-07-07 (v0.9.5) Some small bugfixes, added /usr/X11R6/lib/X11/fonts/truetype to default font path, wmhdplop will try harder to find a font. gkhdplop won't kill gkrellm if not font is found. wmhdplop should work out of box with fvwm2 and others windowmanagers. - + http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=257760 should be fixed, and the font names/size can now be changed in the gkhdplop panel. - + 2004-04-06 (v0.9.4) Well well well, wmhdplop won't try anymore to parse device names. Major & minor device number are the only truth. Forget the brain-damaged 0.9.3 which was broken with devfs. - + 2004-04-06 (v0.9.3) Fixed some crashes, and wrong throughput when partitions where monitored. wmhdplop should recognize automatically scsi drives, and even raid arrays. - + 2004-04-01 The release that will rule the desktops \o/ (v0.9.2) Add mouse interactivity. Add gkhdplop, the port to gkrellm. wmhdplop -g=wxh is not resizable - + 2003-12-18 Improved release \o/ (v0.9.1) Many internal changes. The @@ -77,7 +77,7 @@ arbitray window size. This option has to be used with the gnome-swallow meta applet (see example on the homepage). The default font-paths are now scanned recursively. - + 2003-12-06 Initial release \o/ (v0.9.0) diff --git a/wmhdplop/README b/wmhdplop/README index 2871ef4..88fb3c1 100644 --- a/wmhdplop/README +++ b/wmhdplop/README @@ -3,7 +3,7 @@ wmdhplop & gkhdplop ------------------------------------------------ - wmhdplop is yet another monitoring applet. This one watches hard-drive + wmhdplop is yet another monitoring applet. This one watches hard-drive activity. gkhdplop is the port of wmhdplop into a gkrellm2 plugin. @@ -11,12 +11,12 @@ Compilation: ----------- ./configure && make && make install - Note that this applet uses Imlib2, and requires the script imlib2-config + Note that this applet uses Imlib2, and requires the script imlib2-config to be in the path. It won't compile on anything but a recent linux kernel (2.4.20 or better, 2.6 is also supported). gkhdplop requires gtk2 and gkrellm2. - + Usage: ------ wmhdplop -h for the list of options. If you have the hddtemp daemon running, @@ -27,7 +27,7 @@ gkhdplop: --------- To install the plugin: mv gkhdplop.so ~/.gkrellm2/plugins - + The configuration is made by clicking with the right button on the plugin. BUG: gkhdplop will close gkrellm if no default .ttf font is found (look at the messages in console). diff --git a/wmhdplop/devnames.c b/wmhdplop/devnames.c index fdade3a..b1749aa 100644 --- a/wmhdplop/devnames.c +++ b/wmhdplop/devnames.c @@ -29,7 +29,7 @@ DiskList *find_dev(unsigned major, unsigned minor) { DiskList *find_id(int hd_id, int part_id) { DiskList *dl; for (dl = dlist; dl; dl = dl->next) { - if (((dl->hd_id == hd_id) || hd_id == -1) && + if (((dl->hd_id == hd_id) || hd_id == -1) && ((dl->part_id == part_id) || part_id == -1)) return dl; } return NULL; @@ -89,69 +89,69 @@ static const char *to_num_(unsigned minor) { int device_info(unsigned major, unsigned minor, char *name, int *hd_id, int *part_id) { switch(major) { #ifdef SCSI_DISK0_MAJOR - case (SCSI_DISK0_MAJOR): + case (SCSI_DISK0_MAJOR): #else - case (SCSI_DISK_MAJOR): + case (SCSI_DISK_MAJOR): #endif - if (name) sprintf(name, "sd%c%s", "abcdefghijklmnop"[(minor)/16], to_num_(minor%16)); + if (name) sprintf(name, "sd%c%s", "abcdefghijklmnop"[(minor)/16], to_num_(minor%16)); if (hd_id) *hd_id = (minor)/16; if (part_id) *part_id = minor%16; return 1; - case IDE0_MAJOR: + case IDE0_MAJOR: if (name) sprintf(name, "hd%c%s", "ab"[(minor)/64], to_num_(minor%64)); if (hd_id) *hd_id = 100 + (minor)/64; if (part_id) *part_id = minor%64; return 2; - case IDE1_MAJOR: - if (name) sprintf(name, "hd%c%s", "cd"[(minor)/64], to_num_(minor%64)); + case IDE1_MAJOR: + if (name) sprintf(name, "hd%c%s", "cd"[(minor)/64], to_num_(minor%64)); if (hd_id) *hd_id = 200 + (minor)/64; if (part_id) *part_id = minor%64; return 3; #ifdef IDE2_MAJOR - case IDE2_MAJOR: + case IDE2_MAJOR: if (name) sprintf(name, "hd%c%s", "ef"[(minor)/64], to_num_(minor%64)); if (hd_id) *hd_id = 300 + (minor)/64; if (part_id) *part_id = minor%64; return 4; #endif #ifdef IDE3_MAJOR - case IDE3_MAJOR: + case IDE3_MAJOR: if (name) sprintf(name, "hd%c%s", "gh"[(minor)/64], to_num_(minor%64)); if (hd_id) *hd_id = 400 + (minor)/64; - if (part_id) *part_id = minor%64; + if (part_id) *part_id = minor%64; return 5; #endif #ifdef IDE4_MAJOR - case IDE4_MAJOR: + case IDE4_MAJOR: if (name) sprintf(name, "hd%c%s", "ij"[(minor)/64], to_num_(minor%64)); if (hd_id) *hd_id = 400 + (minor)/64; - if (part_id) *part_id = minor%64; + if (part_id) *part_id = minor%64; return 6; #endif #ifdef IDE5_MAJOR - case IDE5_MAJOR: + case IDE5_MAJOR: if (name) sprintf(name, "hd%c%s", "kl"[(minor)/64], to_num_(minor%64)); if (hd_id) *hd_id = 400 + (minor)/64; - if (part_id) *part_id = minor%64; + if (part_id) *part_id = minor%64; return 7; #endif #ifdef IDE6_MAJOR - case IDE6_MAJOR: + case IDE6_MAJOR: if (name) sprintf(name, "hd%c%s", "mn"[(minor)/64], to_num_(minor%64)); if (hd_id) *hd_id = 400 + (minor)/64; - if (part_id) *part_id = minor%64; + if (part_id) *part_id = minor%64; return 8; #endif #ifdef MD_MAJOR - case (MD_MAJOR): + case (MD_MAJOR): if (name) sprintf(name, "md%s", to_num_(minor)); if (hd_id) *hd_id = 400 + minor; - if (part_id) *part_id = 0; - return 9; + if (part_id) *part_id = 0; + return 9; #endif #ifdef BLOCK_EXT_MAJOR @@ -181,13 +181,13 @@ int is_partition(unsigned major, unsigned minor) { int device_id_from_name(const char *devname__, unsigned *pmajor, unsigned *pminor) { if (strlen(devname__)>=512) return -1; char *devname_, devname[512]; - + devname_ = str_substitute(devname__, "/dev/mapper", "/dev"); struct stat stat_buf; BLAHBLAH(1,printf("looking for %s in /dev..\n", devname_)); - - if (devname_[0] != '/') snprintf(devname,512,"/dev/%s", devname_); + + if (devname_[0] != '/') snprintf(devname,512,"/dev/%s", devname_); else snprintf(devname,512,"%s",devname_); free(devname_); devname_ = 0; @@ -213,7 +213,7 @@ int device_id_from_name(const char *devname__, unsigned *pmajor, unsigned *pmino /* add a hard-drive if it is a regular ide/scsi/md disk/partition, or return NULL */ static DiskList *create_device(unsigned major, unsigned minor, const char *mtab_name) { - DiskList *dl; + DiskList *dl; char dev_path[512]; ALLOC_OBJ(dl); if (mtab_name && strlen(mtab_name)) dl->name = strdup(mtab_name); @@ -222,11 +222,11 @@ static DiskList *create_device(unsigned major, unsigned minor, const char *mtab_ } BLAHBLAH(1, printf("create_device(major=%d, minor=%d, mtab_name=%s) : name=%s\n", major,minor,mtab_name,dl->name)); dl->major = major; dl->minor = minor; - if (device_info(major,minor,dev_path,&dl->hd_id,&dl->part_id) == 0) { + if (device_info(major,minor,dev_path,&dl->hd_id,&dl->part_id) == 0) { BLAHBLAH(1, printf("(%d,%d) is not a known disc type..\n", major,minor)); - free(dl); return NULL; + free(dl); return NULL; } - dl->dev_path = malloc(strlen(dev_path)+6); assert(dl->dev_path); + dl->dev_path = malloc(strlen(dev_path)+6); assert(dl->dev_path); sprintf(dl->dev_path, "/dev/%s", dev_path); dl->next = NULL; if (dl->part_id == 0) diff --git a/wmhdplop/dockapp_imlib2.c b/wmhdplop/dockapp_imlib2.c index 4d21115..3af45d9 100644 --- a/wmhdplop/dockapp_imlib2.c +++ b/wmhdplop/dockapp_imlib2.c @@ -29,7 +29,7 @@ static void dockimlib2_set_rect_shape(DockImlib2 *dock, int x, int y, int w, int XFillRectangle(dock->display, mask, gc, x,y,w,h); XFreeGC(dock->display,gc); /* setup shaped window */ - XShapeCombineMask(dock->display, dock->normalwin, ShapeBounding, + XShapeCombineMask(dock->display, dock->normalwin, ShapeBounding, 0, 0, mask, ShapeSet); if (dock->iconwin) XShapeCombineMask(dock->display, dock->iconwin, ShapeBounding, @@ -45,7 +45,7 @@ void set_window_title(Display *display, Window win, char *window_title, char *ic rc = XStringListToTextProperty(&window_title,1, &window_title_property); assert(rc); XSetWMName(display, win, &window_title_property); XFree(window_title_property.value); - + /* icon window name */ rc = XStringListToTextProperty(&icon_title,1, &window_title_property); assert(rc); XSetWMIconName(display, win, &window_title_property); @@ -72,10 +72,10 @@ static void dockimlib2_xinit(DockImlib2 *dock, DockImlib2Prefs *prefs) { char sdockgeom[40]; assert(prefs->argv); // this should be always set .. - + if (prefs->flags & DOCKPREF_DISPLAY) sdisplay = prefs->display; if (prefs->flags & DOCKPREF_GEOMETRY) { pgeom = prefs->geometry; undocked = 1; } - + dock->display = XOpenDisplay(sdisplay); if(!dock->display) DOCKIMLIB2_ERR("Couldn't connect to display %s\n", sdisplay); dock->screennum = DefaultScreen(dock->display); @@ -99,8 +99,8 @@ static void dockimlib2_xinit(DockImlib2 *dock, DockImlib2Prefs *prefs) { xsh->flags = XWMGeometry(dock->display, dock->screennum, pgeom, sdockgeom, 0, xsh, &xsh->x, &xsh->y, &xsh->width, &xsh->height, &i); if (undocked) { - dock->win_width = dock->w = xsh->width; - dock->win_height = dock->h = xsh->height; + dock->win_width = dock->w = xsh->width; + dock->win_height = dock->h = xsh->height; dock->x0 = dock->y0 = 0; } xsh->base_width = xsh->width; @@ -115,7 +115,7 @@ static void dockimlib2_xinit(DockImlib2 *dock, DockImlib2Prefs *prefs) { xsh->x, xsh->y, xsh->width, xsh->height, 0, BlackPixel(dock->display, dock->screennum), WhitePixel(dock->display, dock->screennum)); - + if(!dock->normalwin) DOCKIMLIB2_ERR("Couldn't create window\n"); if (!undocked) { /* create icon window */ @@ -133,7 +133,7 @@ static void dockimlib2_xinit(DockImlib2 *dock, DockImlib2Prefs *prefs) { /* start with an empty window in order to get the background pixmap */ dockimlib2_set_rect_shape(dock,32,32,1,0); - + /* set window manager hints */ if (!undocked) { XWMHints *xwmh; @@ -157,7 +157,7 @@ static void dockimlib2_xinit(DockImlib2 *dock, DockImlib2Prefs *prefs) { long evmask = ExposureMask | ButtonPressMask | ButtonReleaseMask | VisibilityChangeMask | PointerMotionMask | EnterWindowMask | LeaveWindowMask | StructureNotifyMask; XSelectInput(dock->display, dock->normalwin, evmask); - if (dock->iconwin) + if (dock->iconwin) XSelectInput(dock->display, dock->iconwin, evmask); } XSetWMProtocols(dock->display, dock->normalwin, &dock->atom_WM_DELETE_WINDOW, 1); @@ -191,7 +191,7 @@ void dockimlib2_gkrellm_xinit(DockImlib2 *dock, GdkDrawable *gkdrawable) { /* start with an empty window in order to get the background pixmap */ dockimlib2_set_rect_shape(dock,32,32,1,0); - + /* map the main window */ XMapWindow(dock->display, dock->normalwin); } @@ -199,7 +199,7 @@ void dockimlib2_gkrellm_xinit(DockImlib2 *dock, GdkDrawable *gkdrawable) { static void add_fontpath(const char *path, int recurse) { struct stat st; - + if (stat(path,&st) != 0 || !S_ISDIR(st.st_mode)) return; if (recurse > 3) return; /* prevent scanning of whole hd/infinite recursions in case of a bad symlink */ @@ -330,18 +330,18 @@ DockImlib2* dockimlib2_gkrellm_setup(int x0, int y0, int w, int h, DockImlib2Pre static char *last_font_name = 0; const char* dockimlib2_last_loaded_font() { return last_font_name; } - + Imlib_Font *imlib_load_font_nocase(const char *name) { Imlib_Font *f; int i; if (last_font_name) free(last_font_name); - last_font_name = strdup(name); + last_font_name = strdup(name); if ((f = imlib_load_font(last_font_name))) return f; for (i=0; last_font_name[i]; ++i) last_font_name[i] = tolower(last_font_name[i]); if ((f = imlib_load_font(last_font_name))) return f; for (i=0; last_font_name[i]; ++i) last_font_name[i] = toupper(last_font_name[i]); f = imlib_load_font(last_font_name); - return f; + return f; } Imlib_Font *load_font(char *prefname, char **flist_) { @@ -375,8 +375,8 @@ Imlib_Font *load_font(char *prefname, char **flist_) { return f; } -/* - merges dock->bg and dock->img, and renders the result on the window +/* + merges dock->bg and dock->img, and renders the result on the window this function does not alter the imlib context */ void dockimlib2_render(DockImlib2 *dock) { @@ -397,7 +397,7 @@ void dockimlib2_render(DockImlib2 *dock) { if (dock->iconwin) { imlib_context_set_drawable(dock->iconwin); imlib_render_image_on_drawable(dock->x0, dock->y0); - } + } /* XSetWindowBackgroundPixmap(dock->display, dock->GKwin, dock->win); XClearWindow(dock->display, dock->GKWin); */ imlib_free_image(); diff --git a/wmhdplop/gkrellm_hdplop.c b/wmhdplop/gkrellm_hdplop.c index ed14534..5cead20 100644 --- a/wmhdplop/gkrellm_hdplop.c +++ b/wmhdplop/gkrellm_hdplop.c @@ -50,7 +50,7 @@ static GkrellmChartconfig *chart_config = NULL; #define PLUGIN_HEIGHT 64 -static gint timeout_id; +static gint timeout_id; static int option_timer = 0; /* Options stuffs */ @@ -115,10 +115,10 @@ static void create_plugin(GtkWidget *vbox, gint first_create) if(first_create) { chart = gkrellm_chart_new0(); } - + gkrellm_set_chart_height_default(chart, PLUGIN_HEIGHT); gkrellm_chart_create(vbox, mon, chart, &chart_config); - + if (first_create) { hdplop_main(chart->w, chart->h, chart->drawing_area->window); } else { @@ -128,7 +128,7 @@ static void create_plugin(GtkWidget *vbox, gint first_create) if (first_create) { //printf("chart : w=%d, h=%d\n", chart->w, chart->h); gtk_signal_connect(GTK_OBJECT(chart->drawing_area), - "expose_event", (GtkSignalFunc) chart_expose_event, NULL); + "expose_event", (GtkSignalFunc) chart_expose_event, NULL); gtk_signal_connect(GTK_OBJECT(chart->drawing_area), "button_release_event", GTK_SIGNAL_FUNC(button_release_event), NULL); g_signal_connect(G_OBJECT(chart->drawing_area), @@ -144,7 +144,7 @@ static void option_toggled_cb(GtkToggleButton *button, gpointer user_data UNUSED { gboolean active = gtk_toggle_button_get_active(button); GtkWidget *togglebutton = GTK_WIDGET(button); - + if (togglebutton == swap_check) { Prefs.disable_swap_matrix = !active; } @@ -211,7 +211,7 @@ static void create_plugin_tab(GtkWidget *tab_vbox) GtkWidget *about_tab = NULL; GtkWidget *about = NULL; GtkWidget *main_box; - + static gchar *info_text[] = { "<b>" PLUGIN_NAME "\n\n", @@ -228,7 +228,7 @@ static void create_plugin_tab(GtkWidget *tab_vbox) "- Several glittering color schemes...\n", "- Popup display with the io throughput...\n", }; - + static gchar *about_text = _( PLUGIN_NAME " " PLUGIN_VERSION "\n" @@ -244,10 +244,10 @@ static void create_plugin_tab(GtkWidget *tab_vbox) tabs = gtk_notebook_new(); gtk_notebook_set_tab_pos(GTK_NOTEBOOK(tabs), GTK_POS_TOP); gtk_box_pack_start(GTK_BOX(tab_vbox), tabs, TRUE, TRUE, 0); - + /* Options tab */ options_tab = gkrellm_gtk_notebook_page(tabs, _("Options")); - + main_box = gtk_vbox_new(FALSE, 0); gtk_widget_set_name(main_box, "main_box"); gtk_widget_ref(main_box); @@ -263,7 +263,7 @@ static void create_plugin_tab(GtkWidget *tab_vbox) gkrellm_gtk_check_button_connected(main_box, &swap_check, !Prefs.disable_swap_matrix, 1, 1, 0, option_toggled_cb, NULL, _("Show swap activity")); /* hdlist button */ - gkrellm_gtk_check_button_connected(main_box, &hdlist_check, + gkrellm_gtk_check_button_connected(main_box, &hdlist_check, (Prefs.hdlist_pos == AL_NONE)?FALSE:TRUE, 1, 1, 0, option_toggled_cb, NULL, _("Show disk name")); /* leds button */ @@ -278,17 +278,17 @@ static void create_plugin_tab(GtkWidget *tab_vbox) /* colormap spin button */ gkrellm_gtk_spin_button(main_box, NULL, Prefs.iomatrix_colormap, 0, 4, 1, 1, 0, 0, cb_colormap_modified, NULL, FALSE, _("Colormap")); - + /* threshold spin button */ gkrellm_gtk_spin_button(main_box, &throughput_threshold, Prefs.popup_throughput_threshold, 0., 500, 0.1, 1, 1, 0, cb_spinbutton_modified, NULL, FALSE, _("minimum io throughput (MB/s)")); - + { GtkWidget *frame = gtk_frame_new("Fonts"); gtk_box_pack_start(GTK_BOX(main_box), frame, TRUE, FALSE, 0); GtkWidget *hbox0 = gtk_hbox_new(FALSE, 4); - gtk_container_add(GTK_CONTAINER(frame), hbox0); + gtk_container_add(GTK_CONTAINER(frame), hbox0); GtkWidget *vbox = gtk_vbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(hbox0), vbox, TRUE, FALSE, 0); @@ -350,7 +350,7 @@ static void load_plugin_config(gchar *config_line) &Prefs.iomatrix_colormap, &Prefs.popup_throughput_threshold, sf, bf); - if (n>= 8) Prefs.smallfontname = strdup(sf); + if (n>= 8) Prefs.smallfontname = strdup(sf); if (n>= 9) Prefs.bigfontname = strdup(bf); } @@ -362,15 +362,15 @@ static GkrellmMonitor hdplop_mon = NULL, /* The update_plugin() function */ create_plugin_tab, /* The create_plugin_tab() config function */ NULL, /* The apply_plugin_config() function */ - + save_plugin_config, /* The save_plugin_config() function */ load_plugin_config, /* The load_plugin_config() function */ PLUGIN_KEYWORD, /* config keyword */ - + NULL, /* Undefined 2 */ NULL, /* Undefined 1 */ NULL, /* private */ - + MON_CPU, /* Insert plugin before this monitor. */ NULL, /* Handle if a plugin, filled in by GKrellM */ NULL /* path if a plugin, filled in by GKrellM */ diff --git a/wmhdplop/global.h b/wmhdplop/global.h index 099808c..e7e94eb 100644 --- a/wmhdplop/global.h +++ b/wmhdplop/global.h @@ -27,8 +27,8 @@ #ifndef NO_BITFIELDS # define BITFIELD(n) :n #else -# define BITFIELD(n) -#endif +# define BITFIELD(n) +#endif #include "dockapp_imlib2.h" diff --git a/wmhdplop/procstat.c b/wmhdplop/procstat.c index 18c74cf..e7eed1b 100644 --- a/wmhdplop/procstat.c +++ b/wmhdplop/procstat.c @@ -28,7 +28,7 @@ void pstat_add(struct pstat *pst, unsigned long v) { void pstat_advance(struct pstat *pst) { unsigned long v = pst->slices[pst->cur_slice]; if (pst->total) - pst->slices[pst->cur_slice] -= pst->total; + pst->slices[pst->cur_slice] -= pst->total; else pst->slices[pst->cur_slice] = 0; pst->total = v; if (++pst->cur_slice >= pst->nslice) pst->cur_slice = 0; @@ -80,7 +80,7 @@ void update_stats() { while (fgets(line, sizeof(line), f)) { int major, minor; unsigned long nr, nw; - const char *fmt = use_proc_diskstats ? + const char *fmt = use_proc_diskstats ? "%d %d %200s %*d %*d %lu %*d %*d %*d %lu" : "%d %d %*u %200s %*d %*d %lu %*d %*d %*d %lu"; if (sscanf(line, fmt, &major, &minor, hdname, &nr, &nw) == 5 || @@ -90,10 +90,10 @@ void update_stats() { DiskList *dl; if (readok == 0) readok = 1; if ((dl=find_dev(major,minor))) { - dl->touched_r = (dl->nr - nr) ? 10 : dl->touched_r; - dl->touched_w = (dl->nw - nw) ? 10 : dl->touched_w; + dl->touched_r = (dl->nr - nr) ? 10 : dl->touched_r; + dl->touched_w = (dl->nw - nw) ? 10 : dl->touched_w; dl->nr = nr; dl->nw = nw; - if (is_displayed(dl->hd_id,dl->part_id) && + if (is_displayed(dl->hd_id,dl->part_id) && ((dl->part_id && (!find_id(dl->hd_id, 0) || !is_displayed(dl->hd_id, 0))) || /* partition without host disk */ (dl->part_id == 0))) /* disk */ { @@ -134,8 +134,8 @@ void update_stats() { pstat_advance(&ps.swap_in);pstat_advance(&ps.swap_out); if (readok == 0) { fprintf(stderr, "warning: could not find any info in %s (kernel too old?)\n", proc_fname); exit(1); } else if (readok == 1) { ONLY_ONCE(fprintf(stderr, "warning: could not find any monitored disc in %s\n", proc_fname)); } - BLAHBLAH(1,printf("swap: %5.2f,%5.2f disc: %5.2f,%5.2f MB/s\n", - get_swapin_throughput(), get_swapout_throughput(), + BLAHBLAH(1,printf("swap: %5.2f,%5.2f disc: %5.2f,%5.2f MB/s\n", + get_swapin_throughput(), get_swapout_throughput(), get_read_throughput(), get_write_throughput())); } @@ -163,8 +163,8 @@ void init_stats(float update_interval) { if (!swap_list()) { fprintf(stderr, "Warning: no swap partition found in /proc/swaps !!\n"); } - if ((f=fopen("/proc/diskstats","r"))) { - use_proc_diskstats = 1; fclose(f); + if ((f=fopen("/proc/diskstats","r"))) { + use_proc_diskstats = 1; fclose(f); } else { use_proc_diskstats = 0; } BLAHBLAH(1,printf("using %s for disc statistics\n", use_proc_diskstats ? "/proc/diskstats" : "/proc/partitions")); @@ -196,7 +196,7 @@ void scan_all_hd(int add_partitions) { while (fgets(s,512,f)) { unsigned major, minor; char name[512]; name[0] = 0; - if (sscanf(s,"%d %d %*d %500s", &major, &minor, name)==3) { + if (sscanf(s,"%d %d %*d %500s", &major, &minor, name)==3) { int hd_id, part_id; /* on n'ajoute que les disques dont au moins une partoche etait dans mtab */ if (device_info(major,minor,NULL,&hd_id,&part_id) != 0 && part_id == 0 && find_id(hd_id,-1)) { diff --git a/wmhdplop/util.c b/wmhdplop/util.c index ed4e441..d66ec32 100644 --- a/wmhdplop/util.c +++ b/wmhdplop/util.c @@ -12,7 +12,7 @@ str_dup(const char *src) { } /* - verifie si la chaine est vide (cad si elle ne contient que des caractères non imprimables + verifie si la chaine est vide (cad si elle ne contient que des caractères non imprimables */ int str_is_empty(const char *s) { @@ -101,7 +101,7 @@ str_substitute(const char *src, const char *key, const char *substitution) { } /* quotage pour les commandes externes.. à priori c'est comme pour open_url - mais bon.. je me refuse à donner la moindre garantie sur la sécurité + mais bon.. je me refuse à donner la moindre garantie sur la sécurité be aware */ @@ -143,7 +143,7 @@ void gen_crc_table(void) /* build the crc table */ { unsigned crc, poly; int i, j; - + poly = 0xEDB88320; for (i = 0; i < 256; i++) { @@ -164,7 +164,7 @@ unsigned str_hash(const unsigned char *s, int max_len) /* calculate the crc v { unsigned crc; int i; - + if (crc_table == NULL) { crc_table = calloc(256, sizeof(unsigned)); gen_crc_table(); @@ -180,12 +180,12 @@ unsigned str_hash(const unsigned char *s, int max_len) /* calculate the crc v unsigned char char_trans[256]; static int char_trans_init = 0; -static void +static void init_char_trans() { - const unsigned char *trans_accents = + const unsigned char *trans_accents = (const unsigned char*) "éèëêÊËÉÈàâáäÀÂÁÄûüùÙçÇîïíìÏÎÍÌôóòõÔÓÒÕñ"; - const unsigned char *trans_accents2 = + const unsigned char *trans_accents2 = (const unsigned char*) "eeeeeeeeaaaaaaaauuuucciiiiiiiioooooooon"; int i; @@ -254,7 +254,7 @@ str_printf(const char *fmt, ...) s_sz *= 2; assert(s_sz < 100000); s = realloc(s, s_sz); assert(s); - } else + } else break; } s = realloc(s, strlen(s)+1); assert(s); @@ -275,7 +275,7 @@ str_fget_line(FILE *f) while ((c = fgetc(f)) > 0) { if (c >= ' ' || c == '\t') { s[i++] = c; - if (i == s_sz) { + if (i == s_sz) { s_sz *= 2; assert(s_sz < 100000); s = realloc(s, s_sz); assert(s); } @@ -296,7 +296,7 @@ str_trim(unsigned char *s) { j = strlen((char*)s)-1; while (j>=0 && s[j] <= ' ') s[j--] = 0; - i = 0; + i = 0; while (s[i] && s[i] <= ' ') i++; if (i<=j) { memmove(s, s+i, j+2-i); diff --git a/wmhdplop/wmhdplop.c b/wmhdplop/wmhdplop.c index 91b6d52..5b18932 100644 --- a/wmhdplop/wmhdplop.c +++ b/wmhdplop/wmhdplop.c @@ -11,10 +11,10 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - + #include "config.h" #include <string.h> #include <sys/types.h> @@ -69,7 +69,7 @@ void update_io_matrix_rw(App *app, float mbs, int op) { l->next = io->ops; l->n = (int)(log2f(1+v*1024)/10.); l->op = op; - l->i = rand() % io->h; + l->i = rand() % io->h; l->j = rand() % io->w; io->ops = l; } @@ -97,24 +97,24 @@ void evolve_io_matrix(App *app, DATA32 * __restrict buff) { } else po = po->next; o = no; } - + /* brain-dead diffusion */ pl = io->v[io->h+2]; int * __restrict l = io->v[io->h+3]; - for (j=1; j < io->w+1; ++j) pl[j] = 0; + for (j=1; j < io->w+1; ++j) pl[j] = 0; for (i=1; i < io->h+1; ++i) { /* for (j=1; j < io->w+1; ++j) { l[j] = io->v[i][j]*0.99 + (io->v[i][j-1] + io->v[i][j+1] + pl[j] + io->v[i+1][j] - 4*io->v[i][j])/5.; } */ - /* + /* float *__restrict nl = io->v[i+1]+1; float *__restrict cl = io->v[i]; for (j=1; j < io->w+1; ++j, ++cl) { l[j] = (cl[1])*0.99 + (cl[0] + cl[2] + pl[j] + *nl++ - 4*cl[1])/5.; } -*/ +*/ int *__restrict dest; int *__restrict pn = io->v[i+1]+1; int *__restrict pc = io->v[i]+1; @@ -134,7 +134,7 @@ void evolve_io_matrix(App *app, DATA32 * __restrict buff) { } *buff++ = io->cm.p[v+CMAPSZ/2]; } - + tmp = pl; pl = io->v[i]; io->v[i] = l; l = tmp; io->v[io->h+2] = pl; io->v[io->h+3] = l; } @@ -146,10 +146,10 @@ static void draw_io_matrix(App *app, DATA32 * __restrict buff) { IOMatrix *io = &app->iom; int i,j; for (i=0; i < io->h; ++i) { - for (j=0; j < io->w; ++j) { + for (j=0; j < io->w; ++j) { float vv = io->v[i+1][j+1]; int v = (int)(vv * 32768); //((int)ldexpf(vv,15)); /* (int)v*(2^15) */ - //if (v == 0) continue; + //if (v == 0) continue; //if (v < 0) v*=3; /* write op are rare, so they are brighter .. */ if (v > CMAPSZ/4) { /* cheaper than a log(vv) ... */ v = MIN(CMAPSZ/4 + (v-CMAPSZ/4)/16,CMAPSZ/2-1); @@ -198,7 +198,7 @@ void draw_swap_matrix(App *app) { if (v > 0) imlib_context_set_color(255, 50, 50, MIN(v+80,255)); else imlib_context_set_color(50, 255, 50, MIN(v+80,255)); imlib_image_fill_rectangle(row*sm->w+1,col*sm->w+1,sm->w-1,sm->w-1); - + if (sm->intensity[row][col] > 0) { sm->intensity[row][col]--; } else if (sm->intensity[row][col] < 0) { @@ -252,7 +252,7 @@ static void query_hddtemp(App *app) { fprintf(stderr,"can't connect to 127.0.0.1:%d : %s\n", Prefs.hddtemp_port, strerror(errno)); #ifdef GKRELLM Prefs.enable_hddtemp = 0; -#endif +#endif return; } int n = 0; @@ -276,11 +276,11 @@ static void query_hddtemp(App *app) { s=strchr(s,'|'); if (s && ((s=strchr(s+1,'|')))) { int unit = 'C'; - char *p = strchr(++s,'|'), oldv=0; - if (p) { - oldv = *p; + char *p = strchr(++s,'|'), oldv=0; + if (p) { + oldv = *p; if (*p && toupper(p[1]) == 'F') unit = 'F'; - *p = 0; + *p = 0; } BLAHBLAH(1,printf("temperature of '%s' : %s %c\n", dl->name, s, unit)); if (strcmp(s,"SLP") == 0) app->disk_temperature[cnt] = -2; @@ -300,7 +300,7 @@ static void query_hddtemp(App *app) { } } } - } else { fprintf(stderr, "error with hddtemp: %s\n", strerror(errno)); } + } else { fprintf(stderr, "error with hddtemp: %s\n", strerror(errno)); } close(fd); } @@ -309,7 +309,7 @@ const char *power_mode_str(int m) { case HD_ACTIVE: return "active/idle"; case HD_STANDBY: return "standby"; case HD_SLEEP: return "sleep"; - case HD_UNKNOWN: + case HD_UNKNOWN: default: return "unknown/error"; } @@ -340,9 +340,9 @@ int is_displayed(int hd_id, int part_id) { void change_displayed_hd(int dir) { DiskList *dl = find_id(app->filter_hd, app->filter_part); - if (dl == NULL) { - app->filter_hd = -1; app->filter_part = -1; - dl = find_id(app->filter_hd, app->filter_part); assert(dl); + if (dl == NULL) { + app->filter_hd = -1; app->filter_part = -1; + dl = find_id(app->filter_hd, app->filter_part); assert(dl); } else if (dir > 0) { if (app->filter_hd == -1 && app->filter_part == -1) { @@ -395,7 +395,7 @@ void prev_displayed_hd() { const char *shorten_name(DiskList *dl) { static char s[8]; if (dl->name && strlen(dl->name)) { - const char *p = dl->name; + const char *p = dl->name; if (strchr(p,'/')) p = strrchr(p,'/')+1; if (strlen(p) == 0) p = dl->name; snprintf(s, sizeof s, "%s%s", dl->part_id ? " " : "", p); @@ -406,11 +406,11 @@ const char *shorten_name(DiskList *dl) { static void draw_hdlist(App *app) { if (Prefs.hdlist_pos == AL_NONE) return; DiskList *dl; - + int dev_cnt, hd_cnt, w; - static int lw = -1, lh = -1, lx = -1, ly = -1, h = -1, + static int lw = -1, lh = -1, lx = -1, ly = -1, h = -1, reshape_cnt = 0; - + if (!app->smallfont) return; if (app->displayed_hd_changed) { lx = -1; app->displayed_hd_changed = 0; } imlib_context_set_font(app->smallfont); @@ -433,24 +433,24 @@ static void draw_hdlist(App *app) { sethw(app,lw,lh,Prefs.hdlist_pos,&lx,&ly,&lw,&lh); reshape_cnt = app->reshape_cnt; } - + imlib_context_set_color(100, 100, 100, 150); imlib_image_fill_rectangle(lx,ly,lw,lh); imlib_context_set_color(100, 100, 100, 200); imlib_image_draw_rectangle(lx-1,ly-1,lw+2,lh+2); - + for (dl = first_dev_in_list(), dev_cnt=hd_cnt=-1; dl; dl = dl->next) { if (dl->part_id==0) ++hd_cnt; if (!is_displayed(dl->hd_id, dl->part_id)) continue; ++dev_cnt; int x = lx, y = ly + lh - dev_cnt * h; if (!Prefs.disable_hd_leds) { - if (dl->touched_r) { - imlib_context_set_color(50, 255, 50, 25*dl->touched_r--); - imlib_image_fill_rectangle(lx+1,y-5,3,3); + if (dl->touched_r) { + imlib_context_set_color(50, 255, 50, 25*dl->touched_r--); + imlib_image_fill_rectangle(lx+1,y-5,3,3); } - if (dl->touched_w) { + if (dl->touched_w) { imlib_context_set_color(255,100-10*dl->touched_w,100-10*dl->touched_w, 25*dl->touched_w - 1); dl->touched_w--; - imlib_image_fill_rectangle(lx+1,y-9,3,3); + imlib_image_fill_rectangle(lx+1,y-9,3,3); } x += 5; } @@ -458,9 +458,9 @@ static void draw_hdlist(App *app) { my_imlib_text_draw(x,y-h,shorten_name(dl)); if (dl->part_id==0 && app->disk_temperature[hd_cnt] != -1) { char s[200]; - if (app->disk_temperature[hd_cnt] != -2) { - snprintf(s,200,"%d",app->disk_temperature[hd_cnt]); - } else { + if (app->disk_temperature[hd_cnt] != -2) { + snprintf(s,200,"%d",app->disk_temperature[hd_cnt]); + } else { strcpy(s,"SLP"); } imlib_get_text_size(s,&w,&h); @@ -510,22 +510,22 @@ static void draw_throughput(App *app) { static int lw = -1, lh = -1, lx = -1, ly = -1; static int reshape_cnt = 0; if (Prefs.popup_throughput_pos == AL_NONE) return; - + if (!app->bigfont) return; imlib_context_set_font(app->bigfont); /* get dimensions (only once) */ - if (lx == -1 || app->reshape_cnt != reshape_cnt) { + if (lx == -1 || app->reshape_cnt != reshape_cnt) { imlib_get_text_size("00.0M/s",&lw,&lh); if (lw > (int)(app->dock->w*3/4)) { lw = app->dock->w; } sethw(app,lw,lh,Prefs.popup_throughput_pos,&lx,&ly,&lw,&lh); reshape_cnt = app->reshape_cnt; } - + if (get_read_mean_throughput() + get_write_mean_throughput() > Prefs.popup_throughput_threshold) { tpstep = MIN(tpstep+1,4); snprintf(tpmsg,sizeof tpmsg, "%.1fM/s",get_read_mean_throughput() + get_write_mean_throughput()); imlib_get_text_size(tpmsg,&tpw,&tph); - if (tpw > lw) { + if (tpw > lw) { snprintf(tpmsg,sizeof tpmsg, "%.1fM",get_read_mean_throughput() + get_write_mean_throughput()); imlib_get_text_size(tpmsg,&tpw,&tph); } @@ -598,10 +598,10 @@ static void event_loop(App *app) { switch (ev.type) { case ClientMessage: if (ev.xclient.message_type == app->dock->atom_WM_PROTOCOLS - && ev.xclient.format == 32 + && ev.xclient.format == 32 && (Atom)ev.xclient.data.l[0] == app->dock->atom_WM_DELETE_WINDOW) { exit(0); - } + } break; case ButtonRelease: //exit(0); @@ -609,19 +609,19 @@ static void event_loop(App *app) { else if (ev.xbutton.button == Button5 || ev.xbutton.button == Button1) next_displayed_hd(+1); break; case ConfigureNotify: { - if (app->dock->iconwin == None && - (ev.xconfigure.width != (int)app->dock->win_width || + if (app->dock->iconwin == None && + (ev.xconfigure.width != (int)app->dock->win_width || ev.xconfigure.height != (int)app->dock->win_height)) { app->dock->w = app->dock->win_width = ev.xconfigure.width; app->dock->h = app->dock->win_height = ev.xconfigure.height; reshape(ev.xconfigure.width, ev.xconfigure.height); //app->dock->w, app->dock->h, None); - /*printf("ConfigureNotify : %dx%d %dx%d\n", - ev.xconfigure.width, ev.xconfigure.height, + /*printf("ConfigureNotify : %dx%d %dx%d\n", + ev.xconfigure.width, ev.xconfigure.height, app->sm.nrow, app->sm.ncol);*/ } } break; } - } + } if (tic_cnt % app->update_stats_mult == 0) { update_stats(); if (!Prefs.disable_io_matrix) update_io_matrix(app); @@ -655,7 +655,7 @@ static void event_loop(App *app) { void setup_cmap(cmap *m) { struct { - float x0; + float x0; DATA32 c; } colors0[] = {{-128, 0xff8080}, {- 70, 0xF00000}, @@ -684,7 +684,7 @@ void setup_cmap(cmap *m) { { 16, 0x000040}, { 34, 0x0000ff}, { 60, 0x0000A0}, - {+128, 0x000040}}, + {+128, 0x000040}}, colors3[] = {{-128, 0x500060}, { -60, 0x500050}, { -34, 0x000000}, @@ -725,7 +725,7 @@ if (Prefs.iomatrix_colormap == n) { sz = sizeof(colors##n)/sizeof(*colors0); cde int j; for (j=i0; j <= MIN(i1,CMAPSZ-1); ++j) { float alpha = (j-i0+.5)/(float)(i1-i0); - m->p[j] = + m->p[j] = (MIN((int)(r1*(1-alpha) + alpha*r2),255)<<16) + (MIN((int)(g1*(1-alpha) + alpha*g2),255)<<8) + (MIN((int)(b1*(1-alpha) + alpha*b2),255)); @@ -736,7 +736,7 @@ if (Prefs.iomatrix_colormap == n) { sz = sizeof(colors##n)/sizeof(*colors0); cde unsigned getpos(const char *pp) { char p[2]; - unsigned v = AL_NONE, i; + unsigned v = AL_NONE, i; if (!pp || !pp[0]) return AL_NONE; if (strlen(pp) > 2) { fprintf(stderr, "invalid position specification: '%s'\n", pp); exit(1); } strncpy(p,pp,2); @@ -747,7 +747,7 @@ unsigned getpos(const char *pp) { else if (p[i] == 't') { v |= AL_TOP; } else if (p[i] == 'b') { v |= AL_BOTTOM; } else if (p[i] == 'c') { - if (v & (AL_LEFT | AL_RIGHT | AL_HCENTER)) v |= AL_VCENTER; else v |= AL_HCENTER; + if (v & (AL_LEFT | AL_RIGHT | AL_HCENTER)) v |= AL_VCENTER; else v |= AL_HCENTER; } else { fprintf(stderr, "unknown position specifier: '%c'\n", p[i]); exit(1); } @@ -781,7 +781,7 @@ void init_prefs(int argc, char **argv) { #ifndef GKRELLM void parse_options(int argc, char **argv) { int d_opt_used = 0; - enum { OPT_DISPLAY=1, OPT_SMALLFONT, OPT_BIGFONT, OPT_FONTPATH, + enum { OPT_DISPLAY=1, OPT_SMALLFONT, OPT_BIGFONT, OPT_FONTPATH, OPT_NOSWAP, OPT_NOIO, OPT_NOLEDS, OPT_HDLIST, OPT_THROUGHPUT, OPT_32, OPT_56, OPT_48 }; static struct option long_options[] = { {"help",0,0,'h'}, @@ -806,7 +806,7 @@ void parse_options(int argc, char **argv) { {NULL,0,0,0} }; int long_options_index; - const char *help = + const char *help = "wmhdplop " VERSION " - monitor hard-drive (or partition) activity\n" "A recent kernel is required (>2.4.20)\n" "Usage: wmhdplop [options]\n" @@ -836,7 +836,7 @@ void parse_options(int argc, char **argv) { " * Arial_Black/10, FreeSansBold/11, VeraMoBd/9\n" " * Vera/7, FreeSans/7, Trebuchet_MS/7\n" " -c n, --colormap=n\n" - " select colormap number n\n" + " select colormap number n\n" " --hdlist[=pos] hide completely the list of drives with leds and temperatures (if no position given)\n" " or change its location (default: 'B'). Possible positions are: 't','b','l','bl','bc','br',...\n" " (t=top, b=bottom, l=left, r=right, c=centered, etc)\n" @@ -859,7 +859,7 @@ void parse_options(int argc, char **argv) { break; switch (c) { case ':': - case '?': + case '?': exit(1); case OPT_DISPLAY: Prefs.xprefs.flags |= DOCKPREF_DISPLAY; Prefs.xprefs.display = strdup(optarg); @@ -932,7 +932,7 @@ void parse_options(int argc, char **argv) { assert(optarg); if (p) *p++ = 0; BLAHBLAH(1,printf("adding device %s to monitored disc list\n",optarg)); - if (add_device_by_name(optarg, p) != 0) + if (add_device_by_name(optarg, p) != 0) fprintf(stderr, "Warning: device %s not found or not recognized -- try option -v to get additionnal information\n", optarg); d_opt_used = 1; } break; @@ -965,10 +965,10 @@ void init_fonts(App *app) { imlib_context_set_font(app->smallfont); imlib_free_font(); app->smallfont = NULL; } app->bigfont = load_font(Prefs.bigfontname, bigfontlist); - if (app->bigfont) + if (app->bigfont) app->current_bigfont_name = strdup(dockimlib2_last_loaded_font()); app->smallfont = load_font(Prefs.smallfontname, smallfontlist); - if (app->smallfont) + if (app->smallfont) app->current_smallfont_name = strdup(dockimlib2_last_loaded_font()); } @@ -999,7 +999,7 @@ int hdplop_main(int width, int height, GdkDrawable *gkdrawable) #else app->dock = dockimlib2_gkrellm_setup(0, 0, width, height, &Prefs.xprefs, gkdrawable); #endif - app->bigfont = app->smallfont = NULL; + app->bigfont = app->smallfont = NULL; app->current_bigfont_name = app->current_smallfont_name = NULL; app->reshape_cnt = 0; if (find_id(-1,0) == 0) { @@ -1034,7 +1034,7 @@ int hdplop_main(int width, int height, GdkDrawable *gkdrawable) BLAHBLAH(1, { DiskList *dl = first_dev_in_list(); for ( ; dl; dl=dl->next) { - printf("Monitored: %s (%s) major=%d, minor=%d is_partition=%d\n", + printf("Monitored: %s (%s) major=%d, minor=%d is_partition=%d\n", dl->dev_path, dl->name, dl->major, dl->minor, is_partition(dl->major,dl->minor)); } }); diff --git a/wmhdplop/wmhdplop.h b/wmhdplop/wmhdplop.h index b105684..7dd9520 100644 --- a/wmhdplop/wmhdplop.h +++ b/wmhdplop/wmhdplop.h @@ -42,7 +42,7 @@ typedef struct { char *current_bigfont_name, *current_smallfont_name; unsigned update_display_delay_ms; unsigned update_stats_mult; - + unsigned char swap_matrix_luminosity, swap_matrix_lighting; SwapMatrix sm; @@ -51,7 +51,7 @@ typedef struct { int nb_hd, nb_dev; enum {HD_ACTIVE, HD_STANDBY, HD_SLEEP, HD_UNKNOWN} *disk_power_mode; int *disk_temperature; - + int filter_hd, filter_part; int displayed_hd_changed; int reshape_cnt; diff --git a/wmhexaclock/INSTALL b/wmhexaclock/INSTALL index ddbd1b5..6044d56 100644 --- a/wmhexaclock/INSTALL +++ b/wmhexaclock/INSTALL @@ -20,4 +20,4 @@ Installation Names By default the make install script will install the binary in: /usr/local/bin/ - + diff --git a/wmhexaclock/Makefile b/wmhexaclock/Makefile index 56a119b..5fecfa3 100644 --- a/wmhexaclock/Makefile +++ b/wmhexaclock/Makefile @@ -36,9 +36,9 @@ all : $(MAINSRC) install : install -c -s -m 755 $(BIN) $(INSPATH) - -clean : + +clean : rm -f $(SOURCEPATH)$(BIN) -uninstall : +uninstall : rm -f $(INSPATH)wmHexaClock diff --git a/wmhexaclock/README b/wmhexaclock/README index b478b3f..9544ae4 100644 --- a/wmhexaclock/README +++ b/wmhexaclock/README @@ -21,7 +21,7 @@ There are just a few options so far: in the beginning. Example: "wmHexClock -fg-color 00ff00" for green. - --mode (-m) [0 or 1] + --mode (-m) [0 or 1] You can run wmHexaClock in two different modes. In mode 0 the program will display the time always while the name of the day and the date of the day will be displayed @@ -29,7 +29,7 @@ There are just a few options so far: In mode 1 everything will be displayed the same time. It is much more difficult to read it since the space is actually not big enough. - + --help (-h) Might help you diff --git a/wmhexaclock/src/main.c b/wmhexaclock/src/main.c index e7672ff..ed5a535 100644 --- a/wmhexaclock/src/main.c +++ b/wmhexaclock/src/main.c @@ -55,14 +55,14 @@ bool errorColor(char *color) if (strlen(color)!=6) return true; - + for (i=0;i<6;i++) { if ((color[i]<48 || color[i]>57) && (color[i]<65 || color[i]>70) && (color[i]<97 || color[i]>102)) return true; } - + return false; } @@ -113,7 +113,7 @@ int main(int argc, char *argv[]) { XEvent event; actualtime=time(0); - + static struct option long_options[] = { /* These options set a flag. */ @@ -129,13 +129,13 @@ int main(int argc, char *argv[]) { int c; int option_index = 0; - + c = getopt_long (argc, argv, "vhc:m:", long_options, &option_index); - + /* Detect the end of the options. */ if (c == -1) break; - + switch (c) { case 'v': @@ -145,7 +145,7 @@ int main(int argc, char *argv[]) print_help(); break; case 'c': - setColor(optarg); + setColor(optarg); break; case 'm': setMode(optarg); @@ -161,14 +161,14 @@ int main(int argc, char *argv[]) openXwindow(argc, argv, xpm_numbers, xpm_master, xpm_mask_bits, xpm_mask_width, xpm_mask_height); - + /* Loop Forever */ - while (1) + while (1) { if (actualtime!=time(0)) - beat(); + beat(); /* Process any pending X events. */ - while (XPending(display)) + while (XPending(display)) { XNextEvent(display, &event); if (event.type==Expose) @@ -189,17 +189,17 @@ void beat() time_struct=localtime(&actualtime); cleanXPMArea(); - + display_time(time_struct->tm_hour,HOUR); display_time(time_struct->tm_min,MINUTE); display_time(time_struct->tm_sec,SECOND); copyXPMArea(177,0,8,12,27,3); /*Display the two dots*/ - + display_lines(time_struct->tm_sec); display_date(time_struct->tm_wday,time_struct->tm_mday,time_struct->tm_mon,time_struct->tm_year+1900,g_mode,time_struct->tm_sec); - - RedrawWindow(); + + RedrawWindow(); } void display_time(int number,int time_unit){ @@ -246,9 +246,9 @@ void display_date(int day_of_week, int day_of_month, int month, int year,int mod int first_pos_year=year/256; int second_pos_year=(year-first_pos_year*256)/16; int third_pos_year=year-first_pos_year*256-second_pos_year*16; - + static bool rec_mode; - + if (mode==1) { copyXPMArea((day_of_week-1)*22,20,22,9,5,39); @@ -262,12 +262,12 @@ void display_date(int day_of_week, int day_of_month, int month, int year,int mod copyXPMArea(third_pos_year*7,12,7,8,53,50); } else - { + { if (seconds%3==0) rec_mode=!rec_mode; } - if (rec_mode) + if (rec_mode) copyXPMArea((day_of_week-1)*31,32,31,12,16,39); else { diff --git a/wmhexaclock/src/wmgeneral.h b/wmhexaclock/src/wmgeneral.h index 48ccacd..1fd1c23 100644 --- a/wmhexaclock/src/wmgeneral.h +++ b/wmhexaclock/src/wmgeneral.h @@ -18,8 +18,8 @@ XpmIcon wmempty; /* Function Prototypes */ void openXwindow(int argc, char *argv[], char **, char **, char *, int, int); -void RedrawWindow(void); -void copyXPMArea(int, int, int, int, int, int); -void cleanXPMArea(); +void RedrawWindow(void); +void copyXPMArea(int, int, int, int, int, int); +void cleanXPMArea(); #endif diff --git a/wmix/mixer-alsa.c b/wmix/mixer-alsa.c index 065e01a..686b3b7 100644 --- a/wmix/mixer-alsa.c +++ b/wmix/mixer-alsa.c @@ -226,7 +226,7 @@ static bool get_mixer_state(void) element[e].is_muted = element_is_muted(e); element[e].is_recording = element_is_recording(e); - //printf("Channel %s, has_vol: %d, stereo: %d, muted: %d, max: %ld, min: %ld, left: %ld, right: %ld, vol: %f, bal: %f\n", element[e].name, element[e].has_playback, element[e].is_stereo, element[e].is_muted, element[e].max, element[e].min, left, element[e].is_stereo?right:-1, element[e].volume, element[e].balance); + //printf("Channel %s, has_vol: %d, stereo: %d, muted: %d, max: %ld, min: %ld, left: %ld, right: %ld, vol: %f, bal: %f\n", element[e].name, element[e].has_playback, element[e].is_stereo, element[e].is_muted, element[e].max, element[e].min, left, element[e].is_stereo?right:-1, element[e].volume, element[e].balance); } return true; } diff --git a/wmjmail/CHANGES b/wmjmail/CHANGES index 35286a4..8ac260e 100644 --- a/wmjmail/CHANGES +++ b/wmjmail/CHANGES @@ -6,7 +6,7 @@ Wed Mar 28 07:59:14 EST 2001 Andre Merzky gave me a patch for some lovely changes to this little app. I had requests for one of them, so I was very exicted. - The changes (including an efficiency improvement) were sufficient to + The changes (including an efficiency improvement) were sufficient to warrent a version change. Thanx Andre! Tue Aug 24 20:55:57 EDT 1999 diff --git a/wmjmail/CREDITS b/wmjmail/CREDITS index 7fa71a2..4d7ab41 100644 --- a/wmjmail/CREDITS +++ b/wmjmail/CREDITS @@ -15,25 +15,25 @@ Jettero Heller The inspiration and some of the code for wmstock came from wmWeather (v1.30), an excellent dock application. wmWeather was written by Mike Henderson -and it is available from: +and it is available from: http://nis-www.lanl.gov/~mgh/WindowMaker/DockApps.shtml *** I no longer use this PERL package, but I did take some code from it, and used it for versions 0.01 and 0.02 *** -I also used some code from the Finance::YahooQuotes PERL Module, which is +I also used some code from the Finance::YahooQuotes PERL Module, which is written by Dj Padzensky <[email protected]> The Finance::YahooQuote home page can be found at http://www.padz.net/~djpadz/YahooQuote/ -------------------------------------------------------------------------------- -As I learned more about writing dock apps, I produced more and more of +As I learned more about writing dock apps, I produced more and more of my own code, and fixed what I believe were engineering flaws in wmWeather, however, I recommend to anyone who wants to get started in dock app programming to start with wmWeather, and perhaps also check out this page: - + http://www.inria.fr/koala/lehors/xpm.html (info about XPMs) Also, for those of you using XPMs in your code, I found its easier to start diff --git a/wmjmail/src/Andre.Merzky.audio.patch b/wmjmail/src/Andre.Merzky.audio.patch index 70254da..32324b1 100644 --- a/wmjmail/src/Andre.Merzky.audio.patch +++ b/wmjmail/src/Andre.Merzky.audio.patch @@ -3,19 +3,19 @@ @@ -11,41 +11,56 @@ #include <sys/time.h> #include <sys/types.h> - + +#define AUDIOPLAYER "/usr/bin/play" +#define AUDIOFILE "/usr/share/audio/clink.au" #define SPOOLDIR "/var/spool/mail/" #define APPLICATION "xterm -sb -sl 2000 +si +sk -title XTerm -fg black -bg wheat -geometry 71x50-0-0 -e mutt &" - + int dontread = 0; static char my_folder[256]; static char my_app[256]; +static char my_audio[512]; static int my_new, my_tot, my_read; static off_t size; - + void show_help() { - printf("-s <sec>: Seconds between executions of mailchk\n"); - printf("-r : Don't show the read mail stat.\n"); @@ -25,10 +25,10 @@ + printf("-f <folder>: Mail folder to watch \n"); + printf("-P <player>: Audio player to use for notification \n"); + printf("-p <afile> : Audio file to play for notification \n"); - + exit(0); } - + void setup(int argc, char** argv) { - char c; - int i; @@ -41,7 +41,7 @@ + snprintf (my_folder, 255, "%s/%s", SPOOLDIR, getenv("USER")); + snprintf (my_aplayer, 255, "%s", AUDIOPLAYER); + snprintf (my_afile, 255, "%s", AUDIOFILE); - + - snprintf (my_app, 255, "%s", APPLICATION); - snprintf (my_folder, 255, "%s/%s", SPOOLDIR, getenv("USER")); - @@ -50,7 +50,7 @@ switch(c) { case '?': exit(1); case 'h': show_help(); - + case 'r': dontread = 1; break; case 's': i=atoi(optarg); break; - case 'x': snprintf (my_app, 255, "%s", optarg); break; @@ -61,16 +61,16 @@ + case 'P': snprintf (my_aplayer, 255, "%s", optarg); break; } } - + + snprintf (my_audio, 511, "%s %s &", my_aplayer, my_afile); -+ ++ set_update_delay((i) ? i : 15); /* seconds */ set_loop_delay(1000); /* mu seconds */ } @@ -55,7 +70,6 @@ int in; struct stat buf; - + - fprintf (stderr, "Stat '%s'\n", my_folder); if ( stat (my_folder, &buf) != 0 ) { @@ -86,6 +86,6 @@ + { + system (my_audio); + } - + size = buf.st_size; } diff --git a/wmjmail/src/Andre.Merzky.patch b/wmjmail/src/Andre.Merzky.patch index 50d8186..c543608 100644 --- a/wmjmail/src/Andre.Merzky.patch +++ b/wmjmail/src/Andre.Merzky.patch @@ -3,7 +3,7 @@ @@ -3,7 +3,22 @@ #include <getopt.h> #include "jenglish.h" - + -int dontread = 0; +#include <errno.h> +#include <fcntl.h> @@ -21,7 +21,7 @@ +static char my_app[256]; +static int my_new, my_tot, my_read; +static off_t size; - + void show_help() { printf("-s <sec>: Seconds between executions of mailchk\n"); @@ -15,47 +30,69 @@ @@ -37,7 +37,7 @@ switch(c) { case '?': exit(1); case 'h': show_help(); - + case 'r': dontread = 1; break; case 's': i=atoi(optarg); break; + case 'x': snprintf (my_app, 255, "%s", optarg); break; @@ -48,7 +48,7 @@ set_update_delay((i) ? i : 15); /* seconds */ set_loop_delay(1000); /* mu seconds */ } - + void do_update() { - int i, new, tot, read; - @@ -66,25 +66,25 @@ + fprintf (stderr, "Could not stat '%s'\n", my_folder); + exit (-2); + } -+ ++ + if ( size != buf.st_size ) + { + FILE *f = popen ("mailchk", "r"); + fscanf (f, "%i - %i - %i", &my_new, &my_tot, &my_read); + pclose (f); - + + size = buf.st_size; + } -+ ++ clear_window(); - + jpprintf(0, 0, YELLOW, " J-mail"); - -- jpprintf(1, 2, BLUE, "New", new); + +- jpprintf(1, 2, BLUE, "New", new); - jprintf(GREEN, ":"); - if(new) { - jpprintf(7, 2, RED, "%i", new); -+ jpprintf(1, 2, BLUE, "New"); ++ jpprintf(1, 2, BLUE, "New"); + jpprintf(6, 2, GREEN, ":"); + if (my_new) { + jpprintf(7, 2, RED, "%i", my_new); @@ -92,7 +92,7 @@ - jpprintf(7, 2, CYAN, "%i", new); + jpprintf(7, 2, CYAN, "%i", my_new); } - + - if(!dontread) { - jpprintf(1, 3, BLUE, "Read", read); - jprintf(GREEN, ":"); @@ -102,7 +102,7 @@ + jpprintf(6, 3, GREEN, ":"); + jpprintf(7, 3, CYAN, "%i", my_read); } - + - jpprintf(1, 4, BLUE, "Total", tot); - jprintf(GREEN, ":"); - jpprintf(7, 4, CYAN, "%i", tot); @@ -110,11 +110,11 @@ + jpprintf(6, 4, GREEN, ":"); + jpprintf(7, 4, CYAN, "%i", my_tot); } - + void do_expose() { @@ -63,5 +100,6 @@ } - + void do_button_release() { - do_update(); + system (my_app); diff --git a/wmjmail/src/Jet.post-andre.patch b/wmjmail/src/Jet.post-andre.patch index 41b59ba..a7c4b57 100644 --- a/wmjmail/src/Jet.post-andre.patch +++ b/wmjmail/src/Jet.post-andre.patch @@ -9,16 +9,16 @@ + +// I wanted a different default than Andre, since I print it and no-longer use '&' +//#define APPLICATION "xterm -sb -sl 2000 +si +sk -title XTerm -fg black -bg wheat -geometry 71x50-0-0 -e mutt &" - + int dontread = 0; static char my_folder[256]; static char my_app[256]; static char my_audio[512]; -+static char my_aplayer[256]; // made global for the help -+static char my_afile[256]; // made global for the help ++static char my_aplayer[256]; // made global for the help ++static char my_afile[256]; // made global for the help static int my_new, my_tot, my_read; static off_t size; - + void show_help() { - printf("-r : Don't show the read mail stat.\n"); - printf("-s <sec> : Seconds between executions of mailchk\n"); @@ -32,7 +32,7 @@ + printf("-f <folder>: Mail folder to watch [%s]\n", my_folder); + printf("-P <player>: Audio player to use for notification [%s]\n", my_afile); + printf("-p <afile> : Audio file to play for notification [%s]\n", my_aplayer); - + exit(0); } @@ -37,8 +42,6 @@ @@ -41,13 +41,13 @@ int i; - char my_aplayer[256]; - char my_afile[256]; - + snprintf (my_app, 255, "%s", APPLICATION); snprintf (my_folder, 255, "%s/%s", SPOOLDIR, getenv("USER")); @@ -70,15 +73,13 @@ int in; struct stat buf; - + - if ( stat (my_folder, &buf) != 0 ) - { + if ( stat (my_folder, &buf) != 0 ) { @@ -55,7 +55,7 @@ fprintf (stderr, "Could not stat '%s'\n", my_folder); exit (-2); } - + - if ( size != buf.st_size ) - { + if ( size != buf.st_size ) { @@ -64,7 +64,7 @@ pclose (f); @@ -121,6 +122,9 @@ } - + void do_button_release() { - system (my_app); + if(!fork()) { @@ -72,4 +72,4 @@ + exit( 0 ); + } } - + diff --git a/wmjmail/src/Jet.stat.patch b/wmjmail/src/Jet.stat.patch index 3fbfb8b..4c668d7 100644 --- a/wmjmail/src/Jet.stat.patch +++ b/wmjmail/src/Jet.stat.patch @@ -2,7 +2,7 @@ +++ wmjmail.c.3 Sat Apr 14 10:13:35 2001 @@ -20,6 +20,7 @@ //#define APPLICATION "xterm -sb -sl 2000 +si +sk -title XTerm -fg black -bg wheat -geometry 71x50-0-0 -e mutt &" - + int dontread = 0; +static char my_cmd[350]; static char my_folder[256]; @@ -11,14 +11,14 @@ @@ -62,6 +63,7 @@ } } - + + snprintf (my_cmd, 350, "mailchk %s", my_folder); snprintf (my_audio, 511, "%s %s &", my_aplayer, my_afile); - + set_update_delay((i) ? i : 15); /* seconds */ @@ -74,20 +76,19 @@ struct stat buf; - + if ( stat (my_folder, &buf) != 0 ) { - perror (""); - fprintf (stderr, "Could not stat '%s'\n", my_folder); @@ -28,13 +28,13 @@ + //exit (-2); + buf.st_size = 0; } - + if ( size != buf.st_size ) { - FILE *f = popen ("mailchk", "r"); + FILE *f = popen (my_cmd, "r"); fscanf (f, "%i - %i - %i", &my_new, &my_tot, &my_read); pclose (f); - + /* Do not play on startup, and only on NEW mails */ - if ( size != 0 && - size < buf.st_size ) @@ -42,4 +42,4 @@ + if ( size != 0 && size < buf.st_size ) { system (my_audio); } - + diff --git a/wmjmail/src/jDockApp/jDockApp.c b/wmjmail/src/jDockApp/jDockApp.c index b80c016..86a4eca 100644 --- a/wmjmail/src/jDockApp/jDockApp.c +++ b/wmjmail/src/jDockApp/jDockApp.c @@ -12,7 +12,7 @@ int main(int argc, char **argv) { initXwindow(argc, argv); openXwindow(argc, argv, jDockApp_main_xpm, jDockApp_mask_xpm, - mask_width, mask_height, "#000000", "#000000", "#000000", + mask_width, mask_height, "#000000", "#000000", "#000000", "#000000", "#000000" ); @@ -37,11 +37,11 @@ int main(int argc, char **argv) { RedrawWindow(); break; case EnterNotify: - XSetInputFocus(display, + XSetInputFocus(display, PointerRoot, RevertToParent, CurrentTime); break; case LeaveNotify: - XSetInputFocus(display, + XSetInputFocus(display, PointerRoot, RevertToParent, CurrentTime); break; } diff --git a/wmjmail/src/jDockApp/jprintf.c b/wmjmail/src/jDockApp/jprintf.c index 8f55ddd..6aee482 100644 --- a/wmjmail/src/jDockApp/jprintf.c +++ b/wmjmail/src/jDockApp/jprintf.c @@ -131,10 +131,10 @@ void jprintf_internal(int color, const char *line) { if(copy_start) copyXPMArea( copy_start, - color, + color, copy_width, char_height, - start_x+line_position, + start_x+line_position, start_y ); diff --git a/wmjmail/src/jenglish.h b/wmjmail/src/jenglish.h index d1f819b..64ecb36 100644 --- a/wmjmail/src/jenglish.h +++ b/wmjmail/src/jenglish.h @@ -2,7 +2,7 @@ ** This file does all of the #include's for the driver. It also ** sets up some english like functions... ** Strictly speaking, it's poor style to put functions in a header file. -** The functions in here arn't really functions though... +** The functions in here arn't really functions though... */ #include <signal.h> #include <stdio.h> diff --git a/wmjmail/src/wmjmail.jet b/wmjmail/src/wmjmail.jet index dce8e49..75d6ad6 100644 --- a/wmjmail/src/wmjmail.jet +++ b/wmjmail/src/wmjmail.jet @@ -39,7 +39,7 @@ void do_update() { jpprintf(0, 0, YELLOW, " J-mail"); - jpprintf(1, 2, BLUE, "New", new); + jpprintf(1, 2, BLUE, "New", new); jprintf(GREEN, ":"); if(new) { jpprintf(7, 2, RED, "%i", new); @@ -61,7 +61,7 @@ void do_update() { void do_expose() { do_update(); } - + void do_button_release() { do_update(); } diff --git a/wmjmail/src/xutils/xutils.c b/wmjmail/src/xutils/xutils.c index e93976b..10e71eb 100644 --- a/wmjmail/src/xutils/xutils.c +++ b/wmjmail/src/xutils/xutils.c @@ -1,10 +1,10 @@ /* * xutils.c - A collection of X-windows utilties for creating WindowMAker - * DockApps. + * DockApps. * * This file contains alot of the lower-level X windows routines. Origins * with wmppp (by Martijn Pieterse ([email protected])), but its been - * hacked up quite a bit and passed on from one new DockApp to the next. + * hacked up quite a bit and passed on from one new DockApp to the next. * * * @@ -27,7 +27,7 @@ * * * - */ + */ #include <stdlib.h> #include <stdio.h> #include <string.h> @@ -42,7 +42,7 @@ /* - * X11 Variables + * X11 Variables */ int x_fd; XSizeHints mysizehints; @@ -85,7 +85,7 @@ static int flush_expose(Window w) { * RedrawWindowXY */ void RedrawWindow(void) { - + flush_expose(iconwin); XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, 0,0, wmgen.attributes.width, wmgen.attributes.height, 0, 0); @@ -95,7 +95,7 @@ void RedrawWindow(void) { } void RedrawWindowXY(int x, int y) { - + flush_expose(iconwin); XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, x,y, wmgen.attributes.width, wmgen.attributes.height, 0, 0); @@ -165,8 +165,8 @@ void initXwindow(int argc, char *argv[]){ /* * openXwindow */ -void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bits, - int pixmask_width, int pixmask_height, char *BackColor, char *LabelColor, +void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bits, + int pixmask_width, int pixmask_height, char *BackColor, char *LabelColor, char *WindGustColor, char *DataColor, char *StationTimeColor) { unsigned int borderwidth = 1; @@ -183,9 +183,9 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit {"StationTimeColor", NULL, 0} }; - - /* + + /* * Create Pixmap */ cols[0].pixel = getColor(BackColor, 1.0); @@ -197,9 +197,9 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit wmgen.attributes.colorsymbols = cols; wmgen.attributes.exactColors = False; wmgen.attributes.closeness = 40000; - wmgen.attributes.valuemask = XpmReturnPixels | XpmReturnExtensions | XpmColorSymbols + wmgen.attributes.valuemask = XpmReturnPixels | XpmReturnExtensions | XpmColorSymbols | XpmExactColors | XpmCloseness | XpmSize; - if (XpmCreatePixmapFromData(display, Root, pixmap_bytes, + if (XpmCreatePixmapFromData(display, Root, pixmap_bytes, &(wmgen.pixmap), &(wmgen.mask), &(wmgen.attributes)) != XpmSuccess){ fprintf(stderr, "Not enough free colorcells.\n"); exit(1); @@ -208,8 +208,8 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit - /* - * Create a window + /* + * Create a window */ mysizehints.flags = USSize | USPosition; mysizehints.x = 0; @@ -223,19 +223,19 @@ 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); - /* - * Activate hints + /* + * Activate hints */ XSetWMNormalHints(display, win, &mysizehints); classHint.res_name = wname; @@ -250,11 +250,11 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit * effect. I.e. for some you will need to Grab the focus and then return * it after you are done... */ - XSelectInput(display, win, ButtonPressMask | ExposureMask | ButtonReleaseMask - | PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask + XSelectInput(display, win, ButtonPressMask | ExposureMask | ButtonReleaseMask + | PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask | KeyPressMask | KeyReleaseMask); - XSelectInput(display, iconwin, ButtonPressMask | ExposureMask | ButtonReleaseMask - | PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask + XSelectInput(display, iconwin, ButtonPressMask | ExposureMask | ButtonReleaseMask + | PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask | KeyPressMask | KeyReleaseMask); @@ -266,8 +266,8 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit XSetWMName(display, win, &name); - /* - * Create Graphics Context (GC) for drawing + /* + * Create Graphics Context (GC) for drawing */ gcm = GCForeground | GCBackground | GCGraphicsExposures; gcv.foreground = fore_pix; diff --git a/wmjmail/src/xutils/xutils.h b/wmjmail/src/xutils/xutils.h index 5b6231f..fcd25f6 100644 --- a/wmjmail/src/xutils/xutils.h +++ b/wmjmail/src/xutils/xutils.h @@ -4,7 +4,7 @@ /* - * Typedefs + * Typedefs */ typedef struct { Pixmap pixmap; @@ -21,7 +21,7 @@ typedef struct { Display *display; Window Root; Window iconwin, win; -int screen; +int screen; int DisplayDepth; diff --git a/wmlongrun/README b/wmlongrun/README index 3175302..e159556 100644 --- a/wmlongrun/README +++ b/wmlongrun/README @@ -50,7 +50,7 @@ For AfterStep users =================== Add this line to your ~/GNUstep/Library/AfterStep/wharf: - *Wharf wmlongrun - Swallow "wmlongrun" wmlongrun -w & + *Wharf wmlongrun - Swallow "wmlongrun" wmlongrun -w & For Enlightenment users diff --git a/wmlongrun/configure.ac b/wmlongrun/configure.ac index 53c2fb4..3b48676 100644 --- a/wmlongrun/configure.ac +++ b/wmlongrun/configure.ac @@ -17,11 +17,11 @@ dnl =============================================== AC_ARG_WITH(libs-from, [ --with-libs-from pass compiler flags to look for libraries], [lib_search_path="$withval $lib_search_path"]) - + AC_ARG_WITH(incs-from, [ --with-incs-from pass compiler flags to look for header files], [inc_search_path="$withval $inc_search_path"]) - + dnl =========================================== dnl Stuff that uses X diff --git a/wmlongrun/doc/wmlongrun.1 b/wmlongrun/doc/wmlongrun.1 index d912ca7..2be7e4e 100644 --- a/wmlongrun/doc/wmlongrun.1 +++ b/wmlongrun/doc/wmlongrun.1 @@ -26,7 +26,7 @@ This manual page documents briefly the command. .PP .\" TeX users may be more comfortable with the \fB<whatever>\fP and -.\" \fI<whatever>\fP escape sequences to invode bold face and italics, +.\" \fI<whatever>\fP escape sequences to invode bold face and italics, .\" respectively. \fBWMLongRun\fP is a program to monitor for LongRun(tm). It displays the current LongRun(tm) settings and status: the frequency, the LongRun(tm) flags diff --git a/wmlongrun/src/Makefile.am b/wmlongrun/src/Makefile.am index 4719d4f..bd1c647 100644 --- a/wmlongrun/src/Makefile.am +++ b/wmlongrun/src/Makefile.am @@ -22,10 +22,10 @@ CPPFLAGS = \ INCLUDES = \ @HEADER_SEARCH_PATH@ - + wmlongrun_LDADD = \ @LIBRARY_SEARCH_PATH@ \ - @XLIBS@ + @XLIBS@ INSTALL_PROGRAM = \ @INSTALL_PROGRAM@ \ diff --git a/wmmp3/AUTHORS b/wmmp3/AUTHORS index 3a823a7..e80cc33 100644 --- a/wmmp3/AUTHORS +++ b/wmmp3/AUTHORS @@ -1,10 +1,10 @@ wmmp3 Authors: -Primary Author: +Primary Author: Patrick Crosby <[email protected]> Contributors: - Matthew D. Campbell <[email protected]> + Matthew D. Campbell <[email protected]> (random play functionality, plus alwaysscroll) Steven Jorgensen (bug fixes with song names, added ability for diff --git a/wmmp3/COPYING b/wmmp3/COPYING index 5c1f80c..8fb900c 100644 --- a/wmmp3/COPYING +++ b/wmmp3/COPYING @@ -1,8 +1,8 @@ GNU GENERAL PUBLIC LICENSE -Version 2, June 1991 +Version 2, June 1991 -Copyright (C) 1989, 1991 Free Software Foundation, Inc. +Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Everyone is permitted to copy and distribute verbatim copies @@ -13,142 +13,142 @@ Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is -covered by the GNU Library General Public License instead.) You can apply it to your programs, too. +covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the -software or use pieces of it in new free programs; and that you know you can do these things. +software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions -translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. +translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make -sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. +sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or -modify the software. +modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced -by others will not reflect on the original authors' reputations. +by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free -use or not licensed at all. +use or not licensed at all. -The precise terms and conditions for copying, distribution and modification follow. +The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or -translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". +translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by -running the Program). Whether that is true depends on what the Program does. +running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the -absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. +absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. -You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. +You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such -modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: +modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: - a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. + a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be - licensed as a whole at no charge to all third parties under the terms of this License. + licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not - required to print an announcement.) + required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on -the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. +the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control -the distribution of derivative or collective works based on the Program. +the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage -or distribution medium does not bring the other work under the scope of this License. +or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 -above provided that you also do one of the following: +above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 - above on a medium customarily used for software interchange; or, + above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above - on a medium customarily used for software interchange; or, + on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b - above.) + above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself -accompanies the executable. +accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object -code. +code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or -rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. +rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the -Program or works based on it. +Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the -rights granted herein. You are not responsible for enforcing compliance by third parties to this License. +rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from -distribution of the Program. +distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section -as a whole is intended to apply in other circumstances. +as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the -author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. +author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. -This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. +This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted -only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. +only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar -in spirit to the present version, but may differ in detail to address new problems or concerns. +in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the -Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. +Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of -software generally. +software generally. NO WARRANTY @@ -157,13 +157,13 @@ PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIG PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU -ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. +ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH -HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. +HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS diff --git a/wmmp3/ChangeLog b/wmmp3/ChangeLog index 0e0707f..acf5352 100644 --- a/wmmp3/ChangeLog +++ b/wmmp3/ChangeLog @@ -15,4 +15,3 @@ Wed Oct 6 12:55:00 1999 Patrick Crosby <[email protected]> * configure added...whole building process should be working now. - \ No newline at end of file diff --git a/wmmp3/INSTALL b/wmmp3/INSTALL index ac8dade..ece0514 100644 --- a/wmmp3/INSTALL +++ b/wmmp3/INSTALL @@ -6,9 +6,9 @@ wmmp3 v0.06 INSTALL -- Patrick Crosby <[email protected]> 3. Type 'make install' -The default will probably put it in /usr/local/bin. Use +The default will probably put it in /usr/local/bin. Use - ./configure --help + ./configure --help to set various options if the default is not right for you. diff --git a/wmmp3/Makefile.in b/wmmp3/Makefile.in index 65dbf77..d3f62fd 100644 --- a/wmmp3/Makefile.in +++ b/wmmp3/Makefile.in @@ -67,11 +67,11 @@ wmmp3_SOURCES = main.c mpg123ctl.c wmgeneral.c buttons.c main.h mpg123ctl.h wmge EXTRA_DIST = sample.wmmp3 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = PROGRAMS = $(bin_PROGRAMS) -DEFS = @DEFS@ -I. -I$(srcdir) +DEFS = @DEFS@ -I. -I$(srcdir) CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ @@ -81,8 +81,8 @@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ wmmp3_OBJECTS = main.o mpg123ctl.o wmgeneral.o buttons.o song_hash.o wmmp3_LDADD = $(LDADD) -wmmp3_DEPENDENCIES = -wmmp3_LDFLAGS = +wmmp3_DEPENDENCIES = +wmmp3_LDFLAGS = CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) @@ -102,14 +102,14 @@ OBJECTS = $(wmmp3_OBJECTS) all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .o .s -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status -$(ACLOCAL_M4): configure.in +$(ACLOCAL_M4): configure.in cd $(srcdir) && $(ACLOCAL) config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) diff --git a/wmmp3/README b/wmmp3/README index 2e4956f..546e99e 100644 --- a/wmmp3/README +++ b/wmmp3/README @@ -1,18 +1,18 @@ wmmp3 v0.08 README -- Patrick Crosby <[email protected]> -wmmp3 is an mpg123 frontend. It is a small X application that will also +wmmp3 is an mpg123 frontend. It is a small X application that will also work as a windowmaker dock app. -All user options are contained in a config file, ~/.wmmp3 . There is a -sample.wmmp3 file in the distribution that can be used as an +All user options are contained in a config file, ~/.wmmp3 . There is a +sample.wmmp3 file in the distribution that can be used as an example/template. -Basically, enter in the config file any directories that contain mp3 files -and wmmp3 right now will play all the files in each directory sequentially +Basically, enter in the config file any directories that contain mp3 files +and wmmp3 right now will play all the files in each directory sequentially when you press play. You can select which directory to start with by using the up/down buttons in the left frame when the player is stopped. Pressing the "infinity" button will cause the player to repeat the songs in the current -directory instead of just playing them once. Pressing the "random" (R) button +directory instead of just playing them once. Pressing the "random" (R) button will cause the player to randomly select songs from the current directory. More documentation can be found at http://dotfiles.com/software/wmmp3/ diff --git a/wmmp3/buttons.c b/wmmp3/buttons.c index fb86eb7..98bfd10 100644 --- a/wmmp3/buttons.c +++ b/wmmp3/buttons.c @@ -3,10 +3,10 @@ * Copyright (c)1999 Patrick Crosby <[email protected]>. * This software covered by the GPL. See COPYING file for details. * - * buttons.c - * + * buttons.c + * * This file contains button code. - * + * * $Id: mpg123ctl.c,v 1.12 1999/10/08 06:21:41 pcrosby Exp $ */ diff --git a/wmmp3/buttons.h b/wmmp3/buttons.h index 019de56..f5cfe23 100644 --- a/wmmp3/buttons.h +++ b/wmmp3/buttons.h @@ -3,10 +3,10 @@ * Copyright (c)1999 Patrick Crosby <[email protected]>. * This software covered by the GPL. See COPYING file for details. * - * buttons.h - * + * buttons.h + * * header file for buttons.c - * + * * $Id: mpg123ctl.c,v 1.12 1999/10/08 06:21:41 pcrosby Exp $ */ diff --git a/wmmp3/configure b/wmmp3/configure index 0675bd0..6b303c2 100755 --- a/wmmp3/configure +++ b/wmmp3/configure @@ -1,7 +1,7 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 +# Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation diff --git a/wmmp3/install-sh b/wmmp3/install-sh index e9de238..594a4ed 100755 --- a/wmmp3/install-sh +++ b/wmmp3/install-sh @@ -115,7 +115,7 @@ fi if [ x"$dir_arg" != x ]; then dst=$src src="" - + if [ -d $dst ]; then instcmd=: chmodcmd="" @@ -125,7 +125,7 @@ if [ x"$dir_arg" != x ]; then else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad +# might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] @@ -135,7 +135,7 @@ else echo "install: $src does not exist" exit 1 fi - + if [ x"$dst" = x ] then echo "install: no destination specified" @@ -163,7 +163,7 @@ dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then -defaultIFS=' +defaultIFS=' ' IFS="${IFS-${defaultIFS}}" @@ -202,17 +202,17 @@ else # If we're going to rename the final executable, determine the name now. - if [ x"$transformarg" = x ] + if [ x"$transformarg" = x ] then dstfile=`basename $dst` else - dstfile=`basename $dst $transformbasename | + dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename - if [ x"$dstfile" = x ] + if [ x"$dstfile" = x ] then dstfile=`basename $dst` else @@ -243,7 +243,7 @@ else # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile + $doit $mvcmd $dsttmp $dstdir/$dstfile fi && diff --git a/wmmp3/main.c b/wmmp3/main.c index 675e99f..ec3bdac 100644 --- a/wmmp3/main.c +++ b/wmmp3/main.c @@ -4,10 +4,10 @@ * This software covered by the GPL. See COPYING file for details. * * main.c - * + * * This is the main body of the application. Handles all initialization * plus the X event loop. - * + * * $Id: main.c,v 1.11 1999/10/08 22:21:32 pcrosby Exp $ */ @@ -47,10 +47,10 @@ void stripspace(char *s) { t++; *t = '\0'; } - + int handle_button_press(int x, int y) { int i; - + i = CheckMouseRegion(x, y); switch (i) { case B_STOP: @@ -92,7 +92,7 @@ int handle_button_press(int x, int y) { default: fprintf(stderr, "unknown button pressed\n"); } - RedrawWindow(); + RedrawWindow(); return(i); } @@ -101,7 +101,7 @@ void handle_button_release(int i) { /* play stays down, don't mess with toggles */ /* ignore song title press too */ - if (((i != B_PLAY) && (i != B_RAND)) && + if (((i != B_PLAY) && (i != B_RAND)) && ((i != B_REPEAT) && (i != B_TITLE))) { if (!is_playing()) { button_up(i); @@ -207,7 +207,7 @@ int check_options(int argc, char *argv[]) int option_entered = 0; int i; - + for (i = 1; i < argc; i++) { if (streq(argv[i], "-h")) { option_entered = 1; @@ -285,7 +285,7 @@ void main(int argc, char *argv[]) XCloseDisplay(display); exit(0); case ButtonPress: - btn_num = handle_button_press(Event.xbutton.x, + btn_num = handle_button_press(Event.xbutton.x, Event.xbutton.y); break; case ButtonRelease: diff --git a/wmmp3/main.h b/wmmp3/main.h index 70404c4..9908c04 100644 --- a/wmmp3/main.h +++ b/wmmp3/main.h @@ -4,9 +4,9 @@ * This software covered by the GPL. See COPYING file for details. * * main.h - * - * Header file for main.c - * + * + * Header file for main.c + * * $Id: main.h,v 1.4 1999/10/08 22:21:32 pcrosby Exp $ */ diff --git a/wmmp3/mpg123ctl.c b/wmmp3/mpg123ctl.c index b2e116b..83cd5dc 100644 --- a/wmmp3/mpg123ctl.c +++ b/wmmp3/mpg123ctl.c @@ -3,11 +3,11 @@ * Copyright (c)1999 Patrick Crosby <[email protected]>. * This software covered by the GPL. See COPYING file for details. * - * mpg123ctl.c - * - * This file contains all the functions for controlling the - * mpg123 backend processes. - * + * mpg123ctl.c + * + * This file contains all the functions for controlling the + * mpg123 backend processes. + * * Random play functionality courtesy of: * Matthew D. Campbell <[email protected]> * @@ -74,7 +74,7 @@ int is_playing() } /* - * patch received from Steven Jorgensen to fix following function + * patch received from Steven Jorgensen to fix following function */ void set_playlist() @@ -88,7 +88,7 @@ void set_playlist() directory = (char *) current_mp3dir(); - if (directory) + if (directory) { dp = opendir(directory); if (dp == NULL) { @@ -124,7 +124,7 @@ void set_playlist() rand_song_num = (int *)malloc(sizeof(int)*num_songs); if (!rand_song_num) { /* This shouldn't happen - the list isn't that big */ - fprintf(stderr, + fprintf(stderr, "Error: cannot allocate randomized list\n"); exit(1); } @@ -144,7 +144,7 @@ void set_playlist() * functions that actually control mpg123 */ -void signal_play() +void signal_play() { int status; @@ -153,7 +153,7 @@ void signal_play() play_next(); } -void play(char *song_name) +void play(char *song_name) { if ((play_pid = fork()) == 0) { execl(mpg123_cmd, mpg123_cmd, "-q", @@ -162,7 +162,7 @@ void play(char *song_name) } } -void play_next() +void play_next() { struct hash_elt *song; @@ -183,7 +183,7 @@ void play_next() scroll_pos = 0; do_scroll = 1; scroll_title(); - + play(song->filename); next_song++; signal(SIGCHLD, signal_play); @@ -192,7 +192,7 @@ void play_next() } } -void play_prev() +void play_prev() { struct hash_elt *song; @@ -245,7 +245,7 @@ void back() * initialization functions */ -void init_ctl() +void init_ctl() { signal(SIGINT, finish); signal(SIGCHLD, dostuff); @@ -297,7 +297,7 @@ void push_dirname(char *s) if ((strlen(s) + 1) < 10) dirnames[ntop] = (char *) malloc(10); else - dirnames[ntop] = (char *) malloc(strlen(s) + 1); + dirnames[ntop] = (char *) malloc(strlen(s) + 1); strcpy(dirnames[ntop], s); ntop++; nmax_dirs++; @@ -372,13 +372,13 @@ void dir_down(int button_num) } } -void load_next_dir() +void load_next_dir() { next_mp3dir(); set_playlist(); } -void load_prev_dir() +void load_prev_dir() { prev_mp3dir(); set_playlist(); @@ -444,7 +444,7 @@ void random_toggle(int button_num) button_down(button_num); random_flag = 1; } else { - button_up(button_num); + button_up(button_num); random_flag = 0; } } @@ -464,7 +464,7 @@ void repeat_toggle(int button_num) * cleanup */ -void finish() +void finish() { stop(); } @@ -472,7 +472,7 @@ void finish() /* * misc */ -void dostuff() +void dostuff() { /* empty */ } diff --git a/wmmp3/mpg123ctl.h b/wmmp3/mpg123ctl.h index c3c7bc6..5109115 100644 --- a/wmmp3/mpg123ctl.h +++ b/wmmp3/mpg123ctl.h @@ -4,9 +4,9 @@ * This software covered by the GPL. See COPYING file for details. * * mpg123ctl.h - * - * Header file for mpg123ctl.c - * + * + * Header file for mpg123ctl.c + * * $Id: mpg123ctl.h,v 1.6 1999/10/12 03:03:33 pcrosby Exp $ */ diff --git a/wmmp3/song_hash.c b/wmmp3/song_hash.c index 492fba5..fc46609 100644 --- a/wmmp3/song_hash.c +++ b/wmmp3/song_hash.c @@ -7,12 +7,12 @@ struct hash_elt *Table[HASH_TABLE_SIZE]; int hash_fn(int num); void free_elt(struct hash_elt *elt); -int hash_fn(int num) +int hash_fn(int num) { return (num % HASH_TABLE_SIZE); } -void insert_song(int track_num, char *title, char *filename) +void insert_song(int track_num, char *title, char *filename) { int hash_value; struct hash_elt *hash_list; @@ -50,7 +50,7 @@ struct hash_elt *get_song(int track_num) hash_value = hash_fn(track_num); hash_list = Table[hash_value]; if (hash_list) { - while ((hash_list->track_num != track_num) && + while ((hash_list->track_num != track_num) && (hash_list->next != NULL)) { hash_list = hash_list->next; } @@ -66,13 +66,13 @@ struct hash_elt *get_song(int track_num) } } -void free_elt(struct hash_elt *elt) +void free_elt(struct hash_elt *elt) { if (elt != NULL) { if (elt->next != NULL) { free_elt(elt->next); - } + } free(elt); } } @@ -80,7 +80,7 @@ void free_elt(struct hash_elt *elt) void empty_hash() { int i; - + for (i = 0; i < HASH_TABLE_SIZE; i++) { free_elt(Table[i]); Table[i] = NULL; @@ -102,7 +102,7 @@ void print_hash() hash_list = hash_list->next; } } - + } diff --git a/wmmp3/wmgeneral.c b/wmmp3/wmgeneral.c index 9e75a51..36c5794 100644 --- a/wmmp3/wmgeneral.c +++ b/wmmp3/wmgeneral.c @@ -19,7 +19,7 @@ * Now supports >256 colors 11/09/1998 (Martijn Pieterse, [email protected]) * Removed a bug from parse_rcfile. You could - not use "start" in a command if a label was + not use "start" in a command if a label was also start. * Changed the needed geometry string. We don't use window size, and don't support diff --git a/wmpop3/CHANGE_LOG b/wmpop3/CHANGE_LOG index 32e3604..50bd810 100644 --- a/wmpop3/CHANGE_LOG +++ b/wmpop3/CHANGE_LOG @@ -4,7 +4,7 @@ Version 0.5.6a : Minor additions * Added extra checking when connecting to pop-server. * Fixed some variable addressing problems. * updated the version number int the source.. :) oops. - + Version 0.5.5a : Minor additions * Fixed Pop3Client, it now closes the socket after use. * Fixed Comment missing in the default config file. diff --git a/wmpop3/INSTALL b/wmpop3/INSTALL index 08a1617..f7e9c80 100644 --- a/wmpop3/INSTALL +++ b/wmpop3/INSTALL @@ -6,7 +6,7 @@ tested and compiled on a i386 Linux machine. There are two methods to install WMPop3, either a system install where all users have access to this file, OR a single user install -which installs WMPop3 in the users home directory, this is useful +which installs WMPop3 in the users home directory, this is useful if you have an account on someone else's computer. First thing you should do is the following: @@ -18,11 +18,11 @@ if you have an account on someone else's computer. Method 1. System install -A system install will place the WMPop3 binary in "/usr/local/pub", +A system install will place the WMPop3 binary in "/usr/local/pub", this can be done as follows (must be root for this ) : - + make install1 - + Method 2. Single user install A single user install will create a directory called wmpop3 in the users diff --git a/wmpop3/README b/wmpop3/README index cfcfb7b..cc2e2f9 100644 --- a/wmpop3/README +++ b/wmpop3/README @@ -8,7 +8,7 @@ responsible for any damages this application may cause your system. 1) WHAT IS THIS WMPop3 is a POP3 mail box checker. It will connect to a POP3 -server to check if you have mail, if you do then it will alert you +server to check if you have mail, if you do then it will alert you of new mail and how many messages are currently in you mail box. 2) How do I configure WMPop3 @@ -35,23 +35,23 @@ be changed : This is the easy part.. 1) If you have no mail, WMPop3 will show a empty mail bin. - + 2) If you have new mail, WMPop3 will show a mail bin containing a message. - - 3) Depending on the option chosen for viewallmessages, either, - a) The number of read and unread messages in you mail box - will be shown below the mailbox image. + + 3) Depending on the option chosen for viewallmessages, either, + a) The number of read and unread messages in you mail box + will be shown below the mailbox image. b) The number of unread messages currently in your mail box will be shown below the mail box image.. * The right button is now used to toggle both views. - + 4) To run your configured mail reader, mouse click on the mail bin. - - 5) To manually check for mail at any time, mouse click on the + + 5) To manually check for mail at any time, mouse click on the center grey button marked "CHECK" on the bottom. - + 6) To turn off auto mail checking mouse click bottom left button marked "AC". A red led will appear up in the top right hand corner, this means that auto mail checking is disabled. diff --git a/wmpop3/wmgeneral/list.c b/wmpop3/wmgeneral/list.c index f804b2c..d9f7329 100644 --- a/wmpop3/wmgeneral/list.c +++ b/wmpop3/wmgeneral/list.c @@ -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; diff --git a/wmpop3/wmgeneral/list.h b/wmpop3/wmgeneral/list.h index af0f22c..be101ef 100644 --- a/wmpop3/wmgeneral/list.h +++ b/wmpop3/wmgeneral/list.h @@ -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 diff --git a/wmpop3/wmgeneral/misc.c b/wmpop3/wmgeneral/misc.c index 34281e2..c36cdb4 100644 --- a/wmpop3/wmgeneral/misc.c +++ b/wmpop3/wmgeneral/misc.c @@ -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); diff --git a/wmpop3/wmgeneral/wmgeneral.c b/wmpop3/wmgeneral/wmgeneral.c index 56b7bd6..c064b39 100644 --- a/wmpop3/wmgeneral/wmgeneral.c +++ b/wmpop3/wmgeneral/wmgeneral.c @@ -17,7 +17,7 @@ * Now supports >256 colors 11/09/1998 (Martijn Pieterse, [email protected]) * Removed a bug from parse_rcfile. You could - not use "start" in a command if a label was + not use "start" in a command if a label was also start. * Changed the needed geometry string. We don't use window size, and don't support @@ -177,7 +177,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); @@ -224,9 +224,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, @@ -238,9 +238,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, @@ -296,7 +296,7 @@ void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) { unsigned char bwrite; int bcount; int curpixel; - + sscanf(*xpm, "%d %d %d %d", &width, &height, &numcol, &depth); @@ -305,7 +305,7 @@ void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) { zero <<=8; zero |= xpm[1][k]; } - + for (i=numcol+1; i < numcol+sy+1; i++) { bcount = 0; bwrite = 0; @@ -318,7 +318,7 @@ void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) { curpixel <<=8; curpixel |= xpm[i][j+k]; } - + if ( curpixel != zero ) { bwrite += 128; } @@ -394,7 +394,7 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit } 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); } @@ -419,10 +419,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); @@ -443,7 +443,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; diff --git a/wmpop3/wmpop3/Makefile b/wmpop3/wmpop3/Makefile index 6bb62bd..a20296f 100644 --- a/wmpop3/wmpop3/Makefile +++ b/wmpop3/wmpop3/Makefile @@ -11,7 +11,7 @@ OBJS = wmpop3.o \ .c.o: cc -I/usr/X11R6/share/include $(FLAGS) -c -Wall $< -o $*.o -wmpop3: $(OBJS) +wmpop3: $(OBJS) cc $(FLAGS) -o wmpop3 $^ -lXext $(LIBDIR) $(LIBS) all:: wmpop3 @@ -20,19 +20,19 @@ clean:: for i in $(OBJS) ; do \ rm -f $$i ; \ done - rm -f wmpop3 + rm -f wmpop3 rm -f *~ -install:: wmpop3 - @echo "Use 'make install1' for system install." +install:: wmpop3 + @echo "Use 'make install1' for system install." @echo "Use 'make install2' for single user install." - @echo + @echo -install1:: wmpop3 +install1:: wmpop3 cp -f wmpop3 /usr/local/bin/ chmod 755 /usr/local/bin/wmpop3 chown root:root /usr/local/bin/wmpop3 - @echo + @echo @echo "WMPop3 Installation finished..." install2:: wmpop3 @@ -42,7 +42,7 @@ install2:: wmpop3 cp -f wmpop3rc $(HOME)/.wmpop3rc chmod 600 $(HOME)/.wmpop3rc @echo "WMPop3 Installation finished..." - @echo + @echo @echo "Make sure ~/wmpop3 is in your path" - @echo + @echo @echo "Please edit ~/.wmpop3rc before running WMPop3." diff --git a/wmpop3/wmpop3/Pop3Client.c b/wmpop3/wmpop3/Pop3Client.c index 808d0c0..f7e5f53 100644 --- a/wmpop3/wmpop3/Pop3Client.c +++ b/wmpop3/wmpop3/Pop3Client.c @@ -1,5 +1,5 @@ /* Author : Scott Holden ( [email protected] ) - * + * * Pop3 Email checker. * * Last Updated : Mar 20, 1999 @@ -80,7 +80,7 @@ int pop3IsConnected(Pop3 pc){ int pop3Login(Pop3 pc, char *name, char *pass){ - int size; + int size; char temp[1024]; if( pc->connected == NOT_CONNECTED ){ @@ -97,7 +97,7 @@ int pop3Login(Pop3 pc, char *name, char *pass){ } sprintf(pc->outBuf,"USER %s\r\n",name); - send(pc->s, &pc->outBuf,strlen(pc->outBuf),0); + send(pc->s, &pc->outBuf,strlen(pc->outBuf),0); size =recv(pc->s,pc->inBuf,1024,0); memset(temp,0,1024); memcpy(temp,pc->inBuf,size); @@ -162,7 +162,7 @@ int pop3CheckMail(Pop3 pc){ int pop3GetTotalNumberOfMessages( Pop3 pc ){ if( pc != 0 ) return pc->numOfMessages; - return -1; + return -1; } int pop3GetNumberOfUnreadMessages( Pop3 pc ){ diff --git a/wmpop3/wmpop3/wmpop3.c b/wmpop3/wmpop3/wmpop3.c index f016cf5..3d9e069 100644 --- a/wmpop3/wmpop3/wmpop3.c +++ b/wmpop3/wmpop3/wmpop3.c @@ -1,6 +1,6 @@ /* * wmpop3.c - * pop3 mail checker. + * pop3 mail checker. * by Scott Holden ([email protected]) * * Contains some code from WMInet Dockable app. @@ -78,7 +78,7 @@ int main(int argc, char *argv[]) { ProgName = argv[0]; if (strlen(ProgName) >= 5) ProgName += (strlen(ProgName) - 5); - + for (i=1; i<argc; i++) { char *arg = argv[i]; @@ -146,13 +146,13 @@ void wmCheckMail_routine(int argc, char **argv){ pc =pop3Create(); /* initialize Pop3 ADT */ /* Set up timer for checking mail */ - startTime = time(0); + startTime = time(0); nextCheckTime = 0; /* Make 0, so it checks for mail on start */ - + createXBMfromXPM(wminet_mask_bits, wmpop3_xpm , wminet_mask_width, wminet_mask_height); - + openXwindow(argc, argv, wmpop3_xpm, wminet_mask_bits , wminet_mask_width, wminet_mask_height); @@ -164,16 +164,16 @@ void wmCheckMail_routine(int argc, char **argv){ /* Check if Autochecking is on or off */ if(autoChecking == NO ){ - copyXPMArea(67, 7 ,4 ,4 ,52 ,7 ); + copyXPMArea(67, 7 ,4 ,4 ,52 ,7 ); } RedrawWindow(); - + while (1){ if( (((time(0) > nextCheckTime) || (nextCheckTime == 0)) - && ( autoChecking == YES)) - || (forcedCheck == YES)){ + && ( autoChecking == YES)) + || (forcedCheck == YES)){ if(pop3MakeConnection(pc,popserver,serverport) == -1){ mailWaiting = -1; } @@ -219,7 +219,7 @@ void wmCheckMail_routine(int argc, char **argv){ RedrawWindow(); - + /* X Events */ while (XPending(display)){ XNextEvent(display, &Event); @@ -255,13 +255,13 @@ void wmCheckMail_routine(int argc, char **argv){ case 3: execCommand(mailclient); /* Recheck mail after 30 seconds, - * This gives time for the mail - * browser to check the account */ + * This gives time for the mail + * browser to check the account */ nextCheckTime = time(0) + 30; break; } } - + break; case ButtonRelease: i = CheckMouseRegion(Event.xbutton.x, Event.xbutton.y); @@ -277,10 +277,10 @@ void wmCheckMail_routine(int argc, char **argv){ if( autoChecking == YES){ autoChecking = NO; /* Activate Red Led */ - copyXPMArea(67, 7 ,4 ,4 ,52 ,7 ); + copyXPMArea(67, 7 ,4 ,4 ,52 ,7 ); }else{ /* Activate Green Led */ - copyXPMArea(67, 2 ,4 ,4 ,52 ,7 ); + copyXPMArea(67, 2 ,4 ,4 ,52 ,7 ); autoChecking = YES; } break; @@ -335,7 +335,7 @@ void BlitString(char *name, int x, int y) k = x; for (i=0; name[i]; i++) { - c = toupper(name[i]); + c = toupper(name[i]); if (c >= 'A' && c <= 'Z') { /* its a letter */ c -= 'A'; @@ -385,7 +385,7 @@ void BlitNum(int num, int x, int y) BlitString(buf, newx, y); } - + int readConfigFile( char *filename ){ char buf[256]; @@ -428,7 +428,7 @@ int readConfigFile( char *filename ){ printf("Invalid UserName.\n"); return -1; } - strcpy(username, ptr); + strcpy(username, ptr); } else if( !strcmp( ptr, "password") ){ ptr = strtok( 0, " \n"); @@ -436,7 +436,7 @@ int readConfigFile( char *filename ){ printf("Invalid password.\n"); return -1; } - strcpy(password, ptr); + strcpy(password, ptr); } else if( !strcmp( ptr, "popserver") ){ ptr = strtok( 0, " \n"); @@ -444,7 +444,7 @@ int readConfigFile( char *filename ){ printf("Invalid popserver address.\n"); return -1; } - strcpy(popserver, ptr); + strcpy(popserver, ptr); } else if( !strcmp( ptr, "mailclient") ){ ptr = strtok( 0, " \n"); @@ -452,7 +452,7 @@ int readConfigFile( char *filename ){ printf("Invalid mailclient.\n"); return -1; } - strcpy(mailclient, ptr); + strcpy(mailclient, ptr); } else if( !strcmp( ptr, "port") ){ ptr = strtok( 0, " \n"); diff --git a/wmpop3/wmpop3/wmpop3rc b/wmpop3/wmpop3/wmpop3rc index dd2ba09..99860e2 100644 --- a/wmpop3/wmpop3/wmpop3rc +++ b/wmpop3/wmpop3/wmpop3rc @@ -1,11 +1,11 @@ # Replace all < > with appropriate data -popserver < pop3 server name > +popserver < pop3 server name > port 110 # default port -username < pop3 login name > +username < pop3 login name > password < pop3 password > viewallmessages 0 # 0 Shows unread and read messages -# 1 Shows only unread messages +# 1 Shows only unread messages autochecking 1 # 1 enables, 0 disables mailcheckdelay 10 # default mail check time in minutes mailclient kmail # default mail client diff --git a/wmpop3lb/CHANGE_LOG b/wmpop3lb/CHANGE_LOG index 3f1a8e6..f9ef210 100644 --- a/wmpop3lb/CHANGE_LOG +++ b/wmpop3lb/CHANGE_LOG @@ -2,57 +2,57 @@ WMPOP3 CHANGE_LOG WMPOP3LB -Version 2.4.2: - * fixed a bug in pop3WriteOneMail: the first line of a received buffer was - always removed, so the received mail was incomplete and corrupted. -Version 2.4.1: +Version 2.4.2: + * fixed a bug in pop3WriteOneMail: the first line of a received buffer was + always removed, so the received mail was incomplete and corrupted. +Version 2.4.1: * %c with newmailcommand only applies to new mails * final dot of messages removed when saving to a temporary file. * optmized connecting/disconnecting when using %c or %C -Version 2.4: - * switch directly in the summary view mode from total number of messages +Version 2.4: + * switch directly in the summary view mode from total number of messages to number of unread messages. - * selectedmesgcommand configuation option: specify a command per server + * selectedmesgcommand configuation option: specify a command per server to launch only on selected messages. - * wilcard implemented for newmailcommand, mailclient and - selectedmesgcommand. - * maxdlsize configuration option: in the case of the %c, %C and %m + * wilcard implemented for newmailcommand, mailclient and + selectedmesgcommand. + * maxdlsize configuration option: in the case of the %c, %C and %m wildcards, will not download messages bigger than this value. - * mailseparator configuration option: specify a separator to include + * mailseparator configuration option: specify a separator to include between each mail when using %c or %C wildcards. * configuration options specified between double quotes ('"') can now be spread among multiple lines. Usefull for mailseparator option... Version 2.3: skipped -Version 2.2: - * now unlimited (i.e. not limited by wmpop3lb...) number of messages per +Version 2.2: + * now unlimited (i.e. not limited by wmpop3lb...) number of messages per server listed. * new scrollbar for fast browsing. - * newmailcommand configuration option : allows to specify (per server) a + * newmailcommand configuration option : allows to specify (per server) a command, per server, to run if a new mail has arrived. * progress bar shown when retrieving the messages off the server. -Version 2.1: +Version 2.1: * smooth scrolling. Version 2.0: !! new, multi pop3 checker !! * can check up to 6 pop3 servers - * you can choose in the configuration, for each server, - to display the number of unread messages only or the total number + * you can choose in the configuration, for each server, + to display the number of unread messages only or the total number of messages. * put back the ability to launch a mail client from WMPop3lb. You can specify one mail client per account! - To launch your mail client, switch to the counter view mode and click on + To launch your mail client, switch to the counter view mode and click on the desired server line. Version 1.0: based on WMPop3 * completely changed the GUI. * display information when contacting the POP3 server. * fixed the button behaviour (buttons now "react" to the clicks). - * now displays the From: and Subject: header fields of each mail in the + * now displays the From: and Subject: header fields of each mail in the mailbox instead of just a picture telling there is new messages. * you can no longer launch your mail browser from the interface, as this is a feature I didn't need. If anyone needs it, please send a mail to [email protected]. -The changelog below is from the original work of Scott Holden +The changelog below is from the original work of Scott Holden ( [email protected] ) on WMPop3. ======================================================================= @@ -60,7 +60,7 @@ Version 0.5.6a : Minor additions * Added extra checking when connecting to pop-server. * Fixed some variable addressing problems. * updated the version number int the source.. :) oops. - + Version 0.5.5a : Minor additions * Fixed Pop3Client, it now closes the socket after use. * Fixed Comment missing in the default config file. diff --git a/wmpop3lb/INSTALL b/wmpop3lb/INSTALL index 59b0a5d..c8a672d 100644 --- a/wmpop3lb/INSTALL +++ b/wmpop3lb/INSTALL @@ -5,7 +5,7 @@ This has only been tested and compiled on a i386 Linux machine. There are two methods to install WMPop3lb, either a system install where all users have access to this file, OR a single user install -which installs WMPop3lb in the users home directory, this is useful +which installs WMPop3lb in the users home directory, this is useful if you have an account on someone else's computer. First thing you should do is the following: @@ -17,11 +17,11 @@ if you have an account on someone else's computer. Method 1. System install -A system install will place the WMPop3lb binary in "/usr/local/bin", +A system install will place the WMPop3lb binary in "/usr/local/bin", this can be done as follows (must be root for this ) : - + make install1 - + Method 2. Single user install A single user install will create a directory called wmpop3lbx.x in the users diff --git a/wmpop3lb/README b/wmpop3lb/README index 331874c..3d55674 100644 --- a/wmpop3lb/README +++ b/wmpop3lb/README @@ -11,32 +11,32 @@ responsible for any damages this application may cause to your system. 1) WHAT IS THIS WMPop3LB is a multi POP3 mail box checker. It will connect to up to 6 POP3 servers to check if you have mail, get the "From:" and "Subject:" - header fields of each mail and display them in a 7 lines window. - If there are more than 7 mails, they can be read by scrolling the window + header fields of each mail and display them in a 7 lines window. + If there are more than 7 mails, they can be read by scrolling the window up and down. Messages can be deleted directly off the servers by selecting the mails to delete and clicking the "delete" button. A command to spawn can be specified for each new received message, for - selected messages (by clicking on the "open" button) or to launch a + selected messages (by clicking on the "open" button) or to launch a mailclient. 2) How do I configure WMPop3LB WMPop3LB when first executed will check if there is a .wmpop3rc file in - the user's home directory, it will create it if it can not be located. + the user's home directory, it will create it if it can not be located. This file must be edited and the following fields must be changed : -- before any [server] section: - 1) autochecking: This allows to disable or enable auto mail checking. + 1) autochecking: This allows to disable or enable auto mail checking. 1 enables, 0 disables 2) displaydelay: this will determine how long error messages show up before the screen is cleaned up. 3) scrollspeed: this is a percentage of the original scrolling speed. - Higher than 100, the text will scroll faster, lower than 100, the + Higher than 100, the text will scroll faster, lower than 100, the text will scroll more slowly. 4) tempdir: directory to put temporary mails retrieved when using %c, %C or %m wildcards (default: /tmp). - 5) viewallmessages: This allows for alternating mail views upon startup, - 0 shows the From: and Subject: header fields of each mail, (message + 5) viewallmessages: This allows for alternating mail views upon startup, + 0 shows the From: and Subject: header fields of each mail, (message view mode) 1 shows the total number of messages or the number of unread messages, per domain, and the number of selected messages (summary view @@ -52,7 +52,7 @@ responsible for any damages this application may cause to your system. differentiate servers in the display window. 6) mailcheckdelay: Number of minutes, before checking mail on this server. (default = 10 minutes) - 7) countunreadonly: in the counter view, 0 displays the total number of + 7) countunreadonly: in the counter view, 0 displays the total number of messages on the server, 1 displays only the number of unread messages. 8) mailclient: command to launch when clicking on the server alias name in @@ -60,16 +60,16 @@ responsible for any damages this application may cause to your system. The command, if it contains spaces or special characters must be written between double quotes (`"'). See "template substitution" for more options. - 9) newmailcommand: command to launch when a new mail has arrived on the + 9) newmailcommand: command to launch when a new mail has arrived on the server. See "template substitution" for more options. 10) selectedmesgcommand: command to launch on selected messages. See "template substitution" for more options. - 11) mailseparator: specify a separator to include between each mail when + 11) mailseparator: specify a separator to include between each mail when using %c or %C template substitutions. 12) maxdlsize: in the case of the %c, %C and %m template substitutions, will not download messages bigger than this value (-1: no limit). - + 3) Using WMPop3. @@ -77,25 +77,25 @@ responsible for any damages this application may cause to your system. the time before the next cheking. If none of the configured server can be contacted, WMPop3LB will show "ERROR" and will count down the time before the next checking. - + 2) If you have mails, WMPop3LB will display a line for each mail, and will - start scrolling the display, showing the server alias identifier, the + start scrolling the display, showing the server alias identifier, the "From:" and "Subject:" header fields in the following format: "alias:<from field>/<subject field> * " - * each time a new mail is received, wmpop3lb will try to launch the + * each time a new mail is received, wmpop3lb will try to launch the newmailcommand if it is specified in the configuration file. - - 3) Depending on the option chosen for viewallmessages, it will display + + 3) Depending on the option chosen for viewallmessages, it will display either: - - a) the alias, The From: and Subject: fields of each mail as + + a) the alias, The From: and Subject: fields of each mail as described above. b) The total number of messages or the number of unread messages (depending on the configuration parameter "countunreadonly") on the POP3 server (if the server has been contacted successfully) as well as the number of messages selected. - Switching between number of unread messages and total number of + Switching between number of unread messages and total number of messages can be done by clicking on the right side of each server line (':' means total number, '-' means total number of unread). If the server cannot be contacted, it will show one of the @@ -105,7 +105,7 @@ responsible for any damages this application may cause to your system. - alias: M*ER --> can't get mails. * The far most right button is used to toggle both views. - + 4) To delete one or more messages directly off one or more servers, select the messages you want to delete and then click on the bottom left "DEL" button. @@ -119,36 +119,36 @@ responsible for any damages this application may cause to your system. - NONE: no message was selected for this server - D:nb: nb messages failed to be deleted. - Err: an error has occured (connection or else). - + WMPop3LB will not allow you to delete messages if the content of the mailbox on the server has changed since last checking. It will instead display an error message ("mailbox content has changed between updates del can.") and reload the content of the mailbox from the server. - + 5) If a message is selected in the message view mode, the "reload" button will change to represent an "open" button. - Clicking on this button will launch the command specified in the + Clicking on this button will launch the command specified in the configuration file by the selectedmesgcommand parameter. - - 6) to select all the messages, go to the summary view mode and click on + + 6) to select all the messages, go to the summary view mode and click on "sel:" (left side of the last displayed line). to unselect all the messages, click on the right side of that line. - - 7) To manually check for mail at any time, mouse click on the + + 7) To manually check for mail at any time, mouse click on the 2nd button from the left, with a round arrow, if no message is selected. - + 8) To turn off auto mail checking, mouse click on the "ch" button (second from the right). - 9) If you have more than 7 messages on all your servers you can scroll the - window up and down using the up and down arrows or by using the + 9) If you have more than 7 messages on all your servers you can scroll the + window up and down using the up and down arrows or by using the scrollbar. - + 4) known problems / TODO - 1) wmpop3lb was built on the existing source code of wmpop3, written by + 1) wmpop3lb was built on the existing source code of wmpop3, written by Scott Holden ([email protected]). I didn't touch a lot the network functions, which are still using blocking sockets and connections. diff --git a/wmpop3lb/wmgeneral/list.c b/wmpop3lb/wmgeneral/list.c index f804b2c..d9f7329 100644 --- a/wmpop3lb/wmgeneral/list.c +++ b/wmpop3lb/wmgeneral/list.c @@ -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; diff --git a/wmpop3lb/wmgeneral/list.h b/wmpop3lb/wmgeneral/list.h index af0f22c..be101ef 100644 --- a/wmpop3lb/wmgeneral/list.h +++ b/wmpop3lb/wmgeneral/list.h @@ -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 diff --git a/wmpop3lb/wmgeneral/misc.c b/wmpop3lb/wmgeneral/misc.c index 34281e2..c36cdb4 100644 --- a/wmpop3lb/wmgeneral/misc.c +++ b/wmpop3lb/wmgeneral/misc.c @@ -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); diff --git a/wmpop3lb/wmgeneral/wmgeneral.c b/wmpop3lb/wmgeneral/wmgeneral.c index 6364956..1db6a15 100644 --- a/wmpop3lb/wmgeneral/wmgeneral.c +++ b/wmpop3lb/wmgeneral/wmgeneral.c @@ -17,7 +17,7 @@ * Now supports >256 colors 11/09/1998 (Martijn Pieterse, [email protected]) * Removed a bug from parse_rcfile. You could - not use "start" in a command if a label was + not use "start" in a command if a label was also start. * Changed the needed geometry string. We don't use window size, and don't support @@ -176,7 +176,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); @@ -223,9 +223,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, @@ -237,9 +237,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, @@ -295,7 +295,7 @@ void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) { unsigned char bwrite; int bcount; int curpixel; - + sscanf(*xpm, "%d %d %d %d", &width, &height, &numcol, &depth); @@ -304,7 +304,7 @@ void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) { zero <<=8; zero |= xpm[1][k]; } - + for (i=numcol+1; i < numcol+sy+1; i++) { bcount = 0; bwrite = 0; @@ -317,7 +317,7 @@ void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) { curpixel <<=8; curpixel |= xpm[i][j+k]; } - + if ( curpixel != zero ) { bwrite += 128; } @@ -393,7 +393,7 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit } 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); } @@ -418,10 +418,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); @@ -442,7 +442,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; diff --git a/wmpop3lb/wmpop3/.wmpop3rc_test b/wmpop3lb/wmpop3/.wmpop3rc_test index efdc236..f2b1586 100644 --- a/wmpop3lb/wmpop3/.wmpop3rc_test +++ b/wmpop3lb/wmpop3/.wmpop3rc_test @@ -10,7 +10,7 @@ tempdir "/tmp" #popserver pop.free.fr #port 110 # default port #username lbj -#password 42vm90cx +#password 42vm90cx #mailcheckdelay 3 # default mail check time in minutes #alias flb #countunreadonly 0 @@ -41,7 +41,7 @@ maxdlsize 650 mailclient "echo %c %C" selectedmesgcommand "echo %c %C" mailseparator " -From - +From - " [server] diff --git a/wmpop3lb/wmpop3/Makefile b/wmpop3lb/wmpop3/Makefile index f154d25..16cecf0 100644 --- a/wmpop3lb/wmpop3/Makefile +++ b/wmpop3lb/wmpop3/Makefile @@ -11,7 +11,7 @@ OBJS = wmpop3.o \ .c.o: cc -I/usr/X11R6/share/include $(FLAGS) -c -Wall $< -o $*.o -wmpop3lb: $(OBJS) +wmpop3lb: $(OBJS) cc $(FLAGS) -o wmpop3lb $^ -lXext $(LIBDIR) $(LIBS) all:: wmpop3lb @@ -20,19 +20,19 @@ clean:: for i in $(OBJS) ; do \ rm -f $$i ; \ done - rm -f wmpop3lb + rm -f wmpop3lb rm -f *~ -install:: wmpop3lb - @echo "Use 'make install1' for system install." +install:: wmpop3lb + @echo "Use 'make install1' for system install." @echo "Use 'make install2' for single user install." - @echo + @echo -install1:: wmpop3lb +install1:: wmpop3lb cp -f wmpop3lb /usr/local/bin/ chmod 755 /usr/local/bin/wmpop3lb chown root:root /usr/local/bin/wmpop3lb - @echo + @echo @echo "WMPop3 Installation finished..." install2:: wmpop3lb @@ -40,8 +40,8 @@ install2:: wmpop3lb cp -f wmpop3lb $(HOME)/wmpop3lb chmod 755 $(HOME)/wmpop3lb @echo "WMPop3 Installation finished..." - @echo + @echo @echo "Make sure ~/wmpop3 is in your path" - @echo + @echo @echo "Please run wmpop3lb once and then edit ~/.wmpop3rc" diff --git a/wmpop3lb/wmpop3/Pop3Client.c b/wmpop3lb/wmpop3/Pop3Client.c index 184eeec..3dfb0c2 100644 --- a/wmpop3lb/wmpop3/Pop3Client.c +++ b/wmpop3lb/wmpop3/Pop3Client.c @@ -1,6 +1,6 @@ /* Author : Louis-Benoit JOURDAIN ([email protected]) * based on the original work by Scott Holden ( [email protected] ) - * + * * multi Pop3 Email checker. * * Last Updated : Feb 7th, 2002 @@ -28,15 +28,15 @@ #include "Pop3Client.h" /* return size if all goes well, -1 if not expected answer */ -int send_command(char *exp_answer, char **retour, Pop3 pc) +int send_command(char *exp_answer, char **retour, Pop3 pc) { int size; - - send(pc->s, &pc->outBuf,strlen(pc->outBuf),0); + + send(pc->s, &pc->outBuf,strlen(pc->outBuf),0); size = recv(pc->s,pc->inBuf,1024,0); memset(*retour,0,1024); memcpy(*retour,pc->inBuf,size); - if (strncmp(pc->inBuf, exp_answer, strlen(exp_answer))) { + if (strncmp(pc->inBuf, exp_answer, strlen(exp_answer))) { return (-1); } return (size); @@ -45,7 +45,7 @@ int send_command(char *exp_answer, char **retour, Pop3 pc) Pop3 pop3Create(int num) { Pop3 pc; - + pc = (Pop3)malloc( sizeof(*pc) ); if( pc == 0) return 0; @@ -86,7 +86,7 @@ int pop3IsConnected(Pop3 pc){ int pop3Login(Pop3 pc, char *name, char *pass){ - int size; + int size; char temp[1024]; if( pc->connected == NOT_CONNECTED ){ @@ -103,7 +103,7 @@ int pop3Login(Pop3 pc, char *name, char *pass){ } sprintf(pc->outBuf,"USER %s\r\n",name); - send(pc->s, &pc->outBuf,strlen(pc->outBuf),0); + send(pc->s, &pc->outBuf,strlen(pc->outBuf),0); size =recv(pc->s,pc->inBuf,1024,0); memset(temp,0,1024); memcpy(temp,pc->inBuf,size); @@ -131,11 +131,11 @@ int store_from(char *buf, int pos, int buflen, int num, Pop3 pc) { int deb_addr; int fin_addr; int i; - + /* strip the white spaces */ for (; (pos < buflen) && isspace(buf[pos]); pos++); /* get the end of the line */ - for (end = pos; (end + 1 < buflen) && + for (end = pos; (end + 1 < buflen) && (buf[end] != '\r') && (buf[end + 1] != '\n'); end++); /* try to find the '@' sign for the address */ for (i = pos; (i < end) && buf[i] != '@'; i++); @@ -146,12 +146,12 @@ int store_from(char *buf, int pos, int buflen, int num, Pop3 pc) { for (fin_addr = i; fin_addr < end && !isspace(buf[fin_addr]); fin_addr++); if ('>' == buf[fin_addr - 1]) fin_addr--; - memcpy(pc->mails[num].from, buf + deb_addr, - (fin_addr - deb_addr > MAIL_BUFLEN) ? + memcpy(pc->mails[num].from, buf + deb_addr, + (fin_addr - deb_addr > MAIL_BUFLEN) ? MAIL_BUFLEN : fin_addr - deb_addr); } else { - memcpy(pc->mails[num].from, buf + pos, + memcpy(pc->mails[num].from, buf + pos, (end - pos > MAIL_BUFLEN) ? MAIL_BUFLEN : end - pos); } return (end + 2); @@ -162,7 +162,7 @@ int store_subject(char *buf, int pos, int buflen, int num, Pop3 pc) { int i; /* get the end of the line */ - for (end = pos, i = 0; (i < MAIL_BUFLEN) && (end + 1 < buflen) && + for (end = pos, i = 0; (i < MAIL_BUFLEN) && (end + 1 < buflen) && (buf[end] != '\r') && (buf[end + 1] != '\n'); end++, i++); for (; (pos < buflen) && (buf[pos] == ' '); pos++); memcpy(pc->mails[num].subject, buf + pos, end - pos); @@ -172,7 +172,7 @@ int store_subject(char *buf, int pos, int buflen, int num, Pop3 pc) { int parse_header(char *buf, int buflen, int num, Pop3 pc) { int pos = 0; int retour = 1; - + /* parse the header for the from and subject fields */ #ifdef _DEBUG printf(" parse_header, buflen: %d, num %d, buf:\n%s\n", @@ -193,7 +193,7 @@ int parse_header(char *buf, int buflen, int num, Pop3 pc) { pos = store_subject(buf, pos, buflen, num, pc); } else { - for( ; (buflen > (pos + 2)) && (buf[pos] != '\r') && + for( ; (buflen > (pos + 2)) && (buf[pos] != '\r') && (buf[pos + 1] != '\n'); pos++); pos += 2; } @@ -206,10 +206,10 @@ int pop3VerifStats(Pop3 pc) int retour = 0; char *ptr; int size; - + if( pc->connected == NOT_CONNECTED ) return (-1); - + /* Find total number of messages in mail box */ sprintf(pc->outBuf,"STAT\r\n"); send(pc->s, pc->outBuf, strlen(pc->outBuf),0 ); @@ -222,7 +222,7 @@ int pop3VerifStats(Pop3 pc) ptr = strtok( 0," "); ptr = strtok( 0, " "); if (ptr) - retour = atoi(ptr); + retour = atoi(ptr); return (retour); } @@ -238,7 +238,7 @@ long calculate_cksum(char *buf, int len) { int is_in_old_mails(long cksum, t_mail *oldmails, int numold) { int i; - + for (i = 0; i < numold; i++) { if (oldmails[i].cksum == cksum) return (1); @@ -257,7 +257,7 @@ int pop3CheckMail(Pop3 pc) { int old_numOfMessages; int progressbarpos = 0; t_mail *oldmails; - + if( pc->connected == NOT_CONNECTED ) return -1; /* save the old values */ @@ -290,7 +290,7 @@ int pop3CheckMail(Pop3 pc) { pc->mails = NULL; /* allocate space for the new ones */ if (pc->numOfMessages) { - if (NULL == + if (NULL == (pc->mails = (t_mail *) malloc (sizeof(t_mail) * pc->numOfMessages))) { fprintf(stderr, "can't allocate memory for message structure\n"); /* clear the old messages */ @@ -306,7 +306,7 @@ int pop3CheckMail(Pop3 pc) { } ptr = strtok( 0, " "); - pc->sizeOfAllMessages = atoi(ptr); + pc->sizeOfAllMessages = atoi(ptr); /* -1 means first time */ if (-1 != pc->sizechanged) pc->sizechanged = (old_sizeOfAllMessages != pc->sizeOfAllMessages); @@ -338,9 +338,9 @@ int pop3CheckMail(Pop3 pc) { printf(" ---- message %d ---\n", i); #endif /* increment the progress bar by 1 message */ - progressbarpos = (int) ((i + 1) * (PROGRESSBAR_LEN - 2)) / + progressbarpos = (int) ((i + 1) * (PROGRESSBAR_LEN - 2)) / pc->numOfMessages; - copyXPMArea(ORIG_PB_BARX, ORIG_PB_BARY, progressbarpos, 2, + copyXPMArea(ORIG_PB_BARX, ORIG_PB_BARY, progressbarpos, 2, PROGRESSBAR_HPOS + 1, PROGRESSBAR_VPOS + 2); RedrawWindow(); /* reset the from and subject fields for num */ @@ -366,11 +366,11 @@ int pop3CheckMail(Pop3 pc) { } pc->mails[i].todelete = 0; /* verify if this message is new or not */ - pc->mails[i].new = !is_in_old_mails(pc->mails[i].cksum, oldmails, + pc->mails[i].new = !is_in_old_mails(pc->mails[i].cksum, oldmails, old_numOfMessages); #ifdef _DEBUG - printf(" mess %d, cksum: %ld, new: %d\n", - i, pc->mails[i].cksum, pc->mails[i].new); + printf(" mess %d, cksum: %ld, new: %d\n", + i, pc->mails[i].cksum, pc->mails[i].new); #endif } /* clear the old messages */ @@ -378,7 +378,7 @@ int pop3CheckMail(Pop3 pc) { free (oldmails); } return 1; -} +} int pop3WriteOneMail(int nb, int dest_fd, Pop3 pc) { @@ -392,7 +392,7 @@ int pop3WriteOneMail(int nb, int dest_fd, Pop3 pc) char *deb, *fin; int theemailsize = 0; int mustdisconnect = 0; - + if (NOT_CONNECTED == pc->connected) { #ifdef _DEBUG @@ -409,12 +409,12 @@ int pop3WriteOneMail(int nb, int dest_fd, Pop3 pc) /* check the size */ #ifdef _DEBUG printf(" pc->maxdlsize = [%d]\n", pc->maxdlsize); -#endif +#endif if (-1 != pc->maxdlsize) { sprintf(pc->outBuf, "LIST %d\r\n", nb); #ifdef _DEBUG printf(" pop3WriteOneMail: %s", pc->outBuf); -#endif +#endif send(pc->s, pc->outBuf, strlen(pc->outBuf), 0); size = recv(pc->s, pc->inBuf, 4096, 0); #ifdef _DEBUG @@ -426,7 +426,7 @@ int pop3WriteOneMail(int nb, int dest_fd, Pop3 pc) printf(" pop3WriteOneMail: answer [%s]\n", temp); #endif if (temp[0] != '+') { - sprintf(buf, TXT_ERROR, pc->mails[nb - 1].from, + sprintf(buf, TXT_ERROR, pc->mails[nb - 1].from, pc->mails[nb - 1].subject, pc->outBuf); write (dest_fd, buf, strlen(buf)); #ifdef _DEBUG @@ -464,8 +464,8 @@ int pop3WriteOneMail(int nb, int dest_fd, Pop3 pc) /* else {} the command is screwed up, never mind, continue to download the mail */ } - - + + sprintf(pc->outBuf, "RETR %d\r\n", nb); #ifdef _DEBUG printf(" pop3WriteOneMail: %s", pc->outBuf); @@ -480,7 +480,7 @@ int pop3WriteOneMail(int nb, int dest_fd, Pop3 pc) deb = temp; if (!pass) { if (temp[0] != '+') { - sprintf(buf, TXT_ERROR, pc->mails[nb - 1].from, + sprintf(buf, TXT_ERROR, pc->mails[nb - 1].from, pc->mails[nb - 1].subject, pc->outBuf); write (dest_fd, buf, strlen(buf)); retour = 1; @@ -489,7 +489,7 @@ int pop3WriteOneMail(int nb, int dest_fd, Pop3 pc) } #ifdef _DEBUG printf(" first pass, skeep RETR answer ([%s])\n", deb); -#endif +#endif /* skip the RETR answer, go to the end of the line; */ for (;*deb && ('\n' != *deb); deb++); deb++; @@ -498,7 +498,7 @@ int pop3WriteOneMail(int nb, int dest_fd, Pop3 pc) fin = temp + size - 5; #ifdef _DEBUG printf(" size: %d, fin: [%s]\n", size, fin); -#endif +#endif if (size >= 5) { if (!strncmp(fin, "\r\n.\r\n", 5)) { go = 0; @@ -536,10 +536,10 @@ int pop3WriteOneMail(int nb, int dest_fd, Pop3 pc) return (retour); } -int pop3DeleteMail(int num, Pop3 pc) +int pop3DeleteMail(int num, Pop3 pc) { int size; - + sprintf(pc->outBuf, "DELE %d\r\n", num); #ifdef _DEBUG printf(" %s\n", pc->outBuf); @@ -552,14 +552,14 @@ int pop3DeleteMail(int num, Pop3 pc) } return (0); } - - + + int pop3GetTotalNumberOfMessages( Pop3 pc ){ if( pc != 0 ) return pc->numOfMessages; - return -1; + return -1; } int pop3GetNumberOfUnreadMessages( Pop3 pc ){ @@ -570,7 +570,7 @@ int pop3GetNumberOfUnreadMessages( Pop3 pc ){ int pop3Quit(Pop3 pc){ int size; - + #ifdef _DEBUG printf("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n"); printf("XXXXXX pop3Quit -------- disconneting XXXXXXXXX\n"); diff --git a/wmpop3lb/wmpop3/Pop3Client.h b/wmpop3lb/wmpop3/Pop3Client.h index 043a62a..d5ad039 100644 --- a/wmpop3lb/wmpop3/Pop3Client.h +++ b/wmpop3lb/wmpop3/Pop3Client.h @@ -1,6 +1,6 @@ /* Author : Louis-Benoit JOURDAIN ([email protected]) * based on the original work by Scott Holden ( [email protected] ) - * + * * multi Pop3 Email checker. * * Last Updated : Feb 7th, 2002 @@ -27,7 +27,7 @@ #define RSET_COLOR color = 0 #define SWAP_COLOR color = 1 - color -#define CH_COLOR(a) (color) ? a + 24 : a +#define CH_COLOR(a) (color) ? a + 24 : a #define WMPOP3_VERSION "2.4.2" @@ -57,7 +57,7 @@ #define ORIG_PB_TX 72 #define ORIG_PB_TY 65 -#define ORIG_PB_BARX 73 +#define ORIG_PB_BARX 73 #define ORIG_PB_BARY 71 #define SCROLL_LX 4 /* left X coordinate */ @@ -66,7 +66,7 @@ #define SCROLL_BY 45 /* botton Y coordinate */ #define SCROLL_W 3 #define SCROLL_H 38 /* this is without SCROLL_EXT at each end */ -#define SCROLL_EXT 2 +#define SCROLL_EXT 2 #define TMPPREFIX "Pop3tmp" #define TMPPREFIXLEN 7 @@ -123,7 +123,7 @@ struct pop3_struct{ int numOfUnreadMessages; int countunreadonly; int sizeOfAllMessages; - int sizechanged; + int sizechanged; int mailCheckDelay; int forcedCheck; int status; diff --git a/wmpop3lb/wmpop3/wmpop3.c b/wmpop3lb/wmpop3/wmpop3.c index a7f4649..2867b32 100644 --- a/wmpop3lb/wmpop3/wmpop3.c +++ b/wmpop3lb/wmpop3/wmpop3.c @@ -1,6 +1,6 @@ /* * wmpop3.c - * multi pop3 mail checker. + * multi pop3 mail checker. * written by Louis-Benoit JOURDAIN ([email protected]) * based on the original work by Scott Holden ([email protected]) * @@ -78,7 +78,7 @@ int pop3VerifStats(Pop3 pc); /******************************** * Main Program ********************************/ -void deleteoldtmpfiles() +void deleteoldtmpfiles() { char buf[1024]; DIR *dir; @@ -108,7 +108,7 @@ int main(int argc, char *argv[]) { ProgName = argv[0]; if (strlen(ProgName) >= 5) ProgName += (strlen(ProgName) - 5); - + for (i=1; i<argc; i++) { char *arg = argv[i]; @@ -149,12 +149,12 @@ int main(int argc, char *argv[]) { return 0; } -void build_line(char *buf, int num, int index, Pop3 pc) +void build_line(char *buf, int num, int index, Pop3 pc) { int len; int pos; char tmp[256]; - + /* display spaces in case alias is less than 3 char long */ memset(tmp, ' ', sizeof(char) * 3); memset(tmp + 3, 0, sizeof(char) * (256 - 3)); @@ -216,7 +216,7 @@ int DeleteMail(Pop3 pc) int etat = 0; int old_sizeOfAllMessages; int i; - + old_sizeOfAllMessages = pc->sizeOfAllMessages; BlitString(pc->alias, 10, TOP_MARGIN, 0); BlitString("connect", 10, 6*2 + TOP_MARGIN, 0); @@ -257,7 +257,7 @@ int DeleteMail(Pop3 pc) } pop3Quit(pc); return (etat); -} +} /* void launch_mail_client(int iS) @@ -301,19 +301,19 @@ void launch_mail_client(int iS) } */ -void display_scrollbar(int index, int totalmessages, +void display_scrollbar(int index, int totalmessages, int maxlines, int scrollmode) { int delta; int scrollen; int vertpos; - + if (totalmessages <= maxlines) { #ifdef _DEBUG if (haspassed) printf(" full scrollbar\n"); #endif - copyXPMArea((scrollmode) ? 68 : 65, 18, SCROLL_W, + copyXPMArea((scrollmode) ? 68 : 65, 18, SCROLL_W, SCROLL_H + (2 * SCROLL_EXT), SCROLL_LX, SCROLL_TY); scrollbar.top = SCROLL_TY; scrollbar.bottom = SCROLL_TY + SCROLL_H; @@ -331,7 +331,7 @@ void display_scrollbar(int index, int totalmessages, SCROLL_LX, vertpos + SCROLL_TY); copyXPMArea((scrollmode) ? 68 : 65, 18 + SCROLL_EXT, SCROLL_W, scrollen, SCROLL_LX, vertpos + SCROLL_TY + SCROLL_EXT); - copyXPMArea((scrollmode) ? 68 : 65, 18 + SCROLL_EXT + SCROLL_H, + copyXPMArea((scrollmode) ? 68 : 65, 18 + SCROLL_EXT + SCROLL_H, SCROLL_W, SCROLL_EXT, SCROLL_LX, vertpos + SCROLL_TY + SCROLL_EXT + scrollen); scrollbar.top = vertpos + SCROLL_TY; @@ -340,7 +340,7 @@ void display_scrollbar(int index, int totalmessages, #ifdef _DEBUG if (haspassed) { printf(" index: %d, totalmess:%d, mxli: %d, delta: %d, vertpos: %d, allowedspace: %d, sl:%d\n", - index, totalmessages, maxlines, delta, vertpos, + index, totalmessages, maxlines, delta, vertpos, scrollbar.allowedspace, scrollen); } #endif @@ -348,10 +348,10 @@ void display_scrollbar(int index, int totalmessages, /* RedrawWindow(); */ } -int is_for_each_mail(char **command) +int is_for_each_mail(char **command) { int i; - + if (command) { for (i = 0; command[i]; i++) { if ('%' == command[i][0]) { @@ -366,7 +366,7 @@ int is_for_each_mail(char **command) return (0); } -char *quotify(char *str) +char *quotify(char *str) { char *retour; int len; @@ -387,8 +387,8 @@ char *quotify(char *str) onlyselected: only for selected messages pc: main struct. on success return 0 */ -int writemailstofile(int nb, char *path, int newonly, - int onlyselected, Pop3 pc) +int writemailstofile(int nb, char *path, int newonly, + int onlyselected, Pop3 pc) { int fd; int len; @@ -396,7 +396,7 @@ int writemailstofile(int nb, char *path, int newonly, int retour = 0; int goforwritemail = 0; int mustdisconnect = 0; - + len = strlen(tempdir); if (len) { path[0] = '\0'; @@ -440,22 +440,22 @@ int writemailstofile(int nb, char *path, int newonly, if (!newonly && !onlyselected) { #ifdef _DEBUG printf(" !newonly && !onlyselected\n"); -#endif +#endif goforwritemail = 1; } else if (newonly) { - if (pc->mails[i].new && + if (pc->mails[i].new && (!onlyselected || (onlyselected && pc->mails[i].todelete))) { #ifdef _DEBUG printf(" newonly\n"); -#endif +#endif goforwritemail = 1; } } else if (onlyselected && pc->mails[i].todelete) { #ifdef _DEBUG printf(" onlyselected\n"); -#endif +#endif goforwritemail = 1; } if (goforwritemail) { @@ -469,7 +469,7 @@ int writemailstofile(int nb, char *path, int newonly, else { #ifdef _DEBUG printf(" TXT_SEPARATOR: [%s]\n", TXT_SEPARATOR); -#endif +#endif write(fd, TXT_SEPARATOR, strlen(TXT_SEPARATOR)); } if (pop3WriteOneMail(i + 1, fd, pc)) { @@ -500,19 +500,19 @@ int writemailstofile(int nb, char *path, int newonly, return (retour); } -/* +/* * do_command_completion * returned array should be freed by calling function - * if nbnewmail == 0, for %c option concatenate _all_ the messages + * if nbnewmail == 0, for %c option concatenate _all_ the messages */ -char **do_command_completion(int num, char **command, - int nbnewmail, Pop3 pc) +char **do_command_completion(int num, char **command, + int nbnewmail, Pop3 pc) { char **retour; int i; int yaerreur = 0; char path[1024]; - + for (i = 0; command[i]; i++); #ifdef _DEBUG printf(" %d args to the command, mail num %d\n", i, num); @@ -530,13 +530,13 @@ char **do_command_completion(int num, char **command, case 'T': /* total nb of mails */ if (NULL != (retour[i] = (char *) malloc(sizeof(char) * 8))) sprintf(retour[i], "%d", pc->numOfMessages); - else + else yaerreur = 1; break; case 't': /* total nb of new mails */ if (NULL != (retour[i] = (char *) malloc(sizeof(char) * 8))) sprintf(retour[i], "%d", (nbnewmail < 0) ? 0 : 1); - else + else yaerreur = 1; break; case 'C': /* concatenate all the selected mails in 1 file */ @@ -548,9 +548,9 @@ char **do_command_completion(int num, char **command, } break; case 'c': /* concatenate all the mails in 1 file */ - if (writemailstofile(-1, path, (nbnewmail > 0), NOSELECTONLY, pc)) + if (writemailstofile(-1, path, (nbnewmail > 0), NOSELECTONLY, pc)) yaerreur = 1; - else + else if (NULL == (retour[i] = strdup(path))) { yaerreur = 1; } @@ -565,15 +565,15 @@ char **do_command_completion(int num, char **command, case 's': /* subject of the mail */ #ifdef _DEBUG printf(" subject field: [%s]\n", pc->mails[num].subject); -#endif +#endif if (NULL == (retour[i] = quotify(pc->mails[num].subject))) yaerreur = 1; break; case 'm': /* copy the mail to tmp file */ if (0 <= num) { - if (writemailstofile(num, path, (nbnewmail > 0), NOSELECTONLY, pc)) + if (writemailstofile(num, path, (nbnewmail > 0), NOSELECTONLY, pc)) yaerreur = 1; - else + else if (NULL == (retour[i] = strdup(path))) { yaerreur = 1; } @@ -608,10 +608,10 @@ char **do_command_completion(int num, char **command, yaerreur = 1; break; case '%': /* % character, leave in place */ - if (NULL == (retour[i] = strdup(command[i]))) + if (NULL == (retour[i] = strdup(command[i]))) yaerreur = 1; break; - default: + default: break; } } @@ -619,7 +619,7 @@ char **do_command_completion(int num, char **command, #ifdef _DEBUG printf(" just copying arg [%s]\n", command[i]); #endif - if (NULL == (retour[i] = strdup(command[i]))) + if (NULL == (retour[i] = strdup(command[i]))) yaerreur = 1; } } @@ -633,17 +633,17 @@ char **do_command_completion(int num, char **command, return (NULL); } -/* num is the index of the mail in the mail array +/* num is the index of the mail in the mail array if num == -1, means that the command isn't for each mail */ -void spawn_command(int num, char **command, int nbnewmail, +void spawn_command(int num, char **command, int nbnewmail, char *display, Pop3 pc) { char **tmpcommand; char str[16]; int i, j; - + if (display) { ClearDisplay(); if (!command) { @@ -702,7 +702,7 @@ void spawn_command(int num, char **command, int nbnewmail, BlitString(display, 10, 6*6 + TOP_MARGIN, 0); fprintf(stderr, "Error while parsing %s\n", display); } - else + else fprintf(stderr, "Error while parsing command\n"); } } @@ -718,7 +718,7 @@ void spawn_command(int num, char **command, int nbnewmail, */ void wmCheckMail_routine(int argc, char **argv){ - + int buttonStatus = -1; int iS; Pop3 pc; @@ -739,33 +739,33 @@ void wmCheckMail_routine(int argc, char **argv){ int scrollmode = 0; int nbnewmail; char separ; - + if( !strcmp( config_file, "not-defined") ) sprintf(config_file, "%s/.wmpop3rc", getenv("HOME")); - + if( readConfigFile(config_file) == -1){ exit(0); } /* Set up timer for checking mail */ createXBMfromXPM(wminet_mask_bits, wmpop3_xpm , wminet_mask_width, wminet_mask_height); - + openXwindow(argc, argv, wmpop3_xpm, wminet_mask_bits , wminet_mask_width, wminet_mask_height); - + AddMouseRegion(0, 19, 49, 30, 58); /* check button */ AddMouseRegion(1, 46, 49, 50, 58 ); /* autocheck button */ AddMouseRegion(2, 53, 49, 57, 58 ); /* switch display button */ - AddMouseRegion(3, 5, 49, 16, 58 ); /* delete button */ + AddMouseRegion(3, 5, 49, 16, 58 ); /* delete button */ AddMouseRegion(4, 33, 49, 44, 53); /* top arrow */ AddMouseRegion(5, 33, 54, 44, 58); /* botton arrow */ /* add the mouse regions for each line */ for (i = 0; i < NB_LINE; i++) { - AddMouseRegion(6 + i, 9, (i*6) + TOP_MARGIN, + AddMouseRegion(6 + i, 9, (i*6) + TOP_MARGIN, 58, (i*6) + TOP_MARGIN + CHAR_HEIGHT); } - - + + /* Check if Autochecking is on or off */ if(autoChecking == NO ){ copyXPMArea(142, 38, 7, 11, 45, 48); @@ -773,9 +773,9 @@ void wmCheckMail_routine(int argc, char **argv){ else { copyXPMArea(142, 49, 7, 11, 45, 48); } - + RedrawWindow(); - + summess = 0; deleteoldtmpfiles(); @@ -785,9 +785,9 @@ void wmCheckMail_routine(int argc, char **argv){ RSET_COLOR; for (iS = 0; iS < nb_conf; iS++) { pc = conf[iS]; - if( (((time(0) > pc->nextCheckTime) || - (pc->nextCheckTime == 0)) && ( autoChecking == YES)) - || (pc->forcedCheck == YES)){ + if( (((time(0) > pc->nextCheckTime) || + (pc->nextCheckTime == 0)) && ( autoChecking == YES)) + || (pc->forcedCheck == YES)){ justreloaded = 1; ClearDisplay(); BlitString(pc->alias, 10, TOP_MARGIN, 0); @@ -800,7 +800,7 @@ void wmCheckMail_routine(int argc, char **argv){ if (!pc->status) { BlitString("login", 10, (6*3) + TOP_MARGIN, 0); RedrawWindow(); - if (pop3Login(pc, pc->username, pc->password) == -1 ) + if (pop3Login(pc, pc->username, pc->password) == -1 ) pc->status = 2; } if (!pc->status) { @@ -823,7 +823,7 @@ void wmCheckMail_routine(int argc, char **argv){ printf(" %d New mail(s) ha(s)(ve) arrived!\n", nbnewmail); #endif if (is_for_each_mail(pc->newmailcommand)) { - for (i = 0; i < pc->numOfMessages; i++) + for (i = 0; i < pc->numOfMessages; i++) if (pc->mails[i].new) spawn_command(i, pc->newmailcommand, nbnewmail, NULL, pc); } @@ -865,13 +865,13 @@ void wmCheckMail_routine(int argc, char **argv){ for (i = 0; i < summess && i < pc->numOfMessages; i++) { #ifdef _DEBUG if (haspassed) { - printf(" %s, mails[%d], todelete=%d\n", + printf(" %s, mails[%d], todelete=%d\n", pc->alias, i, pc->mails[i].todelete); } #endif nbsel += pc->mails[i].todelete; - } - } + } + } if (justreloaded) { /* make sure we display the correct buttons */ justreloaded = 0; @@ -887,7 +887,7 @@ void wmCheckMail_routine(int argc, char **argv){ pc = conf[iS]; if (pc->countunreadonly) separ = '-'; - else + else separ = ':'; switch(pc->status) { case 1: @@ -901,7 +901,7 @@ void wmCheckMail_routine(int argc, char **argv){ break; default: sprintf(str, "%-3s%c %3d", pc->alias, separ, - (pc->countunreadonly) ? pc->numOfUnreadMessages : + (pc->countunreadonly) ? pc->numOfUnreadMessages : pc->numOfMessages); break; } @@ -910,7 +910,7 @@ void wmCheckMail_routine(int argc, char **argv){ } RSET_COLOR; sprintf(str, "sel.: %2d", nbsel); - BlitString(str, 10, (int) (6*6) + TOP_MARGIN, 0); + BlitString(str, 10, (int) (6*6) + TOP_MARGIN, 0); } else { RSET_COLOR; @@ -924,7 +924,7 @@ void wmCheckMail_routine(int argc, char **argv){ if (autoChecking == YES) { BlitString(" next", 10, 6*2 + TOP_MARGIN, 0); BlitString(" update", 10, 6*3 + TOP_MARGIN, 0); - j = SEC_IN_MIN * 1000; + j = SEC_IN_MIN * 1000; thistime = time(0); for (i = 0, k = 0; i < nb_conf; i++) { if ((conf[i]->nextCheckTime - thistime) < j) { @@ -942,16 +942,16 @@ void wmCheckMail_routine(int argc, char **argv){ else { RSET_COLOR; /* iS = index in the conf struct - i = index of the mail + i = index of the mail j = line nb on display */ memset(linestodel, 0, sizeof(char *)); for (iS = 0, j = 0; iS < nb_conf && j < NB_LINE + index_vert; iS++) { pc = conf[iS]; - for (i = 0; (j < NB_LINE + index_vert) && i < pc->numOfMessages; + for (i = 0; (j < NB_LINE + index_vert) && i < pc->numOfMessages; j++, i++) { if (j >= index_vert) { build_line(str, i, index, pc); - BlitString(str, 10, ((j - index_vert) * 6) + TOP_MARGIN, + BlitString(str, 10, ((j - index_vert) * 6) + TOP_MARGIN, fragment); display_index(i, (j - index_vert), pc); /* store the address of the delete flag, so that it will */ @@ -973,9 +973,9 @@ void wmCheckMail_routine(int argc, char **argv){ #ifdef _DEBUG haspassed = 0; #endif - + RedrawWindow(); - + RSET_COLOR; /* X Events */ while (XPending(display)){ @@ -999,8 +999,8 @@ void wmCheckMail_routine(int argc, char **argv){ #endif if (summess > NB_LINE) { - index_vert = scrollbar.orig_index_vert + - ((Event.xbutton.y - scrollbar.orig_y) * (summess - NB_LINE) / + index_vert = scrollbar.orig_index_vert + + ((Event.xbutton.y - scrollbar.orig_y) * (summess - NB_LINE) / scrollbar.allowedspace); if (0 > index_vert) index_vert = 0; @@ -1008,7 +1008,7 @@ void wmCheckMail_routine(int argc, char **argv){ index_vert = summess - NB_LINE; } #ifdef _DEBUG - printf(" deplacement de %d pixels --> index_vert = %d\n", + printf(" deplacement de %d pixels --> index_vert = %d\n", Event.xbutton.y - scrollbar.orig_y, index_vert); #endif } @@ -1018,7 +1018,7 @@ void wmCheckMail_routine(int argc, char **argv){ if (buttonStatus >= 0){ switch (buttonStatus){ case 0 : /* check / open button pressed */ - if ((NO == newMessagesOnly) && nbsel) + if ((NO == newMessagesOnly) && nbsel) copyXPMArea(128, 60 ,14 ,11 ,18 ,48 ); else copyXPMArea(128,38 ,14 ,11 ,18 ,48 ); @@ -1040,7 +1040,7 @@ void wmCheckMail_routine(int argc, char **argv){ RedrawWindow(); } else if (SCROLL_LX <= Event.xbutton.x && SCROLL_RX >= Event.xbutton.x - && scrollbar.top <= Event.xbutton.y && + && scrollbar.top <= Event.xbutton.y && scrollbar.bottom >= Event.xbutton.y) { scrollbar.orig_y = Event.xbutton.y; scrollbar.orig_index_vert = index_vert; @@ -1049,12 +1049,12 @@ void wmCheckMail_routine(int argc, char **argv){ break; case ButtonRelease: i = CheckMouseRegion(Event.xbutton.x, Event.xbutton.y); - + if (buttonStatus == i && buttonStatus >= 0){ switch (buttonStatus){ case 0 : /* check button */ if (nbsel && !newMessagesOnly) { - copyXPMArea(128,49 ,14 ,11 ,18 ,48 ); + copyXPMArea(128,49 ,14 ,11 ,18 ,48 ); /* this is where you launch the open mail command */ for (iS = 0; iS < nb_conf; iS++) { pc = conf[iS]; @@ -1069,7 +1069,7 @@ void wmCheckMail_routine(int argc, char **argv){ printf(" launching selectedmesgcommand command for conf %d\n", iS); #endif - + if (is_for_each_mail(pc->selectedmesgcommand)) { #ifdef _DEBUG if (!pc->numOfMessages) { @@ -1078,19 +1078,19 @@ void wmCheckMail_routine(int argc, char **argv){ else printf(" command is for each mail\n"); #endif - for (i = 0; i < pc->numOfMessages; i++) - spawn_command(i, pc->selectedmesgcommand, 0, + for (i = 0; i < pc->numOfMessages; i++) + spawn_command(i, pc->selectedmesgcommand, 0, "selectm.", pc); } else { - spawn_command(-1, pc->selectedmesgcommand, 0, + spawn_command(-1, pc->selectedmesgcommand, 0, "selectm.", pc); } } } } else { - copyXPMArea(128,27 ,14 ,11 ,18 ,48 ); + copyXPMArea(128,27 ,14 ,11 ,18 ,48 ); for (iS = 0; iS < nb_conf; iS++) conf[iS]->forcedCheck = YES; } @@ -1098,12 +1098,12 @@ void wmCheckMail_routine(int argc, char **argv){ case 1 : /* autocheck Button */ if (autoChecking == YES){ autoChecking = NO; - copyXPMArea(142, 38, 7, 11, 45, 48); + copyXPMArea(142, 38, 7, 11, 45, 48); } else { autoChecking = YES; for (iS = 0; iS < nb_conf; iS++) - conf[iS]->nextCheckTime = time(0) + + conf[iS]->nextCheckTime = time(0) + (conf[iS]->mailCheckDelay * SEC_IN_MIN); copyXPMArea(142, 49, 7, 11, 45, 48); } @@ -1120,7 +1120,7 @@ void wmCheckMail_routine(int argc, char **argv){ else { copyXPMArea(128,27,14,11,18,48); } - } + } else { newMessagesOnly = YES; copyXPMArea(149,49 , 7 , 11, 52, 48); @@ -1136,7 +1136,7 @@ void wmCheckMail_routine(int argc, char **argv){ RSET_COLOR; for (iS = 0; iS < nb_conf; iS++) { pc = conf[iS]; - for (i = 0, k = 0; i < pc->numOfMessages; i++) + for (i = 0, k = 0; i < pc->numOfMessages; i++) k += pc->mails[i].todelete; if (k) { /* clear the display */ @@ -1148,7 +1148,7 @@ void wmCheckMail_routine(int argc, char **argv){ else if (k > 0) { sprintf(pc->delstatus, "%-3s/D:%2d", pc->alias, k); } - else + else sprintf(pc->delstatus, "%-3s: ok", pc->alias); pc->forcedCheck = YES; } @@ -1189,10 +1189,10 @@ void wmCheckMail_routine(int argc, char **argv){ if ((5 < buttonStatus) && (buttonStatus <= 5 + NB_LINE)) { if ((buttonStatus - 6 + index_vert) < summess) { /* first update lines to del */ - *(linestodel[buttonStatus - 6]) = + *(linestodel[buttonStatus - 6]) = 1 - *(linestodel[buttonStatus - 6]); #ifdef _DEBUG - printf(" button %d pressed, j'update lines to del\n", + printf(" button %d pressed, j'update lines to del\n", buttonStatus - 6); haspassed = 1; #endif @@ -1219,7 +1219,7 @@ void wmCheckMail_routine(int argc, char **argv){ } else { /* summary view mode */ if ((5 < buttonStatus) && (buttonStatus <= 5 + nb_conf)) { - if ((Event.xbutton.x > 10) && + if ((Event.xbutton.x > 10) && (Event.xbutton.x < (10 + (4 * (CHAR_WIDTH + 1))))) { #ifdef _DEBUG printf(" launching command for conf %d\n", @@ -1232,32 +1232,32 @@ void wmCheckMail_routine(int argc, char **argv){ printf(" command is for each mail but there's no mail\n"); } #endif - for (i = 0; i < pc->numOfMessages; i++) - spawn_command(i, pc->mailclient, nbnewmail, + for (i = 0; i < pc->numOfMessages; i++) + spawn_command(i, pc->mailclient, nbnewmail, "mailcli.", pc); } else { - spawn_command(-1, pc->mailclient, nbnewmail, + spawn_command(-1, pc->mailclient, nbnewmail, "mailcli.", pc); } } - else if ((Event.xbutton.x > (10 + (4 * (CHAR_WIDTH + 1)))) && + else if ((Event.xbutton.x > (10 + (4 * (CHAR_WIDTH + 1)))) && (Event.xbutton.x < (10 + (8 * (CHAR_WIDTH + 1))))) { /* swap view mode */ - conf[buttonStatus - 6]->countunreadonly = + conf[buttonStatus - 6]->countunreadonly = 1 - conf[buttonStatus - 6]->countunreadonly; #ifdef _DEBUG printf(" swapping view mode for conf %d: %s\n", buttonStatus - 6, (conf[buttonStatus - 6]->countunreadonly) ? "UnreadMessages" : "TotalMessages"); - -#endif + +#endif } } - else if ((5 + NB_LINE) == buttonStatus) { + else if ((5 + NB_LINE) == buttonStatus) { /* status summary line pressed */ - if ((Event.xbutton.x > 10) && + if ((Event.xbutton.x > 10) && (Event.xbutton.x < (10 + (4 * (CHAR_WIDTH + 1))))) { /* select all messages */ for (iS = 0; iS < nb_conf; iS++) { @@ -1266,7 +1266,7 @@ void wmCheckMail_routine(int argc, char **argv){ } } } - else if ((Event.xbutton.x > (10 + (4 * (CHAR_WIDTH + 1)))) && + else if ((Event.xbutton.x > (10 + (4 * (CHAR_WIDTH + 1)))) && (Event.xbutton.x < (10 + (8 * (CHAR_WIDTH + 1))))) { /* unselect all messages */ for (iS = 0; iS < nb_conf; iS++) { @@ -1335,10 +1335,10 @@ void BlitString(char *name, int x, int y, int fragment) int c; int k; int row; - + /* printf("--name: [%s] \n", name); */ for (i = 0, k = x; name[i]; i++) { - c = toupper(name[i]); + c = toupper(name[i]); if (c >= 'A' && c <= 'Z') { /* its a letter */ c -= 'A'; row = LETTERS; @@ -1356,7 +1356,7 @@ void BlitString(char *name, int x, int y, int fragment) c = 27; row = LETTERS; break; - case ':': + case ':': c = 10; row = NUMBERS; break; @@ -1385,23 +1385,23 @@ void BlitString(char *name, int x, int y, int fragment) row = NUMBERS; break; } - /* printf("c:%2d (%c), fragment: %d, i:%d, k=%d ", + /* printf("c:%2d (%c), fragment: %d, i:%d, k=%d ", c, name[i], fragment, i, k); */ if (i > 0 && i < NB_DISP) { - copyXPMArea(c * CHAR_WIDTH, CH_COLOR(row), CHAR_WIDTH + 1, CHAR_HEIGHT, + copyXPMArea(c * CHAR_WIDTH, CH_COLOR(row), CHAR_WIDTH + 1, CHAR_HEIGHT, k, y); /* printf(" - k1: %d += %d + 1", k, CHAR_WIDTH); */ k += CHAR_WIDTH + 1; } else if (0 == i) { - copyXPMArea(c * CHAR_WIDTH + fragment, CH_COLOR(row), - CHAR_WIDTH + 1 - fragment, CHAR_HEIGHT, + copyXPMArea(c * CHAR_WIDTH + fragment, CH_COLOR(row), + CHAR_WIDTH + 1 - fragment, CHAR_HEIGHT, k, y); /* printf(" - k2: %d += %d + 1 - %d", k, CHAR_WIDTH, fragment); */ k += CHAR_WIDTH + 1 - fragment; } else if (fragment && (NB_DISP == i)) { - copyXPMArea(c * CHAR_WIDTH, CH_COLOR(row), fragment + 1, CHAR_HEIGHT, + copyXPMArea(c * CHAR_WIDTH, CH_COLOR(row), fragment + 1, CHAR_HEIGHT, k, y); /* printf(" - k3: %d += %d ", k, fragment); */ k += fragment; @@ -1417,11 +1417,11 @@ void BlitNum(int num, int x, int y, int todelete) { if (todelete) num += 19; - copyXPMArea(((num - 1) * (SN_CHAR_W + 1)) + 1, CH_COLOR(SMALL_NUM), + copyXPMArea(((num - 1) * (SN_CHAR_W + 1)) + 1, CH_COLOR(SMALL_NUM), SN_CHAR_W, CHAR_HEIGHT + 1, x, y); } -int parsestring(char *buf, char *data, int max, FILE *fp) +int parsestring(char *buf, char *data, int max, FILE *fp) { char *deb; char *end; @@ -1582,18 +1582,18 @@ int readConfigFile( char *filename ){ fclose(fp); return -1; } - + nb_conf = 0; tempdir[0] = '\0'; - + while ((nb_conf < 7) && fgets(buf, CONF_BUFLEN, fp) != 0) { if (buf[0] != '#') { if (!nb_conf && !strncasecmp( buf, "autochecking", 12) ){ - if (parsenum(buf + 12, &autoChecking)) + if (parsenum(buf + 12, &autoChecking)) fprintf(stderr, "syntax error for parameter autochecking\n"); } else if (!nb_conf && !strncasecmp( buf, "scrollspeed", 11) ){ - if (parsenum(buf + 11, &scrollspeed)) + if (parsenum(buf + 11, &scrollspeed)) fprintf(stderr, "syntax error for parameter scrollspeed\n"); } else if (!nb_conf && !strncasecmp( buf, "displaydelay", 12) ){ @@ -1614,12 +1614,12 @@ int readConfigFile( char *filename ){ } else if (nb_conf && !strncasecmp(buf, "username", 8) ) { if (parsestring(buf + 8, conf[nb_conf -1]->username, 256, fp)) - fprintf(stderr, "section %d: invalid syntax for username\n", + fprintf(stderr, "section %d: invalid syntax for username\n", nb_conf); } else if (nb_conf && !strncasecmp( buf, "password", 8) ){ if (parsestring(buf + 8, conf[nb_conf - 1]->password, 256, fp)) - fprintf(stderr, "section %d: invalid syntax for password\n", + fprintf(stderr, "section %d: invalid syntax for password\n", nb_conf); } else if (nb_conf && !strncasecmp(buf, "alias", 5) ) { @@ -1628,12 +1628,12 @@ int readConfigFile( char *filename ){ } else if (nb_conf && !strncasecmp( buf, "popserver", 9) ){ if (parsestring(buf + 9, conf[nb_conf - 1]->popserver, 128, fp)) - fprintf(stderr, "section %d: invalid syntax for popserver\n", + fprintf(stderr, "section %d: invalid syntax for popserver\n", nb_conf); } else if (nb_conf && !strncasecmp( buf, "port", 4) ){ if (parsenum(buf + 4, &(conf[nb_conf - 1]->serverport))) - fprintf(stderr, "section %d: Invalid popserver port number.\n", + fprintf(stderr, "section %d: Invalid popserver port number.\n", nb_conf); } else if (!nb_conf && !strncasecmp( buf, "viewallmessages", 15) ){ @@ -1652,26 +1652,26 @@ int readConfigFile( char *filename ){ } else if (nb_conf && !strncasecmp(buf, "mailclient", 10)) { if (parsestring(buf + 10, tmp, 256, fp)) - fprintf(stderr, "section %d: Invalid syntax for mailclient.\n", + fprintf(stderr, "section %d: Invalid syntax for mailclient.\n", nb_conf); else conf[nb_conf - 1]->mailclient = build_arg_list(tmp, strlen(tmp)); } else if (nb_conf && !strncasecmp(buf, "newmailcommand", 14)) { if (parsestring(buf + 14, tmp, 256, fp)) - fprintf(stderr,"section %d: Invalid syntax for newmailcommand.\n", + fprintf(stderr,"section %d: Invalid syntax for newmailcommand.\n", nb_conf); - else - conf[nb_conf - 1]->newmailcommand = + else + conf[nb_conf - 1]->newmailcommand = build_arg_list(tmp, strlen(tmp)); } else if (nb_conf && !strncasecmp(buf, "selectedmesgcommand", 19)) { if (parsestring(buf + 19, tmp, 256, fp)) fprintf(stderr, - "section %d: Invalid syntax for selectedmesgcommand.\n", + "section %d: Invalid syntax for selectedmesgcommand.\n", nb_conf); else - conf[nb_conf - 1]->selectedmesgcommand = + conf[nb_conf - 1]->selectedmesgcommand = build_arg_list(tmp, strlen(tmp)); } else if (nb_conf && !strncasecmp(buf, "mailseparator", 13)) { @@ -1683,9 +1683,9 @@ int readConfigFile( char *filename ){ if (parsenum(buf + 9, &(conf[nb_conf -1]->maxdlsize))) fprintf(stderr, "section %d: Invalid maxdlsize.\n", nb_conf); } - else if (nb_conf) { + else if (nb_conf) { if (*buf && (isalpha(*buf) || isalnum(*buf))) - fprintf(stderr, "section %d: Unknown indentifier : [%s]\n", + fprintf(stderr, "section %d: Unknown indentifier : [%s]\n", nb_conf, buf); } else { @@ -1693,7 +1693,7 @@ int readConfigFile( char *filename ){ if (*bal) fprintf(stderr, "identifier outside Server section: [%s]\n", buf); } - } + } } fclose(fp); return 0; diff --git a/wmradio/Makefile b/wmradio/Makefile index ce8a65e..ef2679e 100644 --- a/wmradio/Makefile +++ b/wmradio/Makefile @@ -13,7 +13,7 @@ LIBXOSD_LIBS= X_CFLAGS= -I/usr/X11R6/include X_LIBS= -L/usr/X11R6/lib -lXpm -lXext -lX11 -lm -PANEL_CFLAGS=-DGNOME_RADIO +PANEL_CFLAGS=-DGNOME_RADIO PANEL_LIBS= EXTRA_CFLAGS=-Wall -D SKIN_DIR=\"$(LIBDIR)\" diff --git a/wmradio/config.h b/wmradio/config.h index 950ab36..80d1d59 100644 --- a/wmradio/config.h +++ b/wmradio/config.h @@ -1,20 +1,20 @@ /* * Copyright (C) 12 Jun 2003 Tomas Cermak - * - * This file is part of wmradio program. + * + * This file is part of wmradio program. * * 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 * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ diff --git a/wmradio/config.h.in b/wmradio/config.h.in index 986cb7a..9527533 100644 --- a/wmradio/config.h.in +++ b/wmradio/config.h.in @@ -1,20 +1,20 @@ /* * Copyright (C) 12 Jun 2003 Tomas Cermak - * - * This file is part of wmradio program. + * + * This file is part of wmradio program. * * 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 * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ diff --git a/wmradio/config.log b/wmradio/config.log index 37d2bbd..ea23524 100644 --- a/wmradio/config.log +++ b/wmradio/config.log @@ -76,7 +76,7 @@ configure:1699: result: no configure:1702: checking for suffix of executables configure:1704: gcc -o conftest conftest.c >&5 configure:1707: $? = 0 -configure:1732: result: +configure:1732: result: configure:1738: checking for suffix of object files configure:1760: gcc -c conftest.c >&5 configure:1763: $? = 0 @@ -115,7 +115,7 @@ configure:2205: $? = 1 configure: failed program was: | #line 2190 "configure" | /* confdefs.h. */ -| +| | #define PACKAGE_NAME "" | #define PACKAGE_TARNAME "" | #define PACKAGE_VERSION "" @@ -132,7 +132,7 @@ configure:2312: $? = 1 configure: failed program was: | #line 2297 "configure" | /* confdefs.h. */ -| +| | #define PACKAGE_NAME "" | #define PACKAGE_TARNAME "" | #define PACKAGE_VERSION "" @@ -185,11 +185,11 @@ configure:3819: creating ./config.status This file was extended by config.status, which was generated by GNU Autoconf 2.57. Invocation command line was - CONFIG_FILES = - CONFIG_HEADERS = - CONFIG_LINKS = - CONFIG_COMMANDS = - $ ./config.status + CONFIG_FILES = + CONFIG_HEADERS = + CONFIG_LINKS = + CONFIG_COMMANDS = + $ ./config.status on m700pha.anect.cz diff --git a/wmradio/config/wmradio-config.py b/wmradio/config/wmradio-config.py index 8e1731b..58da8e2 100644 --- a/wmradio/config/wmradio-config.py +++ b/wmradio/config/wmradio-config.py @@ -7,7 +7,7 @@ from locale import setlocale, LC_ALL import os PREFIX = "/usr" -LOCALEDIR = "%s/share/locale" % (PREFIX) +LOCALEDIR = "%s/share/locale" % (PREFIX) PACKAGE = "wmradio-config.py" SKINDIR = "%s/lib/wmradio" % (PREFIX) FREQMIN=87.5 @@ -126,7 +126,7 @@ class WmRadioConfig: self.cfg.set_variable("config", "preset%i" % i , "%.2f" % self.g_pressed[i].get_value()) - self.station_to_ini() + self.station_to_ini() self.cfg.set_int_variable("config","osd", self.g_osd.get_active()) self.cfg.set_variable("config","osd-font",self.g_osd_font.get_text()) self.cfg.set_variable("config","osd-color", self.g_osd_color.get_text()) @@ -156,7 +156,7 @@ class WmRadioConfig: for name in self.cfg.sections["names"].keys(): item = self.g_jobs.append() self.g_jobs.set(item,0, - "%s=%s" % + "%s=%s" % (name,self.cfg.get_variable("names",name)) ) if self.cfg.get_variable("config","osd") == "1": @@ -184,7 +184,7 @@ class WmRadioConfig: item = self.g_jobs.append() self.g_jobs.set(item, 0, - "%s=%.2f" % + "%s=%.2f" % (self.g_new_name.get_text(), self.g_new_freq.get_value())) def activate_delete_button(self,model,path,iter,data): @@ -207,7 +207,7 @@ class WmRadioConfig: if string.lower(name) == string.lower(text): self.g_jobs.set(iter, 0, - "%s=%.2f" % + "%s=%.2f" % (self.g_new_name.get_text(), self.g_new_freq.get_value())) self.station_alredy_exist = 1 @@ -243,10 +243,10 @@ class WmRadioConfig: self.g_start_muted = gtk.CheckButton(_("Start muted")) table.attach(self.g_start_muted,0,2,2,3) - + self.g_dont_quit = gtk.CheckButton(_("Don't quit mode")) table.attach(self.g_dont_quit,0,2,3,4) - + return frame def frame2(self): frame = gtk.Frame(_("Stations")) @@ -314,7 +314,7 @@ class WmRadioConfig: self.g_delete_button = gtk.Button(_("Delete")) self.g_delete_button.connect("clicked",self.on_delete) self.g_delete_button.set_sensitive(gtk.FALSE) - + table.attach(self.g_delete_button,0,1,2,3,yoptions=0) return frame def frame4(self): @@ -327,7 +327,7 @@ class WmRadioConfig: table.set_border_width(5) table.set_col_spacings(5) frame.add(table) - + self.g_osd = gtk.CheckButton(_("Use osd")) table.attach(self.g_osd,0,2,0,1) self.g_osd.connect("clicked",self.on_osd_changed,None) @@ -361,7 +361,7 @@ class WmRadioConfig: table.attach(lbl,0,1,5,6) self.g_osd_timeout = gtk.SpinButton(gtk.Adjustment(0,0,5000,1,5,0)) table.attach(self.g_osd_timeout,1,2,5,6) - + return vbox def create_gui(self): setlocale(LC_ALL,"") diff --git a/wmradio/config/wmradio-config.py.in b/wmradio/config/wmradio-config.py.in index 9afb2fb..c2ab0bc 100644 --- a/wmradio/config/wmradio-config.py.in +++ b/wmradio/config/wmradio-config.py.in @@ -7,7 +7,7 @@ from locale import setlocale, LC_ALL import os PREFIX = "@prefix@" -LOCALEDIR = "%s/share/locale" % (PREFIX) +LOCALEDIR = "%s/share/locale" % (PREFIX) PACKAGE = "wmradio-config.py" SKINDIR = "%s/lib/wmradio" % (PREFIX) FREQMIN=87.5 @@ -126,7 +126,7 @@ class WmRadioConfig: self.cfg.set_variable("config", "preset%i" % i , "%.2f" % self.g_pressed[i].get_value()) - self.station_to_ini() + self.station_to_ini() self.cfg.set_int_variable("config","osd", self.g_osd.get_active()) self.cfg.set_variable("config","osd-font",self.g_osd_font.get_text()) self.cfg.set_variable("config","osd-color", self.g_osd_color.get_text()) @@ -156,7 +156,7 @@ class WmRadioConfig: for name in self.cfg.sections["names"].keys(): item = self.g_jobs.append() self.g_jobs.set(item,0, - "%s=%s" % + "%s=%s" % (name,self.cfg.get_variable("names",name)) ) if self.cfg.get_variable("config","osd") == "1": @@ -184,7 +184,7 @@ class WmRadioConfig: item = self.g_jobs.append() self.g_jobs.set(item, 0, - "%s=%.2f" % + "%s=%.2f" % (self.g_new_name.get_text(), self.g_new_freq.get_value())) def activate_delete_button(self,model,path,iter,data): @@ -207,7 +207,7 @@ class WmRadioConfig: if string.lower(name) == string.lower(text): self.g_jobs.set(iter, 0, - "%s=%.2f" % + "%s=%.2f" % (self.g_new_name.get_text(), self.g_new_freq.get_value())) self.station_alredy_exist = 1 @@ -243,10 +243,10 @@ class WmRadioConfig: self.g_start_muted = gtk.CheckButton(_("Start muted")) table.attach(self.g_start_muted,0,2,2,3) - + self.g_dont_quit = gtk.CheckButton(_("Don't quit mode")) table.attach(self.g_dont_quit,0,2,3,4) - + return frame def frame2(self): frame = gtk.Frame(_("Stations")) @@ -314,7 +314,7 @@ class WmRadioConfig: self.g_delete_button = gtk.Button(_("Delete")) self.g_delete_button.connect("clicked",self.on_delete) self.g_delete_button.set_sensitive(gtk.FALSE) - + table.attach(self.g_delete_button,0,1,2,3,yoptions=0) return frame def frame4(self): @@ -327,7 +327,7 @@ class WmRadioConfig: table.set_border_width(5) table.set_col_spacings(5) frame.add(table) - + self.g_osd = gtk.CheckButton(_("Use osd")) table.attach(self.g_osd,0,2,0,1) self.g_osd.connect("clicked",self.on_osd_changed,None) @@ -361,7 +361,7 @@ class WmRadioConfig: table.attach(lbl,0,1,5,6) self.g_osd_timeout = gtk.SpinButton(gtk.Adjustment(0,0,5000,1,5,0)) table.attach(self.g_osd_timeout,1,2,5,6) - + return vbox def create_gui(self): setlocale(LC_ALL,"") diff --git a/wmradio/configure.in b/wmradio/configure.in index 2c5b661..16c6948 100644 --- a/wmradio/configure.in +++ b/wmradio/configure.in @@ -30,7 +30,7 @@ fi dnl gnome panel test ------------------------------------------------- PANEL_LIBS="" PANEL_CFLAGS="" -if test "$enable_gnome" = "yes" ; then +if test "$enable_gnome" = "yes" ; then AC_PATH_PROG(PKG_CONFIG, pkg-config ) if test "$PKG_CONFIG" = "" ; then AC_MSG_ERROR(pgk-config not found) diff --git a/wmradio/doc/wmradio.1 b/wmradio/doc/wmradio.1 index 52abc6f..6821c15 100644 --- a/wmradio/doc/wmradio.1 +++ b/wmradio/doc/wmradio.1 @@ -1,4 +1,4 @@ -.TH WMRADIO 1 +.TH WMRADIO 1 .SH NAME wmradio \- dockable FM radio for WindowMaker. .SH SYNOPSIS @@ -12,15 +12,15 @@ wmradio \- dockable FM radio for WindowMaker. .B \-q|\-\-dont\-quit Start in "Don't quit" mode. .TP -.B \-m|\-\-start\-muted -Start and don't open the radio device. +.B \-m|\-\-start\-muted +Start and don't open the radio device. .TP .B \-h|\-\-help Print help page and quit .SH wmradio-remote is simple shell script. It writes commands into wmradio's named pipe. Example: -.I wmradio-remote SET_PRESET 3 +.I wmradio-remote SET_PRESET 3 .SH wmradio-config.py GUI application for setting wmradio .SH Tunning @@ -34,8 +34,8 @@ the ~/.wmradio file. .SH Mouse wheel support In the diaplay the mouse wheel changes stations with names. With <shift-wheel> it change frequency (<shift-control-wheel> -= fine tuning). In other place the Mouse wheel changes -the preset station. += fine tuning). In other place the Mouse wheel changes +the preset station. .SH Normal mode In this mode, program mutes the radio, closes the device and quits by clicking into <power> button. <control-power> click close the device only, the program @@ -48,8 +48,8 @@ Every skin is specified in two files. The XPM bitmap file and the text descripti There are coordinates and dimensions of skin parts (as buttons and digits) in this file. You can change the skin by editing your ~/.wmradio file. .P -In the skin image is the background in left top corner. Default size is -56x56 pixels. Buttons and digits are around this. Button is defined by +In the skin image is the background in left top corner. Default size is +56x56 pixels. Buttons and digits are around this. Button is defined by 6 numbers. .P name=xdest,ydest,xsource,ysource,width,height diff --git a/wmradio/fifo.c b/wmradio/fifo.c index c8d9d55..dc3b165 100644 --- a/wmradio/fifo.c +++ b/wmradio/fifo.c @@ -1,20 +1,20 @@ /* * Copyright (C) 12 Jun 2003 Tomas Cermak - * - * This file is part of wmradio program. + * + * This file is part of wmradio program. * * 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 * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "fifo.h" @@ -39,7 +39,7 @@ char *read_line(FILE *file) int size=MAX_STRINGS; int retries; struct timespec pause = { 0, 100000000 }; - + if (fgets(str,MAX_STRINGS,file)==NULL) { free(str); @@ -70,7 +70,7 @@ char *read_line(FILE *file) char * fifo_filename() { static char *name = NULL; char buffer[100]; - + if (name == NULL) { snprintf(buffer,sizeof(buffer),"%i",getuid()); name = malloc(sizeof(char)*strlen(buffer)+ diff --git a/wmradio/fifo.h b/wmradio/fifo.h index a82b684..edaa8c1 100644 --- a/wmradio/fifo.h +++ b/wmradio/fifo.h @@ -1,20 +1,20 @@ /* * Copyright (C) 12 Jun 2003 Tomas Cermak - * - * This file is part of wmradio program. + * + * This file is part of wmradio program. * * 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 * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ diff --git a/wmradio/gnome_applet_envelope.c b/wmradio/gnome_applet_envelope.c index a66be95..8b47b3c 100644 --- a/wmradio/gnome_applet_envelope.c +++ b/wmradio/gnome_applet_envelope.c @@ -1,20 +1,20 @@ /* * Copyright (C) 12 Jun 2003 Tomas Cermak - * - * This file is part of wmradio program. + * + * This file is part of wmradio program. * * 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 * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ @@ -40,7 +40,7 @@ guint timer; void logt(char *s) { FILE *f; - + f = fopen("/tmp/wmradio.log","a"); fputs(s,f); fputs("\n",f); @@ -72,10 +72,10 @@ void gtk_drawing_area_copy_from_X11_drawable(GtkDrawingArea *DA, int destx, int desty) { GdkWindow *gdkwindow; - + g_return_if_fail( DA != NULL ); g_return_if_fail( X11 != 0 ); - + gdkwindow = GDK_WINDOW(GTK_WIDGET(DA)->window); if(!GDK_WINDOW_DESTROYED( gdkwindow ) ) { XCopyArea(GDK_DISPLAY(), @@ -89,7 +89,7 @@ void gtk_drawing_area_copy_from_X11_drawable(GtkDrawingArea *DA, gint on_expose(GtkWidget *w, GdkEventExpose *e) { RadioEvent re; - + re.type = REVENT_EXPOSE; wmradio_handle_event(&re); return TRUE; @@ -98,39 +98,39 @@ gint on_expose(GtkWidget *w, GdkEventExpose *e) gint on_button_press(GtkWidget *w, GdkEventButton *e) { RadioEvent re; - + re.type = REVENT_BUTTON_PRESS; re.x = e->x; re.y = e->y; - re.control = e->state & GDK_CONTROL_MASK ? + re.control = e->state & GDK_CONTROL_MASK ? CONTROL_STATE_PRESSED : CONTROL_STATE_NOT_PRESSED; - re.shift = e->state & GDK_SHIFT_MASK ? + re.shift = e->state & GDK_SHIFT_MASK ? CONTROL_STATE_PRESSED : CONTROL_STATE_NOT_PRESSED; wmradio_handle_event(&re); - if( e->button & 2 ) return FALSE; + if( e->button & 2 ) return FALSE; return TRUE; } gint on_button_release(GtkWidget *w, GdkEventButton *e) { RadioEvent re; - + re.type = REVENT_BUTTON_RELEASE; re.x = e->x; re.y = e->y; - re.control = e->state & GDK_CONTROL_MASK ? + re.control = e->state & GDK_CONTROL_MASK ? CONTROL_STATE_PRESSED : CONTROL_STATE_NOT_PRESSED; - re.shift = e->state & GDK_SHIFT_MASK ? + re.shift = e->state & GDK_SHIFT_MASK ? CONTROL_STATE_PRESSED : CONTROL_STATE_NOT_PRESSED; wmradio_handle_event(&re); - if( e->button & 2 ) return FALSE; + if( e->button & 2 ) return FALSE; return TRUE; } gint on_scroll(GtkWidget *w, GdkEventScroll *e) { RadioEvent re; - + switch(e->direction) { case GDK_SCROLL_UP: re.type = REVENT_SCROLL_UP; @@ -143,9 +143,9 @@ gint on_scroll(GtkWidget *w, GdkEventScroll *e) } re.x = e->x; re.y = e->y; - re.control = e->state & GDK_CONTROL_MASK ? + re.control = e->state & GDK_CONTROL_MASK ? CONTROL_STATE_PRESSED : CONTROL_STATE_NOT_PRESSED; - re.shift = e->state & GDK_SHIFT_MASK ? + re.shift = e->state & GDK_SHIFT_MASK ? CONTROL_STATE_PRESSED : CONTROL_STATE_NOT_PRESSED; wmradio_handle_event(&re); return TRUE; @@ -154,7 +154,7 @@ gint on_scroll(GtkWidget *w, GdkEventScroll *e) gint on_timer(gpointer data) { RadioEvent re; - + re.type = REVENT_TIMER; wmradio_handle_event(&re); return TRUE; @@ -240,7 +240,7 @@ static gboolean wmradio_applet_fill(PanelApplet *applet, gpointer data) { if (strcmp (iid, "OAFIID:WMRadioApplet") != 0) return FALSE; - + video_init(); gtk_container_add (GTK_CONTAINER (applet), radio); gtk_widget_show_all (GTK_WIDGET (applet)); @@ -258,10 +258,10 @@ PANEL_APPLET_BONOBO_FACTORY ("OAFIID:WMRadioApplet_Factory", /* int main(int argc, char *argv[]) */ /* { */ /* GtkWidget *win; */ - + /* gtk_set_locale(); */ /* gtk_init(&argc,&argv); */ - + /* win = gtk_window_new(GTK_WINDOW_TOPLEVEL); */ /* radio = video_init(); */ /* gtk_container_add (GTK_CONTAINER (win), radio); */ diff --git a/wmradio/gnome_applet_envelope.h b/wmradio/gnome_applet_envelope.h index 8dd4c35..1511205 100644 --- a/wmradio/gnome_applet_envelope.h +++ b/wmradio/gnome_applet_envelope.h @@ -1,20 +1,20 @@ /* * Copyright (C) 12 Jun 2003 Tomas Cermak - * - * This file is part of wmradio program. + * + * This file is part of wmradio program. * * 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 * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ diff --git a/wmradio/ini.c b/wmradio/ini.c index 4d7c65c..c194542 100644 --- a/wmradio/ini.c +++ b/wmradio/ini.c @@ -8,7 +8,7 @@ List *ini_section_add(List *ini, char *name) { char *c; IniSection *i; - + c = strdup(name); if(!c) return ini; i = (IniSection *)malloc(sizeof(IniSection)); @@ -23,7 +23,7 @@ List *ini_get_section_node(List *ini, char *name) { List *item; IniSection *i; - + item = ini; while(item) { i = item -> data; @@ -36,7 +36,7 @@ List *ini_get_section_node(List *ini, char *name) IniSection *ini_get_section(List *ini, char *name) { List *item; - + item = ini_get_section_node(ini,name); if(!item) return NULL; return (IniSection *)(item->data); @@ -47,7 +47,7 @@ List *ini_get_variable_node(List *ini, char *section, char *variable) IniSection *sec; IniVariable *ini_i; List *item; - + sec = ini_get_section(ini, section); if(!sec) return NULL; item = sec->variables; @@ -62,7 +62,7 @@ List *ini_get_variable_node(List *ini, char *section, char *variable) IniVariable *ini_get_variable_ini_variable(List *ini, char *section, char *variable) { List *item; - + item = ini_get_variable_node(ini,section,variable); if(!item) return NULL; return (IniVariable *)(item->data); @@ -92,22 +92,22 @@ void ini_variable_add_empty(List *ini, char *section, char *variable) List *item; IniSection *sec; IniVariable *var; - + item = ini_get_section_node(ini,section); if(!item) { ini = ini_section_add(ini,section); item = ini_get_section_node(ini,section); } if(!item) return; - + sec = item->data; - + var = (IniVariable *)malloc(sizeof(IniVariable)); if(!var) return; var->name = strdup(variable); var->value = NULL; var->value_int = INI_INT_UNDEFINED; - + sec->variables = list_add_data(sec->variables,var); } @@ -115,23 +115,23 @@ List *ini_set_variable(List *ini, char *section, char *variable, char *value) { List *item; IniVariable *var; - + item = ini_get_section_node(ini,section); if(!item) { ini = ini_section_add(ini,section); item = ini_get_section_node(ini,section); } if(!item) return ini; - + item = ini_get_variable_node(ini,section,variable); if(!item) { ini_variable_add_empty(ini,section,variable); item = ini_get_variable_node(ini,section,variable); } if(!item) return ini; - + var = item->data; - + free(var->value); var->value = strdup(value); return ini; @@ -141,7 +141,7 @@ List *ini_set_variable_as_int(List *ini, char *section, char *variable, int valu { IniVariable *i; char value_str[256]; - + snprintf(value_str,sizeof(value_str),"%i",value); ini = ini_set_variable(ini,section,variable,value_str); i = ini_get_variable_ini_variable(ini,section,variable); @@ -153,7 +153,7 @@ void ini_print(FILE *f, List *ini) { List *section_item,*var_item; IniSection *section_data; IniVariable *ini_data; - + for(section_item = ini; section_item; section_item = section_item->next) { section_data = section_item->data; fprintf(f,"[%s]\n",section_data->name); @@ -167,7 +167,7 @@ void ini_print(FILE *f, List *ini) { void ini_save_file(List *ini, char *filename) { FILE *f; - + f = fopen(filename,"w"); ini_print(f,ini); fclose(f); @@ -176,12 +176,12 @@ void ini_save_file(List *ini, char *filename) void ini_readline(FILE *f,char *buffer,int size) { char *p; - + fgets(buffer,size-1,f); p = strstr(buffer,"\n"); if(p) *p = 0; p = strstr(buffer,";"); - if(p) *p = 0; + if(p) *p = 0; p = strstr(buffer,"#"); if(p) *p = 0; } @@ -189,7 +189,7 @@ void ini_readline(FILE *f,char *buffer,int size) char *ini_buffer_to_section(char *buffer) { char *b,*e; - + b = strstr(buffer,"["); if(!b) return NULL; e = strstr(b,"]"); @@ -203,7 +203,7 @@ char *ini_buffer_to_section(char *buffer) void ini_buffer_to_variable(char *buffer, char **var, char **val) { char *p; - + p = strstr(buffer,"="); if(!p) { *var = NULL; @@ -221,7 +221,7 @@ List *ini_load_file(List *ini, char *default_section, char *name) FILE *f; char buffer[1024],current_section[100]; char *section, *var, *val; - + memset(current_section,0,sizeof(current_section)); if(default_section) strncpy(current_section,default_section,sizeof(current_section)-1); f = fopen(name,"r"); @@ -249,7 +249,7 @@ List *ini_section_node_with_variable_node(List *ini, List *node) { IniSection *section_data; List *section; - + for(section = ini; section; section = section->next) { section_data = section->data; if( list_has_node(section_data->variables,node) ) return section; @@ -261,7 +261,7 @@ void ini_delete_variable_ini_variable(IniVariable *var) { if(var->name) free(var->name); if(var->value) free(var->value); - free(var); + free(var); } void ini_delete_variable_node(List *ini, List *node) @@ -269,11 +269,11 @@ void ini_delete_variable_node(List *ini, List *node) IniVariable *ini_var; List *section_node; IniSection *section_data; - + section_node = ini_section_node_with_variable_node(ini,node); if(!section_node) return; section_data = section_node->data; - + ini_var = node->data; ini_delete_variable_ini_variable(ini_var); section_data->variables = list_delete_node(section_data->variables,node); @@ -282,7 +282,7 @@ void ini_delete_variable_node(List *ini, List *node) void ini_delete_variable(List *ini, char *section, char *variable) { List *node; - + node = ini_get_variable_node(ini,section,variable); if(!node) return; ini_delete_variable_node(ini,node); @@ -292,7 +292,7 @@ List *ini_delete_section(List *ini, char *section) { List *section_node, *var_node; IniSection *section_data; - + section_node = ini_get_section_node(ini,section); if(!section_node) return ini; section_data = section_node->data; diff --git a/wmradio/ini.h b/wmradio/ini.h index 4916894..207fca3 100644 --- a/wmradio/ini.h +++ b/wmradio/ini.h @@ -1,20 +1,20 @@ /* * Copyright (C) 12 Jun 2003 Tomas Cermak - * - * This file is part of wmradio program. + * + * This file is part of wmradio program. * * 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 * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ diff --git a/wmradio/lists.c b/wmradio/lists.c index f41b44a..ad11179 100644 --- a/wmradio/lists.c +++ b/wmradio/lists.c @@ -12,7 +12,7 @@ List *list_new_item() List *list_last(List *list) { List *item; - + item = list; if(!item) return NULL; while(item->next) item = item->next; @@ -22,21 +22,21 @@ List *list_last(List *list) List *list_add(List *list, List *newitem) { List *lastitem; - + if(!newitem) return list; if(!list) return newitem; - + lastitem = list_last(list); lastitem -> next = newitem; newitem -> prev = lastitem; - + return list; } List *list_add_data(List *list, void *data) { List *newitem; - + newitem = list_new_item(); if(!newitem) return list; list = list_add(list,newitem); @@ -47,7 +47,7 @@ List *list_add_data(List *list, void *data) List *list_node_with_data(List *list, void *data) { List *item; - + item = list; while(item) { if(item->data == data) return item; @@ -60,7 +60,7 @@ int list_length(List *list) { int l = 0; List *item; - + if(!list) return 0; item = list; while(item) { @@ -74,7 +74,7 @@ List *list_nth_node(List *list, int index) { List *item; int i; - + item = list; i = 0; while(item) { @@ -88,10 +88,10 @@ List *list_nth_node(List *list, int index) List *list_remove_node(List *list, List *node) { List *prev,*next; - + if(!list) return list; if(!node) return list; - + prev = node ->prev; next = node ->next; node -> next = NULL; @@ -112,10 +112,10 @@ List *list_delete_node(List *list, List *node) void list_for_each(List *list, list_for_each_function func, void *data) { List *item = list; - + if(!list) return; if(!func) return; - + while(item) { if( func(item, data) ) return; item = item -> next; @@ -125,9 +125,9 @@ void list_for_each(List *list, list_for_each_function func, void *data) void list_free(List *list) { List *item, *prev; - + item = list_last(list); - + while(item) { prev = item->prev; free(item); @@ -138,7 +138,7 @@ void list_free(List *list) int list_has_node(List *list, List *node) { List *i; - + for(i=list; i ; i = i->next) { if( i == node ) return 1; } diff --git a/wmradio/lists.h b/wmradio/lists.h index b7456d3..9bff71e 100644 --- a/wmradio/lists.h +++ b/wmradio/lists.h @@ -1,20 +1,20 @@ /* * Copyright (C) 12 Jun 2003 Tomas Cermak - * - * This file is part of wmradio program. + * + * This file is part of wmradio program. * * 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 * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ diff --git a/wmradio/osd.c b/wmradio/osd.c index 6c8a14a..8534edd 100644 --- a/wmradio/osd.c +++ b/wmradio/osd.c @@ -1,20 +1,20 @@ /* * Copyright (C) 12 Jun 2003 Tomas Cermak - * - * This file is part of wmradio preogram. + * + * This file is part of wmradio preogram. * * 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 * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "osd.h" @@ -64,7 +64,7 @@ int osd_init(char *progname, char *font, char *color, } } else xosd_set_colour(osd, "LawnGreen"); - + xosd_set_vertical_offset(osd, y); xosd_set_horizontal_offset(osd, x); xosd_set_shadow_offset(osd, shadow); diff --git a/wmradio/osd.h b/wmradio/osd.h index 1d76217..ff6982a 100644 --- a/wmradio/osd.h +++ b/wmradio/osd.h @@ -1,20 +1,20 @@ /* * Copyright (C) 12 Jun 2003 Tomas Cermak - * - * This file is part of wmradio preogram. + * + * This file is part of wmradio preogram. * * 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 * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ diff --git a/wmradio/radio.c b/wmradio/radio.c index 44502ec..ce93ab4 100644 --- a/wmradio/radio.c +++ b/wmradio/radio.c @@ -1,20 +1,20 @@ /* * Copyright (C) 12 Jun 2003 Tomas Cermak - * - * This file is part of wmradio program. + * + * This file is part of wmradio program. * * 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 * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ @@ -85,7 +85,7 @@ int radio_getsignal(int fd) { struct video_tuner vt; int signal; - + memset(&vt,0,sizeof(vt)); ioctl (fd, VIDIOCGTUNER, &vt); signal=vt.signal>>13; diff --git a/wmradio/radio.h b/wmradio/radio.h index ddcb18a..37d0cc1 100644 --- a/wmradio/radio.h +++ b/wmradio/radio.h @@ -1,20 +1,20 @@ /* * Copyright (C) 12 Jun 2003 Tomas Cermak - * - * This file is part of wmradio program. + * + * This file is part of wmradio program. * * 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 * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ diff --git a/wmradio/rc.c b/wmradio/rc.c index e3a2f06..52568d6 100644 --- a/wmradio/rc.c +++ b/wmradio/rc.c @@ -1,20 +1,20 @@ /* * Copyright (C) 12 Jun 2003 Tomas Cermak - * - * This file is part of wmradio program. + * + * This file is part of wmradio program. * * 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 * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ @@ -62,7 +62,7 @@ void rc_save_config(void) void rc_read_config(void) { char rcfile[256]; - + snprintf(rcfile,sizeof(rcfile),"%s/.wmradio",getenv("HOME")); ini = ini_load_file(NULL,"config",rcfile); } @@ -70,7 +70,7 @@ void rc_read_config(void) void rc_set_variable_as_pseudofloat(char *section, char *variable, int value) { IniVariable *i; - + ini = ini_set_variable(ini,section,variable,freqtostr(value)); i = ini_get_variable_ini_variable(ini,section,variable); if(i) i->value_int = value; @@ -89,7 +89,7 @@ int rc_get_variable_as_pseudofloat(char *section, char *variable, int dflt) int rc_get_freq(int index) { char buffer[10]; - + snprintf(buffer,sizeof(buffer),"preset%i",index); return rc_get_variable_as_pseudofloat(SECTION_CONFIG,buffer,9700); } @@ -97,7 +97,7 @@ int rc_get_freq(int index) void rc_set_freq(int index, int value) { char buffer[10]; - + snprintf(buffer,sizeof(buffer),"preset%i",index); rc_set_variable_as_pseudofloat(SECTION_CONFIG,buffer,value); } @@ -111,7 +111,7 @@ IniSection *rc_get_section(char *section) { return ini_get_section(ini,section); } - + void rc_free_config(void) { ini_free(ini); diff --git a/wmradio/rc.h b/wmradio/rc.h index ab0cd15..725f82d 100644 --- a/wmradio/rc.h +++ b/wmradio/rc.h @@ -1,20 +1,20 @@ /* * Copyright (C) 12 Jun 2003 Tomas Cermak - * - * This file is part of wmradio program. + * + * This file is part of wmradio program. * * 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 * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ diff --git a/wmradio/skin.c b/wmradio/skin.c index bbd7528..e1a3c50 100644 --- a/wmradio/skin.c +++ b/wmradio/skin.c @@ -1,20 +1,20 @@ /* * Copyright (C) 12 Jun 2003 Tomas Cermak - * - * This file is part of wmradio program. + * + * This file is part of wmradio program. * * 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 * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ @@ -150,7 +150,7 @@ void skin_def_line(char *line, Display *display, Drawable drawable, char *skin_d letters.w[i] = skin_read_num(p); } letters.h = skin_read_num(p); - break; + break; case 2917: /* stereo */ StereoInfo.destx = skin_read_num(p); StereoInfo.desty = skin_read_num(p); @@ -182,7 +182,7 @@ void create_skin(char *skin_def_file, Display *display, Drawable drawable) p = &dir[strlen(dir)-1]; while( *p != '/' ) p--; p[1] = '\000'; - + f = fopen(buffer,"r"); if(! f ){ printf("wmradio: Skin %s not found\n", skin_def_file); @@ -224,10 +224,10 @@ int skin_button_index(int x, int y) { int i; for(i=0; i< button_count; i++) { - if( in_region(x,y, - buttons[i].destx, - buttons[i].desty, - buttons[i].width, + if( in_region(x,y, + buttons[i].destx, + buttons[i].desty, + buttons[i].width, buttons[i].height) ) { return i; } @@ -317,7 +317,7 @@ int have_letters(void) void char_to_window(Display *display, Window win, GC gc, char c, int *x, int y) { int idx, sourcex; - + if(isalpha(c)) { idx = letter_index(c); sourcex = letter_source_x(idx); @@ -348,7 +348,7 @@ void freq_to_window(Display *display, Window win, GC gc, int freq) { char freqs[10], temp[10], *stn_name; int x,i; - + stn_name = station_get_freq_name(freq); if(stn_name && have_letters()) { strncpy(freqs,stn_name,4); @@ -440,7 +440,7 @@ int skin_width(void) { int skin_height(void) { return icon_height; } - + void skin_select_station(int station) { int i; diff --git a/wmradio/skin.h b/wmradio/skin.h index a4f8153..e0b740a 100644 --- a/wmradio/skin.h +++ b/wmradio/skin.h @@ -1,20 +1,20 @@ /* * Copyright (C) 12 Jun 2003 Tomas Cermak - * - * This file is part of wmradio program. + * + * This file is part of wmradio program. * * 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 * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ diff --git a/wmradio/stationnames.c b/wmradio/stationnames.c index a90d347..0fdd8af 100644 --- a/wmradio/stationnames.c +++ b/wmradio/stationnames.c @@ -1,20 +1,20 @@ /* * Copyright (C) 12 Jun 2003 Tomas Cermak - * - * This file is part of wmradio program. + * + * This file is part of wmradio program. * * 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 * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ @@ -29,7 +29,7 @@ char *freqtostr(int freq) { static char buffer[10]; - + sprintf(buffer, "%i.%.2i\n", freq / 100,freq % 100); return buffer; } @@ -38,7 +38,7 @@ int ato100i(char *str) { char *p,*q; int result,tmp; - + p = strstr(str,"."); if(!p) { return atoi(str) * 100; @@ -48,7 +48,7 @@ int ato100i(char *str) result = atoi(str) * 100; tmp = atoi(q); *p = '.'; - + switch(strlen(q)) { case 1: result += 10 * tmp; @@ -70,7 +70,7 @@ IniVariable *station_find_by_freq(int freq) IniVariable *variable; List *item; int cfreq; - + section = rc_get_section(SECTION_NAMES); if(!section) return NULL; for(item = section->variables; item; item = item->next) { @@ -90,7 +90,7 @@ void station_add(char *name, int freq) char *station_get_freq_name(int freq) { IniVariable *variable; - + variable = station_find_by_freq(freq); if(!variable) return NULL; return variable->name; @@ -106,8 +106,8 @@ List *station_nearest(int freq) IniSection *section; List *item,*current; IniVariable *item_var; - int delta; - + int delta; + section = rc_get_section(SECTION_NAMES); if(! section ) return NULL; item = current = section -> variables; @@ -129,7 +129,7 @@ int station_next_freq(int freq) { IniVariable *item_var; List *item; - + item = station_nearest(freq); if(!item) return freq; if(item->next) { @@ -145,7 +145,7 @@ int station_prev_freq(int freq) { IniVariable *item_var; List *item; - + item = station_nearest(freq); if(!item) return freq; if(item->prev) { diff --git a/wmradio/stationnames.h b/wmradio/stationnames.h index 6391389..07e21a9 100644 --- a/wmradio/stationnames.h +++ b/wmradio/stationnames.h @@ -1,20 +1,20 @@ /* * Copyright (C) 12 Jun 2003 Tomas Cermak - * - * This file is part of wmradio program. + * + * This file is part of wmradio program. * * 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 * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ diff --git a/wmradio/wm_envelope.c b/wmradio/wm_envelope.c index 9af36af..fa86768 100644 --- a/wmradio/wm_envelope.c +++ b/wmradio/wm_envelope.c @@ -1,20 +1,20 @@ /* * Copyright (C) 12 Jun 2003 Tomas Cermak - * - * This file is part of wmradio program. + * + * This file is part of wmradio program. * * 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 * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ @@ -161,7 +161,7 @@ int parse_command_line(int argc, char *argv [],RadioInfo *info) case 10: case 'k': rc_set_variable(SECTION_CONFIG,"skin",optarg); - break; + break; } } return 1; @@ -171,7 +171,7 @@ void video_mainloop(void) { XEvent xe; RadioEvent re; - + radio_continue = 1; while (radio_continue) { /* X Events */ @@ -205,9 +205,9 @@ void video_mainloop(void) re.x = xe.xbutton.x; re.y = xe.xbutton.y; re.button = xe.xbutton.button; - re.control = xe.xbutton.state & ControlMask ? + re.control = xe.xbutton.state & ControlMask ? CONTROL_STATE_PRESSED : CONTROL_STATE_NOT_PRESSED; - re.shift = xe.xbutton.state & ShiftMask ? + re.shift = xe.xbutton.state & ShiftMask ? CONTROL_STATE_PRESSED : CONTROL_STATE_NOT_PRESSED; wmradio_handle_event(&re); } @@ -217,9 +217,9 @@ void video_mainloop(void) re.x = xe.xbutton.x; re.y = xe.xbutton.y; re.button = xe.xbutton.button; - re.control = xe.xbutton.state & ControlMask ? + re.control = xe.xbutton.state & ControlMask ? CONTROL_STATE_PRESSED : CONTROL_STATE_NOT_PRESSED; - re.shift = xe.xbutton.state & ShiftMask ? + re.shift = xe.xbutton.state & ShiftMask ? CONTROL_STATE_PRESSED : CONTROL_STATE_NOT_PRESSED; if(re.button == 4) re.type = REVENT_SCROLL_UP; if(re.button == 5) re.type = REVENT_SCROLL_DOWN; @@ -259,7 +259,7 @@ int main(int argc, char *argv []) wmradio_init_radio_info(); rc_read_config(); parse_command_line(argc,argv,wmradio_radio_info()); - + main_display = XOpenDisplay(NULL); if (!main_display) { printf("wmradio: can't open display %s.\n",XDisplayName(NULL)); @@ -306,8 +306,8 @@ int main(int argc, char *argv []) XStoreName(main_display, applet, "WmRadio"); XSetIconName(main_display, applet, "WmRadio"); - wm_delete_window_atom = XInternAtom(main_display, "WM_DELETE_WINDOW", 0); - wm_protocol_atom = XInternAtom(main_display, "WM_PROTOCOLS", 0); + wm_delete_window_atom = XInternAtom(main_display, "WM_DELETE_WINDOW", 0); + wm_protocol_atom = XInternAtom(main_display, "WM_PROTOCOLS", 0); XSetWMProtocols(main_display, applet, &wm_delete_window_atom, 1); status = XMapWindow(main_display, applet); diff --git a/wmradio/wm_envelope.h b/wmradio/wm_envelope.h index 8aaf2f1..1d3be10 100644 --- a/wmradio/wm_envelope.h +++ b/wmradio/wm_envelope.h @@ -1,20 +1,20 @@ /* * Copyright (C) 12 Jun 2003 Tomas Cermak - * - * This file is part of wmradio program. + * + * This file is part of wmradio program. * * 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 * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ diff --git a/wmradio/wmradio-remote b/wmradio/wmradio-remote index e1ba277..412635e 100755 --- a/wmradio/wmradio-remote +++ b/wmradio/wmradio-remote @@ -4,7 +4,7 @@ PIPEPREFIX=/tmp/wmradio_ PIPE=${PIPEPREFIX}`id -u` -if [ "$1" = "" ] ; then +if [ "$1" = "" ] ; then echo -e "Usage: $0 COMMAND [param]\n"\ "valid commands are:\n"\ " POWER\n"\ diff --git a/wmradio/wmradio.c b/wmradio/wmradio.c index a1d4b8c..a5fada9 100644 --- a/wmradio/wmradio.c +++ b/wmradio/wmradio.c @@ -1,20 +1,20 @@ /* * Copyright (C) 12 Jun 2003 Tomas Cermak - * - * This file is part of wmradio program. + * + * This file is part of wmradio program. * * 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 * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ @@ -89,7 +89,7 @@ void tuned_to_preset_station(void) { int i; int x,y; - + x = radio_info.current_freq; for(i = 0; i<6; i++) { y = rc_get_freq(i); @@ -373,7 +373,7 @@ void wmradio_handle_event(RadioEvent *e) } int wmradio_init(void) -{ +{ if (rc_get_variable_as_int(SECTION_CONFIG,"osd",0) ){ if (! osd_init("wmradio", rc_get_variable(SECTION_CONFIG,"osd-font","*-courier-*"), @@ -408,7 +408,7 @@ int wmradio_init(void) } void wmradio_done(void) -{ +{ osd_close(); fifo_close(); } diff --git a/wmradio/wmradio.h b/wmradio/wmradio.h index 2f8fbac..5b2a4d3 100644 --- a/wmradio/wmradio.h +++ b/wmradio/wmradio.h @@ -1,20 +1,20 @@ /* * Copyright (C) 12 Jun 2003 Tomas Cermak - * - * This file is part of wmradio program. + * + * This file is part of wmradio program. * * 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 * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ diff --git a/wmradio/wmradio.spec b/wmradio/wmradio.spec index 2d52666..cd79e93 100644 --- a/wmradio/wmradio.spec +++ b/wmradio/wmradio.spec @@ -41,4 +41,3 @@ rm -rf $RPM_BUILD_ROOT /usr/share/applications/wmradio.desktop /usr/share/pixmaps/wmradio.png - \ No newline at end of file diff --git a/wmradio/x_envelope.c b/wmradio/x_envelope.c index dcff5da..01d5c14 100644 --- a/wmradio/x_envelope.c +++ b/wmradio/x_envelope.c @@ -1,20 +1,20 @@ /* * Copyright (C) 12 Jun 2003 Tomas Cermak - * - * This file is part of wmradio program. + * + * This file is part of wmradio program. * * 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 * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ @@ -76,7 +76,7 @@ int parse_command_line(int argc, char *argv [],RadioInfo *info) {"osd-position",1,0,0}, {"osd-shadow-offset",1,0,0}, {"osd-timeout",1,0,0}, - + {"skin",1,0,0}, {0,0,0,0} @@ -158,7 +158,7 @@ int parse_command_line(int argc, char *argv [],RadioInfo *info) } break; case 10: - case 'k': + case 'k': rc_set_variable(SECTION_CONFIG,"skin",optarg); break; } @@ -171,7 +171,7 @@ void video_mainloop(void) XEvent xe; RadioEvent re; int i; - + radio_continue = 1; while (radio_continue) { /* X Events */ @@ -202,9 +202,9 @@ void video_mainloop(void) re.x = xe.xbutton.x; re.y = xe.xbutton.y; re.button = xe.xbutton.button; - re.control = xe.xbutton.state & ControlMask ? + re.control = xe.xbutton.state & ControlMask ? CONTROL_STATE_PRESSED : CONTROL_STATE_NOT_PRESSED; - re.shift = xe.xbutton.state & ShiftMask ? + re.shift = xe.xbutton.state & ShiftMask ? CONTROL_STATE_PRESSED : CONTROL_STATE_NOT_PRESSED; wmradio_handle_event(&re); } @@ -214,9 +214,9 @@ void video_mainloop(void) re.x = xe.xbutton.x; re.y = xe.xbutton.y; re.button = xe.xbutton.button; - re.control = xe.xbutton.state & ControlMask ? + re.control = xe.xbutton.state & ControlMask ? CONTROL_STATE_PRESSED : CONTROL_STATE_NOT_PRESSED; - re.shift = xe.xbutton.state & ShiftMask ? + re.shift = xe.xbutton.state & ShiftMask ? CONTROL_STATE_PRESSED : CONTROL_STATE_NOT_PRESSED; if(re.button == 4) re.type = REVENT_SCROLL_UP; if(re.button == 5) re.type = REVENT_SCROLL_DOWN; @@ -257,7 +257,7 @@ int main(int argc, char *argv []) char * appletname = "WmRadio"; XSizeHints sh; - + wmradio_init_radio_info(); rc_read_config(); parse_command_line(argc,argv,wmradio_radio_info()); @@ -303,8 +303,8 @@ int main(int argc, char *argv []) gcv.background = background; gcv.graphics_exposures = 0; NormalGC = XCreateGC(main_display, root, gcm, &gcv); - wm_delete_window_atom = XInternAtom(main_display, "WM_DELETE_WINDOW", 0); - wm_protocol_atom = XInternAtom(main_display, "WM_PROTOCOLS", 0); + wm_delete_window_atom = XInternAtom(main_display, "WM_DELETE_WINDOW", 0); + wm_protocol_atom = XInternAtom(main_display, "WM_PROTOCOLS", 0); XSetWMProtocols(main_display, applet, &wm_delete_window_atom, 1); XSelectInput(main_display, applet, ButtonPressMask | ExposureMask | diff --git a/wmradio/xor.c b/wmradio/xor.c index ed5161b..60dc640 100644 --- a/wmradio/xor.c +++ b/wmradio/xor.c @@ -1,20 +1,20 @@ /* * Copyright (C) 12 Jun 2003 Tomas Cermak - * - * This file is part of wmradio program. + * + * This file is part of wmradio program. * * 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 * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ diff --git a/wmspaceweather/CHANGES b/wmspaceweather/CHANGES index a2d2f71..d26b36c 100644 --- a/wmspaceweather/CHANGES +++ b/wmspaceweather/CHANGES @@ -5,14 +5,14 @@ Version Description 1.04 - released Feb 18, 1999 Added double click capability. Double clicking on mouse button 1 sends URL (defined via ne command line option -url) to netscape. - + 1.03 - released Feb 11, 1999 Changed display a bit. When no data is available, it now shows nothing (before it would show false junk...). Modified Perl Script GetKp. - - + + 1.02 - released Feb 8, 1999 bug fixes... - + 1.0b - released Dec 19, 1998 diff --git a/wmspaceweather/HINTS b/wmspaceweather/HINTS index 4aef871..8f406e6 100644 --- a/wmspaceweather/HINTS +++ b/wmspaceweather/HINTS @@ -25,7 +25,7 @@ Afterstep users put the following in their .steprc Note: AfterStep's Wharf has a problem with pixmaps that are larger than 60x60 pixels. Please tell the AfterStep authors to fix this, this is not our fault, but a Wharf problem! - + Other window managers. ---------------------- diff --git a/wmspaceweather/INSTALL b/wmspaceweather/INSTALL index 954d519..c4bf584 100644 --- a/wmspaceweather/INSTALL +++ b/wmspaceweather/INSTALL @@ -10,8 +10,8 @@ Installation 1) gunzip wmSpaceWeather-1.0.tar.gz 1) tar -xvf wmSpaceWeather-1.0.tar 2) cd wmSpaceWeather-1.0/wmSpaceWeather/ -3) make -4) make install (must be root) +3) make +4) make install (must be root) 5) wmSpaceWeather & (or 'wmSpaceWeather -h' for help, or 'man wmSpaceWeather' for the man page) 6) You need to set the location of perl correctly in GetKp if your perl is located in a place other than /usr/bin/ diff --git a/wmspaceweather/README b/wmspaceweather/README index 29c0327..b418f04 100644 --- a/wmspaceweather/README +++ b/wmspaceweather/README @@ -1,8 +1,8 @@ wmSpaceWeather-1.0b release ---------------------- Author....: Michael G. Henderson <[email protected]> - - + + Description ----------- wmSpaceWeather is a space weather monitor @@ -16,7 +16,7 @@ HINTS Hints about what you can do with wmSpaceWeather. BUGS Bug reports CHANGES Change history. COPYING GNU General Public License Version 2. - + Bugs ----- @@ -26,5 +26,5 @@ Send bug reports to [email protected] Copyright ---------- wmSpaceWeather is copyright (c) 1998 by Michael G. Henderson and -licensed through the GNU General Public License. Read the +licensed through the GNU General Public License. Read the COPYING file for the complete GNU license. diff --git a/wmspaceweather/wmSpaceWeather/GetKp b/wmspaceweather/wmSpaceWeather/GetKp index 27f9274..6e03dc3 100755 --- a/wmspaceweather/wmSpaceWeather/GetKp +++ b/wmspaceweather/wmSpaceWeather/GetKp @@ -9,7 +9,7 @@ ($Year, $Month, $Day) = &year_month_day(); - + if (-e "/tmp/DGD.txt"){ unlink("/tmp/DGD.txt"); } @@ -43,7 +43,7 @@ if ($_ =~ /^\d{4} \d{2} \d{2}\s*\d*/ ){ $Date = $_; - + s/^(\d{4}) (\d{2}) (\d{2}).*\s{2,}(.*)/\4/; s/([ -]{0,1}\d{1,2})([ -]{0,1}\d{1,2})([ -]{0,1}\d{1,2})([ -]{0,1}\d{1,2})([ -]{0,1}\d{1,2})([ -]{0,1}\d{1,2})([ -]{0,1}\d{1,2})([ -]{0,1}\d{1,2})/\1 \2 \3 \4 \5 \6 \7 \8/; @@ -88,7 +88,7 @@ } if ($_ =~ /.*\d/) { $Line = $_; - } + } if ($_ =~ /^\s{1,}[0-9e\.\+\-]{2,}\s{1,}[0-9e\.\+\-]{2,}\s{1,}[0-9e\.\+\-]{2,}\s{1,}[0-9e\.\+\-]{2,}\s{1,}[0-9e\.\+\-]{2,}\s{1,}[BCMX]{1,}[0-9\.]{1,}\s{1,}[0-9-]{1,}/){ @@ -145,7 +145,7 @@ $FluxLine =~ s/^\s*//; if ($FluxLine =~ /\d/){ ($E1, $E2, $P1, $P2, $P3, $Xray, $junk) = split(/\s{1,}/, $FluxLine); - + } else { $E1 = -999; $E2 = -999; @@ -188,7 +188,7 @@ # # # -# +# # # open(TmpFile, ">/n/leadbelly/belly3/PolarNRT/CEPPAD/IPS/LatestDst.txt"); # printf TmpFile "${Gif}\n"; diff --git a/wmspaceweather/wmSpaceWeather/Makefile b/wmspaceweather/wmSpaceWeather/Makefile index 2e543b6..8c2ce30 100644 --- a/wmspaceweather/wmSpaceWeather/Makefile +++ b/wmspaceweather/wmSpaceWeather/Makefile @@ -18,7 +18,7 @@ OBJS = wmSpaceWeather.o \ all: wmSpaceWeather.o wmSpaceWeather wmSpaceWeather.o: wmSpaceWeather_master.xpm wmSpaceWeather_mask.xbm -wmSpaceWeather: $(OBJS) +wmSpaceWeather: $(OBJS) $(CC) $(COPTS) $(SYSTEM) -o wmSpaceWeather $^ $(INCDIR) $(LIBDIR) $(LIBS) clean: @@ -30,5 +30,5 @@ clean: install:: wmSpaceWeather install -s -m 0755 wmSpaceWeather $(DESTDIR)/bin install -m 0755 GetKp $(DESTDIR)/bin - install -m 0644 wmSpaceWeather.1 $(DESTDIR)/man/man1 + install -m 0644 wmSpaceWeather.1 $(DESTDIR)/man/man1 diff --git a/wmspaceweather/wmSpaceWeather/wmSpaceWeather.1 b/wmspaceweather/wmSpaceWeather/wmSpaceWeather.1 index 3497284..582fdbf 100644 --- a/wmspaceweather/wmSpaceWeather/wmSpaceWeather.1 +++ b/wmspaceweather/wmSpaceWeather/wmSpaceWeather.1 @@ -1,16 +1,16 @@ -.TH WMSPACEWEATHER 1.1 "19 December 1998" +.TH WMSPACEWEATHER 1.1 "19 December 1998" .SH NAME WMSPACEWEATHER \- Dockable Space Weather Monitor .SH SYNOPSIS .B wmSpaceWeather -[-h] [-display <Display>] +[-h] [-display <Display>] .SH DESCRIPTION .PP -wmSpaceWeather is a space weather monitor. The monitor shows: 2 relativistic electron +wmSpaceWeather is a space weather monitor. The monitor shows: 2 relativistic electron and 3 relativistic proton flux levels at geosyncronous orbit (currently from the NOAA GOES spacecraft), current Solar Flare X-ray flux, and the last 8 3-hour Kp index values. .PP -Large fluxes of relativistic (aka `Killer') electrons can cause harmful `deep-dielectric' +Large fluxes of relativistic (aka `Killer') electrons can cause harmful `deep-dielectric' charging/discharging events inside satellites. High proton fluxes (`Solar Energetic Proton' or SEP events) can cause single event upsets in satellite electronics. The Kp index is a measure of how disturbed the Earth's magnetic field has been over a 3-hour interval. Kp can range from diff --git a/wmspaceweather/wmSpaceWeather/wmSpaceWeather.c b/wmspaceweather/wmSpaceWeather/wmSpaceWeather.c index 19072d9..5fd6a16 100644 --- a/wmspaceweather/wmSpaceWeather/wmSpaceWeather.c +++ b/wmspaceweather/wmSpaceWeather/wmSpaceWeather.c @@ -1,11 +1,11 @@ /* * * wmSpaceWeather-1.04 (C) 1998 Mike Henderson ([email protected]) - * + * * - Its a Space Weather Monitor - * - * - * + * + * + * * * 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 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program (see the file COPYING); if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA * * ToDo: @@ -41,7 +41,7 @@ * Changes: * * Version 1.04 - released Feb 18, 1999 - * Added double click capability. Double clicking on mouse button 1 sends + * Added double click capability. Double clicking on mouse button 1 sends * URL (defined via ne command line option -url) to netscape. * * Version 1.03 - released Feb 11, 1999 @@ -62,8 +62,8 @@ -/* - * Includes +/* + * Includes */ #include <stdio.h> #include <unistd.h> @@ -78,8 +78,8 @@ -/* - * Delay between refreshes (in microseconds) +/* + * Delay between refreshes (in microseconds) */ #define DELAY 10000L #define WMSPACEWEATHER_VERSION "1.04" @@ -104,8 +104,8 @@ void pressEvent(XButtonEvent *xev); -/* - * main +/* + * main */ int main(int argc, char *argv[]) { @@ -136,19 +136,19 @@ FILE *fp; - + /* * Parse any command line arguments. */ ParseCMDLine(argc, argv); - - + + openXwindow(argc, argv, wmSpaceWeather_master, wmSpaceWeather_mask_bits, wmSpaceWeather_mask_width, wmSpaceWeather_mask_height); - + /* * Loop until we die */ @@ -169,18 +169,18 @@ FILE *fp; * Keep track of # of seconds */ if (m > 100){ - + m = 0; ++dt1; ++dt2; - + } else { - + /* * Increment counter */ ++m; - + } @@ -212,7 +212,7 @@ FILE *fp; - /* + /* * Process any pending X events. */ while(XPending(display)){ @@ -233,9 +233,9 @@ FILE *fp; - - /* - * Redraw + + /* + * Redraw */ RedrawWindow(); @@ -256,7 +256,7 @@ FILE *fp; * may be Up-To-Date! */ if (dt2 > 2){ - + dt2 = 0; /* @@ -272,7 +272,7 @@ FILE *fp; Secs = Time->tm_sec; UT = (double)Hours + (double)Mins/60.0 + (double)Secs/3600.0; CurrentJD = jd(Year, Month, Day, UT); - + /* @@ -333,9 +333,9 @@ FILE *fp; } - } + } - } + } @@ -350,7 +350,7 @@ FILE *fp; n = 0; copyXPMArea(5, 67, 47, 20, 5, 39); - + for (i=0; i<8; ++i){ if ((Kp[i] >= 0)&&(Kp[i] <= 9)){ height = 2*Kp[i] + 1; @@ -471,7 +471,7 @@ FILE *fp; s = 0; if (LEDOn){ - + if (UpToDate) copyXPMArea(65, 82, 4, 4, 54, 53); else @@ -479,7 +479,7 @@ FILE *fp; LEDOn = 0; - } else { + } else { if (UpToDate) copyXPMArea(60, 82, 4, 4, 54, 53); @@ -487,7 +487,7 @@ FILE *fp; copyXPMArea(60, 76, 4, 4, 54, 53); LEDOn = 1; - + } } else { @@ -498,7 +498,7 @@ FILE *fp; } - + @@ -526,8 +526,8 @@ FILE *fp; - /* - * Wait for next update + /* + * Wait for next update */ usleep(DELAY); diff --git a/wmspaceweather/wmgeneral/wmgeneral.c b/wmspaceweather/wmgeneral/wmgeneral.c index a4f13c1..645321c 100644 --- a/wmspaceweather/wmgeneral/wmgeneral.c +++ b/wmspaceweather/wmgeneral/wmgeneral.c @@ -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; diff --git a/wmtop/wmtop.1 b/wmtop/wmtop.1 index 49bccea..456d2d4 100644 --- a/wmtop/wmtop.1 +++ b/wmtop/wmtop.1 @@ -48,16 +48,16 @@ Exclude processes whose name matches the given regular expression. The regular expression need only match part of the process name. Use '^' to mean the start of the name and '$' to mean the end. .TP -.B \-m +.B \-m Show memory usage rather than CPU usage on start-up. .TP .B \-a \fItheme Choose an artisitc style or theme for wmtop to use. .TP -.B \-s +.B \-s Set interval between process samples in milliseconds. .TP -.B \-r +.B \-r Set interval between screen updates in milliseconds. .SH EXAMPLES diff --git a/wmtop/wmtop.c b/wmtop/wmtop.c index a1c20c9..bf065de 100644 --- a/wmtop/wmtop.c +++ b/wmtop/wmtop.c @@ -6,7 +6,7 @@ * wmtop.c -- WindowMaker process view dock app * Derived by Dan Piponi [email protected] * http://www.tanelorn.demon.co.uk - * http://wmtop.sourceforge.net + * http://wmtop.sourceforge.net * from code originally contained in wmsysmon by Dave Clark ([email protected]) * This software is licensed through the GNU General Public License. */ @@ -546,7 +546,7 @@ int process_parse_procfs(struct process *process) { line[endl]=0; /* account for "kdeinit: " */ if ((char*)line == strstr(line, "kdeinit: ")) - r = ((char*)line)+9; + r = ((char*)line)+9; else r = (char*)line; @@ -574,7 +574,7 @@ int process_parse_procfs(struct process *process) { * Extract cpu times from data in /proc/<pid>/stat * XXX: Process name extractor for FreeBSD is untested right now. * - * [TODO: FREEBSD code probably needs similar data type changes to + * [TODO: FREEBSD code probably needs similar data type changes to * those made for LINUX above. Need to check docs. -wbk] */ rc = sscanf(line,"%s %*s %*s %*s %*s %*s %*s %*s %d,%d %d,%d", @@ -746,7 +746,7 @@ void draw_processes() { ++g_time; update_process_table(); - + switch (mode) { case 0: total = calc_cpu_total(); @@ -954,8 +954,8 @@ void blit_string(char *name, int x, int y) { k = x; for ( i = 0; name[i]; i++) { - c = toupper(name[i]); - if (c >= 'A' && c <= 'J') { + c = toupper(name[i]); + if (c >= 'A' && c <= 'J') { c -= 'A'; copyXPMArea(c*6,73,6,7,k,y); } else if (c>='K' && c<='T') { @@ -964,7 +964,7 @@ void blit_string(char *name, int x, int y) { } else if (c>='U' && c<='Z') { c -= 'U'; copyXPMArea(c*6,89,6,7,k,y); - } else if (c>='0' && c<='9') { + } else if (c>='0' && c<='9') { c -= '0'; copyXPMArea(c*6,65,6,7,k,y); } else { diff --git a/wmwork/src/install-sh b/wmwork/src/install-sh index e9de238..594a4ed 100644 --- a/wmwork/src/install-sh +++ b/wmwork/src/install-sh @@ -115,7 +115,7 @@ fi if [ x"$dir_arg" != x ]; then dst=$src src="" - + if [ -d $dst ]; then instcmd=: chmodcmd="" @@ -125,7 +125,7 @@ if [ x"$dir_arg" != x ]; then else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad +# might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] @@ -135,7 +135,7 @@ else echo "install: $src does not exist" exit 1 fi - + if [ x"$dst" = x ] then echo "install: no destination specified" @@ -163,7 +163,7 @@ dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then -defaultIFS=' +defaultIFS=' ' IFS="${IFS-${defaultIFS}}" @@ -202,17 +202,17 @@ else # If we're going to rename the final executable, determine the name now. - if [ x"$transformarg" = x ] + if [ x"$transformarg" = x ] then dstfile=`basename $dst` else - dstfile=`basename $dst $transformbasename | + dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename - if [ x"$dstfile" = x ] + if [ x"$dstfile" = x ] then dstfile=`basename $dst` else @@ -243,7 +243,7 @@ else # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile + $doit $mvcmd $dsttmp $dstdir/$dstfile fi && diff --git a/wmwork/src/wmgeneral.c b/wmwork/src/wmgeneral.c index a75b2e4..2e41355 100644 --- a/wmwork/src/wmgeneral.c +++ b/wmwork/src/wmgeneral.c @@ -36,7 +36,7 @@ KeyReleaseMask in XSelectInput 11/09/1998 (Martijn Pieterse, [email protected]) * Removed a bug from parse_rcfile. You could - not use "start" in a command if a label was + not use "start" in a command if a label was also start. * Changed the needed geometry string. We don't use window size, and don't support @@ -195,7 +195,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, "wm.app: not enough free colorcells.\n"); exit(1); @@ -242,9 +242,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, @@ -256,9 +256,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, @@ -314,7 +314,7 @@ void createXBMfromXPM(char *xbm, char **xpm, int sx, int sy) { char *zero, *color, *pos; unsigned char bwrite; int bcount; - + sscanf(*xpm, "%d %d %d %d", &width, &height, &numcol, &chars); @@ -381,7 +381,7 @@ void setMaskXY(int x, int y) { void initXwindow(char *display_name) { if (!(display = XOpenDisplay(display_name))) { - fprintf(stderr, "wm.app: can't open display %s\n", + fprintf(stderr, "wm.app: can't open display %s\n", XDisplayName(display_name)); exit(1); } @@ -431,10 +431,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); @@ -455,7 +455,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; diff --git a/wmxss/Src/Makefile b/wmxss/Src/Makefile index 5f464f9..b04fe07 100644 --- a/wmxss/Src/Makefile +++ b/wmxss/Src/Makefile @@ -21,7 +21,7 @@ OBJS = wmxss.o \ all: wmxss.o wmxss wmxss.o: wmxss_master.xpm wmxss_mask.xbm -wmxss: $(OBJS) +wmxss: $(OBJS) $(CC) $(COPTS) $(SYSTEM) -o wmxss $^ $(INCDIR) $(LIBDIR) $(LIBS) clean: @@ -32,5 +32,5 @@ clean: install:: wmxss install -c -s -m 0755 wmxss $(DESTDIR)/bin - install -c -m 0644 wmxss.1 $(DESTDIR)/man/man1 + install -c -m 0644 wmxss.1 $(DESTDIR)/man/man1 diff --git a/wmxss/Src/Makefile.sgi b/wmxss/Src/Makefile.sgi index 276de93..bad4e88 100644 --- a/wmxss/Src/Makefile.sgi +++ b/wmxss/Src/Makefile.sgi @@ -21,7 +21,7 @@ OBJS = wmxss.o \ all: wmxss.o wmxss wmxss.o: wmxss_master.xpm wmxss_mask.xbm -wmxss: $(OBJS) +wmxss: $(OBJS) $(CC) $(COPTS) $(SYSTEM) -o wmxss $(OBJS) $(INCDIR) $(LIBDIR) $(LIBS) clean: @@ -32,5 +32,5 @@ clean: install:: wmxss install -s -m 0755 wmxss $(DESTDIR)/bin - install -c -m 0644 wmxss.1 $(DESTDIR)/man/man1 + install -c -m 0644 wmxss.1 $(DESTDIR)/man/man1 diff --git a/wmxss/Src/Makefile.solaris b/wmxss/Src/Makefile.solaris index 6e876d2..caa9a00 100644 --- a/wmxss/Src/Makefile.solaris +++ b/wmxss/Src/Makefile.solaris @@ -21,7 +21,7 @@ OBJS = wmxss.o \ all: wmxss.o wmxss wmxss.o: wmxss_master.xpm wmxss_mask.xbm -wmxss: $(OBJS) +wmxss: $(OBJS) $(CC) $(COPTS) $(SYSTEM) -o wmxss $^ $(INCDIR) $(LIBDIR) $(LIBS) clean: @@ -32,5 +32,5 @@ clean: install:: wmxss install -c -s -m 0755 wmxss $(DESTDIR)/bin - install -c -m 0644 wmxss.1 $(DESTDIR)/man/man1 + install -c -m 0644 wmxss.1 $(DESTDIR)/man/man1 diff --git a/wmxss/Src/wmxss.c b/wmxss/Src/wmxss.c index 1322111..f51c4a5 100644 --- a/wmxss/Src/wmxss.c +++ b/wmxss/Src/wmxss.c @@ -1,11 +1,11 @@ /* * * wmxss-0.10 (C) 1999 Mike Henderson ([email protected]) - * + * * - Its a DockApp front end for xscreensaver - * - * - * + * + * + * * * 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 @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program (see the file COPYING); if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA * * @@ -35,8 +35,8 @@ -/* - * Includes +/* + * Includes */ #include <stdio.h> #include <unistd.h> @@ -51,8 +51,8 @@ -/* - * Delay between refreshes (in microseconds) +/* + * Delay between refreshes (in microseconds) */ #define DELAY 10000L #define WMXSS_VERSION "0.10" @@ -85,8 +85,8 @@ char BackgroundColor[30] = "#181818"; -/* - * main +/* + * main */ int main(int argc, char *argv[]) { @@ -106,7 +106,7 @@ int main(int argc, char *argv[]) { - + initXwindow(argc, argv); openXwindow(argc, argv, wmxss_master, wmxss_mask_bits, wmxss_mask_width, wmxss_mask_height); @@ -118,7 +118,7 @@ int main(int argc, char *argv[]) { } - + /* * Loop until we die */ @@ -133,7 +133,7 @@ int main(int argc, char *argv[]) { } else { /* - * Update the counter. + * Update the counter. */ ++n; @@ -163,7 +163,7 @@ int main(int argc, char *argv[]) { - /* + /* * Process any pending X events. */ while(XPending(display)){ @@ -184,9 +184,9 @@ int main(int argc, char *argv[]) { - - /* - * Redraw and wait for next update + + /* + * Redraw and wait for next update */ /* RedrawWindow(); @@ -207,13 +207,13 @@ int main(int argc, char *argv[]) { -/* - * ParseCMDLine() +/* + * ParseCMDLine() */ void ParseCMDLine(int argc, char *argv[]) { int i; - + for (i = 1; i < argc; i++) { if (!strcmp(argv[i], "-display")){ @@ -255,7 +255,7 @@ int i; } } - + } diff --git a/wmxss/Src/xutils.c b/wmxss/Src/xutils.c index 8759e15..6c28863 100644 --- a/wmxss/Src/xutils.c +++ b/wmxss/Src/xutils.c @@ -1,10 +1,10 @@ /* * xutils.c - A collection of X-windows utilties for creating WindowMAker - * DockApps. + * DockApps. * * This file contains alot of the lower-level X windows routines. Origins with wmppp * (by Martijn Pieterse ([email protected])), but its been hacked up quite a bit - * and passed on from one new DockApp to the next. + * and passed on from one new DockApp to the next. * * * @@ -27,7 +27,7 @@ * * * - */ + */ #include <stdlib.h> #include <stdio.h> #include <string.h> @@ -42,7 +42,7 @@ /* - * X11 Variables + * X11 Variables */ int x_fd; XSizeHints mysizehints; @@ -93,7 +93,7 @@ static int flush_expose(Window w) { * RedrawWindowXY */ void RedrawWindow(void) { - + flush_expose(iconwin); XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, 0,0, wmgen.attributes.width, wmgen.attributes.height, 0, 0); @@ -103,7 +103,7 @@ void RedrawWindow(void) { } void RedrawWindowXY(int x, int y) { - + flush_expose(iconwin); XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, x,y, wmgen.attributes.width, wmgen.attributes.height, 0, 0); @@ -167,7 +167,7 @@ void initXwindow(int argc, char *argv[]){ /* * openXwindow */ -void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bits, +void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bits, int pixmask_width, int pixmask_height) { unsigned int borderwidth = 1; @@ -189,9 +189,9 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit {"Color9", NULL, 0}}; - - /* + + /* * Create Pixmap */ cols[0].pixel = getColor(BackgroundColor, 1.0000, &red, &grn, &blu); @@ -209,9 +209,9 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit wmgen.attributes.colorsymbols = cols; wmgen.attributes.exactColors = False; wmgen.attributes.closeness = 40000; - wmgen.attributes.valuemask = XpmReturnPixels | XpmReturnExtensions | XpmColorSymbols + wmgen.attributes.valuemask = XpmReturnPixels | XpmReturnExtensions | XpmColorSymbols | XpmExactColors | XpmCloseness | XpmSize; - if (XpmCreatePixmapFromData(display, Root, pixmap_bytes, + if (XpmCreatePixmapFromData(display, Root, pixmap_bytes, &(wmgen.pixmap), &(wmgen.mask), &(wmgen.attributes)) != XpmSuccess){ fprintf(stderr, "Not enough free colorcells.\n"); exit(1); @@ -220,8 +220,8 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit - /* - * Create a window + /* + * Create a window */ mysizehints.flags = USSize | USPosition; mysizehints.x = 0; @@ -235,19 +235,19 @@ 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); - /* - * Activate hints + /* + * Activate hints */ XSetWMNormalHints(display, win, &mysizehints); classHint.res_name = wname; @@ -262,11 +262,11 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit * effect. I.e. for some you will need to Grab the focus and then return * it after you are done... */ - XSelectInput(display, win, ButtonPressMask | ExposureMask | ButtonReleaseMask - | PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask + XSelectInput(display, win, ButtonPressMask | ExposureMask | ButtonReleaseMask + | PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask | KeyPressMask | KeyReleaseMask); - XSelectInput(display, iconwin, ButtonPressMask | ExposureMask | ButtonReleaseMask - | PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask + XSelectInput(display, iconwin, ButtonPressMask | ExposureMask | ButtonReleaseMask + | PointerMotionMask | StructureNotifyMask | EnterWindowMask | LeaveWindowMask | KeyPressMask | KeyReleaseMask); @@ -278,8 +278,8 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit XSetWMName(display, win, &name); - /* - * Create Graphics Context (GC) for drawing + /* + * Create Graphics Context (GC) for drawing */ gcm = GCForeground | GCBackground | GCGraphicsExposures; gcv.foreground = fore_pix; @@ -325,7 +325,7 @@ unsigned long getColor(char *ColorName, float fac, int *red, int *grn, int *blu) Color.flags = DoRed | DoGreen | DoBlue; XAllocColor(display, Attributes.colormap, &Color); - + *red = Color.red; *grn = Color.green; *blu = Color.blue; diff --git a/wmxss/Src/xutils.h b/wmxss/Src/xutils.h index 565a134..4ed615f 100644 --- a/wmxss/Src/xutils.h +++ b/wmxss/Src/xutils.h @@ -4,7 +4,7 @@ /* - * Typedefs + * Typedefs */ typedef struct { Pixmap pixmap; @@ -21,7 +21,7 @@ typedef struct { Display *display; Window Root; Window iconwin, win; -int screen; +int screen; int DisplayDepth; diff --git a/wmymail/README.old b/wmymail/README.old index 1d28cdf..974b436 100644 --- a/wmymail/README.old +++ b/wmymail/README.old @@ -40,7 +40,7 @@ requirements : this application needs libdockapp v0.2 or newer compile : - + this code is known to work under linux v2.10 and osf v3.2 (tested) together with Window Maker v0.60.0 and docklib v0.2. I've provided a simple Makefile you can use to build the binary - edit that file to suit your needs. diff --git a/wmymail/wmymail.c b/wmymail/wmymail.c index d0dfc81..38d97db 100644 --- a/wmymail/wmymail.c +++ b/wmymail/wmymail.c @@ -131,7 +131,7 @@ int main(int argc, char **argv) { #endif sigemptyset(&sa.sa_mask); sigaction(SIGCHLD, &sa, NULL); - + DAParseArguments(argc, argv, options, sizeof(options) / sizeof(DAProgramOption), @@ -191,7 +191,7 @@ int main(int argc, char **argv) { updatePixmap(); DAShow(); - + checkForNewMail(0); DAEventLoop(); @@ -254,7 +254,7 @@ void checkForNewMail(int dummy) { } /* - * + * * checkfetchmail * */ @@ -347,7 +347,7 @@ void checkfetchmail (void) { numUnread = msgtotal - msgseen; } /* - * + * * checkmbox * */ @@ -376,7 +376,7 @@ void checkmbox (void) { void updatePixmap(void) { Pixmap outPixmap = flip ? outPixmap1 : outPixmap2; - + flip = !flip; XCopyArea(DADisplay, mainPixmap, outPixmap, defaultGC, @@ -407,8 +407,8 @@ void updatePixmap(void) { } else { XCopyArea(DADisplay, mboxthreePixmap, outPixmap, defaultGC, 0, 0, 40, 34, 14, 6); - } - + } + DASetPixmap(outPixmap); } @@ -479,7 +479,7 @@ void parseMailFile(struct stat *fileStat) { * 1) Take note, if the message appears to have been read * 2) Locate the end of the header */ } else if (inHeader) { - + /* A blank line indicates the end of the header */ if (!strcmp(buf, "\n")) { inHeader = 0; @@ -499,7 +499,7 @@ void parseMailFile(struct stat *fileStat) { statusRead = 1; } } - + /* The 1024 byte buffer can easily be exceeded by long lines... * when no newline is present, we must enter the state of "skipping * over the rest of a very long line". Else a line inside the body -- 2.7.4 -- To unsubscribe, send mail to [email protected].