Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
steam-runtime-tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
steamrt
steam-runtime-tools
Commits
0885d673
Commit
0885d673
authored
10 years ago
by
Colin Walters
Browse files
Options
Downloads
Patches
Plain Diff
dirfd: Add some gtk-doc
parent
a90e1c34
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
glnx-dirfd.c
+48
-11
48 additions, 11 deletions
glnx-dirfd.c
with
48 additions
and
11 deletions
glnx-dirfd.c
+
48
−
11
View file @
0885d673
...
...
@@ -80,12 +80,22 @@ struct GLnxRealDirfdIterator
};
typedef
struct
GLnxRealDirfdIterator
GLnxRealDirfdIterator
;
/**
* glnx_dirfd_iterator_init_at:
* @dfd: File descriptor, may be AT_FDCWD or -1
* @path: Path, may be relative to @df
* @follow: If %TRUE and the last component of @path is a symlink, follow it
* @out_dfd_iter: (out caller-allocates): A directory iterator, will be initialized
* @error: Error
*
* Initialize @out_dfd_iter from @dfd and @path.
*/
gboolean
glnx_dirfd_iterator_init_at
(
int
dfd
,
const
char
*
path
,
gboolean
follow
,
GLnxDirFdIterator
*
dfd_iter
,
GError
**
error
)
glnx_dirfd_iterator_init_at
(
int
dfd
,
const
char
*
path
,
gboolean
follow
,
GLnxDirFdIterator
*
out_
dfd_iter
,
GError
**
error
)
{
gboolean
ret
=
FALSE
;
glnx_fd_close
int
fd
=
-
1
;
...
...
@@ -102,10 +112,19 @@ glnx_dirfd_iterator_init_at (int dfd,
return
ret
;
}
/**
* glnx_dirfd_iterator_init_take_fd:
* @dfd: File descriptor - ownership is taken
* @dfd_iter: A directory iterator
* @error: Error
*
* Steal ownership of @dfd, using it to initialize @dfd_iter for
* iteration.
*/
gboolean
glnx_dirfd_iterator_init_take_fd
(
int
dfd
,
glnx_dirfd_iterator_init_take_fd
(
int
dfd
,
GLnxDirFdIterator
*
dfd_iter
,
GError
**
error
)
GError
**
error
)
{
gboolean
ret
=
FALSE
;
GLnxRealDirfdIterator
*
real_dfd_iter
=
(
GLnxRealDirfdIterator
*
)
dfd_iter
;
...
...
@@ -126,11 +145,22 @@ glnx_dirfd_iterator_init_take_fd (int dfd,
return
ret
;
}
/**
* glnx_dirfd_iterator_next_dent:
* @dfd_iter: A directory iterator
* @out_dent: (out) (transfer none): Pointer to dirent; do not free
* @cancellable: Cancellable
* @error: Error
*
* Read the next value from @dfd_iter, causing @out_dent to be
* updated. If end of stream is reached, @out_dent will be set
* to %NULL, and %TRUE will be returned.
*/
gboolean
glnx_dirfd_iterator_next_dent
(
GLnxDirFdIterator
*
dfd_iter
,
struct
dirent
**
out_dent
,
GCancellable
*
cancellable
,
GError
**
error
)
struct
dirent
**
out_dent
,
GCancellable
*
cancellable
,
GError
**
error
)
{
gboolean
ret
=
FALSE
;
GLnxRealDirfdIterator
*
real_dfd_iter
=
(
GLnxRealDirfdIterator
*
)
dfd_iter
;
...
...
@@ -156,10 +186,17 @@ glnx_dirfd_iterator_next_dent (GLnxDirFdIterator *dfd_iter,
return
ret
;
}
/**
* glnx_dirfd_iterator_clear:
* @dfd_iter: Iterator, will be de-initialized
*
* Unset @dfd_iter, freeing any resources. If @dfd_iter is not
* initialized, do nothing.
*/
void
glnx_dirfd_iterator_clear
(
GLnxDirFdIterator
*
dfd_iter
)
{
GLnxRealDirfdIterator
*
real_dfd_iter
=
(
GLnxRealDir
fd
Iterator
*
)
dfd_iter
;
GLnxRealDirfdIterator
*
real_dfd_iter
=
(
GLnxRealDirIterator
*
)
dfd_iter
;
/* fd is owned by dfd_iter */
(
void
)
closedir
(
real_dfd_iter
->
d
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment