From 1ab39058cc1fbe9b2ce48e784284fd0383d537c5 Mon Sep 17 00:00:00 2001 From: Lukasz Rzasik Date: Thu, 29 Dec 2016 15:55:46 -0700 Subject: ovsdb-data: Add support for integer ranges in database commands Adding / removing a range of integers to a column accepting a set of integers requires enumarating all of the integers. This patch simplifies it by introducing 'range' concept to the database commands. Two integers separated by a hyphen represent an inclusive range. The patch adds positive and negative tests for the new syntax. The patch was tested by 'make check'. Covarage was tested by 'make check-lcov'. Signed-off-by: Lukasz Rzasik Suggested-by: Suggested-by: Ben Pfaff Signed-off-by: Ben Pfaff --- lib/util.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/util.h') diff --git a/lib/util.h b/lib/util.h index 5ad25cbb1..aa38122ee 100644 --- a/lib/util.h +++ b/lib/util.h @@ -153,7 +153,9 @@ void ovs_hex_dump(FILE *, const void *, size_t, uintptr_t offset, bool ascii); bool str_to_int(const char *, int base, int *); bool str_to_long(const char *, int base, long *); bool str_to_llong(const char *, int base, long long *); +bool str_to_llong_with_tail(const char *, char **, int base, long long *); bool str_to_uint(const char *, int base, unsigned int *); +bool str_to_llong_range(const char *, int base, long long *, long long *); bool ovs_scan(const char *s, const char *format, ...) OVS_SCANF_FORMAT(2, 3); bool ovs_scan_len(const char *s, int *n, const char *format, ...); -- cgit v1.2.1