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
438b56f0
Commit
438b56f0
authored
Sep 07, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ls: don't pass "fd" to lsPlaylists(), printRemoteUrlHandlers()
Pass the client struct instead of the raw file descriptor.
parent
4665f2bf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
10 deletions
+12
-10
command.c
src/command.c
+2
-2
ls.c
src/ls.c
+6
-6
ls.h
src/ls.h
+4
-2
No files found.
src/command.c
View file @
438b56f0
...
...
@@ -300,7 +300,7 @@ static void addCommand(const char *name,
static
int
handleUrlHandlers
(
struct
client
*
client
,
mpd_unused
int
*
permission
,
mpd_unused
int
argc
,
mpd_unused
char
*
argv
[])
{
return
printRemoteUrlHandlers
(
client
_get_fd
(
client
)
);
return
printRemoteUrlHandlers
(
client
);
}
static
int
handleTagTypes
(
struct
client
*
client
,
mpd_unused
int
*
permission
,
...
...
@@ -601,7 +601,7 @@ static int handleLsInfo(struct client *client, mpd_unused int *permission,
}
if
(
isRootDirectory
(
path
))
return
lsPlaylists
(
client
_get_fd
(
client
)
,
path
);
return
lsPlaylists
(
client
,
path
);
return
0
;
}
...
...
src/ls.c
View file @
438b56f0
...
...
@@ -19,7 +19,7 @@
#include "ls.h"
#include "playlist.h"
#include "path.h"
#include "
myfprintf
.h"
#include "
client
.h"
#include "log.h"
#include "utf8.h"
#include "utils.h"
...
...
@@ -30,12 +30,12 @@ static const char *remoteUrlPrefixes[] = {
NULL
};
int
printRemoteUrlHandlers
(
int
fd
)
int
printRemoteUrlHandlers
(
struct
client
*
client
)
{
const
char
**
prefixes
=
remoteUrlPrefixes
;
while
(
*
prefixes
)
{
fdprintf
(
fd
,
"handler: %s
\n
"
,
*
prefixes
);
client_printf
(
client
,
"handler: %s
\n
"
,
*
prefixes
);
prefixes
++
;
}
...
...
@@ -98,7 +98,7 @@ int isRemoteUrl(const char *url)
return
0
;
}
int
lsPlaylists
(
int
fd
,
const
char
*
utf8path
)
int
lsPlaylists
(
struct
client
*
client
,
const
char
*
utf8path
)
{
DIR
*
dir
;
struct
stat
st
;
...
...
@@ -168,8 +168,8 @@ int lsPlaylists(int fd, const char *utf8path)
node
=
list
->
firstNode
;
while
(
node
!=
NULL
)
{
if
(
!
strchr
(
node
->
key
,
'\n'
))
{
fdprintf
(
fd
,
"playlist: %s%s
\n
"
,
duplicated
,
node
->
key
);
client_printf
(
client
,
"playlist: %s%s
\n
"
,
duplicated
,
node
->
key
);
}
node
=
node
->
nextNode
;
}
...
...
src/ls.h
View file @
438b56f0
...
...
@@ -21,7 +21,9 @@
#include "decoder_list.h"
int
lsPlaylists
(
int
fd
,
const
char
*
utf8path
);
struct
client
;
int
lsPlaylists
(
struct
client
*
client
,
const
char
*
utf8path
);
const
char
*
getSuffix
(
const
char
*
utf8file
);
...
...
@@ -40,7 +42,7 @@ struct decoder_plugin *hasMusicSuffix(const char *utf8file, unsigned int next);
struct
decoder_plugin
*
isMusic
(
const
char
*
utf8file
,
time_t
*
mtime
,
unsigned
int
next
);
int
printRemoteUrlHandlers
(
int
fd
);
int
printRemoteUrlHandlers
(
struct
client
*
client
);
int
isFile
(
const
char
*
utf8file
,
time_t
*
mtime
);
...
...
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