WIP: Vulkan: Workbench #107886
|
@ -114,6 +114,16 @@ size_t BLI_strcpy_rlen(char *__restrict dst, const char *__restrict src) ATTR_WA
|
|||
char *BLI_strncat(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy)
|
||||
ATTR_NONNULL(1, 2);
|
||||
|
||||
/**
|
||||
* A version of `strchr` that returns the end of the string (point to `\0`)
|
||||
* if the character is not found.
|
||||
*
|
||||
* Useful for stepping over newlines up until the last line.
|
||||
*/
|
||||
const char *BLI_strchr_or_end(const char *str,
|
||||
char ch) ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL
|
||||
ATTR_NONNULL(1);
|
||||
|
||||
/**
|
||||
* Return the range of the quoted string (excluding quotes) `str` after `prefix`.
|
||||
*
|
||||
|
|
|
@ -988,6 +988,21 @@ size_t BLI_strnlen(const char *s, const size_t maxlen)
|
|||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name String Scanning
|
||||
* \{ */
|
||||
|
||||
const char *BLI_strchr_or_end(const char *str, const char ch)
|
||||
{
|
||||
const char *p = str;
|
||||
while (!ELEM(*p, ch, '\0')) {
|
||||
p++;
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name String Case Conversion
|
||||
* \{ */
|
||||
|
|
Loading…
Reference in New Issue