libcucul exporters to various formats


Functions

cucul_buffer_tcucul_create_export (cucul_canvas_t *, char const *)
 Export a canvas into a foreign format.
char const *const * cucul_get_export_list (void)
 Get available export formats.

Detailed Description

These functions export the current canvas to various text formats. It is necessary to call cucul_free_buffer() to dispose of the data.

Function Documentation

cucul_buffer_t* cucul_create_export cucul_canvas_t cv,
char const *  format
 

This function exports a libcucul canvas into various foreign formats such as ANSI art, HTML, IRC colours, etc. One should use cucul_get_buffer_data() and cucul_get_buffer_size() to access the buffer contents. The allocated data is valid until cucul_free_buffer() is called.

Valid values for format are:

  • "caca": export native libcaca files.
  • "ansi": export ANSI art (CP437 charset with ANSI colour codes).
  • "html": export an HTML page with CSS information.
  • "html3": export an HTML table that should be compatible with most navigators, including textmode ones.
  • "irc": export UTF-8 text with mIRC colour codes.
  • "ps": export a PostScript document.
  • "svg": export an SVG vector image.
  • "tga": export a TGA image.
Parameters:
cv A libcucul canvas
format A string describing the requested output format.

char const* const* cucul_get_export_list void   ) 
 

Return a list of available export formats. The list is a NULL-terminated array of strings, interleaving a string containing the internal value for the export format, to be used with cucul_create_export(), and a string containing the natural language description for that export format.

Returns:
An array of strings.