Remove trailing whitespace in recently added dockapps.

This commit is contained in:
Doug Torrance 2016-12-23 18:28:17 -05:00 committed by Carlos R. Mafra
parent 8d4679e080
commit 1b4708cb92
257 changed files with 2411 additions and 2413 deletions

View file

@ -1,4 +1,4 @@
asbeats 0.2 by Martin Dahl <dahlm@vf.telia.no> asbeats 0.2 by Martin Dahl <dahlm@vf.telia.no>
and Karl-Martin Skontorp <karl-ms@online.no> and Karl-Martin Skontorp <karl-ms@online.no>
WHAT IS IT? WHAT IS IT?
@ -19,7 +19,7 @@ windowmaker dock.
INSTALLING 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. program anywhere you like.

View file

@ -6,7 +6,7 @@ the best clock for the best X-windowmanager!
RELEASE 10 RELEASE 10
26 August 1996 26 August 1996
by Beat Christen, bchriste@iiic.ethz.ch by Beat Christen, bchriste@iiic.ethz.ch
VERSION 1.0 VERSION 1.0
@ -26,9 +26,9 @@ INSTALL
HINTS 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 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'. 'MaxSwallow' keyword for 'asclock'.
@ -48,8 +48,8 @@ CONTRIBUTORS
Shape Extensions Dan Weeks Shape Extensions Dan Weeks
and man page and man page
language specific Carlos Canau language specific Carlos Canau
files Frank Larsen files Frank Larsen
Andy Lo A Foe Andy Lo A Foe
Dan Weeks Dan Weeks
Emanuele Caratti Emanuele Caratti
@ -60,9 +60,9 @@ CHANGES
26-Aug-96 - czech added 26-Aug-96 - czech added
13-Aug-96 - french added 13-Aug-96 - french added
6-Aug-96 - spanish added (thanks to David Lazaro Saz khelekir@encomix.es) 6-Aug-96 - spanish added (thanks to David Lazaro Saz khelekir@encomix.es)
- hungarian added - hungarian added
(thanks to Gyula Matics mgyula@garfield.sch.bme.hu) (thanks to Gyula Matics mgyula@garfield.sch.bme.hu)
- breton added (thanks to Jean-Pierre.Messager@univ-brest.fr) - breton added (thanks to Jean-Pierre.Messager@univ-brest.fr)
30-Jul-96 - ClassHints added (patch by Peter Parnes peppar@cdt.luth.se) 30-Jul-96 - ClassHints added (patch by Peter Parnes peppar@cdt.luth.se)
@ -72,9 +72,9 @@ CHANGES
- improved configure - improved configure
21-Jun-96 - '-iconic' state added 21-Jun-96 - '-iconic' state added
- usleep did not exist on Solaris 2.4: changed to poll() - usleep did not exist on Solaris 2.4: changed to poll()
- better error messages - better error messages
8-Jun-96 - '-noblink' feature added 8-Jun-96 - '-noblink' feature added
- final switch to imake - final switch to imake
@ -86,12 +86,12 @@ CHANGES
- in AM/PM mode, no leading one was visible... - in AM/PM mode, no leading one was visible...
- '-led' command line option added - '-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 message on console
- command line options added (-exe, -geometry, -shape, -12, -24) - command line options added (-exe, -geometry, -shape, -12, -24)
- Shape-Extension (by Dan Weeks) - Shape-Extension (by Dan Weeks)
- now it's a Build script - now it's a Build script
- dutch added (by Andy Lo A Foe <arloafoe@cs.vu.nl>) - dutch added (by Andy Lo A Foe <arloafoe@cs.vu.nl>)
- norwegian added (by Frank Larsen <frankrl@stud.cs.uit.no>) - norwegian added (by Frank Larsen <frankrl@stud.cs.uit.no>)
22-May-96 - obscure, not necessary XRaiseWindow removed :) 22-May-96 - obscure, not necessary XRaiseWindow removed :)

View file

@ -46,7 +46,7 @@ int main(int argc,char *argv[])
{ {
int i; int i;
unsigned int borderwidth; unsigned int borderwidth;
char *display_name=NULL; char *display_name=NULL;
char *wname="asbeats"; char *wname="asbeats";
XGCValues gcv; XGCValues gcv;
unsigned long gcm; unsigned long gcm;
@ -55,12 +55,12 @@ int main(int argc,char *argv[])
XClassHint classHint; XClassHint classHint;
Pixmap pixmask; Pixmap pixmask;
char *Geometry=""; char *Geometry="";
if (!(dpy = XOpenDisplay(display_name))) if (!(dpy = XOpenDisplay(display_name)))
{ {
fprintf(stderr,"asbeats: can't open display %s\n", fprintf(stderr,"asbeats: can't open display %s\n",
XDisplayName(display_name)); XDisplayName(display_name));
exit (1); exit (1);
} }
screen=DefaultScreen(dpy); screen=DefaultScreen(dpy);
Root=RootWindow(dpy,screen); Root=RootWindow(dpy,screen);
d_depth=DefaultDepth(dpy,screen); d_depth=DefaultDepth(dpy,screen);
@ -73,7 +73,7 @@ int main(int argc,char *argv[])
fore_pix=GetColor("black"); fore_pix=GetColor("black");
XWMGeometry(dpy,screen,Geometry,NULL,(borderwidth =1), XWMGeometry(dpy,screen,Geometry,NULL,(borderwidth =1),
&mysizehints,&mysizehints.x,&mysizehints.y, &mysizehints,&mysizehints.x,&mysizehints.y,
&mysizehints.width,&mysizehints.height,&i); &mysizehints.width,&mysizehints.height,&i);
mysizehints.width=wmclock.attributes.width; mysizehints.width=wmclock.attributes.width;
mysizehints.height=wmclock.attributes.height; mysizehints.height=wmclock.attributes.height;
win=XCreateSimpleWindow(dpy,Root,mysizehints.x,mysizehints.y, win=XCreateSimpleWindow(dpy,Root,mysizehints.x,mysizehints.y,
@ -98,8 +98,8 @@ int main(int argc,char *argv[])
gcv.foreground = fore_pix; gcv.foreground = fore_pix;
gcv.background = back_pix; gcv.background = back_pix;
gcv.graphics_exposures = FALSE; gcv.graphics_exposures = FALSE;
NormalGC = XCreateGC(dpy, Root, gcm, &gcv); NormalGC = XCreateGC(dpy, Root, gcm, &gcv);
pixmask = XCreateBitmapFromData(dpy, win, mask_bits, mask_width, pixmask = XCreateBitmapFromData(dpy, win, mask_bits, mask_width,
mask_height); mask_height);
XShapeCombineMask(dpy, win, ShapeBounding, 0, 0, pixmask, ShapeSet); XShapeCombineMask(dpy, win, ShapeBounding, 0, 0, pixmask, ShapeSet);
XShapeCombineMask(dpy, iconwin, 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.window_group = win;
mywmhints.flags = StateHint | IconWindowHint | mywmhints.flags = StateHint | IconWindowHint |
IconPositionHint | WindowGroupHint; IconPositionHint | WindowGroupHint;
XSetWMHints(dpy, win, &mywmhints); XSetWMHints(dpy, win, &mywmhints);
XSetCommand(dpy, win, argv, argc); XSetCommand(dpy, win, argv, argc);
XMapWindow(dpy,win); XMapWindow(dpy,win);
InsertTime(); InsertTime();
@ -134,9 +134,9 @@ int main(int argc,char *argv[])
break; break;
case DestroyNotify: case DestroyNotify:
XCloseDisplay(dpy); XCloseDisplay(dpy);
exit(0); exit(0);
default: default:
break; break;
} }
} }
XFlush(dpy); XFlush(dpy);
@ -158,7 +158,7 @@ void GetXPM(void)
char led2[22]; char led2[22];
int ret; int ret;
XGetWindowAttributes(dpy,Root,&attributes); XGetWindowAttributes(dpy,Root,&attributes);
if(!XParseColor(dpy,attributes.colormap,LedColor,&col)) if(!XParseColor(dpy,attributes.colormap,LedColor,&col))
{ {
nocolor("parse",LedColor); nocolor("parse",LedColor);
} }
@ -178,7 +178,7 @@ void GetXPM(void)
CreatePixmap(dpy,Root,mask_xpm,&wmclock); CreatePixmap(dpy,Root,mask_xpm,&wmclock);
CreatePixmap(dpy,Root,mask_xpm,&visible); CreatePixmap(dpy,Root,mask_xpm,&visible);
CreatePixmap(dpy,Root,led_xpm,&led); CreatePixmap(dpy,Root,led_xpm,&led);
} }
static void CreatePixmap(Display *dpy, Window Root, char **data, XpmIcon* icon) static void CreatePixmap(Display *dpy, Window Root, char **data, XpmIcon* icon)
{ {
@ -221,9 +221,9 @@ Pixel GetColor(char *name)
XWindowAttributes attributes; XWindowAttributes attributes;
XGetWindowAttributes(dpy,Root,&attributes); XGetWindowAttributes(dpy,Root,&attributes);
color.pixel=0; color.pixel=0;
if (!XParseColor(dpy,attributes.colormap,name,&color)) if (!XParseColor(dpy,attributes.colormap,name,&color))
nocolor("parse",name); nocolor("parse",name);
else if(!XAllocColor (dpy,attributes.colormap,&color)) else if(!XAllocColor (dpy,attributes.colormap,&color))
nocolor("alloc",name); nocolor("alloc",name);
return color.pixel; return color.pixel;
} }
@ -242,7 +242,7 @@ void Beat()
else else
if (fTime < 0) if (fTime < 0)
fTime+=1000; fTime+=1000;
XCopyArea(dpy,led.pixmap,visible.pixmap,NormalGC, XCopyArea(dpy,led.pixmap,visible.pixmap,NormalGC,
90,0,9,11,posx[0],15); 90,0,9,11,posx[0],15);
XCopyArea(dpy,led.pixmap,visible.pixmap,NormalGC, XCopyArea(dpy,led.pixmap,visible.pixmap,NormalGC,
@ -253,7 +253,7 @@ void Beat()
9*((int)fTime % 10),0,9,11,posx[3],15); 9*((int)fTime % 10),0,9,11,posx[3],15);
fTime = abs(((fTime - abs(fTime)) * 1000) + 0.5); fTime = abs(((fTime - abs(fTime)) * 1000) + 0.5);
XCopyArea(dpy,led.pixmap,visible.pixmap,NormalGC, XCopyArea(dpy,led.pixmap,visible.pixmap,NormalGC,
99,0,9,11,posx[0],32); 99,0,9,11,posx[0],32);
XCopyArea(dpy,led.pixmap,visible.pixmap,NormalGC, XCopyArea(dpy,led.pixmap,visible.pixmap,NormalGC,
@ -262,7 +262,7 @@ void Beat()
9*((((int)fTime) / 10) % 10),0,9,11,posx[2],32); 9*((((int)fTime) / 10) % 10),0,9,11,posx[2],32);
XCopyArea(dpy,led.pixmap,visible.pixmap,NormalGC, XCopyArea(dpy,led.pixmap,visible.pixmap,NormalGC,
9*((int)fTime % 10),0,9,11,posx[3],32); 9*((int)fTime % 10),0,9,11,posx[3],32);
return; return;
} }

View file

@ -14,7 +14,7 @@ Important note:
I changed two things in libworkman: 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. prevent libworkman to use the mixer.
2) I added wm_cddb.h in installed files as it was missing in the 2) I added wm_cddb.h in installed files as it was missing in the

View file

@ -43,7 +43,7 @@ OBJS = cdcontrol.o misc.o faktory.o handlers.o \
#ifdef WMK #ifdef WMK
WM_LIB = -lm -lz -lpng -ljpeg -ltiff -lgif -lPropList -lwraster -lWINGs WM_LIB = -lm -lz -lpng -ljpeg -ltiff -lgif -lPropList -lwraster -lWINGs
#else #else
WM_LIB = WM_LIB =
#endif #endif
AllTarget($(NAME)) AllTarget($(NAME))

View file

@ -31,7 +31,7 @@ AScd 0.1 -> 0.6
The original code was taken by Rob Malda from asclock (Afterstep wharf The original code was taken by Rob Malda from asclock (Afterstep wharf
module, by Beat Christen <bchriste@iiic.ethz.ch>) and from workbone (CD module, by Beat Christen <bchriste@iiic.ethz.ch>) and from workbone (CD
driver). driver).
AScd 0.7 -> 0.9 AScd 0.7 -> 0.9
--------------- ---------------
@ -52,7 +52,7 @@ AScd's archive. WorkMan's maintainer is Dirk Foersterling
AScd >= 0.12 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 change the pixmaps theme at run time. AScd now needs a directory where
to store the pixmaps. The default is /usr/local/share/AScd. 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 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 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/ 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. theme files are *not* compatible.
make make
- If you want to try the program, just type - If you want to try the program, just type
./ascd ./ascd
(try './ascd -help' to see the commandline options) (try './ascd -help' to see the commandline options)
If everything is ok, you can install the program and the If everything is ok, you can install the program and the
man page: man page:
make install make install
make install.man make install.man
@ -113,7 +113,7 @@ theme files are *not* compatible.
*Wharf - - Swallow "ascd" /usr/local/bin/ascd -device /dev/wcd0a & *Wharf - - Swallow "ascd" /usr/local/bin/ascd -device /dev/wcd0a &
(customized to your system settings of course!) (customized to your system settings of course!)
* installation for Window Maker * installation for Window Maker
----------------------------- -----------------------------
@ -131,7 +131,7 @@ theme files are *not* compatible.
clock applet for Window Maker. Wmitime was written by Dave Clark clock applet for Window Maker. Wmitime was written by Dave Clark
(clarkd@skynet.ca) More info at: http://www.neotokyo.org. I added the (clarkd@skynet.ca) More info at: http://www.neotokyo.org. I added the
lower case letters. lower case letters.
The new 0.13 default font is fully 8bit compatible! It has been drawn The new 0.13 default font is fully 8bit compatible! It has been drawn
by Stefan Zeiger (szeiger@novocode.com). by Stefan Zeiger (szeiger@novocode.com).
======================================================================== ========================================================================

View file

