Skip to content
This repository was archived by the owner on Mar 4, 2024. It is now read-only.

Commit 81bbf58

Browse files
author
Mathieu Borderé
committed
raft.h: Add raft_version_number and macros
1 parent ac5cf9e commit 81bbf58

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

include/raft.h

+10
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@
1010

1111
#define RAFT_API __attribute__((visibility("default")))
1212

13+
/**
14+
* Version.
15+
*/
16+
#define RAFT_VERSION_MAJOR 1
17+
#define RAFT_VERSION_MINOR 15
18+
#define RAFT_VERSION_RELEASE 0
19+
#define RAFT_VERSION_NUMBER (RAFT_VERSION_MAJOR *100*100 + RAFT_VERSION_MINOR *100 + RAFT_VERSION_RELEASE)
20+
21+
int raft_version_number (void);
22+
1323
/**
1424
* Error codes.
1525
*/

src/raft.c

+5
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
#define DEFAULT_MAX_CATCH_UP_ROUNDS 10
2525
#define DEFAULT_MAX_CATCH_UP_ROUND_DURATION (5 * 1000)
2626

27+
int raft_version_number (void)
28+
{
29+
return RAFT_VERSION_NUMBER;
30+
}
31+
2732
static int ioFsmVersionCheck(struct raft *r,
2833
struct raft_io *io,
2934
struct raft_fsm *fsm);

0 commit comments

Comments
 (0)