diff options
author | Daniel Carl <danielcarl@gmx.de> | 2013-06-14 02:32:04 +0200 |
---|---|---|
committer | Daniel Carl <danielcarl@gmx.de> | 2013-06-14 02:35:32 +0200 |
commit | 3e9077078ca72cdd8b25d8fc04938188c14cd4f6 (patch) | |
tree | 242feb32c803f6f8b3401a3d1da661bb615c9471 /src/command.h | |
parent | fbdb3249e4e86d02b5b131c56b32cb7b68b43dd9 (diff) |
Don't use string for command and params in keybinding.
It wasn't a good approach to use string for the command and it's params to
call if a keybinding is used. Now we translate the command string and
parameters to the right command function and a prepared Arg parameter. This
will save system resources during runtime.
Diffstat (limited to 'src/command.h')
-rw-r--r-- | src/command.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/command.h b/src/command.h index f0e101c..c562272 100644 --- a/src/command.h +++ b/src/command.h @@ -44,14 +44,15 @@ enum { COMMAND_SAVE_URI }; +typedef gboolean (*Command)(const Arg *arg); + void command_init(void); GList *command_get_by_prefix(const char *prefix); void command_cleanup(void); -gboolean command_exists(const char *name); -gboolean command_run(const char *name, const char *param); +gboolean command_parse_from_string(const char *input, Command *func, Arg *arg, guint *count); gboolean command_run_string(const char *input); - gboolean command_run_multi(const Arg *arg); + gboolean command_open(const Arg *arg); gboolean command_open_home(const Arg *arg); gboolean command_open_closed(const Arg *arg); |