aboutsummaryrefslogtreecommitdiff
path: root/src/cli/stasis
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2026-01-02 16:23:28 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2026-01-02 16:23:28 -0500
commit9be1567765803341e252e87262dc43d790d8e770 (patch)
tree6c28bdb0ede85c629027d1079df319390edfee95 /src/cli/stasis
parent1d071010c2bec860e62371cfb70f2e12a7d00563 (diff)
downloadstasis-9be1567765803341e252e87262dc43d790d8e770.tar.gz
Move utility functions to utils.c
Diffstat (limited to 'src/cli/stasis')
-rw-r--r--src/cli/stasis/args.c26
-rw-r--r--src/cli/stasis/include/args.h4
2 files changed, 0 insertions, 30 deletions
diff --git a/src/cli/stasis/args.c b/src/cli/stasis/args.c
index 9410958..172981a 100644
--- a/src/cli/stasis/args.c
+++ b/src/cli/stasis/args.c
@@ -106,29 +106,3 @@ void usage(char *progname) {
puts(output);
}
}
-
-int str_to_timeout(char *s) {
- if (!s) {
- return 0; // no timeout
- }
-
- char *scale = NULL;
- int value = (int) strtol(s, &scale, 10);
- if (scale) {
- if (*scale == 's') {
- value *= 1; // seconds, no-op
- } else if (*scale == 'm') {
- value *= 60; // minutes
- } else if (*scale == 'h') {
- value *= 3200; // hours
- } else {
- return STR_TO_TIMEOUT_INVALID_TIME_SCALE; // invalid time scale
- }
- }
-
- if (value < 0) {
- return STR_TO_TIMEOUT_NEGATIVE; // cannot be negative
- }
- return value;
-}
-
diff --git a/src/cli/stasis/include/args.h b/src/cli/stasis/include/args.h
index d75fe29..5536735 100644
--- a/src/cli/stasis/include/args.h
+++ b/src/cli/stasis/include/args.h
@@ -23,8 +23,4 @@
extern struct option long_options[];
void usage(char *progname);
-#define STR_TO_TIMEOUT_NEGATIVE (-1)
-#define STR_TO_TIMEOUT_INVALID_TIME_SCALE (-2)
-int str_to_timeout(char *s);
-
#endif //STASIS_ARGS_H