diff -urN mcd-0.3h/Makefile mcdp-0.3j/Makefile --- mcd-0.3h/Makefile Sat Apr 13 20:33:47 2002 +++ mcdp-0.3j/Makefile Thu Jul 4 09:33:02 2002 @@ -13,26 +13,26 @@ SRC = $(shell ls *.c) OBJS = $(SRC:.c=.o) -PRGS = mcd +PRGS = mcdp all: $(PRGS) -mcd: $(OBJS) +mcdp: $(OBJS) strip -x $(S_FLAGS) $(OBJS) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) - strip $(S_FLAGS) mcd + strip $(S_FLAGS) mcdp clean: - rm -rf $(OBJS) mcd + rm -rf $(OBJS) mcdp install: - cp -f mcd $(BINDIR) - cp -f mcd.1 $(MANDIR)/man1 && gzip -f9 $(MANDIR)/man1/mcd.1 - @echo "You may take a look at \"doc/profile-to-add\" ... " + cp -f mcdp $(BINDIR) + cp -f mcdp.1 $(MANDIR)/man1 && gzip -f9 $(MANDIR)/man1/mcdp.1 + @echo "You may take a look at \"doc/profile.sh\" ... " uninstall: - rm -f mcd $(BINDIR) - rm -f $(MANDIR)/man1/mcd.1.gz + rm -f mcdp $(BINDIR) + rm -f $(MANDIR)/man1/mcdp.1.gz .c.o: $(CC) $(CFLAGS) -c $< -o $@ diff -urN mcd-0.3h/cddb.c mcdp-0.3j/cddb.c --- mcd-0.3h/cddb.c Sat Apr 13 19:55:48 2002 +++ mcdp-0.3j/cddb.c Fri Jul 12 15:26:07 2002 @@ -1,23 +1,17 @@ -/* - * Author strongly advices against using this code, or a part of it, - * in an application designed to run on any Microsoft(tm) platform. - * - * See doc/README for more information about COPYING terms. - */ -#include "mcd.h" +#include "mcdp.h" #include #define BUFSIZE 1024 /* complete lines of server must fit ! */ char port[6], ip[16]; -static short cddb_parseentry(struct mcd *cd); +static short cddb_parseentry(struct mcdp *cd); static int cddb_getserver(const char *ipport, char *ip, char *port); static int cddb_opensocket(char *ip, char *port); static int cddb_readsocket(char *s, int size, int *socket); static short cddb_abort(struct he *h); /* searches a local entry, success returns 0 (needs CDB_PATH!)*/ -static short cddb_parseentry(struct mcd *cd) { +static short cddb_parseentry(struct mcdp *cd) { char *fn=malloc(sizeof(char)*PATH_MAX); int p=0,tr=0,len,fd; /* p=parse;tr=track */ char ch; @@ -97,8 +91,8 @@ s[i]='\0';return i; } -/* the global call, fills cd->t[].name, returns CDDB_MODES (mcd.h) */ -int cddb_getentries(struct mcd *cd) { +/* the global call, fills cd->t[].name, returns CDDB_MODES (mcdp.h) */ +int cddb_getentries(struct mcdp *cd) { char *hostname=getenv("HOSTNAME"); char *logname=getenv("LOGNAME"); char tmp[16]; /* tracks to str */ @@ -127,11 +121,11 @@ if ((len=cddb_readsocket(h.msg, BUFSIZE, &h.fd))<0) return cddb_abort(&h); if (strncmp("201",h.msg,3)) return cddb_abort(&h); - len=_snprintf(h.msg,BUFSIZE,"cddb hello %s %s mcd %s\n", - logname,hostname,MCD_VERSION); + len=_snprintf(h.msg,BUFSIZE,"cddb hello %s %s mcdp %s\n", + logname,hostname,MCDP_VERSION); write(h.fd,h.msg,len); - /* 200 Hello and welcome user@hostname running mcd version */ + /* 200 Hello and welcome user@hostname running mcdp version */ if ((len=cddb_readsocket(h.msg, BUFSIZE, &h.fd))<0) return cddb_abort(&h); if (strncmp("200",h.msg,3)) return cddb_abort(&h); diff -urN mcd-0.3h/cddev.c mcdp-0.3j/cddev.c --- mcd-0.3h/cddev.c Sat Apr 13 20:30:28 2002 +++ mcdp-0.3j/cddev.c Thu Jul 4 08:38:49 2002 @@ -1,14 +1,8 @@ -/* - * Author strongly advices against using this code, or a part of it, - * in an application designed to run on any Microsoft(tm) platform. - * - * See doc/README for more information about COPYING terms. - */ -#include "mcd.h" +#include "mcdp.h" short cddb; /* if 0, we have no entries and no remote stuff */ -static void cd_playmsf(struct mcd *cd, struct cdrom_msf *msf); +static void cd_playmsf(struct mcdp *cd, struct cdrom_msf *msf); -static void cd_playmsf(struct mcd *cd, struct cdrom_msf *msf) { +static void cd_playmsf(struct mcdp *cd, struct cdrom_msf *msf) { if (cd->status == CDROM_AUDIO_PLAY) if (ioctl(cd->fd,CDROMPAUSE,NULL)<0) return; @@ -19,7 +13,7 @@ /* GLOBAL */ /* look at the specs, should do, what they want :) */ -unsigned cd_discid(struct mcd *cd) { +unsigned cd_discid(struct mcdp *cd) { static unsigned cd_cddbsum(register int n) { register unsigned int ret=0; while (n>0) { @@ -35,7 +29,7 @@ } /* open device or exit ! */ -int cd_init(const char *cdpath, struct mcd *cd) { +int cd_init(const char *cdpath, struct mcdp *cd) { cd->fd=open(cdpath,O_RDONLY|O_NONBLOCK); if ((cd->fd<0) || (cd->status=ioctl(cd->fd,CDROM_DISC_STATUS,NULL)<0)) { _printf("Sorry, can't open cd-device \"%s\" !\n",cdpath); @@ -46,7 +40,7 @@ } /* needs correct cd->fd; seems very efficient (no division...) */ -int cd_readtracks(struct mcd *cd) { +int cd_readtracks(struct mcdp *cd) { struct cdrom_tochdr cdth; /* TocHdr Stuff */ register int i; @@ -55,7 +49,7 @@ return -1; } /* track[1] - [last-1])*/ - for (i=1;i<=cdth.cdth_trk1 && i<=MCD_CDAUDIO_MAX;i++) { + for (i=1;i<=cdth.cdth_trk1 && i<=MCDP_CDAUDIO_MAX;i++) { cd->cdte[i].cdte_track=i; cd->cdte[i].cdte_format=CDROM_MSF; if (ioctl(cd->fd, CDROMREADTOCENTRY, &cd->cdte[i])<0) @@ -102,7 +96,7 @@ } -int cd_readsubchannel(struct mcd *cd) { +int cd_readsubchannel(struct mcdp *cd) { struct cdrom_volctrl cdv; /* Volume Stuff */ /* trackinfos */ @@ -156,7 +150,7 @@ } /* set title[0] to new track before */ -void cd_start(struct mcd *cd) { +void cd_start(struct mcdp *cd) { struct cdrom_msf msf; /* checking for last/first */ @@ -169,7 +163,7 @@ if (cd->method==M_INTRO) { msf.cdmsf_min1 = cd->cdte[cd->title[0]].cdte_addr.msf.minute; - msf.cdmsf_sec1 = cd->cdte[cd->title[0]].cdte_addr.msf.second+MCD_INTRO_TIME; + msf.cdmsf_sec1 = cd->cdte[cd->title[0]].cdte_addr.msf.second+MCDP_INTRO_TIME; if (msf.cdmsf_sec1>=60) { msf.cdmsf_min1++; msf.cdmsf_sec1-=60; } msf.cdmsf_frame1 = cd->cdte[cd->title[0]].cdte_addr.msf.frame; } else { @@ -184,7 +178,7 @@ } /* only for skipping, rest is done via cd_play(..)! */ -void cd_skip(struct mcd *cd, int secs) { +void cd_skip(struct mcdp *cd, int secs) { struct cdrom_msf msf; if (cd->method==M_INTRO) return; /* skipping @intros ? */ @@ -210,14 +204,14 @@ return; } -void cd_stop(struct mcd *cd) { +void cd_stop(struct mcdp *cd) { if (cd->cds.cdsc_audiostatus == CDROM_AUDIO_PLAY) if (ioctl(cd->fd,CDROMSTOP,NULL)<0) draw_status("error stopping",1); return; } -void cd_pauseresume(struct mcd *cd) { +void cd_pauseresume(struct mcdp *cd) { switch (cd->cds.cdsc_audiostatus) { case CDROM_AUDIO_PLAY: ioctl(cd->fd,CDROMPAUSE,NULL); diff -urN mcd-0.3h/doc/CHANGES mcdp-0.3j/doc/CHANGES --- mcd-0.3h/doc/CHANGES Sat Apr 13 20:17:00 2002 +++ mcdp-0.3j/doc/CHANGES Fri Jul 12 15:18:24 2002 @@ -1,3 +1,13 @@ +0.3j +- marked CDDA_DEVICE to handle bus,lun,id in future, cd-text comes next +- CDROM == /dev/cdrom an so on, like in old versdion -> will be removed, + if cd-text works how I want it :) +- added the ugly-boxes definitions in params.h (from leo rosa, some time ago) + +0.3i: (deleted, use 0.3j instead!) + changed some environment variables + changed the name: mcd -> mcdp + 0.3h changed some environment variables ... see mcd.1! workman.c: workman entries parsing diff -urN mcd-0.3h/doc/INSTALL mcdp-0.3j/doc/INSTALL --- mcd-0.3h/doc/INSTALL Sat Apr 13 20:17:17 2002 +++ mcdp-0.3j/doc/INSTALL Thu Jul 4 08:34:53 2002 @@ -1,6 +1,6 @@ - Installing mcd -================ + Installing mcdp +================= 1. Possibly, edit the Makefile (compilertuning etc) $ vi Makefile diff -urN mcd-0.3h/doc/README mcdp-0.3j/doc/README --- mcd-0.3h/doc/README Sat Apr 13 20:31:54 2002 +++ mcdp-0.3j/doc/README Fri Jul 12 15:11:00 2002 @@ -2,7 +2,7 @@ WHAT IS IT ============ -- mcd is a small (maybe the smallest) cd-player for _linux_ +- mcdp is a small (maybe the smallest) cd-player for _linux_ - it compiles/runs out off the box - it can be compiled against dietlibc (~16kb static!) - working play methods: reapeat cd, repeat track and intro @@ -48,20 +48,23 @@ (btw: a new small mc will be my next project ...mmc?) - maybe some things of the wishlist... (if someone ask me, i will do it) - add a buffer for cddb stuff + fix protocol handling (we need FULL cddb!) -- add a buffer for drawing +- add a buffer for drawing (is on the way to ya) +- CD-Text (will also come next) + WISHLIST ========== -- CD-Text (i like this, but may cdrom not) -- shuffle isn't really done yet, it is added if it works well +- shuffle/random +- playlists + HOMEPAGE ========== - http://www.mcmilk.de/projects/mcd/ + http://www.mcmilk.de/projects/mcdp/ @@ -70,4 +73,4 @@ Please report bugs to: - Tino Reichardt + Tino Reichardt diff -urN mcd-0.3h/doc/THANKS mcdp-0.3j/doc/THANKS --- mcd-0.3h/doc/THANKS Thu Jan 1 01:00:00 1970 +++ mcdp-0.3j/doc/THANKS Thu Jul 4 09:32:49 2002 @@ -0,0 +1 @@ +Leo Rosa diff -urN mcd-0.3h/doc/profile.sh mcdp-0.3j/doc/profile.sh --- mcd-0.3h/doc/profile.sh Thu Jan 1 01:00:00 1970 +++ mcdp-0.3j/doc/profile.sh Fri Jul 12 15:13:09 2002 @@ -0,0 +1,18 @@ +# here are some sample entries for your /etc/profile: + +# this is for the next releases -> scsi cdrom or scsi-emulated atapi cdrom +CDDA_DEVICE='0,0,0' + +# this is the main device for playing audio cd's - will be removed +CDROM='/dev/your-default-cdrom-device' + +# IP:PORT - i haven't included any dns bloat in the code +CDDB_SERVER='194.97.4.18:888' + +# you need to create this directory for yourself! +CDDB_PATH="/home/user/.cddb" + + +export CDROM CDDB_SERVER CDDB_PATH CDDA_DEVICE + +# maybe WORKMANDB and so on ... later diff -urN mcd-0.3h/doc/profile.to-add mcdp-0.3j/doc/profile.to-add --- mcd-0.3h/doc/profile.to-add Sat Apr 13 20:21:04 2002 +++ mcdp-0.3j/doc/profile.to-add Thu Jan 1 01:00:00 1970 @@ -1,12 +0,0 @@ -# here are some sample entries for your /etc/profile: - -# this is the main device for playing audio cd's -CDROM='/dev/your-default-cdrom-device' - -# IP:PORT - i haven't included any dns bloat in the code -CDDB_SERVER='194.97.4.18:888' - -# you need to create this directory for yourself! -CDDB_PATH="/home/user/.cddb" - -export CDROM CDDB_SERVER CDDB_PATH diff -urN mcd-0.3h/draw.c mcdp-0.3j/draw.c --- mcd-0.3h/draw.c Sat Apr 13 19:30:57 2002 +++ mcdp-0.3j/draw.c Thu Jul 4 08:38:34 2002 @@ -1,17 +1,11 @@ -/* - * Author strongly advices against using this code, or a part of it, - * in an application designed to run on any Microsoft(tm) platform. - * - * See doc/README for more information about COPYING terms. - */ -#include "mcd.h" +#include "mcdp.h" short maxx,maxy; /* screenmaxima */ static void draw_hline(int i, char *ch); /* draw an hline */ static void draw_box(int x1, int y1, int x2, int y2); /* draw a box */ static void draw_method(char *msg); static void draw_initscr(void); -static void draw_tracks(struct mcd *cd); +static void draw_tracks(struct mcdp *cd); static void draw_hline(int i, char *ch) { if (i<0) return; @@ -57,7 +51,7 @@ show1(AC_MR); } show1(C_HEADLINE); - gotoxyw(3,2, "mcd version " MCD_VERSION); + gotoxyw(3,2, "mcdp version " MCDP_VERSION); if (cddb) gotoxyw(36,2,"freedb info"); gotoxyw(3,10,"tracklist"); show1(C_DESCRIPT); @@ -74,11 +68,11 @@ } /* this function looks strange since cddb =:) */ -static void draw_tracks(struct mcd *cd) { +static void draw_tracks(struct mcdp *cd) { register int i,m; /* title/modifier/realtitle */ int y=0,x=0; /* x,y==diffs to real */ - for (i=1;(i<=cd->title[1] && i<=MCD_CDAUDIO_MAX); i++) { + for (i=1;(i<=cd->title[1] && i<=MCDP_CDAUDIO_MAX); i++) { m=((i-(pluskey+1)*10)<0 && (i-(pluskey+1)*10)>-11); /* is shortcut? */ if (i%(maxy-10)==0) {y=-i;x+=15;} /* bottom reached, horiz. isn't checked! */ gotoxy(3+x,10+i+y); @@ -135,7 +129,7 @@ return; } -void draw_updatescr(struct mcd *cd) { +void draw_updatescr(struct mcdp *cd) { if (cd_readsubchannel(cd)<0) { draw_status("no disc (use e/c)",0); return; diff -urN mcd-0.3h/formats.c mcdp-0.3j/formats.c --- mcd-0.3h/formats.c Sat Apr 13 19:29:51 2002 +++ mcdp-0.3j/formats.c Thu Jul 4 08:33:15 2002 @@ -1,8 +1,4 @@ -/* - * modified version of stdio stuff from fefes dietlibc - * http://www.fefe.de/dietlibc/ - */ -#include "mcd.h" +#include "mcdp.h" int _ltostr(char *s, int size, unsigned long i, int base, char UpCase) { char *tmp; diff -urN mcd-0.3h/mcd.1 mcdp-0.3j/mcd.1 --- mcd-0.3h/mcd.1 Sat Apr 13 20:14:23 2002 +++ mcdp-0.3j/mcd.1 Thu Jan 1 01:00:00 1970 @@ -1,75 +0,0 @@ -.\" Tino Reichardt -.TH MCD 1 "2002-04-13" "mcd-0.3h" "User commands" -.SH "NAME" -mcd \- a small cdplayer for linux -.SH "SYNOPSIS" -\fBmcd\fR [\fI/dev/some-cdrom-device\fR] -.SH "DESCRIPTION" -The command \fBmcd\fR is used for playing AudioCD's. It has a curses like -userinterface and is fairly simple to use. -.SH "OPTIONS" -There is only one (optional) option: a cd device (e.g. /dev/cdrom2) ! -.SH "KEYS" -.TS -tab (@); -l l. -KEY@DESCRIPTION -@ -#@play track number # (0,1..9) -cursor up@fast forward -cursor right@slow forward -cursor left@slow rewind -cursor down@fast rewind -space@next track -b/B@previous track -S/s@toggle start/stop -P/p@toggle pause/resume -E/e@eject cdrom device -C/c@close cdrom device -R/r@redraw screen -M/m@change playmethod (-/+) -+/-@change trackmodifier (+/-) -@change audio volume of cdrom device (-/+) -Q/q@quit mcd -.TE -.SH "ENVIRONMENT VARIABLES" -.TS -tab (@); -l l. -CDROM@Try this cdrom as default (if unset, CDROM_DEFAULT -@from params.h is used). -CDDB_PATH@path to your local cddb files (if unset, _no_ cddb titelinfo -@is displayed) -CDDB_SERVER@IP:PORT of a freedb server (if unset, only local cddb -@stuff is used, if it exists in $CDDB_PATH/$discid). -LOGNAME@Is used for remote cddb login. -HOSTNAME@Is used for remote cddb login too. -.TE -.SH "FILES" -.TS -tab (@); -l l. -$HOME/.workmandb@Is used (first) for reading wmdb entries. -$CDDB_PATH/*@Is used for reeading/writing cddb entries. -.TE -.SH "RETURN VALUES" -.TS -tab (@); -l l. -\fB0\fP @no errors occured / normal quit -\fB1\fP @the given cd-device isn't a cd-device -\fB2\fP @your cd seems to be sth. other then a CD-Audio or CD-Mixed -\fB3\fP @some error while processing terminal code -.TE -.SH "NOTES" -Some terminals don't like the default escape-sequences from params.h ... if -so, you have to edit them ! Successfully tested terminals are \fBvt100\fP, -\fBlinux\fP, \fBxterm\fP, \fBxterm-color\fP. -.PP -If you haven't direct access to a freedb server, you may use some -port redirector program ... see freshmeat. -.SH "AUTHORS" -Tino Reichardt -Leo Rosa (patch for workman db) -.PP -Homepage: http://www.mcmilk.de/projects/mcd/ diff -urN mcd-0.3h/mcd.c mcdp-0.3j/mcd.c --- mcd-0.3h/mcd.c Sat Apr 13 20:16:29 2002 +++ mcdp-0.3j/mcd.c Thu Jan 1 01:00:00 1970 @@ -1,153 +0,0 @@ -/* - * Author strongly advices against using this code, or a part of it, - * in an application designed to run on any Microsoft(tm) platform. - * - * See doc/README for more information about COPYING terms. - */ -#include "mcd.h" - -short pluskey=0; /* 0..9|X is played */ -short updates[4]; /* see mcd.h */ - -int main(int argc, char **argv, char **environ) { - struct mcd *cd=malloc(sizeof(struct mcd)); - int quit=0; - char ch; - - if (argc>1) quit=cd_init(argv[1],&cd[0]); - else { /* try default stuff */ - if ((argv[1]=getenv("CDROM"))!=NULL) { /* env */ - quit=cd_init(argv[1],&cd[0]); - } else { - quit=cd_init(CDROM_DEFAULT,&cd[0]); /* params.h */ - } - } - if (quit<0) { - mesg(1,"Sorry, your disc isn't a Mixed-CD or Audio-CD !\n"); - exit(2); - } - - tty_mode(TERM_INIT); - signal(SIGINT,mcd_quit); - signal(SIGQUIT,mcd_quit); - signal(SIGTERM,mcd_quit); - - updates[U_ALL]=1; - while (!quit) { - draw_updatescr(&cd[0]); - if (1 == select_wait(0,1)) { - read(0,&ch,1); - switch (ch) { - case '\033': - read(0,&ch,1);read(0,&ch,1); /* XXX - should be done in another way ? */ - switch(ch) { - case 'A': cd_skip(&cd[0], FW_FAST);break; /* c_up */ - case 'B': cd_skip(&cd[0],-RW_FAST);break; /* c_down */ - case 'C': cd_skip(&cd[0], FW_SLOW);break; /* c_left */ - case 'D': cd_skip(&cd[0],-RW_SLOW);break; /* c_right */ - } - break; - case ' ': /* next */ - cd->title[0]++;cd_start(&cd[0]); - updates[U_TRACKS]=1; - break; - case 'b': /* previous */ - case 'B': - cd->title[0]--;cd_start(&cd[0]); - updates[U_TRACKS]=1; - break; - case 'r': - case 'R': - updates[U_ALL]=1; - break; - case 'm': - if (cd->methodmethod++; - else cd->method=M_PLAY_CD; - updates[U_TRACKS]=updates[U_METHOD]=1; - break; - case 'M': - if (cd->method>M_PLAY_CD) cd->method--; - else cd->method=M_INTRO; - updates[U_METHOD]=1; - break; - case 'P': - case 'p': - cd_pauseresume(&cd[0]); - updates[U_STATUS]=1; - break; - case 'S': - case 's': - if (cd->status==CDROM_AUDIO_PLAY) { - cd_stop(&cd[0]); - } else { - cd->title[0]=1; - cd_start(&cd[0]); - } - updates[U_STATUS]=updates[U_TRACKS]=1; - break; - case 'E': - case 'e': - cd_eject(&cd->fd); - updates[U_ALL]=1; - break; - case 'C': - case 'c': - cd_close(&cd->fd); - updates[U_ALL]=1; - break; - case '?': - case 'H': - case 'h': - system("man mcd"); - break; - case '+': - pluskey=(pluskey<9)?++pluskey:0; - updates[U_TRACKS]=1; - break; - case '-': - pluskey=(pluskey>0)?--pluskey:9; - updates[U_TRACKS]=1; - break; - case '<': - cd->vol.channel0=cd->vol.channel1=cd->vol.channel2=cd->vol.channel3= - (cd->vol.channel0>0)?cd->vol.channel0-=3:255; - if (ioctl(cd->fd,CDROMVOLCTRL,&cd->vol)<0) - draw_status("error: setting volume",1); - updates[U_VOLUME]=1; - break; - case '>': - cd->vol.channel0=cd->vol.channel1=cd->vol.channel2=cd->vol.channel3= - (cd->vol.channel0<255)?cd->vol.channel0+=3:0; - if (ioctl(cd->fd,CDROMVOLCTRL,&cd->vol)<0) - draw_status("error: setting volume",1); - updates[U_VOLUME]=1; - break; - case 'q': - case 'Q': - quit=1; - break; - case '0': - if (!pluskey && !((int)ch-48)) { - draw_status("hey, this isn't valid!",1); - break; - } - case '1': case '2': case '3': case '4': case '5': case '6': - case '7': case '8': case '9': - if ((pluskey*10)+((int)ch-48)>cd->title[1] || (pluskey*10)+((int)ch-48)<1) break; - else { - cd->title[0]=((pluskey*10)+((int)ch-48)); - cd_start(&cd[0]); - updates[U_TRACKS]=1; - } - break; - } /* switch */ - } /* select */ - } /* while */ - mcd_quit(1); /* cleanup */ - exit(0); -} - -void mcd_quit(int i) { - show1(T_NORMAL T_HOME T_CLEAR T_BOLD "ByeBye...\n\n" T_NORMAL); - tty_mode(TERM_QUIT); -} diff -urN mcd-0.3h/mcd.h mcdp-0.3j/mcd.h --- mcd-0.3h/mcd.h Sat Apr 13 20:07:15 2002 +++ mcdp-0.3j/mcd.h Thu Jan 1 01:00:00 1970 @@ -1,143 +0,0 @@ -/* - * Author strongly advices against using this code, or a part of it, - * in an application designed to run on any Microsoft(tm) platform. - * - * See doc/README for more information about COPYING terms. - */ -#ifndef _MCD_H -#define _MCD_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "params.h" - -#define MCD_VERSION "0.3h" - -/* METHODS */ -#define M_PLAY_CD 0 /* play whole cd and stop */ -#define M_REPEAT_CD 1 /* play whole cd in endless-loop */ -#define M_REPEAT_TRK 2 /* play current track in endless-loop */ -#define M_INTRO 3 /* play first ten seconds of each track and stop */ - -/* UPDATES */ -#define U_STATUS 0 /* only titles are updated */ -#define U_METHOD 1 /* status-method is updated */ -#define U_VOLUME 2 /* status-volume is updated */ -#define U_TRACKS 3 /* all tracks are updated */ -#define U_ALL 4 /* really ALL is updated */ - -#define CDDB_NOENT 0 /* no local cddb, no remote access*/ -#define CDDB_LOCAL 1 /* local entry is used */ -#define CDDB_REMOTE 2 /* can download from CDDB_SERVER */ -#define CDDB_WORKMAN 3 /* local entry .workman format */ - -/* ***** */ -/* mcd.c */ -struct track { - int audio; /* current track is audio */ - int sec; /* seconds of current title */ - int min; /* minutes of current title */ - int cddb; /* cddb-trackid, 0=discid */ - char name[CDDB_TITLEMAX]; /* name of title, 0=artist/cdname (XXX: is fixed sized okay?) */ -}; - -struct mcd { - int fd; /* file descriptor */ - int method; /* current playing METHOD (M_*) */ - int status; /* old status, compared to cds.audiost.. */ - int title[1]; /* current/last title */ - struct track t[MCD_CDAUDIO_MAX+1]; /* calculated times of all tracks */ - struct cdrom_volctrl vol; /* current channel0..3 (0..255) */ - struct cdrom_subchnl cds; /* tmp subchannelinfos */ - struct cdrom_tocentry cdte[MCD_CDAUDIO_MAX+1]; /* mainly for playmsf */ -}; - -struct he { - int fd; /* socketfd */ - char *msg; /* some msg */ -}; - -extern short pluskey,updates[4]; -extern void mcd_quit(int); /* cleanups + quit */ - -/* ****** */ -/* cddb.c */ -extern short cddb; -extern char port[6], ip[16]; - -extern int cddb_getentries(struct mcd *cd); /* fills cd->t[].name, sets cddb variable */ -extern int wmdb_getentries(struct mcd *cd); /* fills also cd->t[].name */ - -/* ***** */ -/* tty.c */ -#define TERM_INIT 0 /* save current value (only one time) */ -#define TERM_QUIT 1 /* reset terminal to the old values */ -extern void tty_mode(int mode); /* for setting up the terminal */ -extern int tty_getsize(short *x, short *y); /* termsize to x,y */ -extern void tty_resize(int i); /* after changes */ - -/* aliase */ -#define show1(m) mesg(1,(char*)m) /* to stdout */ -#define show2(m) mesg(2,(char*)m) /* to stderr */ -#define gotoxy(x,y) _printf(T_GOTO_XY, y, x) -#define gotoxyw(x,y,t) _printf(T_GOTO_XY "%s", y, x, t) - -/* ****** */ -/* draw.c */ -extern short maxx,maxy; - -extern void draw_updatescr(struct mcd *cd); -extern void draw_status(char *msg, short update); - -/* ****** */ -/* misc.c */ -extern int select_wait(int fd, int sec); -extern void mesg(int fd, char *msg); - -/* ******* */ -/* cddev.c */ -extern int cd_init(const char *cdpath, struct mcd *cd); -extern int cd_readtracks(struct mcd *cd); -extern int cd_readsubchannel(struct mcd *cd); -extern void cd_pauseresume(struct mcd *cd); -extern void cd_skip(struct mcd *cd, int secs); -extern void cd_start(struct mcd *cd); -extern void cd_stop(struct mcd *cd); -extern void cd_eject(int *fd); -extern void cd_close(int *fd); -extern unsigned cd_discid(struct mcd *cd); - -/* ********* */ -/* formats.c */ -extern int _printf(const char *format, ...); -extern int _sprintf(char *str, const char *format, ...); -extern int _snprintf(char *str, size_t size, const char *format, ...); -extern int _vsnprintf(char *str, size_t size, const char *format, va_list ap); -extern int _ltostr(char *s, int size, unsigned long i, int base, char UpCase); - -/* ***** */ -/* str.c */ -extern size_t str_len(const unsigned char *str); -extern size_t str_ncpy(unsigned char *dst, const unsigned char *src, size_t n); - -#endif /* _MCD_H */ diff -urN mcd-0.3h/mcd.lsm mcdp-0.3j/mcd.lsm --- mcd-0.3h/mcd.lsm Sat Apr 13 20:15:04 2002 +++ mcdp-0.3j/mcd.lsm Thu Jan 1 01:00:00 1970 @@ -1,18 +0,0 @@ -Begin4 -Title: mcd -Version: 0.3h -Entered-date: 2002-04-13 -Description: Is a small cd player application with a curses like - interface. Has a track database, supports remote/local cddb - track data, different play modes and volume control. -Keywords: cd, player, audio, sound, curses, dietlibc, cddb, freedb, - workmandb -Author: Tino Reichardt -Maintained-by: Tino Reichardt -Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/cdrom - 21kB mcd-0.3f.tar.gz - 16kB mcd-0.3f.bin.gz (static binary!) -Alternate-site: http://www.mcmilk.de/projects/mcd/ -Platforms: Linux >=2.2 -Copying-policy: Gnu Library General Public License (GLPL) 2.0 -End diff -urN mcd-0.3h/mcdp.1 mcdp-0.3j/mcdp.1 --- mcd-0.3h/mcdp.1 Thu Jan 1 01:00:00 1970 +++ mcdp-0.3j/mcdp.1 Fri Jul 12 15:19:26 2002 @@ -0,0 +1,75 @@ +.\" Tino Reichardt +.TH MCDP 1 "2002-04-13" "mcdp-0.3i" "User commands" +.SH "NAME" +mcdp \- a small cdplayer for linux +.SH "SYNOPSIS" +\fBmcdp\fR [\fI/dev/some-cdrom-device\fR] +.SH "DESCRIPTION" +The command \fBmcdp\fR is used for playing AudioCD's. It has a curses like +userinterface and is fairly simple to use. +.SH "OPTIONS" +There is only one (optional) option: a cd device (e.g. /dev/cdrom2) ! +.SH "KEYS" +.TS +tab (@); +l l. +KEY@DESCRIPTION +@ +#@play track number # (0,1..9) +cursor up@fast forward +cursor right@slow forward +cursor left@slow rewind +cursor down@fast rewind +space@next track +b/B@previous track +S/s@toggle start/stop +P/p@toggle pause/resume +E/e@eject cdrom device +C/c@close cdrom device +R/r@redraw screen +M/m@change playmethod (-/+) ++/-@change trackmodifier (+/-) +@change audio volume of cdrom device (-/+) +Q/q@quit mcdp +.TE +.SH "ENVIRONMENT VARIABLES" +.TS +tab (@); +l l. +CDDA_DEVICE@Reserved or later :) +CDROM@Try this cdrom as default (if unset, CDROM_DEFAULT +@from params.h is used). +CDDB_PATH@path to your local cddb files (if unset, _no_ cddb titelinfo +@is displayed) +CDDB_SERVER@IP:PORT of a freedb server (if unset, only local cddb +@stuff is used, if it exists in $CDDB_PATH/$discid). +LOGNAME@Is used for remote cddb login. +HOSTNAME@Is used for remote cddb login too. +.TE +.SH "FILES" +.TS +tab (@); +l l. +$HOME/.workmandb@Is used (first) for reading wmdb entries. +$CDDB_PATH/*@Is used for reeading/writing cddb entries. +.TE +.SH "RETURN VALUES" +.TS +tab (@); +l l. +\fB0\fP @no errors occured / normal quit +\fB1\fP @the given cd-device isn't a cd-device +\fB2\fP @your cd seems to be sth. other then a CD-Audio or CD-Mixed +\fB3\fP @some error while processing terminal code +.TE +.SH "NOTES" +Some terminals don't like the default escape-sequences from params.h ... if +so, you have to edit them ! Successfully tested terminals are \fBvt100\fP, +\fBlinux\fP, \fBxterm\fP, \fBxterm-color\fP. +.PP +If you haven't direct access to a freedb server, you may use some +port redirector program ... see freshmeat. +.SH "AUTHOR" +Tino Reichardt +.PP +Homepage: http://www.mcmilk.de/projects/mcdp/ diff -urN mcd-0.3h/mcdp.c mcdp-0.3j/mcdp.c --- mcd-0.3h/mcdp.c Thu Jan 1 01:00:00 1970 +++ mcdp-0.3j/mcdp.c Fri Jul 12 15:14:01 2002 @@ -0,0 +1,148 @@ +#include "mcdp.h" +short pluskey=0; /* 0..9|X is played */ +short updates[4]; /* see mcdp.h */ + +int main(int argc, char **argv, char **environ) { + struct mcdp *cd=malloc(sizeof(struct mcdp)); + int quit=0; + char ch; + + if (argc>1) quit=cd_init(argv[1],&cd[0]); + else { /* try default stuff */ + /* CDDA_DEVICE -> 0,0,0 - like cdda2wav ... */ + /* if ((argv[1]=getenv("CDDA_DEVICE"))!=NULL) { */ + if ((argv[1]=getenv("CDROM"))!=NULL) { + quit=cd_init(argv[1],&cd[0]); + } else { + quit=cd_init(CDROM_DEFAULT,&cd[0]); /* params.h */ + } + } + if (quit<0) { + mesg(1,"Sorry, your disc isn't a Mixed-CD or Audio-CD !\n"); + exit(2); + } + + tty_mode(TERM_INIT); + signal(SIGINT,mcdp_quit); + signal(SIGQUIT,mcdp_quit); + signal(SIGTERM,mcdp_quit); + + updates[U_ALL]=1; + while (!quit) { + draw_updatescr(&cd[0]); + if (1 == select_wait(0,1)) { + read(0,&ch,1); + switch (ch) { + case '\033': + read(0,&ch,1);read(0,&ch,1); /* XXX - should be done in another way ? */ + switch(ch) { + case 'A': cd_skip(&cd[0], FW_FAST);break; /* c_up */ + case 'B': cd_skip(&cd[0],-RW_FAST);break; /* c_down */ + case 'C': cd_skip(&cd[0], FW_SLOW);break; /* c_left */ + case 'D': cd_skip(&cd[0],-RW_SLOW);break; /* c_right */ + } + break; + case ' ': /* next */ + cd->title[0]++;cd_start(&cd[0]); + updates[U_TRACKS]=1; + break; + case 'b': /* previous */ + case 'B': + cd->title[0]--;cd_start(&cd[0]); + updates[U_TRACKS]=1; + break; + case 'r': + case 'R': + updates[U_ALL]=1; + break; + case 'm': + if (cd->methodmethod++; + else cd->method=M_PLAY_CD; + updates[U_TRACKS]=updates[U_METHOD]=1; + break; + case 'M': + if (cd->method>M_PLAY_CD) cd->method--; + else cd->method=M_INTRO; + updates[U_METHOD]=1; + break; + case 'P': + case 'p': + cd_pauseresume(&cd[0]); + updates[U_STATUS]=1; + break; + case 'S': + case 's': + if (cd->status==CDROM_AUDIO_PLAY) { + cd_stop(&cd[0]); + } else { + cd->title[0]=1; + cd_start(&cd[0]); + } + updates[U_STATUS]=updates[U_TRACKS]=1; + break; + case 'E': + case 'e': + cd_eject(&cd->fd); + updates[U_ALL]=1; + break; + case 'C': + case 'c': + cd_close(&cd->fd); + updates[U_ALL]=1; + break; + case '?': + case 'H': + case 'h': + system("man mcdp"); + break; + case '+': + pluskey=(pluskey<9)?++pluskey:0; + updates[U_TRACKS]=1; + break; + case '-': + pluskey=(pluskey>0)?--pluskey:9; + updates[U_TRACKS]=1; + break; + case '<': + cd->vol.channel0=cd->vol.channel1=cd->vol.channel2=cd->vol.channel3= + (cd->vol.channel0>0)?cd->vol.channel0-=3:255; + if (ioctl(cd->fd,CDROMVOLCTRL,&cd->vol)<0) + draw_status("error: setting volume",1); + updates[U_VOLUME]=1; + break; + case '>': + cd->vol.channel0=cd->vol.channel1=cd->vol.channel2=cd->vol.channel3= + (cd->vol.channel0<255)?cd->vol.channel0+=3:0; + if (ioctl(cd->fd,CDROMVOLCTRL,&cd->vol)<0) + draw_status("error: setting volume",1); + updates[U_VOLUME]=1; + break; + case 'q': + case 'Q': + quit=1; + break; + case '0': + if (!pluskey && !((int)ch-48)) { + draw_status("hey, this isn't valid!",1); + break; + } + case '1': case '2': case '3': case '4': case '5': case '6': + case '7': case '8': case '9': + if ((pluskey*10)+((int)ch-48)>cd->title[1] || (pluskey*10)+((int)ch-48)<1) break; + else { + cd->title[0]=((pluskey*10)+((int)ch-48)); + cd_start(&cd[0]); + updates[U_TRACKS]=1; + } + break; + } /* switch */ + } /* select */ + } /* while */ + mcdp_quit(1); /* cleanup */ + exit(0); +} + +void mcdp_quit(int i) { + show1(T_NORMAL T_HOME T_CLEAR T_BOLD "ByeBye...\n\n" T_NORMAL); + tty_mode(TERM_QUIT); +} diff -urN mcd-0.3h/mcdp.h mcdp-0.3j/mcdp.h --- mcd-0.3h/mcdp.h Thu Jan 1 01:00:00 1970 +++ mcdp-0.3j/mcdp.h Fri Jul 12 15:24:30 2002 @@ -0,0 +1,143 @@ +/* + * Author strongly advices against using this code, or a part of it, + * in an application designed to run on any Microsoft(tm) platform. + * + * See doc/README for more information about COPYING terms. + */ +#ifndef _MCDP_H +#define _MCDP_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "params.h" + +#define MCDP_VERSION "0.3j" + +/* METHODS */ +#define M_PLAY_CD 0 /* play whole cd and stop */ +#define M_REPEAT_CD 1 /* play whole cd in endless-loop */ +#define M_REPEAT_TRK 2 /* play current track in endless-loop */ +#define M_INTRO 3 /* play first ten seconds of each track and stop */ + +/* UPDATES */ +#define U_STATUS 0 /* only titles are updated */ +#define U_METHOD 1 /* status-method is updated */ +#define U_VOLUME 2 /* status-volume is updated */ +#define U_TRACKS 3 /* all tracks are updated */ +#define U_ALL 4 /* really ALL is updated */ + +#define CDDB_NOENT 0 /* no local cddb, no remote access*/ +#define CDDB_LOCAL 1 /* local entry is used */ +#define CDDB_REMOTE 2 /* can download from CDDB_SERVER */ +#define CDDB_WORKMAN 3 /* local entry .workman format */ + +/* ***** */ +/* mcdp.c */ +struct track { + int audio; /* current track is audio */ + int sec; /* seconds of current title */ + int min; /* minutes of current title */ + int cddb; /* cddb-trackid, 0=discid */ + char name[CDDB_TITLEMAX]; /* name of title, 0=artist/cdname (XXX: is fixed sized okay?) */ +}; + +struct mcdp { + int fd; /* file descriptor */ + int method; /* current playing METHOD (M_*) */ + int status; /* old status, compared to cds.audiost.. */ + int title[1]; /* current/last title */ + struct track t[MCDP_CDAUDIO_MAX+1]; /* calculated times of all tracks */ + struct cdrom_volctrl vol; /* current channel0..3 (0..255) */ + struct cdrom_subchnl cds; /* tmp subchannelinfos */ + struct cdrom_tocentry cdte[MCDP_CDAUDIO_MAX+1]; /* mainly for playmsf */ +}; + +struct he { + int fd; /* socketfd */ + char *msg; /* some msg */ +}; + +extern short pluskey,updates[4]; +extern void mcdp_quit(int); /* cleanups + quit */ + +/* ****** */ +/* cddb.c */ +extern short cddb; +extern char port[6], ip[16]; + +extern int cddb_getentries(struct mcdp *cd); /* fills cd->t[].name, sets cddb variable */ +extern int wmdb_getentries(struct mcdp *cd); /* fills also cd->t[].name */ + +/* ***** */ +/* tty.c */ +#define TERM_INIT 0 /* save current value (only one time) */ +#define TERM_QUIT 1 /* reset terminal to the old values */ +extern void tty_mode(int mode); /* for setting up the terminal */ +extern int tty_getsize(short *x, short *y); /* termsize to x,y */ +extern void tty_resize(int i); /* after changes */ + +/* aliase */ +#define show1(m) mesg(1,(char*)m) /* to stdout */ +#define show2(m) mesg(2,(char*)m) /* to stderr */ +#define gotoxy(x,y) _printf(T_GOTO_XY, y, x) +#define gotoxyw(x,y,t) _printf(T_GOTO_XY "%s", y, x, t) + +/* ****** */ +/* draw.c */ +extern short maxx,maxy; + +extern void draw_updatescr(struct mcdp *cd); +extern void draw_status(char *msg, short update); + +/* ****** */ +/* misc.c */ +extern int select_wait(int fd, int sec); +extern void mesg(int fd, char *msg); + +/* ******* */ +/* cddev.c */ +extern int cd_init(const char *cdpath, struct mcdp *cd); +extern int cd_readtracks(struct mcdp *cd); +extern int cd_readsubchannel(struct mcdp *cd); +extern void cd_pauseresume(struct mcdp *cd); +extern void cd_skip(struct mcdp *cd, int secs); +extern void cd_start(struct mcdp *cd); +extern void cd_stop(struct mcdp *cd); +extern void cd_eject(int *fd); +extern void cd_close(int *fd); +extern unsigned cd_discid(struct mcdp *cd); + +/* ********* */ +/* formats.c */ +extern int _printf(const char *format, ...); +extern int _sprintf(char *str, const char *format, ...); +extern int _snprintf(char *str, size_t size, const char *format, ...); +extern int _vsnprintf(char *str, size_t size, const char *format, va_list ap); +extern int _ltostr(char *s, int size, unsigned long i, int base, char UpCase); + +/* ***** */ +/* str.c */ +extern size_t str_len(const unsigned char *str); +extern size_t str_ncpy(unsigned char *dst, const unsigned char *src, size_t n); + +#endif /* _MCDP_H */ diff -urN mcd-0.3h/mcdp.lsm mcdp-0.3j/mcdp.lsm --- mcd-0.3h/mcdp.lsm Thu Jan 1 01:00:00 1970 +++ mcdp-0.3j/mcdp.lsm Fri Jul 12 15:24:08 2002 @@ -0,0 +1,18 @@ +Begin4 +Title: mcdp +Version: 0.3j +Entered-date: 2002-04-13 +Description: Is a small cd player application with a curses like + interface. Has a track database, supports remote/local cddb + track data, different play modes and volume control. +Keywords: cd, player, audio, sound, curses, dietlibc, cddb, freedb, + workmandb +Author: Tino Reichardt +Maintained-by: Tino Reichardt +Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/cdrom + 21kB mcdp-0.3j.tar.gz + 10kB mcdp-0.3j.bin.gz (static binary, upx compressed!) +Alternate-site: http://www.mcmilk.de/projects/mcdp/ +Platforms: Linux >=2.2 +Copying-policy: Gnu Library General Public License (GLPL) 2.0 +End diff -urN mcd-0.3h/misc.c mcdp-0.3j/misc.c --- mcd-0.3h/misc.c Sat Apr 13 19:30:42 2002 +++ mcdp-0.3j/misc.c Thu Jul 4 08:33:41 2002 @@ -1,10 +1,4 @@ -/* - * Author strongly advices against using this code, or a part of it, - * in an application designed to run on any Microsoft(tm) platform. - * - * See doc/README for more information about COPYING terms. - */ -#include "mcd.h" +#include "mcdp.h" int select_wait(int fd, int sec) { struct timeval tv; diff -urN mcd-0.3h/params.h mcdp-0.3j/params.h --- mcd-0.3h/params.h Sat Apr 13 19:45:07 2002 +++ mcdp-0.3j/params.h Fri Jul 12 15:17:22 2002 @@ -3,8 +3,8 @@ * When you're done, type 'make' to compile and link. * Then you may install with 'make install'. */ -#ifndef _MCD_PARAMS_H -#define _MCD_PARAMS_H +#ifndef _MCDP_PARAMS_H +#define _MCDP_PARAMS_H // #define CDROM_DEFAULT "/dev/cdrom" /* !devfs */ #define CDROM_DEFAULT "/dev/cdroms/cdrom0" /* devfs */ @@ -16,8 +16,8 @@ */ #define CDDB_TITLEMAX 62 -#define MCD_INTRO_TIME 10 /* seconds for the intro */ -#define MCD_CDAUDIO_MAX 99 /* maxtracks of the cd (RedBook) */ +#define MCDP_INTRO_TIME 10 /* seconds for the intro */ +#define MCDP_CDAUDIO_MAX 99 /* maxtracks of the cd (RedBook) */ #define FW_FAST 30 /* FF (sec. ffast forward) */ #define FW_SLOW 6 /* FW (sec. fslow forward) */ @@ -38,6 +38,7 @@ #define T_GOTO_XY "\033[%d;%dH" /* goto x,y position (%d=int) */ /* box drawing */ +#if 1 /* if you have some ugly old terminals, define it to 0 */ #define AC_TL "\016l\017" /* top left */ #define AC_TR "\016k\017" /* top right */ #define AC_BL "\016m\017" /* bottom left */ @@ -49,6 +50,19 @@ #define AC_MM "\016n\017" /* middle + */ #define AC_HL "\016q\017" /* hline - */ #define AC_VL "\016x\017" /* vline | */ +#else +#define AC_TL "," /* top left */ +#define AC_TR "." /* top right */ +#define AC_BL "`" /* bottom left */ +#define AC_BR "'" /* bottom right */ +#define AC_MT "^" /* top 2middle */ +#define AC_MB "v" /* bottom 2middle */ +#define AC_ML ">" /* left 2middle */ +#define AC_MR "<" /* right 2middle */ +#define AC_MM "+" /* middle + */ +#define AC_HL "-" /* hline - */ +#define AC_VL "|" /* vline | */ +#endif /* colors */ #define C_BOX "\033[0;34m" /* blue - boxdrawing */ @@ -61,4 +75,4 @@ * bg: 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=grey */ -#endif /* _MCD_PARAMS_H */ +#endif /* _MCDP_PARAMS_H */ diff -urN mcd-0.3h/str.c mcdp-0.3j/str.c --- mcd-0.3h/str.c Sat Apr 13 19:42:19 2002 +++ mcdp-0.3j/str.c Thu Jul 4 08:33:54 2002 @@ -1,10 +1,4 @@ -/* - * Author strongly advices against using this code, or a part of it, - * in an application designed to run on any Microsoft(tm) platform. - * - * See doc/README for more information about COPYING terms. - */ -#include "mcd.h" +#include "mcdp.h" size_t str_len(const unsigned char *str) { register size_t n=0; diff -urN mcd-0.3h/tty.c mcdp-0.3j/tty.c --- mcd-0.3h/tty.c Sat Apr 13 19:30:31 2002 +++ mcdp-0.3j/tty.c Thu Jul 4 08:33:59 2002 @@ -1,10 +1,4 @@ -/* - * Author strongly advices against using this code, or a part of it, - * in an application designed to run on any Microsoft(tm) platform. - * - * See doc/README for more information about COPYING terms. - */ -#include "mcd.h" +#include "mcdp.h" void tty_mode(int mode) { static struct termios told; diff -urN mcd-0.3h/workman.c mcdp-0.3j/workman.c --- mcd-0.3h/workman.c Sat Apr 13 20:32:17 2002 +++ mcdp-0.3j/workman.c Thu Jul 4 08:37:44 2002 @@ -1,15 +1,9 @@ -/* - * Author strongly advices against using this code, or a part of it, - * in an application designed to run on any Microsoft(tm) platform. - * - * See doc/README for more information about COPYING terms. - */ -#include "mcd.h" +#include "mcdp.h" -static short wmdb_testdisk(char *fn, struct mcd *cd); +static short wmdb_testdisk(char *fn, struct mcdp *cd); /* test the disk lenght */ -static short wmdb_testdisk(char *fn, struct mcd *cd) { +static short wmdb_testdisk(char *fn, struct mcdp *cd) { register int pos=0,i=0; while(fn[i++]!='\0') if(fn[i]==' ') pos=i; /* jump spaces */ @@ -17,7 +11,7 @@ return 0; } -int wmdb_getentries(struct mcd *cd) { +int wmdb_getentries(struct mcdp *cd) { char *fn=malloc(sizeof(char)*PATH_MAX); int p=0,tr=0,len,fd; /* p=parse;tr=track */ char ch;