blob: ec492b5566afd2f4401057669f57b58e869fb6fc [file] [log] [blame]
bigbiff bigbiffe60683a2013-02-22 20:55:50 -05001#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
8extern char *mangle(const char *s);
9
10extern void unmangle_to_buffer(const char *s, char *buf, size_t len);
11void unhexmangle_to_buffer(const char *s, char *buf, size_t len);
12
13extern char *unmangle(const char *s, char **end);
14
15static inline void unmangle_string(char *s)
16{
17 unmangle_to_buffer(s, s, strlen(s) + 1);
18}
19
20static inline void unhexmangle_string(char *s)
21{
22 unhexmangle_to_buffer(s, s, strlen(s) + 1);
23}
24
25#endif /* UTIL_LINUX_MANGLE_H */
26