@ -24,12 +24,12 @@
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL DENIS BOUREZ, ROB MALDA OR CONTRIBUTORS BE * ARE DISCLAIMED. IN NO EVENT SHALL DENIS BOUREZ, ROB MALDA OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * 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 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* =========================================================================== * ===========================================================================
*/ */
@ -179,7 +179,7 @@ char th_alpha2[FAK_CMAX];
char th_background[FAK_CMAX]; char th_background[FAK_CMAX];
char th_icon_window[FAK_CMAX]; char th_icon_window[FAK_CMAX];
int th_no_minus = FALSE; int th_no_minus = FALSE;
int th_no_icon_window = FALSE; int th_no_icon_window = FALSE;
struct fak_button thdata[FAK_BMAX]; 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 i;
int j; int j;
@ -244,13 +244,13 @@ void mouse_events(XEvent Event)
} }
} }
} }
/* ------------------------------------------------------------------------ /* ------------------------------------------------------------------------
GUI control GUI control
------------------------------------------------------------------------ */ ------------------------------------------------------------------------ */
Pixel get_color(char *ColorName) Pixel get_color(char *ColorName)
{ {
XColor Color; XColor Color;
XWindowAttributes Attributes; XWindowAttributes Attributes;
@ -264,9 +264,9 @@ Pixel get_color(char *ColorName)
fprintf(stderr,"ascd: can't allocate %s\n", ColorName); fprintf(stderr,"ascd: can't allocate %s\n", ColorName);
return Color.pixel; return Color.pixel;
} }
void create_window(int argc, char **argv) void create_window(int argc, char **argv)
{ {
int i; int i;
unsigned int borderwidth ; unsigned int borderwidth ;
@ -345,7 +345,7 @@ void create_window(int argc, char **argv)
fore_pix, fore_pix,
back_pix); back_pix);
} else { } else {
Iconwin = XCreateSimpleWindow(Disp, Win, Iconwin = XCreateSimpleWindow(Disp, Win,
SizeHints.x, SizeHints.x,
SizeHints.y, SizeHints.y,
iconXPM.attributes.width, iconXPM.attributes.width,
@ -366,7 +366,7 @@ void create_window(int argc, char **argv)
XSelectInput(Disp, Iconwin, (ExposureMask | ButtonPressMask | XSelectInput(Disp, Iconwin, (ExposureMask | ButtonPressMask |
StructureNotifyMask)); StructureNotifyMask));
if (XStringListToTextProperty(&wname, 1, &name) ==0) { if (XStringListToTextProperty(&wname, 1, &name) ==0) {
fprintf(stderr, "ascd: can't allocate window name\n"); fprintf(stderr, "ascd: can't allocate window name\n");
exit(-1); exit(-1);
@ -389,21 +389,21 @@ void create_window(int argc, char **argv)
WmHints.icon_y = SizeHints.y; WmHints.icon_y = SizeHints.y;
XSetWMHints(Disp, Win, &WmHints); XSetWMHints(Disp, Win, &WmHints);
XSetCommand(Disp, Win, argv, argc); XSetCommand(Disp, Win, argv, argc);
XMapWindow(Disp, Win); XMapWindow(Disp, Win);
if (debug) fprintf(stderr, "-> calling fak_maskset() from create_window()...\n"); if (debug) fprintf(stderr, "-> calling fak_maskset() from create_window()...\n");
fak_maskset(); fak_maskset();
if (debug) fprintf(stderr, "-> calling fak_redraw() from create_window()...\n"); if (debug) fprintf(stderr, "-> calling fak_redraw() from create_window()...\n");
fak_redraw(); fak_redraw();
if (debug) fprintf(stderr, "-> Leaving create_window()\n"); if (debug) fprintf(stderr, "-> Leaving create_window()\n");
} }
void newtext(char *txt) { void newtext(char *txt) {
strcpy(led_text, txt); strcpy(led_text, txt);
text_start = 0; text_start = 0;
} }
void show_icon_db_f() { void show_icon_db_f() {
/* scroll the song title */ /* scroll the song title */
@ -434,7 +434,7 @@ void show_icon_db_f() {
} }
if (track > cur_ntracks - 1) return; if (track > cur_ntracks - 1) return;
if (cd->trk[track].songname != NULL) { if (cd->trk[track].songname != NULL) {
if (show_artist) { if (show_artist) {
if (cd->artist != NULL) { if (cd->artist != NULL) {
@ -483,10 +483,10 @@ void show_db_f() {
if ((theme_select == 0) || (where == DB_PANEL)) { if ((theme_select == 0) || (where == DB_PANEL)) {
/* /*
there is a message to display, we'll wait for the message there is a message to display, we'll wait for the message
to time-out before handling the track title... (but only if 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; 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 > cur_ntracks - 1) return;
if (track < 0) return; if (track < 0) return;
if (debug > 1) fprintf(stderr, "** Show DB TRACK = %d\n", track); if (debug > 1) fprintf(stderr, "** Show DB TRACK = %d\n", track);
if (cd->trk[track].songname != NULL) { if (cd->trk[track].songname != NULL) {
@ -542,20 +542,20 @@ void show_db_f() {
Loooooooooooooooooping......... Loooooooooooooooooping.........
------------------------------------------------------------------------ */ ------------------------------------------------------------------------ */
void main_loop() void main_loop()
{ {
unsigned int no_disk = 0; unsigned int no_disk = 0;
long int dodo = RDTIME; long int dodo = RDTIME;
XEvent Event; XEvent Event;
while(1) { while(1) {
if (debug > 1) fprintf(stderr, "** [Main Loop] mode = %02d track = %02d \n", cur_cdmode, cur_track); 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; if (cur_cdmode == WM_CDM_EJECTED) no_disk = 1;
slow_down++; slow_down++;
if (slow_down > 10) { if (slow_down > 10) {
#ifdef WMK #ifdef WMK
@ -589,13 +589,13 @@ void main_loop()
fak_redraw(); fak_redraw();
} }
} }
/* The Loop Mode : */ /* The Loop Mode : */
if ( (cur_track == loop_end_track ) && (cur_pos_rel >= loop_2) && (loop_mode) ) { if ( (cur_track == loop_end_track ) && (cur_pos_rel >= loop_2) && (loop_mode) ) {
cd_control(LOOP); cd_control(LOOP);
fak_redraw(); fak_redraw();
} }
/* The Intro Scan Mode : */ /* The Intro Scan Mode : */
if ( (cur_pos_rel > cue_time) && (intro_mode) ) { if ( (cur_pos_rel > cue_time) && (intro_mode) ) {
cd_control(INTRONEXT); cd_control(INTRONEXT);
@ -608,19 +608,19 @@ void main_loop()
} }
/* Check events */ /* Check events */
while (XPending(Disp)) while (XPending(Disp))
{ {
XNextEvent(Disp, &Event); XNextEvent(Disp, &Event);
#ifdef WMK #ifdef WMK
if (!WMHandleEvent(&Event)) { if (!WMHandleEvent(&Event)) {
#endif #endif
switch(Event.type) { switch(Event.type) {
/* ---------------------- Redraw Window --------------------- */ /* ---------------------- Redraw Window --------------------- */
case Expose: case Expose:
if(Event.xexpose.count == 0) { if(Event.xexpose.count == 0) {
lasttime=01; lasttime=01;
@ -630,17 +630,17 @@ void main_loop()
if (debug > 1) fprintf(stderr, "** XEVent - expose, not handled, count = %d\n", Event.xexpose.count); if (debug > 1) fprintf(stderr, "** XEVent - expose, not handled, count = %d\n", Event.xexpose.count);
} }
break; break;
/* ----------------------- Mouse Click ---------------------- */ /* ----------------------- Mouse Click ---------------------- */
case ButtonPress: case ButtonPress:
wm_cd_status(); wm_cd_status();
mouse_events(Event); mouse_events(Event);
break; break;
/* ------------------------ Destroy Window ------------------- */ /* ------------------------ Destroy Window ------------------- */
case DestroyNotify: case DestroyNotify:
XFreeGC(Disp, WinGC); XFreeGC(Disp, WinGC);
XDestroyWindow(Disp, Win); XDestroyWindow(Disp, Win);
@ -653,34 +653,34 @@ void main_loop()
break; break;
} }
#ifdef WMK #ifdef WMK
} }
#endif #endif
XFlush(Disp); XFlush(Disp);
} /* check event */ } /* check event */
usleep(dodo); usleep(dodo);
/* ----------------- now we have to redraw the screen: ---------------- */ /* ----------------- now we have to redraw the screen: ---------------- */
if ((slow_down > 10) || (has_clicked)) { if ((slow_down > 10) || (has_clicked)) {
fak_redraw(); fak_redraw();
slow_down = 0; slow_down = 0;
has_clicked = FALSE; has_clicked = FALSE;
} }
} }
} }
/* ------------------------------------------------------------------------ /* ------------------------------------------------------------------------
So... let's go! 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);*/ /*printf("AScd %s\n", VERSION);*/
/* CD device: */ /* CD device: */
#ifndef NO_D_DEVICE #ifndef NO_D_DEVICE
@ -691,7 +691,7 @@ int main(int argc, char *argv[])
strcpy(led_text, ""); strcpy(led_text, "");
strcpy(theme, "default"); strcpy(theme, "default");
strcpy(xv, "xv"); strcpy(xv, "xv");
/* the WorkMan database. It's still not used in ascd, but we need this /* the WorkMan database. It's still not used in ascd, but we need this
to start the WorkMan code to start the WorkMan code
*/ */
@ -723,7 +723,7 @@ int main(int argc, char *argv[])
create_window(argc, argv); create_window(argc, argv);
if (debug) fprintf(stderr, "** checking CD status...\n"); if (debug) fprintf(stderr, "** checking CD status...\n");
wm_cd_status(); wm_cd_status();
if (cur_cdmode != WM_CDM_EJECTED) { if (cur_cdmode != WM_CDM_EJECTED) {
if (debug) fprintf(stderr, "** reading CD initial volume...\n"); if (debug) fprintf(stderr, "** reading CD initial volume...\n");
volume = wm_cd_read_initial_volume(max_volume); 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 (debug) fprintf(stderr, "** checking current CD volume in database\n");
if (((cur_cdmode == WM_CDM_PLAYING) || (cur_cdmode == WM_CDM_PAUSED)) && (cd->volume > 0)) { if (((cur_cdmode == WM_CDM_PLAYING) || (cur_cdmode == WM_CDM_PAUSED)) && (cd->volume > 0)) {
volume=cd->volume; volume=cd->volume;
cd_volume(volume, 10, max_volume); cd_volume(volume, 10, max_volume);
} }
fak_maskset(); fak_maskset();
if (debug) fprintf(stderr, "** Init passed. Entering main loop.\n"); if (debug) fprintf(stderr, "** Init passed. Entering main loop.\n");

View file

@ -94,7 +94,7 @@
.SH DESCRIPTION .SH DESCRIPTION
\fBascd\fP is CD player written to play audio CD's integrated in \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. \fBascd\fP handles mounted volumes, and opens and closes the tray.
.SH CONFIGURATION OPTIONS .SH CONFIGURATION OPTIONS
@ -120,7 +120,7 @@ afterstep's Wharf module or WindowMaker's dock.
you use ascd with WindowMaker. you use ascd with WindowMaker.
.B -device <device> .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 ascd. If "-DNO_DEFAULT_DEVICE" was set at
compilation time this option will have no effect. compilation time this option will have no effect.
@ -138,7 +138,7 @@ afterstep's Wharf module or WindowMaker's dock.
.B +/-autoplay, +/-a .B +/-autoplay, +/-a
Turn on or off \fBautoplay mode\fP. When this is 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. automatically when inserted.
.B +/-autoprobe, +/-p .B +/-autoprobe, +/-p
@ -161,7 +161,7 @@ afterstep's Wharf module or WindowMaker's dock.
.B -volume <value> .B -volume <value>
Set the CD driver volume, between 0 and maxvolume. 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 the mixer. It controls the drive, not the sound
card. card.
@ -199,7 +199,7 @@ afterstep's Wharf module or WindowMaker's dock.
.B -save .B -save
Save all the settings and exit. Usefull to 'make' a Save all the settings and exit. Usefull to 'make' a
new configuration file: set all the stuff you want 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: Example:
ascd +w +a -device /dev/cd0c -save ascd +w +a -device /dev/cd0c -save

View file

@ -1,6 +1,6 @@
/* =========================================================================== /* ===========================================================================
* AScd: cdcontrol.c * 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. * the appropriate commands to libworkman.
* *
* Please do *not* modify this function as it is used without changes by * 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 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL DENIS BOUREZ, ROB MALDA OR CONTRIBUTORS BE * ARE DISCLAIMED. IN NO EVENT SHALL DENIS BOUREZ, ROB MALDA OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * 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 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* =========================================================================== * ===========================================================================
*/ */
#define CD_C_VERSION "1.4" #define CD_C_VERSION "1.4"
#include "ext.h" #include "ext.h"
void void
cd_control(int order) cd_control(int order)
{ {
static int pos_changed = FALSE; static int pos_changed = FALSE;
@ -61,7 +61,7 @@ cd_control(int order)
if ((cur_ntracks == 1) && (cd->trk[cur_track - 1].data)) { 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 all commands to avoid some funny things. Only the EJECT
commands are allowed */ commands are allowed */
@ -70,7 +70,7 @@ cd_control(int order)
return; return;
} }
} }
switch(order) { switch(order) {
case PLAY: case PLAY:
@ -85,7 +85,7 @@ cd_control(int order)
if (cur_track < 1) cur_track = 1; if (cur_track < 1) cur_track = 1;
/* don't play data tracks: */ /* don't play data tracks: */
if (! cd->trk[cur_track - 1].data) { if (! cd->trk[cur_track - 1].data) {
if (cur_cdmode != WM_CDM_EJECTED) { if (cur_cdmode != WM_CDM_EJECTED) {
if (cur_cdmode != WM_CDM_PAUSED) { if (cur_cdmode != WM_CDM_PAUSED) {
@ -226,7 +226,7 @@ cd_control(int order)
/* if it's a data track, skip it */ /* if it's a data track, skip it */
while ((cd->trk[cur_track - 1].data) && (cur_track <= cur_ntracks)) cur_track++; while ((cd->trk[cur_track - 1].data) && (cur_track <= cur_ntracks)) cur_track++;
if (cur_cdmode == WM_CDM_PLAYING) { if (cur_cdmode == WM_CDM_PLAYING) {
wanna_play = TRUE; wanna_play = TRUE;
wm_cd_play(cur_track, 0, cur_ntracks + 1); wm_cd_play(cur_track, 0, cur_ntracks + 1);
@ -280,17 +280,17 @@ cd_control(int order)
case LOOP: case LOOP:
if ( (loop_2 > loop_1) || if ( (loop_2 > loop_1) ||
(loop_end_track > loop_start_track) ) { (loop_end_track > loop_start_track) ) {
if (loop_start_track == 0) loop_start_track = 1; if (loop_start_track == 0) loop_start_track = 1;
intro_mode = 0; intro_mode = 0;
if ( ( loop_2 > loop_1 ) if ( ( loop_2 > loop_1 )
|| ( loop_start_track != loop_end_track ) ) || ( loop_start_track != loop_end_track ) )
currenttrack = loop_start_track; currenttrack = loop_start_track;
else { else {
loop_end_track = cur_ntracks; loop_end_track = cur_ntracks;
currenttrack = loop_start_track = 1; currenttrack = loop_start_track = 1;
loop_1 = 0; loop_1 = 0;
loop_2 = loop_2 =
thiscd.trk[ loop_end_track - 1 ].length - 1; thiscd.trk[ loop_end_track - 1 ].length - 1;
} }
wm_cd_play(loop_start_track, loop_1, cur_ntracks + 1); wm_cd_play(loop_start_track, loop_1, cur_ntracks + 1);
@ -327,7 +327,7 @@ cd_control(int order)
intro_mode = 0; intro_mode = 0;
} }
break; break;
case INTRONEXT: case INTRONEXT:
wm_cd_pause(); wm_cd_pause();
currenttrack = cur_track; currenttrack = cur_track;
@ -337,7 +337,7 @@ cd_control(int order)
cur_pos_rel = 0; cur_pos_rel = 0;
wm_cd_play(currenttrack, 0, cur_ntracks + 1); wm_cd_play(currenttrack, 0, cur_ntracks + 1);
break; break;
case LOCACCESS: case LOCACCESS:
if ( (loop_1 > 0) && (loop_start_track > 0) ) { if ( (loop_1 > 0) && (loop_start_track > 0) ) {
intro_mode = 0; intro_mode = 0;

14
ascd/ascd/configure vendored
View file

@ -64,7 +64,7 @@ printf "Bin directory? "
read BINDIR read BINDIR
echo echo
case $BINDIR in case $BINDIR in
"") echo "#define CBINDIR /usr/local/bin" > dirs.h "") echo "#define CBINDIR /usr/local/bin" > dirs.h
echo "** Ascd will be /usr/local/bin/ascd" echo "** Ascd will be /usr/local/bin/ascd"
;; ;;
@ -85,9 +85,9 @@ echo "default value (/usr/local/man/man1)."
echo echo
printf "Man directory? " printf "Man directory? "
read MANDIR read MANDIR
echo echo
case $MANDIR in case $MANDIR in
"") echo "#define CMANDIR /usr/local/man/man1" >> dirs.h "") echo "#define CMANDIR /usr/local/man/man1" >> dirs.h
echo "** Man page will be installed in /usr/local/man/man1." echo "** Man page will be installed in /usr/local/man/man1."
;; ;;
@ -110,7 +110,7 @@ printf "Themes pixmaps directory? "
read THDIR read THDIR
echo echo
case $THDIR in case $THDIR in
"") echo "#define THDIR \"/usr/local/share/AScd\"" >> config.h "") echo "#define THDIR \"/usr/local/share/AScd\"" >> config.h
echo "#define CTHDIR /usr/local/share/AScd" >> dirs.h echo "#define CTHDIR /usr/local/share/AScd" >> dirs.h
echo "** Theme dir: /usr/local/share/AScd." echo "** Theme dir: /usr/local/share/AScd."
@ -139,9 +139,9 @@ echo "2) no WINGs support (DEFAULT)"
echo echo
printf "Type 1 or 2: " printf "Type 1 or 2: "
read WINGS read WINGS
echo echo
case $WINGS in case $WINGS in
1) echo "#define WMK" >> config.h 1) echo "#define WMK" >> config.h
echo "** Compiling with WINGs support." echo "** Compiling with WINGs support."
;; ;;
@ -167,7 +167,7 @@ printf "Type 1 or 2: "
read WINGS read WINGS
echo echo
case $WINGS in case $WINGS in
1) echo "#define MIXER" >> config.h 1) echo "#define MIXER" >> config.h
echo "** Compiling with mixer support." echo "** Compiling with mixer support."
;; ;;

View file

@ -55,13 +55,13 @@
- added "quick ref" support with quick_ref command and a button - added "quick ref" support with quick_ref command and a button
in the WINGs main window in the WINGs main window
------------- 05/16/99: ------------- 05/16/99:
- added support for vertical sliders (CD direct access, volume and - added support for vertical sliders (CD direct access, volume and
mixer) via vprogress_bar, vvolume_bar and vmixer_bar. mixer) via vprogress_bar, vvolume_bar and vmixer_bar.
- added support for inverted vertical sliders via iprogress_bar, - added support for inverted vertical sliders via iprogress_bar,
ivolume_bar and imixer_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.) you compile mixer support on other platforms.)
- added -mixer commandline option to specify the mixer device - added -mixer commandline option to specify the mixer device
- themes manual updated - themes manual updated
@ -79,21 +79,21 @@
- better WINGs handling. The WINGs window is no longer closed by - better WINGs handling. The WINGs window is no longer closed by
the program when CD is ejected. the program when CD is ejected.
- [fix] WINGs windows crashed when CD was stopped - [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) program at startup time (cd_curtrack = -1)
- [fix] bug in the song title scrolling (hardcoded length) - [fix] bug in the song title scrolling (hardcoded length)
------------- 05/11/99: 0.13pr6 ------------- 05/11/99: 0.13pr6
- small updates in the man page (so outdated...) - 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 installed in /usr/local/share/AScd
- added alt pixmap support for eject command - added alt pixmap support for eject command
- added database panel which can now be different from message one - added database panel which can now be different from message one
- changed the themes loading mechanism: themes are now installed in - changed the themes loading mechanism: themes are now installed in
/usr/local/share/AScd/Themes. There's also a Default/ dir that can /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 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. digits.xpm and digits2.xpm.
- the theme selectors now use dirent instead of the '.dir' file - the theme selectors now use dirent instead of the '.dir' file
- added alt pixmap support for mute command - added alt pixmap support for mute command
@ -147,7 +147,7 @@ New features and fixes since 0.12.1:
0.13 fixes and additions: 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 case of mouse events
- support for introscan - support for introscan
- support for fade in/out - 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 **** ------------- 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 that appears on the screen is now 100% configurable. Put the buttons
you want, where you want! 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. several smaller C files.
- [bug] the WINGs support shall *not* compile. I didn't have time - [bug] the WINGs support shall *not* compile. I didn't have time
to update this code with the new features. 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 - [fix WINGs] the themes popup didn't display the selected theme
- multiple-mask shape mode, to allow transparent background with - 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 runtime visual themes management, with -theme cl option
- added a popup menu in configuration window to change the visual - added a popup menu in configuration window to change the visual
theme *without* restarting the program 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 if the mouse click was outside the buttons
- [fix] a couple of typos in the WINGs windows. - [fix] a couple of typos in the WINGs windows.
@ -219,13 +219,13 @@ pre-releases.
------------- 04/14/99: 0.11.1 ------------- 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 changes in the background pixmap to display the new letters. I
also added a conversion that remove accents. also added a conversion that remove accents.
- added 2 buttons in WINGs window to switch on/off song name and - added 2 buttons in WINGs window to switch on/off song name and
artist scrolling in main window. artist scrolling in main window.
- added a field to edit the cd device in WINGs 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 - [fix?] autorepeat
------------- 04/13/99: 0.11.0 RELEASE ------------- 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 - [fix] 0.9 didn't compile if NO_D_DEVICE was defined. Thanks to
Gus Hartmann who found the bug. 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. was off.
------------- 01/27/99: 0.9 RELEASE ------------- 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] 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] 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) buttons when stopped (since 01/21)
- [fix] window was not properly redrawn when stopped (since 0.8-R) - [fix] window was not properly redrawn when stopped (since 0.8-R)
- [fix] it was not possible to access the last track when stopped - [fix] it was not possible to access the last track when stopped
@ -364,13 +364,13 @@ is gone again!
* Ascd: * 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. 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. player and the mixer.
- all the mixer settings can be saved in a ~/.ascdrc file. This file - all the mixer settings can be saved in a ~/.ascdrc file. This file
can be loaded at startup. 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. new commands. See ascd -help for further details.
* Lib: * Lib:
@ -385,25 +385,25 @@ is gone again!
- Almost total rewrite of cd_control() function. The code should be - Almost total rewrite of cd_control() function. The code should be
more reliable (I hope!). Some clean-ups two. 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) paused). Only the WorkMan ones (cur_track, cur_ntracks, cur_cdmode)
are used. are used.
- on launch, if autoplay is disabled, the track nbr panel displays - on launch, if autoplay is disabled, the track nbr panel displays
how tracks are on the CD instead of "01". 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. the track nbr panel displays the number of remaining tracks.
- new alpha pixmaps. - new alpha pixmaps.
- adjusted timing for checking inserted CD in autoplay mode. - 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. volumes can be set with 'm' and 'v' command line parameters.
- [fix] in autoplay mode, launching ascd with an inserted audio CD in - [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 ------------- 01/21/99: PR2
* Ascd: * 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. changes.
- XPM code redesigned: each button has its own XPM file. - XPM code redesigned: each button has its own XPM file.
@ -412,15 +412,15 @@ is gone again!
* Lib: * Lib:
- added O_RDONLY | O_NONBLOCK flagsto the cd_device opening function - 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
(axboe@image.dk) (axboe@image.dk)
------------- 12/20/98: PR1 ------------- 12/20/98: PR1
* Lib: * Lib:
- using WorkMan 1.3b (BETA) code instead of WorkMan 1.3a - 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 (secrer@le-bar.fdn.fr) Stephane Marzloff (secrer@le-bar.fdn.fr)
- plat_openbsd.c added (WorkMan) - plat_openbsd.c added (WorkMan)
@ -456,7 +456,7 @@ is gone again!
------------- 11/29/98: ------------- 11/29/98:
- lib should now compile on Solaris 7 with gcc, using a specific - lib should now compile on Solaris 7 with gcc, using a specific
Makefile. Makefile.
- added NO_D_DEVICE option for Solaris Volume Manager. - added NO_D_DEVICE option for Solaris Volume Manager.
------------- 12/01/97: ------------- 12/01/97:
@ -472,13 +472,13 @@ is gone again!
- 'Config' file where all compilation options can be changed. - 'Config' file where all compilation options can be changed.
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 !! Lovesexy's album !!
* Ascd: * Ascd:
- ascd now includes asmixer! - 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. time display with right button to switch to it.
- added -v, -1, -2, -3 command line parameters for the - added -v, -1, -2, -3 command line parameters for the
mixer screen (same as asmixer). Removed the old -v option. 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) - changed "-l" option to "-f" ([F]oreground color)
- when CD is ejected, track nbr shows "--". - when CD is ejected, track nbr shows "--".
- all the XPMs are now included in ascd.c, to allow to - 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. "old and quick made" ascd+ buttons.
- when global time is displayed, clicking on the - when global time is displayed, clicking on the
progress bar give access to the whole disk. progress bar give access to the whole disk.
- added a "#define VERSION" in ascd.c - 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 v0.6
- Most important: WindowMaker Dock support with the -w flag! - Most important: WindowMaker Dock support with the -w flag!
===================================================================== =====================================================================
03/25/97: 0.4+ release 03/25/97: 0.4+ release
@ -555,7 +555,7 @@ database code)
- added: 4th digit for songs longer than 10 minutes. - added: 4th digit for songs longer than 10 minutes.
- added: -a command line option. Activates the autoplay mode: ascd - added: -a command line option. Activates the autoplay mode: ascd
automatically plays the CD when it is inserted. 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. for the intro scan mode and the cue/review function.
- changed the indentation in the source code with the auto- - changed the indentation in the source code with the auto-
indentation in jed. Sorry ;-) indentation in jed. Sorry ;-)
@ -594,4 +594,4 @@ v0.2
useful with ascdc. useful with ascdc.
- Now includes the correct README file. Thanks to the - Now includes the correct README file. Thanks to the
Hundreds of you who caught that. It's nice to know Hundreds of you who caught that. It's nice to know
someone reads these files. someone reads these files.

View file

@ -7,8 +7,8 @@ considering this code as beta stage one.)
* Visual Themes: * Visual Themes:
Visual themes are now 100% configurable. A theme consist in a description 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 file and various pixmaps. You can place any screen element anywhere in the
window and the icon. Available screen elements: window and the icon. Available screen elements:
- pixmaps - pixmaps
@ -24,8 +24,8 @@ considering this code as beta stage one.)
buttons. AScd provides commands to control the general options, the CD buttons. AScd provides commands to control the general options, the CD
player and the mixer. player and the mixer.
AScd is no longer restricted to a "dockable" size. More: In -w mode, it's 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 now possible to have different screen layouts for the main window and the
icon one icon one
* Mixer support is back (FreeBSD and Linux are the only supported platforms) * 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 * REWRITE of the command line parsing function. Added a few
new options. See the man page or type ascd -help. new options. See the man page or type ascd -help.
* ascd can save and load its settings in ~/.ascdrc file. It * 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. .ascdrc settings can be overidden with the commandline options.
* added drive volume control with a "mute" switch (values * added drive volume control with a "mute" switch (values
can be changed with commandline options). Note that mute 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. 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) commandline & ~/.ascdrc)
* Autoplay and autorepeat modes redesigned. They should ok now. * Autoplay and autorepeat modes redesigned. They should ok now.
(still a few little problems with autoplay detecting) (still a few little problems with autoplay detecting)

View file

@ -24,16 +24,16 @@
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL DENIS BOUREZ, ROB MALDA OR CONTRIBUTORS BE * ARE DISCLAIMED. IN NO EVENT SHALL DENIS BOUREZ, ROB MALDA OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * 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 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* =========================================================================== * ===========================================================================
*/ */
#include "ext.h" #include "ext.h"
#define MAX_LINE_NAME 16 #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 */ /* re-init all the buttons structure and globals */
int i; int i;
if (debug) fprintf(stderr, "** Init theme variables.\n Buttons...\n"); 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].panel = 0;
thdata[i].left = 0; thdata[i].left = 0;
thdata[i].mid = 0; thdata[i].mid = 0;
thdata[i].right = 0; thdata[i].right = 0;
thdata[i].x = 0; thdata[i].x = 0;
thdata[i].y = 0; thdata[i].y = 0;
thdata[i].w = 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 txt[256];
char key[256]; char key[256];
@ -308,7 +308,7 @@ struct {
} }
} else if (key[0] == '}') { } else if (key[0] == '}') {
button = FALSE; button = FALSE;
/* update the pointers to msg, counter and tracknbr: */ /* update the pointers to msg, counter and tracknbr: */
switch(thdata[but_max].type) { switch(thdata[but_max].type) {
@ -387,9 +387,9 @@ struct {
} }
i = 0; i = 0;
if ((strcmp(key, "left") == 0) || if ((strcmp(key, "left") == 0) ||
(strcmp(key, "middle") ==0) || (strcmp(key, "middle") ==0) ||
(strcmp(key, "mid") ==0) || (strcmp(key, "mid") ==0) ||
(strcmp(key, "right") == 0)) { (strcmp(key, "right") == 0)) {
/* --------------- available commands: ---------------- */ /* --------------- available commands: ---------------- */
@ -519,7 +519,7 @@ struct {
if ((Ret != XpmSuccess) && (debug)) fprintf(stderr, "*!* "); if ((Ret != XpmSuccess) && (debug)) fprintf(stderr, "*!* ");
/* the fonts: */ /* the fonts: */
if (debug) fprintf(stderr, "alpha 1 "); if (debug) fprintf(stderr, "alpha 1 ");
fak_validate_pixmap(txt, th_alpha1); fak_validate_pixmap(txt, th_alpha1);
@ -533,7 +533,7 @@ struct {
Ret = XpmReadFileToPixmap(Disp, Root, txt, &ralphaXPM.pixmap, Ret = XpmReadFileToPixmap(Disp, Root, txt, &ralphaXPM.pixmap,
&ralphaXPM.mask, &ralphaXPM.attributes); &ralphaXPM.mask, &ralphaXPM.attributes);
if ((Ret != XpmSuccess) && (debug)) fprintf(stderr, "*!* "); if ((Ret != XpmSuccess) && (debug)) fprintf(stderr, "*!* ");
if (debug) fprintf(stderr, "\n-> Loading buttons pixmaps... "); if (debug) fprintf(stderr, "\n-> Loading buttons pixmaps... ");
for (i = 1; i <= but_max; i++) { for (i = 1; i <= but_max; i++) {
if (strlen(thdata[i].xpm_file) > 0) { 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 x = 0;
unsigned int offset = 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)) { if ((strlen(txt) > thdata[icon_msg].w) && (where == MSG_PANEL)) {
txt[thdata[icon_msg].w] = 0; txt[thdata[icon_msg].w] = 0;
} }
if ((strcmp(txt, "") == 0) && (where == MSG_PANEL)) { if ((strcmp(txt, "") == 0) && (where == MSG_PANEL)) {
for (x = 1; x <= thdata[icon_msg].w; x++) { for (x = 1; x <= thdata[icon_msg].w; x++) {
strcat(txt, " "); strcat(txt, " ");
} }
} }
if (red) { if (red) {
char_max = alphaXPM.attributes.width / 6; 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) { if (red) {
XCopyArea(Disp, ralphaXPM.pixmap, Iconwin, WinGC, XCopyArea(Disp, ralphaXPM.pixmap, Iconwin, WinGC,
6 * offset, 0, 6, 9, 6 * offset, 0, 6, 9,
hoffset + (col * 6) + (x * 6), hoffset + (col * 6) + (x * 6),
voffset); voffset);
} else { } else {
XCopyArea(Disp, alphaXPM.pixmap, Iconwin, WinGC, XCopyArea(Disp, alphaXPM.pixmap, Iconwin, WinGC,
6 * offset, 0, 6, 9, 6 * offset, 0, 6, 9,
hoffset + (col * 6) + (x * 6), hoffset + (col * 6) + (x * 6),
voffset); 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)) { if ((strlen(txt) > thdata[but_msg].w) && (where == MSG_PANEL)) {
txt[thdata[but_msg].w] = 0; txt[thdata[but_msg].w] = 0;
} }
if ((strlen(txt) > thdata[but_db].w) && (where == DB_PANEL)) { if ((strlen(txt) > thdata[but_db].w) && (where == DB_PANEL)) {
txt[thdata[but_msg].w] = 0; txt[thdata[but_msg].w] = 0;
} }
if ((strcmp(txt, "") == 0) && (where == MSG_PANEL)) { if ((strcmp(txt, "") == 0) && (where == MSG_PANEL)) {
for (x = 1; x <= thdata[but_msg].w; x++) { for (x = 1; x <= thdata[but_msg].w; x++) {
strcat(txt, " "); strcat(txt, " ");
} }
} }
if ((strcmp(txt, "") == 0) && (where == DB_PANEL)) { if ((strcmp(txt, "") == 0) && (where == DB_PANEL)) {
for (x = 1; x <= thdata[but_db].w; x++) { for (x = 1; x <= thdata[but_db].w; x++) {
strcat(txt, " "); strcat(txt, " ");
@ -792,41 +792,41 @@ void fak_text(char *string, unsigned int where, unsigned int col, unsigned int r
if (red) { if (red) {
XCopyArea(Disp, ralphaXPM.pixmap, Win, WinGC, XCopyArea(Disp, ralphaXPM.pixmap, Win, WinGC,
6 * offset, 0, 6, 9, 6 * offset, 0, 6, 9,
hoffset + (col * 6) + (x * 6), hoffset + (col * 6) + (x * 6),
voffset); voffset);
if (!th_no_icon_window) { if (!th_no_icon_window) {
XCopyArea(Disp, ralphaXPM.pixmap, Iconwin, WinGC, XCopyArea(Disp, ralphaXPM.pixmap, Iconwin, WinGC,
6 * offset, 0, 6, 9, 6 * offset, 0, 6, 9,
hoffset + (col * 6) + (x * 6), hoffset + (col * 6) + (x * 6),
voffset); voffset);
} }
} else { } else {
XCopyArea(Disp, alphaXPM.pixmap, Win, WinGC, XCopyArea(Disp, alphaXPM.pixmap, Win, WinGC,
6 * offset, 0, 6, 9, 6 * offset, 0, 6, 9,
hoffset + (col * 6) + (x * 6), hoffset + (col * 6) + (x * 6),
voffset); voffset);
if (!th_no_icon_window) { if (!th_no_icon_window) {
XCopyArea(Disp, alphaXPM.pixmap, Iconwin, WinGC, XCopyArea(Disp, alphaXPM.pixmap, Iconwin, WinGC,
6 * offset, 0, 6, 9, 6 * offset, 0, 6, 9,
hoffset + (col * 6) + (x * 6), hoffset + (col * 6) + (x * 6),
voffset); voffset);
} }
} }
} }
} }
int fak_flush_expose(Window w) int fak_flush_expose(Window w)
{ {
XEvent dummy; XEvent dummy;
int i=0; int i=0;
while (XCheckTypedWindowEvent (Disp, w, Expose, &dummy))i++; while (XCheckTypedWindowEvent (Disp, w, Expose, &dummy))i++;
return i; return i;
} }
void fak_minus(void) { void fak_minus(void) {
if (th_no_minus) return; if (th_no_minus) return;
@ -835,20 +835,20 @@ void fak_minus(void) {
if (!th_no_icon_window) { if (!th_no_icon_window) {
if (but_counter == 0) return; if (but_counter == 0) return;
XCopyArea(Disp, alphaXPM.pixmap, Win, WinGC, 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); thdata[but_counter].x, thdata[but_counter].y);
XCopyArea(Disp, alphaXPM.pixmap, Iconwin, WinGC, 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); thdata[but_counter].x, thdata[but_counter].y);
} else { } else {
if (but_counter > 0) { if (but_counter > 0) {
XCopyArea(Disp, alphaXPM.pixmap, Win, WinGC, 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); thdata[but_counter].x, thdata[but_counter].y);
} }
if (icon_counter > 0) { if (icon_counter > 0) {
XCopyArea(Disp, alphaXPM.pixmap, Iconwin, WinGC, 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); thdata[icon_counter].x, thdata[icon_counter].y);
} }
} }
@ -856,20 +856,20 @@ void fak_minus(void) {
if (!th_no_icon_window) { if (!th_no_icon_window) {
if (but_counter == 0) return; if (but_counter == 0) return;
XCopyArea(Disp, alphaXPM.pixmap, Win, WinGC, XCopyArea(Disp, alphaXPM.pixmap, Win, WinGC,
588, 0, 4, 7, 588, 0, 4, 7,
thdata[but_counter].x, thdata[but_counter].y); thdata[but_counter].x, thdata[but_counter].y);
XCopyArea(Disp, alphaXPM.pixmap, Iconwin, WinGC, XCopyArea(Disp, alphaXPM.pixmap, Iconwin, WinGC,
588, 0, 4, 7, 588, 0, 4, 7,
thdata[but_counter].x, thdata[but_counter].y); thdata[but_counter].x, thdata[but_counter].y);
} else { } else {
if (but_counter > 0) { if (but_counter > 0) {
XCopyArea(Disp, alphaXPM.pixmap, Win, WinGC, XCopyArea(Disp, alphaXPM.pixmap, Win, WinGC,
588, 0, 4, 7, 588, 0, 4, 7,
thdata[but_counter].x, thdata[but_counter].y); thdata[but_counter].x, thdata[but_counter].y);
} }
if (icon_counter > 0) { if (icon_counter > 0) {
XCopyArea(Disp, alphaXPM.pixmap, Iconwin, WinGC, XCopyArea(Disp, alphaXPM.pixmap, Iconwin, WinGC,
588, 0, 4, 7, 588, 0, 4, 7,
thdata[icon_counter].x, thdata[icon_counter].y); thdata[icon_counter].x, thdata[icon_counter].y);
} }
} }
@ -897,7 +897,7 @@ void fak_minus(void) {
582, 0, 4, 4, 582, 0, 4, 4,
thdata[icon_counter].x, thdata[icon_counter].y); 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 (strlen(thdata[i].xpm_file) > 0) {
if (!th_no_icon_window) { 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); 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); thdata[i].xpm.mask, ShapeSubtract);
} else { } else {
if (thdata[i].icon) { 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); thdata[i].xpm.mask, ShapeSubtract);
} else { } 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); thdata[i].xpm.mask, ShapeSubtract);
} }
} }
@ -925,16 +925,16 @@ void fak_singlemask(int i)
if (strlen(thdata[i].altxpm_file) > 0) { if (strlen(thdata[i].altxpm_file) > 0) {
if (!th_no_icon_window) { 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); 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); thdata[i].altxpm.mask, ShapeSubtract);
} else { } else {
if (thdata[i].icon) { 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); thdata[i].altxpm.mask, ShapeSubtract);
} else { } 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); 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 ((fak_use_alt(i)) && (strlen(thdata[i].altxpm_file) > 0)) {
if (!th_no_icon_window) { 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); 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); thdata[i].altxpm.mask, ShapeUnion);
} else { } else {
if (thdata[i].icon) { 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); thdata[i].altxpm.mask, ShapeUnion);
} else { } 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); thdata[i].altxpm.mask, ShapeUnion);
} }
} }
} else { } else {
if (!th_no_icon_window) { 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); 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); thdata[i].xpm.mask, ShapeUnion);
} else { } else {
if (thdata[i].icon) { 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); thdata[i].xpm.mask, ShapeUnion);
} else { } 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); thdata[i].xpm.mask, ShapeUnion);
} }
} }
@ -982,15 +982,15 @@ void fak_maskset()
if (debug) fprintf(stderr, "** Setting pixmaps mask\n"); if (debug) fprintf(stderr, "** Setting pixmaps mask\n");
if (debug) fprintf(stderr, "-> background\n"); if (debug) fprintf(stderr, "-> background\n");
XShapeCombineMask(Disp, Win, ShapeBounding, 0, 0, XShapeCombineMask(Disp, Win, ShapeBounding, 0, 0,
backXPM.mask, ShapeSet); backXPM.mask, ShapeSet);
if (!th_no_icon_window) { if (!th_no_icon_window) {
XShapeCombineMask(Disp, Iconwin, ShapeBounding, 0, 0, XShapeCombineMask(Disp, Iconwin, ShapeBounding, 0, 0,
backXPM.mask, ShapeSet); backXPM.mask, ShapeSet);
} else { } else {
if (strlen(th_icon_window) > 0) { if (strlen(th_icon_window) > 0) {
XShapeCombineMask(Disp, Iconwin, ShapeBounding, 0, 0, XShapeCombineMask(Disp, Iconwin, ShapeBounding, 0, 0,
iconXPM.mask, ShapeSet); iconXPM.mask, ShapeSet);
} }
} }
@ -1001,31 +1001,31 @@ void fak_maskset()
if (debug) fprintf(stderr, "%d ", i); if (debug) fprintf(stderr, "%d ", i);
if ((fak_use_alt(i)) && (strlen(thdata[i].altxpm_file) > 0)) { if ((fak_use_alt(i)) && (strlen(thdata[i].altxpm_file) > 0)) {
if (!th_no_icon_window) { 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); 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); thdata[i].altxpm.mask, ShapeUnion);
} else { } else {
if (thdata[i].icon) { 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); thdata[i].altxpm.mask, ShapeUnion);
} else { } 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); thdata[i].altxpm.mask, ShapeUnion);
} }
} }
} else { } else {
if (!th_no_icon_window) { 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); 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); thdata[i].xpm.mask, ShapeUnion);
} else { } else {
if (thdata[i].icon) { 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); thdata[i].xpm.mask, ShapeUnion);
} else { } 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); thdata[i].xpm.mask, ShapeUnion);
} }
} }
@ -1061,7 +1061,7 @@ void fak_redraw()
/* ============================================================== */ /* ============================================================== */
if (debug) fprintf(stderr, "** Entering redraw routine\n"); if (debug) fprintf(stderr, "** Entering redraw routine\n");
if (!blind_mode) { if (!blind_mode) {
if ((cur_cdmode == WM_CDM_PLAYING) || (wanna_play)) wm_cd_status(); if ((cur_cdmode == WM_CDM_PLAYING) || (wanna_play)) wm_cd_status();
} }
@ -1089,7 +1089,7 @@ void fak_redraw()
cur_track = 0; cur_track = 0;
redraw = TRUE; redraw = TRUE;
fak_maskset(); 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 as last time, we simply exit the redraw function
====================================================================== */ ====================================================================== */
@ -1146,7 +1146,7 @@ void fak_redraw()
/* draw the text if we have a query */ /* 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 we skip the text! It will be displayed next time
the function is called... 0.13 */ the function is called... 0.13 */
@ -1157,13 +1157,13 @@ void fak_redraw()
fak_text("", MSG_PANEL, 0, FALSE); fak_text("", MSG_PANEL, 0, FALSE);
fak_text(led_text, MSG_PANEL, 0, FALSE); fak_text(led_text, MSG_PANEL, 0, FALSE);
} }
if (time(NULL) - text_start > text_timeout) { if (time(NULL) - text_start > text_timeout) {
text_start = 0; text_start = 0;
redraw = TRUE; redraw = TRUE;
strcpy(led_text, ""); strcpy(led_text, "");
fak_text("", MSG_PANEL, 0, FALSE); fak_text("", MSG_PANEL, 0, FALSE);
} else { } else {
if (!fade_out) return; if (!fade_out) return;
} }
} }
@ -1201,43 +1201,43 @@ void fak_redraw()
} }
} }
} }
/* the buttons: */ /* the buttons: */
for (i = 1; i <= but_max; i++) { for (i = 1; i <= but_max; i++) {
use_alt = FALSE; use_alt = FALSE;
if ((thdata[i].panel == panel) || (thdata[i].panel == 0)) { if ((thdata[i].panel == panel) || (thdata[i].panel == 0)) {
if (thdata[i].type == FAK_VCD_BAR) { if (thdata[i].type == FAK_VCD_BAR) {
if ( (cur_cdmode != WM_CDM_STOPPED) && (cur_cdmode != WM_CDM_EJECTED) ) { if ( (cur_cdmode != WM_CDM_STOPPED) && (cur_cdmode != WM_CDM_EJECTED) ) {
if ((time_mode == 2) || (time_mode == 3)) { if ((time_mode == 2) || (time_mode == 3)) {
if (cur_cdlen > 0) { if (cur_cdlen > 0) {
XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0, XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0,
thdata[i].xpm.attributes.width, thdata[i].xpm.attributes.width,
0 + (int)((float)cur_pos_abs / (float)cur_cdlen * (float)thdata[i].xpm.attributes.height), 0 + (int)((float)cur_pos_abs / (float)cur_cdlen * (float)thdata[i].xpm.attributes.height),
thdata[i].x, thdata[i].x,
thdata[i].y); thdata[i].y);
if (!th_no_icon_window) { if (!th_no_icon_window) {
XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0, XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0,
thdata[i].xpm.attributes.width, thdata[i].xpm.attributes.width,
0 + (int)((float)cur_pos_abs / (float)cur_cdlen * (float)thdata[i].xpm.attributes.height), 0 + (int)((float)cur_pos_abs / (float)cur_cdlen * (float)thdata[i].xpm.attributes.height),
thdata[i].x, thdata[i].x,
thdata[i].y); thdata[i].y);
} }
} }
} else { } else {
if (cur_tracklen > 0) { if (cur_tracklen > 0) {
XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0, XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0,
thdata[i].xpm.attributes.width, thdata[i].xpm.attributes.width,
0 + (int)((float)cur_pos_rel / (float)cur_tracklen * (float)thdata[i].xpm.attributes.height), 0 + (int)((float)cur_pos_rel / (float)cur_tracklen * (float)thdata[i].xpm.attributes.height),
thdata[i].x, thdata[i].x,
thdata[i].y); thdata[i].y);
if (!th_no_icon_window) { if (!th_no_icon_window) {
XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0, XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0,
thdata[i].xpm.attributes.width, thdata[i].xpm.attributes.width,
0 + (int)((float)cur_pos_rel / (float)cur_tracklen * (float)thdata[i].xpm.attributes.height), 0 + (int)((float)cur_pos_rel / (float)cur_tracklen * (float)thdata[i].xpm.attributes.height),
thdata[i].x, thdata[i].x,
thdata[i].y); 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 = (int)((float)cur_pos_abs / (float)cur_cdlen * (float)thdata[i].xpm.attributes.height);
offset = thdata[i].xpm.attributes.height - offset; offset = thdata[i].xpm.attributes.height - offset;
XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0, XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0,
thdata[i].xpm.attributes.width, thdata[i].xpm.attributes.width,
thdata[i].xpm.attributes.height - offset, thdata[i].xpm.attributes.height - offset,
thdata[i].x, thdata[i].x,
thdata[i].y +offset); thdata[i].y +offset);
if (!th_no_icon_window) { if (!th_no_icon_window) {
XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0, XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0,
thdata[i].xpm.attributes.width, thdata[i].xpm.attributes.width,
thdata[i].xpm.attributes.height - offset, thdata[i].xpm.attributes.height - offset,
thdata[i].x, thdata[i].x,
thdata[i].y +offset); 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 = (int)((float)cur_pos_rel / (float)cur_tracklen * (float)thdata[i].xpm.attributes.height);
offset = thdata[i].xpm.attributes.height - offset; offset = thdata[i].xpm.attributes.height - offset;
XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0, XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0,
thdata[i].xpm.attributes.width, thdata[i].xpm.attributes.width,
thdata[i].xpm.attributes.height - offset, thdata[i].xpm.attributes.height - offset,
thdata[i].x, thdata[i].x,
thdata[i].y +offset); thdata[i].y +offset);
if (!th_no_icon_window) { if (!th_no_icon_window) {
XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0, XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0,
thdata[i].xpm.attributes.width, thdata[i].xpm.attributes.width,
thdata[i].xpm.attributes.height - offset, thdata[i].xpm.attributes.height - offset,
thdata[i].x, thdata[i].x,
thdata[i].y +offset); thdata[i].y +offset);
} }
} }
@ -1291,23 +1291,23 @@ void fak_redraw()
if ( (cur_cdmode != WM_CDM_STOPPED) && (cur_cdmode != WM_CDM_EJECTED) ) { if ( (cur_cdmode != WM_CDM_STOPPED) && (cur_cdmode != WM_CDM_EJECTED) ) {
if ((time_mode == 2) || (time_mode == 3)) { if ((time_mode == 2) || (time_mode == 3)) {
if (cur_cdlen > 0) { if (cur_cdlen > 0) {
XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 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), 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); thdata[i].xpm.attributes.height, thdata[i].x, thdata[i].y);
if (!th_no_icon_window) { if (!th_no_icon_window) {
XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0, 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), 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); thdata[i].xpm.attributes.height, thdata[i].x, thdata[i].y);
} }
} }
} else { } else {
if (cur_tracklen > 0) { if (cur_tracklen > 0) {
XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 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), 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); thdata[i].xpm.attributes.height, thdata[i].x, thdata[i].y);
if (!th_no_icon_window) { if (!th_no_icon_window) {
XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0, 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), 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); thdata[i].xpm.attributes.height, thdata[i].x, thdata[i].y);
} }
} }
@ -1320,17 +1320,17 @@ void fak_redraw()
/* erase the old position : */ /* erase the old position : */
if (thdata[i].ox > 0) { if (thdata[i].ox > 0) {
XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC,
0, thdata[i].oy, 0, thdata[i].oy,
thdata[i].altxpm.attributes.width, thdata[i].altxpm.attributes.height, thdata[i].altxpm.attributes.width, thdata[i].altxpm.attributes.height,
thdata[i].x, thdata[i].x,
thdata[i].oy + thdata[i].y); thdata[i].oy + thdata[i].y);
if (!th_no_icon_window) { 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, 0, thdata[i].oy,
thdata[i].altxpm.attributes.width, thdata[i].altxpm.attributes.height, thdata[i].altxpm.attributes.width, thdata[i].altxpm.attributes.height,
thdata[i].x, thdata[i].x,
thdata[i].oy + thdata[i].y); thdata[i].oy + thdata[i].y);
} }
} }
@ -1345,17 +1345,17 @@ void fak_redraw()
/* and show it: */ /* and show it: */
XCopyArea(Disp, thdata[i].altxpm.pixmap, Win, WinGC, XCopyArea(Disp, thdata[i].altxpm.pixmap, Win, WinGC,
0, 0, 0, 0,
thdata[i].altxpm.attributes.width, thdata[i].altxpm.attributes.height, thdata[i].altxpm.attributes.width, thdata[i].altxpm.attributes.height,
thdata[i].x, thdata[i].x,
thdata[i].y + fx); thdata[i].y + fx);
if (!th_no_icon_window) { if (!th_no_icon_window) {
XCopyArea(Disp, thdata[i].altxpm.pixmap, Iconwin, WinGC, XCopyArea(Disp, thdata[i].altxpm.pixmap, Iconwin, WinGC,
0, 0, 0, 0,
thdata[i].altxpm.attributes.width, thdata[i].altxpm.attributes.height, thdata[i].altxpm.attributes.width, thdata[i].altxpm.attributes.height,
thdata[i].x, thdata[i].x,
thdata[i].y + fx); thdata[i].y + fx);
} }
@ -1367,17 +1367,17 @@ void fak_redraw()
/* erase the old position : */ /* erase the old position : */
if (thdata[i].ox > 0) { if (thdata[i].ox > 0) {
XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC,
thdata[i].ox, 0, thdata[i].ox, 0,
thdata[i].altxpm.attributes.width, thdata[i].altxpm.attributes.height, 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); thdata[i].y);
if (!th_no_icon_window) { if (!th_no_icon_window) {
XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC,
thdata[i].ox, 0, thdata[i].ox, 0,
thdata[i].altxpm.attributes.width, thdata[i].altxpm.attributes.height, 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); thdata[i].y);
} }
} }
@ -1392,17 +1392,17 @@ void fak_redraw()
/* and show it: */ /* and show it: */
XCopyArea(Disp, thdata[i].altxpm.pixmap, Win, WinGC, XCopyArea(Disp, thdata[i].altxpm.pixmap, Win, WinGC,
0, 0, 0, 0,
thdata[i].altxpm.attributes.width, thdata[i].altxpm.attributes.height, thdata[i].altxpm.attributes.width, thdata[i].altxpm.attributes.height,
thdata[i].x + fx, thdata[i].x + fx,
thdata[i].y); thdata[i].y);
if (!th_no_icon_window) { if (!th_no_icon_window) {
XCopyArea(Disp, thdata[i].altxpm.pixmap, Iconwin, WinGC, XCopyArea(Disp, thdata[i].altxpm.pixmap, Iconwin, WinGC,
0, 0, 0, 0,
thdata[i].altxpm.attributes.width, thdata[i].altxpm.attributes.height, thdata[i].altxpm.attributes.width, thdata[i].altxpm.attributes.height,
thdata[i].x + fx, thdata[i].x + fx,
thdata[i].y); thdata[i].y);
} }
@ -1411,12 +1411,12 @@ void fak_redraw()
} }
} else if (thdata[i].type == FAK_VOL_BAR) { } else if (thdata[i].type == FAK_VOL_BAR) {
if ( (cur_cdmode != WM_CDM_STOPPED) && (cur_cdmode != WM_CDM_EJECTED) ) { if ( (cur_cdmode != WM_CDM_STOPPED) && (cur_cdmode != WM_CDM_EJECTED) ) {
XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0, XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0,
0 + (int)((float)volume / (float)max_volume * (float)thdata[i].xpm.attributes.width), 0 + (int)((float)volume / (float)max_volume * (float)thdata[i].xpm.attributes.width),
thdata[i].xpm.attributes.height, thdata[i].x, thdata[i].y); thdata[i].xpm.attributes.height, thdata[i].x, thdata[i].y);
if (!th_no_icon_window) { if (!th_no_icon_window) {
XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0, XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0,
0 + (int)((float)volume / (float)max_volume * (float)thdata[i].xpm.attributes.width), 0 + (int)((float)volume / (float)max_volume * (float)thdata[i].xpm.attributes.width),
thdata[i].xpm.attributes.height, thdata[i].x, thdata[i].y); thdata[i].xpm.attributes.height, thdata[i].x, thdata[i].y);
} }
} }
@ -1426,17 +1426,17 @@ void fak_redraw()
/* first erase the old position : */ /* first erase the old position : */
if (thdata[i].ox > 0) { if (thdata[i].ox > 0) {
XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC,
thdata[i].ox, 0, thdata[i].ox, 0,
thdata[i].altxpm.attributes.width, thdata[i].altxpm.attributes.height, 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); thdata[i].y);
if (!th_no_icon_window) { if (!th_no_icon_window) {
XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC,
thdata[i].ox, 0, thdata[i].ox, 0,
thdata[i].altxpm.attributes.width, thdata[i].altxpm.attributes.height, 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); thdata[i].y);
} }
} }
@ -1450,17 +1450,17 @@ void fak_redraw()
/* and show it: */ /* and show it: */
XCopyArea(Disp, thdata[i].altxpm.pixmap, Win, WinGC, XCopyArea(Disp, thdata[i].altxpm.pixmap, Win, WinGC,
0, 0, 0, 0,
thdata[i].altxpm.attributes.width, thdata[i].altxpm.attributes.height, thdata[i].altxpm.attributes.width, thdata[i].altxpm.attributes.height,
thdata[i].x + fx, thdata[i].x + fx,
thdata[i].y); thdata[i].y);
if (!th_no_icon_window) { if (!th_no_icon_window) {
XCopyArea(Disp, thdata[i].altxpm.pixmap, Iconwin, WinGC, XCopyArea(Disp, thdata[i].altxpm.pixmap, Iconwin, WinGC,
0, 0, 0, 0,
thdata[i].altxpm.attributes.width, thdata[i].altxpm.attributes.height, thdata[i].altxpm.attributes.width, thdata[i].altxpm.attributes.height,
thdata[i].x + fx, thdata[i].x + fx,
thdata[i].y); thdata[i].y);
} }
@ -1469,16 +1469,16 @@ void fak_redraw()
} }
} else if (thdata[i].type == FAK_VVOL_BAR) { } else if (thdata[i].type == FAK_VVOL_BAR) {
if ( (cur_cdmode != WM_CDM_STOPPED) && (cur_cdmode != WM_CDM_EJECTED) ) { if ( (cur_cdmode != WM_CDM_STOPPED) && (cur_cdmode != WM_CDM_EJECTED) ) {
XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0, XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0,
thdata[i].xpm.attributes.width, thdata[i].xpm.attributes.width,
0 + (int)((float)volume / (float)max_volume * (float)thdata[i].xpm.attributes.height), 0 + (int)((float)volume / (float)max_volume * (float)thdata[i].xpm.attributes.height),
thdata[i].x, thdata[i].x,
thdata[i].y); thdata[i].y);
if (!th_no_icon_window) { if (!th_no_icon_window) {
XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0, XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0,
thdata[i].xpm.attributes.width, thdata[i].xpm.attributes.width,
0 + (int)((float)volume / (float)max_volume * (float)thdata[i].xpm.attributes.height), 0 + (int)((float)volume / (float)max_volume * (float)thdata[i].xpm.attributes.height),
thdata[i].x, thdata[i].x,
thdata[i].y); thdata[i].y);
} }
} }
@ -1486,42 +1486,42 @@ void fak_redraw()
if ( (cur_cdmode != WM_CDM_STOPPED) && (cur_cdmode != WM_CDM_EJECTED) ) { 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 = (int)((float)volume / (float)max_volume * (float)thdata[i].xpm.attributes.height);
offset = thdata[i].xpm.attributes.height - offset; offset = thdata[i].xpm.attributes.height - offset;
XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, offset, XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, offset,
thdata[i].xpm.attributes.width, thdata[i].xpm.attributes.width,
thdata[i].xpm.attributes.height - offset, thdata[i].xpm.attributes.height - offset,
thdata[i].x, thdata[i].x,
thdata[i].y +offset); thdata[i].y +offset);
if (!th_no_icon_window) { if (!th_no_icon_window) {
XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, offset, XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, offset,
thdata[i].xpm.attributes.width, thdata[i].xpm.attributes.width,
thdata[i].xpm.attributes.height - offset, thdata[i].xpm.attributes.height - offset,
thdata[i].x, thdata[i].x,
thdata[i].y +offset); thdata[i].y +offset);
} }
} }
} else if (thdata[i].type == FAK_MIXER_BAR) { } else if (thdata[i].type == FAK_MIXER_BAR) {
#ifdef MIXER #ifdef MIXER
XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0, 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), 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); thdata[i].xpm.attributes.height, thdata[i].x, thdata[i].y);
if (!th_no_icon_window) { if (!th_no_icon_window) {
XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0, 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), 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); thdata[i].xpm.attributes.height, thdata[i].x, thdata[i].y);
} }
#endif #endif
} else if (thdata[i].type == FAK_VMIXER_BAR) { } else if (thdata[i].type == FAK_VMIXER_BAR) {
#ifdef MIXER #ifdef MIXER
XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0, XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, 0, 0,
thdata[i].xpm.attributes.width, thdata[i].xpm.attributes.width,
0 + (int)((float)getvol(thdata[i].arg) / 100.0 * (float)thdata[i].xpm.attributes.height), 0 + (int)((float)getvol(thdata[i].arg) / 100.0 * (float)thdata[i].xpm.attributes.height),
thdata[i].x, thdata[i].x,
thdata[i].y); thdata[i].y);
if (!th_no_icon_window) { if (!th_no_icon_window) {
XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0, XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, 0,
thdata[i].xpm.attributes.width, thdata[i].xpm.attributes.width,
0 + (int)((float)getvol(thdata[i].arg) / 100.0 * (float)thdata[i].xpm.attributes.height), 0 + (int)((float)getvol(thdata[i].arg) / 100.0 * (float)thdata[i].xpm.attributes.height),
thdata[i].x, thdata[i].x,
thdata[i].y); thdata[i].y);
} }
#endif #endif
@ -1529,18 +1529,18 @@ void fak_redraw()
#ifdef MIXER #ifdef MIXER
offset = (int)((float)getvol(thdata[i].arg) / 100.0 * (float)thdata[i].xpm.attributes.height); offset = (int)((float)getvol(thdata[i].arg) / 100.0 * (float)thdata[i].xpm.attributes.height);
offset = thdata[i].xpm.attributes.height - offset; offset = thdata[i].xpm.attributes.height - offset;
XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC, XCopyArea(Disp, thdata[i].xpm.pixmap, Win, WinGC,
0, 0,
offset, offset,
thdata[i].xpm.attributes.width, thdata[i].xpm.attributes.width,
thdata[i].xpm.attributes.height - offset, thdata[i].xpm.attributes.height - offset,
thdata[i].x, thdata[i].x,
thdata[i].y + offset); thdata[i].y + offset);
if (!th_no_icon_window) { if (!th_no_icon_window) {
XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, offset, XCopyArea(Disp, thdata[i].xpm.pixmap, Iconwin, WinGC, 0, offset,
thdata[i].xpm.attributes.width, thdata[i].xpm.attributes.width,
thdata[i].xpm.attributes.height - offset, thdata[i].xpm.attributes.height - offset,
thdata[i].x, thdata[i].x,
thdata[i].y + offset); thdata[i].y + offset);
} }
#endif #endif
@ -1549,7 +1549,7 @@ void fak_redraw()
if (strlen(thdata[i].xpm_file) > 0) { if (strlen(thdata[i].xpm_file) > 0) {
if (strlen(thdata[i].altxpm_file) == 0) use_alt = FALSE; if (strlen(thdata[i].altxpm_file) == 0) use_alt = FALSE;
else use_alt = fak_use_alt(i); else use_alt = fak_use_alt(i);
if (use_alt) { if (use_alt) {
if (!th_no_icon_window) { 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); 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; redraw = FALSE;
if (debug) fprintf(stderr, "-> Display [last section]\n"); if (debug) fprintf(stderr, "-> Display [last section]\n");
/* The Track number */ /* The Track number */
@ -1611,7 +1611,7 @@ void fak_redraw()
fak_text("THEME", COUNTER_PANEL, 0, TRUE); fak_text("THEME", COUNTER_PANEL, 0, TRUE);
sprintf(cdtime, "%02d", theme_select); sprintf(cdtime, "%02d", theme_select);
fak_text(cdtime, TRACK_PANEL, 0, FALSE); fak_text(cdtime, TRACK_PANEL, 0, FALSE);
i = 0; i = 0;
sprintf(txt, "%s/Themes", THDIR); sprintf(txt, "%s/Themes", THDIR);

View file

@ -3,9 +3,9 @@ extern char *tes_xgets(char *, int , FILE *);
extern int fak_parse_line(char *, char *, char *); extern int fak_parse_line(char *, char *, char *);
extern int fak_use_alt(int); extern int fak_use_alt(int);
extern void fak_validate_pixmap(char *, char *); extern void fak_validate_pixmap(char *, char *);
extern void fak_init_theme(int); extern void fak_init_theme(int);
extern int fak_load_theme(char *, int); extern int fak_load_theme(char *, int);
extern void fak_icon_text(char *, unsigned int, unsigned int, unsigned 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 void fak_text(char *, unsigned int, unsigned int, unsigned int);
extern int fak_flush_expose(Window); extern int fak_flush_expose(Window);
extern void fak_minus(void); extern void fak_minus(void);

View file

@ -24,16 +24,16 @@
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL DENIS BOUREZ, ROB MALDA OR CONTRIBUTORS BE * ARE DISCLAIMED. IN NO EVENT SHALL DENIS BOUREZ, ROB MALDA OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * 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 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* =========================================================================== * ===========================================================================
*/ */
#include "ext.h" #include "ext.h"
#include "faktory_prot.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++; while((dir_pt = readdir(dir_fd)) != NULL) if (dir_pt->d_name[0] != '.') theme_select_nbr++;
closedir(dir_fd); closedir(dir_fd);
} }
sprintf(txt, "%s/Themes", THDIR); sprintf(txt, "%s/Themes", THDIR);
if ((dir_fd = opendir(txt)) != NULL) { if ((dir_fd = opendir(txt)) != NULL) {
i = 0; i = 0;
@ -290,7 +290,7 @@ void cd_event_handle(int event, XEvent Event)
newtext("Eject"); newtext("Eject");
cd_control(EJECT); cd_control(EJECT);
redraw = TRUE; redraw = TRUE;
fak_redraw(); fak_redraw();
break; break;
case FAK_CD_EJECTQUIT: case FAK_CD_EJECTQUIT:
fast_track = 0; fast_track = 0;
@ -325,9 +325,9 @@ void cd_event_handle(int event, XEvent Event)
/* Direct Access: /* Direct Access:
we have to compute the offset to pass it to cd_control. We also have to 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 */ check if we want to move inside the current track or in the whole CD */
if (cur_track < 1) cur_track = 1; if (cur_track < 1) cur_track = 1;
if ((time_mode == 2) || (time_mode == 3)) { if ((time_mode == 2) || (time_mode == 3)) {
if ((thdata[but_current].type == FAK_CD_BAR) || (thdata[but_current].type == FAK_CD_PIX)) { 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); direct_access = (int)((float)(Event.xbutton.x - thdata[but_current].x) / (float)thdata[but_current].xpm.attributes.width * (float)cur_cdlen);

View file

@ -24,12 +24,12 @@
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL DENIS BOUREZ, ROB MALDA OR CONTRIBUTORS BE * ARE DISCLAIMED. IN NO EVENT SHALL DENIS BOUREZ, ROB MALDA OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * 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 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* =========================================================================== * ===========================================================================
*/ */
@ -105,7 +105,7 @@ void save_rc_file()
fprintf(out, "#### generated by AScd version %s ####\n", VERSION); fprintf(out, "#### generated by AScd version %s ####\n", VERSION);
#ifndef NO_D_DEVICE #ifndef NO_D_DEVICE
fprintf(out, "CD_DEVICE=%s\n", cd_device); fprintf(out, "CD_DEVICE=%s\n", cd_device);
#endif #endif
fprintf(out, "THEME=%s\n", theme); fprintf(out, "THEME=%s\n", theme);
fprintf(out, "VISU=%s\n", xv); fprintf(out, "VISU=%s\n", xv);
fprintf(out, "AUTOREPEAT=%d\n", autorepeat); 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); fprintf(stderr, "ascd %s ", VERSION);
#ifdef WMK #ifdef WMK
@ -183,14 +183,14 @@ void command_line_help()
fprintf(stderr, "-debug Enable debug (verbose) messages on stderr\n"); fprintf(stderr, "-debug Enable debug (verbose) messages on stderr\n");
fprintf(stderr, "-save Save settings and exit. Should be *last* command.\n\n"); fprintf(stderr, "-save Save settings and exit. Should be *last* command.\n\n");
exit(0); exit(0);
} }
void command_line_err() void command_line_err()
{ {
fprintf(stderr, "ascd: bad command line syntax.\n"); fprintf(stderr, "ascd: bad command line syntax.\n");
fprintf(stderr, "Type 'ascd -help' for a list of command line options.\n"); fprintf(stderr, "Type 'ascd -help' for a list of command line options.\n");
exit(-1); exit(-1);
} }
void themes_help() void themes_help()
{ {
@ -269,7 +269,7 @@ void command_line_parse(int argc, char *argv[]) {
if(++i >= argc) command_line_err(); if(++i >= argc) command_line_err();
Geometry = argv[i]; Geometry = argv[i];
} }
else if ((strcmp(Argument + 1, "d") == 0) || (strcmp(Argument + 1, "device") == 0)) { else if ((strcmp(Argument + 1, "d") == 0) || (strcmp(Argument + 1, "device") == 0)) {
if(++i >= argc) command_line_err(); if(++i >= argc) command_line_err();
cd_device = malloc(strlen(argv[i]) + 1); cd_device = malloc(strlen(argv[i]) + 1);
@ -402,8 +402,8 @@ void command_line_parse(int argc, char *argv[]) {
} }
} }
} }
void quick_reference(int nbr) void quick_reference(int nbr)
{ {

View file

@ -24,16 +24,16 @@
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL DENIS BOUREZ, ROB MALDA OR CONTRIBUTORS BE * ARE DISCLAIMED. IN NO EVENT SHALL DENIS BOUREZ, ROB MALDA OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * 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 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* =========================================================================== * ===========================================================================
*/ */
#include "ext.h" #include "ext.h"
#ifdef MIXER #ifdef MIXER

View file

@ -24,12 +24,12 @@
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL DENIS BOUREZ, ROB MALDA OR CONTRIBUTORS BE * ARE DISCLAIMED. IN NO EVENT SHALL DENIS BOUREZ, ROB MALDA OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * 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 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* =========================================================================== * ===========================================================================
*/ */
@ -64,7 +64,7 @@ void close_dbwin(WMWidget *self, void *data) {
strcpy(cd->cdname, WMGetTextFieldText(db_title)); strcpy(cd->cdname, WMGetTextFieldText(db_title));
if (strlen(WMGetTextFieldText(db_track)) > 0) { if (strlen(WMGetTextFieldText(db_track)) > 0) {
cd->trk[db_curtrack - 1].songname = malloc(strlen(WMGetTextFieldText(db_track)) + 1); 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(); save();
@ -76,19 +76,19 @@ void close_dbwin(WMWidget *self, void *data) {
} else { } else {
strcpy(txt, "unknown artist"); strcpy(txt, "unknown artist");
} }
strcat(txt, "\n"); strcat(txt, "\n");
if (cd->cdname != NULL) { if (cd->cdname != NULL) {
strcpy(txt2, cd->cdname); strcpy(txt2, cd->cdname);
if (strcmp(txt2, "") == 0) strcpy(txt2, "unknown album"); if (strcmp(txt2, "") == 0) strcpy(txt2, "unknown album");
} else { } else {
strcpy(txt2, "unknown album"); strcpy(txt2, "unknown album");
} }
strcat(txt, txt2); strcat(txt, txt2);
WMSetButtonText(b_title, txt); WMSetButtonText(b_title, txt);
db_en_vue = FALSE; db_en_vue = FALSE;
} }
@ -424,8 +424,8 @@ void db_prev_cb(WMWidget *self, void *data) {
WMSetButtonSelected(db_avoid, TRUE); WMSetButtonSelected(db_avoid, TRUE);
} else { } else {
WMSetButtonSelected(db_avoid, FALSE); WMSetButtonSelected(db_avoid, FALSE);
} }
WMRealizeWidget(dbwin); WMRealizeWidget(dbwin);
} }
@ -460,7 +460,7 @@ void db_next_cb(WMWidget *self, void *data) {
} else { } else {
WMSetButtonSelected(db_avoid, FALSE); WMSetButtonSelected(db_avoid, FALSE);
} }
WMRealizeWidget(dbwin); WMRealizeWidget(dbwin);
} }
@ -682,7 +682,7 @@ void create_big_window(WMScreen *scr) {
WMSetPopUpButtonPullsDown(pop, True); WMSetPopUpButtonPullsDown(pop, True);
WMSetPopUpButtonText(pop, "Tracks"); WMSetPopUpButtonText(pop, "Tracks");
WMAddPopUpButtonItem(pop, "1"); WMAddPopUpButtonItem(pop, "1");
WMSetPopUpButtonAction(pop, track_select, NULL); WMSetPopUpButtonAction(pop, track_select, NULL);
fr = WMCreateFrame(win); fr = WMCreateFrame(win);
WMMoveWidget(fr, 10, 75); WMMoveWidget(fr, 10, 75);
@ -750,7 +750,7 @@ void create_big_window(WMScreen *scr) {
WMMoveWidget(pop2, 140, 185); WMMoveWidget(pop2, 140, 185);
WMSetPopUpButtonText(pop2, theme); WMSetPopUpButtonText(pop2, theme);
WMAddPopUpButtonItem(pop2, "1"); WMAddPopUpButtonItem(pop2, "1");
WMSetPopUpButtonAction(pop2, theme_pick, NULL); WMSetPopUpButtonAction(pop2, theme_pick, NULL);
b_help = WMCreateButton(win, 0); b_help = WMCreateButton(win, 0);
WMResizeWidget(b_help, 80, 18); WMResizeWidget(b_help, 80, 18);
@ -887,7 +887,7 @@ void update_track() {
} else { } else {
strcpy(txt, "unknown artist"); strcpy(txt, "unknown artist");
} }
strcat(txt, "\n"); strcat(txt, "\n");
if (cd->cdname != NULL) { if (cd->cdname != NULL) {
@ -911,7 +911,7 @@ void update_track() {
} }
pistes = cur_ntracks; pistes = cur_ntracks;
if (cur_track >= 1) { if (cur_track >= 1) {
if (cd->trk[cur_track - 1].songname != NULL) { if (cd->trk[cur_track - 1].songname != NULL) {
sprintf(txt, "%s", cd->trk[cur_track - 1].songname); sprintf(txt, "%s", cd->trk[cur_track - 1].songname);
@ -955,7 +955,7 @@ void big_window(WMScreen *scr) {
WMSetTextFieldText(b_mutedvol, txt); WMSetTextFieldText(b_mutedvol, txt);
WMSetTextFieldText(b_device, cd_device); WMSetTextFieldText(b_device, cd_device);
WMSetSliderMinValue(b_volume, min_volume); WMSetSliderMinValue(b_volume, min_volume);
WMSetSliderMaxValue(b_volume, max_volume); WMSetSliderMaxValue(b_volume, max_volume);
WMSetSliderValue(b_volume, volume); WMSetSliderValue(b_volume, volume);
@ -970,7 +970,7 @@ void big_window(WMScreen *scr) {
WMRemovePopUpButtonItem(pop2, i); 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! */ stuff from this function as update_track() do the same! */
update_track(); update_track();

View file

@ -7,7 +7,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@ -102,7 +102,7 @@ struct cdda_block {
#endif #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 * In 1998, the WorkMan platforms don't support __PDP_ENDIAN
* architectures. * architectures.
* *
@ -111,7 +111,7 @@ struct cdda_block {
#if !WM_LITTLE_ENDIAN #if !WM_LITTLE_ENDIAN
# if !WM_BIG_ENDIAN # if !WM_BIG_ENDIAN
# error yet unsupported architecture # error yet unsupported architecture
foo bar this is to stop the compiler. foo bar this is to stop the compiler.
# endif # endif
#endif #endif
#endif /* WM_CDDA_H */ #endif /* WM_CDDA_H */

View file

@ -7,7 +7,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public

View file

@ -7,7 +7,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * 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 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* *
* Prototypes from cdinfo.c * Prototypes from cdinfo.c
* *
* This is just one more step to a more modular and understandable code. * This is just one more step to a more modular and understandable code.
*/ */

View file

@ -7,7 +7,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * 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 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* *
* Prototypes from cdrom.c * Prototypes from cdrom.c
* *
* This is just one more step to a more modular and understandable code. * This is just one more step to a more modular and understandable code.
*/ */

View file

@ -7,7 +7,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * 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. * 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 * Don't be surprised, if there are no options for your OS. They aren't
* needed in any case. * needed in any case.
* *
* The default values should produce a functional WorkMan on every * The default values should produce a functional WorkMan on every
* platform. * platform.
* *
@ -72,7 +72,7 @@
#define WORKMAN_NAME "LibWorkMan" #define WORKMAN_NAME "LibWorkMan"
#define WORKMAN_VERSION "1.4.0" #define WORKMAN_VERSION "1.4.0"
/* /*
* If your CD-ROM drive closes its tray if the device is opened, then * 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" * 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 * 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 * probably want this, but it will cause WorkMan to not work on IDE
* drives. * drives.
*/ */
@ -210,7 +210,7 @@
*/ */
/* #define CURVED_VOLUME */ /* #define CURVED_VOLUME */
/* /*
* Uncomment the following if you want to try out a better responding * Uncomment the following if you want to try out a better responding
* WorkMan, especially with IDE drives. This may work with non-IDE * 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. * fstat() should be used, but I'm too dumb to do so.
*/ */
#define BSD_MOUNTTEST #define BSD_MOUNTTEST
#endif /* linux */ #endif /* linux */
@ -353,5 +353,5 @@
#endif /* IBM AIX */ #endif /* IBM AIX */
/******************************************************************/ /******************************************************************/
#endif /* WM_CONFIG_H */ #endif /* WM_CONFIG_H */

View file

@ -7,7 +7,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * 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 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* *
* Prototypes for WorkMan database * Prototypes for WorkMan database
* *
* This is just one more step to a more modular and understandable code. * This is just one more step to a more modular and understandable code.
*/ */
#define WM_DB_SAVE_ERROR 1 #define WM_DB_SAVE_ERROR 1
#define WM_DB_SAVE_DISABLED 2 #define WM_DB_SAVE_DISABLED 2
int wm_db_get_playnew( void ); int wm_db_get_playnew( void );
void split_workmandb( void ); void split_workmandb( void );
int save( void ); int save( void );

View file

@ -7,7 +7,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * 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 * 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 * 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_NONE 0
#define WM_MSG_LEVEL_ERROR 1 #define WM_MSG_LEVEL_ERROR 1
@ -49,7 +49,7 @@
* Message classes. This is somehow a definition of * Message classes. This is somehow a definition of
* the message's source. * the message's source.
*/ */
#define WM_MSG_CLASS_PLATFORM 0x010 #define WM_MSG_CLASS_PLATFORM 0x010
#define WM_MSG_CLASS_SCSI 0x020 #define WM_MSG_CLASS_SCSI 0x020
#define WM_MSG_CLASS_CDROM 0x040 #define WM_MSG_CLASS_CDROM 0x040
@ -66,7 +66,7 @@ extern int wm_lib_verbosity;
#ifdef DEBUG #ifdef DEBUG
#define CHECKPOINT(t) fprintf(stderr, "%s (%d): %s\n", __FILE__, __LINE__, t ); #define CHECKPOINT(t) fprintf(stderr, "%s (%d): %s\n", __FILE__, __LINE__, t );
#else #else
#define CHECKPOINT(t) #define CHECKPOINT(t)
#endif #endif
#ifndef TRUE #ifndef TRUE

View file

@ -7,7 +7,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * 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 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* *
* Prototypes for wm_index.c * Prototypes for wm_index.c
* *
* This is just one more step to a more modular and understandable code. * This is just one more step to a more modular and understandable code.
*/ */

View file

@ -7,7 +7,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * 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 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* *
* The platform interface * The platform interface
* *
* This is just one more step to a more modular and understandable code. * This is just one more step to a more modular and understandable code.
*/ */

View file

@ -7,7 +7,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * 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 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* *
* SCSI prototypes (scsi.c) * SCSI prototypes (scsi.c)
* *
* This is just one more step to a more modular and understandable code. * 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 #define WM_ERR_SCSI_INQUIRY_FAILED -1

View file

@ -7,7 +7,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * 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 -- * Structure for a single track. This is pretty much self-explanatory --
* one of these exists for each track on the current CD. * 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 *songname; /* Name of song, dynamically allocated */
char *otherdb; /* Unrecognized info for this track */ 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, * the total playing time of the playlist (which will usually be overestimated,
* since we don't play leadouts in some cases.) * 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 start; /* Start track, or 0 if end of list */
int end; /* last track plus 1 */ 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 * followed by a zero-terminated list of track numbers to play. The list
* is terminated by a NULL name. * is terminated by a NULL name.
*/ */
struct wm_playlist struct wm_playlist
{ {
char *name; /* Name of this playlist */ char *name; /* Name of this playlist */
int *list; /* List of tracks */ int *list; /* List of tracks */
@ -104,7 +104,7 @@ extern struct wm_cdinfo *cd;
struct wm_playlist *new_list(); struct wm_playlist *new_list();
enum wm_cd_modes enum wm_cd_modes
{ {
WM_CDM_UNKNOWN = -1, WM_CDM_UNKNOWN = -1,
WM_CDM_BACK = 0, WM_CDM_TRACK_DONE = 0, 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. * Drive descriptor structure. Used for access to low-level routines.
*/ */
struct wm_drive struct wm_drive
{ {
int fd; /* File descriptor, if used by platform */ int fd; /* File descriptor, if used by platform */
char vendor[32]; /* Vendor name */ char vendor[32]; /* Vendor name */
@ -126,7 +126,7 @@ struct wm_drive
char revision[32]; /* Revision of the drive */ char revision[32]; /* Revision of the drive */
void *aux; /* Pointer to optional platform-specific info */ void *aux; /* Pointer to optional platform-specific info */
void *daux; /* Pointer to optional drive-specific info */ void *daux; /* Pointer to optional drive-specific info */
int (*init)(); int (*init)();
int (*get_trackcount)(); int (*get_trackcount)();
int (*get_cdlen)(); int (*get_cdlen)();

View file

@ -7,7 +7,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public

View file

@ -7,7 +7,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@ -31,21 +31,21 @@
/* /*
* wm_config should always be included first * wm_config should always be included first
*/ */
#include "wm_config.h" #include "wm_config.h"
#include "workman_defs.h" #include "workman_defs.h"
#ifdef BUILD_CDDA #ifdef BUILD_CDDA
#include "wm_cdda.h" #include "wm_cdda.h"
#endif #endif
#include "wm_cddb.h" #include "wm_cddb.h"
#include "wm_cdinfo.h" #include "wm_cdinfo.h"
#include "wm_cdrom.h" #include "wm_cdrom.h"
#include "wm_database.h" #include "wm_database.h"
#include "wm_helpers.h" #include "wm_helpers.h"
#include "wm_index.h" #include "wm_index.h"
#include "wm_platform.h" #include "wm_platform.h"
#include "wm_scsi.h" #include "wm_scsi.h"
#include "wm_struct.h" #include "wm_struct.h"
#endif /* WORKMAN_H */ #endif /* WORKMAN_H */

View file

@ -7,7 +7,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* 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 * it under the terms of the GNU General Public License as published by
@ -20,7 +20,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* #defined CONSTANTS * #defined CONSTANTS
* *
* Too bad this file seems to be so empty... * Too bad this file seems to be so empty...
* *
*/ */

View file

@ -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 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 writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does. and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's 1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an you conspicuously and appropriately publish on each copy an

View file

@ -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) 1991-1997 by Steven Grimm (original author)
XCOMM (c) by Dirk Försterling (current 'author' = maintainer) XCOMM (c) by Dirk Försterling (current 'author' = maintainer)
XCOMM The maintainer can be contacted by his e-mail address: XCOMM The maintainer can be contacted by his e-mail address:
XCOMM milliByte@DeathsDoor.com XCOMM milliByte@DeathsDoor.com
XCOMM XCOMM
XCOMM This library is free software; you can redistribute it and/or XCOMM This library is free software; you can redistribute it and/or
XCOMM modify it under the terms of the GNU Library General Public XCOMM modify it under the terms of the GNU Library General Public

View file

@ -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) 1991-1997 by Steven Grimm (original author)
XCOMM (c) by Dirk Försterling (current 'author' = maintainer) XCOMM (c) by Dirk Försterling (current 'author' = maintainer)
XCOMM The maintainer can be contacted by his e-mail address: XCOMM The maintainer can be contacted by his e-mail address:
XCOMM milliByte@DeathsDoor.com XCOMM milliByte@DeathsDoor.com
XCOMM XCOMM
XCOMM This library is free software; you can redistribute it and/or XCOMM This library is free software; you can redistribute it and/or
XCOMM modify it under the terms of the GNU Library General Public XCOMM modify it under the terms of the GNU Library General Public
@ -58,8 +58,8 @@ HEADERS= \
include/wm_struct.h \ include/wm_struct.h \
include/wm_version.h \ include/wm_version.h \
include/workman.h \ include/workman.h \
include/workman_defs.h include/workman_defs.h
#include <Library.tmpl> #include <Library.tmpl>

View file

@ -5,7 +5,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * 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 $"; static char buildindex_id[] = "$Id: buildindex.c,v 1.2 1999/02/14 09:50:42 dirk Exp $";
#include <stdio.h> #include <stdio.h>
#include <db.h> #include <db.h>
#include <fcntl.h> #include <fcntl.h>
@ -140,7 +140,7 @@ main(argc, argv)
/* End of file? */ /* End of file? */
if (feof(fp)) if (feof(fp))
break; break;
/* Nope. A read error. Unlink the database. */ /* Nope. A read error. Unlink the database. */
perror(argv[i]); perror(argv[i]);
(void) unlink(indname); (void) unlink(indname);
@ -149,7 +149,7 @@ main(argc, argv)
if (strncmp(buf, "tracks ", 7)) if (strncmp(buf, "tracks ", 7))
continue; continue;
/* /*
* Found the start of a record. Figure out the start * Found the start of a record. Figure out the start
* time of the last track and put an entry in the * time of the last track and put an entry in the

View file

@ -5,7 +5,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@ -45,7 +45,7 @@
#include "config.h" #include "config.h"
#ifdef BUILD_CDDA #ifdef BUILD_CDDA
static char cddaslave_id[] = "$Id: cddaslave.c,v 1.3 1999/02/14 22:10:24 dirk Exp $"; static char cddaslave_id[] = "$Id: cddaslave.c,v 1.3 1999/02/14 22:10:24 dirk Exp $";
#include <stdio.h> #include <stdio.h>
@ -509,7 +509,7 @@ main(argc, argv)
*/ */
continue; continue;
} }
if (playing) if (playing)
{ {
result = wmcdda_read(cd_fd, cddabuf, cddabuflen, result = wmcdda_read(cd_fd, cddabuf, cddabuflen,

View file

@ -5,7 +5,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * 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 backward compatibility this algorithm must not change */
for (i = 0; i < thiscd.ntracks; i++) { for (i = 0; i < thiscd.ntracks; i++) {
n += cddb_sum(thiscd.trk[i].start / 75); n += cddb_sum(thiscd.trk[i].start / 75);
/* /*
* Just for demonstration (See below) * Just for demonstration (See below)
* *
* t += (thiscd.trk[i+1].start / 75) - * t += (thiscd.trk[i+1].start / 75) -
* (thiscd.trk[i ].start / 75); * (thiscd.trk[i ].start / 75);
*/ */
} }
/* /*
@ -174,10 +174,10 @@ void
string_makehello(char *line,char delim) string_makehello(char *line,char delim)
{ {
char mail[84],*host; char mail[84],*host;
strcpy(mail,cddb.mail_adress); strcpy(mail,cddb.mail_adress);
host=string_split(mail,'@'); host=string_split(mail,'@');
sprintf(line,"%shello%c%s%c%s%c%s%c%s", sprintf(line,"%shello%c%s%c%s%c%s%c%s",
delim == ' ' ? "cddb " : "&", delim == ' ' ? "cddb " : "&",
delim == ' ' ? ' ' : '=', delim == ' ' ? ' ' : '=',
@ -197,13 +197,13 @@ connect_open(void)
struct hostent *hp; struct hostent *hp;
struct sockaddr_in soc_in; struct sockaddr_in soc_in;
int port; int port;
if(cddb.protocol == 3) /* http proxy */ if(cddb.protocol == 3) /* http proxy */
host = strdup(cddb.proxy_server); host = strdup(cddb.proxy_server);
else else
host = strdup(cddb.cddb_server); host = strdup(cddb.cddb_server);
/* /*
* t=string_split(host,':'); * t=string_split(host,':');
*/ */
port=atoi(string_split(host,':')); port=atoi(string_split(host,':'));
if(!port) if(!port)
@ -211,7 +211,7 @@ connect_open(void)
printf("%s:%d\n",host,port); printf("%s:%d\n",host,port);
hp =gethostbyname(host); hp =gethostbyname(host);
if (hp == NULL) if (hp == NULL)
{ {
static struct hostent def; static struct hostent def;
@ -219,9 +219,9 @@ connect_open(void)
static char *alist[1]; static char *alist[1];
static char namebuf[128]; static char namebuf[128];
int inet_addr(); int inet_addr();
defaddr.s_addr = inet_addr(host); defaddr.s_addr = inet_addr(host);
if (defaddr.s_addr == -1) if (defaddr.s_addr == -1)
{ {
printf("unknown host: %s\n", host); printf("unknown host: %s\n", host);
return (-1); return (-1);
@ -238,19 +238,19 @@ connect_open(void)
bcopy(hp->h_addr, (char *)&soc_in.sin_addr, hp->h_length); bcopy(hp->h_addr, (char *)&soc_in.sin_addr, hp->h_length);
soc_in.sin_port = htons(port); soc_in.sin_port = htons(port);
Socket = socket(hp->h_addrtype, SOCK_STREAM, 0); Socket = socket(hp->h_addrtype, SOCK_STREAM, 0);
if (Socket < 0) if (Socket < 0)
{ {
perror("socket"); perror("socket");
return (-1); return (-1);
} }
fflush(stdout); 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"); perror("connect");
close(Socket); close(Socket);
return (-1); return (-1);
} }
Connection = fdopen(Socket, "r"); Connection = fdopen(Socket, "r");
return (0); return (0);
} /* connect_open() */ } /* connect_open() */
@ -261,7 +261,7 @@ connect_open(void)
*/ */
void void
connect_close(void) connect_close(void)
{ {
(void)fclose(Connection); (void)fclose(Connection);
close(Socket); close(Socket);
} /* connect_close() */ } /* connect_close() */
@ -273,7 +273,7 @@ void
connect_getline(char *line) connect_getline(char *line)
{ {
char c; char c;
while ((c = getc(Connection)) != '\n') while ((c = getc(Connection)) != '\n')
{ {
*line = c; *line = c;
@ -291,21 +291,21 @@ connect_read_entry(void)
{ {
char type; char type;
int trknr; int trknr;
char *t,*t2,tempbuf[2000]; char *t,*t2,tempbuf[2000];
while(strcmp(tempbuf,".")) while(strcmp(tempbuf,"."))
{ {
connect_getline(tempbuf); connect_getline(tempbuf);
t=string_split(tempbuf,'='); t=string_split(tempbuf,'=');
if(t != NULL) if(t != NULL)
{ {
type=tempbuf[0]; type=tempbuf[0];
if(strncmp("TITLE",tempbuf+1,5)) if(strncmp("TITLE",tempbuf+1,5))
continue; continue;
if('D' == type) if('D' == type)
{ {
/* /*
@ -318,7 +318,7 @@ connect_read_entry(void)
if(*t2 == ' ') if(*t2 == ' ')
t2++; t2++;
strcpy(cd->cdname,t2); strcpy(cd->cdname,t2);
for(t2=t;*t2;t2++) for(t2=t;*t2;t2++)
{ {
if((*t2 == ' ') && (*(t2+1) == 0)) if((*t2 == ' ') && (*(t2+1) == 0))
@ -326,7 +326,7 @@ connect_read_entry(void)
} }
strcpy(cd->artist,t); strcpy(cd->artist,t);
} }
if('T' == type) if('T' == type)
{ {
trknr=atoi(tempbuf+6); trknr=atoi(tempbuf+6);
@ -370,7 +370,7 @@ void
http_send(char* line) http_send(char* line)
{ {
char tempbuf[2000]; char tempbuf[2000];
write(Socket, "GET ", 4); write(Socket, "GET ", 4);
printf("GET "); printf("GET ");
if(cddb.protocol == 3) if(cddb.protocol == 3)
@ -413,18 +413,18 @@ cddb_request(void)
int i; int i;
char tempbuf[2000]; char tempbuf[2000];
extern int cur_ntracks; extern int cur_ntracks;
int status; int status;
char category[20]; char category[20];
unsigned int id; unsigned int id;
strcpy(cddb.cddb_server,"localhost:888"); strcpy(cddb.cddb_server,"localhost:888");
strcpy(cddb.mail_adress,"svolli@bigfoot.com"); strcpy(cddb.mail_adress,"svolli@bigfoot.com");
/* /*
* cddb.protocol = 1; * cddb.protocol = 1;
*/ */
wipe_cdinfo(); wipe_cdinfo();
switch(cddb.protocol) switch(cddb.protocol)
{ {
case 1: /* cddbp */ case 1: /* cddbp */
@ -445,7 +445,7 @@ cddb_request(void)
cddbp_send(tempbuf); cddbp_send(tempbuf);
connect_getline(tempbuf); connect_getline(tempbuf);
printf("[%s]\n",tempbuf); printf("[%s]\n",tempbuf);
printf("query\n"); printf("query\n");
sprintf(tempbuf, "cddb query %08x %d",thiscd.cddbid,thiscd.ntracks); sprintf(tempbuf, "cddb query %08x %d",thiscd.cddbid,thiscd.ntracks);
for (i = 0; i < cur_ntracks; i++) for (i = 0; i < cur_ntracks; i++)
@ -457,7 +457,7 @@ cddb_request(void)
cddbp_send(tempbuf); cddbp_send(tempbuf);
connect_getline(tempbuf); connect_getline(tempbuf);
printf("[%s]\n",tempbuf); printf("[%s]\n",tempbuf);
status=atoi(tempbuf); status=atoi(tempbuf);
/* /*
* fprintf(stderr, "status:%d\n",status); * fprintf(stderr, "status:%d\n",status);
@ -470,7 +470,7 @@ cddb_request(void)
cddbp_read(category,id); cddbp_read(category,id);
connect_read_entry(); connect_read_entry();
} }
if(status == 211) /* Unexact match, multiple possible if(status == 211) /* Unexact match, multiple possible
* Hack: always use first. */ * Hack: always use first. */
{ {
@ -481,7 +481,7 @@ cddb_request(void)
cddbp_read(category,id); cddbp_read(category,id);
connect_read_entry(); connect_read_entry();
} }
cddbp_send("quit"); cddbp_send("quit");
connect_close(); connect_close();
printf("close\n"); printf("close\n");
@ -502,7 +502,7 @@ cddb_request(void)
http_send(tempbuf); http_send(tempbuf);
connect_getline(tempbuf); connect_getline(tempbuf);
printf("[%s]\n",tempbuf); printf("[%s]\n",tempbuf);
status=atoi(tempbuf); status=atoi(tempbuf);
/* /*
* fprintf(stderr, "status:%d\n",status); * fprintf(stderr, "status:%d\n",status);
@ -518,7 +518,7 @@ cddb_request(void)
http_read(category,id); http_read(category,id);
connect_read_entry(); connect_read_entry();
} }
if(status == 211) /* Unexact match, multiple possible if(status == 211) /* Unexact match, multiple possible
* Hack: always use first. */ * Hack: always use first. */
{ {

View file

@ -1,11 +1,11 @@
/* /*
* $Id: cdinfo.c,v 1.6 1999/02/14 16:47:40 dirk Exp $ * $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 * This file is part of WorkMan, the civilized CD player library
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@ -169,7 +169,7 @@ split_trackinfo( int pos )
if (playlist[i].end > num) if (playlist[i].end > num)
playlist[i].end++; playlist[i].end++;
} }
/* Now adjust the information in cd->trk[]. */ /* Now adjust the information in cd->trk[]. */
cd->trk[num].start = pos; cd->trk[num].start = pos;
if (num == cur_ntracks) if (num == cur_ntracks)
@ -194,7 +194,7 @@ split_trackinfo( int pos )
for (i = num + 1; i < cur_ntracks; i++) for (i = num + 1; i < cur_ntracks; i++)
if (cd->trk[i].track == cd->trk[num].track) if (cd->trk[i].track == cd->trk[num].track)
cd->trk[i].section++; cd->trk[i].section++;
return (1); return (1);
} }
@ -214,7 +214,7 @@ remove_trackinfo( int num )
if (num < 1 || num >= cur_ntracks || cd->trk[num].section < 2) if (num < 1 || num >= cur_ntracks || cd->trk[num].section < 2)
return (0); return (0);
cd->trk[num - 1].length += cd->trk[num].length; cd->trk[num - 1].length += cd->trk[num].length;
for (i = num; i < cur_ntracks - 1; i++) for (i = num; i < cur_ntracks - 1; i++)
@ -226,7 +226,7 @@ remove_trackinfo( int num )
cur_firsttrack--; cur_firsttrack--;
if (cur_lasttrack > num) if (cur_lasttrack > num)
cur_lasttrack--; cur_lasttrack--;
/* Update the user-defined playlists. */ /* Update the user-defined playlists. */
if (cd->lists != NULL) if (cd->lists != NULL)
for (l = 0; cd->lists[l].name != NULL; l++) 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++) for (i = 0; cd->lists[l].list[i]; i++)
if (cd->lists[l].list[i] > num) if (cd->lists[l].list[i] > num)
cd->lists[l].list[i]--; cd->lists[l].list[i]--;
/* Update the internal playlist. */ /* Update the internal playlist. */
if (playlist != NULL) if (playlist != NULL)
for (i = 0; playlist[i].start; i++) for (i = 0; playlist[i].start; i++)
@ -244,7 +244,7 @@ remove_trackinfo( int num )
if (playlist[i].end > num) if (playlist[i].end > num)
playlist[i].end--; playlist[i].end--;
} }
cur_ntracks--; cur_ntracks--;
cur_nsections--; cur_nsections--;
@ -297,12 +297,12 @@ listentry( int num )
digits = 2; digits = 2;
sdigits = cur_nsections < 9 ? -1 : -2; sdigits = cur_nsections < 9 ? -1 : -2;
name = cd->trk[num].songname ? cd->trk[num].songname : ""; name = cd->trk[num].songname ? cd->trk[num].songname : "";
if (cur_nsections) if (cur_nsections)
{ {
if (cd->trk[num].section > 9) if (cd->trk[num].section > 9)
{ {
sprintf(tracknum, "%*d.%d", digits, sprintf(tracknum, "%*d.%d", digits,
cd->trk[num].track, cd->trk[num].track,
@ -348,7 +348,7 @@ listentry( int num )
char * char *
trackname( int num ) trackname( int num )
{ {
if (num >= 0 && num < cur_ntracks) if (num >= 0 && num < cur_ntracks)
{ {
if (cd->trk[num].songname) if (cd->trk[num].songname)
{ {
@ -861,7 +861,7 @@ pl_find_track( int track )
cur_lasttrack = playlist[i].end - 1; cur_lasttrack = playlist[i].end - 1;
return; return;
} }
/* /*
* Couldn't find the track in question. Make a special entry with * Couldn't find the track in question. Make a special entry with
* just that track. * just that track.

View file

@ -5,7 +5,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * 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->mod != NULL) && strncmp(d->mod, model, strlen(d->mod)) ) ||
( (d->rev != NULL) && strncmp(d->rev, rev, strlen(d->rev)) ) ) ( (d->rev != NULL) && strncmp(d->rev, rev, strlen(d->rev)) ) )
continue; continue;
if (d->proto->vendor[0] == '\0') if (d->proto->vendor[0] == '\0')
strcpy(d->proto->vendor, vendor); strcpy(d->proto->vendor, vendor);
if (d->proto->model[0] == '\0') if (d->proto->model[0] == '\0')
@ -255,7 +255,7 @@ read_toc()
thiscd.length = thiscd.trk[thiscd.ntracks].length; thiscd.length = thiscd.trk[thiscd.ntracks].length;
thiscd.cddbid = cddb_discid(drive); thiscd.cddbid = cddb_discid(drive);
return (&thiscd); return (&thiscd);
} }
@ -404,13 +404,13 @@ wm_cd_status( void )
break; break;
case WM_CDM_FORWARD: case WM_CDM_FORWARD:
case WM_CDM_EJECTED: case WM_CDM_EJECTED:
break; break;
} }
return (ret); return (ret);
} }
#undef CLIF_VOL #undef CLIF_VOL
#ifdef CLIF_VOL #ifdef CLIF_VOL
/* /*
* cd_volume(vol, bal, max) * 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); /* 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; scale = (vol + 5) / 10;
if (bal < 9) if (bal < 9)
@ -446,7 +446,7 @@ cd_volume(vol, bal, max)
} }
else if (bal > 11) else if (bal > 11)
{ {
#ifdef SYMETRIC_BALANCE #ifdef SYMETRIC_BALANCE
right = vol + scale * (bal - 10); right = vol + scale * (bal - 10);
#else #else
right = vol; right = vol;
@ -536,7 +536,7 @@ wm_cd_pause( void )
wm_cd_play(cur_track, paused_pos, wm_cd_play(cur_track, paused_pos,
playlist[cur_listno-1].end); playlist[cur_listno-1].end);
default: /* */ default: /* */
break; break;
} }
} /* wm_cd_pause() */ } /* wm_cd_pause() */
@ -559,7 +559,7 @@ wm_cd_stop( void )
cur_track = 1; cur_track = 1;
} }
} /* wm_cd_stop() */ } /* wm_cd_stop() */
/* /*
* wm_cd_play_chunk(start, end) * wm_cd_play_chunk(start, end)
* *
@ -641,7 +641,7 @@ wm_cd_eject( void )
return (1); return (1);
} }
} }
if (exit_on_eject) if (exit_on_eject)
exit(0); exit(0);

View file

@ -5,7 +5,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@ -107,7 +107,7 @@ split_workmandb( void )
int ndbs, i; int ndbs, i;
char *home, *wmdb; char *home, *wmdb;
int no_rc = 0, no_db = 0; int no_rc = 0, no_db = 0;
if (rcfile == NULL) if (rcfile == NULL)
{ {
if ((home = getenv("HOME")) != NULL) if ((home = getenv("HOME")) != NULL)
@ -115,7 +115,7 @@ split_workmandb( void )
rcfile = malloc(strlen(home) + sizeof(RCFILE)); rcfile = malloc(strlen(home) + sizeof(RCFILE));
if (rcfile == NULL) if (rcfile == NULL)
{ {
nomem: nomem:
perror("split_workmandb()"); perror("split_workmandb()");
exit(1); exit(1);
@ -149,7 +149,7 @@ nomem:
else else
{ {
static char *emptydb = NULL; static char *emptydb = NULL;
databases = &emptydb; databases = &emptydb;
no_db = 1; no_db = 1;
} }
@ -163,11 +163,11 @@ nomem:
*home = '\0'; *home = '\0';
ndbs++; ndbs++;
} }
databases = malloc((ndbs + 1) * sizeof(databases[0])); databases = malloc((ndbs + 1) * sizeof(databases[0]));
if (databases == NULL) if (databases == NULL)
goto nomem; goto nomem;
for (i = 0; i < ndbs; i++) for (i = 0; i < ndbs; i++)
{ {
databases[i] = wmdb; databases[i] = wmdb;
@ -571,7 +571,7 @@ chomp:
if (scratch != cd->trk[track].start) if (scratch != cd->trk[track].start)
{ {
sizediff = abs(scratch - cd->trk[track].start); sizediff = abs(scratch - cd->trk[track].start);
if (sizediff > fuzz_frames || if (sizediff > fuzz_frames ||
(sizediff && scan)) (sizediff && scan))
break; break;
fudge += sizediff; fudge += sizediff;
@ -615,7 +615,7 @@ chomp:
{ {
getc(fp); getc(fp);
i = getc(fp); /* only first letter is used */ i = getc(fp); /* only first letter is used */
cddb.protocol = i == 'c' ? 1 : cddb.protocol = i == 'c' ? 1 :
i == 'h' ? 2 : 3 ; i == 'h' ? 2 : 3 ;
do do
i = getc(fp); i = getc(fp);
@ -631,7 +631,7 @@ chomp:
while (i != '\n' && i != EOF); while (i != '\n' && i != EOF);
else else
{ {
fgets(cddb.cddb_server, fgets(cddb.cddb_server,
sizeof(cddb.cddb_server), fp); sizeof(cddb.cddb_server), fp);
if ((i = strlen(cddb.cddb_server))) if ((i = strlen(cddb.cddb_server)))
cddb.cddb_server[i - 1] = '\0'; cddb.cddb_server[i - 1] = '\0';
@ -647,7 +647,7 @@ chomp:
while (i != '\n' && i != EOF); while (i != '\n' && i != EOF);
else else
{ {
fgets(cddb.mail_adress, fgets(cddb.mail_adress,
sizeof(cddb.mail_adress), fp); sizeof(cddb.mail_adress), fp);
if ((i = strlen(cddb.mail_adress))) if ((i = strlen(cddb.mail_adress)))
cddb.mail_adress[i - 1] = '\0'; cddb.mail_adress[i - 1] = '\0';
@ -663,7 +663,7 @@ chomp:
while (i != '\n' && i != EOF); while (i != '\n' && i != EOF);
else else
{ {
fgets(cddb.path_to_cgi, fgets(cddb.path_to_cgi,
sizeof(cddb.path_to_cgi), fp); sizeof(cddb.path_to_cgi), fp);
if ((i = strlen(cddb.path_to_cgi))) if ((i = strlen(cddb.path_to_cgi)))
cddb.path_to_cgi[i - 1] = '\0'; cddb.path_to_cgi[i - 1] = '\0';
@ -679,7 +679,7 @@ chomp:
while (i != '\n' && i != EOF); while (i != '\n' && i != EOF);
else else
{ {
fgets(cddb.proxy_server, fgets(cddb.proxy_server,
sizeof(cddb.proxy_server), fp); sizeof(cddb.proxy_server), fp);
if ((i = strlen(cddb.proxy_server))) if ((i = strlen(cddb.proxy_server)))
cddb.proxy_server[i - 1] = '\0'; cddb.proxy_server[i - 1] = '\0';
@ -705,7 +705,7 @@ chomp:
} }
/* If we're searching, skip to the next "tracks" line. */ /* If we're searching, skip to the next "tracks" line. */
else if (((searching & 1)|| scan) else if (((searching & 1)|| scan)
&& !(prefs && firstpos == -1)) && !(prefs && firstpos == -1))
SWALLOW_LINE(fp) SWALLOW_LINE(fp)
@ -759,7 +759,7 @@ chomp:
trackmap[i++] = track++; trackmap[i++] = track++;
else else
trackmap[i++] = -1; trackmap[i++] = -1;
if (track == cur_ntracks) if (track == cur_ntracks)
break; break;
} }
@ -838,7 +838,7 @@ chomp:
/* /*
* nasty bug was here. Was it? BUGBUGBUG * nasty bug was here. Was it? BUGBUGBUG
* *
* wipe_cdinfo(); * wipe_cdinfo();
*/ trackmap = reset_tracks(); */ trackmap = reset_tracks();
getc(fp); /* lose the space */ getc(fp); /* lose the space */
@ -853,11 +853,11 @@ chomp:
{ {
strcpy(cd->cdname, "Probably://"); strcpy(cd->cdname, "Probably://");
fgets(cd->cdname + strlen(cd->cdname), sizeof(cd->cdname), fp); fgets(cd->cdname + strlen(cd->cdname), sizeof(cd->cdname), fp);
} }
else else
{ {
fgets(cd->cdname, sizeof(cd->cdname), fp); fgets(cd->cdname, sizeof(cd->cdname), fp);
} }
if ( (i = strlen(cd->cdname)) ) if ( (i = strlen(cd->cdname)) )
cd->cdname[i - 1] = '\0'; cd->cdname[i - 1] = '\0';
} }
@ -1092,7 +1092,7 @@ load( void )
time(&t1); time(&t1);
printf("%s (%d): search start = %ld\n", __FILE__, __LINE__, t1); printf("%s (%d): search start = %ld\n", __FILE__, __LINE__, t1);
fflush(stdout); fflush(stdout);
} }
#endif #endif
dbfile = databases; dbfile = databases;
@ -1139,7 +1139,7 @@ load( void )
time(&t2); time(&t2);
printf("%s (%d): db search end = %ld, elapsed = %ld\n", __FILE__, __LINE__, t2, t2 - t1); printf("%s (%d): db search end = %ld, elapsed = %ld\n", __FILE__, __LINE__, t2, t2 - t1);
fflush(stdout); fflush(stdout);
} }
#endif #endif
fp = rcfile ? open_rcfile(rcfile, "r") : NULL; fp = rcfile ? open_rcfile(rcfile, "r") : NULL;
@ -1173,7 +1173,7 @@ load( void )
time(&t2); time(&t2);
printf("%s (%d): search end = %ld, elapsed = %ld\n", __FILE__, __LINE__, t2, t2 - t1); printf("%s (%d): search end = %ld, elapsed = %ld\n", __FILE__, __LINE__, t2, t2 - t1);
fflush(stdout); fflush(stdout);
} }
#endif #endif
} /* load() */ } /* load() */
@ -1242,7 +1242,7 @@ save_globals(FILE *fp)
break; break;
} }
wm_strmcat(&globes, temp); wm_strmcat(&globes, temp);
if(cddb.mail_adress[0]) if(cddb.mail_adress[0])
{ {
sprintf(temp,"cddbmailadress %s\n", sprintf(temp,"cddbmailadress %s\n",
@ -1340,7 +1340,7 @@ save_globals(FILE *fp)
wm_strmcat(&cdentry, temp); wm_strmcat(&cdentry, temp);
curpos += strlen(temp); curpos += strlen(temp);
} }
} }
if (cdentry != NULL) if (cdentry != NULL)
{ {

View file

@ -5,7 +5,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@ -128,7 +128,7 @@ unscale_volume(cd_vol, max)
else else
bot = vol + 1; bot = vol + 1;
} }
/* Might have looked down too far for repeated scaled values */ /* Might have looked down too far for repeated scaled values */
if (cd_vol < scaled) if (cd_vol < scaled)
vol++; vol++;

View file

@ -5,7 +5,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@ -123,7 +123,7 @@ unscale_volume(cd_vol, max)
else else
bot = vol + 1; bot = vol + 1;
} }
/* Might have looked down too far for repeated scaled values */ /* Might have looked down too far for repeated scaled values */
if (cd_vol < scaled) if (cd_vol < scaled)
vol++; vol++;

View file

@ -7,7 +7,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@ -102,7 +102,7 @@ struct cdda_block {
#endif #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 * In 1998, the WorkMan platforms don't support __PDP_ENDIAN
* architectures. * architectures.
* *
@ -111,7 +111,7 @@ struct cdda_block {
#if !WM_LITTLE_ENDIAN #if !WM_LITTLE_ENDIAN
# if !WM_BIG_ENDIAN # if !WM_BIG_ENDIAN
# error yet unsupported architecture # error yet unsupported architecture
foo bar this is to stop the compiler. foo bar this is to stop the compiler.
# endif # endif
#endif #endif
#endif /* WM_CDDA_H */ #endif /* WM_CDDA_H */

View file

@ -7,7 +7,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public

View file

@ -7,7 +7,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * 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 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* *
* Prototypes from cdinfo.c * Prototypes from cdinfo.c
* *
* This is just one more step to a more modular and understandable code. * This is just one more step to a more modular and understandable code.
*/ */

View file

@ -7,7 +7,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * 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 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* *
* Prototypes from cdrom.c * Prototypes from cdrom.c
* *
* This is just one more step to a more modular and understandable code. * This is just one more step to a more modular and understandable code.
*/ */

View file

@ -7,7 +7,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * 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. * 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 * Don't be surprised, if there are no options for your OS. They aren't
* needed in any case. * needed in any case.
* *
* The default values should produce a functional WorkMan on every * The default values should produce a functional WorkMan on every
* platform. * platform.
* *
@ -72,7 +72,7 @@
#define WORKMAN_NAME "LibWorkMan" #define WORKMAN_NAME "LibWorkMan"
#define WORKMAN_VERSION "1.4.0" #define WORKMAN_VERSION "1.4.0"
/* /*
* If your CD-ROM drive closes its tray if the device is opened, then * 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" * 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 * 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 * probably want this, but it will cause WorkMan to not work on IDE
* drives. * drives.
*/ */
@ -210,7 +210,7 @@
*/ */
/* #define CURVED_VOLUME */ /* #define CURVED_VOLUME */
/* /*
* Uncomment the following if you want to try out a better responding * Uncomment the following if you want to try out a better responding
* WorkMan, especially with IDE drives. This may work with non-IDE * 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. * fstat() should be used, but I'm too dumb to do so.
*/ */
#define BSD_MOUNTTEST #define BSD_MOUNTTEST
#endif /* linux */ #endif /* linux */
@ -353,5 +353,5 @@
#endif /* IBM AIX */ #endif /* IBM AIX */
/******************************************************************/ /******************************************************************/
#endif /* WM_CONFIG_H */ #endif /* WM_CONFIG_H */

View file

@ -7,7 +7,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * 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 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* *
* Prototypes for WorkMan database * Prototypes for WorkMan database
* *
* This is just one more step to a more modular and understandable code. * This is just one more step to a more modular and understandable code.
*/ */
#define WM_DB_SAVE_ERROR 1 #define WM_DB_SAVE_ERROR 1
#define WM_DB_SAVE_DISABLED 2 #define WM_DB_SAVE_DISABLED 2
int wm_db_get_playnew( void ); int wm_db_get_playnew( void );
void split_workmandb( void ); void split_workmandb( void );
int save( void ); int save( void );

View file

@ -7,7 +7,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * 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 * 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 * 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_NONE 0
#define WM_MSG_LEVEL_ERROR 1 #define WM_MSG_LEVEL_ERROR 1
@ -49,7 +49,7 @@
* Message classes. This is somehow a definition of * Message classes. This is somehow a definition of
* the message's source. * the message's source.
*/ */
#define WM_MSG_CLASS_PLATFORM 0x010 #define WM_MSG_CLASS_PLATFORM 0x010
#define WM_MSG_CLASS_SCSI 0x020 #define WM_MSG_CLASS_SCSI 0x020
#define WM_MSG_CLASS_CDROM 0x040 #define WM_MSG_CLASS_CDROM 0x040
@ -66,7 +66,7 @@ extern int wm_lib_verbosity;
#ifdef DEBUG #ifdef DEBUG
#define CHECKPOINT(t) fprintf(stderr, "%s (%d): %s\n", __FILE__, __LINE__, t ); #define CHECKPOINT(t) fprintf(stderr, "%s (%d): %s\n", __FILE__, __LINE__, t );
#else #else
#define CHECKPOINT(t) #define CHECKPOINT(t)
#endif #endif
#ifndef TRUE #ifndef TRUE

View file

@ -7,7 +7,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * 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 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* *
* Prototypes for wm_index.c * Prototypes for wm_index.c
* *
* This is just one more step to a more modular and understandable code. * This is just one more step to a more modular and understandable code.
*/ */

View file

@ -7,7 +7,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * 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 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* *
* The platform interface * The platform interface
* *
* This is just one more step to a more modular and understandable code. * This is just one more step to a more modular and understandable code.
*/ */

View file

@ -7,7 +7,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * 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 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* *
* SCSI prototypes (scsi.c) * SCSI prototypes (scsi.c)
* *
* This is just one more step to a more modular and understandable code. * 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 #define WM_ERR_SCSI_INQUIRY_FAILED -1

View file

@ -7,7 +7,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * 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 -- * Structure for a single track. This is pretty much self-explanatory --
* one of these exists for each track on the current CD. * 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 *songname; /* Name of song, dynamically allocated */
char *otherdb; /* Unrecognized info for this track */ 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, * the total playing time of the playlist (which will usually be overestimated,
* since we don't play leadouts in some cases.) * 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 start; /* Start track, or 0 if end of list */
int end; /* last track plus 1 */ 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 * followed by a zero-terminated list of track numbers to play. The list
* is terminated by a NULL name. * is terminated by a NULL name.
*/ */
struct wm_playlist struct wm_playlist
{ {
char *name; /* Name of this playlist */ char *name; /* Name of this playlist */
int *list; /* List of tracks */ int *list; /* List of tracks */
@ -104,7 +104,7 @@ extern struct wm_cdinfo *cd;
struct wm_playlist *new_list(); struct wm_playlist *new_list();
enum wm_cd_modes enum wm_cd_modes
{ {
WM_CDM_UNKNOWN = -1, WM_CDM_UNKNOWN = -1,
WM_CDM_BACK = 0, WM_CDM_TRACK_DONE = 0, 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. * Drive descriptor structure. Used for access to low-level routines.
*/ */
struct wm_drive struct wm_drive
{ {
int fd; /* File descriptor, if used by platform */ int fd; /* File descriptor, if used by platform */
char vendor[32]; /* Vendor name */ char vendor[32]; /* Vendor name */
@ -126,7 +126,7 @@ struct wm_drive
char revision[32]; /* Revision of the drive */ char revision[32]; /* Revision of the drive */
void *aux; /* Pointer to optional platform-specific info */ void *aux; /* Pointer to optional platform-specific info */
void *daux; /* Pointer to optional drive-specific info */ void *daux; /* Pointer to optional drive-specific info */
int (*init)(); int (*init)();
int (*get_trackcount)(); int (*get_trackcount)();
int (*get_cdlen)(); int (*get_cdlen)();

View file

@ -7,7 +7,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public

View file

@ -7,7 +7,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@ -31,21 +31,21 @@
/* /*
* wm_config should always be included first * wm_config should always be included first
*/ */
#include "wm_config.h" #include "wm_config.h"
#include "workman_defs.h" #include "workman_defs.h"
#ifdef BUILD_CDDA #ifdef BUILD_CDDA
#include "wm_cdda.h" #include "wm_cdda.h"
#endif #endif
#include "wm_cddb.h" #include "wm_cddb.h"
#include "wm_cdinfo.h" #include "wm_cdinfo.h"
#include "wm_cdrom.h" #include "wm_cdrom.h"
#include "wm_database.h" #include "wm_database.h"
#include "wm_helpers.h" #include "wm_helpers.h"
#include "wm_index.h" #include "wm_index.h"
#include "wm_platform.h" #include "wm_platform.h"
#include "wm_scsi.h" #include "wm_scsi.h"
#include "wm_struct.h" #include "wm_struct.h"
#endif /* WORKMAN_H */ #endif /* WORKMAN_H */

View file

@ -7,7 +7,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* 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 * it under the terms of the GNU General Public License as published by
@ -20,7 +20,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* #defined CONSTANTS * #defined CONSTANTS
* *
* Too bad this file seems to be so empty... * Too bad this file seems to be so empty...
* *
*/ */

View file

@ -1,11 +1,11 @@
/* /*
* $Id: index.c,v 1.2 1999/02/14 09:50:42 dirk Exp $ * $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 * This file is part of WorkMan, the civilized CD player library
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * 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)); dbpos = ntohl(*((unsigned long *) data.data));
if (fseek(text, dbpos, 0)) if (fseek(text, dbpos, 0))
break; break;
fgets(tracksline, sizeof(tracksline), text); fgets(tracksline, sizeof(tracksline), text);
if (strncmp(tracksline, "tracks ", 7)) if (strncmp(tracksline, "tracks ", 7))
break; break;
@ -155,7 +155,7 @@ idx_find_entry( char *file, int ntracks, int *tracks,
break; break;
if (atoi(s) != ntracks) if (atoi(s) != ntracks)
continue; continue;
for (i = 0; i < ntracks; i++) for (i = 0; i < ntracks; i++)
{ {
s = strtok(NULL, " \t"); s = strtok(NULL, " \t");
@ -174,7 +174,7 @@ idx_find_entry( char *file, int ntracks, int *tracks,
val = atoi(s); val = atoi(s);
if (val + fuzz / 75 < len / 75 || val + fuzz / 75 > len / 75) if (val + fuzz / 75 < len / 75 || val + fuzz / 75 > len / 75)
continue; continue;
/* XXX - add to sorted list! */ /* XXX - add to sorted list! */
*pos = dbpos; *pos = dbpos;
(index->close)(index); (index->close)(index);

View file

@ -5,7 +5,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * 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 * 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 ) * Original AIX IDE Code: Cloyce Spradling (xmcd libdi_d/aixioc.c )
* *
* Taken from the ascd distribution. * Taken from the ascd distribution.
@ -64,7 +64,7 @@ int max_volume = 255;
* *
* FUNCTION: * FUNCTION:
* *
* RETURNS: * RETURNS:
*/ */
int gen_init(struct wm_drive *d){ int gen_init(struct wm_drive *d){
@ -79,7 +79,7 @@ int gen_init(struct wm_drive *d){
* RETURNS: * 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; struct cd_audio_cmd cmd;
cmd.audio_cmds = CD_TRK_INFO_AUDIO; cmd.audio_cmds = CD_TRK_INFO_AUDIO;
@ -103,7 +103,7 @@ int gen_get_trackcount(struct wm_drive *d,int *tracks){
* RETURNS: * RETURNS:
*/ */
int gen_get_cdlen(struct wm_drive *d,int *frames){ int gen_get_cdlen(struct wm_drive *d,int *frames){
int tmp; int tmp;
return gen_get_trackinfo(d,LEADOUT,&tmp,frames); 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.msf_flag = 1;
cmd.indexing.track_msf.track = track; cmd.indexing.track_msf.track = track;
if( ioctl(d->fd,DKAUDIO,&cmd) < 0) if( ioctl(d->fd,DKAUDIO,&cmd) < 0)
return -1; return -1;
*startframe = cmd.indexing.track_msf.mins * 60 * 75 + *startframe = cmd.indexing.track_msf.mins * 60 * 75 +
cmd.indexing.track_msf.secs * 75 + cmd.indexing.track_msf.secs * 75 +
cmd.indexing.track_msf.frames; cmd.indexing.track_msf.frames;
@ -148,7 +148,7 @@ int gen_get_drive_status(struct wm_drive *d,
enum wm_cd_modes *mode, enum wm_cd_modes *mode,
int *pos, int *pos,
int *track, int *track,
int *index){ int *index){
struct cd_audio_cmd cmd; struct cd_audio_cmd cmd;
*mode = WM_CDM_EJECTED; *mode = WM_CDM_EJECTED;
@ -216,7 +216,7 @@ int unscale_volume(int vol,int max){
* RETURNS: * 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; struct cd_audio_cmd cmd;
int l,r; int l,r;
@ -239,12 +239,12 @@ int gen_get_volume(struct wm_drive *d,int *left,int *right){
* RETURNS: * 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; struct cd_audio_cmd cmd;
cmd.audio_cmds = CD_SET_VOLUME; cmd.audio_cmds = CD_SET_VOLUME;
cmd.volume_type = CD_VOLUME_CHNLS; cmd.volume_type = CD_VOLUME_CHNLS;
cmd.out_port_0_vol = scale_volume(left,100); cmd.out_port_0_vol = scale_volume(left,100);
cmd.out_port_1_vol = scale_volume(right,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: * RETURNS:
*/ */
int gen_pause(struct wm_drive *d){ int gen_pause(struct wm_drive *d){
struct cd_audio_cmd cmd; struct cd_audio_cmd cmd;
cmd.audio_cmds = CD_PAUSE_AUDIO; cmd.audio_cmds = CD_PAUSE_AUDIO;
return ioctl(d->fd,DKAUDIO,&cmd); return ioctl(d->fd,DKAUDIO,&cmd);
@ -278,7 +278,7 @@ int gen_pause(struct wm_drive *d){
* RETURNS: * RETURNS:
*/ */
int gen_resume(struct wm_drive *d){ int gen_resume(struct wm_drive *d){
struct cd_audio_cmd cmd; struct cd_audio_cmd cmd;
cmd.audio_cmds = CD_RESUME_AUDIO; cmd.audio_cmds = CD_RESUME_AUDIO;
@ -292,7 +292,7 @@ int gen_resume(struct wm_drive *d){
* RETURNS: * RETURNS:
*/ */
int gen_stop(struct wm_drive *d){ int gen_stop(struct wm_drive *d){
struct cd_audio_cmd cmd; struct cd_audio_cmd cmd;
cmd.audio_cmds = CD_STOP_AUDIO; cmd.audio_cmds = CD_STOP_AUDIO;
@ -306,7 +306,7 @@ int gen_stop(struct wm_drive *d){
* RETURNS: * 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; struct cd_audio_cmd cmd;
cmd.audio_cmds = CD_PLAY_AUDIO; cmd.audio_cmds = CD_PLAY_AUDIO;
@ -335,7 +335,7 @@ int gen_play(struct wm_drive *d,int start,int end){
* RETURNS: * RETURNS:
*/ */
int gen_eject(struct wm_drive *d){ int gen_eject(struct wm_drive *d){
return ioctl(d->fd,DKEJECT,NULL); return ioctl(d->fd,DKEJECT,NULL);
} }
@ -408,7 +408,7 @@ int wmcd_open(struct wm_drive *d){
*d = *(find_drive_struct(vendor, model, rev)); *d = *(find_drive_struct(vendor, model, rev));
wm_drive_settype(vendor, model, rev); wm_drive_settype(vendor, model, rev);
d->fd = fd; d->fd = fd;
d->init(d); d->init(d);

View file

@ -5,7 +5,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * 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 #else
/* /*
* this is for glibc 2.x which defines ust structure in * this is for glibc 2.x which defines ust structure in
* ustat.h not stat.h. * ustat.h not stat.h.
*/ */
#ifdef __GLIBC__ #ifdef __GLIBC__
#include <sys/ustat.h> #include <sys/ustat.h>
@ -377,7 +377,7 @@ unscale_volume(int cd_vol, int max)
else else
bot = vol + 1; bot = vol + 1;
} }
if (vol < 0) if (vol < 0)
vol = 0; vol = 0;
else if (vol > max) else if (vol > max)

View file

@ -5,7 +5,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@ -370,15 +370,15 @@ gen_eject( struct wm_drive *d )
return (-3); return (-3);
rval = ioctl(d->fd, CDIOCALLOW); rval = ioctl(d->fd, CDIOCALLOW);
if (rval == 0) if (rval == 0)
rval = ioctl(d->fd, CDIOCEJECT); rval = ioctl(d->fd, CDIOCEJECT);
if (rval == 0) if (rval == 0)
rval = ioctl(d->fd, CDIOCPREVENT); rval = ioctl(d->fd, CDIOCPREVENT);
(void) close(d->fd); (void) close(d->fd);
return rval; return rval;
} }
@ -428,7 +428,7 @@ unscale_volume( int cd_vol, int max )
else else
bot = vol + 1; bot = vol + 1;
} }
if (vol < 0) if (vol < 0)
vol = 0; vol = 0;
else if (vol > max) else if (vol > max)
@ -529,7 +529,7 @@ wmcd_open( struct wm_drive *d )
*d = *(find_drive_struct(vendor, model, rev)); *d = *(find_drive_struct(vendor, model, rev));
wm_drive_settype(vendor, model, rev); wm_drive_settype(vendor, model, rev);
(d->init)(d); (d->init)(d);
d->fd = fd; d->fd = fd;

View file

@ -5,7 +5,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * 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? */ if (d->fd >= 0) /* Device already open? */
return (0); return (0);
if (cd_device == NULL) if (cd_device == NULL)
cd_device = DEFAULT_CD_DEVICE; cd_device = DEFAULT_CD_DEVICE;
@ -317,7 +317,7 @@ wmcd_open( struct wm_drive *d )
wm_scsi_get_drive_type(d, vendor, model, rev); wm_scsi_get_drive_type(d, vendor, model, rev);
*d = *(find_drive_struct(vendor, model, rev)); *d = *(find_drive_struct(vendor, model, rev));
wm_drive_settype(vendor, model, rev); wm_drive_settype(vendor, model, rev);
d->fd = fd; d->fd = fd;
(d->init)(d); (d->init)(d);

View file

@ -5,7 +5,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@ -32,7 +32,7 @@
*/ */
#ifdef sgi #ifdef sgi
static char plat_irix_id[] = "$Id: plat_irix.c,v 1.6 1999/03/07 08:36:40 dirk Exp $"; 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" #include "include/wm_config.h"
@ -440,7 +440,7 @@ wmcd_reopen( struct wm_drive *d )
/*----------------------------------* /*----------------------------------*
* Send a SCSI command out the bus. * Send a SCSI command out the bus.
*----------------------------------*/ *----------------------------------*/
int int
wm_scsi(d, xcdb, cdblen, retbuf, retbuflen, getreply) wm_scsi(d, xcdb, cdblen, retbuf, retbuflen, getreply)
struct wm_drive *d; struct wm_drive *d;
unsigned char *xcdb; unsigned char *xcdb;

View file

@ -5,7 +5,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * 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 max(a,b) ((a) > (b) ? (a) : (b))
#define WM_MSG_CLASS WM_MSG_CLASS_PLATFORM #define WM_MSG_CLASS WM_MSG_CLASS_PLATFORM
#ifdef LINUX_SCSI_PASSTHROUGH #ifdef LINUX_SCSI_PASSTHROUGH
/* this is from <scsi/scsi_ioctl.h> */ /* this is from <scsi/scsi_ioctl.h> */
# define SCSI_IOCTL_SEND_COMMAND 1 # 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)) if (ioctl(d->fd, CDROMREADTOCHDR, &hdr))
return (-1); return (-1);
*tracks = hdr.cdth_trk1; *tracks = hdr.cdth_trk1;
return (0); return (0);
} }
/*---------------------------------------------------------* /*---------------------------------------------------------*
* Get the start time and mode (data or audio) of a track. * 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)) if (ioctl(d->fd, CDROMREADTOCENTRY, &entry))
return (-1); return (-1);
*startframe = entry.cdte_addr.msf.minute * 60 * 75 + *startframe = entry.cdte_addr.msf.minute * 60 * 75 +
entry.cdte_addr.msf.second * 75 + entry.cdte_addr.msf.second * 75 +
entry.cdte_addr.msf.frame; entry.cdte_addr.msf.frame;
*data = entry.cdte_ctrl & CDROM_DATA_TRACK ? 1 : 0; *data = entry.cdte_ctrl & CDROM_DATA_TRACK ? 1 : 0;
return (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++; } 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 #ifdef SBPCD_HACK
static int prevpos = 0; static int prevpos = 0;
#endif #endif
/* If we can't get status, the CD is ejected, so default to that. */ /* If we can't get status, the CD is ejected, so default to that. */
*mode = WM_CDM_EJECTED; *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; *mode = WM_CDM_TRACK_DONE;
} }
} }
prevpos = *pos; prevpos = *pos;
#endif #endif
break; break;
@ -361,10 +361,10 @@ scale_volume( int vol, int max )
{ {
#ifdef CURVED_VOLUME #ifdef CURVED_VOLUME
return ((max * max - (max - vol) * (max - vol)) * return ((max * max - (max - vol) * (max - vol)) *
(max_volume - min_volume) / (max * max) + min_volume); (max_volume - min_volume) / (max * max) + min_volume);
#else #else
return ((vol * (max_volume - min_volume)) / max + min_volume); return ((vol * (max_volume - min_volume)) / max + min_volume);
#endif #endif
} /* scale_volume() */ } /* scale_volume() */
#endif #endif
@ -391,7 +391,7 @@ gen_set_volume( struct wm_drive *d, int left, int right )
perror( "MIXER_WRITE" ); perror( "MIXER_WRITE" );
return ( -1 ); return ( -1 );
} }
return ( 0 ); return ( 0 );
#else #else
/* Adjust the volume to make up for the CD-ROM drive's weirdness. */ /* 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.channel0 = v.channel2 = left < 0 ? 0 : left > 255 ? 255 : left;
v.channel1 = v.channel3 = right < 0 ? 0 : right > 255 ? 255 : right; v.channel1 = v.channel3 = right < 0 ? 0 : right > 255 ? 255 : right;
return (ioctl(d->fd, CDROMVOLCTRL, &v)); 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 #ifndef FAST_IDE
if (ioctl(d->fd, CDROMSTART)) if (ioctl(d->fd, CDROMSTART))
return (-1); return (-1);
#endif #endif
if (ioctl(d->fd, CDROMPLAYMSF, &msf)) if (ioctl(d->fd, CDROMPLAYMSF, &msf))
return (-2); return (-2);
return (0); return (0);
} }
@ -471,7 +471,7 @@ gen_eject(struct wm_drive *d)
struct mntent *mnt; struct mntent *mnt;
FILE *fp; FILE *fp;
#endif #endif
if (fstat(d->fd, &stbuf) != 0) if (fstat(d->fd, &stbuf) != 0)
return (-2); return (-2);
@ -484,7 +484,7 @@ gen_eject(struct wm_drive *d)
* This is the same test as in the WorkBone interface. * This is the same test as in the WorkBone interface.
* I should eliminate it there, because there is no need * I should eliminate it there, because there is no need
* for it in the UI * for it in the UI
*/ */
/* check if drive is mounted (from Mark Buckaway's cdplayer code) */ /* check if drive is mounted (from Mark Buckaway's cdplayer code) */
/* Changed it again (look at XPLAYCD from ???? */ /* Changed it again (look at XPLAYCD from ???? */
/* It's better to check the device name rather than one device is */ /* 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 * (The tray closed just after ejecting because re-opening the
* device causes the tray to close) * device causes the tray to close)
*------------------*/ *------------------*/
#ifdef foobar_one #ifdef foobar_one
extern int intermittent_dev extern int intermittent_dev
/* /*
* Some drives (drivers?) won't recognize a new CD if we leave the * Some drives (drivers?) won't recognize a new CD if we leave the
@ -527,9 +527,9 @@ extern int intermittent_dev
{ {
close(d->fd); close(d->fd);
d->fd = -1; d->fd = -1;
} }
#endif #endif
return (0); return (0);
} /* gen_eject() */ } /* gen_eject() */
@ -634,7 +634,7 @@ gen_get_volume( struct wm_drive *d, int *left, int *right )
*left = *right = -1; *left = *right = -1;
} }
*right = 0x007f & ( vol >> 8 ); *right = 0x007f & ( vol >> 8 );
*left = 0x007f & vol; *left = 0x007f & vol;
#else #else
/* Suns, HPs, Linux, NEWS can't read the volume; oh well */ /* 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 + retbuflen);
} }
else cmdsize += cdblen; else cmdsize += cdblen;
cmd = malloc(cmdsize); cmd = malloc(cmdsize);
if (cmd == NULL) if (cmd == NULL)
return (-1); return (-1);
@ -749,7 +749,7 @@ wm_scsi( struct wm_drive *d, unsigned char *cdb, int cdblen,
memcpy(cmd + 2*sizeof(int), cdb, cdblen); memcpy(cmd + 2*sizeof(int), cdb, cdblen);
if (retbuf && !getreply) if (retbuf && !getreply)
memcpy(cmd + 2*sizeof(int) + cdblen, retbuf, retbuflen); memcpy(cmd + 2*sizeof(int) + cdblen, retbuf, retbuflen);
if (ioctl(d->fd, SCSI_IOCTL_SEND_COMMAND, cmd)) if (ioctl(d->fd, SCSI_IOCTL_SEND_COMMAND, cmd))
{ {
wm_lib_message(WM_MSG_LEVEL_DEBUG|WM_MSG_CLASS, "%s: ioctl() failure\n", __FILE__); 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); free(cmd);
return (-1); return (-1);
} }
if (retbuf && getreply) if (retbuf && getreply)
memcpy(retbuf, cmd + 2*sizeof(int), retbuflen); memcpy(retbuf, cmd + 2*sizeof(int), retbuflen);
@ -781,7 +781,7 @@ wmcd_open( struct wm_drive *d )
static int warned = 0; static int warned = 0;
int retval = 0; int retval = 0;
char vendor[32], model[32], rev[32]; char vendor[32], model[32], rev[32];
if (cd_device == NULL) if (cd_device == NULL)
cd_device = DEFAULT_CD_DEVICE; 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); wm_lib_message(WM_MSG_LEVEL_DEBUG|WM_MSG_CLASS, "wmcd_open(): [device is open (fd=%d)]\n", d->fd);
return (0); return (0);
} }
d->fd = open(cd_device, O_RDONLY | O_NONBLOCK); d->fd = open(cd_device, O_RDONLY | O_NONBLOCK);
if (d->fd < 0) if (d->fd < 0)
{ {
@ -830,7 +830,7 @@ wmcd_open( struct wm_drive *d )
/* Can we figure out the drive type? */ /* Can we figure out the drive type? */
wm_scsi_get_drive_type(d, vendor, model, rev); wm_scsi_get_drive_type(d, vendor, model, rev);
#endif #endif
*d = *(find_drive_struct(vendor, model, rev)); *d = *(find_drive_struct(vendor, model, rev));
wm_drive_settype(vendor, model, rev); wm_drive_settype(vendor, model, rev);
d->fd = fd; d->fd = fd;

View file

@ -5,7 +5,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@ -77,7 +77,7 @@ extern int playing;
static int aufd, aucfd; static int aufd, aucfd;
static int raw_audio = 1; /* Can /dev/audio take 44.1KHz stereo? */ 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 * For fast linear-to-ulaw mapping, we use a lookup table that's generated
* at startup. * at startup.
*/ */
@ -408,7 +408,7 @@ wmaudio_state(struct cdda_block *blk)
#define ZEROTRAP /* turn on the trap as per the MIL-STD */ #define ZEROTRAP /* turn on the trap as per the MIL-STD */
#define BIAS 0x84 /* define the add-in bias for 16 bit samples */ #define BIAS 0x84 /* define the add-in bias for 16 bit samples */
#define CLIP 32635 #define CLIP 32635
unsigned char unsigned char
linear_to_ulaw( sample ) linear_to_ulaw( sample )
int 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}; 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7};
int sign, exponent, mantissa; int sign, exponent, mantissa;
unsigned char ulawbyte; unsigned char ulawbyte;
/* Get the sample into sign-magnitude. */ /* Get the sample into sign-magnitude. */
sign = (sample >> 8) & 0x80; /* set aside the sign */ sign = (sample >> 8) & 0x80; /* set aside the sign */
if ( sign != 0 ) sample = -sample; /* get magnitude */ if ( sign != 0 ) sample = -sample; /* get magnitude */
if ( sample > CLIP ) sample = CLIP; /* clip the magnitude */ if ( sample > CLIP ) sample = CLIP; /* clip the magnitude */
/* Convert from 16 bit linear to ulaw. */ /* Convert from 16 bit linear to ulaw. */
sample = sample + BIAS; sample = sample + BIAS;
exponent = exp_lut[( sample >> 7 ) & 0xFF]; exponent = exp_lut[( sample >> 7 ) & 0xFF];
@ -445,7 +445,7 @@ int sample;
#ifdef ZEROTRAP #ifdef ZEROTRAP
if ( ulawbyte == 0 ) ulawbyte = 0x02; /* optional CCITT trap */ if ( ulawbyte == 0 ) ulawbyte = 0x02; /* optional CCITT trap */
#endif #endif
return ulawbyte; return ulawbyte;
} }

View file

@ -5,7 +5,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@ -26,7 +26,7 @@
*/ */
#include "include/wm_config.h" #include "include/wm_config.h"
#if defined(linux) && defined(BUILD_CDDA) /* { */ #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 $"; 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; int fd;
fd = open(devname, 0); fd = open(devname, 0);
if (fd == -1) if (fd == -1)
fd = open("/dev/rdsk/c0t6d0s2", 0); fd = open("/dev/rdsk/c0t6d0s2", 0);

View file

@ -5,7 +5,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * 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); wm_scsi_get_drive_type(d, vendor, model, rev);
*d = *(find_drive_struct(vendor, model, rev)); *d = *(find_drive_struct(vendor, model, rev));
wm_drive_settype(vendor, model, rev); wm_drive_settype(vendor, model, rev);
d->fd = fd; d->fd = fd;
(d->init)(d); (d->init)(d);

View file

@ -5,7 +5,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * 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 * License along with this library; if not, write to the Free
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* *
* *
* OpenBSD-specific drive control routines. (Based on plat_freebsd.c) * OpenBSD-specific drive control routines. (Based on plat_freebsd.c)
* *
* Michael Shalayeff, 7/24/96 * Michael Shalayeff, 7/24/96
@ -398,7 +398,7 @@ unscale_volume(int cd_vol, int max)
else else
bot = vol + 1; bot = vol + 1;
} }
if (vol < 0) if (vol < 0)
vol = 0; vol = 0;
else if (vol > max) else if (vol > max)
@ -494,7 +494,7 @@ wmcd_open(struct wm_drive *d)
*d = *(find_drive_struct(vendor, model, rev)); *d = *(find_drive_struct(vendor, model, rev));
wm_drive_settype(vendor, model, rev); wm_drive_settype(vendor, model, rev);
(d->init)(d); (d->init)(d);
d->fd = fd; d->fd = fd;

View file

@ -3,7 +3,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@ -475,7 +475,7 @@ unscale_volume(cd_vol, max)
else else
bot = vol + 1; bot = vol + 1;
} }
if (vol < 0) if (vol < 0)
vol = 0; vol = 0;
else if (vol > max) else if (vol > max)

View file

@ -5,7 +5,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * 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)) if (ioctl(d->fd, CDROMREADTOCHDR, &hdr))
return (-1); return (-1);
*tracks = hdr.cdth_trk1; *tracks = hdr.cdth_trk1;
return (0); 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)) if (ioctl(d->fd, CDROMREADTOCENTRY, &entry))
return (-1); return (-1);
*startframe = entry.cdte_addr.msf.minute * 60 * 75 + *startframe = entry.cdte_addr.msf.minute * 60 * 75 +
entry.cdte_addr.msf.second * 75 + entry.cdte_addr.msf.second * 75 +
entry.cdte_addr.msf.frame; entry.cdte_addr.msf.frame;
*data = entry.cdte_ctrl & CDROM_DATA_TRACK ? 1 : 0; *data = entry.cdte_ctrl & CDROM_DATA_TRACK ? 1 : 0;
return (0); return (0);
} }
@ -487,7 +487,7 @@ gen_get_drive_status( struct wm_drive *d,
*mode = WM_CDM_TRACK_DONE; /* waiting for next track. */ *mode = WM_CDM_TRACK_DONE; /* waiting for next track. */
break; break;
default: default:
*mode = WM_CDM_UNKNOWN; *mode = WM_CDM_UNKNOWN;
break; break;
} }
@ -509,7 +509,7 @@ gen_set_volume( struct wm_drive *d, int left, int right )
last_right = right; last_right = right;
thecd = d; thecd = d;
#endif #endif
if (cdda_slave > -1) if (cdda_slave > -1)
{ {
int bal, vol; int bal, vol;
@ -854,13 +854,13 @@ wm_scsi( struct wm_drive *d,
cmd.uscsi_flags = USCSI_ISOLATE | USCSI_SILENT; cmd.uscsi_flags = USCSI_ISOLATE | USCSI_SILENT;
if (getreply) if (getreply)
cmd.uscsi_flags |= USCSI_READ; cmd.uscsi_flags |= USCSI_READ;
if (ioctl(d->fd, USCSICMD, &cmd)) if (ioctl(d->fd, USCSICMD, &cmd))
return (-1); return (-1);
if (cmd.uscsi_status) if (cmd.uscsi_status)
return (-1); return (-1);
return (0); return (0);
} }
#else #else
@ -886,7 +886,7 @@ wmcd_open( struct wm_drive *d )
if (d->fd >= 0) /* Device already open? */ if (d->fd >= 0) /* Device already open? */
return (0); return (0);
d->fd = open(cd_device, 0); d->fd = open(cd_device, 0);
if (d->fd < 0) if (d->fd < 0)
{ {
@ -1050,7 +1050,7 @@ codec_init( void )
ctl_fd = -1; ctl_fd = -1;
return(0); return(0);
} }
if (!(devname = getenv("AUDIODEV"))) devname = "/dev/audio"; if (!(devname = getenv("AUDIODEV"))) devname = "/dev/audio";
ctlname = strcat(strcpy(malloc(strlen(devname) + 4), devname), "ctl"); ctlname = strcat(strcpy(malloc(strlen(devname) + 4), devname), "ctl");
if ((ctl_fd = open(ctlname, O_WRONLY, 0)) < 0) { 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) * now set it up to use it. See audio(7I)
*/ */
AUDIO_INITINFO(&foo); AUDIO_INITINFO(&foo);
foo.record.port = port; foo.record.port = port;
foo.record.balance = foo.play.balance = AUDIO_MID_BALANCE; 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.record.gain = (AUDIO_MAX_GAIN * 80) / 100;
foo.play.gain = (AUDIO_MAX_GAIN * 40) / 100; foo.play.gain = (AUDIO_MAX_GAIN * 40) / 100;
ioctl(ctl_fd, AUDIO_SETINFO, &foo); ioctl(ctl_fd, AUDIO_SETINFO, &foo);
return 0; return 0;
} }
@ -1133,7 +1133,7 @@ static kick_codec( void ) {
* Open the audio device, not the control device. This * Open the audio device, not the control device. This
* will fail if someone else has taken it. * will fail if someone else has taken it.
*/ */
if ((dev_fd = open(devname, O_WRONLY|O_NDELAY, 0)) < 0) { if ((dev_fd = open(devname, O_WRONLY|O_NDELAY, 0)) < 0) {
perror(devname); perror(devname);
return -1; return -1;
@ -1142,13 +1142,13 @@ static kick_codec( void ) {
AUDIO_INITINFO(&foo); AUDIO_INITINFO(&foo);
foo.record.port = port; foo.record.port = port;
foo.monitor_gain = AUDIO_MAX_GAIN; foo.monitor_gain = AUDIO_MAX_GAIN;
/* These can only be set on the real device */ /* These can only be set on the real device */
foo.play.sample_rate = 44100; foo.play.sample_rate = 44100;
foo.play.channels = 2; foo.play.channels = 2;
foo.play.precision = 16; foo.play.precision = 16;
foo.play.encoding = AUDIO_ENCODING_LINEAR; foo.play.encoding = AUDIO_ENCODING_LINEAR;
if ((retval = ioctl(dev_fd, AUDIO_SETINFO, &foo)) < 0) if ((retval = ioctl(dev_fd, AUDIO_SETINFO, &foo)) < 0)
perror(devname); perror(devname);

View file

@ -5,7 +5,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@ -26,7 +26,7 @@
*/ */
#include "include/wm_config.h" #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 $"; 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 aufd, aucfd;
static int raw_audio = 1; /* Can /dev/audio take 44.1KHz stereo? */ 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 * For fast linear-to-ulaw mapping, we use a lookup table that's generated
* at startup. * at startup.
*/ */
@ -407,7 +407,7 @@ wmaudio_state(struct cdda_block *blk)
#define ZEROTRAP /* turn on the trap as per the MIL-STD */ #define ZEROTRAP /* turn on the trap as per the MIL-STD */
#define BIAS 0x84 /* define the add-in bias for 16 bit samples */ #define BIAS 0x84 /* define the add-in bias for 16 bit samples */
#define CLIP 32635 #define CLIP 32635
unsigned char unsigned char
linear_to_ulaw( sample ) linear_to_ulaw( sample )
int 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}; 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7};
int sign, exponent, mantissa; int sign, exponent, mantissa;
unsigned char ulawbyte; unsigned char ulawbyte;
/* Get the sample into sign-magnitude. */ /* Get the sample into sign-magnitude. */
sign = (sample >> 8) & 0x80; /* set aside the sign */ sign = (sample >> 8) & 0x80; /* set aside the sign */
if ( sign != 0 ) sample = -sample; /* get magnitude */ if ( sign != 0 ) sample = -sample; /* get magnitude */
if ( sample > CLIP ) sample = CLIP; /* clip the magnitude */ if ( sample > CLIP ) sample = CLIP; /* clip the magnitude */
/* Convert from 16 bit linear to ulaw. */ /* Convert from 16 bit linear to ulaw. */
sample = sample + BIAS; sample = sample + BIAS;
exponent = exp_lut[( sample >> 7 ) & 0xFF]; exponent = exp_lut[( sample >> 7 ) & 0xFF];
@ -444,7 +444,7 @@ int sample;
#ifdef ZEROTRAP #ifdef ZEROTRAP
if ( ulawbyte == 0 ) ulawbyte = 0x02; /* optional CCITT trap */ if ( ulawbyte == 0 ) ulawbyte = 0x02; /* optional CCITT trap */
#endif #endif
return ulawbyte; return ulawbyte;
} }

View file

@ -5,7 +5,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@ -133,7 +133,7 @@ wmcdda_open(char *devname)
{ {
int fd; int fd;
fd = open(devname, 0); fd = open(devname, 0);
if (fd == -1) if (fd == -1)
fd = open("/dev/rdsk/c0t6d0s2", 0); fd = open("/dev/rdsk/c0t6d0s2", 0);

View file

@ -5,7 +5,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * 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); ccode = access(pass_through, F_OK);
if (ccode < 0) if (ccode < 0)
{ {
if ((file_des = open(dev_name, O_RDONLY)) < 0) if ((file_des = open(dev_name, O_RDONLY)) < 0)
@ -258,7 +258,7 @@ create_cdrom_node(char *dev_name)
return -1; return -1;
} }
} }
file_des = open( pass_through, O_RDWR); file_des = open( pass_through, O_RDWR);
err = errno; err = errno;
@ -286,7 +286,7 @@ wmcd_open(d)
if (d->fd >= 0) /* Device already open? */ if (d->fd >= 0) /* Device already open? */
return (0); return (0);
if (cd_device == NULL) if (cd_device == NULL)
cd_device = DEFAULT_CD_DEVICE; cd_device = DEFAULT_CD_DEVICE;
@ -329,7 +329,7 @@ wmcd_open(d)
} }
*d = *(find_drive_struct(vendor, model, rev)); *d = *(find_drive_struct(vendor, model, rev));
wm_drive_settype(vendor, model, rev); wm_drive_settype(vendor, model, rev);
d->fd = fd; d->fd = fd;
return (0); return (0);
@ -366,7 +366,7 @@ wmcd_reopen( struct wm_drive *d )
/* /*
* Send a SCSI command out the bus. * Send a SCSI command out the bus.
*/ */
int int
wm_scsi(d, xcdb, cdblen, retbuf, retbuflen, getreply) wm_scsi(d, xcdb, cdblen, retbuf, retbuflen, getreply)
struct wm_drive *d; struct wm_drive *d;
unsigned char *xcdb; unsigned char *xcdb;
@ -382,7 +382,7 @@ wm_scsi(d, xcdb, cdblen, retbuf, retbuflen, getreply)
int errno_save; int errno_save;
/* getreply == 1 is read, == 0 is write */ /* getreply == 1 is read, == 0 is write */
struct sb sb; struct sb sb;
struct scs scs; struct scs scs;

View file

@ -5,7 +5,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * 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) int gen_get_trackcount(struct wm_drive *d,int *tracks)
{ {
return (0); return (0);
} }
@ -66,7 +66,7 @@ int gen_get_cdlen(struct wm_drive *d,int *frames)
return (0); return (0);
} }
/* /*
* gen_get_trackinfo() * gen_get_trackinfo()
* *
*/ */
@ -77,7 +77,7 @@ gen_get_trackinfo(struct wm_drive *d,int track,int *data,int *startframe)
return (0); return (0);
} }
/* /*
* gen_get_drive_status() * gen_get_drive_status()
* *
*/ */
@ -88,7 +88,7 @@ int gen_get_drive_status(struct wm_drive *d,
int *pos, int *pos,
int *track, int *track,
int *index) int *index)
{ {
return (0); return (0);
} }
@ -115,7 +115,7 @@ int gen_get_volume(struct wm_drive *d,int *left,int *right)
return (0); return (0);
} }
/* /*
* gen_set_volume() * gen_set_volume()
* *
*/ */
@ -125,7 +125,7 @@ int gen_set_volume(struct wm_drive *d,int left,int right)
return (0); return (0);
} }
/* /*
* gen_pause() * 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); return (0);
} }
@ -234,7 +234,7 @@ int wmcd_open(struct wm_drive *d)
*d = *(find_drive_struct(vendor, model, rev)); *d = *(find_drive_struct(vendor, model, rev));
wm_drive_settype(vendor, model, rev); wm_drive_settype(vendor, model, rev);
d->fd = fd; d->fd = fd;
d->init(d); d->init(d);

View file

@ -5,7 +5,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@ -473,7 +473,7 @@ unscale_volume(cd_vol, max)
else else
bot = vol + 1; bot = vol + 1;
} }
if (vol < 0) if (vol < 0)
vol = 0; vol = 0;
else if (vol > max) else if (vol > max)

View file

@ -5,7 +5,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@ -101,7 +101,7 @@ sendscsi( struct wm_drive *d, void *buf,
case 0: case 0:
cdblen = 6; cdblen = 6;
break; break;
case 5: case 5:
cdb[10] = a10; cdb[10] = a10;
cdb[11] = a11; 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); page, 0, sizeof(pagebuf), 0,0,0,0,0,0,0);
if (status < 0) if (status < 0)
return (status); return (status);
/* /*
* The first byte of the returned data is the transfer length. Then * The first byte of the returned data is the transfer length. Then
* two more bytes and the length of whatever header blocks are in * 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'; rev[4] = '\0';
wm_lib_message(WM_MSG_LEVEL_DEBUG|WM_MSG_CLASS, "SCSI Inquiry result: [%s|%s|%s]\n", vendor, model, rev); 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. */ /* Remove "CD-ROM " from the model. */
if (! strncmp(model, "CD-ROM", 6)) 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, 0, 0, 0, 0, track, sizeof(buf) / 256,
sizeof(buf) % 256, 0,0,0)) sizeof(buf) % 256, 0,0,0))
return (-1); return (-1);
*data = buf[5] & 4 ? 1 : 0; *data = buf[5] & 4 ? 1 : 0;
*startframe = buf[9] * 60 * 75 + buf[10] * 75 + buf[11]; *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 * stupid somehow, but necessary this time
*/ */
switch( wmcd_open( d ) ) { switch( wmcd_open( d ) ) {
case -1: /* error */ case -1: /* error */
return (-1); return (-1);
case 1: /* retry */ case 1: /* retry */
return (0); 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, 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)) 0, 0, 0, sizeof(buf) / 256, sizeof(buf) % 256, 0,0,0))
return (0); return (0);
switch (buf[1]) { switch (buf[1]) {
case SUBQ_STATUS_PLAY: case SUBQ_STATUS_PLAY:
*mode = WM_CDM_PLAYING; *mode = WM_CDM_PLAYING;
@ -399,11 +399,11 @@ wm_scsi2_get_drive_status(d, oldmode, mode, pos, track, index)
default: default:
*mode = WM_CDM_UNKNOWN; *mode = WM_CDM_UNKNOWN;
#ifdef DEBUG #ifdef DEBUG
if( getenv( "WORKMAN_DEBUG" ) != NULL ) if( getenv( "WORKMAN_DEBUG" ) != NULL )
printf("wm_scsi2_get_drive_status: status is 0x%x\n", printf("wm_scsi2_get_drive_status: status is 0x%x\n",
buf[1]); buf[1]);
#endif #endif
break; break;
} }
@ -521,7 +521,7 @@ wm_scsi2_set_volume(d, left, right)
/* Get the current audio parameters first. */ /* Get the current audio parameters first. */
if (wm_scsi_mode_sense(d, PAGE_AUDIO, mode)) if (wm_scsi_mode_sense(d, PAGE_AUDIO, mode))
return (-1); return (-1);
/* Tweak the volume part of the parameters. */ /* Tweak the volume part of the parameters. */
mode[9] = (left * 255) / 100; mode[9] = (left * 255) / 100;
mode[11] = (right * 255) / 100; mode[11] = (right * 255) / 100;

