Walking along a path.
More...
How to use
- Find the first/last segment of the path (path_walk_first/path_walk_last)
- Walk forward/backward (path_walk_next/path_walk_prev)
◆ DO_FOREACH_SEGMENT
| #define DO_FOREACH_SEGMENT |
( |
|
_segment, |
|
|
|
_path, |
|
|
|
_body |
|
) |
| |
Value: do { \
do { \
_body; \
} \
} while (0)
bool path_walk_next(path_segment_t *segment)
Retrieve the next segment.
Definition: path.c:138
bool path_walk_first(const path_t *, path_segment_t *)
Retrieve the first segment of a path.
Definition: path.c:98
A single path component.
Definition: path.h:107
- Parameters
-
| _segment | Name of the iterator used by the loop to store the segment |
| _path | The original path |
| _body | The body placed inside the loop |
◆ path_segment_is()
| bool path_segment_is |
( |
const char * |
name, |
|
|
const path_segment_t * |
segment |
|
) |
| |
- Returns
true if the segment name corresponds to the string
◆ path_walk_first()
This function returns the first segment of the path.
- Parameters
-
| path | The path to walk along |
| [out] | segment | Pointer to a struct which the segment will be stored into |
- Returns
false if no segment could be extracted, true otherwise
◆ path_walk_last()
This function returns the last segment of the path.
- Parameters
-
| path | The path to walk along |
| [out] | segment | Pointer to a struct which the segment will be stored into |
- Returns
false if no segment could be extracted, true otherwise
◆ path_walk_next()
- Warning
- The current content inside the segment's struct will be overriden with the information concerning the new segment.
- Parameters
-
| segment | The current segment's information struct |
- Returns
false if there is no next segment, true otherwise
◆ path_walk_prev()
- Warning
- The current content inside the segment's struct will be overriden with the information concerning the new segment.
- Parameters
-
| segment | The current segment's information struct |
- Returns
false if there is no previous segment, true otherwise