summaryrefslogtreecommitdiff
path: root/src/actions.c
diff options
context:
space:
mode:
authorJérémie Courrèges-Anglas <jca@wxcvbn.org>2016-11-23 02:49:38 +0100
committerJérémie Courrèges-Anglas <jca@wxcvbn.org>2016-11-23 02:49:38 +0100
commit9094ef8db4c47ab127cf6b0667f4c8c73bed5d10 (patch)
treefcf0b418f2396f9c286663adc4998a2785269ce9 /src/actions.c
parent42323e46cb36cf6340fc4223bf3ec39250ae5ace (diff)
downloadratpoison-9094ef8db4c47ab127cf6b0667f4c8c73bed5d10.zip
Move some implementation details from actions.h to actions.c
Diffstat (limited to 'src/actions.c')
-rw-r--r--src/actions.c153
1 files changed, 147 insertions, 6 deletions
diff --git a/src/actions.c b/src/actions.c
index 00f9fce..a3d7c56 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -53,6 +53,30 @@ struct set_var
struct list_head node;
};
+LIST_HEAD(set_vars);
+
+struct user_command
+{
+ char *name;
+ cmdret * (*func)(int, struct cmdarg **);
+ struct argspec *args;
+ int num_args;
+ /* The number of required arguments. Any arguments after that are
+ optional and won't be filled in when called
+ interactively. ni_required_args is used when called non-interactively,
+ i_required_args when called interactively. */
+ int ni_required_args, i_required_args;
+
+ struct list_head node;
+};
+
+LIST_HEAD(user_commands);
+
+/* rp_keymaps is ratpoison's list of keymaps. */
+LIST_HEAD(rp_keymaps);
+
+
+/* setter function prototypes */
static cmdret * set_resizeunit (struct cmdarg **args);
static cmdret * set_wingravity (struct cmdarg **args);
static cmdret * set_transgravity (struct cmdarg **args);
@@ -87,7 +111,126 @@ static cmdret * set_startupmessage(struct cmdarg **args);
static cmdret * set_warp(struct cmdarg **args);
static cmdret * set_rudeness(struct cmdarg **args);
-LIST_HEAD(set_vars);
+/* command function prototypes. */
+static cmdret *cmd_abort (int interactive, struct cmdarg **args);
+static cmdret *cmd_addhook (int interactive, struct cmdarg **args);
+static cmdret *cmd_alias (int interactive, struct cmdarg **args);
+static cmdret *cmd_banish (int interactive, struct cmdarg **args);
+static cmdret *cmd_banishrel (int interactive, struct cmdarg **args);
+static cmdret *cmd_bind (int interactive, struct cmdarg **args);
+static cmdret *cmd_compat (int interactive, struct cmdarg **args);
+static cmdret *cmd_chdir (int interactive, struct cmdarg **args);
+static cmdret *cmd_clrunmanaged (int interactive, struct cmdarg **args);
+static cmdret *cmd_colon (int interactive, struct cmdarg **args);
+static cmdret *cmd_commands (int interactive, struct cmdarg **args);
+static cmdret *cmd_curframe (int interactive, struct cmdarg **args);
+static cmdret *cmd_delete (int interactive, struct cmdarg **args);
+static cmdret *cmd_echo (int interactive, struct cmdarg **args);
+static cmdret *cmd_escape (int interactive, struct cmdarg **args);
+static cmdret *cmd_exec (int interactive, struct cmdarg **args);
+static cmdret *cmd_execa (int interactive, struct cmdarg **args);
+static cmdret *cmd_execf (int interactive, struct cmdarg **args);
+static cmdret *cmd_fdump (int interactive, struct cmdarg **args);
+static cmdret *cmd_focusdown (int interactive, struct cmdarg **args);
+static cmdret *cmd_focuslast (int interactive, struct cmdarg **args);
+static cmdret *cmd_focusleft (int interactive, struct cmdarg **args);
+static cmdret *cmd_focusright (int interactive, struct cmdarg **args);
+static cmdret *cmd_focusup (int interactive, struct cmdarg **args);
+static cmdret *cmd_exchangeup (int interactive, struct cmdarg **args);
+static cmdret *cmd_exchangedown (int interactive, struct cmdarg **args);
+static cmdret *cmd_exchangeleft (int interactive, struct cmdarg **args);
+static cmdret *cmd_exchangeright (int interactive, struct cmdarg **args);
+static cmdret *cmd_swap (int interactive, struct cmdarg **args);
+static cmdret *cmd_frestore (int interactive, struct cmdarg **args);
+static cmdret *cmd_fselect (int interactive, struct cmdarg **args);
+static cmdret *cmd_gdelete (int interactive, struct cmdarg **args);
+static cmdret *cmd_getenv (int interactive, struct cmdarg **args);
+static cmdret *cmd_gmerge (int interactive, struct cmdarg **args);
+static cmdret *cmd_gmove (int interactive, struct cmdarg **args);
+static cmdret *cmd_gnew (int interactive, struct cmdarg **args);
+static cmdret *cmd_gnewbg (int interactive, struct cmdarg **args);
+static cmdret *cmd_gnext (int interactive, struct cmdarg **args);
+static cmdret *cmd_gnumber (int interactive, struct cmdarg **args);
+static cmdret *cmd_gprev (int interactive, struct cmdarg **args);
+static cmdret *cmd_gother (int interactive, struct cmdarg **args);
+static cmdret *cmd_gravity (int interactive, struct cmdarg **args);
+static cmdret *cmd_grename (int interactive, struct cmdarg **args);
+static cmdret *cmd_groups (int interactive, struct cmdarg **args);
+static cmdret *cmd_gselect (int interactive, struct cmdarg **args);
+static cmdret *cmd_h_split (int interactive, struct cmdarg **args);
+static cmdret *cmd_help (int interactive, struct cmdarg **args);
+static cmdret *cmd_info (int interactive, struct cmdarg **args);
+static cmdret *cmd_kill (int interactive, struct cmdarg **args);
+static cmdret *cmd_lastmsg (int interactive, struct cmdarg **args);
+static cmdret *cmd_license (int interactive, struct cmdarg **args);
+static cmdret *cmd_link (int interactive, struct cmdarg **args);
+static cmdret *cmd_listhook (int interactive, struct cmdarg **args);
+static cmdret *cmd_meta (int interactive, struct cmdarg **args);
+static cmdret *cmd_msgwait (int interactive, struct cmdarg **args);
+static cmdret *cmd_newwm (int interactive, struct cmdarg **args);
+static cmdret *cmd_next (int interactive, struct cmdarg **args);
+static cmdret *cmd_next_frame (int interactive, struct cmdarg **args);
+static cmdret *cmd_nextscreen (int interactive, struct cmdarg **args);
+static cmdret *cmd_number (int interactive, struct cmdarg **args);
+static cmdret *cmd_only (int interactive, struct cmdarg **args);
+static cmdret *cmd_other (int interactive, struct cmdarg **args);
+static cmdret *cmd_prev (int interactive, struct cmdarg **args);
+static cmdret *cmd_prev_frame (int interactive, struct cmdarg **args);
+static cmdret *cmd_prevscreen (int interactive, struct cmdarg **args);
+static cmdret *cmd_quit (int interactive, struct cmdarg **args);
+static cmdret *cmd_redisplay (int interactive, struct cmdarg **args);
+static cmdret *cmd_remhook (int interactive, struct cmdarg **args);
+static cmdret *cmd_remove (int interactive, struct cmdarg **args);
+static cmdret *cmd_rename (int interactive, struct cmdarg **args);
+static cmdret *cmd_resize (int interactive, struct cmdarg **args);
+static cmdret *cmd_restart (int interactive, struct cmdarg **args);
+static cmdret *cmd_rudeness (int interactive, struct cmdarg **args);
+static cmdret *cmd_select (int interactive, struct cmdarg **args);
+static cmdret *cmd_setenv (int interactive, struct cmdarg **args);
+static cmdret *cmd_shrink (int interactive, struct cmdarg **args);
+static cmdret *cmd_source (int interactive, struct cmdarg **args);
+static cmdret *cmd_startup_message (int interactive, struct cmdarg **args);
+static cmdret *cmd_time (int interactive, struct cmdarg **args);
+static cmdret *cmd_tmpwm (int interactive, struct cmdarg **args);
+static cmdret *cmd_unalias (int interactive, struct cmdarg **args);
+static cmdret *cmd_unbind (int interactive, struct cmdarg **args);
+static cmdret *cmd_unimplemented (int interactive, struct cmdarg **args);
+static cmdret *cmd_unmanage (int interactive, struct cmdarg **args);
+static cmdret *cmd_unsetenv (int interactive, struct cmdarg **args);
+static cmdret *cmd_v_split (int interactive, struct cmdarg **args);
+static cmdret *cmd_verbexec (int interactive, struct cmdarg **args);
+static cmdret *cmd_version (int interactive, struct cmdarg **args);
+static cmdret *cmd_warp (int interactive, struct cmdarg **args);
+static cmdret *cmd_windows (int interactive, struct cmdarg **args);
+static cmdret *cmd_readkey (int interactive, struct cmdarg **args);
+static cmdret *cmd_newkmap (int interactive, struct cmdarg **args);
+static cmdret *cmd_delkmap (int interactive, struct cmdarg **args);
+static cmdret *cmd_definekey (int interactive, struct cmdarg **args);
+static cmdret *cmd_undefinekey (int interactive, struct cmdarg **args);
+static cmdret *cmd_set (int interactive, struct cmdarg **args);
+static cmdret *cmd_sselect (int interactive, struct cmdarg **args);
+static cmdret *cmd_ratwarp (int interactive, struct cmdarg **args);
+static cmdret *cmd_ratinfo (int interactive, struct cmdarg **args);
+static cmdret *cmd_ratrelinfo (int interactive, struct cmdarg **args);
+static cmdret *cmd_ratclick (int interactive, struct cmdarg **args);
+static cmdret *cmd_ratrelwarp (int interactive, struct cmdarg **args);
+static cmdret *cmd_rathold (int interactive, struct cmdarg **args);
+static cmdret *cmd_cnext (int interactive, struct cmdarg **args);
+static cmdret *cmd_cother (int interactive, struct cmdarg **args);
+static cmdret *cmd_cprev (int interactive, struct cmdarg **args);
+static cmdret *cmd_dedicate (int interactive, struct cmdarg **args);
+static cmdret *cmd_describekey (int interactive, struct cmdarg **args);
+static cmdret *cmd_inext (int interactive, struct cmdarg **args);
+static cmdret *cmd_iother (int interactive, struct cmdarg **args);
+static cmdret *cmd_iprev (int interactive, struct cmdarg **args);
+static cmdret *cmd_prompt (int interactive, struct cmdarg **args);
+static cmdret *cmd_sdump (int interactive, struct cmdarg **args);
+static cmdret *cmd_sfdump (int interactive, struct cmdarg **args);
+static cmdret *cmd_sfrestore (int interactive, struct cmdarg **args);
+static cmdret *cmd_undo (int interactive, struct cmdarg **args);
+static cmdret *cmd_redo (int interactive, struct cmdarg **args);
+static cmdret *cmd_putsel (int interactive, struct cmdarg **args);
+static cmdret *cmd_getsel (int interactive, struct cmdarg **args);
static void
add_set_var (char *name, cmdret * (*fn)(struct cmdarg **), int nargs, ...)
@@ -163,10 +306,6 @@ init_set_vars (void)
add_set_var ("winname", set_winname, 1, "", arg_STRING);
}
-/* rp_keymaps is ratpoison's list of keymaps. */
-LIST_HEAD(rp_keymaps);
-LIST_HEAD(user_commands);
-
/* i_nrequired is the number required when called
interactively. ni_nrequired is when called non-interactively. */
static void
@@ -438,6 +577,8 @@ static const char *invalid_negative_arg = "invalid negative argument";
static cmdret* frestore (char *data, rp_screen *s);
static char* fdump (rp_screen *screen);
+static int spawn(char *data, int raw, rp_frame *frame);
+
/* Delete all entries in the redo list. */
static void
@@ -2506,7 +2647,7 @@ command (int interactive, char *data)
cmdret *result = NULL;
char *cmd, *rest;
char *input;
- user_command *uc;
+ struct user_command *uc;
int i;
if (data == NULL)