View file

@ -5,7 +5,7 @@
* (c) 1991-1997 by Steven Grimm (original author) * (c) 1991-1997 by Steven Grimm (original author)
* (c) by Dirk Försterling (current 'author' = maintainer) * (c) by Dirk Försterling (current 'author' = maintainer)
* The maintainer can be contacted by his e-mail address: * The maintainer can be contacted by his e-mail address:
* milliByte@DeathsDoor.com * milliByte@DeathsDoor.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * 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; int wm_lib_verbosity = WM_MSG_LEVEL_NONE;
/* /*
* Some seleced functions of version reporting follow... * 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 *wm_libver_name( void )
{ {
char *s = NULL; char *s = NULL;
wm_strmcat(&s, WM_LIBVER_NAME); wm_strmcat(&s, WM_LIBVER_NAME);
return s; return s;
} /* wm_libver_name() */ } /* wm_libver_name() */
@ -78,9 +78,9 @@ char *wm_libver_string( void )
{ {
char *s = NULL; char *s = NULL;
wm_strmcat( &s, wm_libver_name() ); wm_strmcat( &s, wm_libver_name() );
wm_strmcat( &s, " " ); wm_strmcat( &s, " " );
wm_strmcat( &s, wm_libver_number() ); wm_strmcat( &s, wm_libver_number() );
return s; return s;
} /* wm_libver_string() */ } /* 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. * print it only if level and class are allowed.
*/ */
if( (level <= vlevel) && (vclass != 0) ) if( (level <= vlevel) && (vclass != 0) )
{ {
va_start(ap, fmt); va_start(ap, fmt);

View file

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
echo "Image courtesy of Clemens Krammer <drk@pollux.ikn.tuwien.ac.at>" echo "Image courtesy of Clemens Krammer <drk@pollux.ikn.tuwien.ac.at>"
echo echo
cmd='../src/pclock -B../XPM/rolexgmt.xpm -H grey80 --hands-width=2 --hour-hand-length=12 --second-hand-length=18' cmd='../src/pclock -B../XPM/rolexgmt.xpm -H grey80 --hands-width=2 --hour-hand-length=12 --second-hand-length=18'

View file

@ -101,9 +101,9 @@ CreateWindow(int ac, char *av[])
attributes.valuemask = XpmSize; attributes.valuemask = XpmSize;
result = XpmReadFileToPixmap(display, root, option.background_pixmap, result = XpmReadFileToPixmap(display, root, option.background_pixmap,
&back_pm, &mask_pm, &attributes); &back_pm, &mask_pm, &attributes);
if (result != XpmSuccess) 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) else if (attributes.width != SIZE || attributes.height != SIZE)
fprintf(stderr, "ERR: pixmap must be %dx%d\n", SIZE, SIZE); fprintf(stderr, "ERR: pixmap must be %dx%d\n", SIZE, SIZE);
else else

View file

@ -16,7 +16,7 @@ Some features are:
* Command line options (-h for help) * Command line options (-h for help)
* Customize the program through config file, command line * Customize the program through config file, command line
options, or on the fly options, or on the fly
Files Files
-------------------------------------------------------------- --------------------------------------------------------------
@ -24,7 +24,7 @@ README This file.
INSTALL Installation instructions. INSTALL Installation instructions.
Changelog Description of changes. Changelog Description of changes.
COPYING GNU General Public License Version 2. COPYING GNU General Public License Version 2.
Program Usage Program Usage
-------------------------------------------------------------- --------------------------------------------------------------

View file

@ -1,5 +1,5 @@
LIBDIR = -L/usr/X11R6/lib -L/usr/lib -L/opt/gnome/lib 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 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 \ OBJS = washerDryer.o \
../wmgeneral/wmgeneral.o \ ../wmgeneral/wmgeneral.o \

View file

@ -43,7 +43,7 @@ int wdryer_mask_width = 64;
int wdryer_mask_height = 64; int wdryer_mask_height = 64;
int wInCommandMode = 0; // 0 = default/bell 1 = command int wInCommandMode = 0; // 0 = default/bell 1 = command
int dInCommandMode = 0; int dInCommandMode = 0;
int tmp_wInCmdMode = 0; int tmp_wInCmdMode = 0;
int tmp_dInCmdMode = 0; int tmp_dInCmdMode = 0;
@ -184,7 +184,7 @@ int main (int argc, char *argv[])
//clickable regions //clickable regions
AddMouseRegion (0, 8, 6, 28, 24); //0: washer 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 AddMouseRegion (2, 6, 26, 57, 57); //2: main area
starttime = time (0); starttime = time (0);
@ -209,7 +209,7 @@ int main (int argc, char *argv[])
//decrement timer, draw status //decrement timer, draw status
if (oldsec < time_struct->tm_sec) if (oldsec < time_struct->tm_sec)
DecrementTimer (); DecrementTimer ();
oldsec = (time_struct->tm_sec); oldsec = (time_struct->tm_sec);
RedrawWindow (); RedrawWindow ();
@ -275,7 +275,7 @@ int main (int argc, char *argv[])
break; break;
/*************** /***************
* click on main * click on main
***************/ ***************/
case 2: // main area case 2: // main area
//open GUI //open GUI
configure_washerdryer (); configure_washerdryer ();
@ -354,7 +354,7 @@ void DrawStatus(int intProcNum, int intStatus)
copyXPMArea (intXPMx, 64, copyXPMArea (intXPMx, 64,
3, 30, 3, 30,
8 + intProcNum*5, 27); 8 + intProcNum*5, 27);
intPrevStatus[intProcNum] = intXPMx; intPrevStatus[intProcNum] = intXPMx;
} }
} }
@ -668,7 +668,7 @@ void destroyAndReloadConfig(GtkWidget* widget)
configure_washerdryer(); configure_washerdryer();
} }
//destroys window //destroys window
void destroy (GtkWidget * widget, gpointer data) void destroy (GtkWidget * widget, gpointer data)
{ {
gtk_main_quit (); gtk_main_quit ();
@ -786,7 +786,7 @@ int configure_washerdryer ()
// Add vertical box to main window // Add vertical box to main window
gtk_container_add (GTK_CONTAINER (frame), sub_vbox); gtk_container_add (GTK_CONTAINER (frame), sub_vbox);
gtk_widget_show (sub_vbox); gtk_widget_show (sub_vbox);
box2 = gtk_hbox_new (FALSE, 0); box2 = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (sub_vbox), box2, TRUE, TRUE, 2); 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_box_pack_start (GTK_BOX(innerHbox), buttonChange, FALSE, FALSE, 2);
gtk_widget_show (buttonChange); gtk_widget_show (buttonChange);
sprintf(buffer, " min remaining"); sprintf(buffer, " min remaining");
label = gtk_label_new (buffer); label = gtk_label_new (buffer);
gtk_misc_set_alignment (GTK_MISC (label), 2, 2); gtk_misc_set_alignment (GTK_MISC (label), 2, 2);
gtk_box_pack_start (GTK_BOX (innerHbox), label, FALSE, FALSE, 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_box_pack_start (GTK_BOX (innerHbox), button, FALSE, FALSE, 4);
gtk_widget_show (button); gtk_widget_show (button);
} }
} //end for } //end for

