+
+/* function: get_range_bounds
+ * Parse a range string like "1_3,5_20" and return 1,3 as lower and upper.
+ * Note: '_' is separator for bounds integer delimiter and
+ * ',' is considered as separator for range pair.
+ * returns TRUE when both range values are found
+ */
+boolean_t
+get_range_bounds(char *c, int64_t *lower, int64_t *upper)
+{
+ if (c == NULL || lower == NULL || upper == NULL) {
+ return FALSE;
+ }
+
+ if (NUM != getval(c, lower, israngesep, TRUE)) {
+ return FALSE;
+ }
+
+ while (*c != '\0') {
+ if (*c == '_') {
+ break;
+ }
+ c++;
+ }
+
+ if (*c == '_') {
+ c++;
+ if (NUM != getval(c, upper, israngesep, TRUE)) {
+ return FALSE;
+ }
+ } else {
+ return FALSE;
+ }
+ return TRUE;
+}