Cleanup: move search templates into their own files

This commit is contained in:
2020-05-06 15:51:23 +10:00
parent 6fe3bbed34
commit c0bbf1553f
6 changed files with 932 additions and 822 deletions

View File

@@ -22,6 +22,7 @@
*/
#include <assert.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -51,6 +52,22 @@
#include "interface_intern.h"
bool ui_str_has_word_prefix(const char *haystack, const char *needle, size_t needle_len)
{
const char *match = BLI_strncasestr(haystack, needle, needle_len);
if (match) {
if ((match == haystack) || (*(match - 1) == ' ') || ispunct(*(match - 1))) {
return true;
}
else {
return ui_str_has_word_prefix(match + 1, needle, needle_len);
}
}
else {
return false;
}
}
/*************************** RNA Utilities ******************************/
uiBut *uiDefAutoButR(uiBlock *block,