Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-09-06 08:51:53 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-09-06 08:51:53 +0300
commit3e44592cb9f93b0f5b443c03c7d9103f28dba1a0 (patch)
tree8d1757fcadb2a66a7ab674ae3defa04f216a06f8 /source/blender/blenlib
parent58632a7f3c0f1be6cc860c7cad9c41ba43e6454f (diff)
Cleanup: comment unused functions
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/BLI_string.h2
-rw-r--r--source/blender/blenlib/intern/string.c20
2 files changed, 21 insertions, 1 deletions
diff --git a/source/blender/blenlib/BLI_string.h b/source/blender/blenlib/BLI_string.h
index eab39433796..d3dc05edd9e 100644
--- a/source/blender/blenlib/BLI_string.h
+++ b/source/blender/blenlib/BLI_string.h
@@ -62,9 +62,11 @@ bool BLI_str_quoted_substr_range(const char *__restrict str,
int *__restrict r_start,
int *__restrict r_end) ATTR_WARN_UNUSED_RESULT
ATTR_NONNULL(1, 2, 3, 4);
+#if 0 /* UNUSED */
char *BLI_str_quoted_substrN(const char *__restrict str,
const char *__restrict prefix) ATTR_WARN_UNUSED_RESULT
ATTR_NONNULL() ATTR_MALLOC;
+#endif
bool BLI_str_quoted_substr(const char *__restrict str,
const char *__restrict prefix,
char *result,
diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c
index fab5e44de25..0ea784c95b0 100644
--- a/source/blender/blenlib/intern/string.c
+++ b/source/blender/blenlib/intern/string.c
@@ -509,8 +509,12 @@ bool BLI_str_quoted_substr_range(const char *__restrict str,
return true;
}
+/* NOTE(@campbellbarton): in principal it should be possible to access a quoted string
+ * with an arbitrary size, currently all callers for this functionality
+ * happened to use a fixed size buffer, so only #BLI_str_quoted_substr is needed. */
+#if 0
/**
- * Makes a copy of the text within the "" that appear after some text `blahblah`.
+ * Makes a copy of the text within the "" that appear after the contents of \a prefix.
* i.e. for string `pose["apples"]` with prefix `pose[`, it will return `apples`.
*
* \param str: is the entire string to chop.
@@ -533,7 +537,21 @@ char *BLI_str_quoted_substrN(const char *__restrict str, const char *__restrict
}
return result;
}
+#endif
+/**
+ * Fills \a result with text within "" that appear after some the contents of \a prefix.
+ * i.e. for string `pose["apples"]` with prefix `pose[`, it will return `apples`.
+ *
+ * \param str: is the entire string to chop.
+ * \param prefix: is the part of the string to step over.
+ * \param result: The buffer to fill.
+ * \param result_maxlen: The maximum size of the buffer (including nil terminator).
+ * \return True if the prefix was found and the entire quoted string was copied into result.
+ *
+ * Assume that the strings returned must be freed afterwards,
+ * and that the inputs will contain data we want.
+ */
bool BLI_str_quoted_substr(const char *__restrict str,
const char *__restrict prefix,
char *result,