2 CTDB event daemon - protocol utilities
4 Copyright (C) Amitay Isaacs 2018
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, see <http://www.gnu.org/licenses/>.
22 #include "event/event_protocol.h"
23 #include "event/event_protocol_api.h"
26 enum ctdb_event_command command
;
28 } event_command_map
[] = {
29 { CTDB_EVENT_CMD_RUN
, "RUN" },
30 { CTDB_EVENT_CMD_STATUS
, "STATUS" },
31 { CTDB_EVENT_CMD_SCRIPT
, "SCRIPT" },
32 { CTDB_EVENT_CMD_MAX
, NULL
},
35 const char *ctdb_event_command_to_string(enum ctdb_event_command command
)
39 for (i
=0; event_command_map
[i
].label
!= NULL
; i
++) {
40 if (event_command_map
[i
].command
== command
) {
41 return event_command_map
[i
].label
;