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
598162e3
Commit
598162e3
authored
Jun 21, 2004
by
Warren Dukes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
todo update
git-svn-id:
https://svn.musicpd.org/mpd/trunk@1597
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
49455434
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
41 deletions
+30
-41
TODO
TODO
+4
-0
ls.c
src/ls.c
+19
-40
ls.h
src/ls.h
+7
-1
No files found.
TODO
View file @
598162e3
*) deal with recursive symlinks
*) only check symbolic links when updating adding!
*) don't keep track of inodes or devices in db
*) use inodes and devices for checking for recursive symlinks on the fly
*) implement this in updateDirectoryDb and exploreDirectory
*) Optimize read() on cleints
...
...
src/ls.c
View file @
598162e3
...
...
@@ -190,14 +190,19 @@ int lsPlaylists(FILE * fp, char * utf8path) {
return
0
;
}
int
isFile
(
char
*
utf8file
,
time_t
*
mtime
)
{
struct
stat
st
;
int
myStat
(
char
*
utf8file
,
struct
stat
*
st
)
{
char
*
file
=
utf8ToFsCharset
(
utf8file
);
char
*
actualFile
=
file
;
if
(
actualFile
[
0
]
!=
'/'
)
actualFile
=
rmp2amp
(
file
);
if
(
stat
(
actualFile
,
&
st
)
==
0
)
{
return
stat
(
actualFile
,
st
);
}
int
isFile
(
char
*
utf8file
,
time_t
*
mtime
)
{
struct
stat
st
;
if
(
myStat
(
utf8file
,
&
st
))
{
if
(
S_ISREG
(
st
.
st_mode
))
{
if
(
mtime
)
*
mtime
=
st
.
st_mtime
;
return
1
;
...
...
@@ -233,57 +238,31 @@ int isPlaylist(char * utf8file) {
return
0
;
}
int
hasWaveSuffix
(
char
*
utf8file
)
{
return
hasSuffix
(
utf8file
,
"wav"
);
}
int
hasFlacSuffix
(
char
*
utf8file
)
{
return
hasSuffix
(
utf8file
,
"flac"
);
}
int
hasOggSuffix
(
char
*
utf8file
)
{
return
hasSuffix
(
utf8file
,
"ogg"
);
}
int
hasAacSuffix
(
char
*
utf8file
)
{
return
hasSuffix
(
utf8file
,
"aac"
);
}
int
hasMp4Suffix
(
char
*
utf8file
)
{
if
(
hasSuffix
(
utf8file
,
"mp4"
))
return
1
;
if
(
hasSuffix
(
utf8file
,
"m4a"
))
return
1
;
return
0
;
}
int
hasMp3Suffix
(
char
*
utf8file
)
{
return
hasSuffix
(
utf8file
,
"mp3"
);
}
int
isDir
(
char
*
utf8name
)
{
struct
stat
st
;
if
(
stat
(
rmp2amp
(
utf8ToFsCharset
(
utf8name
))
,
&
st
)
==
0
)
{
if
(
myStat
(
utf8name
,
&
st
)
==
0
)
{
if
(
S_ISDIR
(
st
.
st_mode
))
{
return
1
;
}
}
else
{
DEBUG
(
"isDir: unable to stat: %s (%s)
\n
"
,
utf8name
,
rmp2amp
(
utf8ToFsCharset
(
utf8name
)));
}
return
0
;
}
InputPlugin
*
isMusic
(
char
*
utf8file
,
time_t
*
mtim
e
)
{
InputPlugin
*
hasMusicSuffix
(
char
*
utf8fil
e
)
{
InputPlugin
*
ret
=
NULL
;
if
(
isFile
(
utf8file
,
mtime
))
{
char
*
s
=
getSuffix
(
utf8file
);
if
(
s
)
ret
=
getInputPluginFromSuffix
(
s
);
}
char
*
s
=
getSuffix
(
utf8file
);
if
(
s
)
ret
=
getInputPluginFromSuffix
(
s
);
return
ret
;
}
/* vim:set shiftwidth=4 tabstop=8 expandtab: */
InputPlugin
*
isMusic
(
char
*
utf8file
,
time_t
*
mtime
)
{
if
(
isFile
(
utf8file
,
mtime
))
{
return
hasMusicSuffix
(
utf8file
);
}
return
NULL
;
}
src/ls.h
View file @
598162e3
...
...
@@ -24,6 +24,9 @@
#include "inputPlugin.h"
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <time.h>
int
lsPlaylists
(
FILE
*
fp
,
char
*
utf8path
);
...
...
@@ -34,12 +37,16 @@ int isValidRemoteUtf8Url(char * utf8url);
int
isRemoteUrl
(
char
*
url
);
int
myStat
(
char
*
utf8file
,
struct
stat
*
st
);
int
isFile
(
char
*
utf8file
,
time_t
*
mtime
);
int
isDir
(
char
*
utf8name
);
int
isPlaylist
(
char
*
utf8file
);
InputPlugin
*
hasMusicSuffix
(
char
*
utf8file
);
InputPlugin
*
isMusic
(
char
*
utf8file
,
time_t
*
mtime
);
char
*
dupAndStripPlaylistSuffix
(
char
*
file
);
...
...
@@ -47,4 +54,3 @@ char * dupAndStripPlaylistSuffix(char * file);
int
printRemoteUrlHandlers
(
FILE
*
fp
);
#endif
/* vim:set shiftwidth=4 tabstop=8 expandtab: */
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