ELinks 0.18.0
dump_output Struct Reference

A place where dumping functions write their output. More...

Collaboration diagram for dump_output:

Data Fields

size_t bufpos
 How many bytes are in buf already.
 
struct stringstring
 A string to which the buffer should eventually be flushed, or NULL.
 
int fd
 A file descriptor to which the buffer should eventually be flushed, or -1.
 
unicode_val_T frame [FRAME_CHARS_END - FRAME_CHARS_BEGIN]
 Mapping of SCREEN_ATTR_FRAME characters.
 
char buf [D_BUF]
 Bytes waiting to be flushed.
 

Related Symbols

(Note that these are not member symbols.)

static void dump_output_prepare_frame (struct dump_output *out, int to_cp)
 Initialize dump_output::frame for the specified codepage.
 
static struct dump_outputdump_output_alloc (int fd, struct string *string, int cp)
 Allocate and initialize a struct dump_output.
 
static int dump_output_flush (struct dump_output *out)
 Flush buffered output to the file or string.
 

Detailed Description

A place where dumping functions write their output.

The data first goes to the buffer in this structure. When the buffer is full enough, it is flushed to a file descriptor or to a string.

Friends And Related Symbol Documentation

◆ dump_output_alloc()

static struct dump_output * dump_output_alloc ( int fd,
struct string * string,
int cp )
related

Allocate and initialize a struct dump_output.

The caller should eventually free the structure with mem_free().

Parameters
fdThe file descriptor to which the output will be written. Use -1 if the output should go to a string instead.
stringThe string to which the output will be appended. Use NULL if the output should go to a file descriptor instead.
cpThe codepage of the dump. It need not match the codepage of the document.
Returns
The new structure, or NULL on error.

◆ dump_output_flush()

static int dump_output_flush ( struct dump_output * out)
related

Flush buffered output to the file or string.

Returns
0 on success, or -1 on error.
Postcondition
If this succeeds, then out->bufpos == 0, so that the buffer has room for more data.

◆ dump_output_prepare_frame()

static void dump_output_prepare_frame ( struct dump_output * out,
int to_cp )
related

Initialize dump_output::frame for the specified codepage.

If the codepage does not support all the box-drawing characters of CP437, then map them to simpler characters, according to frame_simplify.

Field Documentation

◆ buf

char dump_output::buf[D_BUF]

Bytes waiting to be flushed.


◆ bufpos

size_t dump_output::bufpos

How many bytes are in buf already.


◆ fd

int dump_output::fd

A file descriptor to which the buffer should eventually be flushed, or -1.


◆ frame

Mapping of SCREEN_ATTR_FRAME characters.

If the target codepage is UTF-8 (which is possible only if CONFIG_UTF8 is defined), then the values are UTF-32. Otherwise, they are in the target codepage, even though the type may still be unicode_val_T.

◆ string

struct string* dump_output::string

A string to which the buffer should eventually be flushed, or NULL.



The documentation for this struct was generated from the following file: