Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
9cde8a8a
Unverified
Commit
9cde8a8a
authored
Jan 26, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
string_utils: add must_make_path_relative()
Stolen without shame from my previous implementation in LXCFS. Cc: stable-4.0 Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
d23cb29e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
string_utils.h
src/lxc/string_utils.h
+10
-0
No files found.
src/lxc/string_utils.h
View file @
9cde8a8a
...
@@ -87,6 +87,16 @@ __hidden __attribute__((sentinel)) extern char *must_concat(size_t *len, const c
...
@@ -87,6 +87,16 @@ __hidden __attribute__((sentinel)) extern char *must_concat(size_t *len, const c
__hidden
__attribute__
((
sentinel
))
extern
char
*
must_make_path
(
const
char
*
first
,
...);
__hidden
__attribute__
((
sentinel
))
extern
char
*
must_make_path
(
const
char
*
first
,
...);
__hidden
__attribute__
((
sentinel
))
extern
char
*
must_append_path
(
char
*
first
,
...);
__hidden
__attribute__
((
sentinel
))
extern
char
*
must_append_path
(
char
*
first
,
...);
#define must_make_path_relative(__first__, ...) \
({ \
char *__ptr__; \
if (*__first__ == '/') \
__ptr__ = must_make_path(".", __first__, __VA_ARGS__); \
else \
__ptr__ = must_make_path(__first__, __VA_ARGS__); \
__ptr__; \
})
/* Return copy of string @entry. Do not fail. */
/* Return copy of string @entry. Do not fail. */
__hidden
extern
char
*
must_copy_string
(
const
char
*
entry
);
__hidden
extern
char
*
must_copy_string
(
const
char
*
entry
);
...
...
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