summaryrefslogtreecommitdiff
path: root/shared/semver.c
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-05-26 14:45:36 +0200
committerlonkaars <loek@pipeframe.xyz>2022-05-26 14:45:36 +0200
commitfda1e9389c4bcef89a2bcdd2c01f0727e9efdb18 (patch)
tree32c558a3d0e7b2ce10fae84d1ce61460138fe73c /shared/semver.c
parent2a88cf72a211746f4da582850dc5d65ea7bfd4dc (diff)
add semver parsing, more error codes and verify avr compilation compatibility
Diffstat (limited to 'shared/semver.c')
-rw-r--r--shared/semver.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/shared/semver.c b/shared/semver.c
new file mode 100644
index 0000000..07a7057
--- /dev/null
+++ b/shared/semver.c
@@ -0,0 +1,9 @@
+#include "semver.h"
+
+#include <stdio.h>
+
+w2_semver_t w2_semver_parse(const char *str, uint8_t length) {
+ w2_semver_t version;
+ sscanf(str, "%d.%d.%d", (int *)&version.major, (int *)&version.minor, (int *)&version.patch);
+ return version;
+}