Commit 70b87f2e authored by Max Kellermann's avatar Max Kellermann

client: convert to C++

parent 94b2ee62
...@@ -102,8 +102,6 @@ mpd_headers = \ ...@@ -102,8 +102,6 @@ mpd_headers = \
src/text_input_stream.h \ src/text_input_stream.h \
src/icy_server.h \ src/icy_server.h \
src/icy_metadata.h \ src/icy_metadata.h \
src/client.h \
src/client_internal.h \
src/server_socket.h \ src/server_socket.h \
src/log.h \ src/log.h \
src/ls.h \ src/ls.h \
...@@ -192,10 +190,10 @@ src_mpd_SOURCES = \ ...@@ -192,10 +190,10 @@ src_mpd_SOURCES = \
src/audio_check.c \ src/audio_check.c \
src/audio_format.c \ src/audio_format.c \
src/audio_parser.c \ src/audio_parser.c \
src/protocol/argparser.c src/protocol/argparser.h \ src/protocol/ArgParser.cxx src/protocol/ArgParser.hxx \
src/protocol/result.c src/protocol/result.h \ src/protocol/Result.cxx src/protocol/Result.hxx \
src/CommandError.cxx src/CommandError.hxx \ src/CommandError.cxx src/CommandError.hxx \
src/AllCommands.cxx src/AllCommands.h \ src/AllCommands.cxx src/AllCommands.hxx \
src/QueueCommands.cxx src/QueueCommands.hxx \ src/QueueCommands.cxx src/QueueCommands.hxx \
src/PlayerCommands.cxx src/PlayerCommands.hxx \ src/PlayerCommands.cxx src/PlayerCommands.hxx \
src/PlaylistCommands.cxx src/PlaylistCommands.hxx \ src/PlaylistCommands.cxx src/PlaylistCommands.hxx \
...@@ -243,22 +241,20 @@ src_mpd_SOURCES = \ ...@@ -243,22 +241,20 @@ src_mpd_SOURCES = \
src/UpdateContainer.cxx src/UpdateContainer.hxx \ src/UpdateContainer.cxx src/UpdateContainer.hxx \
src/UpdateInternal.hxx \ src/UpdateInternal.hxx \
src/UpdateRemove.cxx src/UpdateRemove.hxx \ src/UpdateRemove.cxx src/UpdateRemove.hxx \
src/client.c \ src/Client.cxx src/Client.hxx \
src/client_event.c \ src/ClientInternal.hxx \
src/client_expire.c \ src/ClientEvent.cxx \
src/client_global.c \ src/ClientExpire.cxx \
src/client_idle.h \ src/ClientGlobal.cxx \
src/client_idle.c \ src/ClientIdle.cxx src/ClientIdle.hxx \
src/client_list.c \ src/ClientList.cxx \
src/ClientNew.cxx \ src/ClientNew.cxx \
src/client_process.c \ src/ClientProcess.cxx \
src/client_read.c \ src/ClientRead.cxx \
src/client_write.c \ src/ClientWrite.cxx \
src/client_message.h \ src/ClientMessage.cxx src/ClientMessage.hxx \
src/client_message.c \ src/ClientSubscribe.cxx src/ClientSubscribe.hxx \
src/client_subscribe.h \ src/ClientFile.cxx src/ClientFile.hxx \
src/client_subscribe.c \
src/client_file.c src/client_file.h \
src/server_socket.c \ src/server_socket.c \
src/Listen.cxx src/Listen.hxx \ src/Listen.cxx src/Listen.hxx \
src/log.c \ src/log.c \
......
...@@ -18,11 +18,7 @@ ...@@ -18,11 +18,7 @@
*/ */
#include "config.h" #include "config.h"
#include "AllCommands.hxx"
extern "C" {
#include "AllCommands.h"
}
#include "command.h" #include "command.h"
#include "QueueCommands.hxx" #include "QueueCommands.hxx"
#include "PlayerCommands.hxx" #include "PlayerCommands.hxx"
...@@ -33,11 +29,11 @@ extern "C" { ...@@ -33,11 +29,11 @@ extern "C" {
#include "OtherCommands.hxx" #include "OtherCommands.hxx"
#include "Permission.hxx" #include "Permission.hxx"
#include "tag.h" #include "tag.h"
#include "protocol/Result.hxx"
#include "Client.hxx"
extern "C" { extern "C" {
#include "protocol/result.h"
#include "tokenizer.h" #include "tokenizer.h"
#include "client.h"
} }
#ifdef ENABLE_SQLITE #ifdef ENABLE_SQLITE
......
/* /*
* Copyright (C) 2003-2012 The Music Player Daemon Project * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#ifndef MPD_ALL_COMMANDS_H #ifndef MPD_ALL_COMMANDS_HXX
#define MPD_ALL_COMMANDS_H #define MPD_ALL_COMMANDS_HXX
#include "command.h" #include "command.h"
......
/* /*
* Copyright (C) 2003-2011 The Music Player Daemon Project * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
*/ */
#include "config.h" #include "config.h"
#include "client_internal.h" #include "ClientInternal.hxx"
bool client_is_expired(const struct client *client) bool client_is_expired(const struct client *client)
{ {
......
/* /*
* Copyright (C) 2003-2011 The Music Player Daemon Project * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
*/ */
#include "config.h" #include "config.h"
#include "client_internal.h" #include "ClientInternal.hxx"
#include "Main.hxx" #include "Main.hxx"
#include <assert.h> #include <assert.h>
...@@ -27,7 +27,7 @@ static gboolean ...@@ -27,7 +27,7 @@ static gboolean
client_out_event(G_GNUC_UNUSED GIOChannel *source, GIOCondition condition, client_out_event(G_GNUC_UNUSED GIOChannel *source, GIOCondition condition,
gpointer data) gpointer data)
{ {
struct client *client = data; struct client *client = (struct client *)data;
assert(!client_is_expired(client)); assert(!client_is_expired(client));
...@@ -49,7 +49,7 @@ client_out_event(G_GNUC_UNUSED GIOChannel *source, GIOCondition condition, ...@@ -49,7 +49,7 @@ client_out_event(G_GNUC_UNUSED GIOChannel *source, GIOCondition condition,
/* done sending deferred buffers exist: schedule /* done sending deferred buffers exist: schedule
read */ read */
client->source_id = g_io_add_watch(client->channel, client->source_id = g_io_add_watch(client->channel,
G_IO_IN|G_IO_ERR|G_IO_HUP, GIOCondition(G_IO_IN|G_IO_ERR|G_IO_HUP),
client_in_event, client); client_in_event, client);
return false; return false;
} }
...@@ -62,7 +62,7 @@ gboolean ...@@ -62,7 +62,7 @@ gboolean
client_in_event(G_GNUC_UNUSED GIOChannel *source, GIOCondition condition, client_in_event(G_GNUC_UNUSED GIOChannel *source, GIOCondition condition,
gpointer data) gpointer data)
{ {
struct client *client = data; struct client *client = (struct client *)data;
enum command_return ret; enum command_return ret;
assert(!client_is_expired(client)); assert(!client_is_expired(client));
...@@ -99,7 +99,7 @@ client_in_event(G_GNUC_UNUSED GIOChannel *source, GIOCondition condition, ...@@ -99,7 +99,7 @@ client_in_event(G_GNUC_UNUSED GIOChannel *source, GIOCondition condition,
if (!g_queue_is_empty(client->deferred_send)) { if (!g_queue_is_empty(client->deferred_send)) {
/* deferred buffers exist: schedule write */ /* deferred buffers exist: schedule write */
client->source_id = g_io_add_watch(client->channel, client->source_id = g_io_add_watch(client->channel,
G_IO_OUT|G_IO_ERR|G_IO_HUP, GIOCondition(G_IO_OUT|G_IO_ERR|G_IO_HUP),
client_out_event, client); client_out_event, client);
return false; return false;
} }
......
/* /*
* Copyright (C) 2003-2011 The Music Player Daemon Project * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
*/ */
#include "config.h" #include "config.h"
#include "client_internal.h" #include "ClientInternal.hxx"
static guint expire_source_id; static guint expire_source_id;
...@@ -42,7 +42,7 @@ client_set_expired(struct client *client) ...@@ -42,7 +42,7 @@ client_set_expired(struct client *client)
static void static void
client_check_expired_callback(gpointer data, G_GNUC_UNUSED gpointer user_data) client_check_expired_callback(gpointer data, G_GNUC_UNUSED gpointer user_data)
{ {
struct client *client = data; struct client *client = (struct client *)data;
if (client_is_expired(client)) { if (client_is_expired(client)) {
g_debug("[%u] expired", client->num); g_debug("[%u] expired", client->num);
......
/* /*
* Copyright (C) 2003-2012 The Music Player Daemon Project * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#include "client_file.h" #include "ClientFile.hxx"
#include "client.h" #include "Client.hxx"
#include "ack.h" #include "ack.h"
#include "io_error.h" #include "io_error.h"
......
/* /*
* Copyright (C) 2003-2012 The Music Player Daemon Project * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#ifndef MPD_CLIENT_FILE_H #ifndef MPD_CLIENT_FILE_HXX
#define MPD_CLIENT_FILE_H #define MPD_CLIENT_FILE_HXX
#include "gerror.h" #include "gerror.h"
......
/* /*
* Copyright (C) 2003-2011 The Music Player Daemon Project * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -18,8 +18,11 @@ ...@@ -18,8 +18,11 @@
*/ */
#include "config.h" #include "config.h"
#include "client_internal.h" #include "ClientInternal.hxx"
extern "C" {
#include "conf.h" #include "conf.h"
}
#include <assert.h> #include <assert.h>
......
/* /*
* Copyright (C) 2003-2011 The Music Player Daemon Project * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -18,9 +18,12 @@ ...@@ -18,9 +18,12 @@
*/ */
#include "config.h" #include "config.h"
#include "client_idle.h" #include "ClientIdle.hxx"
#include "client_internal.h" #include "ClientInternal.hxx"
extern "C" {
#include "idle.h" #include "idle.h"
}
#include <assert.h> #include <assert.h>
...@@ -68,7 +71,7 @@ client_idle_add(struct client *client, unsigned flags) ...@@ -68,7 +71,7 @@ client_idle_add(struct client *client, unsigned flags)
static void static void
client_idle_callback(gpointer data, gpointer user_data) client_idle_callback(gpointer data, gpointer user_data)
{ {
struct client *client = data; struct client *client = (struct client *)data;
unsigned flags = GPOINTER_TO_UINT(user_data); unsigned flags = GPOINTER_TO_UINT(user_data);
client_idle_add(client, flags); client_idle_add(client, flags);
......
/* /*
* Copyright (C) 2003-2011 The Music Player Daemon Project * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -17,10 +17,8 @@ ...@@ -17,10 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#ifndef MPD_CLIENT_IDLE_H #ifndef MPD_CLIENT_IDLE_HXX
#define MPD_CLIENT_IDLE_H #define MPD_CLIENT_IDLE_HXX
#include <stdbool.h>
struct client; struct client;
......
/* /*
* Copyright (C) 2003-2011 The Music Player Daemon Project * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -17,11 +17,11 @@ ...@@ -17,11 +17,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#ifndef MPD_CLIENT_INTERNAL_H #ifndef MPD_CLIENT_INTERNAL_HXX
#define MPD_CLIENT_INTERNAL_H #define MPD_CLIENT_INTERNAL_HXX
#include "client.h" #include "Client.hxx"
#include "client_message.h" #include "ClientMessage.hxx"
#include "command.h" #include "command.h"
#include <glib.h> #include <glib.h>
......
/* /*
* Copyright (C) 2003-2011 The Music Player Daemon Project * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
*/ */
#include "config.h" #include "config.h"
#include "client_internal.h" #include "ClientInternal.hxx"
#include <assert.h> #include <assert.h>
...@@ -42,7 +42,7 @@ client_list_get_first(void) ...@@ -42,7 +42,7 @@ client_list_get_first(void)
{ {
assert(clients != NULL); assert(clients != NULL);
return clients->data; return (struct client *)clients->data;
} }
void void
......
/* /*
* Copyright (C) 2003-2011 The Music Player Daemon Project * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#include "client_message.h" #include "ClientMessage.hxx"
#include <assert.h> #include <assert.h>
#include <glib.h> #include <glib.h>
......
...@@ -18,9 +18,7 @@ ...@@ -18,9 +18,7 @@
*/ */
#include "config.h" #include "config.h"
extern "C" { #include "ClientInternal.hxx"
#include "client_internal.h"
}
#include "fd_util.h" #include "fd_util.h"
extern "C" { extern "C" {
#include "fifo_buffer.h" #include "fifo_buffer.h"
......
/* /*
* Copyright (C) 2003-2011 The Music Player Daemon Project * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -18,9 +18,9 @@ ...@@ -18,9 +18,9 @@
*/ */
#include "config.h" #include "config.h"
#include "client_internal.h" #include "ClientInternal.hxx"
#include "protocol/result.h" #include "protocol/Result.hxx"
#include "AllCommands.h" #include "AllCommands.hxx"
#include <string.h> #include <string.h>
...@@ -35,7 +35,7 @@ client_process_command_list(struct client *client, bool list_ok, GSList *list) ...@@ -35,7 +35,7 @@ client_process_command_list(struct client *client, bool list_ok, GSList *list)
unsigned num = 0; unsigned num = 0;
for (GSList *cur = list; cur != NULL; cur = g_slist_next(cur)) { for (GSList *cur = list; cur != NULL; cur = g_slist_next(cur)) {
char *cmd = cur->data; char *cmd = (char *)cur->data;
g_debug("command_process_list: process command \"%s\"", g_debug("command_process_list: process command \"%s\"",
cmd); cmd);
......
/* /*
* Copyright (C) 2003-2011 The Music Player Daemon Project * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -18,8 +18,11 @@ ...@@ -18,8 +18,11 @@
*/ */
#include "config.h" #include "config.h"
#include "client_internal.h" #include "ClientInternal.hxx"
extern "C" {
#include "fifo_buffer.h" #include "fifo_buffer.h"
}
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
...@@ -27,19 +30,16 @@ ...@@ -27,19 +30,16 @@
static char * static char *
client_read_line(struct client *client) client_read_line(struct client *client)
{ {
const char *p, *newline;
size_t length; size_t length;
char *line; const char *p = (const char *)fifo_buffer_read(client->input, &length);
p = fifo_buffer_read(client->input, &length);
if (p == NULL) if (p == NULL)
return NULL; return NULL;
newline = memchr(p, '\n', length); const char *newline = (const char *)memchr(p, '\n', length);
if (newline == NULL) if (newline == NULL)
return NULL; return NULL;
line = g_strndup(p, newline - p); char *line = g_strndup(p, newline - p);
fifo_buffer_consume(client->input, newline - p + 1); fifo_buffer_consume(client->input, newline - p + 1);
return g_strchomp(line); return g_strchomp(line);
...@@ -71,8 +71,6 @@ client_input_received(struct client *client, size_t bytesRead) ...@@ -71,8 +71,6 @@ client_input_received(struct client *client, size_t bytesRead)
enum command_return enum command_return
client_read(struct client *client) client_read(struct client *client)
{ {
char *p;
size_t max_length;
GError *error = NULL; GError *error = NULL;
GIOStatus status; GIOStatus status;
gsize bytes_read; gsize bytes_read;
...@@ -80,7 +78,8 @@ client_read(struct client *client) ...@@ -80,7 +78,8 @@ client_read(struct client *client)
assert(client != NULL); assert(client != NULL);
assert(client->channel != NULL); assert(client->channel != NULL);
p = fifo_buffer_write(client->input, &max_length); size_t max_length;
char *p = (char *)fifo_buffer_write(client->input, &max_length);
if (p == NULL) { if (p == NULL) {
g_warning("[%u] buffer overflow", client->num); g_warning("[%u] buffer overflow", client->num);
return COMMAND_RETURN_CLOSE; return COMMAND_RETURN_CLOSE;
......
/* /*
* Copyright (C) 2003-2011 The Music Player Daemon Project * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -17,10 +17,13 @@ ...@@ -17,10 +17,13 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#include "client_subscribe.h" #include "ClientSubscribe.hxx"
#include "client_internal.h" #include "ClientIdle.hxx"
#include "client_idle.h" #include "ClientInternal.hxx"
extern "C" {
#include "idle.h" #include "idle.h"
}
#include <string.h> #include <string.h>
......
/* /*
* Copyright (C) 2003-2011 The Music Player Daemon Project * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -17,13 +17,11 @@ ...@@ -17,13 +17,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#ifndef MPD_CLIENT_SUBSCRIBE_H #ifndef MPD_CLIENT_SUBSCRIBE_HXX
#define MPD_CLIENT_SUBSCRIBE_H #define MPD_CLIENT_SUBSCRIBE_HXX
#include "gcc.h" #include "gcc.h"
#include <stdbool.h>
typedef struct _GSList GSList; typedef struct _GSList GSList;
struct client; struct client;
struct client_message; struct client_message;
......
/* /*
* Copyright (C) 2003-2011 The Music Player Daemon Project * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
*/ */
#include "config.h" #include "config.h"
#include "client_internal.h" #include "ClientInternal.hxx"
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
...@@ -73,6 +73,7 @@ client_write_deferred(struct client *client) ...@@ -73,6 +73,7 @@ client_write_deferred(struct client *client)
while (!g_queue_is_empty(client->deferred_send)) { while (!g_queue_is_empty(client->deferred_send)) {
struct deferred_buffer *buf = struct deferred_buffer *buf =
(struct deferred_buffer *)
g_queue_peek_head(client->deferred_send); g_queue_peek_head(client->deferred_send);
assert(buf->size > 0); assert(buf->size > 0);
...@@ -129,7 +130,7 @@ static void client_defer_output(struct client *client, ...@@ -129,7 +130,7 @@ static void client_defer_output(struct client *client,
return; return;
} }
buf = g_malloc(alloc); buf = (struct deferred_buffer *)g_malloc(alloc);
buf->size = length; buf->size = length;
memcpy(buf->data, data, length); memcpy(buf->data, data, length);
...@@ -246,7 +247,6 @@ void client_vprintf(struct client *client, const char *fmt, va_list args) ...@@ -246,7 +247,6 @@ void client_vprintf(struct client *client, const char *fmt, va_list args)
#ifndef G_OS_WIN32 #ifndef G_OS_WIN32
va_list tmp; va_list tmp;
int length; int length;
char *buffer;
va_copy(tmp, args); va_copy(tmp, args);
length = vsnprintf(NULL, 0, fmt, tmp); length = vsnprintf(NULL, 0, fmt, tmp);
...@@ -256,7 +256,7 @@ void client_vprintf(struct client *client, const char *fmt, va_list args) ...@@ -256,7 +256,7 @@ void client_vprintf(struct client *client, const char *fmt, va_list args)
/* wtf.. */ /* wtf.. */
return; return;
buffer = g_malloc(length + 1); char *buffer = (char *)g_malloc(length + 1);
vsnprintf(buffer, length + 1, fmt, args); vsnprintf(buffer, length + 1, fmt, args);
client_write(client, buffer, length); client_write(client, buffer, length);
g_free(buffer); g_free(buffer);
......
...@@ -21,10 +21,7 @@ ...@@ -21,10 +21,7 @@
#include "CommandError.hxx" #include "CommandError.hxx"
#include "db_error.h" #include "db_error.h"
#include "io_error.h" #include "io_error.h"
#include "protocol/Result.hxx"
extern "C" {
#include "protocol/result.h"
}
#include <assert.h> #include <assert.h>
#include <errno.h> #include <errno.h>
......
/* /*
* Copyright (C) 2003-2012 The Music Player Daemon Project * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -24,14 +24,11 @@ ...@@ -24,14 +24,11 @@
#include "DatabasePrint.hxx" #include "DatabasePrint.hxx"
#include "DatabaseSelection.hxx" #include "DatabaseSelection.hxx"
#include "CommandError.hxx" #include "CommandError.hxx"
#include "client_internal.h" #include "ClientInternal.hxx"
#include "tag.h" #include "tag.h"
#include "uri.h" #include "uri.h"
#include "SongFilter.hxx" #include "SongFilter.hxx"
#include "protocol/Result.hxx"
extern "C" {
#include "protocol/result.h"
}
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
......
/* /*
* Copyright (C) 2003-2012 The Music Player Daemon Project * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -25,9 +25,9 @@ ...@@ -25,9 +25,9 @@
#include "SongPrint.hxx" #include "SongPrint.hxx"
#include "TimePrint.hxx" #include "TimePrint.hxx"
#include "Directory.hxx" #include "Directory.hxx"
#include "Client.hxx"
extern "C" { extern "C" {
#include "client.h"
#include "song.h" #include "song.h"
#include "tag.h" #include "tag.h"
} }
......
...@@ -21,10 +21,7 @@ ...@@ -21,10 +21,7 @@
#include "DecoderPrint.hxx" #include "DecoderPrint.hxx"
#include "decoder_list.h" #include "decoder_list.h"
#include "decoder_plugin.h" #include "decoder_plugin.h"
#include "Client.hxx"
extern "C" {
#include "client.h"
}
#include <assert.h> #include <assert.h>
......
...@@ -20,10 +20,10 @@ ...@@ -20,10 +20,10 @@
#include "config.h" #include "config.h"
#include "Listen.hxx" #include "Listen.hxx"
#include "Main.hxx" #include "Main.hxx"
#include "Client.hxx"
extern "C" { extern "C" {
#include "server_socket.h" #include "server_socket.h"
#include "client.h"
#include "conf.h" #include "conf.h"
} }
......
...@@ -29,14 +29,14 @@ ...@@ -29,14 +29,14 @@
#include "DatabaseSimple.hxx" #include "DatabaseSimple.hxx"
#include "Permission.hxx" #include "Permission.hxx"
#include "Listen.hxx" #include "Listen.hxx"
#include "ClientIdle.hxx"
#include "Client.hxx"
#include "AllCommands.hxx"
extern "C" { extern "C" {
#include "daemon.h" #include "daemon.h"
#include "io_thread.h" #include "io_thread.h"
#include "client.h"
#include "client_idle.h"
#include "idle.h" #include "idle.h"
#include "AllCommands.h"
#include "playlist.h" #include "playlist.h"
#include "cmdline.h" #include "cmdline.h"
#include "conf.h" #include "conf.h"
......
/* /*
* Copyright (C) 2003-2012 The Music Player Daemon Project * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -19,13 +19,10 @@ ...@@ -19,13 +19,10 @@
#include "config.h" #include "config.h"
#include "MessageCommands.hxx" #include "MessageCommands.hxx"
#include "ClientSubscribe.hxx"
extern "C" { #include "ClientInternal.hxx"
#include "protocol/argparser.h" #include "protocol/Result.hxx"
#include "protocol/result.h" #include "protocol/ArgParser.hxx"
#include "client_internal.h"
#include "client_subscribe.h"
}
#include <set> #include <set>
#include <string> #include <string>
......
/* /*
* Copyright (C) 2003-2012 The Music Player Daemon Project * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -29,10 +29,10 @@ ...@@ -29,10 +29,10 @@
#include "TimePrint.hxx" #include "TimePrint.hxx"
#include "Mapper.hxx" #include "Mapper.hxx"
#include "DecoderPrint.hxx" #include "DecoderPrint.hxx"
#include "protocol/ArgParser.hxx"
#include "protocol/Result.hxx"
extern "C" { extern "C" {
#include "protocol/argparser.h"
#include "protocol/result.h"
#include "ls.h" #include "ls.h"
#include "uri.h" #include "uri.h"
#include "volume.h" #include "volume.h"
...@@ -41,11 +41,11 @@ extern "C" { ...@@ -41,11 +41,11 @@ extern "C" {
#include "Permission.hxx" #include "Permission.hxx"
#include "PlaylistFile.hxx" #include "PlaylistFile.hxx"
#include "ClientIdle.hxx"
#include "ClientFile.hxx"
#include "Client.hxx"
extern "C" { extern "C" {
#include "client.h"
#include "client_idle.h"
#include "client_file.h"
#include "idle.h" #include "idle.h"
} }
......
...@@ -20,10 +20,10 @@ ...@@ -20,10 +20,10 @@
#include "config.h" #include "config.h"
#include "OutputCommands.hxx" #include "OutputCommands.hxx"
#include "OutputPrint.hxx" #include "OutputPrint.hxx"
#include "protocol/Result.hxx"
#include "protocol/ArgParser.hxx"
extern "C" { extern "C" {
#include "protocol/argparser.h"
#include "protocol/result.h"
#include "output_command.h" #include "output_command.h"
} }
......
...@@ -25,10 +25,10 @@ ...@@ -25,10 +25,10 @@
#include "config.h" #include "config.h"
#include "OutputPrint.hxx" #include "OutputPrint.hxx"
#include "output_internal.h" #include "output_internal.h"
#include "Client.hxx"
extern "C" { extern "C" {
#include "output_all.h" #include "output_all.h"
#include "client.h"
} }
void void
......
/* /*
* Copyright (C) 2003-2012 The Music Player Daemon Project * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -22,15 +22,14 @@ ...@@ -22,15 +22,14 @@
#include "CommandError.hxx" #include "CommandError.hxx"
#include "PlaylistPrint.hxx" #include "PlaylistPrint.hxx"
#include "UpdateGlue.hxx" #include "UpdateGlue.hxx"
#include "ClientInternal.hxx"
#include "protocol/Result.hxx"
#include "protocol/ArgParser.hxx"
extern "C" { extern "C" {
#include "protocol/argparser.h"
#include "protocol/result.h"
#include "player_control.h" #include "player_control.h"
#include "playlist.h" #include "playlist.h"
#include "volume.h" #include "volume.h"
#include "client.h"
#include "client_internal.h"
#include "replay_gain_config.h" #include "replay_gain_config.h"
} }
......
...@@ -26,14 +26,14 @@ ...@@ -26,14 +26,14 @@
#include "PlaylistFile.hxx" #include "PlaylistFile.hxx"
#include "PlaylistQueue.hxx" #include "PlaylistQueue.hxx"
#include "TimePrint.hxx" #include "TimePrint.hxx"
#include "ClientInternal.hxx"
#include "protocol/ArgParser.hxx"
#include "protocol/Result.hxx"
extern "C" { extern "C" {
#include "protocol/argparser.h"
#include "protocol/result.h"
#include "playlist.h" #include "playlist.h"
#include "ls.h" #include "ls.h"
#include "uri.h" #include "uri.h"
#include "client_internal.h"
} }
#include <assert.h> #include <assert.h>
......
...@@ -26,13 +26,13 @@ ...@@ -26,13 +26,13 @@
#include "SongPrint.hxx" #include "SongPrint.hxx"
#include "DatabaseGlue.hxx" #include "DatabaseGlue.hxx"
#include "DatabasePlugin.hxx" #include "DatabasePlugin.hxx"
#include "Client.hxx"
extern "C" { extern "C" {
#include "playlist_list.h" #include "playlist_list.h"
#include "playlist_plugin.h" #include "playlist_plugin.h"
#include "playlist.h" #include "playlist.h"
#include "song.h" #include "song.h"
#include "client.h"
#include "input_stream.h" #include "input_stream.h"
} }
......
/* /*
* Copyright (C) 2003-2012 The Music Player Daemon Project * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -23,15 +23,15 @@ ...@@ -23,15 +23,15 @@
#include "DatabaseQueue.hxx" #include "DatabaseQueue.hxx"
#include "SongFilter.hxx" #include "SongFilter.hxx"
#include "PlaylistPrint.hxx" #include "PlaylistPrint.hxx"
#include "ClientFile.hxx"
#include "ClientInternal.hxx"
#include "protocol/ArgParser.hxx"
#include "protocol/Result.hxx"
extern "C" { extern "C" {
#include "protocol/argparser.h"
#include "protocol/result.h"
#include "playlist.h" #include "playlist.h"
#include "ls.h" #include "ls.h"
#include "uri.h" #include "uri.h"
#include "client_internal.h"
#include "client_file.h"
} }
#include <string.h> #include <string.h>
......
...@@ -22,11 +22,11 @@ ...@@ -22,11 +22,11 @@
#include "SongFilter.hxx" #include "SongFilter.hxx"
#include "SongPrint.hxx" #include "SongPrint.hxx"
#include "Mapper.hxx" #include "Mapper.hxx"
#include "Client.hxx"
extern "C" { extern "C" {
#include "queue.h" #include "queue.h"
#include "song.h" #include "song.h"
#include "client.h"
} }
/** /**
......
...@@ -24,9 +24,9 @@ ...@@ -24,9 +24,9 @@
#include "TimePrint.hxx" #include "TimePrint.hxx"
#include "TagPrint.hxx" #include "TagPrint.hxx"
#include "Mapper.hxx" #include "Mapper.hxx"
#include "Client.hxx"
extern "C" { extern "C" {
#include "client.h"
#include "uri.h" #include "uri.h"
} }
......
/* /*
* Copyright (C) 2003-2012 The Music Player Daemon Project * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -21,11 +21,10 @@ ...@@ -21,11 +21,10 @@
extern "C" { extern "C" {
#include "stats.h" #include "stats.h"
#include "client.h"
#include "player_control.h" #include "player_control.h"
#include "client_internal.h"
} }
#include "ClientInternal.hxx"
#include "DatabaseSelection.hxx" #include "DatabaseSelection.hxx"
#include "DatabaseGlue.hxx" #include "DatabaseGlue.hxx"
#include "DatabasePlugin.hxx" #include "DatabasePlugin.hxx"
......
...@@ -28,10 +28,7 @@ ...@@ -28,10 +28,7 @@
#include "StickerPrint.hxx" #include "StickerPrint.hxx"
#include "StickerDatabase.hxx" #include "StickerDatabase.hxx"
#include "CommandError.hxx" #include "CommandError.hxx"
#include "protocol/Result.hxx"
extern "C" {
#include "protocol/result.h"
}
#include <string.h> #include <string.h>
......
...@@ -20,10 +20,7 @@ ...@@ -20,10 +20,7 @@
#include "config.h" #include "config.h"
#include "StickerPrint.hxx" #include "StickerPrint.hxx"
#include "StickerDatabase.hxx" #include "StickerDatabase.hxx"
#include "Client.hxx"
extern "C" {
#include "client.h"
}
void void
sticker_print_value(struct client *client, sticker_print_value(struct client *client,
......
...@@ -22,10 +22,7 @@ ...@@ -22,10 +22,7 @@
#include "tag.h" #include "tag.h"
#include "tag_internal.h" #include "tag_internal.h"
#include "song.h" #include "song.h"
#include "Client.hxx"
extern "C" {
#include "client.h"
}
void tag_print_types(struct client *client) void tag_print_types(struct client *client)
{ {
......
...@@ -19,10 +19,7 @@ ...@@ -19,10 +19,7 @@
#include "config.h" #include "config.h"
#include "TimePrint.hxx" #include "TimePrint.hxx"
#include "Client.hxx"
extern "C" {
#include "client.h"
}
#include <glib.h> #include <glib.h>
......
...@@ -22,9 +22,10 @@ ...@@ -22,9 +22,10 @@
extern "C" { extern "C" {
#include "ls.h" #include "ls.h"
#include "uri.h" #include "uri.h"
#include "client.h"
} }
#include "Client.hxx"
#include <glib.h> #include <glib.h>
#include <assert.h> #include <assert.h>
......
/* /*
* Copyright (C) 2003-2012 The Music Player Daemon Project * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
*/ */
#include "config.h" #include "config.h"
#include "argparser.h" #include "ArgParser.hxx"
#include "result.h" #include "Result.hxx"
#include <glib.h> #include <glib.h>
#include <stdlib.h> #include <stdlib.h>
......
/* /*
* Copyright (C) 2003-2012 The Music Player Daemon Project * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#ifndef MPD_PROTOCOL_ARGPARSER_H #ifndef MPD_PROTOCOL_ARGPARSER_HXX
#define MPD_PROTOCOL_ARGPARSER_H #define MPD_PROTOCOL_ARGPARSER_HXX
#include "check.h" #include "check.h"
......
/* /*
* Copyright (C) 2003-2012 The Music Player Daemon Project * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
*/ */
#include "config.h" #include "config.h"
#include "result.h" #include "Result.hxx"
#include "client.h" #include "Client.hxx"
#include <assert.h> #include <assert.h>
......
/* /*
* Copyright (C) 2003-2012 The Music Player Daemon Project * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#ifndef MPD_PROTOCOL_RESULT_H #ifndef MPD_PROTOCOL_RESULT_HXX
#define MPD_PROTOCOL_RESULT_H #define MPD_PROTOCOL_RESULT_HXX
#include "check.h" #include "check.h"
#include "gcc.h" #include "gcc.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment