summaryrefslogtreecommitdiff
path: root/c_src/tools-util.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2025-07-07 16:13:35 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2025-07-07 16:14:18 -0400
commit39c00050d2f273cd2af28db4546e55f20d1ae2db (patch)
tree113f039f98e5a85edf7a19d2f17a87f3c3214bdc /c_src/tools-util.c
parentec23efce867a316f2f82df37fc5efd84bbdc7020 (diff)
bpos_parse(): parse symbolic constants
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'c_src/tools-util.c')
-rw-r--r--c_src/tools-util.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/c_src/tools-util.c b/c_src/tools-util.c
index 150925eb..a31adcb0 100644
--- a/c_src/tools-util.c
+++ b/c_src/tools-util.c
@@ -681,6 +681,15 @@ static int kstrtouint_symbolic(const char *s, unsigned int base, unsigned *res)
struct bpos bpos_parse(char *buf)
{
+ if (!strcmp(buf, "POS_MIN"))
+ return POS_MIN;
+
+ if (!strcmp(buf, "POS_MAX"))
+ return POS_MAX;
+
+ if (!strcmp(buf, "SPOS_MAX"))
+ return SPOS_MAX;
+
char *orig = strdup(buf);
char *s = buf;