mirror of
https://github.com/tmux/tmux.git
synced 2024-12-25 10:58:48 +00:00
Sync OpenBSD patchset 824:
Last few tables that should be const.
This commit is contained in:
parent
521247bedb
commit
a24b67fc5a
14
input-keys.c
14
input-keys.c
@ -1,4 +1,4 @@
|
|||||||
/* $Id: input-keys.c,v 1.46 2010-12-30 22:27:38 tcunha Exp $ */
|
/* $Id: input-keys.c,v 1.47 2011-01-03 23:32:04 tcunha Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -39,7 +39,7 @@ struct input_key_ent {
|
|||||||
#define INPUTKEY_CURSOR 0x2 /* cursor key */
|
#define INPUTKEY_CURSOR 0x2 /* cursor key */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct input_key_ent input_keys[] = {
|
const struct input_key_ent input_keys[] = {
|
||||||
/* Backspace key. */
|
/* Backspace key. */
|
||||||
{ KEYC_BSPACE, "\177", 0 },
|
{ KEYC_BSPACE, "\177", 0 },
|
||||||
|
|
||||||
@ -136,11 +136,11 @@ struct input_key_ent input_keys[] = {
|
|||||||
void
|
void
|
||||||
input_key(struct window_pane *wp, int key)
|
input_key(struct window_pane *wp, int key)
|
||||||
{
|
{
|
||||||
struct input_key_ent *ike;
|
const struct input_key_ent *ike;
|
||||||
u_int i;
|
u_int i;
|
||||||
size_t dlen;
|
size_t dlen;
|
||||||
char *out;
|
char *out;
|
||||||
u_char ch;
|
u_char ch;
|
||||||
|
|
||||||
log_debug2("writing key 0x%x", key);
|
log_debug2("writing key 0x%x", key);
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: key-string.c,v 1.34 2010-06-05 20:29:11 micahcowan Exp $ */
|
/* $Id: key-string.c,v 1.35 2011-01-03 23:32:04 tcunha Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -25,7 +25,7 @@
|
|||||||
int key_string_search_table(const char *);
|
int key_string_search_table(const char *);
|
||||||
int key_string_get_modifiers(const char **);
|
int key_string_get_modifiers(const char **);
|
||||||
|
|
||||||
struct {
|
const struct {
|
||||||
const char *string;
|
const char *string;
|
||||||
int key;
|
int key;
|
||||||
} key_string_table[] = {
|
} key_string_table[] = {
|
||||||
|
16
xterm-keys.c
16
xterm-keys.c
@ -1,4 +1,4 @@
|
|||||||
/* $Id: xterm-keys.c,v 1.7 2010-10-24 00:30:51 tcunha Exp $ */
|
/* $Id: xterm-keys.c,v 1.8 2011-01-03 23:32:04 tcunha Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -48,7 +48,7 @@ struct xterm_keys_entry {
|
|||||||
const char *template;
|
const char *template;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct xterm_keys_entry xterm_keys_table[] = {
|
const struct xterm_keys_entry xterm_keys_table[] = {
|
||||||
{ KEYC_F1, "\033[1;_P" },
|
{ KEYC_F1, "\033[1;_P" },
|
||||||
{ KEYC_F1, "\033O_P" },
|
{ KEYC_F1, "\033O_P" },
|
||||||
{ KEYC_F2, "\033[1;_Q" },
|
{ KEYC_F2, "\033[1;_Q" },
|
||||||
@ -140,8 +140,8 @@ xterm_keys_modifiers(const char *template, const char *buf, size_t len)
|
|||||||
int
|
int
|
||||||
xterm_keys_find(const char *buf, size_t len, size_t *size, int *key)
|
xterm_keys_find(const char *buf, size_t len, size_t *size, int *key)
|
||||||
{
|
{
|
||||||
struct xterm_keys_entry *entry;
|
const struct xterm_keys_entry *entry;
|
||||||
u_int i;
|
u_int i;
|
||||||
|
|
||||||
for (i = 0; i < nitems(xterm_keys_table); i++) {
|
for (i = 0; i < nitems(xterm_keys_table); i++) {
|
||||||
entry = &xterm_keys_table[i];
|
entry = &xterm_keys_table[i];
|
||||||
@ -162,10 +162,10 @@ xterm_keys_find(const char *buf, size_t len, size_t *size, int *key)
|
|||||||
char *
|
char *
|
||||||
xterm_keys_lookup(int key)
|
xterm_keys_lookup(int key)
|
||||||
{
|
{
|
||||||
struct xterm_keys_entry *entry;
|
const struct xterm_keys_entry *entry;
|
||||||
u_int i;
|
u_int i;
|
||||||
int modifiers;
|
int modifiers;
|
||||||
char *out;
|
char *out;
|
||||||
|
|
||||||
modifiers = 1;
|
modifiers = 1;
|
||||||
if (key & KEYC_SHIFT)
|
if (key & KEYC_SHIFT)
|
||||||
|
Loading…
Reference in New Issue
Block a user