From b7e55876614b1c55bb4e9cf58003de61c1dd8932 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Thu, 26 Dec 2019 01:26:07 -0500 Subject: Version matching and package searching --- src/strings.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/strings.c') 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; +} -- cgit