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.
This commit is contained in:
Daniel Eklöf 2021-03-28 21:04:48 +02:00
parent eab874eb06
commit 1bc9fd5fe1
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
4 changed files with 55 additions and 13 deletions

View file

@ -2,6 +2,7 @@
#include <stddef.h>
#include <stdbool.h>
#include <wchar.h>
#include "terminal.h"
@ -14,4 +15,8 @@ bool extract_one(
int col, void *context);
bool extract_finish(
struct extraction_context *context, char **text, size_t *len);
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);