aboutsummaryrefslogtreecommitdiff
path: root/include/version_spec.h
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@users.noreply.github.com>2020-05-24 13:25:01 -0400
committerGitHub <noreply@github.com>2020-05-24 13:25:01 -0400
commitc205840e737b23614a686a9675b896106cee5c64 (patch)
treef2eb9d93edb1540221daea3682bf13254d28128c /include/version_spec.h
parent03e39ae5dcd4002ac9657a550c48b8e9f85c449c (diff)
parenta38fbb5766b48a9695ea139f79634fc746642bdd (diff)
downloadspmc-c205840e737b23614a686a9675b896106cee5c64.tar.gz
Merge pull request #37 from jhunkeler/version-fixups
Version fixups
Diffstat (limited to 'include/version_spec.h')
-rw-r--r--include/version_spec.h24
1 files changed, 15 insertions, 9 deletions
diff --git a/include/version_spec.h b/include/version_spec.h
index aab6540..b8d3260 100644
--- a/include/version_spec.h
+++ b/include/version_spec.h
@@ -4,10 +4,11 @@
#ifndef SPM_VERSION_SPEC_H
#define SPM_VERSION_SPEC_H
-#define VERSION_BASE 16
-#define VERSION_ADDENDUM_BITS 16
+#define VERSION_MAX 8
+#define VERSION_BASE 10
#define VERSION_DELIM "."
-#define VERSION_LOCAL "="
+#define VERSION_DELIM_LOCAL "+"
+#define VERSION_LOCAL_MAX 255
#define VERSION_OPERATORS " ~!=<>"
#define VERSION_NOOP 1 << 0
#define VERSION_EQ 1 << 1
@@ -16,13 +17,18 @@
#define VERSION_LT 1 << 4
#define VERSION_COMPAT 1 << 5
-// version_spec.c
-char *version_suffix_get_alpha(char *str);
-char *version_suffix_get_modifier(char *str);
-int64_t version_suffix_modifier_calc(char *str);
-int version_suffix_alpha_calc(char *str);
+struct Version {
+ char *local;
+ uint64_t asInt;
+ uint32_t part[VERSION_MAX];
+};
+
+struct Version *version_init();
+int version_read(struct Version **version, char *s);
+void version_info(struct Version *version);
+
uint64_t version_from(const char *str);
-int version_spec_from(const char *op);
+unsigned int version_spec_from(const char *op);
ManifestPackage **find_by_spec(const Manifest *manifest, const char *name, const char *op, const char *version_str);
int pep440_match(const char *version);
struct PEP440 *pep440_version(const char *version);