From 4d043c99dc49022e10a940b26ed9bc469581926f Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Sat, 27 Jun 2015 10:22:29 +0200 Subject: Extend `BLI_str_partition_ex`: add possibility to define a right limit to the string. Now you can define `end` pointer as right limit of the string (allows to easily search in substring, especially useful when searching from right). --- source/blender/blenlib/BLI_string.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/blender/blenlib/BLI_string.h') diff --git a/source/blender/blenlib/BLI_string.h b/source/blender/blenlib/BLI_string.h index e6c1cc8b4b6..a94777d278b 100644 --- a/source/blender/blenlib/BLI_string.h +++ b/source/blender/blenlib/BLI_string.h @@ -92,7 +92,9 @@ bool BLI_strn_endswith(const char *__restrict str, const char *__restrict end, s size_t BLI_str_partition(const char *str, const char delim[], char **sep, char **suf) ATTR_NONNULL(); size_t BLI_str_rpartition(const char *str, const char delim[], char **sep, char **suf) ATTR_NONNULL(); -size_t BLI_str_partition_ex(const char *str, const char delim[], char **sep, char **suf, const bool from_right) ATTR_NONNULL(); +size_t BLI_str_partition_ex( + const char *str, const char *end, const char delim[], char **sep, char **suf, const bool from_right) + ATTR_NONNULL(1, 3, 4, 5); #ifdef __cplusplus } -- cgit v1.2.3