From bbf33cb4cdfaef9afd70b1355c78121773461f49 Mon Sep 17 00:00:00 2001 From: Antoine Jacquet Date: Sun, 15 Jan 2006 00:00:00 +0100 Subject: [PATCH] version 0.33 * code cleanup to avoid compilation warnings with gcc 4 (patch by Laurent Coustet) * remove leading "./" when parsing current directory * remove double "//" when parsing a directory ending with a "/" (patch by Laurent Coustet) --- CHANGELOG | 5 +++++ README | 2 +- fapg.c | 60 ++++++++++++++++++++++++++++++++----------------------- 3 files changed, 41 insertions(+), 26 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 98fcadf..4acccea 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,10 @@ Change log file for FAPG +version 0.33 (2006-01-15) + * code cleanup to avoid compilation warnings with gcc 4 (patch by Laurent Coustet) + * remove leading "./" when parsing current directory + * remove double "//" when parsing a directory ending with a "/" (patch by Laurent Coustet) + version 0.32 (2005-02-07) * back to a basic Makefile for clean packinging purposes diff --git a/README b/README index bd41f82..529b653 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -FAPG 0.32 (Fast Audio Playlist Generator) +FAPG 0.33 (Fast Audio Playlist Generator) site: http://royale.zerezo.com/fapg/ mail: royale@zerezo.com diff --git a/fapg.c b/fapg.c index 529a26f..b800d76 100644 --- a/fapg.c +++ b/fapg.c @@ -1,5 +1,5 @@ /* - * FAPG version 0.32 + * FAPG version 0.33 * * FAPG means Fast Audio Playlist Generator. * It is a tool to generate list of audio files (Wav, MP3, Ogg, etc) @@ -46,24 +46,24 @@ int debug=0; int format=0; /* 0 = m3u ; 1 = pls ; 2 = html */ char *genrelist=NULL; -unsigned char *prefix=""; +char *prefix=""; int recursive=0; int avoidhlinked=0; int separator='/'; int skip=0; int windows=0; -unsigned char *eol="\n"; -unsigned char buffer[MAX]; +char *eol="\n"; +char buffer[MAX]; int counter=0; -unsigned char artist[1024]; -unsigned char title[1024]; -unsigned char genrebuf[1024]; -unsigned char genre=0; +char artist[1024]; +char title[1024]; +char genrebuf[1024]; +char genre=0; int duration; -unsigned char unix2dos[256]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,70,35,36,37,38,39,40,41,82,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,84,59,36,61,65,71,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,36,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,36,125,126,127,199,252,233,226,228,224,229,231,234,235,232,239,238,236,196,197,201,230,198,244,246,242,251,249,255,214,220,248,163,216,215,131,225,237,243,250,241,209,170,186,191,174,172,189,188,161,171,187,166,166,166,166,166,193,194,192,169,166,166,43,43,162,165,43,43,45,45,43,45,43,227,195,43,43,45,45,166,45,43,164,240,208,202,203,200,105,205,206,207,43,43,166,220,166,204,175,211,223,212,210,245,213,181,254,222,218,219,217,253,221,175,180,173,177,61,190,182,167,247,184,176,168,183,185,179,178,166,160}; +char unix2dos[256]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,70,35,36,37,38,39,40,41,82,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,84,59,36,61,65,71,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,36,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,36,125,126,127,199,252,233,226,228,224,229,231,234,235,232,239,238,236,196,197,201,230,198,244,246,242,251,249,255,214,220,248,163,216,215,131,225,237,243,250,241,209,170,186,191,174,172,189,188,161,171,187,166,166,166,166,166,193,194,192,169,166,166,43,43,162,165,43,43,45,45,43,45,43,227,195,43,43,45,45,166,45,43,164,240,208,202,203,200,105,205,206,207,43,43,166,220,166,204,175,211,223,212,210,245,213,181,254,222,218,219,217,253,221,175,180,173,177,61,190,182,167,247,184,176,168,183,185,179,178,166,160}; void usage() { @@ -172,7 +172,7 @@ void parse_options(int argc,char **argv) } } -void parse_mp3(unsigned char *file) +void parse_mp3(char *file) { int bitrates[2][3][15]= {{{0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448}, @@ -182,7 +182,7 @@ void parse_mp3(unsigned char *file) {0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160}, {0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160}}}; FILE *fic; - unsigned char *c; + char *c; int lus; genre=0; @@ -266,7 +266,7 @@ void parse_mp3(unsigned char *file) while (c> parsing directory : %s\n",path); @@ -577,7 +587,7 @@ void parse_directory(unsigned char *path) /* hlink_check() might be applied more selective ... avoidhlink is only a simple prereq */ if (S_ISREG(infos.st_mode) && ! ( avoidhlinked && hlink_check(&infos) ) ) { - unsigned char ext[5]; + char ext[5]; int j; for (j=0;j<5;j++) ext[j]=tolower(namelist[i]->d_name[strlen(namelist[i]->d_name)-4+j]); artist[0]='\0'; @@ -590,7 +600,7 @@ void parse_directory(unsigned char *path) if (strcmp(".ogg",ext)==0) { duration=-1; parse_ogg(newpath); } if (strcmp(".wav",ext)==0) { duration=-1; /* parse_wav(newpath); */ } - if (duration!=-2 && genrelist[genre]) /* is it an audio file ? */ + if (duration!=-2 && genrelist[(int)genre]) /* is it an audio file ? */ { counter++; switch (format) @@ -642,7 +652,7 @@ int main(int argc,char **argv) printf("[playlist]%s",eol); break; case 2: - printf("%s%s%s%s%sPlaylist generated by FAPG 0.32%s%s%s%s%s%s%s

Playlist

%s%s%s%s",eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol); + printf("%s%s%s%s%sPlaylist generated by FAPG 0.33%s%s%s%s%s%s%s

Playlist

%s%s
EntryArtistTitleLength
%s%s",eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol,eol); break; } for (;optind%s%s

Playlist generated by FAPG 0.32

%s%s%s%s",eol,eol,eol,eol,eol,eol); + printf("
EntryArtistTitleLength
%s%s

Playlist generated by FAPG 0.33

%s%s%s%s",eol,eol,eol,eol,eol,eol); break; } if (genrelist) free(genrelist); -- 2.20.1