aboutsummaryrefslogtreecommitdiff
path: root/src/strings.c
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2019-12-26 01:26:07 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2019-12-26 01:26:07 -0500
commitb7e55876614b1c55bb4e9cf58003de61c1dd8932 (patch)
tree7a2780245761d9734ef64f33a9ab2abe4bf77d1c /src/strings.c
parentb85bae06b45a02f89c08065fd672b969d4c43f1b (diff)
downloadspmc-b7e55876614b1c55bb4e9cf58003de61c1dd8932.tar.gz
Version matching and package searching
Diffstat (limited to 'src/strings.c')
-rw-r--r--src/strings.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/strings.c b/src/strings.c
index 52f81b5..e50daeb 100644
--- a/src/strings.c
+++ b/src/strings.c
@@ -485,3 +485,21 @@ int isquoted(char *sptr) {
}
return 1;
}
+
+/**
+ * Determine whether the input character is a relational operator
+ * Note: `~` is non-standard
+ * @param ch
+ * @return 0=no, 1=yes
+ */
+int isrelational(char ch) {
+ char symbols[] = "~!=<>";
+ char *symbol = symbols;
+ while (*symbol != '\0') {
+ if (ch == *symbol) {
+ return 1;
+ }
+ symbol++;
+ }
+ return 0;
+}