vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit 90ad70151f78e928f229d47869c7fc24067be8b5
parent fcef00d4b9b5a8f80d685ffe5ac5ed51843dc059
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Sat, 31 Dec 2016 14:35:18 +0100

vis: typedef function type not pointer to function

Diffstat:
Mvis-cmds.c | 4++--
Mvis.h | 4++--
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/vis-cmds.c b/vis-cmds.c @@ -4,11 +4,11 @@ #include "vis-lua.h" typedef struct { - CmdFunc func; + CmdFunc *func; void *data; } CmdUser; -bool vis_cmd_register(Vis *vis, const char *name, void *data, CmdFunc func) { +bool vis_cmd_register(Vis *vis, const char *name, void *data, CmdFunc *func) { if (!name) return false; if (!vis->usercmds && !(vis->usercmds = map_new())) diff --git a/vis.h b/vis.h @@ -448,11 +448,11 @@ void vis_cancel(Vis*); bool vis_cmd(Vis*, const char *cmd); /* type of user defined function which can be registered */ -typedef bool (*CmdFunc)(Vis*, Win*, void *data, bool force, +typedef bool (CmdFunc)(Vis*, Win*, void *data, bool force, const char *argv[], Cursor*, Filerange*); /* the function will be invoked whenever a command which matches a * unique prefix of the given name is executed */ -bool vis_cmd_register(Vis*, const char *name, void *data, CmdFunc); +bool vis_cmd_register(Vis*, const char *name, void *data, CmdFunc*); bool vis_cmd_unregister(Vis*, const char *name); /* execute any kind (:,?,/) of prompt command */ bool vis_prompt_cmd(Vis*, const char *cmd);