View file

@ -1,4 +1,4 @@
/* Generic single linked list to keep various information /* Generic single linked list to keep various information
Copyright (C) 1993, 1994 Free Software Foundation, Inc. Copyright (C) 1993, 1994 Free Software Foundation, Inc.
@ -61,7 +61,7 @@ INLINE int list_length (LinkedList * list)
return i; 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 */ larger than the list length, NULL is returned */
INLINE void * list_nth (int index, LinkedList * list) INLINE void * list_nth (int index, LinkedList * list)

View file

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

View file

@ -1,9 +1,9 @@
/* dock.c- built-in Dock module for WindowMaker /* dock.c- built-in Dock module for WindowMaker
* WindowMaker window manager * WindowMaker window manager
* *
* Copyright (c) 1997 Alfredo K. Kojima * Copyright (c) 1997 Alfredo K. Kojima
* *
* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
@ -28,7 +28,7 @@
*---------------------------------------------------------------------- *----------------------------------------------------------------------
* parse_command-- * parse_command--
* Divides a command line into a argv/argc pair. * Divides a command line into a argv/argc pair.
*---------------------------------------------------------------------- *----------------------------------------------------------------------
*/ */
#define PRC_ALPHA 0 #define PRC_ALPHA 0
#define PRC_BLANK 1 #define PRC_BLANK 1

