Blender
V3.3
|
Go to the source code of this file.
Classes | |
struct | FlattenString |
struct | TextFormatType |
Macros | |
#define | FMT_CONT_ALL (FMT_CONT_QUOTESINGLE | FMT_CONT_QUOTEDOUBLE | FMT_CONT_TRIPLE | FMT_CONT_COMMENT_C) |
#define | STR_LITERAL_STARTSWITH(str, str_literal, len_var) (strncmp(str, str_literal, len_var = (sizeof(str_literal) - 1)) == 0) |
Typedefs | |
typedef struct FlattenString | FlattenString |
typedef struct TextFormatType | TextFormatType |
Enumerations | |
enum | { FMT_CONT_NOP = 0 , FMT_CONT_QUOTESINGLE = (1 << 0) , FMT_CONT_QUOTEDOUBLE = (1 << 1) , FMT_CONT_TRIPLE = (1 << 2) , FMT_CONT_QUOTESINGLE_TRIPLE = (FMT_CONT_TRIPLE | FMT_CONT_QUOTESINGLE) , FMT_CONT_QUOTEDOUBLE_TRIPLE = (FMT_CONT_TRIPLE | FMT_CONT_QUOTEDOUBLE) , FMT_CONT_COMMENT_C = (1 << 3) } |
enum | { FMT_TYPE_WHITESPACE = '_' , FMT_TYPE_COMMENT = '#' , FMT_TYPE_SYMBOL = '!' , FMT_TYPE_NUMERAL = 'n' , FMT_TYPE_STRING = 'l' , FMT_TYPE_DIRECTIVE = 'd' , FMT_TYPE_SPECIAL = 'v' , FMT_TYPE_RESERVED = 'r' , FMT_TYPE_KEYWORD = 'b' , FMT_TYPE_DEFAULT = 'q' } |
Functions | |
int | flatten_string (const struct SpaceText *st, FlattenString *fs, const char *in) |
void | flatten_string_free (FlattenString *fs) |
int | flatten_string_strlen (FlattenString *fs, const char *str) |
int | text_check_format_len (TextLine *line, unsigned int len) |
void | text_format_fill (const char **str_p, char **fmt_p, char type, int len) |
void | text_format_fill_ascii (const char **str_p, char **fmt_p, char type, int len) |
TextFormatType * | ED_text_format_get (Text *text) |
void | ED_text_format_register (TextFormatType *tft) |
void | ED_text_format_register_py (void) |
void | ED_text_format_register_osl (void) |
void | ED_text_format_register_lua (void) |
void | ED_text_format_register_pov (void) |
void | ED_text_format_register_pov_ini (void) |
#define FMT_CONT_ALL (FMT_CONT_QUOTESINGLE | FMT_CONT_QUOTEDOUBLE | FMT_CONT_TRIPLE | FMT_CONT_COMMENT_C) |
Definition at line 32 of file text_format.h.
#define STR_LITERAL_STARTSWITH | ( | str, | |
str_literal, | |||
len_var | |||
) | (strncmp(str, str_literal, len_var = (sizeof(str_literal) - 1)) == 0) |
Definition at line 113 of file text_format.h.
typedef struct FlattenString FlattenString |
typedef struct TextFormatType TextFormatType |
anonymous enum |
Format continuation flags (stored just after the NULL terminator).
Enumerator | |
---|---|
FMT_CONT_NOP | |
FMT_CONT_QUOTESINGLE | |
FMT_CONT_QUOTEDOUBLE | |
FMT_CONT_TRIPLE | |
FMT_CONT_QUOTESINGLE_TRIPLE | |
FMT_CONT_QUOTEDOUBLE_TRIPLE | |
FMT_CONT_COMMENT_C |
Definition at line 23 of file text_format.h.
anonymous enum |
Definition at line 80 of file text_format.h.
TextFormatType* ED_text_format_get | ( | Text * | text | ) |
Definition at line 172 of file text_format.c.
References BLI_strcasecmp(), TextFormatType::ext, ListBase::first, Text::id, ID::name, TextFormatType::next, and tft_lb.
Referenced by text_autocomplete_build().
void ED_text_format_register | ( | TextFormatType * | tft | ) |
Definition at line 167 of file text_format.c.
References BLI_addtail(), and tft_lb.
Referenced by ED_text_format_register_lua(), ED_text_format_register_osl(), ED_text_format_register_pov(), ED_text_format_register_pov_ini(), and ED_text_format_register_py().
Definition at line 336 of file text_format_lua.c.
References ED_text_format_register(), TextFormatType::ext, TextFormatType::format_identifier, TextFormatType::format_line, NULL, txtfmt_lua_format_identifier(), and txtfmt_lua_format_line().
Referenced by ED_spacetype_text().
Definition at line 354 of file text_format_osl.c.
References ED_text_format_register(), TextFormatType::ext, TextFormatType::format_identifier, TextFormatType::format_line, NULL, txtfmt_osl_format_identifier(), and txtfmt_osl_format_line().
Referenced by ED_spacetype_text().
Definition at line 931 of file text_format_pov.c.
References ED_text_format_register(), TextFormatType::ext, TextFormatType::format_identifier, TextFormatType::format_line, NULL, txtfmt_pov_format_identifier(), and txtfmt_pov_format_line().
Referenced by ED_spacetype_text().
Definition at line 507 of file text_format_pov_ini.c.
References ED_text_format_register(), TextFormatType::ext, TextFormatType::format_identifier, TextFormatType::format_line, NULL, txtfmt_pov_ini_format_identifier(), and txtfmt_pov_ini_format_line().
Referenced by ED_spacetype_text().
Definition at line 502 of file text_format_py.c.
References ED_text_format_register(), TextFormatType::ext, TextFormatType::format_identifier, TextFormatType::format_line, NULL, txtfmt_py_format_identifier(), and txtfmt_py_format_line().
Referenced by ED_spacetype_text().
int flatten_string | ( | const struct SpaceText * | st, |
FlattenString * | fs, | ||
const char * | in | ||
) |
void flatten_string_free | ( | FlattenString * | fs | ) |
Definition at line 89 of file text_format.c.
References FlattenString::accum, FlattenString::buf, FlattenString::fixedaccum, FlattenString::fixedbuf, and MEM_freeN.
Referenced by text_convert_whitespace_exec(), txtfmt_lua_format_line(), txtfmt_osl_format_line(), txtfmt_pov_format_line(), txtfmt_pov_ini_format_line(), and txtfmt_py_format_line().
int flatten_string_strlen | ( | FlattenString * | fs, |
const char * | str | ||
) |
Takes a string within fs->buf
and returns its length.
Definition at line 99 of file text_format.c.
References BLI_assert, FlattenString::buf, len, FlattenString::pos, and str.
int text_check_format_len | ( | TextLine * | line, |
unsigned int | len | ||
) |
Ensures the format string for the given line is long enough, reallocating as needed. Allocation is done here, alone, to ensure consistency.
Definition at line 106 of file text_format.c.
References TextLine::format, len, MEM_freeN, and MEM_mallocN.
Referenced by txtfmt_lua_format_line(), txtfmt_osl_format_line(), txtfmt_pov_format_line(), txtfmt_pov_ini_format_line(), and txtfmt_py_format_line().
void text_format_fill | ( | const char ** | str_p, |
char ** | fmt_p, | ||
char | type, | ||
int | len | ||
) |
Fill the string with formatting constant, advancing str_p and fmt_p
len | length in bytes of fmt_p to fill. |
Definition at line 127 of file text_format.c.
References BLI_assert, BLI_str_utf8_size_safe(), len, size(), str, and type.
Referenced by txtfmt_lua_format_line(), txtfmt_osl_format_line(), txtfmt_pov_format_line(), txtfmt_pov_ini_format_line(), and txtfmt_py_format_line().
void text_format_fill_ascii | ( | const char ** | str_p, |
char ** | fmt_p, | ||
char | type, | ||
int | len | ||
) |
ASCII version of text_format_fill, use when we no the text being stepped over is ascii (as is the case for most keywords)
Definition at line 149 of file text_format.c.
References BLI_assert, len, str, and type.
Referenced by txtfmt_lua_format_line(), txtfmt_osl_format_line(), txtfmt_pov_format_line(), txtfmt_pov_ini_format_line(), and txtfmt_py_format_line().