eventscript: use an array rather than a linked list of scripts
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 8 Dec 2009 02:17:05 +0000 (12:47 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 8 Dec 2009 02:17:05 +0000 (12:47 +1030)
commit76e8bdc11b953398ce8850de57aa51f30cb46bff
tree1056bbe5a054327fc07ee6b66a4c5a6e9463f168
parentc476c81f3e3d8fc62f2e53d82fce5774044ee9ce
eventscript: use an array rather than a linked list of scripts

This brings us closer to the wire format, by using a simple array
and a 'current' iterator.

The downside is that a 'struct ctdb_script' is no longer a talloc
object: the state must be passed to our log fn, and the current
script extracted with &state->scripts->scripts[state->current].

The wackiness of marshalling is simplified, and as a bonus, we can
distinguish between an empty event directory
(state->scripts->num_scripts == 0) and and error (state->scripts ==
NULL).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
server/eventscript.c