Blender  V3.3
Functions | Variables
text_format.c File Reference
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_string_utils.h"
#include "DNA_space_types.h"
#include "DNA_text_types.h"
#include "ED_text.h"
#include "text_format.h"

Go to the source code of this file.

Functions

static void flatten_string_append (FlattenString *fs, const char *c, int accum, int len)
 
int flatten_string (const 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, uint len)
 
void text_format_fill (const char **str_p, char **fmt_p, const char type, const int len)
 
void text_format_fill_ascii (const char **str_p, char **fmt_p, const char type, const int len)
 
void ED_text_format_register (TextFormatType *tft)
 
TextFormatTypeED_text_format_get (Text *text)
 
bool ED_text_is_syntax_highlight_supported (Text *text)
 

Variables

static ListBase tft_lb = {NULL, NULL}
 

Function Documentation

◆ ED_text_format_get()

TextFormatType* ED_text_format_get ( Text text)

◆ ED_text_format_register()

void ED_text_format_register ( TextFormatType tft)

◆ ED_text_is_syntax_highlight_supported()

bool ED_text_is_syntax_highlight_supported ( Text text)

◆ flatten_string()

int flatten_string ( const SpaceText st,
FlattenString fs,
const char *  in 
)

◆ flatten_string_append()

static void flatten_string_append ( FlattenString fs,
const char *  c,
int  accum,
int  len 
)
static

◆ flatten_string_free()

void flatten_string_free ( FlattenString fs)

◆ flatten_string_strlen()

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.

◆ text_check_format_len()

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().

◆ text_format_fill()

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

Parameters
lenlength 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().

◆ text_format_fill_ascii()

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().

Variable Documentation

◆ tft_lb

ListBase tft_lb = {NULL, NULL}
static