Next: , Previous: , Up: Top   [Contents][Index]


Appendix A API Reference

This section contains a complete list of functions exposed by ctlseqs. See the corresponding man pages for details.

Initialize matcher:

struct ctlseqs_matcher *ctlseqs_matcher_init(void);

Configure matcher:

int ctlseqs_matcher_config(
    struct ctlseqs_matcher               *matcher,
    struct ctlseqs_matcher_options const *options
);

Match string:

ssize_t ctlseqs_match(
    struct ctlseqs_reader const *matcher,
    char                  const *str,
    size_t                       str_len,
    union ctlseqs_value         *result
);

Destroy matcher:

void ctlseqs_matcher_free(
    struct ctlseqs_matcher *matcher
);

Initialize reader:

struct ctlseqs_reader *ctlseqs_reader_init(void);

Configure reader:

int ctlseqs_reader_config(
    struct ctlseqs_reader               *reader,
    struct ctlseqs_reader_options const *options
);

Read and match:

ssize_t ctlseqs_read(
    struct ctlseqs_reader        *reader,
    struct ctlseqs_matcher const *matcher,
    int                           timeout
);

Purge reader:

void ctlseqs_purge(
    struct ctlseqs_reader *reader,
    size_t                 nbytes
);

Destroy reader:

void ctlseqs_reader_free(
    struct ctlseqs_reader *reader
);