View file

@ -17,7 +17,7 @@
* Now supports >256 colors * Now supports >256 colors
11/09/1998 (Martijn Pieterse, pieterse@xs4all.nl) 11/09/1998 (Martijn Pieterse, pieterse@xs4all.nl)
* Removed a bug from parse_rcfile. You could * 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. also start.
* Changed the needed geometry string. * Changed the needed geometry string.
We don't use window size, and don't support We don't use window size, and don't support

View file

@ -166,7 +166,7 @@ Description:
cmd-line option : -c <string> cmd-line option : -c <string>
rc-file statement: Window.Button.Command = "<string>" rc-file statement: Window.Button.Command = "<string>"
default value : "xterm -e mail" default value : "xterm -e mail"
item : your mailbox (file => mbox, directory => Maildir) item : your mailbox (file => mbox, directory => Maildir)
cmd-line option : -mb <string> cmd-line option : -mb <string>
rc-file statement: Mail.MailBox = "<string>" rc-file statement: Mail.MailBox = "<string>"
@ -308,7 +308,7 @@ Porting:
- Sun Solaris 4.0 on Sparc Station 4 and 10 - Sun Solaris 4.0 on Sparc Station 4 and 10
- Sun Solaris 6, 7 and 8 (thanx to Kristian Borum!) - Sun Solaris 6, 7 and 8 (thanx to Kristian Borum!)
- SunOs 5.7 on Ultra Sparc 5 (thanx to Alessandro!) - SunOs 5.7 on Ultra Sparc 5 (thanx to Alessandro!)
...together with Window Maker v0.60.0 or better (or standalone of course) and ...together with Window Maker v0.60.0 or better (or standalone of course) and
libdockapp v0.4.0. libdockapp v0.4.0.

