-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpwb_keymap_actions.c
37 lines (31 loc) · 980 Bytes
/
pwb_keymap_actions.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "pwb_builtin.h"
#include "pwb_actions.h"
#include <argeater.h>
#include <pager.h>
#include <contools.h>
#include <stdio.h>
#include <stdlib.h> // for malloc/free
#include <alloca.h>
#include "pwb_handle.h"
#include "pwb_argeater.h"
#include "pwb_keymap.h"
PWB_RESULT pwb_action_declare_keymap(PWBH *handle, ACLONE *args)
{
PWB_RESULT result = PWB_FAILURE;
static const char *keymap_handle_name = NULL;
static const char *array_name = NULL;
static AE_ITEM items[] = {
{ &keymap_handle_name, "name", '\0', AET_ARGUMENT,
"name of new keymap handle" },
{ &array_name, "array_name", '\0', AET_ARGUMENT,
"array containing keymap values", NULL,
argeater_array_name_setter }
};
static AE_MAP map = INIT_MAP(items);
if (argeater_process(args, &map))
{
if (keymap_handle_name && array_name)
result = pwb_make_kdata_shell_var(keymap_handle_name, array_name, KEYMAP_LABEL);
}
return result;
}