eventscript: introduce enum for different event script calls.
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 24 Nov 2009 00:46:49 +0000 (11:16 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 24 Nov 2009 00:46:49 +0000 (11:16 +1030)
commit8001488be4f2beb25e943fe01b2afc2e8779930d
tree7b30bb73b03556d76be6bd44f674d4043efaea02
parent533c3e053293941d2a9484b495e78d45f478bb08
eventscript: introduce enum for different event script calls.

Rather than doing strcmp everywhere, pass an explicit enum around.  This
also subtly documents what options are available.  The "options" arg
is now used for extra arguments only.

Unfortunately, gcc complains on empty format strings, so we make
ctdb_event_script() take no varargs, and add ctdb_event_script_args().  We
leave ctdb_event_script_callback() taking varargs, which means callers
have to do "%s", "".

For the moment, we have CTDB_EVENT_UNKNOWN for handling forced scripts
from the ctdb tool.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
include/ctdb_private.h
server/ctdb_control.c
server/ctdb_monitor.c
server/ctdb_recover.c
server/ctdb_recoverd.c
server/ctdb_takeover.c
server/eventscript.c