* \param str The string to be duplicated
* \retval Returns the duplicated string
*/
-char *BLI_strdup(const char *str);
+char *BLI_strdup(const char *str)
+#ifdef __GNUC__
+__attribute__((warn_unused_result))
+__attribute__((nonnull))
+#endif
+;
/**
* Duplicates the first \a len bytes of cstring \a str
* \param len The number of bytes to duplicate
* \retval Returns the duplicated string
*/
-char *BLI_strdupn(const char *str, const size_t len);
+char *BLI_strdupn(const char *str, const size_t len)
+#ifdef __GNUC__
+__attribute__((warn_unused_result))
+__attribute__((nonnull))
+#endif
+;
/**
* Appends the two strings, and returns new mallocN'ed string
* \param str2 second string for append
* \retval Returns dst
*/
-char *BLI_strdupcat(const char *str1, const char *str2);
+char *BLI_strdupcat(const char *str1, const char *str2)
+#ifdef __GNUC__
+__attribute__((warn_unused_result))
+__attribute__((nonnull))
+#endif
+;
/**
* Like strncpy but ensures dst is always
* the size of dst)
* \retval Returns dst
*/
-char *BLI_strncpy(char *dst, const char *src, const size_t maxncpy);
+char *BLI_strncpy(char *dst, const char *src, const size_t maxncpy)
+#ifdef __GNUC__
+__attribute__((nonnull))
+#endif
+;
-/* 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 some text 'blahblah'
* i.e. for string 'pose["apples"]' with prefix 'pose[', it should grab "apples"
*
* - str: is the entire string to chop
* Assume that the strings returned must be freed afterwards, and that the inputs will contain
* data we want...
*/
-char *BLI_getQuotedStr(const char *str, const char *prefix);
+char *BLI_getQuotedStr(const char *str, const char *prefix)
+#ifdef __GNUC__
+__attribute__((warn_unused_result))
+__attribute__((nonnull))
+#endif
+;
/**
* Returns a copy of the cstring \a str into a newly mallocN'd
* \param newText The text in the string to find and replace
* \retval Returns the duplicated string
*/
-char *BLI_replacestr(char *str, const char *oldText, const char *newText);
+char *BLI_replacestr(char *str, const char *oldText, const char *newText)
+#ifdef __GNUC__
+__attribute__((warn_unused_result))
+__attribute__((nonnull))
+#endif
+;
/*
* Replacement for snprintf
size_t BLI_snprintf(char *buffer, size_t len, const char *format, ...)
#ifdef __GNUC__
__attribute__ ((format(printf, 3, 4)))
+__attribute__((nonnull))
#endif
;
char *BLI_sprintfN(const char *format, ...)
#ifdef __GNUC__
__attribute__ ((format(printf, 1, 2)))
+__attribute__((warn_unused_result))
+__attribute__((nonnull))
#endif
;
-size_t BLI_strescape(char *dst, const char *src, const size_t maxlen);
+size_t BLI_strescape(char *dst, const char *src, const size_t maxlen)
+#ifdef __GNUC__
+__attribute__((nonnull))
+#endif
+;
/**
* Compare two strings without regard to case.
*
* \retval True if the strings are equal, false otherwise.
*/
-int BLI_strcaseeq(const char *a, const char *b);
+int BLI_strcaseeq(const char *a, const char *b)
+#ifdef __GNUC__
+__attribute__((warn_unused_result))
+__attribute__((nonnull))
+#endif
+;
-char *BLI_strcasestr(const char *s, const char *find);
-int BLI_strcasecmp(const char *s1, const char *s2);
-int BLI_strncasecmp(const char *s1, const char *s2, size_t len);
-int BLI_natstrcmp(const char *s1, const char *s2);
-size_t BLI_strnlen(const char *str, size_t maxlen);
-void BLI_timestr(double _time, char *str); /* time var is global */
+char *BLI_strcasestr(const char *s, const char *find)
+#ifdef __GNUC__
+__attribute__((warn_unused_result))
+__attribute__((nonnull))
+#endif
+;
+int BLI_strcasecmp(const char *s1, const char *s2)
+#ifdef __GNUC__
+__attribute__((warn_unused_result))
+__attribute__((nonnull))
+#endif
+;
+int BLI_strncasecmp(const char *s1, const char *s2, size_t len)
+#ifdef __GNUC__
+__attribute__((warn_unused_result))
+__attribute__((nonnull))
+#endif
+;
+int BLI_natstrcmp(const char *s1, const char *s2)
+#ifdef __GNUC__
+__attribute__((warn_unused_result))
+__attribute__((nonnull))
+#endif
+;
+size_t BLI_strnlen(const char *str, size_t maxlen)
+#ifdef __GNUC__
+__attribute__((warn_unused_result))
+__attribute__((nonnull))
+#endif
+;
+void BLI_timestr(double _time, char *str)
+#ifdef __GNUC__
+__attribute__((nonnull))
+#endif
+; /* time var is global */
-void BLI_ascii_strtolower(char *str, int len);
-void BLI_ascii_strtoupper(char *str, int len);
+void BLI_ascii_strtolower(char *str, int len)
+#ifdef __GNUC__
+__attribute__((nonnull))
+#endif
+;
+void BLI_ascii_strtoupper(char *str, int len)
+#ifdef __GNUC__
+__attribute__((nonnull))
+#endif
+;
#ifdef __cplusplus
}