isocline
Formatted Text

Formatted text using bbcode markup. More...

Functions

void ic_print (const char *s)
 Print to the terminal while respection bbcode markup. More...
 
void ic_println (const char *s)
 Print with bbcode markup ending with a newline. More...
 
void ic_printf (const char *fmt,...)
 Print formatted with bbcode markup. More...
 
void ic_vprintf (const char *fmt, va_list args)
 Print formatted with bbcode markup. More...
 
void ic_style_def (const char *style_name, const char *fmt)
 Define or redefine a style. More...
 
void ic_style_open (const char *fmt)
 Start a global style that is only reset when calling a matching ic_style_close(). More...
 
void ic_style_close (void)
 End a global style. More...
 

Detailed Description

Formatted text using bbcode markup.

Function Documentation

◆ ic_print()

void ic_print ( const char *  s)

Print to the terminal while respection bbcode markup.

Any unclosed tags are closed automatically at the end of the print. For example:

ic_print("[b]bold, [i]bold and italic[/i], [red]red and bold[/][/b] default.");
ic_print("[b]bold[/], [i b]bold and italic[/], [yellow on blue]yellow on blue background");
ic_style_add("em","i color=#888800");
ic_print("[em]emphasis");
void ic_print(const char *s)
Print to the terminal while respection bbcode markup.

Properties that can be assigned are:

  • color= clr, bgcolor= clr: where clr is either a hex value #RRGGBB or #RGB, a standard HTML color name, or an ANSI palette name, like ansi-maroon, ansi-default, etc.
  • bold,italic,reverse,underline: can be on or off.
  • everything else is a style; all HTML and ANSI color names are also a style (so we can just use red instead of color=red, or on red instead of bgcolor=red), and there are the b, i, u, and r styles for bold, italic, underline, and reverse.

See here for a description of the full bbcode format.

◆ ic_printf()

void ic_printf ( const char *  fmt,
  ... 
)

Print formatted with bbcode markup.

See also
ic_print()

◆ ic_println()

void ic_println ( const char *  s)

Print with bbcode markup ending with a newline.

See also
ic_print()

◆ ic_style_close()

void ic_style_close ( void  )

End a global style.

◆ ic_style_def()

void ic_style_def ( const char *  style_name,
const char *  fmt 
)

Define or redefine a style.

Parameters
style_nameThe name of the style.
fmtThe fmt string is the content of a tag and can contain other styles. This is very useful to theme the output of a program by assigning standard styles like em or warning etc.

◆ ic_style_open()

void ic_style_open ( const char *  fmt)

Start a global style that is only reset when calling a matching ic_style_close().

◆ ic_vprintf()

void ic_vprintf ( const char *  fmt,
va_list  args 
)

Print formatted with bbcode markup.

See also
ic_print