disco-dl

Discography/album downloader
git clone git://git.wimdupont.com/disco-dl.git
Log | Files | Refs

commit 84ee158e2241e99fd5fb3e97a10d4da2008c51b7
parent 9af0ab3d5b7f68d10f73f8d87e1ac830876f0b44
Author: Wim Dupont <wim@wimdupont.com>
Date:   Sun, 17 Nov 2024 19:54:12 +0100

cleanup hfile

Diffstat:
MMakefile | 2+-
Mdisco-dl.c | 35+++++++++++++++++++++++++++++++++++
Ddisco-dl.h | 39---------------------------------------
3 files changed, 36 insertions(+), 40 deletions(-)

diff --git a/Makefile b/Makefile @@ -16,7 +16,7 @@ all: ${BIN} ${BIN}: ${@:=.o} -${OBJ}: config.h disco-dl.h +${OBJ}: config.h .o: ${OBJ} ${CC} -o $@ ${OBJ} ${LDFLAGS} diff --git a/disco-dl.c b/disco-dl.c @@ -11,6 +11,41 @@ #include "config.h" #include "disco-dl.h" +#define DIR_SEP "/" + +typedef struct +{ + char *band; + char *album; + char *genre; + int year; + char *url; + char *tracklist; + char *dir; +} Album; + +typedef struct +{ + char *tracknum; + char *title; + char *path; + Album *album; +} Track; + +static int make_dir(const char *name); +static char *concat(const char *s1, const char *s2); +static Track *get_track(Album **album, char **track_name, unsigned int count); +static char *make_message(const char *str, ...); +static Album **get_albums(int *line_count); +static Album *get_album(char *line_buf, ssize_t line_size); +static void tag_album(Album *album); +static void dl_album(Album *album); +static void id3_tag(Track *track); +static void tag(char *tag, char *value, FILE **f1); +static void merge_file(char *prefile1, char *file2); +static void convert(Track *track); +static void fatal(const char *fmt, ...); + int main(void) { diff --git a/disco-dl.h b/disco-dl.h @@ -1,39 +0,0 @@ -#ifndef DISCODL_H -#define DISCODL_H - -#define DIR_SEP "/" - -typedef struct -{ - char *band; - char *album; - char *genre; - int year; - char *url; - char *tracklist; - char *dir; -} Album; - -typedef struct -{ - char *tracknum; - char *title; - char *path; - Album *album; -} Track; - -int make_dir(const char *name); -char *concat(const char *s1, const char *s2); -Track *get_track(Album **album, char **track_name, unsigned int count); -char *make_message(const char *str, ...); -Album **get_albums(int *line_count); -Album *get_album(char *line_buf, ssize_t line_size); -void tag_album(Album *album); -void dl_album(Album *album); -void id3_tag(Track *track); -void tag(char *tag, char *value, FILE **f1); -void merge_file(char *prefile1, char *file2); -void convert(Track *track); -void fatal(const char *fmt, ...); - -#endif