Cleanup: move search templates into their own files
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user