Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
70b87f2e
Commit
70b87f2e
authored
Jan 03, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
client: convert to C++
parent
94b2ee62
Hide whitespace changes
Inline
Side-by-side
Showing
48 changed files
with
155 additions
and
186 deletions
+155
-186
Makefile.am
Makefile.am
+16
-20
AllCommands.cxx
src/AllCommands.cxx
+3
-7
AllCommands.hxx
src/AllCommands.hxx
+3
-3
Client.cxx
src/Client.cxx
+2
-2
Client.hxx
src/Client.hxx
+0
-0
ClientEvent.cxx
src/ClientEvent.cxx
+6
-6
ClientExpire.cxx
src/ClientExpire.cxx
+3
-3
ClientFile.cxx
src/ClientFile.cxx
+3
-3
ClientFile.hxx
src/ClientFile.hxx
+3
-3
ClientGlobal.cxx
src/ClientGlobal.cxx
+5
-2
ClientIdle.cxx
src/ClientIdle.cxx
+7
-4
ClientIdle.hxx
src/ClientIdle.hxx
+3
-5
ClientInternal.hxx
src/ClientInternal.hxx
+5
-5
ClientList.cxx
src/ClientList.cxx
+3
-3
ClientMessage.cxx
src/ClientMessage.cxx
+2
-2
ClientMessage.hxx
src/ClientMessage.hxx
+0
-0
ClientNew.cxx
src/ClientNew.cxx
+1
-3
ClientProcess.cxx
src/ClientProcess.cxx
+5
-5
ClientRead.cxx
src/ClientRead.cxx
+10
-11
ClientSubscribe.cxx
src/ClientSubscribe.cxx
+7
-4
ClientSubscribe.hxx
src/ClientSubscribe.hxx
+3
-5
ClientWrite.cxx
src/ClientWrite.cxx
+5
-5
CommandError.cxx
src/CommandError.cxx
+1
-4
DatabaseCommands.cxx
src/DatabaseCommands.cxx
+3
-6
DatabasePrint.cxx
src/DatabasePrint.cxx
+2
-2
DecoderPrint.cxx
src/DecoderPrint.cxx
+1
-4
Listen.cxx
src/Listen.cxx
+1
-1
Main.cxx
src/Main.cxx
+3
-3
MessageCommands.cxx
src/MessageCommands.cxx
+5
-8
OtherCommands.cxx
src/OtherCommands.cxx
+6
-6
OutputCommands.cxx
src/OutputCommands.cxx
+2
-2
OutputPrint.cxx
src/OutputPrint.cxx
+1
-1
PlayerCommands.cxx
src/PlayerCommands.cxx
+4
-5
PlaylistCommands.cxx
src/PlaylistCommands.cxx
+3
-3
PlaylistPrint.cxx
src/PlaylistPrint.cxx
+1
-1
QueueCommands.cxx
src/QueueCommands.cxx
+5
-5
QueuePrint.cxx
src/QueuePrint.cxx
+1
-1
SongPrint.cxx
src/SongPrint.cxx
+1
-1
Stats.cxx
src/Stats.cxx
+2
-3
StickerCommands.cxx
src/StickerCommands.cxx
+1
-4
StickerPrint.cxx
src/StickerPrint.cxx
+1
-4
TagPrint.cxx
src/TagPrint.cxx
+1
-4
TimePrint.cxx
src/TimePrint.cxx
+1
-4
ls.cxx
src/ls.cxx
+2
-1
ArgParser.cxx
src/protocol/ArgParser.cxx
+3
-3
ArgParser.hxx
src/protocol/ArgParser.hxx
+3
-3
Result.cxx
src/protocol/Result.cxx
+3
-3
Result.hxx
src/protocol/Result.hxx
+3
-3
No files found.
Makefile.am
View file @
70b87f2e
...
...
@@ -102,8 +102,6 @@ mpd_headers = \
src/text_input_stream.h
\
src/icy_server.h
\
src/icy_metadata.h
\
src/client.h
\
src/client_internal.h
\
src/server_socket.h
\
src/log.h
\
src/ls.h
\
...
...
@@ -192,10 +190,10 @@ src_mpd_SOURCES = \
src/audio_check.c
\
src/audio_format.c
\
src/audio_parser.c
\
src/protocol/
argparser.c src/protocol/argparser.h
\
src/protocol/
result.c src/protocol/result.h
\
src/protocol/
ArgParser.cxx src/protocol/ArgParser.hxx
\
src/protocol/
Result.cxx src/protocol/Result.hxx
\
src/CommandError.cxx src/CommandError.hxx
\
src/AllCommands.cxx src/AllCommands.h
\
src/AllCommands.cxx src/AllCommands.h
xx
\
src/QueueCommands.cxx src/QueueCommands.hxx
\
src/PlayerCommands.cxx src/PlayerCommands.hxx
\
src/PlaylistCommands.cxx src/PlaylistCommands.hxx
\
...
...
@@ -243,22 +241,20 @@ src_mpd_SOURCES = \
src/UpdateContainer.cxx src/UpdateContainer.hxx
\
src/UpdateInternal.hxx
\
src/UpdateRemove.cxx src/UpdateRemove.hxx
\
src/
client.c
\
src/
client_event.c
\
src/
client_expire.c
\
src/
client_global.c
\
src/
client_idle.h
\
src/
client_idle.c
\
src/
client_list.c
\
src/
Client.cxx src/Client.hxx
\
src/
ClientInternal.hxx
\
src/
ClientEvent.cxx
\
src/
ClientExpire.cxx
\
src/
ClientGlobal.cxx
\
src/
ClientIdle.cxx src/ClientIdle.hxx
\
src/
ClientList.cxx
\
src/ClientNew.cxx
\
src/client_process.c
\
src/client_read.c
\
src/client_write.c
\
src/client_message.h
\
src/client_message.c
\
src/client_subscribe.h
\
src/client_subscribe.c
\
src/client_file.c src/client_file.h
\
src/ClientProcess.cxx
\
src/ClientRead.cxx
\
src/ClientWrite.cxx
\
src/ClientMessage.cxx src/ClientMessage.hxx
\
src/ClientSubscribe.cxx src/ClientSubscribe.hxx
\
src/ClientFile.cxx src/ClientFile.hxx
\
src/server_socket.c
\
src/Listen.cxx src/Listen.hxx
\
src/log.c
\
...
...
src/AllCommands.cxx
View file @
70b87f2e
...
...
@@ -18,11 +18,7 @@
*/
#include "config.h"
extern
"C"
{
#include "AllCommands.h"
}
#include "AllCommands.hxx"
#include "command.h"
#include "QueueCommands.hxx"
#include "PlayerCommands.hxx"
...
...
@@ -33,11 +29,11 @@ extern "C" {
#include "OtherCommands.hxx"
#include "Permission.hxx"
#include "tag.h"
#include "protocol/Result.hxx"
#include "Client.hxx"
extern
"C"
{
#include "protocol/result.h"
#include "tokenizer.h"
#include "client.h"
}
#ifdef ENABLE_SQLITE
...
...
src/AllCommands.h
→
src/AllCommands.h
xx
View file @
70b87f2e
/*
* Copyright (C) 2003-201
2
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -17,8 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_ALL_COMMANDS_H
#define MPD_ALL_COMMANDS_H
#ifndef MPD_ALL_COMMANDS_H
XX
#define MPD_ALL_COMMANDS_H
XX
#include "command.h"
...
...
src/
client.c
→
src/
Client.cxx
View file @
70b87f2e
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -18,7 +18,7 @@
*/
#include "config.h"
#include "
client_internal.h
"
#include "
ClientInternal.hxx
"
bool
client_is_expired
(
const
struct
client
*
client
)
{
...
...
src/
client.h
→
src/
Client.hxx
View file @
70b87f2e
File moved
src/
client_event.c
→
src/
ClientEvent.cxx
View file @
70b87f2e
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -18,7 +18,7 @@
*/
#include "config.h"
#include "
client_internal.h
"
#include "
ClientInternal.hxx
"
#include "Main.hxx"
#include <assert.h>
...
...
@@ -27,7 +27,7 @@ static gboolean
client_out_event
(
G_GNUC_UNUSED
GIOChannel
*
source
,
GIOCondition
condition
,
gpointer
data
)
{
struct
client
*
client
=
data
;
struct
client
*
client
=
(
struct
client
*
)
data
;
assert
(
!
client_is_expired
(
client
));
...
...
@@ -49,7 +49,7 @@ client_out_event(G_GNUC_UNUSED GIOChannel *source, GIOCondition condition,
/* done sending deferred buffers exist: schedule
read */
client
->
source_id
=
g_io_add_watch
(
client
->
channel
,
G
_IO_IN
|
G_IO_ERR
|
G_IO_HUP
,
G
IOCondition
(
G_IO_IN
|
G_IO_ERR
|
G_IO_HUP
)
,
client_in_event
,
client
);
return
false
;
}
...
...
@@ -62,7 +62,7 @@ gboolean
client_in_event
(
G_GNUC_UNUSED
GIOChannel
*
source
,
GIOCondition
condition
,
gpointer
data
)
{
struct
client
*
client
=
data
;
struct
client
*
client
=
(
struct
client
*
)
data
;
enum
command_return
ret
;
assert
(
!
client_is_expired
(
client
));
...
...
@@ -99,7 +99,7 @@ client_in_event(G_GNUC_UNUSED GIOChannel *source, GIOCondition condition,
if
(
!
g_queue_is_empty
(
client
->
deferred_send
))
{
/* deferred buffers exist: schedule write */
client
->
source_id
=
g_io_add_watch
(
client
->
channel
,
G
_IO_OUT
|
G_IO_ERR
|
G_IO_HUP
,
G
IOCondition
(
G_IO_OUT
|
G_IO_ERR
|
G_IO_HUP
)
,
client_out_event
,
client
);
return
false
;
}
...
...
src/
client_expire.c
→
src/
ClientExpire.cxx
View file @
70b87f2e
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -18,7 +18,7 @@
*/
#include "config.h"
#include "
client_internal.h
"
#include "
ClientInternal.hxx
"
static
guint
expire_source_id
;
...
...
@@ -42,7 +42,7 @@ client_set_expired(struct client *client)
static
void
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
))
{
g_debug
(
"[%u] expired"
,
client
->
num
);
...
...
src/
client_file.c
→
src/
ClientFile.cxx
View file @
70b87f2e
/*
* Copyright (C) 2003-201
2
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -17,8 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "
client_file.h
"
#include "
client.h
"
#include "
ClientFile.hxx
"
#include "
Client.hxx
"
#include "ack.h"
#include "io_error.h"
...
...
src/
client_file.h
→
src/
ClientFile.hxx
View file @
70b87f2e
/*
* Copyright (C) 2003-201
2
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -17,8 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_CLIENT_FILE_H
#define MPD_CLIENT_FILE_H
#ifndef MPD_CLIENT_FILE_H
XX
#define MPD_CLIENT_FILE_H
XX
#include "gerror.h"
...
...
src/
client_global.c
→
src/
ClientGlobal.cxx
View file @
70b87f2e
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -18,8 +18,11 @@
*/
#include "config.h"
#include "client_internal.h"
#include "ClientInternal.hxx"
extern
"C"
{
#include "conf.h"
}
#include <assert.h>
...
...
src/
client_idle.c
→
src/
ClientIdle.cxx
View file @
70b87f2e
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -18,9 +18,12 @@
*/
#include "config.h"
#include "client_idle.h"
#include "client_internal.h"
#include "ClientIdle.hxx"
#include "ClientInternal.hxx"
extern
"C"
{
#include "idle.h"
}
#include <assert.h>
...
...
@@ -68,7 +71,7 @@ client_idle_add(struct client *client, unsigned flags)
static
void
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
);
client_idle_add
(
client
,
flags
);
...
...
src/
client_idle.h
→
src/
ClientIdle.hxx
View file @
70b87f2e
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -17,10 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_CLIENT_IDLE_H
#define MPD_CLIENT_IDLE_H
#include <stdbool.h>
#ifndef MPD_CLIENT_IDLE_HXX
#define MPD_CLIENT_IDLE_HXX
struct
client
;
...
...
src/
client_internal.h
→
src/
ClientInternal.hxx
View file @
70b87f2e
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -17,11 +17,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_CLIENT_INTERNAL_H
#define MPD_CLIENT_INTERNAL_H
#ifndef MPD_CLIENT_INTERNAL_H
XX
#define MPD_CLIENT_INTERNAL_H
XX
#include "
client.h
"
#include "
client_message.h
"
#include "
Client.hxx
"
#include "
ClientMessage.hxx
"
#include "command.h"
#include <glib.h>
...
...
src/
client_list.c
→
src/
ClientList.cxx
View file @
70b87f2e
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -18,7 +18,7 @@
*/
#include "config.h"
#include "
client_internal.h
"
#include "
ClientInternal.hxx
"
#include <assert.h>
...
...
@@ -42,7 +42,7 @@ client_list_get_first(void)
{
assert
(
clients
!=
NULL
);
return
clients
->
data
;
return
(
struct
client
*
)
clients
->
data
;
}
void
...
...
src/
client_message.c
→
src/
ClientMessage.cxx
View file @
70b87f2e
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "
client_message.h
"
#include "
ClientMessage.hxx
"
#include <assert.h>
#include <glib.h>
...
...
src/
client_message.h
→
src/
ClientMessage.hxx
View file @
70b87f2e
File moved
src/ClientNew.cxx
View file @
70b87f2e
...
...
@@ -18,9 +18,7 @@
*/
#include "config.h"
extern
"C"
{
#include "client_internal.h"
}
#include "ClientInternal.hxx"
#include "fd_util.h"
extern
"C"
{
#include "fifo_buffer.h"
...
...
src/
client_process.c
→
src/
ClientProcess.cxx
View file @
70b87f2e
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -18,9 +18,9 @@
*/
#include "config.h"
#include "
client_internal.h
"
#include "protocol/
result.h
"
#include "AllCommands.h"
#include "
ClientInternal.hxx
"
#include "protocol/
Result.hxx
"
#include "AllCommands.h
xx
"
#include <string.h>
...
...
@@ -35,7 +35,7 @@ client_process_command_list(struct client *client, bool list_ok, GSList *list)
unsigned
num
=
0
;
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
\"
"
,
cmd
);
...
...
src/
client_read.c
→
src/
ClientRead.cxx
View file @
70b87f2e
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -18,8 +18,11 @@
*/
#include "config.h"
#include "client_internal.h"
#include "ClientInternal.hxx"
extern
"C"
{
#include "fifo_buffer.h"
}
#include <assert.h>
#include <string.h>
...
...
@@ -27,19 +30,16 @@
static
char
*
client_read_line
(
struct
client
*
client
)
{
const
char
*
p
,
*
newline
;
size_t
length
;
char
*
line
;
p
=
fifo_buffer_read
(
client
->
input
,
&
length
);
const
char
*
p
=
(
const
char
*
)
fifo_buffer_read
(
client
->
input
,
&
length
);
if
(
p
==
NULL
)
return
NULL
;
newline
=
memchr
(
p
,
'\n'
,
length
);
const
char
*
newline
=
(
const
char
*
)
memchr
(
p
,
'\n'
,
length
);
if
(
newline
==
NULL
)
return
NULL
;
line
=
g_strndup
(
p
,
newline
-
p
);
char
*
line
=
g_strndup
(
p
,
newline
-
p
);
fifo_buffer_consume
(
client
->
input
,
newline
-
p
+
1
);
return
g_strchomp
(
line
);
...
...
@@ -71,8 +71,6 @@ client_input_received(struct client *client, size_t bytesRead)
enum
command_return
client_read
(
struct
client
*
client
)
{
char
*
p
;
size_t
max_length
;
GError
*
error
=
NULL
;
GIOStatus
status
;
gsize
bytes_read
;
...
...
@@ -80,7 +78,8 @@ client_read(struct client *client)
assert
(
client
!=
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
)
{
g_warning
(
"[%u] buffer overflow"
,
client
->
num
);
return
COMMAND_RETURN_CLOSE
;
...
...
src/
client_subscribe.c
→
src/
ClientSubscribe.cxx
View file @
70b87f2e
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -17,10 +17,13 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "client_subscribe.h"
#include "client_internal.h"
#include "client_idle.h"
#include "ClientSubscribe.hxx"
#include "ClientIdle.hxx"
#include "ClientInternal.hxx"
extern
"C"
{
#include "idle.h"
}
#include <string.h>
...
...
src/
client_subscribe.h
→
src/
ClientSubscribe.hxx
View file @
70b87f2e
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -17,13 +17,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_CLIENT_SUBSCRIBE_H
#define MPD_CLIENT_SUBSCRIBE_H
#ifndef MPD_CLIENT_SUBSCRIBE_H
XX
#define MPD_CLIENT_SUBSCRIBE_H
XX
#include "gcc.h"
#include <stdbool.h>
typedef
struct
_GSList
GSList
;
struct
client
;
struct
client_message
;
...
...
src/
client_write.c
→
src/
ClientWrite.cxx
View file @
70b87f2e
/*
* Copyright (C) 2003-201
1
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -18,7 +18,7 @@
*/
#include "config.h"
#include "
client_internal.h
"
#include "
ClientInternal.hxx
"
#include <assert.h>
#include <string.h>
...
...
@@ -73,6 +73,7 @@ client_write_deferred(struct client *client)
while
(
!
g_queue_is_empty
(
client
->
deferred_send
))
{
struct
deferred_buffer
*
buf
=
(
struct
deferred_buffer
*
)
g_queue_peek_head
(
client
->
deferred_send
);
assert
(
buf
->
size
>
0
);
...
...
@@ -129,7 +130,7 @@ static void client_defer_output(struct client *client,
return
;
}
buf
=
g_malloc
(
alloc
);
buf
=
(
struct
deferred_buffer
*
)
g_malloc
(
alloc
);
buf
->
size
=
length
;
memcpy
(
buf
->
data
,
data
,
length
);
...
...
@@ -246,7 +247,6 @@ void client_vprintf(struct client *client, const char *fmt, va_list args)
#ifndef G_OS_WIN32
va_list
tmp
;
int
length
;
char
*
buffer
;
va_copy
(
tmp
,
args
);
length
=
vsnprintf
(
NULL
,
0
,
fmt
,
tmp
);
...
...
@@ -256,7 +256,7 @@ void client_vprintf(struct client *client, const char *fmt, va_list args)
/* wtf.. */
return
;
buffer
=
g_malloc
(
length
+
1
);
char
*
buffer
=
(
char
*
)
g_malloc
(
length
+
1
);
vsnprintf
(
buffer
,
length
+
1
,
fmt
,
args
);
client_write
(
client
,
buffer
,
length
);
g_free
(
buffer
);
...
...
src/CommandError.cxx
View file @
70b87f2e
...
...
@@ -21,10 +21,7 @@
#include "CommandError.hxx"
#include "db_error.h"
#include "io_error.h"
extern
"C"
{
#include "protocol/result.h"
}
#include "protocol/Result.hxx"
#include <assert.h>
#include <errno.h>
...
...
src/DatabaseCommands.cxx
View file @
70b87f2e
/*
* Copyright (C) 2003-201
2
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -24,14 +24,11 @@
#include "DatabasePrint.hxx"
#include "DatabaseSelection.hxx"
#include "CommandError.hxx"
#include "
client_internal.h
"
#include "
ClientInternal.hxx
"
#include "tag.h"
#include "uri.h"
#include "SongFilter.hxx"
extern
"C"
{
#include "protocol/result.h"
}
#include "protocol/Result.hxx"
#include <assert.h>
#include <string.h>
...
...
src/DatabasePrint.cxx
View file @
70b87f2e
/*
* Copyright (C) 2003-201
2
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -25,9 +25,9 @@
#include "SongPrint.hxx"
#include "TimePrint.hxx"
#include "Directory.hxx"
#include "Client.hxx"
extern
"C"
{
#include "client.h"
#include "song.h"
#include "tag.h"
}
...
...
src/DecoderPrint.cxx
View file @
70b87f2e
...
...
@@ -21,10 +21,7 @@
#include "DecoderPrint.hxx"
#include "decoder_list.h"
#include "decoder_plugin.h"
extern
"C"
{
#include "client.h"
}
#include "Client.hxx"
#include <assert.h>
...
...
src/Listen.cxx
View file @
70b87f2e
...
...
@@ -20,10 +20,10 @@
#include "config.h"
#include "Listen.hxx"
#include "Main.hxx"
#include "Client.hxx"
extern
"C"
{
#include "server_socket.h"
#include "client.h"
#include "conf.h"
}
...
...
src/Main.cxx
View file @
70b87f2e
...
...
@@ -29,14 +29,14 @@
#include "DatabaseSimple.hxx"
#include "Permission.hxx"
#include "Listen.hxx"
#include "ClientIdle.hxx"
#include "Client.hxx"
#include "AllCommands.hxx"
extern
"C"
{
#include "daemon.h"
#include "io_thread.h"
#include "client.h"
#include "client_idle.h"
#include "idle.h"
#include "AllCommands.h"
#include "playlist.h"
#include "cmdline.h"
#include "conf.h"
...
...
src/MessageCommands.cxx
View file @
70b87f2e
/*
* Copyright (C) 2003-201
2
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -19,13 +19,10 @@
#include "config.h"
#include "MessageCommands.hxx"
extern
"C"
{
#include "protocol/argparser.h"
#include "protocol/result.h"
#include "client_internal.h"
#include "client_subscribe.h"
}
#include "ClientSubscribe.hxx"
#include "ClientInternal.hxx"
#include "protocol/Result.hxx"
#include "protocol/ArgParser.hxx"
#include <set>
#include <string>
...
...
src/OtherCommands.cxx
View file @
70b87f2e
/*
* Copyright (C) 2003-201
2
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -29,10 +29,10 @@
#include "TimePrint.hxx"
#include "Mapper.hxx"
#include "DecoderPrint.hxx"
#include "protocol/ArgParser.hxx"
#include "protocol/Result.hxx"
extern
"C"
{
#include "protocol/argparser.h"
#include "protocol/result.h"
#include "ls.h"
#include "uri.h"
#include "volume.h"
...
...
@@ -41,11 +41,11 @@ extern "C" {
#include "Permission.hxx"
#include "PlaylistFile.hxx"
#include "ClientIdle.hxx"
#include "ClientFile.hxx"
#include "Client.hxx"
extern
"C"
{
#include "client.h"
#include "client_idle.h"
#include "client_file.h"
#include "idle.h"
}
...
...
src/OutputCommands.cxx
View file @
70b87f2e
...
...
@@ -20,10 +20,10 @@
#include "config.h"
#include "OutputCommands.hxx"
#include "OutputPrint.hxx"
#include "protocol/Result.hxx"
#include "protocol/ArgParser.hxx"
extern
"C"
{
#include "protocol/argparser.h"
#include "protocol/result.h"
#include "output_command.h"
}
...
...
src/OutputPrint.cxx
View file @
70b87f2e
...
...
@@ -25,10 +25,10 @@
#include "config.h"
#include "OutputPrint.hxx"
#include "output_internal.h"
#include "Client.hxx"
extern
"C"
{
#include "output_all.h"
#include "client.h"
}
void
...
...
src/PlayerCommands.cxx
View file @
70b87f2e
/*
* Copyright (C) 2003-201
2
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -22,15 +22,14 @@
#include "CommandError.hxx"
#include "PlaylistPrint.hxx"
#include "UpdateGlue.hxx"
#include "ClientInternal.hxx"
#include "protocol/Result.hxx"
#include "protocol/ArgParser.hxx"
extern
"C"
{
#include "protocol/argparser.h"
#include "protocol/result.h"
#include "player_control.h"
#include "playlist.h"
#include "volume.h"
#include "client.h"
#include "client_internal.h"
#include "replay_gain_config.h"
}
...
...
src/PlaylistCommands.cxx
View file @
70b87f2e
...
...
@@ -26,14 +26,14 @@
#include "PlaylistFile.hxx"
#include "PlaylistQueue.hxx"
#include "TimePrint.hxx"
#include "ClientInternal.hxx"
#include "protocol/ArgParser.hxx"
#include "protocol/Result.hxx"
extern
"C"
{
#include "protocol/argparser.h"
#include "protocol/result.h"
#include "playlist.h"
#include "ls.h"
#include "uri.h"
#include "client_internal.h"
}
#include <assert.h>
...
...
src/PlaylistPrint.cxx
View file @
70b87f2e
...
...
@@ -26,13 +26,13 @@
#include "SongPrint.hxx"
#include "DatabaseGlue.hxx"
#include "DatabasePlugin.hxx"
#include "Client.hxx"
extern
"C"
{
#include "playlist_list.h"
#include "playlist_plugin.h"
#include "playlist.h"
#include "song.h"
#include "client.h"
#include "input_stream.h"
}
...
...
src/QueueCommands.cxx
View file @
70b87f2e
/*
* Copyright (C) 2003-201
2
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -23,15 +23,15 @@
#include "DatabaseQueue.hxx"
#include "SongFilter.hxx"
#include "PlaylistPrint.hxx"
#include "ClientFile.hxx"
#include "ClientInternal.hxx"
#include "protocol/ArgParser.hxx"
#include "protocol/Result.hxx"
extern
"C"
{
#include "protocol/argparser.h"
#include "protocol/result.h"
#include "playlist.h"
#include "ls.h"
#include "uri.h"
#include "client_internal.h"
#include "client_file.h"
}
#include <string.h>
...
...
src/QueuePrint.cxx
View file @
70b87f2e
...
...
@@ -22,11 +22,11 @@
#include "SongFilter.hxx"
#include "SongPrint.hxx"
#include "Mapper.hxx"
#include "Client.hxx"
extern
"C"
{
#include "queue.h"
#include "song.h"
#include "client.h"
}
/**
...
...
src/SongPrint.cxx
View file @
70b87f2e
...
...
@@ -24,9 +24,9 @@
#include "TimePrint.hxx"
#include "TagPrint.hxx"
#include "Mapper.hxx"
#include "Client.hxx"
extern
"C"
{
#include "client.h"
#include "uri.h"
}
...
...
src/Stats.cxx
View file @
70b87f2e
/*
* Copyright (C) 2003-201
2
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -21,11 +21,10 @@
extern
"C"
{
#include "stats.h"
#include "client.h"
#include "player_control.h"
#include "client_internal.h"
}
#include "ClientInternal.hxx"
#include "DatabaseSelection.hxx"
#include "DatabaseGlue.hxx"
#include "DatabasePlugin.hxx"
...
...
src/StickerCommands.cxx
View file @
70b87f2e
...
...
@@ -28,10 +28,7 @@
#include "StickerPrint.hxx"
#include "StickerDatabase.hxx"
#include "CommandError.hxx"
extern
"C"
{
#include "protocol/result.h"
}
#include "protocol/Result.hxx"
#include <string.h>
...
...
src/StickerPrint.cxx
View file @
70b87f2e
...
...
@@ -20,10 +20,7 @@
#include "config.h"
#include "StickerPrint.hxx"
#include "StickerDatabase.hxx"
extern
"C"
{
#include "client.h"
}
#include "Client.hxx"
void
sticker_print_value
(
struct
client
*
client
,
...
...
src/TagPrint.cxx
View file @
70b87f2e
...
...
@@ -22,10 +22,7 @@
#include "tag.h"
#include "tag_internal.h"
#include "song.h"
extern
"C"
{
#include "client.h"
}
#include "Client.hxx"
void
tag_print_types
(
struct
client
*
client
)
{
...
...
src/TimePrint.cxx
View file @
70b87f2e
...
...
@@ -19,10 +19,7 @@
#include "config.h"
#include "TimePrint.hxx"
extern
"C"
{
#include "client.h"
}
#include "Client.hxx"
#include <glib.h>
...
...
src/ls.cxx
View file @
70b87f2e
...
...
@@ -22,9 +22,10 @@
extern
"C"
{
#include "ls.h"
#include "uri.h"
#include "client.h"
}
#include "Client.hxx"
#include <glib.h>
#include <assert.h>
...
...
src/protocol/
argparser.c
→
src/protocol/
ArgParser.cxx
View file @
70b87f2e
/*
* Copyright (C) 2003-201
2
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -18,8 +18,8 @@
*/
#include "config.h"
#include "
argparser.h
"
#include "
result.h
"
#include "
ArgParser.hxx
"
#include "
Result.hxx
"
#include <glib.h>
#include <stdlib.h>
...
...
src/protocol/
argparser.h
→
src/protocol/
ArgParser.hxx
View file @
70b87f2e
/*
* Copyright (C) 2003-201
2
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -17,8 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_PROTOCOL_ARGPARSER_H
#define MPD_PROTOCOL_ARGPARSER_H
#ifndef MPD_PROTOCOL_ARGPARSER_H
XX
#define MPD_PROTOCOL_ARGPARSER_H
XX
#include "check.h"
...
...
src/protocol/
result.c
→
src/protocol/
Result.cxx
View file @
70b87f2e
/*
* Copyright (C) 2003-201
2
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -18,8 +18,8 @@
*/
#include "config.h"
#include "
result.h
"
#include "
client.h
"
#include "
Result.hxx
"
#include "
Client.hxx
"
#include <assert.h>
...
...
src/protocol/
result.h
→
src/protocol/
Result.hxx
View file @
70b87f2e
/*
* Copyright (C) 2003-201
2
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -17,8 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_PROTOCOL_RESULT_H
#define MPD_PROTOCOL_RESULT_H
#ifndef MPD_PROTOCOL_RESULT_H
XX
#define MPD_PROTOCOL_RESULT_H
XX
#include "check.h"
#include "gcc.h"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment