pacemaker  1.1.18-7fdfbbe
Scalable High-Availability cluster resource manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
election.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2009 Andrew Beekhof <andrew@beekhof.net>
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This software is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 #ifndef CRM_COMMON_ElECTION__H
19 # define CRM_COMMON_ElECTION__H
20 
27 typedef struct election_s election_t;
28 
30 {
36 };
37 
38 void election_fini(election_t *e);
39 void election_reset(election_t *e);
40 election_t *election_init(const char *name, const char *uname, guint period_ms, GSourceFunc cb);
41 
42 void election_timeout_set_period(election_t *e, guint period_ms);
44 
45 void election_vote(election_t *e);
46 bool election_check(election_t *e);
47 void election_remove(election_t *e, const char *uname);
49 enum election_result election_count_vote(election_t *e, xmlNode *vote, bool can_win);
50 
51 #endif
bool election_check(election_t *e)
Definition: election.c:250
enum election_result election_count_vote(election_t *e, xmlNode *vote, bool can_win)
Definition: election.c:304
void election_remove(election_t *e, const char *uname)
Definition: election.c:86
void election_fini(election_t *e)
Definition: election.c:108
void election_vote(election_t *e)
Definition: election.c:208
struct election_s election_t
Definition: election.h:27
char uname[MAX_NAME]
Definition: internal.h:53
election_result
Definition: election.h:29
enum election_result election_state(election_t *e)
Definition: election.c:56
election_t * election_init(const char *name, const char *uname, guint period_ms, GSourceFunc cb)
Definition: election.c:65
void election_timeout_stop(election_t *e)
Definition: election.c:129
void election_reset(election_t *e)
Definition: election.c:94
void election_timeout_set_period(election_t *e, guint period_ms)
Definition: election.c:137