string-utils.h 514 B

1234567891011121314151617181920212223
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright 2023 Red Hat
  4. */
  5. #ifndef VDO_STRING_UTILS_H
  6. #define VDO_STRING_UTILS_H
  7. #include <linux/kernel.h>
  8. #include <linux/string.h>
  9. /* Utilities related to string manipulation */
  10. static inline const char *vdo_bool_to_string(bool value)
  11. {
  12. return value ? "true" : "false";
  13. }
  14. /* Append a formatted string to the end of a buffer. */
  15. char *vdo_append_to_buffer(char *buffer, char *buf_end, const char *fmt, ...)
  16. __printf(3, 4);
  17. #endif /* VDO_STRING_UTILS_H */