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
7a982169
Commit
7a982169
authored
Jan 03, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Client: rename the struct client to class Client
parent
f2510d60
Hide whitespace changes
Inline
Side-by-side
Showing
63 changed files
with
394 additions
and
372 deletions
+394
-372
AllCommands.cxx
src/AllCommands.cxx
+8
-8
AllCommands.hxx
src/AllCommands.hxx
+2
-2
Client.cxx
src/Client.cxx
+4
-4
Client.hxx
src/Client.hxx
+9
-9
ClientEvent.cxx
src/ClientEvent.cxx
+2
-2
ClientExpire.cxx
src/ClientExpire.cxx
+2
-2
ClientFile.cxx
src/ClientFile.cxx
+1
-1
ClientFile.hxx
src/ClientFile.hxx
+2
-2
ClientGlobal.cxx
src/ClientGlobal.cxx
+1
-1
ClientIdle.cxx
src/ClientIdle.cxx
+4
-4
ClientIdle.hxx
src/ClientIdle.hxx
+3
-3
ClientInternal.hxx
src/ClientInternal.hxx
+12
-11
ClientList.cxx
src/ClientList.cxx
+4
-4
ClientNew.cxx
src/ClientNew.cxx
+3
-3
ClientProcess.cxx
src/ClientProcess.cxx
+2
-2
ClientRead.cxx
src/ClientRead.cxx
+3
-3
ClientSubscribe.cxx
src/ClientSubscribe.cxx
+6
-6
ClientSubscribe.hxx
src/ClientSubscribe.hxx
+6
-6
ClientWrite.cxx
src/ClientWrite.cxx
+16
-11
CommandError.cxx
src/CommandError.cxx
+2
-2
CommandError.hxx
src/CommandError.hxx
+4
-2
DatabaseCommands.cxx
src/DatabaseCommands.cxx
+12
-12
DatabaseCommands.hxx
src/DatabaseCommands.hxx
+12
-10
DatabasePrint.cxx
src/DatabasePrint.cxx
+14
-14
DatabasePrint.hxx
src/DatabasePrint.hxx
+6
-6
DecoderPrint.cxx
src/DecoderPrint.cxx
+2
-2
DecoderPrint.hxx
src/DecoderPrint.hxx
+2
-2
MessageCommands.cxx
src/MessageCommands.cxx
+7
-7
MessageCommands.hxx
src/MessageCommands.hxx
+7
-5
OtherCommands.cxx
src/OtherCommands.cxx
+15
-15
OtherCommands.hxx
src/OtherCommands.hxx
+16
-14
OutputCommands.cxx
src/OutputCommands.cxx
+3
-3
OutputCommands.hxx
src/OutputCommands.hxx
+5
-3
OutputPrint.cxx
src/OutputPrint.cxx
+1
-1
OutputPrint.hxx
src/OutputPrint.hxx
+2
-2
PlayerCommands.cxx
src/PlayerCommands.cxx
+21
-21
PlayerCommands.hxx
src/PlayerCommands.hxx
+23
-21
PlaylistCommands.cxx
src/PlaylistCommands.cxx
+12
-12
PlaylistCommands.hxx
src/PlaylistCommands.hxx
+13
-11
PlaylistPrint.cxx
src/PlaylistPrint.cxx
+11
-11
PlaylistPrint.hxx
src/PlaylistPrint.hxx
+10
-10
QueueCommands.cxx
src/QueueCommands.cxx
+20
-20
QueueCommands.hxx
src/QueueCommands.hxx
+21
-19
QueuePrint.cxx
src/QueuePrint.cxx
+6
-6
QueuePrint.hxx
src/QueuePrint.hxx
+6
-6
SongPrint.cxx
src/SongPrint.cxx
+2
-2
SongPrint.hxx
src/SongPrint.hxx
+3
-3
Stats.cxx
src/Stats.cxx
+1
-1
StickerCommands.cxx
src/StickerCommands.cxx
+3
-3
StickerCommands.hxx
src/StickerCommands.hxx
+3
-1
StickerPrint.cxx
src/StickerPrint.cxx
+3
-3
StickerPrint.hxx
src/StickerPrint.hxx
+3
-4
TagPrint.cxx
src/TagPrint.cxx
+2
-2
TagPrint.hxx
src/TagPrint.hxx
+3
-3
TimePrint.cxx
src/TimePrint.cxx
+1
-1
TimePrint.hxx
src/TimePrint.hxx
+2
-2
ls.cxx
src/ls.cxx
+1
-1
ls.hxx
src/ls.hxx
+2
-3
ArgParser.cxx
src/protocol/ArgParser.cxx
+6
-6
ArgParser.hxx
src/protocol/ArgParser.hxx
+7
-7
Result.cxx
src/protocol/Result.cxx
+3
-3
Result.hxx
src/protocol/Result.hxx
+4
-4
stats.h
src/stats.h
+2
-2
No files found.
src/AllCommands.cxx
View file @
7a982169
...
@@ -58,16 +58,16 @@ struct command {
...
@@ -58,16 +58,16 @@ struct command {
unsigned
permission
;
unsigned
permission
;
int
min
;
int
min
;
int
max
;
int
max
;
enum
command_return
(
*
handler
)(
struct
c
lient
*
client
,
int
argc
,
char
**
argv
);
enum
command_return
(
*
handler
)(
C
lient
*
client
,
int
argc
,
char
**
argv
);
};
};
/* don't be fooled, this is the command handler for "commands" command */
/* don't be fooled, this is the command handler for "commands" command */
static
enum
command_return
static
enum
command_return
handle_commands
(
struct
c
lient
*
client
,
handle_commands
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[]);
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[]);
static
enum
command_return
static
enum
command_return
handle_not_commands
(
struct
c
lient
*
client
,
handle_not_commands
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[]);
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[]);
/**
/**
...
@@ -182,7 +182,7 @@ command_available(G_GNUC_UNUSED const struct command *cmd)
...
@@ -182,7 +182,7 @@ command_available(G_GNUC_UNUSED const struct command *cmd)
/* don't be fooled, this is the command handler for "commands" command */
/* don't be fooled, this is the command handler for "commands" command */
static
enum
command_return
static
enum
command_return
handle_commands
(
struct
c
lient
*
client
,
handle_commands
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
{
{
const
unsigned
permission
=
client_get_permission
(
client
);
const
unsigned
permission
=
client_get_permission
(
client
);
...
@@ -200,7 +200,7 @@ handle_commands(struct client *client,
...
@@ -200,7 +200,7 @@ handle_commands(struct client *client,
}
}
static
enum
command_return
static
enum
command_return
handle_not_commands
(
struct
c
lient
*
client
,
handle_not_commands
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
{
{
const
unsigned
permission
=
client_get_permission
(
client
);
const
unsigned
permission
=
client_get_permission
(
client
);
...
@@ -252,7 +252,7 @@ command_lookup(const char *name)
...
@@ -252,7 +252,7 @@ command_lookup(const char *name)
}
}
static
bool
static
bool
command_check_request
(
const
struct
command
*
cmd
,
struct
c
lient
*
client
,
command_check_request
(
const
struct
command
*
cmd
,
C
lient
*
client
,
unsigned
permission
,
int
argc
,
char
*
argv
[])
unsigned
permission
,
int
argc
,
char
*
argv
[])
{
{
int
min
=
cmd
->
min
+
1
;
int
min
=
cmd
->
min
+
1
;
...
@@ -290,7 +290,7 @@ command_check_request(const struct command *cmd, struct client *client,
...
@@ -290,7 +290,7 @@ command_check_request(const struct command *cmd, struct client *client,
}
}
static
const
struct
command
*
static
const
struct
command
*
command_checked_lookup
(
struct
c
lient
*
client
,
unsigned
permission
,
command_checked_lookup
(
C
lient
*
client
,
unsigned
permission
,
int
argc
,
char
*
argv
[])
int
argc
,
char
*
argv
[])
{
{
const
struct
command
*
cmd
;
const
struct
command
*
cmd
;
...
@@ -317,7 +317,7 @@ command_checked_lookup(struct client *client, unsigned permission,
...
@@ -317,7 +317,7 @@ command_checked_lookup(struct client *client, unsigned permission,
}
}
enum
command_return
enum
command_return
command_process
(
struct
c
lient
*
client
,
unsigned
num
,
char
*
line
)
command_process
(
C
lient
*
client
,
unsigned
num
,
char
*
line
)
{
{
GError
*
error
=
NULL
;
GError
*
error
=
NULL
;
int
argc
;
int
argc
;
...
...
src/AllCommands.hxx
View file @
7a982169
...
@@ -22,13 +22,13 @@
...
@@ -22,13 +22,13 @@
#include "command.h"
#include "command.h"
struct
c
lient
;
class
C
lient
;
void
command_init
(
void
);
void
command_init
(
void
);
void
command_finish
(
void
);
void
command_finish
(
void
);
enum
command_return
enum
command_return
command_process
(
struct
c
lient
*
client
,
unsigned
num
,
char
*
line
);
command_process
(
C
lient
*
client
,
unsigned
num
,
char
*
line
);
#endif
#endif
src/Client.cxx
View file @
7a982169
...
@@ -20,22 +20,22 @@
...
@@ -20,22 +20,22 @@
#include "config.h"
#include "config.h"
#include "ClientInternal.hxx"
#include "ClientInternal.hxx"
bool
client_is_expired
(
const
struct
c
lient
*
client
)
bool
client_is_expired
(
const
C
lient
*
client
)
{
{
return
client
->
channel
==
NULL
;
return
client
->
channel
==
NULL
;
}
}
int
client_get_uid
(
const
struct
c
lient
*
client
)
int
client_get_uid
(
const
C
lient
*
client
)
{
{
return
client
->
uid
;
return
client
->
uid
;
}
}
unsigned
client_get_permission
(
const
struct
c
lient
*
client
)
unsigned
client_get_permission
(
const
C
lient
*
client
)
{
{
return
client
->
permission
;
return
client
->
permission
;
}
}
void
client_set_permission
(
struct
c
lient
*
client
,
unsigned
permission
)
void
client_set_permission
(
C
lient
*
client
,
unsigned
permission
)
{
{
client
->
permission
=
permission
;
client
->
permission
=
permission
;
}
}
src/Client.hxx
View file @
7a982169
...
@@ -26,9 +26,9 @@
...
@@ -26,9 +26,9 @@
#include <stddef.h>
#include <stddef.h>
#include <stdarg.h>
#include <stdarg.h>
struct
client
;
struct
sockaddr
;
struct
sockaddr
;
struct
player_control
;
struct
player_control
;
class
Client
;
void
client_manager_init
(
void
);
void
client_manager_init
(
void
);
void
client_manager_deinit
(
void
);
void
client_manager_deinit
(
void
);
...
@@ -37,14 +37,14 @@ void client_new(struct player_control *player_control,
...
@@ -37,14 +37,14 @@ void client_new(struct player_control *player_control,
int
fd
,
const
struct
sockaddr
*
sa
,
size_t
sa_length
,
int
uid
);
int
fd
,
const
struct
sockaddr
*
sa
,
size_t
sa_length
,
int
uid
);
gcc_pure
gcc_pure
bool
client_is_expired
(
const
struct
c
lient
*
client
);
bool
client_is_expired
(
const
C
lient
*
client
);
/**
/**
* returns the uid of the client process, or a negative value if the
* returns the uid of the client process, or a negative value if the
* uid is unknown
* uid is unknown
*/
*/
gcc_pure
gcc_pure
int
client_get_uid
(
const
struct
c
lient
*
client
);
int
client_get_uid
(
const
C
lient
*
client
);
/**
/**
* Is this client running on the same machine, connected with a local
* Is this client running on the same machine, connected with a local
...
@@ -52,31 +52,31 @@ int client_get_uid(const struct client *client);
...
@@ -52,31 +52,31 @@ int client_get_uid(const struct client *client);
*/
*/
gcc_pure
gcc_pure
static
inline
bool
static
inline
bool
client_is_local
(
const
struct
c
lient
*
client
)
client_is_local
(
const
C
lient
*
client
)
{
{
return
client_get_uid
(
client
)
>
0
;
return
client_get_uid
(
client
)
>
0
;
}
}
gcc_pure
gcc_pure
unsigned
client_get_permission
(
const
struct
c
lient
*
client
);
unsigned
client_get_permission
(
const
C
lient
*
client
);
void
client_set_permission
(
struct
c
lient
*
client
,
unsigned
permission
);
void
client_set_permission
(
C
lient
*
client
,
unsigned
permission
);
/**
/**
* Write a C string to the client.
* Write a C string to the client.
*/
*/
void
client_puts
(
struct
c
lient
*
client
,
const
char
*
s
);
void
client_puts
(
C
lient
*
client
,
const
char
*
s
);
/**
/**
* Write a printf-like formatted string to the client.
* Write a printf-like formatted string to the client.
*/
*/
void
client_vprintf
(
struct
c
lient
*
client
,
const
char
*
fmt
,
va_list
args
);
void
client_vprintf
(
C
lient
*
client
,
const
char
*
fmt
,
va_list
args
);
/**
/**
* Write a printf-like formatted string to the client.
* Write a printf-like formatted string to the client.
*/
*/
gcc_fprintf
gcc_fprintf
void
void
client_printf
(
struct
c
lient
*
client
,
const
char
*
fmt
,
...);
client_printf
(
C
lient
*
client
,
const
char
*
fmt
,
...);
#endif
#endif
src/ClientEvent.cxx
View file @
7a982169
...
@@ -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
=
(
struct
c
lient
*
)
data
;
Client
*
client
=
(
C
lient
*
)
data
;
assert
(
!
client_is_expired
(
client
));
assert
(
!
client_is_expired
(
client
));
...
@@ -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
=
(
struct
c
lient
*
)
data
;
Client
*
client
=
(
C
lient
*
)
data
;
enum
command_return
ret
;
enum
command_return
ret
;
assert
(
!
client_is_expired
(
client
));
assert
(
!
client_is_expired
(
client
));
...
...
src/ClientExpire.cxx
View file @
7a982169
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
static
guint
expire_source_id
;
static
guint
expire_source_id
;
void
void
client_set_expired
(
struct
c
lient
*
client
)
client_set_expired
(
C
lient
*
client
)
{
{
if
(
!
client_is_expired
(
client
))
if
(
!
client_is_expired
(
client
))
client_schedule_expire
();
client_schedule_expire
();
...
@@ -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
=
(
struct
c
lient
*
)
data
;
Client
*
client
=
(
C
lient
*
)
data
;
if
(
client_is_expired
(
client
))
{
if
(
client_is_expired
(
client
))
{
g_debug
(
"[%u] expired"
,
client
->
num
);
g_debug
(
"[%u] expired"
,
client
->
num
);
...
...
src/ClientFile.cxx
View file @
7a982169
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
#include <unistd.h>
#include <unistd.h>
bool
bool
client_allow_file
(
const
struct
c
lient
*
client
,
const
char
*
path_fs
,
client_allow_file
(
const
C
lient
*
client
,
const
char
*
path_fs
,
GError
**
error_r
)
GError
**
error_r
)
{
{
#ifdef WIN32
#ifdef WIN32
...
...
src/ClientFile.hxx
View file @
7a982169
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
#include <stdbool.h>
#include <stdbool.h>
struct
c
lient
;
class
C
lient
;
/**
/**
* Is this client allowed to use the specified local file?
* Is this client allowed to use the specified local file?
...
@@ -37,7 +37,7 @@ struct client;
...
@@ -37,7 +37,7 @@ struct client;
* @return true if access is allowed
* @return true if access is allowed
*/
*/
bool
bool
client_allow_file
(
const
struct
c
lient
*
client
,
const
char
*
path_fs
,
client_allow_file
(
const
C
lient
*
client
,
const
char
*
path_fs
,
GError
**
error_r
);
GError
**
error_r
);
#endif
#endif
src/ClientGlobal.cxx
View file @
7a982169
...
@@ -58,7 +58,7 @@ void client_manager_init(void)
...
@@ -58,7 +58,7 @@ void client_manager_init(void)
static
void
client_close_all
(
void
)
static
void
client_close_all
(
void
)
{
{
while
(
!
client_list_is_empty
())
{
while
(
!
client_list_is_empty
())
{
struct
c
lient
*
client
=
client_list_get_first
();
C
lient
*
client
=
client_list_get_first
();
client_close
(
client
);
client_close
(
client
);
}
}
...
...
src/ClientIdle.cxx
View file @
7a982169
...
@@ -31,7 +31,7 @@ extern "C" {
...
@@ -31,7 +31,7 @@ extern "C" {
* Send "idle" response to this client.
* Send "idle" response to this client.
*/
*/
static
void
static
void
client_idle_notify
(
struct
c
lient
*
client
)
client_idle_notify
(
C
lient
*
client
)
{
{
unsigned
flags
,
i
;
unsigned
flags
,
i
;
const
char
*
const
*
idle_names
;
const
char
*
const
*
idle_names
;
...
@@ -55,7 +55,7 @@ client_idle_notify(struct client *client)
...
@@ -55,7 +55,7 @@ client_idle_notify(struct client *client)
}
}
void
void
client_idle_add
(
struct
c
lient
*
client
,
unsigned
flags
)
client_idle_add
(
C
lient
*
client
,
unsigned
flags
)
{
{
if
(
client_is_expired
(
client
))
if
(
client_is_expired
(
client
))
return
;
return
;
...
@@ -71,7 +71,7 @@ client_idle_add(struct client *client, unsigned flags)
...
@@ -71,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
=
(
struct
c
lient
*
)
data
;
Client
*
client
=
(
C
lient
*
)
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
);
...
@@ -84,7 +84,7 @@ void client_manager_idle_add(unsigned flags)
...
@@ -84,7 +84,7 @@ void client_manager_idle_add(unsigned flags)
client_list_foreach
(
client_idle_callback
,
GUINT_TO_POINTER
(
flags
));
client_list_foreach
(
client_idle_callback
,
GUINT_TO_POINTER
(
flags
));
}
}
bool
client_idle_wait
(
struct
c
lient
*
client
,
unsigned
flags
)
bool
client_idle_wait
(
C
lient
*
client
,
unsigned
flags
)
{
{
assert
(
!
client
->
idle_waiting
);
assert
(
!
client
->
idle_waiting
);
...
...
src/ClientIdle.hxx
View file @
7a982169
...
@@ -20,10 +20,10 @@
...
@@ -20,10 +20,10 @@
#ifndef MPD_CLIENT_IDLE_HXX
#ifndef MPD_CLIENT_IDLE_HXX
#define MPD_CLIENT_IDLE_HXX
#define MPD_CLIENT_IDLE_HXX
struct
c
lient
;
class
C
lient
;
void
void
client_idle_add
(
struct
c
lient
*
client
,
unsigned
flags
);
client_idle_add
(
C
lient
*
client
,
unsigned
flags
);
/**
/**
* Adds the specified idle flags to all clients and immediately sends
* Adds the specified idle flags to all clients and immediately sends
...
@@ -38,6 +38,6 @@ client_manager_idle_add(unsigned flags);
...
@@ -38,6 +38,6 @@ client_manager_idle_add(unsigned flags);
* client into waiting mode and returns false.
* client into waiting mode and returns false.
*/
*/
bool
bool
client_idle_wait
(
struct
c
lient
*
client
,
unsigned
flags
);
client_idle_wait
(
C
lient
*
client
,
unsigned
flags
);
#endif
#endif
src/ClientInternal.hxx
View file @
7a982169
...
@@ -39,7 +39,8 @@ struct deferred_buffer {
...
@@ -39,7 +39,8 @@ struct deferred_buffer {
char
data
[
sizeof
(
long
)];
char
data
[
sizeof
(
long
)];
};
};
struct
client
{
class
Client
{
public
:
struct
player_control
*
player_control
;
struct
player_control
*
player_control
;
GIOChannel
*
channel
;
GIOChannel
*
channel
;
...
@@ -112,23 +113,23 @@ client_list_is_empty(void);
...
@@ -112,23 +113,23 @@ client_list_is_empty(void);
bool
bool
client_list_is_full
(
void
);
client_list_is_full
(
void
);
struct
c
lient
*
C
lient
*
client_list_get_first
(
void
);
client_list_get_first
(
void
);
void
void
client_list_add
(
struct
c
lient
*
client
);
client_list_add
(
C
lient
*
client
);
void
void
client_list_foreach
(
GFunc
func
,
gpointer
user_data
);
client_list_foreach
(
GFunc
func
,
gpointer
user_data
);
void
void
client_list_remove
(
struct
c
lient
*
client
);
client_list_remove
(
C
lient
*
client
);
void
void
client_close
(
struct
c
lient
*
client
);
client_close
(
C
lient
*
client
);
static
inline
void
static
inline
void
new_cmd_list_ptr
(
struct
c
lient
*
client
,
const
char
*
s
)
new_cmd_list_ptr
(
C
lient
*
client
,
const
char
*
s
)
{
{
client
->
cmd_list
=
g_slist_prepend
(
client
->
cmd_list
,
g_strdup
(
s
));
client
->
cmd_list
=
g_slist_prepend
(
client
->
cmd_list
,
g_strdup
(
s
));
}
}
...
@@ -143,7 +144,7 @@ free_cmd_list(GSList *list)
...
@@ -143,7 +144,7 @@ free_cmd_list(GSList *list)
}
}
void
void
client_set_expired
(
struct
c
lient
*
client
);
client_set_expired
(
C
lient
*
client
);
/**
/**
* Schedule an "expired" check for all clients: permanently delete
* Schedule an "expired" check for all clients: permanently delete
...
@@ -159,16 +160,16 @@ void
...
@@ -159,16 +160,16 @@ void
client_deinit_expire
(
void
);
client_deinit_expire
(
void
);
enum
command_return
enum
command_return
client_read
(
struct
c
lient
*
client
);
client_read
(
C
lient
*
client
);
enum
command_return
enum
command_return
client_process_line
(
struct
c
lient
*
client
,
char
*
line
);
client_process_line
(
C
lient
*
client
,
char
*
line
);
void
void
client_write_deferred
(
struct
c
lient
*
client
);
client_write_deferred
(
C
lient
*
client
);
void
void
client_write_output
(
struct
c
lient
*
client
);
client_write_output
(
C
lient
*
client
);
gboolean
gboolean
client_in_event
(
GIOChannel
*
source
,
GIOCondition
condition
,
client_in_event
(
GIOChannel
*
source
,
GIOCondition
condition
,
...
...
src/ClientList.cxx
View file @
7a982169
...
@@ -37,16 +37,16 @@ client_list_is_full(void)
...
@@ -37,16 +37,16 @@ client_list_is_full(void)
return
num_clients
>=
client_max_connections
;
return
num_clients
>=
client_max_connections
;
}
}
struct
c
lient
*
C
lient
*
client_list_get_first
(
void
)
client_list_get_first
(
void
)
{
{
assert
(
clients
!=
NULL
);
assert
(
clients
!=
NULL
);
return
(
struct
c
lient
*
)
clients
->
data
;
return
(
C
lient
*
)
clients
->
data
;
}
}
void
void
client_list_add
(
struct
c
lient
*
client
)
client_list_add
(
C
lient
*
client
)
{
{
clients
=
g_list_prepend
(
clients
,
client
);
clients
=
g_list_prepend
(
clients
,
client
);
++
num_clients
;
++
num_clients
;
...
@@ -59,7 +59,7 @@ client_list_foreach(GFunc func, gpointer user_data)
...
@@ -59,7 +59,7 @@ client_list_foreach(GFunc func, gpointer user_data)
}
}
void
void
client_list_remove
(
struct
c
lient
*
client
)
client_list_remove
(
C
lient
*
client
)
{
{
assert
(
num_clients
>
0
);
assert
(
num_clients
>
0
);
assert
(
clients
!=
NULL
);
assert
(
clients
!=
NULL
);
...
...
src/ClientNew.cxx
View file @
7a982169
...
@@ -50,7 +50,7 @@ client_new(struct player_control *player_control,
...
@@ -50,7 +50,7 @@ client_new(struct player_control *player_control,
int
fd
,
const
struct
sockaddr
*
sa
,
size_t
sa_length
,
int
uid
)
int
fd
,
const
struct
sockaddr
*
sa
,
size_t
sa_length
,
int
uid
)
{
{
static
unsigned
int
next_client_num
;
static
unsigned
int
next_client_num
;
struct
c
lient
*
client
;
C
lient
*
client
;
char
*
remote
;
char
*
remote
;
assert
(
player_control
!=
NULL
);
assert
(
player_control
!=
NULL
);
...
@@ -87,7 +87,7 @@ client_new(struct player_control *player_control,
...
@@ -87,7 +87,7 @@ client_new(struct player_control *player_control,
return
;
return
;
}
}
client
=
g_new0
(
struct
c
lient
,
1
);
client
=
g_new0
(
C
lient
,
1
);
client
->
player_control
=
player_control
;
client
->
player_control
=
player_control
;
client
->
channel
=
g_io_channel_new_socket
(
fd
);
client
->
channel
=
g_io_channel_new_socket
(
fd
);
...
@@ -143,7 +143,7 @@ deferred_buffer_free(gpointer data, G_GNUC_UNUSED gpointer user_data)
...
@@ -143,7 +143,7 @@ deferred_buffer_free(gpointer data, G_GNUC_UNUSED gpointer user_data)
}
}
void
void
client_close
(
struct
c
lient
*
client
)
client_close
(
C
lient
*
client
)
{
{
client_list_remove
(
client
);
client_list_remove
(
client
);
...
...
src/ClientProcess.cxx
View file @
7a982169
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
#define CLIENT_LIST_MODE_END "command_list_end"
#define CLIENT_LIST_MODE_END "command_list_end"
static
enum
command_return
static
enum
command_return
client_process_command_list
(
struct
c
lient
*
client
,
bool
list_ok
,
GSList
*
list
)
client_process_command_list
(
C
lient
*
client
,
bool
list_ok
,
GSList
*
list
)
{
{
enum
command_return
ret
=
COMMAND_RETURN_OK
;
enum
command_return
ret
=
COMMAND_RETURN_OK
;
unsigned
num
=
0
;
unsigned
num
=
0
;
...
@@ -51,7 +51,7 @@ client_process_command_list(struct client *client, bool list_ok, GSList *list)
...
@@ -51,7 +51,7 @@ client_process_command_list(struct client *client, bool list_ok, GSList *list)
}
}
enum
command_return
enum
command_return
client_process_line
(
struct
c
lient
*
client
,
char
*
line
)
client_process_line
(
C
lient
*
client
,
char
*
line
)
{
{
enum
command_return
ret
;
enum
command_return
ret
;
...
...
src/ClientRead.cxx
View file @
7a982169
...
@@ -28,7 +28,7 @@ extern "C" {
...
@@ -28,7 +28,7 @@ extern "C" {
#include <string.h>
#include <string.h>
static
char
*
static
char
*
client_read_line
(
struct
c
lient
*
client
)
client_read_line
(
C
lient
*
client
)
{
{
size_t
length
;
size_t
length
;
const
char
*
p
=
(
const
char
*
)
fifo_buffer_read
(
client
->
input
,
&
length
);
const
char
*
p
=
(
const
char
*
)
fifo_buffer_read
(
client
->
input
,
&
length
);
...
@@ -46,7 +46,7 @@ client_read_line(struct client *client)
...
@@ -46,7 +46,7 @@ client_read_line(struct client *client)
}
}
static
enum
command_return
static
enum
command_return
client_input_received
(
struct
c
lient
*
client
,
size_t
bytesRead
)
client_input_received
(
C
lient
*
client
,
size_t
bytesRead
)
{
{
char
*
line
;
char
*
line
;
...
@@ -69,7 +69,7 @@ client_input_received(struct client *client, size_t bytesRead)
...
@@ -69,7 +69,7 @@ client_input_received(struct client *client, size_t bytesRead)
}
}
enum
command_return
enum
command_return
client_read
(
struct
c
lient
*
client
)
client_read
(
C
lient
*
client
)
{
{
GError
*
error
=
NULL
;
GError
*
error
=
NULL
;
GIOStatus
status
;
GIOStatus
status
;
...
...
src/ClientSubscribe.cxx
View file @
7a982169
...
@@ -29,7 +29,7 @@ extern "C" {
...
@@ -29,7 +29,7 @@ extern "C" {
G_GNUC_PURE
G_GNUC_PURE
static
GSList
*
static
GSList
*
client_find_subscription
(
const
struct
c
lient
*
client
,
const
char
*
channel
)
client_find_subscription
(
const
C
lient
*
client
,
const
char
*
channel
)
{
{
for
(
GSList
*
i
=
client
->
subscriptions
;
i
!=
NULL
;
i
=
g_slist_next
(
i
))
for
(
GSList
*
i
=
client
->
subscriptions
;
i
!=
NULL
;
i
=
g_slist_next
(
i
))
if
(
strcmp
((
const
char
*
)
i
->
data
,
channel
)
==
0
)
if
(
strcmp
((
const
char
*
)
i
->
data
,
channel
)
==
0
)
...
@@ -39,7 +39,7 @@ client_find_subscription(const struct client *client, const char *channel)
...
@@ -39,7 +39,7 @@ client_find_subscription(const struct client *client, const char *channel)
}
}
enum
client_subscribe_result
enum
client_subscribe_result
client_subscribe
(
struct
c
lient
*
client
,
const
char
*
channel
)
client_subscribe
(
C
lient
*
client
,
const
char
*
channel
)
{
{
assert
(
client
!=
NULL
);
assert
(
client
!=
NULL
);
assert
(
channel
!=
NULL
);
assert
(
channel
!=
NULL
);
...
@@ -63,7 +63,7 @@ client_subscribe(struct client *client, const char *channel)
...
@@ -63,7 +63,7 @@ client_subscribe(struct client *client, const char *channel)
}
}
bool
bool
client_unsubscribe
(
struct
c
lient
*
client
,
const
char
*
channel
)
client_unsubscribe
(
C
lient
*
client
,
const
char
*
channel
)
{
{
GSList
*
i
=
client_find_subscription
(
client
,
channel
);
GSList
*
i
=
client_find_subscription
(
client
,
channel
);
if
(
i
==
NULL
)
if
(
i
==
NULL
)
...
@@ -83,7 +83,7 @@ client_unsubscribe(struct client *client, const char *channel)
...
@@ -83,7 +83,7 @@ client_unsubscribe(struct client *client, const char *channel)
}
}
void
void
client_unsubscribe_all
(
struct
c
lient
*
client
)
client_unsubscribe_all
(
C
lient
*
client
)
{
{
for
(
GSList
*
i
=
client
->
subscriptions
;
i
!=
NULL
;
i
=
g_slist_next
(
i
))
for
(
GSList
*
i
=
client
->
subscriptions
;
i
!=
NULL
;
i
=
g_slist_next
(
i
))
g_free
(
i
->
data
);
g_free
(
i
->
data
);
...
@@ -94,7 +94,7 @@ client_unsubscribe_all(struct client *client)
...
@@ -94,7 +94,7 @@ client_unsubscribe_all(struct client *client)
}
}
bool
bool
client_push_message
(
struct
c
lient
*
client
,
const
struct
client_message
*
msg
)
client_push_message
(
C
lient
*
client
,
const
struct
client_message
*
msg
)
{
{
assert
(
client
!=
NULL
);
assert
(
client
!=
NULL
);
assert
(
msg
!=
NULL
);
assert
(
msg
!=
NULL
);
...
@@ -115,7 +115,7 @@ client_push_message(struct client *client, const struct client_message *msg)
...
@@ -115,7 +115,7 @@ client_push_message(struct client *client, const struct client_message *msg)
}
}
GSList
*
GSList
*
client_read_messages
(
struct
c
lient
*
client
)
client_read_messages
(
C
lient
*
client
)
{
{
GSList
*
messages
=
g_slist_reverse
(
client
->
messages
);
GSList
*
messages
=
g_slist_reverse
(
client
->
messages
);
...
...
src/ClientSubscribe.hxx
View file @
7a982169
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
#include "gcc.h"
#include "gcc.h"
typedef
struct
_GSList
GSList
;
typedef
struct
_GSList
GSList
;
struct
c
lient
;
class
C
lient
;
struct
client_message
;
struct
client_message
;
enum
client_subscribe_result
{
enum
client_subscribe_result
{
...
@@ -41,19 +41,19 @@ enum client_subscribe_result {
...
@@ -41,19 +41,19 @@ enum client_subscribe_result {
};
};
enum
client_subscribe_result
enum
client_subscribe_result
client_subscribe
(
struct
c
lient
*
client
,
const
char
*
channel
);
client_subscribe
(
C
lient
*
client
,
const
char
*
channel
);
bool
bool
client_unsubscribe
(
struct
c
lient
*
client
,
const
char
*
channel
);
client_unsubscribe
(
C
lient
*
client
,
const
char
*
channel
);
void
void
client_unsubscribe_all
(
struct
c
lient
*
client
);
client_unsubscribe_all
(
C
lient
*
client
);
bool
bool
client_push_message
(
struct
c
lient
*
client
,
const
struct
client_message
*
msg
);
client_push_message
(
C
lient
*
client
,
const
struct
client_message
*
msg
);
gcc_malloc
gcc_malloc
GSList
*
GSList
*
client_read_messages
(
struct
c
lient
*
client
);
client_read_messages
(
C
lient
*
client
);
#endif
#endif
src/ClientWrite.cxx
View file @
7a982169
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <stdio.h>
static
size_t
static
size_t
client_write_deferred_buffer
(
struct
c
lient
*
client
,
client_write_deferred_buffer
(
C
lient
*
client
,
const
struct
deferred_buffer
*
buffer
)
const
struct
deferred_buffer
*
buffer
)
{
{
GError
*
error
=
NULL
;
GError
*
error
=
NULL
;
...
@@ -67,7 +67,7 @@ client_write_deferred_buffer(struct client *client,
...
@@ -67,7 +67,7 @@ client_write_deferred_buffer(struct client *client,
}
}
void
void
client_write_deferred
(
struct
c
lient
*
client
)
client_write_deferred
(
C
lient
*
client
)
{
{
size_t
ret
;
size_t
ret
;
...
@@ -109,8 +109,8 @@ client_write_deferred(struct client *client)
...
@@ -109,8 +109,8 @@ client_write_deferred(struct client *client)
}
}
}
}
static
void
client_defer_output
(
struct
client
*
client
,
static
void
const
void
*
data
,
size_t
length
)
client_defer_output
(
Client
*
client
,
const
void
*
data
,
size_t
length
)
{
{
size_t
alloc
;
size_t
alloc
;
struct
deferred_buffer
*
buf
;
struct
deferred_buffer
*
buf
;
...
@@ -137,8 +137,8 @@ static void client_defer_output(struct client *client,
...
@@ -137,8 +137,8 @@ static void client_defer_output(struct client *client,
g_queue_push_tail
(
client
->
deferred_send
,
buf
);
g_queue_push_tail
(
client
->
deferred_send
,
buf
);
}
}
static
void
client_write_direct
(
struct
client
*
client
,
static
void
const
char
*
data
,
size_t
length
)
client_write_direct
(
Client
*
client
,
const
char
*
data
,
size_t
length
)
{
{
GError
*
error
=
NULL
;
GError
*
error
=
NULL
;
GIOStatus
status
;
GIOStatus
status
;
...
@@ -182,7 +182,7 @@ static void client_write_direct(struct client *client,
...
@@ -182,7 +182,7 @@ static void client_write_direct(struct client *client,
}
}
void
void
client_write_output
(
struct
c
lient
*
client
)
client_write_output
(
C
lient
*
client
)
{
{
if
(
client_is_expired
(
client
)
||
!
client
->
send_buf_used
)
if
(
client_is_expired
(
client
)
||
!
client
->
send_buf_used
)
return
;
return
;
...
@@ -212,7 +212,8 @@ client_write_output(struct client *client)
...
@@ -212,7 +212,8 @@ client_write_output(struct client *client)
/**
/**
* Write a block of data to the client.
* Write a block of data to the client.
*/
*/
static
void
client_write
(
struct
client
*
client
,
const
char
*
buffer
,
size_t
buflen
)
static
void
client_write
(
Client
*
client
,
const
char
*
buffer
,
size_t
buflen
)
{
{
/* if the client is going to be closed, do nothing */
/* if the client is going to be closed, do nothing */
if
(
client_is_expired
(
client
))
if
(
client_is_expired
(
client
))
...
@@ -237,12 +238,14 @@ static void client_write(struct client *client, const char *buffer, size_t bufle
...
@@ -237,12 +238,14 @@ static void client_write(struct client *client, const char *buffer, size_t bufle
}
}
}
}
void
client_puts
(
struct
client
*
client
,
const
char
*
s
)
void
client_puts
(
Client
*
client
,
const
char
*
s
)
{
{
client_write
(
client
,
s
,
strlen
(
s
));
client_write
(
client
,
s
,
strlen
(
s
));
}
}
void
client_vprintf
(
struct
client
*
client
,
const
char
*
fmt
,
va_list
args
)
void
client_vprintf
(
Client
*
client
,
const
char
*
fmt
,
va_list
args
)
{
{
#ifndef G_OS_WIN32
#ifndef G_OS_WIN32
va_list
tmp
;
va_list
tmp
;
...
@@ -274,7 +277,9 @@ void client_vprintf(struct client *client, const char *fmt, va_list args)
...
@@ -274,7 +277,9 @@ void client_vprintf(struct client *client, const char *fmt, va_list args)
#endif
#endif
}
}
G_GNUC_PRINTF
(
2
,
3
)
void
client_printf
(
struct
client
*
client
,
const
char
*
fmt
,
...)
G_GNUC_PRINTF
(
2
,
3
)
void
client_printf
(
Client
*
client
,
const
char
*
fmt
,
...)
{
{
va_list
args
;
va_list
args
;
...
...
src/CommandError.cxx
View file @
7a982169
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
#include <errno.h>
#include <errno.h>
enum
command_return
enum
command_return
print_playlist_result
(
struct
c
lient
*
client
,
enum
playlist_result
result
)
print_playlist_result
(
C
lient
*
client
,
enum
playlist_result
result
)
{
{
switch
(
result
)
{
switch
(
result
)
{
case
PLAYLIST_RESULT_SUCCESS
:
case
PLAYLIST_RESULT_SUCCESS
:
...
@@ -89,7 +89,7 @@ print_playlist_result(struct client *client, enum playlist_result result)
...
@@ -89,7 +89,7 @@ print_playlist_result(struct client *client, enum playlist_result result)
* Send the GError to the client and free the GError.
* Send the GError to the client and free the GError.
*/
*/
enum
command_return
enum
command_return
print_error
(
struct
c
lient
*
client
,
GError
*
error
)
print_error
(
C
lient
*
client
,
GError
*
error
)
{
{
assert
(
client
!=
NULL
);
assert
(
client
!=
NULL
);
assert
(
error
!=
NULL
);
assert
(
error
!=
NULL
);
...
...
src/CommandError.hxx
View file @
7a982169
...
@@ -25,13 +25,15 @@
...
@@ -25,13 +25,15 @@
#include <glib.h>
#include <glib.h>
class
Client
;
enum
command_return
enum
command_return
print_playlist_result
(
struct
c
lient
*
client
,
enum
playlist_result
result
);
print_playlist_result
(
C
lient
*
client
,
enum
playlist_result
result
);
/**
/**
* Send the GError to the client and free the GError.
* Send the GError to the client and free the GError.
*/
*/
enum
command_return
enum
command_return
print_error
(
struct
c
lient
*
client
,
GError
*
error
);
print_error
(
C
lient
*
client
,
GError
*
error
);
#endif
#endif
src/DatabaseCommands.cxx
View file @
7a982169
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
#include <string.h>
#include <string.h>
enum
command_return
enum
command_return
handle_lsinfo2
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[])
handle_lsinfo2
(
C
lient
*
client
,
int
argc
,
char
*
argv
[])
{
{
const
char
*
uri
;
const
char
*
uri
;
...
@@ -54,7 +54,7 @@ handle_lsinfo2(struct client *client, int argc, char *argv[])
...
@@ -54,7 +54,7 @@ handle_lsinfo2(struct client *client, int argc, char *argv[])
}
}
static
enum
command_return
static
enum
command_return
handle_match
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[],
bool
fold_case
)
handle_match
(
C
lient
*
client
,
int
argc
,
char
*
argv
[],
bool
fold_case
)
{
{
SongFilter
filter
;
SongFilter
filter
;
if
(
!
filter
.
Parse
(
argc
-
1
,
argv
+
1
,
fold_case
))
{
if
(
!
filter
.
Parse
(
argc
-
1
,
argv
+
1
,
fold_case
))
{
...
@@ -71,19 +71,19 @@ handle_match(struct client *client, int argc, char *argv[], bool fold_case)
...
@@ -71,19 +71,19 @@ handle_match(struct client *client, int argc, char *argv[], bool fold_case)
}
}
enum
command_return
enum
command_return
handle_find
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[])
handle_find
(
C
lient
*
client
,
int
argc
,
char
*
argv
[])
{
{
return
handle_match
(
client
,
argc
,
argv
,
false
);
return
handle_match
(
client
,
argc
,
argv
,
false
);
}
}
enum
command_return
enum
command_return
handle_search
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[])
handle_search
(
C
lient
*
client
,
int
argc
,
char
*
argv
[])
{
{
return
handle_match
(
client
,
argc
,
argv
,
true
);
return
handle_match
(
client
,
argc
,
argv
,
true
);
}
}
static
enum
command_return
static
enum
command_return
handle_match_add
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[],
bool
fold_case
)
handle_match_add
(
C
lient
*
client
,
int
argc
,
char
*
argv
[],
bool
fold_case
)
{
{
SongFilter
filter
;
SongFilter
filter
;
if
(
!
filter
.
Parse
(
argc
-
1
,
argv
+
1
,
fold_case
))
{
if
(
!
filter
.
Parse
(
argc
-
1
,
argv
+
1
,
fold_case
))
{
...
@@ -98,19 +98,19 @@ handle_match_add(struct client *client, int argc, char *argv[], bool fold_case)
...
@@ -98,19 +98,19 @@ handle_match_add(struct client *client, int argc, char *argv[], bool fold_case)
}
}
enum
command_return
enum
command_return
handle_findadd
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[])
handle_findadd
(
C
lient
*
client
,
int
argc
,
char
*
argv
[])
{
{
return
handle_match_add
(
client
,
argc
,
argv
,
false
);
return
handle_match_add
(
client
,
argc
,
argv
,
false
);
}
}
enum
command_return
enum
command_return
handle_searchadd
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[])
handle_searchadd
(
C
lient
*
client
,
int
argc
,
char
*
argv
[])
{
{
return
handle_match_add
(
client
,
argc
,
argv
,
true
);
return
handle_match_add
(
client
,
argc
,
argv
,
true
);
}
}
enum
command_return
enum
command_return
handle_searchaddpl
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[])
handle_searchaddpl
(
C
lient
*
client
,
int
argc
,
char
*
argv
[])
{
{
const
char
*
playlist
=
argv
[
1
];
const
char
*
playlist
=
argv
[
1
];
...
@@ -127,7 +127,7 @@ handle_searchaddpl(struct client *client, int argc, char *argv[])
...
@@ -127,7 +127,7 @@ handle_searchaddpl(struct client *client, int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_count
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[])
handle_count
(
C
lient
*
client
,
int
argc
,
char
*
argv
[])
{
{
SongFilter
filter
;
SongFilter
filter
;
if
(
!
filter
.
Parse
(
argc
-
1
,
argv
+
1
,
false
))
{
if
(
!
filter
.
Parse
(
argc
-
1
,
argv
+
1
,
false
))
{
...
@@ -142,7 +142,7 @@ handle_count(struct client *client, int argc, char *argv[])
...
@@ -142,7 +142,7 @@ handle_count(struct client *client, int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_listall
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_listall
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
const
char
*
directory
=
""
;
const
char
*
directory
=
""
;
...
@@ -156,7 +156,7 @@ handle_listall(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
...
@@ -156,7 +156,7 @@ handle_listall(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_list
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[])
handle_list
(
C
lient
*
client
,
int
argc
,
char
*
argv
[])
{
{
unsigned
tagType
=
locate_parse_type
(
argv
[
1
]);
unsigned
tagType
=
locate_parse_type
(
argv
[
1
]);
...
@@ -205,7 +205,7 @@ handle_list(struct client *client, int argc, char *argv[])
...
@@ -205,7 +205,7 @@ handle_list(struct client *client, int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_listallinfo
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_listallinfo
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
const
char
*
directory
=
""
;
const
char
*
directory
=
""
;
...
...
src/DatabaseCommands.hxx
View file @
7a982169
...
@@ -22,34 +22,36 @@
...
@@ -22,34 +22,36 @@
#include "command.h"
#include "command.h"
class
Client
;
enum
command_return
enum
command_return
handle_lsinfo2
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_lsinfo2
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_find
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_find
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_findadd
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_findadd
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_search
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_search
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_searchadd
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_searchadd
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_searchaddpl
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_searchaddpl
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_count
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_count
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_listall
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_listall
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_list
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_list
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_listallinfo
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_listallinfo
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
#endif
#endif
src/DatabasePrint.cxx
View file @
7a982169
...
@@ -38,7 +38,7 @@ extern "C" {
...
@@ -38,7 +38,7 @@ extern "C" {
#include <functional>
#include <functional>
static
bool
static
bool
PrintDirectory
(
struct
c
lient
*
client
,
const
Directory
&
directory
)
PrintDirectory
(
C
lient
*
client
,
const
Directory
&
directory
)
{
{
if
(
!
directory
.
IsRoot
())
if
(
!
directory
.
IsRoot
())
client_printf
(
client
,
"directory: %s
\n
"
,
directory
.
GetPath
());
client_printf
(
client
,
"directory: %s
\n
"
,
directory
.
GetPath
());
...
@@ -47,7 +47,7 @@ PrintDirectory(struct client *client, const Directory &directory)
...
@@ -47,7 +47,7 @@ PrintDirectory(struct client *client, const Directory &directory)
}
}
static
void
static
void
print_playlist_in_directory
(
struct
c
lient
*
client
,
print_playlist_in_directory
(
C
lient
*
client
,
const
Directory
&
directory
,
const
Directory
&
directory
,
const
char
*
name_utf8
)
const
char
*
name_utf8
)
{
{
...
@@ -59,7 +59,7 @@ print_playlist_in_directory(struct client *client,
...
@@ -59,7 +59,7 @@ print_playlist_in_directory(struct client *client,
}
}
static
bool
static
bool
PrintSongBrief
(
struct
c
lient
*
client
,
song
&
song
)
PrintSongBrief
(
C
lient
*
client
,
song
&
song
)
{
{
assert
(
song
.
parent
!=
NULL
);
assert
(
song
.
parent
!=
NULL
);
...
@@ -73,7 +73,7 @@ PrintSongBrief(struct client *client, song &song)
...
@@ -73,7 +73,7 @@ PrintSongBrief(struct client *client, song &song)
}
}
static
bool
static
bool
PrintSongFull
(
struct
c
lient
*
client
,
song
&
song
)
PrintSongFull
(
C
lient
*
client
,
song
&
song
)
{
{
assert
(
song
.
parent
!=
NULL
);
assert
(
song
.
parent
!=
NULL
);
...
@@ -87,7 +87,7 @@ PrintSongFull(struct client *client, song &song)
...
@@ -87,7 +87,7 @@ PrintSongFull(struct client *client, song &song)
}
}
static
bool
static
bool
PrintPlaylistBrief
(
struct
c
lient
*
client
,
PrintPlaylistBrief
(
C
lient
*
client
,
const
PlaylistInfo
&
playlist
,
const
PlaylistInfo
&
playlist
,
const
Directory
&
directory
)
const
Directory
&
directory
)
{
{
...
@@ -96,7 +96,7 @@ PrintPlaylistBrief(struct client *client,
...
@@ -96,7 +96,7 @@ PrintPlaylistBrief(struct client *client,
}
}
static
bool
static
bool
PrintPlaylistFull
(
struct
c
lient
*
client
,
PrintPlaylistFull
(
C
lient
*
client
,
const
PlaylistInfo
&
playlist
,
const
PlaylistInfo
&
playlist
,
const
Directory
&
directory
)
const
Directory
&
directory
)
{
{
...
@@ -109,7 +109,7 @@ PrintPlaylistFull(struct client *client,
...
@@ -109,7 +109,7 @@ PrintPlaylistFull(struct client *client,
}
}
bool
bool
db_selection_print
(
struct
c
lient
*
client
,
const
DatabaseSelection
&
selection
,
db_selection_print
(
C
lient
*
client
,
const
DatabaseSelection
&
selection
,
bool
full
,
GError
**
error_r
)
bool
full
,
GError
**
error_r
)
{
{
const
Database
*
db
=
GetDatabase
(
error_r
);
const
Database
*
db
=
GetDatabase
(
error_r
);
...
@@ -135,7 +135,7 @@ struct SearchStats {
...
@@ -135,7 +135,7 @@ struct SearchStats {
unsigned
long
playTime
;
unsigned
long
playTime
;
};
};
static
void
printSearchStats
(
struct
c
lient
*
client
,
SearchStats
*
stats
)
static
void
printSearchStats
(
C
lient
*
client
,
SearchStats
*
stats
)
{
{
client_printf
(
client
,
"songs: %i
\n
"
,
stats
->
numberOfSongs
);
client_printf
(
client
,
"songs: %i
\n
"
,
stats
->
numberOfSongs
);
client_printf
(
client
,
"playtime: %li
\n
"
,
stats
->
playTime
);
client_printf
(
client
,
"playtime: %li
\n
"
,
stats
->
playTime
);
...
@@ -151,7 +151,7 @@ stats_visitor_song(SearchStats &stats, song &song)
...
@@ -151,7 +151,7 @@ stats_visitor_song(SearchStats &stats, song &song)
}
}
bool
bool
searchStatsForSongsIn
(
struct
c
lient
*
client
,
const
char
*
name
,
searchStatsForSongsIn
(
C
lient
*
client
,
const
char
*
name
,
const
SongFilter
*
filter
,
const
SongFilter
*
filter
,
GError
**
error_r
)
GError
**
error_r
)
{
{
...
@@ -176,14 +176,14 @@ searchStatsForSongsIn(struct client *client, const char *name,
...
@@ -176,14 +176,14 @@ searchStatsForSongsIn(struct client *client, const char *name,
}
}
bool
bool
printAllIn
(
struct
c
lient
*
client
,
const
char
*
uri_utf8
,
GError
**
error_r
)
printAllIn
(
C
lient
*
client
,
const
char
*
uri_utf8
,
GError
**
error_r
)
{
{
const
DatabaseSelection
selection
(
uri_utf8
,
true
);
const
DatabaseSelection
selection
(
uri_utf8
,
true
);
return
db_selection_print
(
client
,
selection
,
false
,
error_r
);
return
db_selection_print
(
client
,
selection
,
false
,
error_r
);
}
}
bool
bool
printInfoForAllIn
(
struct
c
lient
*
client
,
const
char
*
uri_utf8
,
printInfoForAllIn
(
C
lient
*
client
,
const
char
*
uri_utf8
,
GError
**
error_r
)
GError
**
error_r
)
{
{
const
DatabaseSelection
selection
(
uri_utf8
,
true
);
const
DatabaseSelection
selection
(
uri_utf8
,
true
);
...
@@ -191,7 +191,7 @@ printInfoForAllIn(struct client *client, const char *uri_utf8,
...
@@ -191,7 +191,7 @@ printInfoForAllIn(struct client *client, const char *uri_utf8,
}
}
static
bool
static
bool
PrintSongURIVisitor
(
struct
c
lient
*
client
,
song
&
song
)
PrintSongURIVisitor
(
C
lient
*
client
,
song
&
song
)
{
{
song_print_uri
(
client
,
&
song
);
song_print_uri
(
client
,
&
song
);
...
@@ -199,7 +199,7 @@ PrintSongURIVisitor(struct client *client, song &song)
...
@@ -199,7 +199,7 @@ PrintSongURIVisitor(struct client *client, song &song)
}
}
static
bool
static
bool
PrintUniqueTag
(
struct
c
lient
*
client
,
enum
tag_type
tag_type
,
PrintUniqueTag
(
C
lient
*
client
,
enum
tag_type
tag_type
,
const
char
*
value
)
const
char
*
value
)
{
{
client_printf
(
client
,
"%s: %s
\n
"
,
tag_item_names
[
tag_type
],
value
);
client_printf
(
client
,
"%s: %s
\n
"
,
tag_item_names
[
tag_type
],
value
);
...
@@ -207,7 +207,7 @@ PrintUniqueTag(struct client *client, enum tag_type tag_type,
...
@@ -207,7 +207,7 @@ PrintUniqueTag(struct client *client, enum tag_type tag_type,
}
}
bool
bool
listAllUniqueTags
(
struct
c
lient
*
client
,
int
type
,
listAllUniqueTags
(
C
lient
*
client
,
int
type
,
const
SongFilter
*
filter
,
const
SongFilter
*
filter
,
GError
**
error_r
)
GError
**
error_r
)
{
{
...
...
src/DatabasePrint.hxx
View file @
7a982169
...
@@ -23,34 +23,34 @@
...
@@ -23,34 +23,34 @@
#include "gcc.h"
#include "gcc.h"
#include "gerror.h"
#include "gerror.h"
struct
client
;
class
SongFilter
;
class
SongFilter
;
struct
DatabaseSelection
;
struct
DatabaseSelection
;
struct
db_visitor
;
struct
db_visitor
;
class
Client
;
gcc_nonnull
(
1
)
gcc_nonnull
(
1
)
bool
bool
db_selection_print
(
struct
c
lient
*
client
,
const
DatabaseSelection
&
selection
,
db_selection_print
(
C
lient
*
client
,
const
DatabaseSelection
&
selection
,
bool
full
,
GError
**
error_r
);
bool
full
,
GError
**
error_r
);
gcc_nonnull
(
1
,
2
)
gcc_nonnull
(
1
,
2
)
bool
bool
printAllIn
(
struct
c
lient
*
client
,
const
char
*
uri_utf8
,
GError
**
error_r
);
printAllIn
(
C
lient
*
client
,
const
char
*
uri_utf8
,
GError
**
error_r
);
gcc_nonnull
(
1
,
2
)
gcc_nonnull
(
1
,
2
)
bool
bool
printInfoForAllIn
(
struct
c
lient
*
client
,
const
char
*
uri_utf8
,
printInfoForAllIn
(
C
lient
*
client
,
const
char
*
uri_utf8
,
GError
**
error_r
);
GError
**
error_r
);
gcc_nonnull
(
1
,
2
)
gcc_nonnull
(
1
,
2
)
bool
bool
searchStatsForSongsIn
(
struct
c
lient
*
client
,
const
char
*
name
,
searchStatsForSongsIn
(
C
lient
*
client
,
const
char
*
name
,
const
SongFilter
*
filter
,
const
SongFilter
*
filter
,
GError
**
error_r
);
GError
**
error_r
);
gcc_nonnull
(
1
)
gcc_nonnull
(
1
)
bool
bool
listAllUniqueTags
(
struct
c
lient
*
client
,
int
type
,
listAllUniqueTags
(
C
lient
*
client
,
int
type
,
const
SongFilter
*
filter
,
const
SongFilter
*
filter
,
GError
**
error_r
);
GError
**
error_r
);
...
...
src/DecoderPrint.cxx
View file @
7a982169
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
#include <assert.h>
#include <assert.h>
static
void
static
void
decoder_plugin_print
(
struct
c
lient
*
client
,
decoder_plugin_print
(
C
lient
*
client
,
const
struct
decoder_plugin
*
plugin
)
const
struct
decoder_plugin
*
plugin
)
{
{
const
char
*
const
*
p
;
const
char
*
const
*
p
;
...
@@ -46,7 +46,7 @@ decoder_plugin_print(struct client *client,
...
@@ -46,7 +46,7 @@ decoder_plugin_print(struct client *client,
}
}
void
void
decoder_list_print
(
struct
c
lient
*
client
)
decoder_list_print
(
C
lient
*
client
)
{
{
decoder_plugins_for_each_enabled
(
plugin
)
decoder_plugins_for_each_enabled
(
plugin
)
decoder_plugin_print
(
client
,
plugin
);
decoder_plugin_print
(
client
,
plugin
);
...
...
src/DecoderPrint.hxx
View file @
7a982169
...
@@ -20,9 +20,9 @@
...
@@ -20,9 +20,9 @@
#ifndef MPD_DECODER_PRINT_HXX
#ifndef MPD_DECODER_PRINT_HXX
#define MPD_DECODER_PRINT_HXX
#define MPD_DECODER_PRINT_HXX
struct
c
lient
;
class
C
lient
;
void
void
decoder_list_print
(
struct
c
lient
*
client
);
decoder_list_print
(
C
lient
*
client
);
#endif
#endif
src/MessageCommands.cxx
View file @
7a982169
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
#include <assert.h>
#include <assert.h>
enum
command_return
enum
command_return
handle_subscribe
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_subscribe
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
assert
(
argc
==
2
);
assert
(
argc
==
2
);
...
@@ -59,7 +59,7 @@ handle_subscribe(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
...
@@ -59,7 +59,7 @@ handle_subscribe(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_unsubscribe
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_unsubscribe
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
assert
(
argc
==
2
);
assert
(
argc
==
2
);
...
@@ -81,7 +81,7 @@ collect_channels(gpointer data, gpointer user_data)
...
@@ -81,7 +81,7 @@ collect_channels(gpointer data, gpointer user_data)
{
{
struct
channels_context
*
context
=
struct
channels_context
*
context
=
(
struct
channels_context
*
)
user_data
;
(
struct
channels_context
*
)
user_data
;
const
struct
client
*
client
=
(
const
struct
c
lient
*
)
data
;
const
Client
*
client
=
(
const
C
lient
*
)
data
;
for
(
GSList
*
i
=
client
->
subscriptions
;
i
!=
NULL
;
for
(
GSList
*
i
=
client
->
subscriptions
;
i
!=
NULL
;
i
=
g_slist_next
(
i
))
{
i
=
g_slist_next
(
i
))
{
...
@@ -92,7 +92,7 @@ collect_channels(gpointer data, gpointer user_data)
...
@@ -92,7 +92,7 @@ collect_channels(gpointer data, gpointer user_data)
}
}
enum
command_return
enum
command_return
handle_channels
(
struct
c
lient
*
client
,
handle_channels
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
{
{
assert
(
argc
==
1
);
assert
(
argc
==
1
);
...
@@ -108,7 +108,7 @@ handle_channels(struct client *client,
...
@@ -108,7 +108,7 @@ handle_channels(struct client *client,
}
}
enum
command_return
enum
command_return
handle_read_messages
(
struct
c
lient
*
client
,
handle_read_messages
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
{
{
assert
(
argc
==
1
);
assert
(
argc
==
1
);
...
@@ -139,14 +139,14 @@ send_message(gpointer data, gpointer user_data)
...
@@ -139,14 +139,14 @@ send_message(gpointer data, gpointer user_data)
{
{
struct
send_message_context
*
context
=
struct
send_message_context
*
context
=
(
struct
send_message_context
*
)
user_data
;
(
struct
send_message_context
*
)
user_data
;
struct
client
*
client
=
(
struct
c
lient
*
)
data
;
Client
*
client
=
(
C
lient
*
)
data
;
if
(
client_push_message
(
client
,
&
context
->
msg
))
if
(
client_push_message
(
client
,
&
context
->
msg
))
context
->
sent
=
true
;
context
->
sent
=
true
;
}
}
enum
command_return
enum
command_return
handle_send_message
(
struct
c
lient
*
client
,
handle_send_message
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
{
{
assert
(
argc
==
3
);
assert
(
argc
==
3
);
...
...
src/MessageCommands.hxx
View file @
7a982169
...
@@ -22,19 +22,21 @@
...
@@ -22,19 +22,21 @@
#include "command.h"
#include "command.h"
class
Client
;
enum
command_return
enum
command_return
handle_subscribe
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_subscribe
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_unsubscribe
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_unsubscribe
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_channels
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_channels
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_read_messages
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_read_messages
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_send_message
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_send_message
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
#endif
#endif
src/OtherCommands.cxx
View file @
7a982169
...
@@ -57,7 +57,7 @@ extern "C" {
...
@@ -57,7 +57,7 @@ extern "C" {
#include <string.h>
#include <string.h>
static
void
static
void
print_spl_list
(
struct
c
lient
*
client
,
const
PlaylistFileList
&
list
)
print_spl_list
(
C
lient
*
client
,
const
PlaylistFileList
&
list
)
{
{
for
(
const
auto
&
i
:
list
)
{
for
(
const
auto
&
i
:
list
)
{
client_printf
(
client
,
"playlist: %s
\n
"
,
i
.
name
.
c_str
());
client_printf
(
client
,
"playlist: %s
\n
"
,
i
.
name
.
c_str
());
...
@@ -68,7 +68,7 @@ print_spl_list(struct client *client, const PlaylistFileList &list)
...
@@ -68,7 +68,7 @@ print_spl_list(struct client *client, const PlaylistFileList &list)
}
}
enum
command_return
enum
command_return
handle_urlhandlers
(
struct
c
lient
*
client
,
handle_urlhandlers
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
{
{
if
(
client_is_local
(
client
))
if
(
client_is_local
(
client
))
...
@@ -78,7 +78,7 @@ handle_urlhandlers(struct client *client,
...
@@ -78,7 +78,7 @@ handle_urlhandlers(struct client *client,
}
}
enum
command_return
enum
command_return
handle_decoders
(
struct
c
lient
*
client
,
handle_decoders
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
{
{
decoder_list_print
(
client
);
decoder_list_print
(
client
);
...
@@ -86,7 +86,7 @@ handle_decoders(struct client *client,
...
@@ -86,7 +86,7 @@ handle_decoders(struct client *client,
}
}
enum
command_return
enum
command_return
handle_tagtypes
(
struct
c
lient
*
client
,
handle_tagtypes
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
{
{
tag_print_types
(
client
);
tag_print_types
(
client
);
...
@@ -94,21 +94,21 @@ handle_tagtypes(struct client *client,
...
@@ -94,21 +94,21 @@ handle_tagtypes(struct client *client,
}
}
enum
command_return
enum
command_return
handle_kill
(
G_GNUC_UNUSED
struct
c
lient
*
client
,
handle_kill
(
G_GNUC_UNUSED
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
{
{
return
COMMAND_RETURN_KILL
;
return
COMMAND_RETURN_KILL
;
}
}
enum
command_return
enum
command_return
handle_close
(
G_GNUC_UNUSED
struct
c
lient
*
client
,
handle_close
(
G_GNUC_UNUSED
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
{
{
return
COMMAND_RETURN_CLOSE
;
return
COMMAND_RETURN_CLOSE
;
}
}
enum
command_return
enum
command_return
handle_lsinfo
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[])
handle_lsinfo
(
C
lient
*
client
,
int
argc
,
char
*
argv
[])
{
{
const
char
*
uri
;
const
char
*
uri
;
...
@@ -151,7 +151,7 @@ handle_lsinfo(struct client *client, int argc, char *argv[])
...
@@ -151,7 +151,7 @@ handle_lsinfo(struct client *client, int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_update
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_update
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
const
char
*
path
=
NULL
;
const
char
*
path
=
NULL
;
unsigned
ret
;
unsigned
ret
;
...
@@ -182,7 +182,7 @@ handle_update(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
...
@@ -182,7 +182,7 @@ handle_update(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_rescan
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_rescan
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
const
char
*
path
=
NULL
;
const
char
*
path
=
NULL
;
unsigned
ret
;
unsigned
ret
;
...
@@ -210,7 +210,7 @@ handle_rescan(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
...
@@ -210,7 +210,7 @@ handle_rescan(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_setvol
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_setvol
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
unsigned
level
;
unsigned
level
;
bool
success
;
bool
success
;
...
@@ -234,7 +234,7 @@ handle_setvol(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
...
@@ -234,7 +234,7 @@ handle_setvol(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_stats
(
struct
c
lient
*
client
,
handle_stats
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
{
{
stats_print
(
client
);
stats_print
(
client
);
...
@@ -242,14 +242,14 @@ handle_stats(struct client *client,
...
@@ -242,14 +242,14 @@ handle_stats(struct client *client,
}
}
enum
command_return
enum
command_return
handle_ping
(
G_GNUC_UNUSED
struct
c
lient
*
client
,
handle_ping
(
G_GNUC_UNUSED
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
{
{
return
COMMAND_RETURN_OK
;
return
COMMAND_RETURN_OK
;
}
}
enum
command_return
enum
command_return
handle_password
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_password
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
unsigned
permission
=
0
;
unsigned
permission
=
0
;
...
@@ -264,7 +264,7 @@ handle_password(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
...
@@ -264,7 +264,7 @@ handle_password(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_config
(
struct
c
lient
*
client
,
handle_config
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
{
{
if
(
!
client_is_local
(
client
))
{
if
(
!
client_is_local
(
client
))
{
...
@@ -281,7 +281,7 @@ handle_config(struct client *client,
...
@@ -281,7 +281,7 @@ handle_config(struct client *client,
}
}
enum
command_return
enum
command_return
handle_idle
(
struct
c
lient
*
client
,
handle_idle
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
{
{
unsigned
flags
=
0
,
j
;
unsigned
flags
=
0
,
j
;
...
...
src/OtherCommands.hxx
View file @
7a982169
...
@@ -22,46 +22,48 @@
...
@@ -22,46 +22,48 @@
#include "command.h"
#include "command.h"
class
Client
;
enum
command_return
enum
command_return
handle_urlhandlers
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_urlhandlers
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_decoders
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_decoders
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_tagtypes
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_tagtypes
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_kill
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_kill
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_close
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_close
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_lsinfo
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_lsinfo
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_update
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_update
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_rescan
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_rescan
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_setvol
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_setvol
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_stats
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_stats
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_ping
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_ping
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_password
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_password
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_config
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_config
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_idle
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_idle
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
#endif
#endif
src/OutputCommands.cxx
View file @
7a982169
...
@@ -30,7 +30,7 @@ extern "C" {
...
@@ -30,7 +30,7 @@ extern "C" {
#include <string.h>
#include <string.h>
enum
command_return
enum
command_return
handle_enableoutput
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_enableoutput
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
unsigned
device
;
unsigned
device
;
bool
ret
;
bool
ret
;
...
@@ -49,7 +49,7 @@ handle_enableoutput(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
...
@@ -49,7 +49,7 @@ handle_enableoutput(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_disableoutput
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_disableoutput
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
unsigned
device
;
unsigned
device
;
bool
ret
;
bool
ret
;
...
@@ -68,7 +68,7 @@ handle_disableoutput(struct client *client, G_GNUC_UNUSED int argc, char *argv[]
...
@@ -68,7 +68,7 @@ handle_disableoutput(struct client *client, G_GNUC_UNUSED int argc, char *argv[]
}
}
enum
command_return
enum
command_return
handle_devices
(
struct
c
lient
*
client
,
handle_devices
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
{
{
printAudioDevices
(
client
);
printAudioDevices
(
client
);
...
...
src/OutputCommands.hxx
View file @
7a982169
...
@@ -22,13 +22,15 @@
...
@@ -22,13 +22,15 @@
#include "command.h"
#include "command.h"
class
Client
;
enum
command_return
enum
command_return
handle_enableoutput
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_enableoutput
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_disableoutput
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_disableoutput
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_devices
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_devices
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
#endif
#endif
src/OutputPrint.cxx
View file @
7a982169
...
@@ -32,7 +32,7 @@ extern "C" {
...
@@ -32,7 +32,7 @@ extern "C" {
}
}
void
void
printAudioDevices
(
struct
c
lient
*
client
)
printAudioDevices
(
C
lient
*
client
)
{
{
const
unsigned
n
=
audio_output_count
();
const
unsigned
n
=
audio_output_count
();
...
...
src/OutputPrint.hxx
View file @
7a982169
...
@@ -25,9 +25,9 @@
...
@@ -25,9 +25,9 @@
#ifndef MPD_OUTPUT_PRINT_HXX
#ifndef MPD_OUTPUT_PRINT_HXX
#define MPD_OUTPUT_PRINT_HXX
#define MPD_OUTPUT_PRINT_HXX
struct
c
lient
;
class
C
lient
;
void
void
printAudioDevices
(
struct
c
lient
*
client
);
printAudioDevices
(
C
lient
*
client
);
#endif
#endif
src/PlayerCommands.cxx
View file @
7a982169
...
@@ -56,7 +56,7 @@ extern "C" {
...
@@ -56,7 +56,7 @@ extern "C" {
#define COMMAND_STATUS_UPDATING_DB "updating_db"
#define COMMAND_STATUS_UPDATING_DB "updating_db"
enum
command_return
enum
command_return
handle_play
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[])
handle_play
(
C
lient
*
client
,
int
argc
,
char
*
argv
[])
{
{
int
song
=
-
1
;
int
song
=
-
1
;
enum
playlist_result
result
;
enum
playlist_result
result
;
...
@@ -68,7 +68,7 @@ handle_play(struct client *client, int argc, char *argv[])
...
@@ -68,7 +68,7 @@ handle_play(struct client *client, int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_playid
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[])
handle_playid
(
C
lient
*
client
,
int
argc
,
char
*
argv
[])
{
{
int
id
=
-
1
;
int
id
=
-
1
;
enum
playlist_result
result
;
enum
playlist_result
result
;
...
@@ -81,7 +81,7 @@ handle_playid(struct client *client, int argc, char *argv[])
...
@@ -81,7 +81,7 @@ handle_playid(struct client *client, int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_stop
(
G_GNUC_UNUSED
struct
c
lient
*
client
,
handle_stop
(
G_GNUC_UNUSED
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
{
{
playlist_stop
(
&
g_playlist
,
client
->
player_control
);
playlist_stop
(
&
g_playlist
,
client
->
player_control
);
...
@@ -89,7 +89,7 @@ handle_stop(G_GNUC_UNUSED struct client *client,
...
@@ -89,7 +89,7 @@ handle_stop(G_GNUC_UNUSED struct client *client,
}
}
enum
command_return
enum
command_return
handle_currentsong
(
struct
c
lient
*
client
,
handle_currentsong
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
{
{
playlist_print_current
(
client
,
&
g_playlist
);
playlist_print_current
(
client
,
&
g_playlist
);
...
@@ -97,7 +97,7 @@ handle_currentsong(struct client *client,
...
@@ -97,7 +97,7 @@ handle_currentsong(struct client *client,
}
}
enum
command_return
enum
command_return
handle_pause
(
struct
c
lient
*
client
,
handle_pause
(
C
lient
*
client
,
int
argc
,
char
*
argv
[])
int
argc
,
char
*
argv
[])
{
{
if
(
argc
==
2
)
{
if
(
argc
==
2
)
{
...
@@ -113,7 +113,7 @@ handle_pause(struct client *client,
...
@@ -113,7 +113,7 @@ handle_pause(struct client *client,
}
}
enum
command_return
enum
command_return
handle_status
(
struct
c
lient
*
client
,
handle_status
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
{
{
const
char
*
state
=
NULL
;
const
char
*
state
=
NULL
;
...
@@ -210,7 +210,7 @@ handle_status(struct client *client,
...
@@ -210,7 +210,7 @@ handle_status(struct client *client,
}
}
enum
command_return
enum
command_return
handle_next
(
G_GNUC_UNUSED
struct
c
lient
*
client
,
handle_next
(
G_GNUC_UNUSED
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
{
{
/* single mode is not considered when this is user who
/* single mode is not considered when this is user who
...
@@ -225,7 +225,7 @@ handle_next(G_GNUC_UNUSED struct client *client,
...
@@ -225,7 +225,7 @@ handle_next(G_GNUC_UNUSED struct client *client,
}
}
enum
command_return
enum
command_return
handle_previous
(
G_GNUC_UNUSED
struct
c
lient
*
client
,
handle_previous
(
G_GNUC_UNUSED
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
{
{
playlist_previous
(
&
g_playlist
,
client
->
player_control
);
playlist_previous
(
&
g_playlist
,
client
->
player_control
);
...
@@ -233,7 +233,7 @@ handle_previous(G_GNUC_UNUSED struct client *client,
...
@@ -233,7 +233,7 @@ handle_previous(G_GNUC_UNUSED struct client *client,
}
}
enum
command_return
enum
command_return
handle_repeat
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_repeat
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
bool
status
;
bool
status
;
if
(
!
check_bool
(
client
,
&
status
,
argv
[
1
]))
if
(
!
check_bool
(
client
,
&
status
,
argv
[
1
]))
...
@@ -244,7 +244,7 @@ handle_repeat(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
...
@@ -244,7 +244,7 @@ handle_repeat(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_single
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_single
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
bool
status
;
bool
status
;
if
(
!
check_bool
(
client
,
&
status
,
argv
[
1
]))
if
(
!
check_bool
(
client
,
&
status
,
argv
[
1
]))
...
@@ -255,7 +255,7 @@ handle_single(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
...
@@ -255,7 +255,7 @@ handle_single(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_consume
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_consume
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
bool
status
;
bool
status
;
if
(
!
check_bool
(
client
,
&
status
,
argv
[
1
]))
if
(
!
check_bool
(
client
,
&
status
,
argv
[
1
]))
...
@@ -266,7 +266,7 @@ handle_consume(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
...
@@ -266,7 +266,7 @@ handle_consume(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_random
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_random
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
bool
status
;
bool
status
;
if
(
!
check_bool
(
client
,
&
status
,
argv
[
1
]))
if
(
!
check_bool
(
client
,
&
status
,
argv
[
1
]))
...
@@ -277,7 +277,7 @@ handle_random(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
...
@@ -277,7 +277,7 @@ handle_random(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_clearerror
(
G_GNUC_UNUSED
struct
c
lient
*
client
,
handle_clearerror
(
G_GNUC_UNUSED
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
{
{
pc_clear_error
(
client
->
player_control
);
pc_clear_error
(
client
->
player_control
);
...
@@ -285,7 +285,7 @@ handle_clearerror(G_GNUC_UNUSED struct client *client,
...
@@ -285,7 +285,7 @@ handle_clearerror(G_GNUC_UNUSED struct client *client,
}
}
enum
command_return
enum
command_return
handle_seek
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_seek
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
unsigned
song
,
seek_time
;
unsigned
song
,
seek_time
;
enum
playlist_result
result
;
enum
playlist_result
result
;
...
@@ -301,7 +301,7 @@ handle_seek(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
...
@@ -301,7 +301,7 @@ handle_seek(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_seekid
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_seekid
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
unsigned
id
,
seek_time
;
unsigned
id
,
seek_time
;
enum
playlist_result
result
;
enum
playlist_result
result
;
...
@@ -317,7 +317,7 @@ handle_seekid(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
...
@@ -317,7 +317,7 @@ handle_seekid(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_seekcur
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_seekcur
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
const
char
*
p
=
argv
[
1
];
const
char
*
p
=
argv
[
1
];
bool
relative
=
*
p
==
'+'
||
*
p
==
'-'
;
bool
relative
=
*
p
==
'+'
||
*
p
==
'-'
;
...
@@ -332,7 +332,7 @@ handle_seekcur(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
...
@@ -332,7 +332,7 @@ handle_seekcur(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_crossfade
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_crossfade
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
unsigned
xfade_time
;
unsigned
xfade_time
;
...
@@ -344,7 +344,7 @@ handle_crossfade(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
...
@@ -344,7 +344,7 @@ handle_crossfade(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_mixrampdb
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_mixrampdb
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
float
db
;
float
db
;
...
@@ -356,7 +356,7 @@ handle_mixrampdb(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
...
@@ -356,7 +356,7 @@ handle_mixrampdb(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_mixrampdelay
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_mixrampdelay
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
float
delay_secs
;
float
delay_secs
;
...
@@ -368,7 +368,7 @@ handle_mixrampdelay(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
...
@@ -368,7 +368,7 @@ handle_mixrampdelay(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_replay_gain_mode
(
struct
c
lient
*
client
,
handle_replay_gain_mode
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
if
(
!
replay_gain_set_mode_string
(
argv
[
1
]))
{
if
(
!
replay_gain_set_mode_string
(
argv
[
1
]))
{
...
@@ -381,7 +381,7 @@ handle_replay_gain_mode(struct client *client,
...
@@ -381,7 +381,7 @@ handle_replay_gain_mode(struct client *client,
}
}
enum
command_return
enum
command_return
handle_replay_gain_status
(
struct
c
lient
*
client
,
handle_replay_gain_status
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
{
{
client_printf
(
client
,
"replay_gain_mode: %s
\n
"
,
client_printf
(
client
,
"replay_gain_mode: %s
\n
"
,
...
...
src/PlayerCommands.hxx
View file @
7a982169
...
@@ -22,67 +22,69 @@
...
@@ -22,67 +22,69 @@
#include "command.h"
#include "command.h"
class
Client
;
enum
command_return
enum
command_return
handle_play
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_play
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_playid
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_playid
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_stop
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_stop
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_currentsong
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_currentsong
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_pause
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_pause
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_status
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_status
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_next
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_next
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_previous
(
struct
c
lient
*
client
,
int
argc
,
char
*
avg
[]);
handle_previous
(
C
lient
*
client
,
int
argc
,
char
*
avg
[]);
enum
command_return
enum
command_return
handle_repeat
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_repeat
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_single
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_single
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_consume
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_consume
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_random
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_random
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_clearerror
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_clearerror
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_seek
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_seek
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_seekid
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_seekid
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_seekcur
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_seekcur
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_crossfade
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_crossfade
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_mixrampdb
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_mixrampdb
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_mixrampdelay
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_mixrampdelay
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_replay_gain_mode
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_replay_gain_mode
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_replay_gain_status
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_replay_gain_status
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
#endif
#endif
src/PlaylistCommands.cxx
View file @
7a982169
...
@@ -40,7 +40,7 @@ extern "C" {
...
@@ -40,7 +40,7 @@ extern "C" {
#include <stdlib.h>
#include <stdlib.h>
static
void
static
void
print_spl_list
(
struct
c
lient
*
client
,
const
PlaylistFileList
&
list
)
print_spl_list
(
C
lient
*
client
,
const
PlaylistFileList
&
list
)
{
{
for
(
const
auto
&
i
:
list
)
{
for
(
const
auto
&
i
:
list
)
{
client_printf
(
client
,
"playlist: %s
\n
"
,
i
.
name
.
c_str
());
client_printf
(
client
,
"playlist: %s
\n
"
,
i
.
name
.
c_str
());
...
@@ -51,7 +51,7 @@ print_spl_list(struct client *client, const PlaylistFileList &list)
...
@@ -51,7 +51,7 @@ print_spl_list(struct client *client, const PlaylistFileList &list)
}
}
enum
command_return
enum
command_return
handle_save
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_save
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
enum
playlist_result
result
;
enum
playlist_result
result
;
...
@@ -60,7 +60,7 @@ handle_save(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
...
@@ -60,7 +60,7 @@ handle_save(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_load
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[])
handle_load
(
C
lient
*
client
,
int
argc
,
char
*
argv
[])
{
{
unsigned
start_index
,
end_index
;
unsigned
start_index
,
end_index
;
...
@@ -97,7 +97,7 @@ handle_load(struct client *client, int argc, char *argv[])
...
@@ -97,7 +97,7 @@ handle_load(struct client *client, int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_listplaylist
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_listplaylist
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
if
(
playlist_file_print
(
client
,
argv
[
1
],
false
))
if
(
playlist_file_print
(
client
,
argv
[
1
],
false
))
return
COMMAND_RETURN_OK
;
return
COMMAND_RETURN_OK
;
...
@@ -109,7 +109,7 @@ handle_listplaylist(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
...
@@ -109,7 +109,7 @@ handle_listplaylist(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_listplaylistinfo
(
struct
c
lient
*
client
,
handle_listplaylistinfo
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
if
(
playlist_file_print
(
client
,
argv
[
1
],
true
))
if
(
playlist_file_print
(
client
,
argv
[
1
],
true
))
...
@@ -122,7 +122,7 @@ handle_listplaylistinfo(struct client *client,
...
@@ -122,7 +122,7 @@ handle_listplaylistinfo(struct client *client,
}
}
enum
command_return
enum
command_return
handle_rm
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_rm
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
GError
*
error
=
NULL
;
GError
*
error
=
NULL
;
return
spl_delete
(
argv
[
1
],
&
error
)
return
spl_delete
(
argv
[
1
],
&
error
)
...
@@ -131,7 +131,7 @@ handle_rm(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
...
@@ -131,7 +131,7 @@ handle_rm(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_rename
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_rename
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
GError
*
error
=
NULL
;
GError
*
error
=
NULL
;
return
spl_rename
(
argv
[
1
],
argv
[
2
],
&
error
)
return
spl_rename
(
argv
[
1
],
argv
[
2
],
&
error
)
...
@@ -140,7 +140,7 @@ handle_rename(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
...
@@ -140,7 +140,7 @@ handle_rename(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_playlistdelete
(
struct
c
lient
*
client
,
handle_playlistdelete
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
char
*
playlist
=
argv
[
1
];
char
*
playlist
=
argv
[
1
];
unsigned
from
;
unsigned
from
;
...
@@ -155,7 +155,7 @@ handle_playlistdelete(struct client *client,
...
@@ -155,7 +155,7 @@ handle_playlistdelete(struct client *client,
}
}
enum
command_return
enum
command_return
handle_playlistmove
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_playlistmove
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
char
*
playlist
=
argv
[
1
];
char
*
playlist
=
argv
[
1
];
unsigned
from
,
to
;
unsigned
from
,
to
;
...
@@ -172,7 +172,7 @@ handle_playlistmove(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
...
@@ -172,7 +172,7 @@ handle_playlistmove(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_playlistclear
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_playlistclear
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
GError
*
error
=
NULL
;
GError
*
error
=
NULL
;
return
spl_clear
(
argv
[
1
],
&
error
)
return
spl_clear
(
argv
[
1
],
&
error
)
...
@@ -181,7 +181,7 @@ handle_playlistclear(struct client *client, G_GNUC_UNUSED int argc, char *argv[]
...
@@ -181,7 +181,7 @@ handle_playlistclear(struct client *client, G_GNUC_UNUSED int argc, char *argv[]
}
}
enum
command_return
enum
command_return
handle_playlistadd
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_playlistadd
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
char
*
playlist
=
argv
[
1
];
char
*
playlist
=
argv
[
1
];
char
*
uri
=
argv
[
2
];
char
*
uri
=
argv
[
2
];
...
@@ -210,7 +210,7 @@ handle_playlistadd(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
...
@@ -210,7 +210,7 @@ handle_playlistadd(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_listplaylists
(
struct
c
lient
*
client
,
handle_listplaylists
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
{
{
GError
*
error
=
NULL
;
GError
*
error
=
NULL
;
...
...
src/PlaylistCommands.hxx
View file @
7a982169
...
@@ -22,37 +22,39 @@
...
@@ -22,37 +22,39 @@
#include "command.h"
#include "command.h"
class
Client
;
enum
command_return
enum
command_return
handle_save
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_save
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_load
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_load
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_listplaylist
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_listplaylist
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_listplaylistinfo
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_listplaylistinfo
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_rm
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_rm
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_rename
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_rename
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_playlistdelete
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_playlistdelete
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_playlistmove
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_playlistmove
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_playlistclear
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_playlistclear
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_playlistadd
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_playlistadd
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_listplaylists
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_listplaylists
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
#endif
#endif
src/PlaylistPrint.cxx
View file @
7a982169
...
@@ -37,7 +37,7 @@ extern "C" {
...
@@ -37,7 +37,7 @@ extern "C" {
}
}
void
void
playlist_print_uris
(
struct
c
lient
*
client
,
const
struct
playlist
*
playlist
)
playlist_print_uris
(
C
lient
*
client
,
const
struct
playlist
*
playlist
)
{
{
const
struct
queue
*
queue
=
&
playlist
->
queue
;
const
struct
queue
*
queue
=
&
playlist
->
queue
;
...
@@ -45,7 +45,7 @@ playlist_print_uris(struct client *client, const struct playlist *playlist)
...
@@ -45,7 +45,7 @@ playlist_print_uris(struct client *client, const struct playlist *playlist)
}
}
bool
bool
playlist_print_info
(
struct
c
lient
*
client
,
const
struct
playlist
*
playlist
,
playlist_print_info
(
C
lient
*
client
,
const
struct
playlist
*
playlist
,
unsigned
start
,
unsigned
end
)
unsigned
start
,
unsigned
end
)
{
{
const
struct
queue
*
queue
=
&
playlist
->
queue
;
const
struct
queue
*
queue
=
&
playlist
->
queue
;
...
@@ -63,7 +63,7 @@ playlist_print_info(struct client *client, const struct playlist *playlist,
...
@@ -63,7 +63,7 @@ playlist_print_info(struct client *client, const struct playlist *playlist,
}
}
bool
bool
playlist_print_id
(
struct
c
lient
*
client
,
const
struct
playlist
*
playlist
,
playlist_print_id
(
C
lient
*
client
,
const
struct
playlist
*
playlist
,
unsigned
id
)
unsigned
id
)
{
{
const
struct
queue
*
queue
=
&
playlist
->
queue
;
const
struct
queue
*
queue
=
&
playlist
->
queue
;
...
@@ -78,7 +78,7 @@ playlist_print_id(struct client *client, const struct playlist *playlist,
...
@@ -78,7 +78,7 @@ playlist_print_id(struct client *client, const struct playlist *playlist,
}
}
bool
bool
playlist_print_current
(
struct
c
lient
*
client
,
const
struct
playlist
*
playlist
)
playlist_print_current
(
C
lient
*
client
,
const
struct
playlist
*
playlist
)
{
{
int
current_position
=
playlist_get_current_song
(
playlist
);
int
current_position
=
playlist_get_current_song
(
playlist
);
...
@@ -91,14 +91,14 @@ playlist_print_current(struct client *client, const struct playlist *playlist)
...
@@ -91,14 +91,14 @@ playlist_print_current(struct client *client, const struct playlist *playlist)
}
}
void
void
playlist_print_find
(
struct
c
lient
*
client
,
const
struct
playlist
*
playlist
,
playlist_print_find
(
C
lient
*
client
,
const
struct
playlist
*
playlist
,
const
SongFilter
&
filter
)
const
SongFilter
&
filter
)
{
{
queue_find
(
client
,
&
playlist
->
queue
,
filter
);
queue_find
(
client
,
&
playlist
->
queue
,
filter
);
}
}
void
void
playlist_print_changes_info
(
struct
c
lient
*
client
,
playlist_print_changes_info
(
C
lient
*
client
,
const
struct
playlist
*
playlist
,
const
struct
playlist
*
playlist
,
uint32_t
version
)
uint32_t
version
)
{
{
...
@@ -106,7 +106,7 @@ playlist_print_changes_info(struct client *client,
...
@@ -106,7 +106,7 @@ playlist_print_changes_info(struct client *client,
}
}
void
void
playlist_print_changes_position
(
struct
c
lient
*
client
,
playlist_print_changes_position
(
C
lient
*
client
,
const
struct
playlist
*
playlist
,
const
struct
playlist
*
playlist
,
uint32_t
version
)
uint32_t
version
)
{
{
...
@@ -114,7 +114,7 @@ playlist_print_changes_position(struct client *client,
...
@@ -114,7 +114,7 @@ playlist_print_changes_position(struct client *client,
}
}
static
bool
static
bool
PrintSongDetails
(
struct
c
lient
*
client
,
const
char
*
uri_utf8
)
PrintSongDetails
(
C
lient
*
client
,
const
char
*
uri_utf8
)
{
{
const
Database
*
db
=
GetDatabase
(
nullptr
);
const
Database
*
db
=
GetDatabase
(
nullptr
);
if
(
db
==
nullptr
)
if
(
db
==
nullptr
)
...
@@ -130,7 +130,7 @@ PrintSongDetails(struct client *client, const char *uri_utf8)
...
@@ -130,7 +130,7 @@ PrintSongDetails(struct client *client, const char *uri_utf8)
}
}
bool
bool
spl_print
(
struct
c
lient
*
client
,
const
char
*
name_utf8
,
bool
detail
,
spl_print
(
C
lient
*
client
,
const
char
*
name_utf8
,
bool
detail
,
GError
**
error_r
)
GError
**
error_r
)
{
{
GError
*
error
=
NULL
;
GError
*
error
=
NULL
;
...
@@ -150,7 +150,7 @@ spl_print(struct client *client, const char *name_utf8, bool detail,
...
@@ -150,7 +150,7 @@ spl_print(struct client *client, const char *name_utf8, bool detail,
}
}
static
void
static
void
playlist_provider_print
(
struct
c
lient
*
client
,
const
char
*
uri
,
playlist_provider_print
(
C
lient
*
client
,
const
char
*
uri
,
struct
playlist_provider
*
playlist
,
bool
detail
)
struct
playlist_provider
*
playlist
,
bool
detail
)
{
{
struct
song
*
song
;
struct
song
*
song
;
...
@@ -173,7 +173,7 @@ playlist_provider_print(struct client *client, const char *uri,
...
@@ -173,7 +173,7 @@ playlist_provider_print(struct client *client, const char *uri,
}
}
bool
bool
playlist_file_print
(
struct
c
lient
*
client
,
const
char
*
uri
,
bool
detail
)
playlist_file_print
(
C
lient
*
client
,
const
char
*
uri
,
bool
detail
)
{
{
GMutex
*
mutex
=
g_mutex_new
();
GMutex
*
mutex
=
g_mutex_new
();
GCond
*
cond
=
g_cond_new
();
GCond
*
cond
=
g_cond_new
();
...
...
src/PlaylistPrint.hxx
View file @
7a982169
...
@@ -23,15 +23,15 @@
...
@@ -23,15 +23,15 @@
#include <glib.h>
#include <glib.h>
#include <stdint.h>
#include <stdint.h>
struct
client
;
struct
playlist
;
struct
playlist
;
class
SongFilter
;
class
SongFilter
;
class
Client
;
/**
/**
* Sends the whole playlist to the client, song URIs only.
* Sends the whole playlist to the client, song URIs only.
*/
*/
void
void
playlist_print_uris
(
struct
c
lient
*
client
,
const
struct
playlist
*
playlist
);
playlist_print_uris
(
C
lient
*
client
,
const
struct
playlist
*
playlist
);
/**
/**
* Sends a range of the playlist to the client, including all known
* Sends a range of the playlist to the client, including all known
...
@@ -40,7 +40,7 @@ playlist_print_uris(struct client *client, const struct playlist *playlist);
...
@@ -40,7 +40,7 @@ playlist_print_uris(struct client *client, const struct playlist *playlist);
* This function however fails when the start offset is invalid.
* This function however fails when the start offset is invalid.
*/
*/
bool
bool
playlist_print_info
(
struct
c
lient
*
client
,
const
struct
playlist
*
playlist
,
playlist_print_info
(
C
lient
*
client
,
const
struct
playlist
*
playlist
,
unsigned
start
,
unsigned
end
);
unsigned
start
,
unsigned
end
);
/**
/**
...
@@ -49,7 +49,7 @@ playlist_print_info(struct client *client, const struct playlist *playlist,
...
@@ -49,7 +49,7 @@ playlist_print_info(struct client *client, const struct playlist *playlist,
* @return true on suite, false if there is no such song
* @return true on suite, false if there is no such song
*/
*/
bool
bool
playlist_print_id
(
struct
c
lient
*
client
,
const
struct
playlist
*
playlist
,
playlist_print_id
(
C
lient
*
client
,
const
struct
playlist
*
playlist
,
unsigned
id
);
unsigned
id
);
/**
/**
...
@@ -58,20 +58,20 @@ playlist_print_id(struct client *client, const struct playlist *playlist,
...
@@ -58,20 +58,20 @@ playlist_print_id(struct client *client, const struct playlist *playlist,
* @return true on success, false if there is no current song
* @return true on success, false if there is no current song
*/
*/
bool
bool
playlist_print_current
(
struct
c
lient
*
client
,
const
struct
playlist
*
playlist
);
playlist_print_current
(
C
lient
*
client
,
const
struct
playlist
*
playlist
);
/**
/**
* Find songs in the playlist.
* Find songs in the playlist.
*/
*/
void
void
playlist_print_find
(
struct
c
lient
*
client
,
const
struct
playlist
*
playlist
,
playlist_print_find
(
C
lient
*
client
,
const
struct
playlist
*
playlist
,
const
SongFilter
&
filter
);
const
SongFilter
&
filter
);
/**
/**
* Print detailed changes since the specified playlist version.
* Print detailed changes since the specified playlist version.
*/
*/
void
void
playlist_print_changes_info
(
struct
c
lient
*
client
,
playlist_print_changes_info
(
C
lient
*
client
,
const
struct
playlist
*
playlist
,
const
struct
playlist
*
playlist
,
uint32_t
version
);
uint32_t
version
);
...
@@ -79,7 +79,7 @@ playlist_print_changes_info(struct client *client,
...
@@ -79,7 +79,7 @@ playlist_print_changes_info(struct client *client,
* Print changes since the specified playlist version, position only.
* Print changes since the specified playlist version, position only.
*/
*/
void
void
playlist_print_changes_position
(
struct
c
lient
*
client
,
playlist_print_changes_position
(
C
lient
*
client
,
const
struct
playlist
*
playlist
,
const
struct
playlist
*
playlist
,
uint32_t
version
);
uint32_t
version
);
...
@@ -92,7 +92,7 @@ playlist_print_changes_position(struct client *client,
...
@@ -92,7 +92,7 @@ playlist_print_changes_position(struct client *client,
* @return true on success, false if the playlist does not exist
* @return true on success, false if the playlist does not exist
*/
*/
bool
bool
spl_print
(
struct
c
lient
*
client
,
const
char
*
name_utf8
,
bool
detail
,
spl_print
(
C
lient
*
client
,
const
char
*
name_utf8
,
bool
detail
,
GError
**
error_r
);
GError
**
error_r
);
/**
/**
...
@@ -104,6 +104,6 @@ spl_print(struct client *client, const char *name_utf8, bool detail,
...
@@ -104,6 +104,6 @@ spl_print(struct client *client, const char *name_utf8, bool detail,
* @return true on success, false if the playlist does not exist
* @return true on success, false if the playlist does not exist
*/
*/
bool
bool
playlist_file_print
(
struct
c
lient
*
client
,
const
char
*
uri
,
bool
detail
);
playlist_file_print
(
C
lient
*
client
,
const
char
*
uri
,
bool
detail
);
#endif
#endif
src/QueueCommands.cxx
View file @
7a982169
...
@@ -37,7 +37,7 @@ extern "C" {
...
@@ -37,7 +37,7 @@ extern "C" {
#include <string.h>
#include <string.h>
enum
command_return
enum
command_return
handle_add
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_add
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
char
*
uri
=
argv
[
1
];
char
*
uri
=
argv
[
1
];
enum
playlist_result
result
;
enum
playlist_result
result
;
...
@@ -76,7 +76,7 @@ handle_add(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
...
@@ -76,7 +76,7 @@ handle_add(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_addid
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[])
handle_addid
(
C
lient
*
client
,
int
argc
,
char
*
argv
[])
{
{
char
*
uri
=
argv
[
1
];
char
*
uri
=
argv
[
1
];
unsigned
added_id
;
unsigned
added_id
;
...
@@ -128,7 +128,7 @@ handle_addid(struct client *client, int argc, char *argv[])
...
@@ -128,7 +128,7 @@ handle_addid(struct client *client, int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_delete
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_delete
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
unsigned
start
,
end
;
unsigned
start
,
end
;
enum
playlist_result
result
;
enum
playlist_result
result
;
...
@@ -142,7 +142,7 @@ handle_delete(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
...
@@ -142,7 +142,7 @@ handle_delete(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_deleteid
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_deleteid
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
unsigned
id
;
unsigned
id
;
enum
playlist_result
result
;
enum
playlist_result
result
;
...
@@ -155,7 +155,7 @@ handle_deleteid(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
...
@@ -155,7 +155,7 @@ handle_deleteid(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_playlist
(
struct
c
lient
*
client
,
handle_playlist
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
{
{
playlist_print_uris
(
client
,
&
g_playlist
);
playlist_print_uris
(
client
,
&
g_playlist
);
...
@@ -163,7 +163,7 @@ handle_playlist(struct client *client,
...
@@ -163,7 +163,7 @@ handle_playlist(struct client *client,
}
}
enum
command_return
enum
command_return
handle_shuffle
(
G_GNUC_UNUSED
struct
c
lient
*
client
,
handle_shuffle
(
G_GNUC_UNUSED
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
{
{
unsigned
start
=
0
,
end
=
queue_length
(
&
g_playlist
.
queue
);
unsigned
start
=
0
,
end
=
queue_length
(
&
g_playlist
.
queue
);
...
@@ -175,7 +175,7 @@ handle_shuffle(G_GNUC_UNUSED struct client *client,
...
@@ -175,7 +175,7 @@ handle_shuffle(G_GNUC_UNUSED struct client *client,
}
}
enum
command_return
enum
command_return
handle_clear
(
G_GNUC_UNUSED
struct
c
lient
*
client
,
handle_clear
(
G_GNUC_UNUSED
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
G_GNUC_UNUSED
int
argc
,
G_GNUC_UNUSED
char
*
argv
[])
{
{
playlist_clear
(
&
g_playlist
,
client
->
player_control
);
playlist_clear
(
&
g_playlist
,
client
->
player_control
);
...
@@ -183,7 +183,7 @@ handle_clear(G_GNUC_UNUSED struct client *client,
...
@@ -183,7 +183,7 @@ handle_clear(G_GNUC_UNUSED struct client *client,
}
}
enum
command_return
enum
command_return
handle_plchanges
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_plchanges
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
uint32_t
version
;
uint32_t
version
;
...
@@ -195,7 +195,7 @@ handle_plchanges(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
...
@@ -195,7 +195,7 @@ handle_plchanges(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_plchangesposid
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_plchangesposid
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
uint32_t
version
;
uint32_t
version
;
...
@@ -207,7 +207,7 @@ handle_plchangesposid(struct client *client, G_GNUC_UNUSED int argc, char *argv[
...
@@ -207,7 +207,7 @@ handle_plchangesposid(struct client *client, G_GNUC_UNUSED int argc, char *argv[
}
}
enum
command_return
enum
command_return
handle_playlistinfo
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[])
handle_playlistinfo
(
C
lient
*
client
,
int
argc
,
char
*
argv
[])
{
{
unsigned
start
=
0
,
end
=
G_MAXUINT
;
unsigned
start
=
0
,
end
=
G_MAXUINT
;
bool
ret
;
bool
ret
;
...
@@ -224,7 +224,7 @@ handle_playlistinfo(struct client *client, int argc, char *argv[])
...
@@ -224,7 +224,7 @@ handle_playlistinfo(struct client *client, int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_playlistid
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[])
handle_playlistid
(
C
lient
*
client
,
int
argc
,
char
*
argv
[])
{
{
if
(
argc
>=
2
)
{
if
(
argc
>=
2
)
{
unsigned
id
;
unsigned
id
;
...
@@ -243,7 +243,7 @@ handle_playlistid(struct client *client, int argc, char *argv[])
...
@@ -243,7 +243,7 @@ handle_playlistid(struct client *client, int argc, char *argv[])
}
}
static
enum
command_return
static
enum
command_return
handle_playlist_match
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[],
handle_playlist_match
(
C
lient
*
client
,
int
argc
,
char
*
argv
[],
bool
fold_case
)
bool
fold_case
)
{
{
SongFilter
filter
;
SongFilter
filter
;
...
@@ -257,19 +257,19 @@ handle_playlist_match(struct client *client, int argc, char *argv[],
...
@@ -257,19 +257,19 @@ handle_playlist_match(struct client *client, int argc, char *argv[],
}
}
enum
command_return
enum
command_return
handle_playlistfind
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[])
handle_playlistfind
(
C
lient
*
client
,
int
argc
,
char
*
argv
[])
{
{
return
handle_playlist_match
(
client
,
argc
,
argv
,
false
);
return
handle_playlist_match
(
client
,
argc
,
argv
,
false
);
}
}
enum
command_return
enum
command_return
handle_playlistsearch
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[])
handle_playlistsearch
(
C
lient
*
client
,
int
argc
,
char
*
argv
[])
{
{
return
handle_playlist_match
(
client
,
argc
,
argv
,
true
);
return
handle_playlist_match
(
client
,
argc
,
argv
,
true
);
}
}
enum
command_return
enum
command_return
handle_prio
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[])
handle_prio
(
C
lient
*
client
,
int
argc
,
char
*
argv
[])
{
{
unsigned
priority
;
unsigned
priority
;
...
@@ -301,7 +301,7 @@ handle_prio(struct client *client, int argc, char *argv[])
...
@@ -301,7 +301,7 @@ handle_prio(struct client *client, int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_prioid
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[])
handle_prioid
(
C
lient
*
client
,
int
argc
,
char
*
argv
[])
{
{
unsigned
priority
;
unsigned
priority
;
...
@@ -331,7 +331,7 @@ handle_prioid(struct client *client, int argc, char *argv[])
...
@@ -331,7 +331,7 @@ handle_prioid(struct client *client, int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_move
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_move
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
unsigned
start
,
end
;
unsigned
start
,
end
;
int
to
;
int
to
;
...
@@ -347,7 +347,7 @@ handle_move(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
...
@@ -347,7 +347,7 @@ handle_move(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_moveid
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_moveid
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
unsigned
id
;
unsigned
id
;
int
to
;
int
to
;
...
@@ -363,7 +363,7 @@ handle_moveid(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
...
@@ -363,7 +363,7 @@ handle_moveid(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_swap
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_swap
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
unsigned
song1
,
song2
;
unsigned
song1
,
song2
;
enum
playlist_result
result
;
enum
playlist_result
result
;
...
@@ -378,7 +378,7 @@ handle_swap(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
...
@@ -378,7 +378,7 @@ handle_swap(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_swapid
(
struct
c
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
handle_swapid
(
C
lient
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
{
unsigned
id1
,
id2
;
unsigned
id1
,
id2
;
enum
playlist_result
result
;
enum
playlist_result
result
;
...
...
src/QueueCommands.hxx
View file @
7a982169
...
@@ -22,61 +22,63 @@
...
@@ -22,61 +22,63 @@
#include "command.h"
#include "command.h"
class
Client
;
enum
command_return
enum
command_return
handle_add
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_add
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_addid
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_addid
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_delete
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_delete
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_deleteid
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_deleteid
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_playlist
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_playlist
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_shuffle
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_shuffle
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_clear
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_clear
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_plchanges
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_plchanges
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_plchangesposid
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_plchangesposid
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_playlistinfo
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_playlistinfo
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_playlistid
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_playlistid
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_playlistfind
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_playlistfind
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_playlistsearch
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_playlistsearch
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_prio
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_prio
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_prioid
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_prioid
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_move
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_move
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_moveid
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_moveid
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_swap
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_swap
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
enum
command_return
enum
command_return
handle_swapid
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_swapid
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
#endif
#endif
src/QueuePrint.cxx
View file @
7a982169
...
@@ -38,7 +38,7 @@ extern "C" {
...
@@ -38,7 +38,7 @@ extern "C" {
* @param end the index of the last song (excluding)
* @param end the index of the last song (excluding)
*/
*/
static
void
static
void
queue_print_song_info
(
struct
c
lient
*
client
,
const
struct
queue
*
queue
,
queue_print_song_info
(
C
lient
*
client
,
const
struct
queue
*
queue
,
unsigned
position
)
unsigned
position
)
{
{
song_print_info
(
client
,
queue_get
(
queue
,
position
));
song_print_info
(
client
,
queue_get
(
queue
,
position
));
...
@@ -51,7 +51,7 @@ queue_print_song_info(struct client *client, const struct queue *queue,
...
@@ -51,7 +51,7 @@ queue_print_song_info(struct client *client, const struct queue *queue,
}
}
void
void
queue_print_info
(
struct
c
lient
*
client
,
const
struct
queue
*
queue
,
queue_print_info
(
C
lient
*
client
,
const
struct
queue
*
queue
,
unsigned
start
,
unsigned
end
)
unsigned
start
,
unsigned
end
)
{
{
assert
(
start
<=
end
);
assert
(
start
<=
end
);
...
@@ -62,7 +62,7 @@ queue_print_info(struct client *client, const struct queue *queue,
...
@@ -62,7 +62,7 @@ queue_print_info(struct client *client, const struct queue *queue,
}
}
void
void
queue_print_uris
(
struct
c
lient
*
client
,
const
struct
queue
*
queue
,
queue_print_uris
(
C
lient
*
client
,
const
struct
queue
*
queue
,
unsigned
start
,
unsigned
end
)
unsigned
start
,
unsigned
end
)
{
{
assert
(
start
<=
end
);
assert
(
start
<=
end
);
...
@@ -75,7 +75,7 @@ queue_print_uris(struct client *client, const struct queue *queue,
...
@@ -75,7 +75,7 @@ queue_print_uris(struct client *client, const struct queue *queue,
}
}
void
void
queue_print_changes_info
(
struct
c
lient
*
client
,
const
struct
queue
*
queue
,
queue_print_changes_info
(
C
lient
*
client
,
const
struct
queue
*
queue
,
uint32_t
version
)
uint32_t
version
)
{
{
for
(
unsigned
i
=
0
;
i
<
queue_length
(
queue
);
i
++
)
{
for
(
unsigned
i
=
0
;
i
<
queue_length
(
queue
);
i
++
)
{
...
@@ -85,7 +85,7 @@ queue_print_changes_info(struct client *client, const struct queue *queue,
...
@@ -85,7 +85,7 @@ queue_print_changes_info(struct client *client, const struct queue *queue,
}
}
void
void
queue_print_changes_position
(
struct
c
lient
*
client
,
const
struct
queue
*
queue
,
queue_print_changes_position
(
C
lient
*
client
,
const
struct
queue
*
queue
,
uint32_t
version
)
uint32_t
version
)
{
{
for
(
unsigned
i
=
0
;
i
<
queue_length
(
queue
);
i
++
)
for
(
unsigned
i
=
0
;
i
<
queue_length
(
queue
);
i
++
)
...
@@ -95,7 +95,7 @@ queue_print_changes_position(struct client *client, const struct queue *queue,
...
@@ -95,7 +95,7 @@ queue_print_changes_position(struct client *client, const struct queue *queue,
}
}
void
void
queue_find
(
struct
c
lient
*
client
,
const
struct
queue
*
queue
,
queue_find
(
C
lient
*
client
,
const
struct
queue
*
queue
,
const
SongFilter
&
filter
)
const
SongFilter
&
filter
)
{
{
for
(
unsigned
i
=
0
;
i
<
queue_length
(
queue
);
i
++
)
{
for
(
unsigned
i
=
0
;
i
<
queue_length
(
queue
);
i
++
)
{
...
...
src/QueuePrint.hxx
View file @
7a982169
...
@@ -27,28 +27,28 @@
...
@@ -27,28 +27,28 @@
#include <stdint.h>
#include <stdint.h>
struct
client
;
struct
queue
;
struct
queue
;
class
SongFilter
;
class
SongFilter
;
class
Client
;
void
void
queue_print_info
(
struct
c
lient
*
client
,
const
struct
queue
*
queue
,
queue_print_info
(
C
lient
*
client
,
const
struct
queue
*
queue
,
unsigned
start
,
unsigned
end
);
unsigned
start
,
unsigned
end
);
void
void
queue_print_uris
(
struct
c
lient
*
client
,
const
struct
queue
*
queue
,
queue_print_uris
(
C
lient
*
client
,
const
struct
queue
*
queue
,
unsigned
start
,
unsigned
end
);
unsigned
start
,
unsigned
end
);
void
void
queue_print_changes_info
(
struct
c
lient
*
client
,
const
struct
queue
*
queue
,
queue_print_changes_info
(
C
lient
*
client
,
const
struct
queue
*
queue
,
uint32_t
version
);
uint32_t
version
);
void
void
queue_print_changes_position
(
struct
c
lient
*
client
,
const
struct
queue
*
queue
,
queue_print_changes_position
(
C
lient
*
client
,
const
struct
queue
*
queue
,
uint32_t
version
);
uint32_t
version
);
void
void
queue_find
(
struct
c
lient
*
client
,
const
struct
queue
*
queue
,
queue_find
(
C
lient
*
client
,
const
struct
queue
*
queue
,
const
SongFilter
&
filter
);
const
SongFilter
&
filter
);
#endif
#endif
src/SongPrint.cxx
View file @
7a982169
...
@@ -31,7 +31,7 @@ extern "C" {
...
@@ -31,7 +31,7 @@ extern "C" {
}
}
void
void
song_print_uri
(
struct
c
lient
*
client
,
struct
song
*
song
)
song_print_uri
(
C
lient
*
client
,
struct
song
*
song
)
{
{
if
(
song_in_database
(
song
)
&&
!
song
->
parent
->
IsRoot
())
{
if
(
song_in_database
(
song
)
&&
!
song
->
parent
->
IsRoot
())
{
client_printf
(
client
,
"%s%s/%s
\n
"
,
SONG_FILE
,
client_printf
(
client
,
"%s%s/%s
\n
"
,
SONG_FILE
,
...
@@ -52,7 +52,7 @@ song_print_uri(struct client *client, struct song *song)
...
@@ -52,7 +52,7 @@ song_print_uri(struct client *client, struct song *song)
}
}
void
void
song_print_info
(
struct
c
lient
*
client
,
struct
song
*
song
)
song_print_info
(
C
lient
*
client
,
struct
song
*
song
)
{
{
song_print_uri
(
client
,
song
);
song_print_uri
(
client
,
song
);
...
...
src/SongPrint.hxx
View file @
7a982169
...
@@ -20,13 +20,13 @@
...
@@ -20,13 +20,13 @@
#ifndef MPD_SONG_PRINT_HXX
#ifndef MPD_SONG_PRINT_HXX
#define MPD_SONG_PRINT_HXX
#define MPD_SONG_PRINT_HXX
struct
client
;
struct
song
;
struct
song
;
class
Client
;
void
void
song_print_info
(
struct
c
lient
*
client
,
struct
song
*
song
);
song_print_info
(
C
lient
*
client
,
struct
song
*
song
);
void
void
song_print_uri
(
struct
c
lient
*
client
,
struct
song
*
song
);
song_print_uri
(
C
lient
*
client
,
struct
song
*
song
);
#endif
#endif
src/Stats.cxx
View file @
7a982169
...
@@ -66,7 +66,7 @@ void stats_update(void)
...
@@ -66,7 +66,7 @@ void stats_update(void)
}
}
void
void
stats_print
(
struct
c
lient
*
client
)
stats_print
(
C
lient
*
client
)
{
{
client_printf
(
client
,
client_printf
(
client
,
"artists: %u
\n
"
"artists: %u
\n
"
...
...
src/StickerCommands.cxx
View file @
7a982169
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
#include <string.h>
#include <string.h>
struct
sticker_song_find_data
{
struct
sticker_song_find_data
{
struct
c
lient
*
client
;
C
lient
*
client
;
const
char
*
name
;
const
char
*
name
;
};
};
...
@@ -49,7 +49,7 @@ sticker_song_find_print_cb(struct song *song, const char *value,
...
@@ -49,7 +49,7 @@ sticker_song_find_print_cb(struct song *song, const char *value,
}
}
static
enum
command_return
static
enum
command_return
handle_sticker_song
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[])
handle_sticker_song
(
C
lient
*
client
,
int
argc
,
char
*
argv
[])
{
{
GError
*
error
=
nullptr
;
GError
*
error
=
nullptr
;
const
Database
*
db
=
GetDatabase
(
&
error
);
const
Database
*
db
=
GetDatabase
(
&
error
);
...
@@ -156,7 +156,7 @@ handle_sticker_song(struct client *client, int argc, char *argv[])
...
@@ -156,7 +156,7 @@ handle_sticker_song(struct client *client, int argc, char *argv[])
}
}
enum
command_return
enum
command_return
handle_sticker
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[])
handle_sticker
(
C
lient
*
client
,
int
argc
,
char
*
argv
[])
{
{
assert
(
argc
>=
4
);
assert
(
argc
>=
4
);
...
...
src/StickerCommands.hxx
View file @
7a982169
...
@@ -22,7 +22,9 @@
...
@@ -22,7 +22,9 @@
#include "command.h"
#include "command.h"
class
Client
;
enum
command_return
enum
command_return
handle_sticker
(
struct
c
lient
*
client
,
int
argc
,
char
*
argv
[]);
handle_sticker
(
C
lient
*
client
,
int
argc
,
char
*
argv
[]);
#endif
#endif
src/StickerPrint.cxx
View file @
7a982169
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
#include "Client.hxx"
#include "Client.hxx"
void
void
sticker_print_value
(
struct
c
lient
*
client
,
sticker_print_value
(
C
lient
*
client
,
const
char
*
name
,
const
char
*
value
)
const
char
*
name
,
const
char
*
value
)
{
{
client_printf
(
client
,
"sticker: %s=%s
\n
"
,
name
,
value
);
client_printf
(
client
,
"sticker: %s=%s
\n
"
,
name
,
value
);
...
@@ -32,13 +32,13 @@ sticker_print_value(struct client *client,
...
@@ -32,13 +32,13 @@ sticker_print_value(struct client *client,
static
void
static
void
print_sticker_cb
(
const
char
*
name
,
const
char
*
value
,
void
*
data
)
print_sticker_cb
(
const
char
*
name
,
const
char
*
value
,
void
*
data
)
{
{
struct
client
*
client
=
(
struct
c
lient
*
)
data
;
Client
*
client
=
(
C
lient
*
)
data
;
sticker_print_value
(
client
,
name
,
value
);
sticker_print_value
(
client
,
name
,
value
);
}
}
void
void
sticker_print
(
struct
c
lient
*
client
,
const
struct
sticker
*
sticker
)
sticker_print
(
C
lient
*
client
,
const
struct
sticker
*
sticker
)
{
{
sticker_foreach
(
sticker
,
print_sticker_cb
,
client
);
sticker_foreach
(
sticker
,
print_sticker_cb
,
client
);
}
}
src/StickerPrint.hxx
View file @
7a982169
...
@@ -21,19 +21,18 @@
...
@@ -21,19 +21,18 @@
#define MPD_STICKER_PRINT_HXX
#define MPD_STICKER_PRINT_HXX
struct
sticker
;
struct
sticker
;
struct
c
lient
;
class
C
lient
;
/**
/**
* Sends one sticker value to the client.
* Sends one sticker value to the client.
*/
*/
void
void
sticker_print_value
(
struct
client
*
client
,
sticker_print_value
(
Client
*
client
,
const
char
*
name
,
const
char
*
value
);
const
char
*
name
,
const
char
*
value
);
/**
/**
* Sends all sticker values to the client.
* Sends all sticker values to the client.
*/
*/
void
void
sticker_print
(
struct
c
lient
*
client
,
const
struct
sticker
*
sticker
);
sticker_print
(
C
lient
*
client
,
const
struct
sticker
*
sticker
);
#endif
#endif
src/TagPrint.cxx
View file @
7a982169
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
#include "song.h"
#include "song.h"
#include "Client.hxx"
#include "Client.hxx"
void
tag_print_types
(
struct
c
lient
*
client
)
void
tag_print_types
(
C
lient
*
client
)
{
{
int
i
;
int
i
;
...
@@ -35,7 +35,7 @@ void tag_print_types(struct client *client)
...
@@ -35,7 +35,7 @@ void tag_print_types(struct client *client)
}
}
}
}
void
tag_print
(
struct
c
lient
*
client
,
const
struct
tag
*
tag
)
void
tag_print
(
C
lient
*
client
,
const
struct
tag
*
tag
)
{
{
if
(
tag
->
time
>=
0
)
if
(
tag
->
time
>=
0
)
client_printf
(
client
,
SONG_TIME
"%i
\n
"
,
tag
->
time
);
client_printf
(
client
,
SONG_TIME
"%i
\n
"
,
tag
->
time
);
...
...
src/TagPrint.hxx
View file @
7a982169
...
@@ -21,10 +21,10 @@
...
@@ -21,10 +21,10 @@
#define MPD_TAG_PRINT_HXX
#define MPD_TAG_PRINT_HXX
struct
tag
;
struct
tag
;
struct
c
lient
;
class
C
lient
;
void
tag_print_types
(
struct
c
lient
*
client
);
void
tag_print_types
(
C
lient
*
client
);
void
tag_print
(
struct
c
lient
*
client
,
const
struct
tag
*
tag
);
void
tag_print
(
C
lient
*
client
,
const
struct
tag
*
tag
);
#endif
#endif
src/TimePrint.cxx
View file @
7a982169
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
#include <glib.h>
#include <glib.h>
void
void
time_print
(
struct
c
lient
*
client
,
const
char
*
name
,
time_t
t
)
time_print
(
C
lient
*
client
,
const
char
*
name
,
time_t
t
)
{
{
#ifdef G_OS_WIN32
#ifdef G_OS_WIN32
const
struct
tm
*
tm2
=
gmtime
(
&
t
);
const
struct
tm
*
tm2
=
gmtime
(
&
t
);
...
...
src/TimePrint.hxx
View file @
7a982169
...
@@ -22,12 +22,12 @@
...
@@ -22,12 +22,12 @@
#include <time.h>
#include <time.h>
struct
c
lient
;
class
C
lient
;
/**
/**
* Write a line with a time stamp to the client.
* Write a line with a time stamp to the client.
*/
*/
void
void
time_print
(
struct
c
lient
*
client
,
const
char
*
name
,
time_t
t
);
time_print
(
C
lient
*
client
,
const
char
*
name
,
time_t
t
);
#endif
#endif
src/ls.cxx
View file @
7a982169
...
@@ -78,7 +78,7 @@ void print_supported_uri_schemes_to_fp(FILE *fp)
...
@@ -78,7 +78,7 @@ void print_supported_uri_schemes_to_fp(FILE *fp)
fprintf
(
fp
,
"
\n
"
);
fprintf
(
fp
,
"
\n
"
);
}
}
void
print_supported_uri_schemes
(
struct
c
lient
*
client
)
void
print_supported_uri_schemes
(
C
lient
*
client
)
{
{
const
char
**
prefixes
=
remoteUrlPrefixes
;
const
char
**
prefixes
=
remoteUrlPrefixes
;
...
...
src/ls.hxx
View file @
7a982169
...
@@ -20,10 +20,9 @@
...
@@ -20,10 +20,9 @@
#ifndef MPD_LS_HXX
#ifndef MPD_LS_HXX
#define MPD_LS_HXX
#define MPD_LS_HXX
#include <stdbool.h>
#include <stdio.h>
#include <stdio.h>
struct
c
lient
;
class
C
lient
;
/**
/**
* Checks whether the scheme of the specified URI is supported by MPD.
* Checks whether the scheme of the specified URI is supported by MPD.
...
@@ -36,7 +35,7 @@ bool uri_supported_scheme(const char *url);
...
@@ -36,7 +35,7 @@ bool uri_supported_scheme(const char *url);
* Send a list of supported URI schemes to the client. This is the
* Send a list of supported URI schemes to the client. This is the
* response to the "urlhandlers" command.
* response to the "urlhandlers" command.
*/
*/
void
print_supported_uri_schemes
(
struct
c
lient
*
client
);
void
print_supported_uri_schemes
(
C
lient
*
client
);
/**
/**
* Send a list of supported URI schemes to a file pointer.
* Send a list of supported URI schemes to a file pointer.
...
...
src/protocol/ArgParser.cxx
View file @
7a982169
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
#include <stdlib.h>
#include <stdlib.h>
bool
bool
check_uint32
(
struct
c
lient
*
client
,
uint32_t
*
dst
,
const
char
*
s
)
check_uint32
(
C
lient
*
client
,
uint32_t
*
dst
,
const
char
*
s
)
{
{
char
*
test
;
char
*
test
;
...
@@ -39,7 +39,7 @@ check_uint32(struct client *client, uint32_t *dst, const char *s)
...
@@ -39,7 +39,7 @@ check_uint32(struct client *client, uint32_t *dst, const char *s)
}
}
bool
bool
check_int
(
struct
c
lient
*
client
,
int
*
value_r
,
const
char
*
s
)
check_int
(
C
lient
*
client
,
int
*
value_r
,
const
char
*
s
)
{
{
char
*
test
;
char
*
test
;
long
value
;
long
value
;
...
@@ -64,7 +64,7 @@ check_int(struct client *client, int *value_r, const char *s)
...
@@ -64,7 +64,7 @@ check_int(struct client *client, int *value_r, const char *s)
}
}
bool
bool
check_range
(
struct
c
lient
*
client
,
unsigned
*
value_r1
,
unsigned
*
value_r2
,
check_range
(
C
lient
*
client
,
unsigned
*
value_r1
,
unsigned
*
value_r2
,
const
char
*
s
)
const
char
*
s
)
{
{
char
*
test
,
*
test2
;
char
*
test
,
*
test2
;
...
@@ -134,7 +134,7 @@ check_range(struct client *client, unsigned *value_r1, unsigned *value_r2,
...
@@ -134,7 +134,7 @@ check_range(struct client *client, unsigned *value_r1, unsigned *value_r2,
}
}
bool
bool
check_unsigned
(
struct
c
lient
*
client
,
unsigned
*
value_r
,
const
char
*
s
)
check_unsigned
(
C
lient
*
client
,
unsigned
*
value_r
,
const
char
*
s
)
{
{
unsigned
long
value
;
unsigned
long
value
;
char
*
endptr
;
char
*
endptr
;
...
@@ -157,7 +157,7 @@ check_unsigned(struct client *client, unsigned *value_r, const char *s)
...
@@ -157,7 +157,7 @@ check_unsigned(struct client *client, unsigned *value_r, const char *s)
}
}
bool
bool
check_bool
(
struct
c
lient
*
client
,
bool
*
value_r
,
const
char
*
s
)
check_bool
(
C
lient
*
client
,
bool
*
value_r
,
const
char
*
s
)
{
{
long
value
;
long
value
;
char
*
endptr
;
char
*
endptr
;
...
@@ -174,7 +174,7 @@ check_bool(struct client *client, bool *value_r, const char *s)
...
@@ -174,7 +174,7 @@ check_bool(struct client *client, bool *value_r, const char *s)
}
}
bool
bool
check_float
(
struct
c
lient
*
client
,
float
*
value_r
,
const
char
*
s
)
check_float
(
C
lient
*
client
,
float
*
value_r
,
const
char
*
s
)
{
{
float
value
;
float
value
;
char
*
endptr
;
char
*
endptr
;
...
...
src/protocol/ArgParser.hxx
View file @
7a982169
...
@@ -25,25 +25,25 @@
...
@@ -25,25 +25,25 @@
#include <stdbool.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdint.h>
struct
c
lient
;
class
C
lient
;
bool
bool
check_uint32
(
struct
c
lient
*
client
,
uint32_t
*
dst
,
const
char
*
s
);
check_uint32
(
C
lient
*
client
,
uint32_t
*
dst
,
const
char
*
s
);
bool
bool
check_int
(
struct
c
lient
*
client
,
int
*
value_r
,
const
char
*
s
);
check_int
(
C
lient
*
client
,
int
*
value_r
,
const
char
*
s
);
bool
bool
check_range
(
struct
c
lient
*
client
,
unsigned
*
value_r1
,
unsigned
*
value_r2
,
check_range
(
C
lient
*
client
,
unsigned
*
value_r1
,
unsigned
*
value_r2
,
const
char
*
s
);
const
char
*
s
);
bool
bool
check_unsigned
(
struct
c
lient
*
client
,
unsigned
*
value_r
,
const
char
*
s
);
check_unsigned
(
C
lient
*
client
,
unsigned
*
value_r
,
const
char
*
s
);
bool
bool
check_bool
(
struct
c
lient
*
client
,
bool
*
value_r
,
const
char
*
s
);
check_bool
(
C
lient
*
client
,
bool
*
value_r
,
const
char
*
s
);
bool
bool
check_float
(
struct
c
lient
*
client
,
float
*
value_r
,
const
char
*
s
);
check_float
(
C
lient
*
client
,
float
*
value_r
,
const
char
*
s
);
#endif
#endif
src/protocol/Result.cxx
View file @
7a982169
...
@@ -27,13 +27,13 @@ const char *current_command;
...
@@ -27,13 +27,13 @@ const char *current_command;
int
command_list_num
;
int
command_list_num
;
void
void
command_success
(
struct
c
lient
*
client
)
command_success
(
C
lient
*
client
)
{
{
client_puts
(
client
,
"OK
\n
"
);
client_puts
(
client
,
"OK
\n
"
);
}
}
void
void
command_error_v
(
struct
c
lient
*
client
,
enum
ack
error
,
command_error_v
(
C
lient
*
client
,
enum
ack
error
,
const
char
*
fmt
,
va_list
args
)
const
char
*
fmt
,
va_list
args
)
{
{
assert
(
client
!=
NULL
);
assert
(
client
!=
NULL
);
...
@@ -48,7 +48,7 @@ command_error_v(struct client *client, enum ack error,
...
@@ -48,7 +48,7 @@ command_error_v(struct client *client, enum ack error,
}
}
void
void
command_error
(
struct
c
lient
*
client
,
enum
ack
error
,
const
char
*
fmt
,
...)
command_error
(
C
lient
*
client
,
enum
ack
error
,
const
char
*
fmt
,
...)
{
{
va_list
args
;
va_list
args
;
va_start
(
args
,
fmt
);
va_start
(
args
,
fmt
);
...
...
src/protocol/Result.hxx
View file @
7a982169
...
@@ -24,20 +24,20 @@
...
@@ -24,20 +24,20 @@
#include "gcc.h"
#include "gcc.h"
#include "ack.h"
#include "ack.h"
struct
c
lient
;
class
C
lient
;
extern
const
char
*
current_command
;
extern
const
char
*
current_command
;
extern
int
command_list_num
;
extern
int
command_list_num
;
void
void
command_success
(
struct
c
lient
*
client
);
command_success
(
C
lient
*
client
);
void
void
command_error_v
(
struct
c
lient
*
client
,
enum
ack
error
,
command_error_v
(
C
lient
*
client
,
enum
ack
error
,
const
char
*
fmt
,
va_list
args
);
const
char
*
fmt
,
va_list
args
);
gcc_fprintf_
gcc_fprintf_
void
void
command_error
(
struct
c
lient
*
client
,
enum
ack
error
,
const
char
*
fmt
,
...);
command_error
(
C
lient
*
client
,
enum
ack
error
,
const
char
*
fmt
,
...);
#endif
#endif
src/stats.h
View file @
7a982169
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
#include <glib.h>
#include <glib.h>
struct
c
lient
;
class
C
lient
;
struct
stats
{
struct
stats
{
GTimer
*
timer
;
GTimer
*
timer
;
...
@@ -50,6 +50,6 @@ void stats_global_finish(void);
...
@@ -50,6 +50,6 @@ void stats_global_finish(void);
void
stats_update
(
void
);
void
stats_update
(
void
);
void
void
stats_print
(
struct
c
lient
*
client
);
stats_print
(
C
lient
*
client
);
#endif
#endif
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