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
36ec2eda
Commit
36ec2eda
authored
Apr 01, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
directory: renamed directory_get_directory()
Renamed directory_get_directory() to directory_lookup_directory(). Added API documentation.
parent
932f70da
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
6 deletions
+13
-6
database.c
src/database.c
+1
-1
directory.c
src/directory.c
+4
-4
directory.h
src/directory.h
+8
-1
No files found.
src/database.c
View file @
36ec2eda
...
@@ -104,7 +104,7 @@ db_get_directory(const char *name)
...
@@ -104,7 +104,7 @@ db_get_directory(const char *name)
if
(
name
==
NULL
)
if
(
name
==
NULL
)
return
music_root
;
return
music_root
;
return
directory_
get
_directory
(
music_root
,
name
);
return
directory_
lookup
_directory
(
music_root
,
name
);
}
}
struct
song
*
struct
song
*
...
...
src/directory.c
View file @
36ec2eda
...
@@ -82,19 +82,19 @@ directory_prune_empty(struct directory *directory)
...
@@ -82,19 +82,19 @@ directory_prune_empty(struct directory *directory)
}
}
struct
directory
*
struct
directory
*
directory_
get_directory
(
struct
directory
*
directory
,
const
char
*
name
)
directory_
lookup_directory
(
struct
directory
*
directory
,
const
char
*
uri
)
{
{
struct
directory
*
cur
=
directory
;
struct
directory
*
cur
=
directory
;
struct
directory
*
found
=
NULL
;
struct
directory
*
found
=
NULL
;
char
*
duplicated
;
char
*
duplicated
;
char
*
locate
;
char
*
locate
;
assert
(
name
!=
NULL
);
assert
(
uri
!=
NULL
);
if
(
isRootDirectory
(
name
))
if
(
isRootDirectory
(
uri
))
return
directory
;
return
directory
;
duplicated
=
g_strdup
(
name
);
duplicated
=
g_strdup
(
uri
);
locate
=
strchr
(
duplicated
,
'/'
);
locate
=
strchr
(
duplicated
,
'/'
);
while
(
1
)
{
while
(
1
)
{
if
(
locate
)
if
(
locate
)
...
...
src/directory.h
View file @
36ec2eda
...
@@ -98,8 +98,15 @@ directory_new_child(struct directory *directory, const char *name)
...
@@ -98,8 +98,15 @@ directory_new_child(struct directory *directory, const char *name)
void
void
directory_prune_empty
(
struct
directory
*
directory
);
directory_prune_empty
(
struct
directory
*
directory
);
/**
* Looks up a directory by its relative URI.
*
* @param directory the parent (or grandparent, ...) directory
* @param uri the relative URI
* @return the directory, or NULL if none was found
*/
struct
directory
*
struct
directory
*
directory_
get_directory
(
struct
directory
*
directory
,
const
char
*
name
);
directory_
lookup_directory
(
struct
directory
*
directory
,
const
char
*
uri
);
void
void
directory_sort
(
struct
directory
*
directory
);
directory_sort
(
struct
directory
*
directory
);
...
...
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