Skip to content

Commit

Permalink
Moving back API functions to parser.c
Browse files Browse the repository at this point in the history
  • Loading branch information
moticless committed Nov 10, 2024
1 parent 2bf975e commit 7a70fb0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
11 changes: 11 additions & 0 deletions src/lib/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,17 @@ _LIBRDB_API int RDB_handleByLevel(RdbParser *p, RdbDataType type, RdbHandlersLev
return 0;
}

_LIBRDB_API const char *RDB_getLibVersion(int *major, int *minor, int *patch) {
if (major) *major = LIBRDB_MAJOR_VERSION;
if (minor) *minor = LIBRDB_MINOR_VERSION;
if (patch) *patch = LIBRDB_PATCH_VERSION;
return LIBRDB_VERSION_STRING;
}

_LIBRDB_API int RDB_getMaxSuppportRdbVersion(void) {
return LIBRDB_SUPPORT_MAX_RDB_VER;
}

/*** various functions ***/

static inline RdbDataType getDataType(int opcode) {
Expand Down
14 changes: 0 additions & 14 deletions src/lib/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#include <assert.h>

#include "version.h"
#include "parser.h"

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

Expand All @@ -18,16 +17,3 @@ STATIC_ASSERT(
(__builtin_strcmp(LIBRDB_VERSION_STRING, LIBRDB_COMPOSED_VERSION_STRING) == 0),
"LIBRDB_VERSION_STRING does not match the individual version components"
);

/*** LIB API functions ***/

_LIBRDB_API const char *RDB_getLibVersion(int *major, int *minor, int *patch) {
if (major) *major = LIBRDB_MAJOR_VERSION;
if (minor) *minor = LIBRDB_MINOR_VERSION;
if (patch) *patch = LIBRDB_PATCH_VERSION;
return LIBRDB_VERSION_STRING;
}

_LIBRDB_API int RDB_getMaxSuppportRdbVersion(void) {
return LIBRDB_SUPPORT_MAX_RDB_VER;
}

0 comments on commit 7a70fb0

Please sign in to comment.