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
3b6ff843
Commit
3b6ff843
authored
Oct 13, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
directory: added directory_get_name()
directory_get_name() returns the base name of the directory.
parent
bc85e92a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
directory.c
src/directory.c
+7
-0
directory.h
src/directory.h
+6
-0
No files found.
src/directory.c
View file @
3b6ff843
...
...
@@ -18,6 +18,7 @@
#include "directory.h"
#include "utils.h"
#include "path.h"
#include <assert.h>
#include <string.h>
...
...
@@ -49,6 +50,12 @@ directory_free(struct directory *directory)
/*directory_get_path(NULL); */
}
const
char
*
directory_get_name
(
const
struct
directory
*
directory
)
{
return
mpd_basename
(
directory
->
path
);
}
void
directory_prune_empty
(
struct
directory
*
directory
)
{
...
...
src/directory.h
View file @
3b6ff843
...
...
@@ -68,6 +68,12 @@ directory_get_path(const struct directory *directory)
return
directory
->
path
;
}
/**
* Returns the base name of the directory.
*/
const
char
*
directory_get_name
(
const
struct
directory
*
directory
);
static
inline
struct
directory
*
directory_get_child
(
const
struct
directory
*
directory
,
const
char
*
name
)
{
...
...
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