X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=playlist.c;h=5cfe1a75196d5baf446507b21ee551044ecf446a;hb=b36883d75a07842740562eb654d5642914042d4b;hp=b9e52c75672f9ada9ad4a949f5fa0747369db3e6;hpb=bd28ec9a64884d70917c4fdea1a3a70c91758f83;p=paraslash.git diff --git a/playlist.c b/playlist.c index b9e52c75..5cfe1a75 100644 --- a/playlist.c +++ b/playlist.c @@ -1,8 +1,4 @@ -/* - * Copyright (C) 2007 Andre Noll - * - * Licensed under the GPL v2. For licencing details see COPYING. - */ +/* Copyright (C) 2007 Andre Noll , see file COPYING. */ #include #include @@ -140,7 +136,7 @@ int playlist_check_callback(struct afs_callback_arg *aca) /** * Close the current playlist. * - * \sa playlist_open(). + * \sa \ref playlist_open(). */ void playlist_close(void) { @@ -151,16 +147,18 @@ void playlist_close(void) } /** - * Open the given playlist. + * Open and load the given playlist. * * \param name The name of the playlist to open. + * \param errmsg To be sent to the client (if called via select command). * * Files which are listed in the playlist, but not contained in the database * are ignored. This is not considered an error. * - * \return Standard. + * \return The length of the loaded playlist on success, negative error code + * else. */ -int playlist_open(const char *name) +int playlist_open(const char *name, char **errmsg) { struct osl_object obj; int ret; @@ -170,7 +168,9 @@ int playlist_open(const char *name) obj.size = strlen(obj.data); ret = osl(osl_get_row(playlists_table, BLOBCOL_NAME, &obj, &row)); if (ret < 0) { - PARA_NOTICE_LOG("failed to load playlist %s\n", name); + if (errmsg) + *errmsg = make_message("could not open playlist %s", + name); return ret; } playlist_close(); @@ -187,7 +187,8 @@ static int search_path(char *path, void *data) static int handle_audio_file_event(enum afs_events event, void *data) { - int ret, was_admissible = 0, is_admissible; + int ret; + bool was_admissible = false, is_admissible; struct osl_object playlist_def; char *new_path; const struct osl_row *row = data;