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
f8e58640
Commit
f8e58640
authored
Oct 22, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
command: added print_spl_list()
The function print_spl_list() replaces the old function lsPlaylists() from ls.c.
parent
a65e20b5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
22 deletions
+18
-22
command.c
src/command.c
+18
-2
ls.c
src/ls.c
+0
-18
ls.h
src/ls.h
+0
-2
No files found.
src/command.c
View file @
f8e58640
...
...
@@ -202,6 +202,17 @@ static int print_playlist_result(struct client *client,
return
-
1
;
}
static
void
print_spl_list
(
struct
client
*
client
,
GPtrArray
*
list
)
{
for
(
unsigned
i
=
0
;
i
<
list
->
len
;
++
i
)
{
struct
stored_playlist_info
*
playlist
=
g_ptr_array_index
(
list
,
i
);
client_printf
(
client
,
"playlist: %s
\n
"
,
playlist
->
name
);
}
}
static
int
handleUrlHandlers
(
struct
client
*
client
,
mpd_unused
int
argc
,
mpd_unused
char
*
argv
[])
{
...
...
@@ -524,8 +535,13 @@ static int handleLsInfo(struct client *client,
directory_print
(
client
,
directory
);
if
(
isRootDirectory
(
path
))
return
lsPlaylists
(
client
,
path
);
if
(
isRootDirectory
(
path
))
{
GPtrArray
*
list
=
spl_list
();
if
(
list
!=
NULL
)
{
print_spl_list
(
client
,
list
);
spl_list_free
(
list
);
}
}
return
0
;
}
...
...
src/ls.c
View file @
f8e58640
...
...
@@ -98,24 +98,6 @@ int isRemoteUrl(const char *url)
return
0
;
}
int
lsPlaylists
(
struct
client
*
client
,
const
char
*
utf8path
)
{
GPtrArray
*
list
=
spl_list
();
if
(
list
==
NULL
)
return
0
;
for
(
unsigned
i
=
0
;
i
<
list
->
len
;
++
i
)
{
struct
stored_playlist_info
*
playlist
=
g_ptr_array_index
(
list
,
i
);
client_printf
(
client
,
"playlist: %s%s
\n
"
,
utf8path
,
playlist
->
name
);
}
spl_list_free
(
list
);
return
0
;
}
/* suffixes should be ascii only characters */
const
char
*
getSuffix
(
const
char
*
utf8file
)
{
...
...
src/ls.h
View file @
f8e58640
...
...
@@ -26,8 +26,6 @@
struct
stat
;
struct
client
;
int
lsPlaylists
(
struct
client
*
client
,
const
char
*
utf8path
);
const
char
*
getSuffix
(
const
char
*
utf8file
);
int
isValidRemoteUtf8Url
(
const
char
*
utf8url
);
...
...
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