From 5166e81e794c0faa80742ad6806745b13b967a51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sun, 19 Mar 2017 14:05:32 +0100 Subject: vis: add infrastructure for user specified operators --- vis.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'vis.h') diff --git a/vis.h b/vis.h index 913a503..6c6e0fe 100644 --- a/vis.h +++ b/vis.h @@ -224,6 +224,7 @@ enum VisOperator { VIS_OP_PUT_AFTER_END, VIS_OP_PUT_BEFORE, VIS_OP_PUT_BEFORE_END, + VIS_OP_LAST, /* has to be last enum member */ }; /* set operator to execute, has immediate effect if @@ -242,6 +243,10 @@ enum VisOperator { */ bool vis_operator(Vis*, enum VisOperator, ...); +typedef struct OperatorContext OperatorContext; +typedef size_t (VisOperatorFunction)(Vis*, Text*, OperatorContext*); +int vis_operator_register(Vis*, VisOperatorFunction*, void *context); + enum VisMotion { VIS_MOVE_LINE_DOWN, VIS_MOVE_LINE_UP, -- cgit v1.2.3