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
f2525e3e
Commit
f2525e3e
authored
Oct 21, 2008
by
Eric Wong
Committed by
Max Kellermann
Oct 21, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dirvec: add dirvec_for_each iterator
This will make it easier to introduce locking
parent
1d385190
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
dirvec.c
src/dirvec.c
+16
-0
dirvec.h
src/dirvec.h
+3
-0
No files found.
src/dirvec.c
View file @
f2525e3e
...
...
@@ -78,3 +78,19 @@ void dirvec_destroy(struct dirvec *dv)
}
dv
->
nr
=
0
;
}
int
dirvec_for_each
(
const
struct
dirvec
*
dv
,
int
(
*
fn
)(
struct
directory
*
,
void
*
),
void
*
arg
)
{
size_t
i
;
for
(
i
=
0
;
i
<
dv
->
nr
;
++
i
)
{
struct
directory
*
dir
=
dv
->
base
[
i
];
assert
(
dir
);
if
(
fn
(
dir
,
arg
)
<
0
)
return
-
1
;
}
return
0
;
}
src/dirvec.h
View file @
f2525e3e
...
...
@@ -24,4 +24,7 @@ dirvec_clear(struct dirvec *dv)
void
dirvec_destroy
(
struct
dirvec
*
dv
);
int
dirvec_for_each
(
const
struct
dirvec
*
dv
,
int
(
*
fn
)(
struct
directory
*
,
void
*
),
void
*
arg
);
#endif
/* DIRVEC_H */
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