bigbiff bigbiff | e60683a | 2013-02-22 20:55:50 -0500 | [diff] [blame] | 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 | void unhexmangle_to_buffer(const char *s, char *buf, size_t len); |
| 12 | |
| 13 | extern char *unmangle(const char *s, char **end); |
| 14 | |
| 15 | static inline void unmangle_string(char *s) |
| 16 | { |
| 17 | unmangle_to_buffer(s, s, strlen(s) + 1); |
| 18 | } |
| 19 | |
| 20 | static 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 | |