From f000d2f9c924bb964203d7dba27b3290045c6853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Wed, 14 Jun 2017 22:54:06 +0200 Subject: vis: add basic infrastructure to store selections in registers --- vis.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'vis.h') diff --git a/vis.h b/vis.h index a4f1d46..2afa00f 100644 --- a/vis.h +++ b/vis.h @@ -13,6 +13,7 @@ typedef struct Win Win; #include "view.h" #include "text-regex.h" #include "libutf.h" +#include "array.h" #ifndef CONFIG_HELP #define CONFIG_HELP 1 @@ -754,6 +755,23 @@ const char *vis_register_slot_get(Vis*, enum VisRegister, size_t slot, size_t *l /** Set register content. */ bool vis_register_put(Vis*, enum VisRegister, const char *data, size_t len); bool vis_register_slot_put(Vis*, enum VisRegister, size_t slot, const char *data, size_t len); +/** + * Store a set of ``Filerange``s in a register. + * + * @param id The register to use. + * @param sel The array containing the file ranges. + */ +void vis_register_selections_set(Vis*, enum VisRegister id, Array *sel); +/** + * Get an array of file ranges stored in the register. + * + * @rst + * .. warning:: The caller must eventually free the Array by calling + * ``array_release``. + * @endrst + */ +Array vis_register_selections_get(Vis*, enum VisRegister id); + /** * @} * @defgroup vis_macros -- cgit v1.2.3