aboutsummaryrefslogtreecommitdiff
path: root/include/version_spec.h
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2020-02-11 11:43:25 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2020-02-11 11:43:25 -0500
commit9bd603b639d7dd08fbe0af7e8669358bd066b7cd (patch)
tree8207b9680cc33846ff7d9ce0c8917aa052766c43 /include/version_spec.h
parentb828cc647f63de48c6e24f5a1043e052eb99b2a2 (diff)
downloadspmc-9bd603b639d7dd08fbe0af7e8669358bd066b7cd.tar.gz
Refactor project structure:
* Move prototypes and definitions to respective header files * Renamed strings.h to str.h to avoid collision with standard library header
Diffstat (limited to 'include/version_spec.h')
-rw-r--r--include/version_spec.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/version_spec.h b/include/version_spec.h
new file mode 100644
index 0000000..995d24a
--- /dev/null
+++ b/include/version_spec.h
@@ -0,0 +1,21 @@
+#ifndef SPM_VERSION_SPEC_H
+#define SPM_VERSION_SPEC_H
+
+#define VERSION_OPERATORS " ~!=<>"
+#define VERSION_NOOP 1 << 0
+#define VERSION_EQ 1 << 1
+#define VERSION_NE 1 << 2
+#define VERSION_GT 1 << 3
+#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);
+int64_t version_from(const char *version_str);
+int version_spec_from(const char *op);
+ManifestPackage **find_by_spec(Manifest *manifest, const char *name, const char *op, const char *version_str);
+
+#endif //SPM_VERSION_SPEC_H