8
wmail/configure vendored
View file

@ -1,7 +1,7 @@
#! /bin/sh #! /bin/sh
# Guess values for system-dependent variables and create Makefiles. # 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. # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
# #
# This configure script is free software; the Free Software Foundation # 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 cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1 #define $ac_tr_hdr 1
EOF EOF
else else
echo "$ac_t""no" 1>&6 echo "$ac_t""no" 1>&6
fi fi
@ -2088,7 +2088,7 @@ fi
echo "$ac_t""$ac_cv_c_const" 1>&6 echo "$ac_t""$ac_cv_c_const" 1>&6
if test $ac_cv_c_const = no; then if test $ac_cv_c_const = no; then
cat >> confdefs.h <<\EOF cat >> confdefs.h <<\EOF
#define const #define const
EOF EOF
fi fi
@ -2331,7 +2331,7 @@ if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
cat >> confdefs.h <<EOF cat >> confdefs.h <<EOF
#define $ac_tr_func 1 #define $ac_tr_func 1
EOF EOF
else else
echo "$ac_t""no" 1>&6 echo "$ac_t""no" 1>&6
fi fi

View file

@ -4,7 +4,7 @@
// //
// Copyright 2000~2002, Sven Geisenhainer <sveng@informatik.uni-jena.de>. // Copyright 2000~2002, Sven Geisenhainer <sveng@informatik.uni-jena.de>.
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions // modification, are permitted provided that the following conditions
// are met: // are met:
@ -15,7 +15,7 @@
// documentation and/or other materials provided with the distribution. // documentation and/or other materials provided with the distribution.
// 3. The name of the author may not be used to endorse or promote products // 3. The name of the author may not be used to endorse or promote products
// derived from this software without specific prior written permission. // derived from this software without specific prior written permission.
// //
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
@ -46,7 +46,7 @@ void TRACE( const char *fmt, ... )
} }
#endif #endif
void ABORT( const char *fmt, ... ) void ABORT( const char *fmt, ... )
{ {
va_list args; va_list args;
va_start( args, fmt ); va_start( args, fmt );
@ -78,7 +78,7 @@ char *MakePathName( const char *dir, const char *file )
fullName = malloc( len1 + len2 + 2 ); fullName = malloc( len1 + len2 + 2 );
else else
fullName = malloc( len1 + len2 + 1 ); fullName = malloc( len1 + len2 + 1 );
memcpy( fullName, dir, len1 ); memcpy( fullName, dir, len1 );
if( dir[len1-1] != '/' ) if( dir[len1-1] != '/' )
fullName[len1++] = '/'; fullName[len1++] = '/';

View file

@ -4,7 +4,7 @@
// //
// Copyright 2000~2002, Sven Geisenhainer <sveng@informatik.uni-jena.de>. // Copyright 2000~2002, Sven Geisenhainer <sveng@informatik.uni-jena.de>.
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions // modification, are permitted provided that the following conditions
// are met: // are met:
@ -15,7 +15,7 @@
// documentation and/or other materials provided with the distribution. // documentation and/or other materials provided with the distribution.
// 3. The name of the author may not be used to endorse or promote products // 3. The name of the author may not be used to endorse or promote products
// derived from this software without specific prior written permission. // derived from this software without specific prior written permission.
// //
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.

View file

@ -4,7 +4,7 @@
// //
// Copyright 2000~2002, Sven Geisenhainer <sveng@informatik.uni-jena.de>. // Copyright 2000~2002, Sven Geisenhainer <sveng@informatik.uni-jena.de>.
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions // modification, are permitted provided that the following conditions
// are met: // are met:
@ -15,7 +15,7 @@
// documentation and/or other materials provided with the distribution. // documentation and/or other materials provided with the distribution.
// 3. The name of the author may not be used to endorse or promote products // 3. The name of the author may not be used to endorse or promote products
// derived from this software without specific prior written permission. // derived from this software without specific prior written permission.
// //
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
@ -38,7 +38,7 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// wmailrc file format // wmailrc file format
// //
// # - comment-lines // # - comment-lines
// Window.Display = "string" // Window.Display = "string"
// Window.NonShaped = On|Off // Window.NonShaped = On|Off
@ -107,7 +107,7 @@ config_t config = {
}; };
// enumeration names for ticker mode // enumeration names for ticker mode
enumList_t tickerEnum[] = enumList_t tickerEnum[] =
{ {
{ "address", TICKER_ADDRESS }, { "address", TICKER_ADDRESS },
{ "familyname", TICKER_FAMILYNAME }, { "familyname", TICKER_FAMILYNAME },
@ -134,7 +134,7 @@ bool Tokenize( const char *line, const char **id, const char **value )
{ {
*id = token1; *id = token1;
*value = token2; *value = token2;
return true; return true;
} }
} }
@ -153,7 +153,7 @@ void AddSenderToSkipList( char *sender )
{ {
if( !strcmp( *skipName, sender )) if( !strcmp( *skipName, sender ))
return; return;
numNames++; numNames++;
} }
@ -228,7 +228,7 @@ void PostProcessConfiguration()
config.display = strdup( WMAIL_DISPLAY ); config.display = strdup( WMAIL_DISPLAY );
if( config.runCmd == NULL ) if( config.runCmd == NULL )
config.runCmd = strdup( WMAIL_CLIENT_CMD ); config.runCmd = strdup( WMAIL_CLIENT_CMD );
if( config.mailBox == NULL ) if( config.mailBox == NULL )
{ {
@ -245,12 +245,12 @@ void ReadConfigFile( bool resetConfigStrings )
// free all config strings and reset their pointers if required // free all config strings and reset their pointers if required
if( resetConfigStrings ) if( resetConfigStrings )
ResetConfigStrings(); ResetConfigStrings();
if(( usersHome = getenv( "HOME" )) != NULL ) if(( usersHome = getenv( "HOME" )) != NULL )
{ {
char *fileName = MakePathName( usersHome, WMAIL_RC_FILE ); char *fileName = MakePathName( usersHome, WMAIL_RC_FILE );
FILE *f = fopen( fileName, "rt" ); FILE *f = fopen( fileName, "rt" );
if( f != NULL ) if( f != NULL )
{ {
char buf[1024]; char buf[1024];
@ -260,7 +260,7 @@ void ReadConfigFile( bool resetConfigStrings )
{ {
const char *id, *value; const char *id, *value;
unsigned int len; unsigned int len;
if( fgets( buf, 1024, f ) == NULL ) if( fgets( buf, 1024, f ) == NULL )
break; break;
@ -268,7 +268,7 @@ void ReadConfigFile( bool resetConfigStrings )
for( len = strlen( buf ); for( len = strlen( buf );
len > 0 && IsWhiteSpace(buf+(--len)); ) len > 0 && IsWhiteSpace(buf+(--len)); )
*(buf+len) = '\0'; *(buf+len) = '\0';
if( !Tokenize( buf, &id, &value )) if( !Tokenize( buf, &id, &value ))
continue; continue;
@ -332,7 +332,7 @@ void ReadConfigFile( bool resetConfigStrings )
} else } else
WARNING( "cfg-file(%i): unrecognized: \"%s\"\n", line, buf ); WARNING( "cfg-file(%i): unrecognized: \"%s\"\n", line, buf );
} }
fclose( f ); fclose( f );
} else { } else {
TRACE( "unable to open config-file \"%s\"\n", fileName ); 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) != '\\' ) if( *(trailingQuote-1) != '\\' )
break; break;
++trailingQuote; ++trailingQuote;
} }
@ -367,7 +367,7 @@ bool ReadString( const char *from, unsigned int line, char **to )
// disposing of "to" is up to the caller... // disposing of "to" is up to the caller...
*to = malloc( trailingQuote - from + 1 ); *to = malloc( trailingQuote - from + 1 );
to_c = *to; to_c = *to;
for( c = from; c != trailingQuote; ++c ) { for( c = from; c != trailingQuote; ++c ) {
if( *c == '\\' ) { if( *c == '\\' ) {
switch( *(++c) ) { switch( *(++c) ) {
@ -394,17 +394,17 @@ bool ReadString( const char *from, unsigned int line, char **to )
} }
} else } else
*to_c = *c; *to_c = *c;
++to_c; ++to_c;
} }
*to_c = '\0'; *to_c = '\0';
TRACE( "ReadString read \"%s\"\n", *to ); TRACE( "ReadString read \"%s\"\n", *to );
return true; return true;
} }
} }
WARNING( "cfg-file(%i): invalid string\n" ); WARNING( "cfg-file(%i): invalid string\n" );
return false; 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 ) bool ReadInt( const char *from, unsigned int line, int *to )
{ {
int value = 0; int value = 0;
if( *from == '0' && (*(from+1) == 'x' || *(from+1) == 'X') ) { if( *from == '0' && (*(from+1) == 'x' || *(from+1) == 'X') ) {
for( from += 2; *from != '\0' && !IsWhiteSpace( from ); ++from ) for( from += 2; *from != '\0' && !IsWhiteSpace( from ); ++from )
{ {
@ -460,7 +460,7 @@ bool ReadInt( const char *from, unsigned int line, int *to )
return false; return false;
} }
} }
*to = value; *to = value;
TRACE( "ReadInt read \"%i\"\n", *to ); 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 ); WARNING( "cfg-file(%i): unknown modifier: \"%s\"\n", line, from );
return false; return false;
} }
@ -494,9 +494,9 @@ bool IsWhiteSpace( const char *chr )
const char *SkipWhiteSpaces( const char *str ) const char *SkipWhiteSpaces( const char *str )
{ {
const char *c; const char *c;
for( c = str; IsWhiteSpace( c ); ++c ) for( c = str; IsWhiteSpace( c ); ++c )
; ;
return c; return c;
} }

