foot/extract.h
Daniel Eklöf 1bc9fd5fe1
extract: add extract_finish_wide(), and optionally skip stripping trailing empty cells
extract_finish() returns the extracted text in UTF-8, while
extract_finish_wide() returns the extracted text in Unicode.

This patch also adds a new argument to extract_finish{,_wide},
that when set to true, skips stripping trailing empty cells.
2021-05-17 18:14:09 +02:00

22 lines
570 B
C

#pragma once
#include <stddef.h>
#include <stdbool.h>
#include <wchar.h>
#include "terminal.h"
struct extraction_context;
struct extraction_context *extract_begin(enum selection_kind kind);
bool extract_one(
const struct terminal *term, const struct row *row, const struct cell *cell,
int col, void *context);
bool extract_finish(
struct extraction_context *context, bool strip_trailing_empty,
char **text, size_t *len);
bool extract_finish_wide(
struct extraction_context *context, bool strip_trailing_empty,
wchar_t **text, size_t *len);