]> git.ipfire.org Git - thirdparty/util-linux.git/blob - include/mangle.h
sfdisk: avoid unneeded empty lines with '--list-free'
[thirdparty/util-linux.git] / include / mangle.h
1 #ifndef UTIL_LINUX_MANGLE_H
2 #define UTIL_LINUX_MANGLE_H
3
4 /*
5 * Functions for \oct encoding used in mtab/fstab/swaps/etc.
6 */
7
8 extern char *mangle(const char *s);
9
10 extern void unmangle_to_buffer(const char *s, char *buf, size_t len);
11 extern size_t unhexmangle_to_buffer(const char *s, char *buf, size_t len);
12
13 extern char *unmangle(const char *s, const char **end);
14
15 static inline void unmangle_string(char *s)
16 {
17 if (s)
18 unmangle_to_buffer(s, s, strlen(s) + 1);
19 }
20
21 static inline void unhexmangle_string(char *s)
22 {
23 if (s)
24 unhexmangle_to_buffer(s, s, strlen(s) + 1);
25 }
26
27 #endif /* UTIL_LINUX_MANGLE_H */
28