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
25f67da5
Commit
25f67da5
authored
Oct 08, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
directory: converted typedef Directory to struct directory
The struct can be forward-declared by other headers, which relaxes the header dependencies.
parent
3c1142cb
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
102 additions
and
87 deletions
+102
-87
dbUtils.c
src/dbUtils.c
+8
-6
directory.c
src/directory.c
+33
-28
directory.h
src/directory.h
+12
-12
dirvec.c
src/dirvec.c
+9
-8
dirvec.h
src/dirvec.h
+4
-4
song.c
src/song.c
+2
-2
song.h
src/song.h
+3
-3
song_save.c
src/song_save.c
+1
-1
song_save.h
src/song_save.h
+1
-1
update.c
src/update.c
+27
-20
update.h
src/update.h
+2
-2
No files found.
src/dbUtils.c
View file @
25f67da5
...
...
@@ -46,8 +46,8 @@ typedef struct _SearchStats {
unsigned
long
playTime
;
}
SearchStats
;
static
int
countSongsInDirectory
(
Directory
*
directory
,
void
*
data
)
static
int
countSongsInDirectory
(
struct
directory
*
directory
,
void
*
data
)
{
int
*
count
=
(
int
*
)
data
;
...
...
@@ -56,7 +56,8 @@ static int countSongsInDirectory(Directory * directory,
return
0
;
}
static
int
printDirectoryInDirectory
(
Directory
*
directory
,
void
*
data
)
static
int
printDirectoryInDirectory
(
struct
directory
*
directory
,
void
*
data
)
{
struct
client
*
client
=
data
;
if
(
directory
->
path
)
{
...
...
@@ -356,15 +357,16 @@ int listAllUniqueTags(struct client *client, int type, int numConditionals,
return
ret
;
}
static
int
sumSavedFilenameMemoryInDirectory
(
Directory
*
dir
,
void
*
data
)
static
int
sumSavedFilenameMemoryInDirectory
(
struct
directory
*
dir
,
void
*
data
)
{
int
*
sum
=
data
;
if
(
!
dir
->
path
)
return
0
;
*
sum
+=
(
strlen
(
getDirectoryPath
(
dir
))
+
1
-
sizeof
(
Directory
*
))
*
dir
->
songs
.
nr
;
*
sum
+=
(
strlen
(
getDirectoryPath
(
dir
))
+
1
-
sizeof
(
struct
directory
*
))
*
dir
->
songs
.
nr
;
return
0
;
}
...
...
src/directory.c
View file @
25f67da5
...
...
@@ -40,11 +40,11 @@
#define DIRECTORY_MPD_VERSION "mpd_version: "
#define DIRECTORY_FS_CHARSET "fs_charset: "
static
D
irectory
*
music_root
;
static
struct
d
irectory
*
music_root
;
static
time_t
directory_dbModTime
;
static
void
deleteEmptyDirectoriesInDirectory
(
D
irectory
*
directory
);
static
void
deleteEmptyDirectoriesInDirectory
(
struct
d
irectory
*
directory
);
static
char
*
getDbFile
(
void
)
{
...
...
@@ -56,12 +56,12 @@ static char *getDbFile(void)
return
param
->
value
;
}
D
irectory
*
newDirectory
(
const
char
*
dirname
,
D
irectory
*
parent
)
struct
d
irectory
*
newDirectory
(
const
char
*
dirname
,
struct
d
irectory
*
parent
)
{
D
irectory
*
directory
;
struct
d
irectory
*
directory
;
directory
=
xcalloc
(
1
,
sizeof
(
D
irectory
));
directory
=
xcalloc
(
1
,
sizeof
(
*
d
irectory
));
if
(
dirname
&&
strlen
(
dirname
))
directory
->
path
=
xstrdup
(
dirname
);
...
...
@@ -71,7 +71,7 @@ newDirectory(const char *dirname, Directory * parent)
}
void
freeDirectory
(
D
irectory
*
directory
)
freeDirectory
(
struct
d
irectory
*
directory
)
{
dirvec_destroy
(
&
directory
->
children
);
songvec_destroy
(
&
directory
->
songs
);
...
...
@@ -82,7 +82,7 @@ freeDirectory(Directory * directory)
/*getDirectoryPath(NULL); */
}
static
void
deleteEmptyDirectoriesInDirectory
(
D
irectory
*
directory
)
static
void
deleteEmptyDirectoriesInDirectory
(
struct
d
irectory
*
directory
)
{
int
i
;
struct
dirvec
*
dv
=
&
directory
->
children
;
...
...
@@ -106,7 +106,7 @@ int isRootDirectory(const char *name)
return
(
!
name
||
name
[
0
]
==
'\0'
||
!
strcmp
(
name
,
"/"
));
}
D
irectory
*
struct
d
irectory
*
directory_get_root
(
void
)
{
assert
(
music_root
!=
NULL
);
...
...
@@ -114,10 +114,11 @@ directory_get_root(void)
return
music_root
;
}
static
Directory
*
getSubDirectory
(
Directory
*
directory
,
const
char
*
name
)
static
struct
directory
*
getSubDirectory
(
struct
directory
*
directory
,
const
char
*
name
)
{
D
irectory
*
cur
=
directory
;
D
irectory
*
found
=
NULL
;
struct
d
irectory
*
cur
=
directory
;
struct
d
irectory
*
found
=
NULL
;
char
*
duplicated
;
char
*
locate
;
...
...
@@ -144,7 +145,7 @@ static Directory *getSubDirectory(Directory * directory, const char *name)
return
found
;
}
D
irectory
*
struct
d
irectory
*
getDirectory
(
const
char
*
name
)
{
return
getSubDirectory
(
music_root
,
name
);
...
...
@@ -164,7 +165,7 @@ static int printDirectoryList(struct client *client, struct dirvec *dv)
int
printDirectoryInfo
(
struct
client
*
client
,
const
char
*
name
)
{
D
irectory
*
directory
;
struct
d
irectory
*
directory
;
if
((
directory
=
getDirectory
(
name
))
==
NULL
)
return
-
1
;
...
...
@@ -176,7 +177,8 @@ int printDirectoryInfo(struct client *client, const char *name)
}
/* TODO error checking */
static
int
writeDirectoryInfo
(
FILE
*
fp
,
Directory
*
directory
)
static
int
writeDirectoryInfo
(
FILE
*
fp
,
struct
directory
*
directory
)
{
struct
dirvec
*
children
=
&
directory
->
children
;
size_t
i
;
...
...
@@ -190,7 +192,7 @@ static int writeDirectoryInfo(FILE * fp, Directory * directory)
}
for
(
i
=
0
;
i
<
children
->
nr
;
++
i
)
{
D
irectory
*
cur
=
children
->
base
[
i
];
struct
d
irectory
*
cur
=
children
->
base
[
i
];
const
char
*
base
=
mpd_basename
(
cur
->
path
);
retv
=
fprintf
(
fp
,
DIRECTORY_DIR
"%s
\n
"
,
base
);
...
...
@@ -209,7 +211,8 @@ static int writeDirectoryInfo(FILE * fp, Directory * directory)
return
0
;
}
static
void
readDirectoryInfo
(
FILE
*
fp
,
Directory
*
directory
)
static
void
readDirectoryInfo
(
FILE
*
fp
,
struct
directory
*
directory
)
{
char
buffer
[
MPD_PATH_MAX
*
2
];
int
bufferSize
=
MPD_PATH_MAX
*
2
;
...
...
@@ -219,7 +222,7 @@ static void readDirectoryInfo(FILE * fp, Directory * directory)
while
(
myFgets
(
buffer
,
bufferSize
,
fp
)
&&
prefixcmp
(
buffer
,
DIRECTORY_END
))
{
if
(
!
prefixcmp
(
buffer
,
DIRECTORY_DIR
))
{
D
irectory
*
subdir
;
struct
d
irectory
*
subdir
;
strcpy
(
key
,
&
(
buffer
[
strlen
(
DIRECTORY_DIR
)]));
if
(
!
myFgets
(
buffer
,
bufferSize
,
fp
))
...
...
@@ -248,7 +251,7 @@ static void readDirectoryInfo(FILE * fp, Directory * directory)
}
void
sortDirectory
(
D
irectory
*
directory
)
sortDirectory
(
struct
d
irectory
*
directory
)
{
int
i
;
struct
dirvec
*
dv
=
&
directory
->
children
;
...
...
@@ -443,10 +446,11 @@ int readDirectoryDB(void)
return
0
;
}
static
int
traverseAllInSubDirectory
(
Directory
*
directory
,
int
(
*
forEachSong
)
(
Song
*
,
void
*
),
int
(
*
forEachDir
)
(
Directory
*
,
void
*
),
void
*
data
)
static
int
traverseAllInSubDirectory
(
struct
directory
*
directory
,
int
(
*
forEachSong
)
(
Song
*
,
void
*
),
int
(
*
forEachDir
)
(
struct
directory
*
,
void
*
),
void
*
data
)
{
struct
dirvec
*
dv
=
&
directory
->
children
;
int
err
=
0
;
...
...
@@ -468,11 +472,12 @@ static int traverseAllInSubDirectory(Directory * directory,
return
err
;
}
int
traverseAllIn
(
const
char
*
name
,
int
(
*
forEachSong
)
(
Song
*
,
void
*
),
int
(
*
forEachDir
)
(
Directory
*
,
void
*
),
void
*
data
)
int
traverseAllIn
(
const
char
*
name
,
int
(
*
forEachSong
)
(
Song
*
,
void
*
),
int
(
*
forEachDir
)
(
struct
directory
*
,
void
*
),
void
*
data
)
{
D
irectory
*
directory
;
struct
d
irectory
*
directory
;
if
((
directory
=
getDirectory
(
name
))
==
NULL
)
{
Song
*
song
;
...
...
@@ -497,7 +502,7 @@ void directory_init(void)
Song
*
getSongFromDB
(
const
char
*
file
)
{
Song
*
song
=
NULL
;
D
irectory
*
directory
;
struct
d
irectory
*
directory
;
char
*
dir
=
NULL
;
char
*
duplicated
=
xstrdup
(
file
);
char
*
shortname
=
strrchr
(
duplicated
,
'/'
);
...
...
src/directory.h
View file @
25f67da5
...
...
@@ -26,19 +26,19 @@
#include <stdbool.h>
struct
dirvec
{
struct
_D
irectory
**
base
;
struct
d
irectory
**
base
;
size_t
nr
;
};
typedef
struct
_D
irectory
{
struct
d
irectory
{
char
*
path
;
struct
dirvec
children
;
struct
songvec
songs
;
struct
_D
irectory
*
parent
;
struct
d
irectory
*
parent
;
ino_t
inode
;
dev_t
device
;
unsigned
stat
;
/* not needed if ino_t == dev_t == 0 is impossible */
}
Directory
;
};
void
directory_init
(
void
);
...
...
@@ -46,26 +46,26 @@ void directory_finish(void);
int
isRootDirectory
(
const
char
*
name
);
D
irectory
*
struct
d
irectory
*
directory_get_root
(
void
);
D
irectory
*
newDirectory
(
const
char
*
dirname
,
D
irectory
*
parent
);
struct
d
irectory
*
newDirectory
(
const
char
*
dirname
,
struct
d
irectory
*
parent
);
void
freeDirectory
(
D
irectory
*
directory
);
freeDirectory
(
struct
d
irectory
*
directory
);
static
inline
bool
directory_is_empty
(
D
irectory
*
directory
)
directory_is_empty
(
struct
d
irectory
*
directory
)
{
return
directory
->
children
.
nr
==
0
&&
directory
->
songs
.
nr
==
0
;
}
D
irectory
*
struct
d
irectory
*
getDirectory
(
const
char
*
name
);
void
sortDirectory
(
D
irectory
*
directory
);
sortDirectory
(
struct
d
irectory
*
directory
);
int
printDirectoryInfo
(
struct
client
*
client
,
const
char
*
dirname
);
...
...
@@ -81,7 +81,7 @@ time_t getDbModTime(void);
int
traverseAllIn
(
const
char
*
name
,
int
(
*
forEachSong
)
(
Song
*
,
void
*
),
int
(
*
forEachDir
)
(
D
irectory
*
,
void
*
),
void
*
data
);
int
(
*
forEachDir
)
(
struct
d
irectory
*
,
void
*
),
void
*
data
);
#define getDirectoryPath(dir) ((dir && dir->path) ? dir->path : "")
...
...
src/dirvec.c
View file @
25f67da5
#include "dirvec.h"
#include "directory.h"
#include "os_compat.h"
#include "utils.h"
static
size_t
dv_size
(
struct
dirvec
*
dv
)
{
return
dv
->
nr
*
sizeof
(
D
irectory
*
);
return
dv
->
nr
*
sizeof
(
struct
d
irectory
*
);
}
/* Only used for sorting/searching a dirvec, not general purpose compares */
static
int
dirvec_cmp
(
const
void
*
d1
,
const
void
*
d2
)
{
const
Directory
*
a
=
((
const
D
irectory
*
const
*
)
d1
)[
0
];
const
Directory
*
b
=
((
const
D
irectory
*
const
*
)
d2
)[
0
];
const
struct
directory
*
a
=
((
const
struct
d
irectory
*
const
*
)
d1
)[
0
];
const
struct
directory
*
b
=
((
const
struct
d
irectory
*
const
*
)
d2
)[
0
];
return
strcmp
(
a
->
path
,
b
->
path
);
}
void
dirvec_sort
(
struct
dirvec
*
dv
)
{
qsort
(
dv
->
base
,
dv
->
nr
,
sizeof
(
D
irectory
*
),
dirvec_cmp
);
qsort
(
dv
->
base
,
dv
->
nr
,
sizeof
(
struct
d
irectory
*
),
dirvec_cmp
);
}
D
irectory
*
dirvec_find
(
struct
dirvec
*
dv
,
const
char
*
path
)
struct
d
irectory
*
dirvec_find
(
struct
dirvec
*
dv
,
const
char
*
path
)
{
int
i
;
...
...
@@ -30,7 +31,7 @@ Directory *dirvec_find(struct dirvec *dv, const char *path)
return
NULL
;
}
int
dirvec_delete
(
struct
dirvec
*
dv
,
D
irectory
*
del
)
int
dirvec_delete
(
struct
dirvec
*
dv
,
struct
d
irectory
*
del
)
{
int
i
;
...
...
@@ -43,7 +44,7 @@ int dirvec_delete(struct dirvec *dv, Directory *del)
dv
->
base
=
NULL
;
}
else
{
memmove
(
&
dv
->
base
[
i
],
&
dv
->
base
[
i
+
1
],
(
dv
->
nr
-
i
+
1
)
*
sizeof
(
D
irectory
*
));
(
dv
->
nr
-
i
+
1
)
*
sizeof
(
struct
d
irectory
*
));
dv
->
base
=
xrealloc
(
dv
->
base
,
dv_size
(
dv
));
}
return
i
;
...
...
@@ -52,7 +53,7 @@ int dirvec_delete(struct dirvec *dv, Directory *del)
return
-
1
;
/* not found */
}
void
dirvec_add
(
struct
dirvec
*
dv
,
D
irectory
*
add
)
void
dirvec_add
(
struct
dirvec
*
dv
,
struct
d
irectory
*
add
)
{
++
dv
->
nr
;
dv
->
base
=
xrealloc
(
dv
->
base
,
dv_size
(
dv
));
...
...
src/dirvec.h
View file @
25f67da5
#ifndef DIRVEC_H
#define DIRVEC_H
#include "directory.h"
struct
dirvec
;
void
dirvec_sort
(
struct
dirvec
*
dv
);
D
irectory
*
dirvec_find
(
struct
dirvec
*
dv
,
const
char
*
path
);
struct
d
irectory
*
dirvec_find
(
struct
dirvec
*
dv
,
const
char
*
path
);
int
dirvec_delete
(
struct
dirvec
*
dv
,
D
irectory
*
del
);
int
dirvec_delete
(
struct
dirvec
*
dv
,
struct
d
irectory
*
del
);
void
dirvec_add
(
struct
dirvec
*
dv
,
D
irectory
*
add
);
void
dirvec_add
(
struct
dirvec
*
dv
,
struct
d
irectory
*
add
);
void
dirvec_destroy
(
struct
dirvec
*
dv
);
...
...
src/song.c
View file @
25f67da5
...
...
@@ -29,7 +29,7 @@
#include "os_compat.h"
Song
*
song_alloc
(
const
char
*
url
,
struct
_D
irectory
*
parent
)
song_alloc
(
const
char
*
url
,
struct
d
irectory
*
parent
)
{
size_t
urllen
;
Song
*
song
;
...
...
@@ -46,7 +46,7 @@ song_alloc(const char *url, struct _Directory *parent)
return
song
;
}
Song
*
newSong
(
const
char
*
url
,
Directory
*
parentDir
)
Song
*
newSong
(
const
char
*
url
,
struct
directory
*
parentDir
)
{
Song
*
song
;
assert
(
*
url
);
...
...
src/song.h
View file @
25f67da5
...
...
@@ -32,15 +32,15 @@ struct client;
typedef
struct
_Song
{
struct
tag
*
tag
;
struct
_D
irectory
*
parentDir
;
struct
d
irectory
*
parentDir
;
time_t
mtime
;
char
url
[
sizeof
(
size_t
)];
}
Song
;
Song
*
song_alloc
(
const
char
*
url
,
struct
_D
irectory
*
parent
);
song_alloc
(
const
char
*
url
,
struct
d
irectory
*
parent
);
Song
*
newSong
(
const
char
*
url
,
struct
_D
irectory
*
parentDir
);
Song
*
newSong
(
const
char
*
url
,
struct
d
irectory
*
parentDir
);
void
freeJustSong
(
Song
*
);
...
...
src/song_save.c
View file @
25f67da5
...
...
@@ -98,7 +98,7 @@ static int matchesAnMpdTagItemKey(char *buffer, int *itemType)
}
void
readSongInfoIntoList
(
FILE
*
fp
,
struct
songvec
*
sv
,
D
irectory
*
parentDir
)
struct
d
irectory
*
parentDir
)
{
char
buffer
[
MPD_PATH_MAX
+
1024
];
int
bufferSize
=
MPD_PATH_MAX
+
1024
;
...
...
src/song_save.h
View file @
25f67da5
...
...
@@ -26,6 +26,6 @@ struct songvec;
void
songvec_save
(
FILE
*
fp
,
struct
songvec
*
sv
);
void
readSongInfoIntoList
(
FILE
*
fp
,
struct
songvec
*
sv
,
struct
_D
irectory
*
parent
);
struct
d
irectory
*
parent
);
#endif
src/update.c
View file @
25f67da5
...
...
@@ -18,6 +18,7 @@
*/
#include "update.h"
#include "directory.h"
#include "log.h"
#include "ls.h"
#include "path.h"
...
...
@@ -53,14 +54,16 @@ int isUpdatingDB(void)
return
(
progress
!=
UPDATE_PROGRESS_IDLE
)
?
update_task_id
:
0
;
}
static
void
directory_set_stat
(
Directory
*
dir
,
const
struct
stat
*
st
)
static
void
directory_set_stat
(
struct
directory
*
dir
,
const
struct
stat
*
st
)
{
dir
->
inode
=
st
->
st_ino
;
dir
->
device
=
st
->
st_dev
;
dir
->
stat
=
1
;
}
static
void
delete_song
(
Directory
*
dir
,
Song
*
del
)
static
void
delete_song
(
struct
directory
*
dir
,
Song
*
del
)
{
/* first, prevent traversers in main task from getting this */
songvec_delete
(
&
dir
->
songs
,
del
);
...
...
@@ -79,7 +82,7 @@ static void delete_song(Directory *dir, Song *del)
struct
delete_data
{
char
*
tmp
;
D
irectory
*
dir
;
struct
d
irectory
*
dir
;
enum
update_return
ret
;
};
...
...
@@ -99,7 +102,7 @@ static int delete_song_if_removed(Song *song, void *_data)
}
static
enum
update_return
removeDeletedFromDirectory
(
char
*
path_max_tmp
,
Directory
*
directory
)
removeDeletedFromDirectory
(
char
*
path_max_tmp
,
struct
directory
*
directory
)
{
enum
update_return
ret
=
UPDATE_RETURN_NOUPDATE
;
int
i
;
...
...
@@ -130,7 +133,8 @@ static const char *opendir_path(char *path_max_tmp, const char *dirname)
return
musicDir
;
}
static
int
statDirectory
(
Directory
*
dir
)
static
int
statDirectory
(
struct
directory
*
dir
)
{
struct
stat
st
;
...
...
@@ -142,7 +146,8 @@ static int statDirectory(Directory * dir)
return
0
;
}
static
int
inodeFoundInParent
(
Directory
*
parent
,
ino_t
inode
,
dev_t
device
)
static
int
inodeFoundInParent
(
struct
directory
*
parent
,
ino_t
inode
,
dev_t
device
)
{
while
(
parent
)
{
if
(
!
parent
->
stat
&&
statDirectory
(
parent
)
<
0
)
...
...
@@ -158,10 +163,10 @@ static int inodeFoundInParent(Directory * parent, ino_t inode, dev_t device)
}
static
enum
update_return
addSubDirectoryToDirectory
(
Directory
*
directory
,
addSubDirectoryToDirectory
(
struct
directory
*
directory
,
const
char
*
name
,
struct
stat
*
st
)
{
D
irectory
*
subDirectory
;
struct
d
irectory
*
subDirectory
;
if
(
inodeFoundInParent
(
directory
,
st
->
st_ino
,
st
->
st_dev
))
return
UPDATE_RETURN_NOUPDATE
;
...
...
@@ -180,7 +185,7 @@ addSubDirectoryToDirectory(Directory * directory,
}
static
enum
update_return
addToDirectory
(
Directory
*
directory
,
const
char
*
name
)
addToDirectory
(
struct
directory
*
directory
,
const
char
*
name
)
{
struct
stat
st
;
...
...
@@ -209,7 +214,7 @@ addToDirectory(Directory * directory, const char *name)
}
static
enum
update_return
updateInDirectory
(
Directory
*
directory
,
const
char
*
name
)
updateInDirectory
(
struct
directory
*
directory
,
const
char
*
name
)
{
Song
*
song
;
struct
stat
st
;
...
...
@@ -230,7 +235,7 @@ updateInDirectory(Directory * directory, const char *name)
return
UPDATE_RETURN_UPDATED
;
}
}
else
if
(
S_ISDIR
(
st
.
st_mode
))
{
D
irectory
*
subdir
=
dirvec_find
(
&
directory
->
children
,
name
);
struct
d
irectory
*
subdir
=
dirvec_find
(
&
directory
->
children
,
name
);
if
(
subdir
)
{
assert
(
directory
==
subdir
->
parent
);
directory_set_stat
(
subdir
,
&
st
);
...
...
@@ -250,7 +255,7 @@ static int skip_path(const char *path)
}
enum
update_return
updateDirectory
(
Directory
*
directory
)
updateDirectory
(
struct
directory
*
directory
)
{
bool
was_empty
=
directory_is_empty
(
directory
);
DIR
*
dir
;
...
...
@@ -301,12 +306,13 @@ updateDirectory(Directory * directory)
return
ret
;
}
static
Directory
*
addDirectoryPathToDB
(
const
char
*
utf8path
)
static
struct
directory
*
addDirectoryPathToDB
(
const
char
*
utf8path
)
{
char
path_max_tmp
[
MPD_PATH_MAX
];
char
*
parent
;
D
irectory
*
parentDirectory
;
D
irectory
*
directory
;
struct
d
irectory
*
parentDirectory
;
struct
d
irectory
*
directory
;
Song
*
conflicting
;
parent
=
parent_path
(
path_max_tmp
,
utf8path
);
...
...
@@ -342,11 +348,12 @@ static Directory *addDirectoryPathToDB(const char *utf8path)
return
directory
;
}
static
Directory
*
addParentPathToDB
(
const
char
*
utf8path
)
static
struct
directory
*
addParentPathToDB
(
const
char
*
utf8path
)
{
char
*
parent
;
char
path_max_tmp
[
MPD_PATH_MAX
];
D
irectory
*
parentDirectory
;
struct
d
irectory
*
parentDirectory
;
parent
=
parent_path
(
path_max_tmp
,
utf8path
);
...
...
@@ -358,13 +365,13 @@ static Directory *addParentPathToDB(const char *utf8path)
if
(
!
parentDirectory
)
return
NULL
;
return
(
D
irectory
*
)
parentDirectory
;
return
(
struct
d
irectory
*
)
parentDirectory
;
}
static
enum
update_return
updatePath
(
const
char
*
utf8path
)
{
D
irectory
*
directory
;
D
irectory
*
parentDirectory
;
struct
d
irectory
*
directory
;
struct
d
irectory
*
parentDirectory
;
Song
*
song
;
char
*
path
=
sanitizePathDup
(
utf8path
);
time_t
mtime
;
...
...
src/update.h
View file @
25f67da5
...
...
@@ -20,7 +20,7 @@
#ifndef UPDATE_H
#define UPDATE_H
#include "directory.h"
struct
directory
;
enum
update_return
{
UPDATE_RETURN_ERROR
=
-
1
,
...
...
@@ -31,7 +31,7 @@ enum update_return {
int
isUpdatingDB
(
void
);
enum
update_return
updateDirectory
(
Directory
*
directory
);
updateDirectory
(
struct
directory
*
directory
);
/*
* returns the non-negative update job ID on success,
...
...
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