selection: refactor: break out text extraction to a separate file

This commit is contained in:
Daniel Eklöf 2020-07-15 11:19:18 +02:00
parent 85c50099af
commit aafa120f92
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
4 changed files with 203 additions and 170 deletions

17
extract.h Normal file
View file

@ -0,0 +1,17 @@
#pragma once
#include <stddef.h>
#include <stdbool.h>
#include "terminal.h"
struct extraction_context;
struct extraction_context *extract_begin(enum selection_kind kind);
bool extract_one(
struct terminal *term, struct row *row, struct cell *cell, int col,
void *context);
bool extract_finish(
struct extraction_context *context, char **text, size_t *len);