From d73085eaa93a0217a679556f7a37a80421877b69 Mon Sep 17 00:00:00 2001 From: C. McEnroe Date: Wed, 12 Feb 2020 00:48:43 -0500 Subject: Allow for arguments to open/copy utilities --- chat.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'chat.h') diff --git a/chat.h b/chat.h index 39be36e..4e9a230 100644 --- a/chat.h +++ b/chat.h @@ -194,8 +194,22 @@ void completeClear(size_t id); size_t completeID(const char *str); enum Color completeColor(size_t id, const char *str); -extern const char *urlOpenUtil; -extern const char *urlCopyUtil; +enum { UtilCap = 16 }; +struct Util { + size_t argc; + const char *argv[UtilCap]; +}; + +static inline void utilPush(struct Util *util, const char *arg) { + if (1 + util->argc < UtilCap) { + util->argv[util->argc++] = arg; + } else { + errx(EX_CONFIG, "too many utility arguments"); + } +} + +extern struct Util urlOpenUtil; +extern struct Util urlCopyUtil; void urlScan(size_t id, const char *nick, const char *mesg); void urlOpenCount(size_t id, size_t count); void urlOpenMatch(size_t id, const char *str); -- cgit 1.4.1-2-gfad0