Пример #1
0
Файл: keys.c Проект: jubalh/vifm
int
add_user_keys(const wchar_t *keys, const wchar_t *cmd, int mode, int no_r)
{
	key_chunk_t *curr;

	curr = add_keys_inner(&user_cmds_root[mode], keys);
	if(curr->conf.type == USER_CMD)
	{
		free((void*)curr->conf.data.cmd);
	}

	curr->conf.type = USER_CMD;
	curr->conf.data.cmd = vifm_wcsdup(cmd);
	curr->no_remap = no_r;
	return 0;
}
Пример #2
0
int
vle_keys_user_add(const wchar_t lhs[], const wchar_t rhs[], int mode,
		int flags)
{
	key_chunk_t *curr = add_keys_inner(&user_cmds_root[mode], lhs);
	if(curr == NULL)
	{
		return -1;
	}

	if(curr->type == USER_CMD)
	{
		free(curr->conf.data.cmd);
	}

	curr->type = USER_CMD;
	curr->conf.data.cmd = vifm_wcsdup(rhs);
	curr->no_remap = ((flags & KEYS_FLAG_NOREMAP) != 0);
	curr->silent = ((flags & KEYS_FLAG_SILENT) != 0);
	return 0;
}