66typedef struct raft_data_t * raft_t ;
77typedef struct raft_msg_data_t * raft_msg_t ;
88
9+ typedef int raft_bool_t ;
10+
911typedef struct raft_update_t {
1012 int len ;
1113 char * data ;
@@ -17,7 +19,7 @@ typedef struct raft_update_t {
1719// This should be a function that applies an 'update' to the state machine.
1820// 'snapshot' is true if 'update' contains a snapshot. 'userdata' is the
1921// userdata that raft was configured with.
20- typedef void (* raft_applier_t )(void * userdata , raft_update_t update , bool snapshot );
22+ typedef void (* raft_applier_t )(void * userdata , raft_update_t update , raft_bool_t snapshot );
2123
2224// This should be a function that makes a snapshot of the state machine. Used
2325// for raft log compaction. 'userdata' is the userdata that raft was configured
@@ -48,10 +50,10 @@ raft_t raft_init(raft_config_t *config);
4850
4951// Add a peer named 'id'. 'self' should be true, if that peer is this instance.
5052// Only one peer should have 'self' == true.
51- bool raft_peer_up (raft_t r , int id , char * host , int port , bool self );
53+ raft_bool_t raft_peer_up (raft_t r , int id , char * host , int port , raft_bool_t self );
5254
5355// Remove a previously added peer named 'id'.
54- bool raft_peer_down (raft_t r , int id );
56+ raft_bool_t raft_peer_down (raft_t r , int id );
5557
5658// --- Log Actions ---
5759
@@ -60,7 +62,7 @@ bool raft_peer_down(raft_t r, int id);
6062int raft_emit (raft_t r , raft_update_t update );
6163
6264// Checks whether an entry at 'index' has been applied by the peer named 'id'.
63- bool raft_applied (raft_t t , int id , int index );
65+ raft_bool_t raft_applied (raft_t t , int id , int index );
6466
6567// --- Control ---
6668
@@ -85,7 +87,7 @@ void raft_handle_message(raft_t r, raft_msg_t m);
8587int raft_create_udp_socket (raft_t r );
8688
8789// Returns true if this peer thinks it is the leader.
88- bool raft_is_leader (raft_t r );
90+ raft_bool_t raft_is_leader (raft_t r );
8991
9092// Returns the id of the current leader, or NOBODY if no leader.
9193int raft_get_leader (raft_t r );
0 commit comments