Skip to content

Commit 128da4b

Browse files
committed
Moving version related functions to version.c
1 parent 0370b40 commit 128da4b

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

src/lib/parser.c

-11
Original file line numberDiff line numberDiff line change
@@ -588,17 +588,6 @@ _LIBRDB_API int RDB_handleByLevel(RdbParser *p, RdbDataType type, RdbHandlersLev
588588
return 0;
589589
}
590590

591-
_LIBRDB_API const char *RDB_getLibVersion(int *major, int *minor, int *patch) {
592-
if (major) *major = LIBRDB_MAJOR_VERSION;
593-
if (minor) *minor = LIBRDB_MINOR_VERSION;
594-
if (patch) *patch = LIBRDB_PATCH_VERSION;
595-
return LIBRDB_VERSION_STRING;
596-
}
597-
598-
_LIBRDB_API int RDB_getMaxSuppportRdbVersion(void) {
599-
return LIBRDB_SUPPORT_MAX_RDB_VER;
600-
}
601-
602591
/*** various functions ***/
603592

604593
static inline RdbDataType getDataType(int opcode) {

src/lib/version.c

+16
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
#include <stddef.h>
2+
13
#include "version.h"
4+
#include "../../api/librdb-api.h"
25

36
#define STATIC_ASSERT(COND,MSG) typedef char static_assertion[(COND)?1:-1]
47

@@ -14,3 +17,16 @@ STATIC_ASSERT(
1417
(__builtin_strcmp(LIBRDB_VERSION_STRING, LIBRDB_COMPOSED_VERSION_STRING) == 0),
1518
"LIBRDB_VERSION_STRING does not match the individual version components"
1619
);
20+
21+
/*** LIB API functions ***/
22+
23+
_LIBRDB_API const char *RDB_getLibVersion(int *major, int *minor, int *patch) {
24+
if (major) *major = LIBRDB_MAJOR_VERSION;
25+
if (minor) *minor = LIBRDB_MINOR_VERSION;
26+
if (patch) *patch = LIBRDB_PATCH_VERSION;
27+
return LIBRDB_VERSION_STRING;
28+
}
29+
30+
_LIBRDB_API int RDB_getMaxSuppportRdbVersion(void) {
31+
return LIBRDB_SUPPORT_MAX_RDB_VER;
32+
}

0 commit comments

Comments
 (0)