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
93598e28
Commit
93598e28
authored
Oct 23, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stored_playlist: renamed and moved spl_delete() to stored_playlist.c
The function deletePlaylist() shouldn't be in playlist.c.
parent
39f0c41f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
17 deletions
+19
-17
command.c
src/command.c
+1
-1
playlist.c
src/playlist.c
+0
-14
playlist.h
src/playlist.h
+0
-2
stored_playlist.c
src/stored_playlist.c
+15
-0
stored_playlist.h
src/stored_playlist.h
+3
-0
No files found.
src/command.c
View file @
93598e28
...
@@ -626,7 +626,7 @@ handle_rm(struct client *client, mpd_unused int argc, char *argv[])
...
@@ -626,7 +626,7 @@ handle_rm(struct client *client, mpd_unused int argc, char *argv[])
{
{
enum
playlist_result
result
;
enum
playlist_result
result
;
result
=
deletePlaylist
(
argv
[
1
]);
result
=
spl_delete
(
argv
[
1
]);
return
print_playlist_result
(
client
,
result
);
return
print_playlist_result
(
client
,
result
);
}
}
...
...
src/playlist.c
View file @
93598e28
...
@@ -1185,20 +1185,6 @@ void shufflePlaylist(void)
...
@@ -1185,20 +1185,6 @@ void shufflePlaylist(void)
}
}
}
}
enum
playlist_result
deletePlaylist
(
const
char
*
utf8file
)
{
char
path_max_tmp
[
MPD_PATH_MAX
];
utf8_to_fs_playlist_path
(
path_max_tmp
,
utf8file
);
if
(
unlink
(
path_max_tmp
)
<
0
)
return
errno
==
ENOENT
?
PLAYLIST_RESULT_NO_SUCH_LIST
:
PLAYLIST_RESULT_ERRNO
;
return
PLAYLIST_RESULT_SUCCESS
;
}
enum
playlist_result
savePlaylist
(
const
char
*
utf8file
)
enum
playlist_result
savePlaylist
(
const
char
*
utf8file
)
{
{
FILE
*
fp
;
FILE
*
fp
;
...
...
src/playlist.h
View file @
93598e28
...
@@ -109,8 +109,6 @@ void shufflePlaylist(void);
...
@@ -109,8 +109,6 @@ void shufflePlaylist(void);
enum
playlist_result
savePlaylist
(
const
char
*
utf8file
);
enum
playlist_result
savePlaylist
(
const
char
*
utf8file
);
enum
playlist_result
deletePlaylist
(
const
char
*
utf8file
);
void
void
deleteASongFromPlaylist
(
const
struct
song
*
song
);
deleteASongFromPlaylist
(
const
struct
song
*
song
);
...
...
src/stored_playlist.c
View file @
93598e28
...
@@ -266,6 +266,21 @@ spl_clear(const char *utf8path)
...
@@ -266,6 +266,21 @@ spl_clear(const char *utf8path)
}
}
enum
playlist_result
enum
playlist_result
spl_delete
(
const
char
*
name_utf8
)
{
char
filename
[
MPD_PATH_MAX
];
utf8_to_fs_playlist_path
(
filename
,
name_utf8
);
if
(
unlink
(
filename
)
<
0
)
return
errno
==
ENOENT
?
PLAYLIST_RESULT_NO_SUCH_LIST
:
PLAYLIST_RESULT_ERRNO
;
return
PLAYLIST_RESULT_SUCCESS
;
}
enum
playlist_result
spl_remove_index
(
const
char
*
utf8path
,
unsigned
pos
)
spl_remove_index
(
const
char
*
utf8path
,
unsigned
pos
)
{
{
GPtrArray
*
list
;
GPtrArray
*
list
;
...
...
src/stored_playlist.h
View file @
93598e28
...
@@ -54,6 +54,9 @@ enum playlist_result
...
@@ -54,6 +54,9 @@ enum playlist_result
spl_clear
(
const
char
*
utf8path
);
spl_clear
(
const
char
*
utf8path
);
enum
playlist_result
enum
playlist_result
spl_delete
(
const
char
*
name_utf8
);
enum
playlist_result
spl_remove_index
(
const
char
*
utf8path
,
unsigned
pos
);
spl_remove_index
(
const
char
*
utf8path
,
unsigned
pos
);
enum
playlist_result
enum
playlist_result
...
...
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