labwc/include/common/string-helpers.h

20 lines
553 B
C
Raw Permalink Normal View History

2021-11-13 21:56:53 +00:00
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef __LABWC_STRING_HELPERS_H
2020-10-09 19:46:59 +01:00
#define __LABWC_STRING_HELPERS_H
/**
* string_strip - strip white space left and right
* Note: this function does a left skip, so the returning pointer cannot be
* used to free any allocated memory
*/
char *string_strip(char *s);
/**
* string_truncate_at_pattern - remove pattern and everything after it
* @buf: pointer to buffer
* @pattern: string to remove
*/
void string_truncate_at_pattern(char *buf, const char *pattern);
#endif /* __LABWC_STRING_HELPERS_H */