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
60bec776
Commit
60bec776
authored
Feb 04, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist_print: use bool instead of int
Return true on success, instead of 0. Converted the "detail" parameter to bool.
parent
f8172859
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
16 deletions
+22
-16
command.c
src/command.c
+12
-8
playlist_print.c
src/playlist_print.c
+6
-6
playlist_print.h
src/playlist_print.h
+4
-2
No files found.
src/command.c
View file @
60bec776
...
...
@@ -686,26 +686,30 @@ handle_load(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
static
enum
command_return
handle_listplaylist
(
struct
client
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
int
ret
;
bool
ret
;
ret
=
spl_print
(
client
,
argv
[
1
],
0
);
if
(
ret
==
-
1
)
ret
=
spl_print
(
client
,
argv
[
1
],
false
);
if
(
!
ret
)
{
command_error
(
client
,
ACK_ERROR_NO_EXIST
,
"No such playlist"
);
return
COMMAND_RETURN_ERROR
;
}
return
ret
;
return
COMMAND_RETURN_OK
;
}
static
enum
command_return
handle_listplaylistinfo
(
struct
client
*
client
,
G_GNUC_UNUSED
int
argc
,
char
*
argv
[])
{
int
ret
;
bool
ret
;
ret
=
spl_print
(
client
,
argv
[
1
],
1
);
if
(
ret
==
-
1
)
ret
=
spl_print
(
client
,
argv
[
1
],
true
);
if
(
!
ret
)
{
command_error
(
client
,
ACK_ERROR_NO_EXIST
,
"No such playlist"
);
return
COMMAND_RETURN_ERROR
;
}
return
ret
;
return
COMMAND_RETURN_OK
;
}
static
enum
command_return
...
...
src/playlist_print.c
View file @
60bec776
...
...
@@ -23,24 +23,24 @@
#include "database.h"
#include "client.h"
int
spl_print
(
struct
client
*
client
,
const
char
*
name_utf8
,
int
detail
)
bool
spl_print
(
struct
client
*
client
,
const
char
*
name_utf8
,
bool
detail
)
{
GPtrArray
*
list
;
list
=
spl_load
(
name_utf8
);
if
(
list
==
NULL
)
return
-
1
;
return
false
;
for
(
unsigned
i
=
0
;
i
<
list
->
len
;
++
i
)
{
const
char
*
temp
=
g_ptr_array_index
(
list
,
i
);
int
wrote
=
0
;
bool
wrote
=
false
;
if
(
detail
)
{
struct
song
*
song
=
db_get_song
(
temp
);
if
(
song
)
{
song_print_info
(
client
,
song
);
wrote
=
1
;
wrote
=
true
;
}
}
...
...
@@ -50,5 +50,5 @@ spl_print(struct client *client, const char *name_utf8, int detail)
}
spl_free
(
list
);
return
0
;
return
true
;
}
src/playlist_print.h
View file @
60bec776
...
...
@@ -19,9 +19,11 @@
#ifndef PLAYLIST_PRINT_H
#define PLAYLIST_PRINT_H
#include <stdbool.h>
struct
client
;
int
spl_print
(
struct
client
*
client
,
const
char
*
name_utf8
,
int
detail
);
bool
spl_print
(
struct
client
*
client
,
const
char
*
name_utf8
,
bool
detail
);
#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