Simplify input.c - lose class table and use macros.

This commit is contained in:
Nicholas Marriott
2007-10-10 19:45:20 +00:00
parent 6aa64f1a93
commit efa3e131b5
3 changed files with 102 additions and 187 deletions

18
tmux.h
View File

@@ -1,4 +1,4 @@
/* $Id: tmux.h,v 1.52 2007-10-05 18:25:05 nicm Exp $ */
/* $Id: tmux.h,v 1.53 2007-10-10 19:45:20 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -354,20 +354,6 @@ struct input_arg {
size_t used;
};
/* Input character classes. */
enum input_class {
INPUT_C0CONTROL,
INPUT_SPACE,
INPUT_INTERMEDIATE,
INPUT_PARAMETER,
INPUT_UPPERCASE,
INPUT_LOWERCASE,
INPUT_DELETE,
INPUT_C1CONTROL,
INPUT_G1DISPLAYABLE,
INPUT_SPECIAL
};
/* Input parser context. */
struct input_ctx {
u_char *buf;
@@ -384,7 +370,7 @@ struct input_ctx {
size_t title_len;
u_int title_type;
void *(*state)(u_char, enum input_class, struct input_ctx *);
void *(*state)(u_char, struct input_ctx *);
u_char private;
ARRAY_DECL(, struct input_arg) args;