dbUtils.h: eliminate this header

This commit is contained in:
Max Kellermann 2012-08-29 18:55:49 +02:00
parent 684a3d30a6
commit 6d4ca071a5
6 changed files with 5 additions and 61 deletions

View File

@ -73,7 +73,6 @@ mpd_headers = \
src/cmdline.h \
src/conf.h \
src/crossfade.h \
src/dbUtils.h \
src/decoder_thread.h \
src/decoder_control.h \
src/decoder_plugin.h \

View File

@ -22,7 +22,6 @@
#include "DatabaseSelection.hxx"
extern "C" {
#include "dbUtils.h"
#include "stored_playlist.h"
}
@ -53,11 +52,3 @@ search_add_to_playlist(const char *uri, const char *playlist_path_utf8,
const auto f = std::bind(AddSong, playlist_path_utf8, _1, _2);
return db->Visit(selection, f, error_r);
}
bool
addAllInToStoredPlaylist(const char *uri_utf8, const char *playlist_path_utf8,
GError **error_r)
{
return search_add_to_playlist(uri_utf8, playlist_path_utf8, nullptr,
error_r);
}

View File

@ -22,7 +22,6 @@
#include "DatabaseSelection.hxx"
extern "C" {
#include "dbUtils.h"
#include "playlist.h"
}
@ -59,9 +58,3 @@ findAddIn(struct player_control *pc, const char *uri,
const auto f = std::bind(AddToQueue, pc, _1, _2);
return db->Visit(selection, f, error_r);
}
bool
addAllIn(struct player_control *pc, const char *uri, GError **error_r)
{
return findAddIn(pc, uri, nullptr, error_r);
}

View File

@ -19,6 +19,7 @@
#include "config.h"
#include "PlaylistCommands.hxx"
#include "DatabasePlaylist.hxx"
#include "CommandError.h"
extern "C" {
@ -32,7 +33,6 @@ extern "C" {
#include "ls.h"
#include "uri.h"
#include "stored_playlist.h"
#include "dbUtils.h"
#include "client_internal.h"
}
@ -201,7 +201,8 @@ handle_playlistadd(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
success = spl_append_uri(argv[1], playlist, &error);
} else
success = addAllInToStoredPlaylist(uri, playlist, &error);
success = search_add_to_playlist(uri, playlist, nullptr,
&error);
if (!success && error == NULL) {
command_error(client, ACK_ERROR_NO_EXIST,

View File

@ -20,6 +20,7 @@
#include "config.h"
#include "QueueCommands.hxx"
#include "CommandError.h"
#include "DatabaseQueue.hxx"
extern "C" {
#include "protocol/argparser.h"
@ -29,7 +30,6 @@ extern "C" {
#include "ls.h"
#include "uri.h"
#include "locate.h"
#include "dbUtils.h"
#include "client_internal.h"
#include "client_file.h"
}
@ -70,7 +70,7 @@ handle_add(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
}
GError *error = NULL;
return addAllIn(client->player_control, uri, &error)
return findAddIn(client->player_control, uri, nullptr, &error)
? COMMAND_RETURN_OK
: print_error(client, error);
}

View File

@ -1,40 +0,0 @@
/*
* Copyright (C) 2003-2011 The Music Player Daemon Project
* http://www.musicpd.org
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_DB_UTILS_H
#define MPD_DB_UTILS_H
#include "gcc.h"
#include "gerror.h"
#include <stdbool.h>
struct locate_item_list;
struct player_control;
gcc_nonnull(1,2)
bool
addAllIn(struct player_control *pc, const char *uri, GError **error_r);
gcc_nonnull(1,2)
bool
addAllInToStoredPlaylist(const char *uri_utf8, const char *path_utf8,
GError **error_r);
#endif