use a central dispatch function for received messages
commit365ceb06d2cd81b79e930b4483aa7aa8f989c927
authorrofl0r <retnyg@gmx.net>
Wed, 18 Jan 2017 03:59:30 +0000 (18 03:59 +0000)
committerrofl0r <retnyg@gmx.net>
Fri, 20 Jan 2017 21:27:18 +0000 (20 21:27 +0000)
tree8146956c1a7b2bcec191677d43bab11da91f50a0
parentfd8f8d3198fd1a19dd6ee131201dc520c4e29bd5
use a central dispatch function for received messages

all irc messages we're interested in share more or less the same
layout, and differ only in number of arguments and what these mean.
we use a few tiny data tables to hardcode knowledge about the
number of arguments, and how we re-arrange the order of these
arguments for our handler functions. additionally all the msg
arguments, which always are sent last, begin with a ':' char
so those pointers must be incremented by one before passing them
on.
even though this commit actually increases the number of code
lines, it removes 3 almost entirely duplicated functions,
and should remove binary size as well. in a followup commit we'll
do further cleanup by removing the intermediate C-to-JS wrapper
functions.
jsbot.c