68 text->filepath =
nullptr;
89 text->curl =
static_cast<TextLine *
>(text->lines.first);
91 text->sell =
static_cast<TextLine *
>(text->lines.first);
106 std::optional<Library *> ,
112 const Text *text_src = (
Text *)id_src;
122 text_dst->
curl = text_dst->
sell =
nullptr;
130 line_dst->
len = line_src->len;
131 line_dst->
format =
nullptr;
137 text_dst->
curc = text_dst->
selc = 0;
158 if (text->filepath !=
nullptr) {
169 text->
flags &= ~TXT_ISEXT;
173 text->compiled =
nullptr;
179 if (text->filepath) {
200 text->compiled =
nullptr;
216 ln->format =
nullptr;
218 if (ln->len !=
int(strlen(ln->line))) {
219 printf(
"Error loading text, line lengths differ\n");
220 ln->len = strlen(ln->line);
224 text->flags = (text->flags) & ~
TXT_ISEXT;
265 for (
TextLine *tmp =
static_cast<TextLine *
>(text->lines.first), *tmp_next; tmp; tmp = tmp_next)
267 tmp_next = tmp->next;
277 text->curl = text->sell =
nullptr;
295 ptrdiff_t bad_char, i = 0;
296 const ptrdiff_t length = ptrdiff_t(strlen(*
str));
309 char *newstr =
static_cast<char *
>(
MEM_mallocN(length + added + 1,
"text_line"));
315 memcpy(newstr + mi, (*
str) + i, length - i + 1);
319 memcpy(newstr + mi, (*
str) + i, bad_char);
321 const int mofs = mi + bad_char;
326 newstr[length + added] =
'\0';
341 for (i = 0; i < tl->
len; i++) {
342 if (tl->
line[i] <
' ' && tl->
line[i] !=
'\t') {
343 memmove(tl->
line + i, tl->
line + i + 1, tl->
len - i);
357 int i, llen, lines_count;
363 for (i = 0; i <
len; i++) {
364 if (buffer[i] ==
'\n') {
370 memcpy(tmp->
line, &buffer[i - llen], llen);
392 if (llen != 0 || lines_count == 0 || buffer[
len - 1] ==
'\n') {
398 memcpy(tmp->
line, &buffer[i - llen], llen);
410 text->curl = text->sell =
static_cast<TextLine *
>(text->lines.first);
411 text->curc = text->selc = 0;
421 if (!text->filepath) {
425 STRNCPY(filepath_abs, text->filepath);
429 if (buffer ==
nullptr) {
438 if (
BLI_stat(filepath_abs, &st) != -1) {
439 text->mtime = st.st_mtime;
452 const char *filepath,
454 const bool is_internal)
462 STRNCPY(filepath_abs, filepath);
466 if (buffer ==
nullptr) {
481 if (is_internal ==
false) {
482 const size_t filepath_len = strlen(filepath);
484 memcpy(ta->
filepath, filepath, filepath_len + 1);
491 if (
BLI_stat(filepath_abs, &st) != -1) {
492 ta->
mtime = st.st_mtime;
530 if (!text->filepath) {
534 STRNCPY(filepath, text->filepath);
547 if ((st.st_mode & S_IFMT) != S_IFREG) {
551 if (st.st_mtime > text->mtime) {
564 if (!text->filepath) {
568 STRNCPY(filepath, text->filepath);
577 if (result == -1 || (st.st_mode & S_IFMT) != S_IFREG) {
581 text->mtime = st.st_mtime;
594 memset(
l->_pad0, 0,
sizeof(
l->_pad0));
607 line->line = newline;
608 line->len = strlen(newline);
609 line->format =
nullptr;
615 tmp->
line =
static_cast<char *
>(
MEM_mallocN(str_len + 1,
"textline_string"));
618 memcpy(tmp->
line,
str, str_len);
619 tmp->
line[str_len] =
'\0';
637 if (!text->lines.first) {
638 if (text->lines.last) {
639 text->lines.first = text->lines.last;
642 text->lines.first = text->lines.last =
txt_new_line(
"");
646 if (!text->lines.last) {
647 text->lines.last = text->lines.first;
650 top = (
TextLine **)&text->lines.first;
651 bot = (
TextLine **)&text->lines.last;
653 while ((*top)->prev) {
656 while ((*bot)->next) {
662 text->curl = text->sell;
665 text->curl =
static_cast<TextLine *
>(text->lines.first);
671 text->sell = text->curl;
720 if (text->compiled) {
734 *linep = &text->curl;
735 *charp = &text->curc;
740 *linep = &text->sell;
741 *charp = &text->selc;
746 return (text->selc == 0);
751 return (text->selc == text->sell->len);
780 if ((*linep)->prev) {
782 (*linep)->line, (*linep)->len, *charp,
TXT_TABSIZE);
783 *linep = (*linep)->
prev;
785 (*linep)->line, (*linep)->len, column,
TXT_TABSIZE);
812 if ((*linep)->next) {
814 (*linep)->line, (*linep)->len, *charp,
TXT_TABSIZE);
815 *linep = (*linep)->
next;
817 (*linep)->line, (*linep)->len, column,
TXT_TABSIZE);
834 for (
int i = 0; i < ch; i++) {
835 if (tl->
line[i] !=
' ') {
850 if (tl->
line[ch] ==
' ') {
852 for (i = 0; i < ch; i++) {
853 if (tl->
line[i] !=
' ') {
887 if ((*linep)->prev) {
889 *charp = (*linep)->len;
928 if (*charp == (*linep)->len) {
929 if ((*linep)->next) {
1041 *charp = (*linep)->len;
1063 *linep =
static_cast<TextLine *
>(text->lines.first);
1086 *linep =
static_cast<TextLine *
>(text->lines.last);
1087 *charp = (*linep)->
len;
1115 *linep =
static_cast<TextLine *
>(text->lines.first);
1116 for (i = 0; i < line; i++) {
1117 if ((*linep)->next) {
1118 *linep = (*linep)->
next;
1124 if (ch >
uint((*linep)->len)) {
1125 ch =
uint((*linep)->len);
1146 text->curl = text->sell;
1150 text->curc = text->selc;
1157 (text->curl == text->sell && text->curc > text->selc))
1168 (text->curl == text->sell && text->curc < text->selc))
1178 text->sell = text->curl;
1179 text->selc = text->curc;
1192 if (reverse ==
false) {
1194 (text->curl == text->sell && text->curc > text->selc))
1201 (text->curl == text->sell && text->curc < text->selc))
1210 return ((text->curl != text->sell) || (text->curc != text->selc));
1231 buf =
static_cast<char *
>(
1232 MEM_mallocN(text->curc + (text->sell->len - text->selc) + 1,
"textline_string"));
1234 memcpy(buf, text->curl->line, text->curc);
1235 memcpy(buf + text->curc, text->sell->line + text->selc, text->sell->len - text->selc);
1236 buf[text->curc + (text->sell->len - text->selc)] = 0;
1241 while (tmpl != text->curl) {
1250 text->sell = text->curl;
1251 text->selc = text->curc;
1256 text->curl =
static_cast<TextLine *
>(text->lines.first);
1259 text->sell =
static_cast<TextLine *
>(text->lines.last);
1260 text->selc = text->sell->
len;
1266 text->curl = text->sell;
1267 text->curc = text->selc;
1278 text->sell = text->curl;
1279 text->selc = text->sell->len;
1287 if (startl < 0 || endl < 0) {
1290 startl = end + startl + 1;
1293 endl = end + endl + 1;
1300 if (froml ==
nullptr) {
1301 froml =
static_cast<TextLine *
>(text->lines.last);
1303 if (startl == endl) {
1308 if (tol ==
nullptr) {
1309 tol =
static_cast<TextLine *
>(text->lines.last);
1316 startc = std::max(0, fromllen + startc + 1);
1320 endc = std::max(0, tollen + endc + 1);
1348 buf_len +=
l->len + 1;
1350 char *buf =
static_cast<char *
>(
MEM_mallocN(buf_len, __func__));
1351 char *buf_step = buf;
1353 memcpy(buf_step,
l->line,
l->len);
1357 *r_buf_len = buf_len;
1363 const char *buf_end = buf + buf_len;
1364 const char *buf_step = buf;
1371 while (buf_step != buf_end && l_src) {
1373 const char *buf_step_next = strchr(buf_step,
'\n');
1374 const int len = buf_step_next - buf_step;
1377 l_src = l_src->
next;
1378 if (
l->len !=
len) {
1384 memcpy(
l->line, buf_step,
len);
1385 l->line[
len] =
'\0';
1387 buf_step = buf_step_next + 1;
1391 while (l_src !=
nullptr) {
1401 while (buf_step != buf_end) {
1403 const char *buf_step_next = strchr(buf_step,
'\n');
1404 const int len = buf_step_next - buf_step;
1407 l->line =
static_cast<char *
>(
MEM_mallocN(
len + 1,
"textline_string"));
1409 l->format =
nullptr;
1411 memcpy(
l->line, buf_step,
len);
1412 l->line[
len] =
'\0';
1414 buf_step = buf_step_next + 1;
1417 text->curl = text->sell =
static_cast<TextLine *
>(text->lines.first);
1418 text->curc = text->selc = 0;
1435 buf_len +=
l->len + 1;
1440 char *buf =
static_cast<char *
>(
MEM_mallocN(buf_len + 1, __func__));
1441 char *buf_step = buf;
1443 memcpy(buf_step,
l->line,
l->len);
1453 *r_buf_strlen = buf_len;
1475 if (text->curl == text->sell) {
1476 linef = linel = text->curl;
1478 if (text->curc < text->selc) {
1502 if (linef == linel) {
1503 length = charl - charf;
1504 buf =
static_cast<char *
>(
MEM_mallocN(length + 1,
"sel buffer"));
1505 memcpy(buf, linef->
line + charf, length);
1510 length = (linef->
len - charf) + charl + 1;
1512 for (tmp = linef->
next; tmp && tmp != linel; tmp = tmp->
next) {
1513 length += tmp->
len + 1;
1516 buf =
static_cast<char *
>(
MEM_mallocN(length + 1,
"sel buffer"));
1518 memcpy(buf, linef->
line + charf, linef->
len - charf);
1519 length = linef->
len - charf;
1520 buf[length++] =
'\n';
1522 for (tmp = linef->
next; tmp && tmp != linel; tmp = tmp->
next) {
1523 memcpy(buf + length, tmp->
line, tmp->
len);
1525 buf[length++] =
'\n';
1528 memcpy(buf + length, linel->
line, charl);
1542 BLI_assert(in_buffer_len == strlen(in_buffer));
1555 while (buffer[i] && buffer[i] !=
'\n') {
1559 if (buffer[i] ==
'\n') {
1563 while (i < in_buffer_len) {
1566 while (buffer[i] && buffer[i] !=
'\n') {
1571 if (buffer[i] ==
'\n') {
1577 for (j = i -
l; j < i && j < in_buffer_len;) {
1597 const char *s =
nullptr;
1599 if (!text->curl || !text->sell) {
1605 tl = startl = text->sell;
1608 s = strstr(&tl->
line[text->selc], findstr);
1617 tl =
static_cast<TextLine *
>(text->lines.first);
1625 s = strstr(tl->
line, findstr);
1639 txt_move_to(text, newl, newc + strlen(findstr),
true);
1665 left =
static_cast<char *
>(
MEM_mallocN(text->curc + 1,
"textline_string"));
1667 memcpy(left, text->curl->line, text->curc);
1669 left[text->curc] = 0;
1671 right =
static_cast<char *
>(
MEM_mallocN(text->curl->len - text->curc + 1,
"textline_string"));
1672 memcpy(right, text->curl->line + text->curc, text->curl->len - text->curc + 1);
1675 if (text->curl->format) {
1684 ins->
len = text->curc;
1686 text->curl->line = right;
1687 text->curl->format =
nullptr;
1688 text->curl->len = text->curl->len - text->curc;
1725 if (!linea || !lineb) {
1729 tmp =
static_cast<char *
>(
MEM_mallocN(linea->
len + lineb->
len + 1,
"textline_string"));
1732 memcpy(s, linea->
line, linea->
len);
1734 memcpy(s, lineb->
line, lineb->
len);
1755 if (text->curl == text->sell) {
1775 if (text->curc == text->curl->len) {
1776 if (text->curl->next) {
1785 int pos = text->curc;
1787 size_t c_len =
pos - text->curc;
1789 memmove(text->curl->line + text->curc,
1790 text->curl->line + text->curc + c_len,
1791 text->curl->len - text->curc - c_len + 1);
1793 text->curl->len -= c_len;
1820 if (text->curc == 0) {
1821 if (!text->curl->prev) {
1825 text->curl = text->curl->prev;
1826 text->curc = text->curl->len;
1832 int pos = text->curc;
1834 size_t c_len = text->curc -
pos;
1837 memmove(text->curl->line + text->curc - c_len,
1838 text->curl->line + text->curc,
1839 text->curl->len - text->curc + 1);
1841 text->curl->len -= c_len;
1842 text->curc -= c_len;
1888 if (add ==
'\t' && replace_tabs) {
1897 tmp =
static_cast<char *
>(
MEM_mallocN(text->curl->len + add_len + 1,
"textline_string"));
1899 memcpy(tmp, text->curl->line, text->curc);
1900 memcpy(tmp + text->curc, ch, add_len);
1902 tmp + text->curc + add_len, text->curl->line + text->curc, text->curl->len - text->curc + 1);
1906 text->curc += add_len;
1935 size_t del_size = 0, add_size;
1943 if (text->curc == text->curl->len ||
txt_has_sel(text) || add ==
'\n') {
1947 del_size = text->curc;
1949 del_size -= text->curc;
1953 if (add_size > del_size) {
1954 char *tmp =
static_cast<char *
>(
1955 MEM_mallocN(text->curl->len + add_size - del_size + 1,
"textline_string"));
1956 memcpy(tmp, text->curl->line, text->curc);
1957 memcpy(tmp + text->curc + add_size,
1958 text->curl->line + text->curc + del_size,
1959 text->curl->len - text->curc - del_size + 1);
1961 text->curl->line = tmp;
1963 else if (add_size < del_size) {
1964 char *tmp = text->curl->line;
1965 memmove(tmp + text->curc + add_size,
1966 tmp + text->curc + del_size,
1967 text->curl->len - text->curc - del_size + 1);
1970 memcpy(text->curl->line + text->curc, ch, add_size);
1971 text->curc += add_size;
1972 text->curl->len += add_size - del_size;
1987 int len, num, curc_old, selc_old;
1990 const int indentlen = strlen(add);
1994 curc_old = text->curc;
1995 selc_old = text->selc;
2001 if ((text->curl->len != 0) || (skip_blank_lines == 0)) {
2002 tmp =
static_cast<char *
>(
MEM_mallocN(text->curl->len + indentlen + 1,
"textline_string"));
2006 memcpy(tmp, text->curl->line, text->curc);
2008 memcpy(tmp + text->curc, add, indentlen);
2010 len = text->curl->len - text->curc;
2012 memcpy(tmp + text->curc + indentlen, text->curl->line + text->curc,
len);
2014 tmp[text->curl->len + indentlen] = 0;
2018 text->curc += indentlen;
2024 if (text->curl == text->sell) {
2025 if (text->curl->len != 0) {
2026 text->selc += indentlen;
2031 text->curl = text->curl->next;
2036 text->curl = text->curl->prev;
2041 if (curc_old == 0 && !(text->curl == text->sell && curc_old == selc_old)) {
2042 if (text->curl == text->sell) {
2043 if (text->curc == text->selc) {
2050 if (text->curl->len != 0) {
2051 text->curc = curc_old + indentlen;
2067 const int indentlen = strlen(remove);
2068 bool unindented_first =
false;
2069 bool changed_any =
false;
2078 if (
STREQLEN(
l->line, remove, indentlen)) {
2083 for (
int i = 0; i <
l->len; i++) {
2084 if (!
ELEM(
l->line[i],
'\t',
' ')) {
2089 if (
l == text->sell) {
2097 bool changed =
false;
2098 if (
STREQLEN(text->curl->line, remove, indentlen)) {
2100 unindented_first =
true;
2102 text->curl->len -= indentlen;
2103 memmove(text->curl->line, text->curl->line + indentlen, text->curl->len + 1);
2111 if (text->curl == text->sell) {
2113 text->selc = std::max(text->selc - indentlen, 0);
2118 text->curl = text->curl->next;
2122 if (unindented_first) {
2123 text->curc = std::max(text->curc - indentlen, 0);
2127 text->curl = text->curl->prev;
2137 if (
ELEM(
nullptr, text->curl, text->sell)) {
2147 if (
ELEM(
nullptr, text->curl, text->sell)) {
2158 if (
ELEM(
nullptr, text->curl, text->sell)) {
2169 if (
ELEM(
nullptr, text->curl, text->sell)) {
2182 if (!text->curl || !text->sell) {
2211 const char *word =
":";
2212 const char *comm =
"#";
2214 static const char *back_words[] = {
"return",
"break",
"continue",
"pass",
"yield",
nullptr};
2220 while (text->curl->line[i] == indent) {
2222 if (i == text->curc) {
2228 if (strstr(text->curl->line, word)) {
2235 bool is_indent =
false;
2236 for (a = 0; (a < text->curc) && (text->curl->line[a] !=
'\0'); a++) {
2237 char ch = text->curl->line[a];
2244 else if (!
ELEM(ch,
' ',
'\t')) {
2253 for (test = 0; back_words[test]; test++) {
2255 if (strstr(text->curl->line, back_words[test]) && i > 0) {
2256 if (strcspn(text->curl->line, back_words[test]) < strcspn(text->curl->line, comm)) {
2273 const char opens[] =
"([{";
2274 const char close[] =
")]}";
2276 for (a = 0; a < (
sizeof(opens) - 1); a++) {
2277 if (ch == opens[a]) {
2280 if (ch == close[a]) {
2293 char delims[] =
"():\"\' ~!%^&*-+=[]{};/<>|.#\t,@";
2295 for (a = 0; a < (
sizeof(delims) - 1); a++) {
2296 if (ch == delims[a]) {
2325 if (ch <=
'Z' || ch ==
'_') {
2345 if (ch <=
'Z' || ch ==
'_') {
2371 if (
ELEM(ch,
' ',
'\t',
'\r',
'\n')) {
bool BKE_bpath_foreach_path_allocated_process(BPathForeachPathData *bpath_data, char **path)
@ IDTYPE_FLAGS_APPEND_IS_REUSABLE
@ IDTYPE_FLAGS_NO_ANIMDATA
void * BKE_libblock_alloc(Main *bmain, short type, const char *name, int flag) ATTR_WARN_UNUSED_RESULT
void id_fake_user_set(ID *id)
void * BKE_id_new(Main *bmain, short type, const char *name)
void BKE_id_blend_write(BlendWriter *writer, ID *id)
#define ATTR_WARN_UNUSED_RESULT
File and directory operations.
int BLI_exists(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
int BLI_stat(const char *path, BLI_stat_t *buffer) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void * BLI_file_read_text_as_mem(const char *filepath, size_t pad_bytes, size_t *r_size)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
void BLI_addhead(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
void BLI_insertlinkafter(struct ListBase *listbase, void *vprevlink, void *vnewlink) ATTR_NONNULL(1)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_insertlinkbefore(struct ListBase *listbase, void *vnextlink, void *vnewlink) ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
bool BLI_path_abs(char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1
void void void const char * BLI_path_basename(const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
#define STRNCPY(dst, src)
char * BLI_strdupn(const char *str, size_t len) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int char * BLI_strcasestr(const char *s, const char *find) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
bool BLI_str_cursor_step_next_utf8(const char *str, int str_maxlen, int *pos)
bool BLI_str_cursor_step_prev_utf8(const char *str, int str_maxlen, int *pos)
void BLI_str_cursor_step_utf8(const char *str, int str_maxlen, int *pos, eStrCursorJumpDirection direction, eStrCursorJumpType jump, bool use_init_step)
char size_t ptrdiff_t BLI_str_utf8_invalid_byte(const char *str, size_t length) ATTR_NONNULL(1)
int BLI_str_utf8_offset_from_index(const char *str, size_t str_len, int index_target) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
size_t BLI_strlen_utf8(const char *strc) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
unsigned int BLI_str_utf8_as_unicode_step_safe(const char *__restrict p, size_t p_len, size_t *__restrict index) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
size_t BLI_str_utf8_from_unicode(unsigned int c, char *dst, size_t dst_maxncpy) ATTR_NONNULL(2)
int BLI_str_utf8_offset_from_column_with_tabs(const char *str, size_t str_len, int column_target, int tab_width) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_str_utf8_offset_to_column_with_tabs(const char *str, size_t str_len, int offset_target, int tab_width) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define STREQLEN(a, b, n)
#define MEMCMP_STRUCT_AFTER_IS_ZERO(struct_var, member)
#define BLO_write_id_struct(writer, struct_name, id_address, id)
#define BLO_write_struct(writer, struct_name, data_ptr)
void BLO_read_string(BlendDataReader *reader, char **ptr_p)
void BLO_write_string(BlendWriter *writer, const char *data_ptr)
#define BLO_read_struct_list(reader, struct_name, list)
#define BLO_read_struct(reader, struct_name, ptr_p)
#define BLT_I18NCONTEXT_ID_TEXT
void BPY_text_free_code(Text *text)
#define ID_BLEND_PATH_FROM_GLOBAL(_id)
@ USER_TXT_TABSTOSPACES_DISABLE
Read Guarded memory(de)allocation.
#define MEM_reallocN(vmemh, len)
ATTR_WARN_UNUSED_RESULT const BMLoop * l
SIMD_FORCE_INLINE btScalar length() const
Return the length of the vector.
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
void *(* MEM_mallocN)(size_t len, const char *str)
void MEM_freeN(void *vmemh)
static void add(blender::Map< std::string, std::string > &messages, Message &msg)
float wrap(float value, float max, float min)
int text_check_identifier_nodigit_unicode(const uint ch)
void txt_insert_buf(Text *text, const char *in_buffer, int in_buffer_len)
bool txt_add_raw_char(Text *text, uint add)
static void text_foreach_path(ID *id, BPathForeachPathData *bpath_data)
static void text_free_data(ID *id)
int txt_find_string(Text *text, const char *findstr, int wrap, int match_case)
static TextLine * txt_new_linen(const char *str, int str_len)
static void txt_curs_swap(Text *text)
int txt_calc_tab_left(const TextLine *tl, int ch)
bool BKE_text_reload(Text *text)
int BKE_text_file_modified_check(const Text *text)
Text * BKE_text_load_ex(Main *bmain, const char *filepath, const char *relbase, const bool is_internal)
bool txt_unindent(Text *text)
static void txt_make_dirty(Text *text)
Text * BKE_text_load(Main *bmain, const char *filepath, const char *relbase)
void txt_sel_set(Text *text, int startl, int startc, int endl, int endc)
void txt_indent(Text *text)
void BKE_text_free_lines(Text *text)
bool text_check_identifier(const char ch)
void txt_sel_all(Text *text)
void txt_clean_text(Text *text)
void BKE_text_write(Text *text, const char *str, int str_len)
int text_check_identifier_unicode(const uint ch)
char * txt_sel_to_buf(const Text *text, size_t *r_buf_strlen)
static void text_blend_read_data(BlendDataReader *reader, ID *id)
bool txt_cursor_is_line_start(const Text *text)
void txt_pop_sel(Text *text)
bool txt_cursor_is_line_end(const Text *text)
static void txt_delete_line(Text *text, TextLine *line)
Text * BKE_text_add(Main *bmain, const char *name)
static TextLine * txt_new_line(const char *str)
void txt_move_bof(Text *text, const bool sel)
void txt_comment(Text *text, const char *prefix)
void txt_delete_word(Text *text)
void txt_from_buf_for_undo(Text *text, const char *buf, size_t buf_len)
bool txt_replace_char(Text *text, uint add)
static void txt_curs_cur(Text *text, TextLine ***linep, int **charp)
void txt_split_curline(Text *text)
char * txt_to_buf(Text *text, size_t *r_buf_strlen)
bool txt_add_char(Text *text, uint add)
static void text_init_data(ID *id)
void txt_jump_right(Text *text, const bool sel, const bool use_init_step)
bool txt_uncomment(Text *text, const char *prefix)
void txt_move_right(Text *text, const bool sel)
bool text_check_digit(const char ch)
bool txt_has_sel(const Text *text)
static bool txt_add_char_intern(Text *text, uint add, bool replace_tabs)
void txt_backspace_char(Text *text)
void txt_move_to(Text *text, uint line, uint ch, const bool sel)
void txt_move_eol(Text *text, const bool sel)
static void make_new_line(TextLine *line, char *newline)
void BKE_text_file_modified_ignore(Text *text)
int txt_setcurr_tab_spaces(Text *text, int space)
int text_check_bracket(const char ch)
void txt_move_toline(Text *text, uint line, const bool sel)
bool text_check_delim(const char ch)
void txt_move_bol(Text *text, const bool sel)
static bool txt_select_unprefix(Text *text, const char *remove, const bool require_all)
void txt_delete_char(Text *text)
char * txt_to_buf_for_undo(Text *text, size_t *r_buf_len)
static void txt_pop_last(Text *text)
static void text_from_buf(Text *text, const uchar *buffer, const int len)
static void txt_delete_sel(Text *text)
void txt_move_eof(Text *text, const bool sel)
void txt_move_down(Text *text, const bool sel)
static void cleanup_textline(TextLine *tl)
int txt_calc_tab_right(const TextLine *tl, int ch)
int txt_get_span(const TextLine *from, const TextLine *to)
static void text_blend_write(BlendWriter *writer, ID *id, const void *id_address)
void BKE_text_clear(Text *text)
static void txt_pop_first(Text *text)
static void txt_convert_tab_to_spaces(Text *text)
void txt_move_lines(Text *text, const int direction)
void txt_jump_left(Text *text, const bool sel, const bool use_init_step)
void txt_move_left(Text *text, const bool sel)
void txt_duplicate_line(Text *text)
static void text_copy_data(Main *, std::optional< Library * >, ID *id_dst, const ID *id_src, const int)
static void txt_combine_lines(Text *text, TextLine *linea, TextLine *lineb)
void txt_backspace_word(Text *text)
void txt_order_cursors(Text *text, const bool reverse)
void txt_sel_clear(Text *text)
static TextLine * txt_line_malloc() ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void txt_move_up(Text *text, const bool sel)
bool text_check_whitespace(const char ch)
static void txt_curs_sel(Text *text, TextLine ***linep, int **charp)
void txt_sel_line(Text *text)
int text_find_identifier_start(const char *str, int i)
static void txt_select_prefix(Text *text, const char *add, bool skip_blank_lines)
void txt_delete_selected(Text *text)
bool text_check_identifier_nodigit(const char ch)
int txt_extended_ascii_as_utf8(char **str)
static char tab_to_spaces[]