summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/tmux.h
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2021-08-25 08:51:56 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2021-08-25 08:51:56 +0000
commit98ffd29fab2ef14be2c2b4748c62d5e8fd1631f7 (patch)
tree92e990c5d80de0e52a3f2ac636a43a10b48d3556 /usr.bin/tmux/tmux.h
parenta50c0d7da75e4226abcd1c52f16afcdebd6b7e28 (diff)
Validate command argument types (string or command list) and give more
useful error messages.
Diffstat (limited to 'usr.bin/tmux/tmux.h')
-rw-r--r--usr.bin/tmux/tmux.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h
index fa9fe2de72f..a7e266091df 100644
--- a/usr.bin/tmux/tmux.h
+++ b/usr.bin/tmux/tmux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.h,v 1.1136 2021/08/25 07:09:30 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.1137 2021/08/25 08:51:55 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1378,8 +1378,16 @@ struct args_value {
struct args_entry;
RB_HEAD(args_tree, args_entry);
+/* Arguments parsing type. */
+enum args_parse_type {
+ ARGS_PARSE_INVALID,
+ ARGS_PARSE_STRING,
+ ARGS_PARSE_COMMANDS_OR_STRING,
+ ARGS_PARSE_COMMANDS
+};
+
/* Arguments parsing state. */
-typedef enum args_type (*args_parse_cb)(struct args *, u_int);
+typedef enum args_parse_type (*args_parse_cb)(struct args *, u_int, char **);
struct args_parse {
const char *template;
int lower;
@@ -2201,7 +2209,7 @@ int tty_keys_next(struct tty *);
void args_set(struct args *, u_char, struct args_value *);
struct args *args_create(void);
struct args *args_parse(const struct args_parse *, struct args_value *,
- u_int);
+ u_int, char **);
void args_vector(struct args *, int *, char ***);
void args_free_value(struct args_value *);
void args_free(struct args *);