View file

@ -4,7 +4,7 @@
// //
// Copyright 2000~2002, Sven Geisenhainer <sveng@informatik.uni-jena.de>. // Copyright 2000~2002, Sven Geisenhainer <sveng@informatik.uni-jena.de>.
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions // modification, are permitted provided that the following conditions
// are met: // are met:
@ -15,7 +15,7 @@
// documentation and/or other materials provided with the distribution. // documentation and/or other materials provided with the distribution.
// 3. The name of the author may not be used to endorse or promote products // 3. The name of the author may not be used to endorse or promote products
// derived from this software without specific prior written permission. // derived from this software without specific prior written permission.
// //
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.

View file

@ -7,7 +7,7 @@
// //
// Copyright 2000~2002, Sven Geisenhainer <sveng@informatik.uni-jena.de>. // Copyright 2000~2002, Sven Geisenhainer <sveng@informatik.uni-jena.de>.
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions // modification, are permitted provided that the following conditions
// are met: // are met:
@ -18,7 +18,7 @@
// documentation and/or other materials provided with the distribution. // documentation and/or other materials provided with the distribution.
// 3. The name of the author may not be used to endorse or promote products // 3. The name of the author may not be used to endorse or promote products
// derived from this software without specific prior written permission. // derived from this software without specific prior written permission.
// //
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // 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 ) { if(( usersHome = getenv( "HOME" )) == NULL ) {
WARNING( "HOME environment-variable is not set, placing %s in current directory!\n", WMAIL_CHECKSUM_FILE ); WARNING( "HOME environment-variable is not set, placing %s in current directory!\n", WMAIL_CHECKSUM_FILE );
config.checksumFileName = WMAIL_CHECKSUM_FILE; config.checksumFileName = WMAIL_CHECKSUM_FILE;
} else } else
config.checksumFileName = MakePathName( usersHome, WMAIL_CHECKSUM_FILE ); config.checksumFileName = MakePathName( usersHome, WMAIL_CHECKSUM_FILE );
} }
@ -312,7 +312,7 @@ int main( int argc, char **argv )
XStringListToTextProperty( &name, 1, &windowName ); XStringListToTextProperty( &name, 1, &windowName );
XSetWMName( DADisplay, DAWindow, &windowName ); XSetWMName( DADisplay, DAWindow, &windowName );
UpdatePixmap( false ); UpdatePixmap( false );
DAShow(); DAShow();
SetTimer(); SetTimer();
@ -421,7 +421,7 @@ void PreparePixmaps( bool freeMem )
DAMakePixmapFromData( chars_xpm, &charsPixmap, NULL, &dummy, &dummy ); DAMakePixmapFromData( chars_xpm, &charsPixmap, NULL, &dummy, &dummy );
DAMakePixmapFromData( numbers_xpm, &numbersPixmap, NULL, &dummy, &dummy ); DAMakePixmapFromData( numbers_xpm, &numbersPixmap, NULL, &dummy, &dummy );
DAMakePixmapFromData( button_xpm, &buttonPixmap, NULL, &dummy, &dummy ); DAMakePixmapFromData( button_xpm, &buttonPixmap, NULL, &dummy, &dummy );
if( config.useX11Font != NULL ) if( config.useX11Font != NULL )
{ {
XRectangle clipRect; XRectangle clipRect;
@ -445,7 +445,7 @@ void PreparePixmaps( bool freeMem )
XSetClipRectangles( DADisplay, tickerGC, 0, 0, &clipRect, 1, Unsorted ); XSetClipRectangles( DADisplay, tickerGC, 0, 0, &clipRect, 1, Unsorted );
} }
if( config.noshape ) // non-shaped dockapp ? if( config.noshape ) // non-shaped dockapp ?
DASetShape( None ); DASetShape( None );
else else
@ -455,7 +455,7 @@ void PreparePixmaps( bool freeMem )
void MarkName( unsigned long checksum ) void MarkName( unsigned long checksum )
{ {
name_t *name; name_t *name;
for( name = names; name != NULL; name = name->next ) { for( name = names; name != NULL; name = name->next ) {
if( name->checksum == checksum ) { if( name->checksum == checksum ) {
name->flag |= FLAG_READ; name->flag |= FLAG_READ;
@ -469,18 +469,18 @@ void MarkName( unsigned long checksum )
void DetermineState() void DetermineState()
{ {
name_t *name; name_t *name;
for( name = names; name != NULL; name = name->next ) for( name = names; name != NULL; name = name->next )
if(!( name->flag & FLAG_READ )) { if(!( name->flag & FLAG_READ )) {
state = STATE_NEWMAIL; state = STATE_NEWMAIL;
if( config.cmdOnMail != NULL ) { if( config.cmdOnMail != NULL ) {
int ret = system( config.cmdOnMail ); int ret = system( config.cmdOnMail );
if( ret == 127 || ret == -1 ) if( ret == 127 || ret == -1 )
WARNING( "execution of command \"%s\" failed.\n", config.cmdOnMail ); WARNING( "execution of command \"%s\" failed.\n", config.cmdOnMail );
} }
break; break;
} }
} }
@ -496,7 +496,7 @@ void ReadChecksumFile()
MarkName( checksum ); MarkName( checksum );
} else } else
return; return;
fclose( f ); fclose( f );
} }
@ -517,15 +517,15 @@ void WriteChecksumFile( bool writeAll )
return; return;
TRACE( "\n" ); TRACE( "\n" );
fclose( f ); fclose( f );
} }
void UpdateChecksum( unsigned long *checksum, const char *buf ) void UpdateChecksum( unsigned long *checksum, const char *buf )
{ {
if( buf != NULL ) { if( buf != NULL ) {
unsigned int i, len = strlen( buf ); unsigned int i, len = strlen( buf );
for( i = 0; i < len; ++i ) for( i = 0; i < len; ++i )
*checksum += buf[i] << (( i % sizeof(long) ) * 8 ); *checksum += buf[i] << (( i % sizeof(long) ) * 8 );
} }
@ -558,7 +558,7 @@ void TimerHandler( int dummy )
else else
CheckMBox(); CheckMBox();
} }
UpdatePixmap( checkMail % config.fps < config.fps/2 ); UpdatePixmap( checkMail % config.fps < config.fps/2 );
if( ++checkMail >= config.fps * config.checkInterval ) 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 *GetMail( unsigned long checksum )
{ {
name_t *name; name_t *name;
for( name = names; name != NULL; name = name->next ) for( name = names; name != NULL; name = name->next )
if( name->checksum == checksum ) if( name->checksum == checksum )
return name; return name;
@ -746,7 +746,7 @@ void UpdatePixmap( bool flashMailSymbol )
XCopyArea( DADisplay, mainPixmap, outPixmap, DAGC, XCopyArea( DADisplay, mainPixmap, outPixmap, DAGC,
0, 0, 64, 64, 0, 0 ); 0, 0, 64, 64, 0, 0 );
if( numMails > 999 ) if( numMails > 999 )
{ {
XCopyArea( DADisplay, numbersPixmap, outPixmap, DAGC, XCopyArea( DADisplay, numbersPixmap, outPixmap, DAGC,
@ -879,7 +879,7 @@ void ParseMaildirFile( const char *fileName, unsigned long checksum,
timeStruct.actime = fileStat->st_atime; timeStruct.actime = fileStat->st_atime;
timeStruct.modtime = fileStat->st_mtime; timeStruct.modtime = fileStat->st_mtime;
utime( fileName, &timeStruct ); utime( fileName, &timeStruct );
} }
char *ParseFromField( char *buf ) char *ParseFromField( char *buf )
@ -918,7 +918,7 @@ char *ParseFromField( char *buf )
state = STATE_QUOTED_FULLNAME; state = STATE_QUOTED_FULLNAME;
continue; continue;
case '<': case '<':
if( fullName[0] != '\0' && if( fullName[0] != '\0' &&
fullName[ strlen( fullName ) - 1 ] == ' ' ) fullName[ strlen( fullName ) - 1 ] == ' ' )
fullName[ strlen( fullName ) - 1 ] = '\0'; fullName[ strlen( fullName ) - 1 ] = '\0';
state = STATE_ADDRESS; state = STATE_ADDRESS;
@ -941,9 +941,9 @@ char *ParseFromField( char *buf )
fullName[ strlen( fullName ) ] = *c; fullName[ strlen( fullName ) ] = *c;
} }
continue; continue;
case STATE_QUOTED_FULLNAME: case STATE_QUOTED_FULLNAME:
switch( *c ) { switch( *c ) {
case '\\': case '\\':
fullName[ strlen( fullName ) ] = *(++c); fullName[ strlen( fullName ) ] = *(++c);
@ -1064,7 +1064,7 @@ bool SkipSender( char *address )
skipName != NULL && *skipName != NULL; skipName++ ) skipName != NULL && *skipName != NULL; skipName++ )
{ {
TRACE( "comparing \"%s\" and \"%s\"\n", *skipName, address ); TRACE( "comparing \"%s\" and \"%s\"\n", *skipName, address );
// call libc-fnmatch (wildcard-match :-) ! // call libc-fnmatch (wildcard-match :-) !
if( !fnmatch( *skipName, address, 0 )) { if( !fnmatch( *skipName, address, 0 )) {
TRACE( "skipping sender \"%s\"\n", *skipName ); TRACE( "skipping sender \"%s\"\n", *skipName );
@ -1103,7 +1103,7 @@ void RemoveLastName()
void ClearAllNames() void ClearAllNames()
{ {
name_t *name, *nextName; name_t *name, *nextName;
for( name = names; name != NULL; name = nextName ) { for( name = names; name != NULL; name = nextName ) {
nextName = name->next; nextName = name->next;
@ -1120,7 +1120,7 @@ void ClearAllNames()
void SetMailFlags( flag_t flag ) void SetMailFlags( flag_t flag )
{ {
name_t *name; name_t *name;
for( name = names; name != NULL; name = name->next ) for( name = names; name != NULL; name = name->next )
name->flag |= flag; name->flag |= flag;
} }
@ -1174,7 +1174,7 @@ void DrawTickerBuildinFont()
int leftSpace; int leftSpace;
int drawTo; int drawTo;
unsigned char *currentChar; unsigned char *currentChar;
if( names == NULL ) if( names == NULL )
return; return;
@ -1201,13 +1201,13 @@ void DrawTickerBuildinFont()
int outChar = (*currentChar < 32 || *currentChar >= 128) ? '?' : int outChar = (*currentChar < 32 || *currentChar >= 128) ? '?' :
*currentChar; *currentChar;
int charWidth = 57-drawTo >= 14 ? 14 - leftSpace : 57-drawTo; int charWidth = 57-drawTo >= 14 ? 14 - leftSpace : 57-drawTo;
XCopyArea( DADisplay, charsPixmap, outPixmap, DAGC, XCopyArea( DADisplay, charsPixmap, outPixmap, DAGC,
(outChar-32)*14+leftSpace, 0, charWidth, 21, drawTo, 20 ); (outChar-32)*14+leftSpace, 0, charWidth, 21, drawTo, 20 );
leftSpace = 0; leftSpace = 0;
drawTo += charWidth; drawTo += charWidth;
if( drawTo > 57 ) if( drawTo > 57 )
break; break;
} }
@ -1229,7 +1229,7 @@ void DrawTickerBuildinFont()
} }
} }
} }
void ButtonPressed( int button, int state, int x, int y ) void ButtonPressed( int button, int state, int x, int y )
{ {
if( x >= 35 && x <= 59 && y >= 47 && y <= 59 ) { 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 ) { if( x >= 35 && x <= 59 && y >= 47 && y <= 59 ) {
int ret = system( config.runCmd ); int ret = system( config.runCmd );
if( ret == 127 || ret == -1 ) if( ret == 127 || ret == -1 )
WARNING( "execution of command \"%s\" failed.\n", config.runCmd ); 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 *newLine = strdup( colorLine );
char *from = strrchr( newLine, '#' ); char *from = strrchr( newLine, '#' );
if( from == NULL && !strcasecmp( &colorLine[ strlen( colorLine ) - 4 ], "none" )) { if( from == NULL && !strcasecmp( &colorLine[ strlen( colorLine ) - 4 ], "none" )) {
// if no # found, it should be a None-color line // if no # found, it should be a None-color line
free( newLine ); free( newLine );
@ -1283,9 +1283,9 @@ char *XpmColorLine( const char *colorName, char *colorLine, bool disposeLine )
if( disposeLine ) if( disposeLine )
free( colorLine ); free( colorLine );
GetHexColorString( colorName, from+1 ); GetHexColorString( colorName, from+1 );
return newLine; return newLine;
} }

View file

@ -5,6 +5,6 @@ wmAppKill - Changelog
added support for mouse wheel (thanks to Mathieu) added support for mouse wheel (thanks to Mathieu)
some code cleaning some code cleaning
- 09/28/2000 - v0.1 - 09/28/2000 - v0.1
initial release initial release

View file

@ -1,5 +1,5 @@
wmAppKill requires the libGtop. wmAppKill requires the libGtop.
Download it at: http://www.home-of-linux.org/gnome/libgtop/ Download it at: http://www.home-of-linux.org/gnome/libgtop/
To install wmAppKill : To install wmAppKill :

View file

@ -12,9 +12,9 @@ wmAppKill : wmAppKill.c
install: wmAppKill install: wmAppKill
install -m 755 wmAppKill /usr/bin/wmAppKill install -m 755 wmAppKill /usr/bin/wmAppKill
clean: clean:
$(RM) *.o core tst *~ \#* $(RM) *.o core tst *~ \#*

View file

@ -2,7 +2,7 @@
wmAppKill v0.2 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 kill any of them by doubleclicking on their names.
You can specify wich process will be the oldest one of the list. 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 : rozange@club-internet.fr Please send comments, bugs, modifications to : rozange@club-internet.fr
Future releases will be holded at: Future releases will be holded at:
http://internettrash.com/users/beuz/wmappkill.html 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 : You might want to check this other cool dockapp from which i started :
wmNetscapeKiller at http://pblumo.free.fr/wmNetscapeKiller wmNetscapeKiller at http://pblumo.free.fr/wmNetscapeKiller

View file

@ -1,7 +1,7 @@
/* /*
* wmAppKill v0.2 - S.Rozange * wmAppKill v0.2 - 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option) * 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 * 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 * 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 * Boston, MA 02111-1307, USA
* *
*/ */
#include <unistd.h> #include <unistd.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/xpm.h> #include <X11/xpm.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <X11/extensions/shape.h> #include <X11/extensions/shape.h>
@ -43,15 +43,15 @@
#include <time.h> #include <time.h>
#include <signal.h> #include <signal.h>
#include "fond.xbm" #include "fond.xbm"
#include "wmAppKill.xpm" #include "wmAppKill.xpm"
#include "wmAppKill.h" #include "wmAppKill.h"
Display *dpy; /* xlib global vars */ Display *dpy; /* xlib global vars */
GC gc; GC gc;
Window win; Window win;
Window iconWin; Window iconWin;
Pixmap XPM; Pixmap XPM;
int screen; int screen;
_zone *fZone = NULL; _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) void ZoneCreate(int x, int y, int width, int height, char no)
{ {
_zone *last; _zone *last;
if (!fZone) { if (!fZone) {
fZone = (_zone *)malloc(sizeof(_zone)); fZone = (_zone *)malloc(sizeof(_zone));
last = fZone; last = fZone;
@ -93,23 +93,23 @@ char CheckZone(void)
unsigned int mask; unsigned int mask;
Window root_ret, child_ret; Window root_ret, child_ret;
_zone *curseur = fZone; _zone *curseur = fZone;
XQueryPointer(dpy, iconWin, &root_ret, &child_ret, &popo, &popo, &x, &y, &mask); /* mouse position */ XQueryPointer(dpy, iconWin, &root_ret, &child_ret, &popo, &popo, &x, &y, &mask); /* mouse position */
do { do {
if ((x >= curseur -> x) && (x <= curseur -> x + curseur -> width) && (y >= curseur -> y) && (y <= curseur -> y + curseur -> height)) if ((x >= curseur -> x) && (x <= curseur -> x + curseur -> width) && (y >= curseur -> y) && (y <= curseur -> y + curseur -> height))
return curseur -> no; return curseur -> no;
} }
while ((curseur = curseur -> next)); while ((curseur = curseur -> next));
return 0; return 0;
} }
void GarbageCollector(_desc *garb) void GarbageCollector(_desc *garb)
{ {
_desc *next; _desc *next;
while (garb) { while (garb) {
next = garb -> next; next = garb -> next;
free(garb); free(garb);
@ -121,12 +121,12 @@ int CheckProc(pid_t pid)
{ {
glibtop_proclist bof; glibtop_proclist bof;
unsigned int *n; unsigned int *n;
if ((n = glibtop_get_proclist (&bof, GLIBTOP_KERN_PROC_PID , (int64_t)pid)) == NULL) { if ((n = glibtop_get_proclist (&bof, GLIBTOP_KERN_PROC_PID , (int64_t)pid)) == NULL) {
glibtop_free(n); glibtop_free(n);
return -1; return -1;
} }
glibtop_free(n); glibtop_free(n);
return 0; return 0;
} }
@ -140,43 +140,43 @@ _desc *GetProcList(void) /* create a double linked list */
_desc *lastOne; _desc *lastOne;
_desc *glump; _desc *glump;
_desc *res; _desc *res;
if ((n = glibtop_get_proclist (&buf, GLIBTOP_KERN_PROC_UID, (int64_t)getuid())) == NULL) { if ((n = glibtop_get_proclist (&buf, GLIBTOP_KERN_PROC_UID, (int64_t)getuid())) == NULL) {
fprintf(stderr, "Problem using libgtop\n"); fprintf(stderr, "Problem using libgtop\n");
exit(1); exit(1);
}; };
nbPr = (int)buf.number; nbPr = (int)buf.number;
glump = (_desc *)malloc(sizeof(_desc)); glump = (_desc *)malloc(sizeof(_desc));
res = glump; res = glump;
lastOne = NULL; lastOne = NULL;
for (i = nbPr; i; i--){ for (i = nbPr; i; i--){
char *bof; char *bof;
glibtop_proc_state buf; glibtop_proc_state buf;
glump -> previous = lastOne; glump -> previous = lastOne;
glump -> next = (_desc *)malloc(sizeof(_desc)); glump -> next = (_desc *)malloc(sizeof(_desc));
glibtop_get_proc_state(&buf, glump -> pid = n[i - 1]); glibtop_get_proc_state(&buf, glump -> pid = n[i - 1]);
strcpy(glump -> name, bof = buf.cmd); strcpy(glump -> name, bof = buf.cmd);
if (strlen(glump -> name) > MAX_CHAR) if (strlen(glump -> name) > MAX_CHAR)
glump -> name[MAX_CHAR] = 0; glump -> name[MAX_CHAR] = 0;
lastOne = glump; lastOne = glump;
glump = glump -> next; glump = glump -> next;
if (procBaseName && !strcmp(bof, procBaseName)) { if (procBaseName && !strcmp(bof, procBaseName)) {
procBasePos = i - 1; procBasePos = i - 1;
procBasePid = n[i - 1]; procBasePid = n[i - 1];
break; break;
} }
} }
lastOne -> next = NULL; lastOne -> next = NULL;
lastProcPid = n[nbPr - 1]; lastProcPid = n[nbPr - 1];
glibtop_free(n); glibtop_free(n);
if (procBaseName && i) gNbProc = nbPr - i + 1; /* procBase has been found */ if (procBaseName && i) gNbProc = nbPr - i + 1; /* procBase has been found */
else { /* procBaseName is null or hasn't been found */ else { /* procBaseName is null or hasn't been found */
procBaseName = NULL; procBaseName = NULL;
@ -184,9 +184,9 @@ _desc *GetProcList(void) /* create a double linked list */
procBasePid = n[0]; procBasePid = n[0];
gNbProc = nbPr; gNbProc = nbPr;
} }
gNbProcTotal = nbPr; gNbProcTotal = nbPr;
return res; return res;
} }
@ -194,21 +194,21 @@ int CheckProcToRemove(unsigned int *procList, unsigned int procListSize)
{ {
_desc *curseur = pList, *temp; _desc *curseur = pList, *temp;
int nbProcRemoved = 0, i; int nbProcRemoved = 0, i;
while (curseur) { while (curseur) {
for (i = procListSize; i; i--) for (i = procListSize; i; i--)
if (curseur -> pid == procList[i - 1]) break; if (curseur -> pid == procList[i - 1]) break;
temp = curseur; temp = curseur;
curseur = curseur -> next; curseur = curseur -> next;
if (!i) { /* we didn't find it in proclist, let's remove it */ if (!i) { /* we didn't find it in proclist, let's remove it */
RemoveProc(temp); RemoveProc(temp);
gNbProc--; gNbProc--;
nbProcRemoved++; nbProcRemoved++;
} }
} }
return nbProcRemoved; return nbProcRemoved;
} }
@ -217,73 +217,73 @@ int CheckProcToAdd(int pos, unsigned int *procList, unsigned int procListSize)
_desc *glump; _desc *glump;
int i, compteur = 0; int i, compteur = 0;
glibtop_proc_state buf; glibtop_proc_state buf;
for (i = pos; i < procListSize ; i++){ for (i = pos; i < procListSize ; i++){
compteur++; compteur++;
glump = (_desc *)malloc(sizeof(_desc)); glump = (_desc *)malloc(sizeof(_desc));
usleep(20000); /* libgtop seems to need a little bit of time */ usleep(20000); /* libgtop seems to need a little bit of time */
if (CheckProc(procList[i])) continue; /* checking if the process isn't already dead */ if (CheckProc(procList[i])) continue; /* checking if the process isn't already dead */
glibtop_get_proc_state(&buf, glump -> pid = procList[i]); glibtop_get_proc_state(&buf, glump -> pid = procList[i]);
strcpy(glump -> name, buf.cmd); strcpy(glump -> name, buf.cmd);
if (strlen(glump -> name) > MAX_CHAR) if (strlen(glump -> name) > MAX_CHAR)
glump -> name[MAX_CHAR] = 0; glump -> name[MAX_CHAR] = 0;
pList -> previous = glump; pList -> previous = glump;
glump -> next = pList; glump -> next = pList;
glump -> previous = NULL; glump -> previous = NULL;
if (posProc == pList) posProc = glump; if (posProc == pList) posProc = glump;
pList = glump; pList = glump;
gNbProc++; gNbProc++;
gNbProcTotal++; gNbProcTotal++;
lastProcPid = glump -> pid; lastProcPid = glump -> pid;
} }
return compteur; return compteur;
} }
int CheckProcChange(void) int CheckProcChange(void)
{ {
glibtop_proclist buf; glibtop_proclist buf;
unsigned int *n; unsigned int *n;
unsigned int nbPr; unsigned int nbPr;
int diffNbProc; int diffNbProc;
if ((n = glibtop_get_proclist (&buf, GLIBTOP_KERN_PROC_UID, (int64_t)getuid())) == NULL) return -1; if ((n = glibtop_get_proclist (&buf, GLIBTOP_KERN_PROC_UID, (int64_t)getuid())) == NULL) return -1;
nbPr = (int)buf.number; nbPr = (int)buf.number;
if ((nbPr == gNbProcTotal) && (n[nbPr - 1] == lastProcPid)) return 0; /* nothing changed */ 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 (procBaseName && (n[procBasePos] != procBasePid)) /* some proc killed before the baseproc (=oldest proc) */
{ {
if (CheckProc(procBasePid)) { /* baseproc doesn't exist anymore */ if (CheckProc(procBasePid)) { /* baseproc doesn't exist anymore */
GarbageCollector(pList); GarbageCollector(pList);
pList = GetProcList(); /* so we create a whole new list */ pList = GetProcList(); /* so we create a whole new list */
posProc = pList; posProc = pList;
return 1; return 1;
} }
else else
while (n[--procBasePos] != procBasePid); /* here we find what's the new pos. of baseproc */ while (n[--procBasePos] != procBasePid); /* here we find what's the new pos. of baseproc */
} }
diffNbProc = (nbPr - procBasePos) - gNbProc; /* nb of changes after baseproc */ diffNbProc = (nbPr - procBasePos) - gNbProc; /* nb of changes after baseproc */
if (diffNbProc == 0 && (n[nbPr - 1] == lastProcPid)){ /* only changes before baseproc */ if (diffNbProc == 0 && (n[nbPr - 1] == lastProcPid)){ /* only changes before baseproc */
gNbProcTotal = nbPr; gNbProcTotal = nbPr;
glibtop_free(n); glibtop_free(n);
return 0; return 0;
} }
if (diffNbProc > 0 && n[nbPr - diffNbProc - 1] == lastProcPid) /* only proc to add */ if (diffNbProc > 0 && n[nbPr - diffNbProc - 1] == lastProcPid) /* only proc to add */
CheckProcToAdd(nbPr - diffNbProc, n, nbPr); CheckProcToAdd(nbPr - diffNbProc, n, nbPr);
else { /* to remove [and to add] */ else { /* to remove [and to add] */
int nb; int nb;
nb = CheckProcToRemove(n, nbPr); nb = CheckProcToRemove(n, nbPr);
if (nb != -diffNbProc) if (nb != -diffNbProc)
CheckProcToAdd(nbPr - diffNbProc - 1, n, nbPr); CheckProcToAdd(nbPr - diffNbProc - 1, n, nbPr);
} }
@ -294,15 +294,15 @@ int CheckProcChange(void)
void RemoveProc(_desc *cible) void RemoveProc(_desc *cible)
{ {
_desc *temp1, *temp2; _desc *temp1, *temp2;
_desc *curseur; _desc *curseur;
int i; int i;
temp1 = cible -> previous; temp1 = cible -> previous;
temp2 = cible -> next; 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 */ 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); for (--i, curseur = posProc; i && curseur -> previous; curseur = curseur -> previous, --i);
posProc = curseur; posProc = curseur;
@ -310,11 +310,11 @@ void RemoveProc(_desc *cible)
else if ((cible == posProc) && (cible -> previous)) { else if ((cible == posProc) && (cible -> previous)) {
posProc = cible -> previous; posProc = cible -> previous;
} }
else if ((cible == posProc) && (cible -> next)) { else if ((cible == posProc) && (cible -> next)) {
posProc = cible -> next; posProc = cible -> next;
} }
if (temp1) temp1 -> next = temp2; if (temp1) temp1 -> next = temp2;
else { else {
pList = temp2; pList = temp2;
temp2 -> previous = NULL; temp2 -> previous = NULL;
@ -323,14 +323,14 @@ void RemoveProc(_desc *cible)
free(cible); free(cible);
return; return;
} }
if (temp2) temp2 -> previous = temp1; if (temp2) temp2 -> previous = temp1;
else else
temp1 -> next = NULL; temp1 -> next = NULL;
free(cible); free(cible);
gNbProcTotal--; gNbProcTotal--;
} }
void ShowString (int x, int y, char *doudou) void ShowString (int x, int y, char *doudou)
@ -339,7 +339,7 @@ void ShowString (int x, int y, char *doudou)
char c; char c;
while ((c = tolower(doudou[i++]))){ 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, 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) ; XCopyArea(dpy,XPM, iconWin,gc, 1 + (c - 'a') * 6, 10, 5, 8, x, y) ;
x += 6; x += 6;
@ -348,10 +348,10 @@ void ShowString (int x, int y, char *doudou)
} }
void DoExp(){ void DoExp(){
XClearWindow(dpy, win); XClearWindow(dpy, win);
XClearWindow(dpy, iconWin); XClearWindow(dpy, iconWin);
XCopyArea(dpy, XPM ,win, gc, 1 + (26) * 6, 10, 6, 8, 5, 51); 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, iconWin, gc, 1 + (26) * 6, 10, 6, 8, 5, 51);
XCopyArea(dpy, XPM, win, gc, 1 + (27) * 6, 10, 6, 8, 53, 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, win, gc, 106, 0, 28, 8, 17, 50);
XCopyArea(dpy, XPM, iconWin, gc, 106, 0, 28, 8, 17, 50); XCopyArea(dpy, XPM, iconWin, gc, 106, 0, 28, 8, 17, 50);
DoExpose(); DoExpose();
} }
void DoExpose() { void DoExpose() {
int i; int i;
_desc *curseur; _desc *curseur;
@ -379,7 +379,7 @@ void DoExpose() {
for (y = NB_LINE; y != gNbProc; y--) tabNoProc[y - 1] = -1; for (y = NB_LINE; y != gNbProc; y--) tabNoProc[y - 1] = -1;
} }
else i = NB_LINE; else i = NB_LINE;
for (curseur = posProc; i; curseur = curseur -> next, i--) for (curseur = posProc; i; curseur = curseur -> next, i--)
{ {
ShowString(X_PROC + 1, Y_PROC + (i - 1) * 10, curseur -> name); ShowString(X_PROC + 1, Y_PROC + (i - 1) * 10, curseur -> name);
@ -393,36 +393,36 @@ void DoClick(XEvent ev)
static unsigned char firstClick = 0; static unsigned char firstClick = 0;
_desc *curseur; _desc *curseur;
char zone, i; char zone, i;
zone = CheckZone(); zone = CheckZone();
if (ev.xbutton.button == CLICK_TWO) { if (ev.xbutton.button == CLICK_TWO) {
DoExpose() ; DoExpose() ;
} }
/* Mouse wheel patch by Mathieu Cuny */ /* Mouse wheel patch by Mathieu Cuny */
if (ev.xbutton.button == WHEEL_UP && gNbProc > NB_LINE) { if (ev.xbutton.button == WHEEL_UP && gNbProc > NB_LINE) {
for (i = NB_LINE, curseur = posProc; i; curseur = curseur -> next, i--); for (i = NB_LINE, curseur = posProc; i; curseur = curseur -> next, i--);
if (curseur) posProc = posProc -> next; if (curseur) posProc = posProc -> next;
DoExpose(); DoExpose();
} }
if (ev.xbutton.button == WHEEL_DOWN && posProc -> previous && gNbProc > NB_LINE) { if (ev.xbutton.button == WHEEL_DOWN && posProc -> previous && gNbProc > NB_LINE) {
posProc = posProc -> previous; posProc = posProc -> previous;
DoExpose(); DoExpose();
} }
/* Mouse wheel patch end */ /* Mouse wheel patch end */
if (ev.xbutton.button == CLICK_ONE) { if (ev.xbutton.button == CLICK_ONE) {
struct timeval temp; struct timeval temp;
long long nms1; long long nms1;
gettimeofday(&temp, NULL); gettimeofday(&temp, NULL);
nms1 = temp.tv_sec - timev.tv_sec; /* nb sec since last click */ nms1 = temp.tv_sec - timev.tv_sec; /* nb sec since last click */
if ((!nms1 || nms1 == 1)){ if ((!nms1 || nms1 == 1)){
long long yop = (nms1 * 1000000L) + (temp.tv_usec - timev.tv_usec); /* nb mlsec since last click */ 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 */ if (firstClick && (yop < DOUBLE_CLICK_DELAY)){ /* we got double click */
@ -430,62 +430,62 @@ void DoClick(XEvent ev)
firstClick = 0; firstClick = 0;
} else firstClick = 1; } else firstClick = 1;
} else firstClick = 1; } else firstClick = 1;
timev = temp; timev = temp;
if (zone == UP && !doubleClick && gNbProc > NB_LINE) if (zone == UP && !doubleClick && gNbProc > NB_LINE)
{ {
for (i = NB_LINE, curseur = posProc; i; curseur = curseur -> next, i--); for (i = NB_LINE, curseur = posProc; i; curseur = curseur -> next, i--);
if (curseur) posProc = posProc -> next; if (curseur) posProc = posProc -> next;
DoExpose(); DoExpose();
} }
else if (zone == DOWN && posProc -> previous && !doubleClick && gNbProc > NB_LINE) else if (zone == DOWN && posProc -> previous && !doubleClick && gNbProc > NB_LINE)
{ {
posProc = posProc -> previous; posProc = posProc -> previous;
DoExpose(); 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 (curseur = pList; curseur -> next; curseur = curseur -> next); /* curseur = end of list */
for (i = NB_LINE - 1; i; curseur = curseur -> previous, i--); for (i = NB_LINE - 1; i; curseur = curseur -> previous, i--);
posProc = curseur; posProc = curseur;
DoExpose(); DoExpose();
} }
else if (zone == DOWN && doubleClick && gNbProc > NB_LINE) else if (zone == DOWN && doubleClick && gNbProc > NB_LINE)
{ {
posProc = pList; posProc = pList;
DoExpose(); DoExpose();
} }
else if (zone > 0 && zone <= NB_LINE && doubleClick && tabNoProc[zone - 1] != -1) else if (zone > 0 && zone <= NB_LINE && doubleClick && tabNoProc[zone - 1] != -1)
{ {
kill(tabNoProc[zone - 1], SIGKILL); /* let's kill the mofo */ kill(tabNoProc[zone - 1], SIGKILL); /* let's kill the mofo */
waitpid(tabNoProc[zone - 1], NULL, 0); waitpid(tabNoProc[zone - 1], NULL, 0);
} }
if (doubleClick) doubleClick = 0; if (doubleClick) doubleClick = 0;
} }
} }
void DoEvents() { void DoEvents() {
unsigned long long compteur = 0; unsigned long long compteur = 0;
XEvent ev ; XEvent ev ;
for (;;){ for (;;){
if (!compteur){ if (!compteur){
if (CheckProcChange()) DoExpose(); if (CheckProcChange()) DoExpose();
compteur = UPDATE_NB * DELAY; compteur = UPDATE_NB * DELAY;
} }
while(XPending(dpy)){ while(XPending(dpy)){
XNextEvent(dpy,&ev); XNextEvent(dpy,&ev);
switch(ev.type) { switch(ev.type) {
case Expose : DoExp(); break; case Expose : DoExp(); break;
case ButtonPress : DoClick(ev); break; case ButtonPress : DoClick(ev); break;
@ -507,13 +507,13 @@ void PrintUsage(void)
void GetArg(int argc, char *argv[]) void GetArg(int argc, char *argv[])
{ {
if (argc == 1) return; if (argc == 1) return;
else if (argc == 3 && !strcmp(argv[1], "-n") && argv[2][0] != '-') else if (argc == 3 && !strcmp(argv[1], "-n") && argv[2][0] != '-')
procBaseName = strdup(argv[2]); procBaseName = strdup(argv[2]);
else if (argc == 2 && !strcmp(argv[1], "-a")) else if (argc == 2 && !strcmp(argv[1], "-a"))
procBaseName = NULL; procBaseName = NULL;
else if (argc == 2 && !strcmp(argv[1], "-h")) else if (argc == 2 && !strcmp(argv[1], "-h"))
{ {
PrintUsage(); PrintUsage();
@ -524,11 +524,11 @@ void GetArg(int argc, char *argv[])
exit(1); exit(1);
} }
} }
void CreateDock(int argc, char *argv[]) /* this part comes from http://www.linuxmag-france.org/ */ void CreateDock(int argc, char *argv[]) /* this part comes from http://www.linuxmag-france.org/ */
{ {
Window root; Window root;
XWMHints wmHints; XWMHints wmHints;
XSizeHints sizeHints; XSizeHints sizeHints;
XClassHint classHint; XClassHint classHint;
Pixmap pixmask; Pixmap pixmask;
@ -536,34 +536,34 @@ void CreateDock(int argc, char *argv[]) /* this part comes from http://www.li
unsigned long p_noir; unsigned long p_noir;
unsigned int borderWidth = 2; unsigned int borderWidth = 2;
char *wname = argv[0] ; char *wname = argv[0] ;
dpy = XOpenDisplay(NULL) ; dpy = XOpenDisplay(NULL) ;
if(dpy == NULL) if(dpy == NULL)
{ {
fprintf(stderr, "Can't open display\n") ; fprintf(stderr, "Can't open display\n") ;
exit(1) ; exit(1) ;
} }
root = RootWindow(dpy,screen); root = RootWindow(dpy,screen);
p_blanc = WhitePixel(dpy,screen) ; p_blanc = WhitePixel(dpy,screen) ;
p_noir = BlackPixel(dpy,screen) ; p_noir = BlackPixel(dpy,screen) ;
gc = XDefaultGC(dpy,screen) ; gc = XDefaultGC(dpy,screen) ;
XSetForeground(dpy, gc, p_noir); XSetForeground(dpy, gc, p_noir);
XSetBackground(dpy, gc,p_noir); XSetBackground(dpy, gc,p_noir);
sizeHints.x = 0 ; sizeHints.x = 0 ;
sizeHints.y = 0 ; sizeHints.y = 0 ;
sizeHints.width = 64 ; sizeHints.width = 64 ;
sizeHints.height = 64 ; sizeHints.height = 64 ;
win = XCreateSimpleWindow(dpy,root,sizeHints.x,sizeHints.y , sizeHints.width, sizeHints.height, borderWidth, p_noir,p_noir) ; 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 ) ; iconWin = XCreateSimpleWindow(dpy,root,sizeHints.x,sizeHints.y,sizeHints.width, sizeHints.height, borderWidth, p_noir,p_noir ) ;
sizeHints.flags = USSize | USPosition ; sizeHints.flags = USSize | USPosition ;
XSetWMNormalHints(dpy,win,&sizeHints) ; XSetWMNormalHints(dpy,win,&sizeHints) ;
wmHints.initial_state = WithdrawnState ; wmHints.initial_state = WithdrawnState ;
wmHints.icon_window = iconWin ; wmHints.icon_window = iconWin ;
wmHints.icon_x = sizeHints.x ; wmHints.icon_x = sizeHints.x ;
wmHints.icon_y = sizeHints.y ; wmHints.icon_y = sizeHints.y ;
wmHints.window_group = win ; 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) ; XSetWMHints(dpy, win, &wmHints) ;
classHint.res_name = wname ; classHint.res_name = wname ;
classHint.res_class = wname ; classHint.res_class = wname ;
XSetClassHint(dpy, win, &classHint) ; XSetClassHint(dpy, win, &classHint) ;
XSetCommand(dpy,win, argv, argc) ; XSetCommand(dpy,win, argv, argc) ;
pixmask = XCreateBitmapFromData(dpy,win,fond_bits, fond_width, fond_height) ; pixmask = XCreateBitmapFromData(dpy,win,fond_bits, fond_width, fond_height) ;
XShapeCombineMask(dpy,win,ShapeBounding,0,0,pixmask,ShapeSet) ; XShapeCombineMask(dpy,win,ShapeBounding,0,0,pixmask,ShapeSet) ;
XShapeCombineMask(dpy,iconWin,ShapeBounding, 0, 0, pixmask, ShapeSet) ; XShapeCombineMask(dpy,iconWin,ShapeBounding, 0, 0, pixmask, ShapeSet) ;
XpmCreatePixmapFromData(dpy,root,wmAppKill_xpm, &XPM, NULL,NULL) ; XpmCreatePixmapFromData(dpy,root,wmAppKill_xpm, &XPM, NULL,NULL) ;
XSelectInput(dpy,win, ExposureMask | ButtonPressMask) ; XSelectInput(dpy,win, ExposureMask | ButtonPressMask) ;
XSelectInput(dpy,iconWin, ExposureMask | ButtonPressMask) ; XSelectInput(dpy,iconWin, ExposureMask | ButtonPressMask) ;
XMapWindow(dpy,win) ; XMapWindow(dpy,win) ;
} }
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
int i; int i;
GetArg(argc, argv); GetArg(argc, argv);
glibtop_init(); glibtop_init();
CreateDock(argc, argv); CreateDock(argc, argv);
gettimeofday(&timev, NULL); gettimeofday(&timev, NULL);
pList = GetProcList(); pList = GetProcList();
posProc = pList; posProc = pList;
ZoneCreate(4, 50, 8, 8, UP); ZoneCreate(4, 50, 8, 8, UP);
ZoneCreate(54, 50, 8, 8, DOWN); ZoneCreate(54, 50, 8, 8, DOWN);
for (i = NB_LINE; i; i--) for (i = NB_LINE; i; i--)
ZoneCreate(X_PROC + 1, Y_PROC + (i - 1) * 10 + 2, 48, 7, i); ZoneCreate(X_PROC + 1, Y_PROC + (i - 1) * 10 + 2, 48, 7, i);
DoEvents(); DoEvents();
return 0; return 0;
} }

View file

@ -1,4 +1,4 @@
#define PROC_DEF "wmaker" #define PROC_DEF "wmaker"
#define MAX_CHAR 8 #define MAX_CHAR 8
#define NB_LINE 4 #define NB_LINE 4

View file

@ -1,6 +1,6 @@
/* readln.c - Edward H. Flora - ehflora@ksu.edu */ /* readln.c - Edward H. Flora - ehflora@ksu.edu */
/* Last Modified: 2/24/98 */ /* Last Modified: 2/24/98 */
/* /*
* This function reads a string from a file pointed to by fp until a * 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 * 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 * to the string. The new line character is included in the string returned
@ -8,10 +8,10 @@
*/ */
/* EXTERNALS: /* EXTERNALS:
****************** ******************
* Functions Called: * Functions Called:
* Standard Libraries. * Standard Libraries.
* *
* Header Files Included: * Header Files Included:
* Standard Includes only. * Standard Includes only.
*/ */
@ -34,7 +34,7 @@
char *readln(FILE *fp){ char *readln(FILE *fp){
char *tmp, *t1, *t2; char *tmp, *t1, *t2;
int count = 0, s1 = SIZE1; int count = 0, s1 = SIZE1;
if((tmp = malloc(SIZE1*sizeof(char))) == NULL)return NULL; if((tmp = malloc(SIZE1*sizeof(char))) == NULL)return NULL;
/* If cannot allocate memory */ /* If cannot allocate memory */
if((t1 = fgets(tmp, SIZE1, fp)) == NULL){ if((t1 = fgets(tmp, SIZE1, fp)) == NULL){

Some files were not shown because too many files have changed in this diff Show more