2023-11-16 19:44:01 -05:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
/*
|
|
|
|
* Copyright 2023 Red Hat
|
|
|
|
*/
|
|
|
|
|
2024-02-14 09:34:46 -06:00
|
|
|
#ifndef VDO_STRING_UTILS_H
|
|
|
|
#define VDO_STRING_UTILS_H
|
2023-11-16 19:44:01 -05:00
|
|
|
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/string.h>
|
|
|
|
|
|
|
|
/* Utilities related to string manipulation */
|
|
|
|
|
2024-02-14 09:34:46 -06:00
|
|
|
static inline const char *vdo_bool_to_string(bool value)
|
2023-11-16 19:44:01 -05:00
|
|
|
{
|
|
|
|
return value ? "true" : "false";
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Append a formatted string to the end of a buffer. */
|
2024-02-14 09:34:46 -06:00
|
|
|
char *vdo_append_to_buffer(char *buffer, char *buf_end, const char *fmt, ...)
|
2023-11-16 19:44:01 -05:00
|
|
|
__printf(3, 4);
|
|
|
|
|
2024-02-14 09:34:46 -06:00
|
|
|
#endif /* VDO_STRING_UTILS_H */
|