CTLSEQS_READER_CONFIG(3) ctlseqs CTLSEQS_READER_CONFIG(3)

ctlseqs_reader_config - configure control sequence reader

#include <ctlseqs.h>
int ctlseqs_reader_config(
    struct ctlseqs_reader               *reader,
    struct ctlseqs_reader_options const *options
);

Changes the properties of the given reader.

The options argument is a pointer to a struct ctlseqs_reader_options, as shown below:


struct ctlseqs_reader_options { union ctlseqs_value *result; size_t maxlen; int fd; unsigned flags; };


Field result is the pointer to the buffer where the values extracted from the matching sequence of ctlseqs_read will be stored.

Field maxlen specifies the maximum possible length (in bytes) of control sequence to be read.

Field fd is the file descriptor to read from.

Field flags is the bit mask of multiple boolean options.

CTLSEQS_READER_NO_POLL
In a ctlseqs_read call, do not poll before read. You may want this option enabled if fd is polled elsewhere (e.g. in an event loop).
CTLSEQS_READER_SAVE_MATCHED_SEQS
When a sequence is successfully matched against a pattern during ctlseqs_read, save the original sequence to result alongside the extracted values.

CTLSEQS_OK
Success.
CTLSEQS_NOMEM
Fails to allocate sufficient memory.
CTLSEQS_ERROR
Attempts to change maxlen value, but data in the internal read buffer will be lost due to truncation, if done so.

Copyright (c) 2020,2021 CismonX <admin@cismon.net>

Copying and distribution of this file, with or without modification, are permitted in any medium without royalty, provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty.

ctlseqs_match(3), ctlseqs_read(3)
September 1, 2020 0.1.0