diff options
author | Lukasz Rzasik <lukasz.rzasik@gmail.com> | 2016-12-29 15:55:46 -0700 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2017-01-05 08:48:10 -0800 |
commit | 1ab39058cc1fbe9b2ce48e784284fd0383d537c5 (patch) | |
tree | 9ce73e573c744e65074f920111c8f27d01f312fa /lib/util.h | |
parent | 84d0ca5d00fe01b29163236d48fa0f9105687149 (diff) | |
download | openvswitch-1ab39058cc1fbe9b2ce48e784284fd0383d537c5.tar.gz |
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 <lukasz.rzasik@gmail.com>
Suggested-by: <my_ovs_discuss@yahoo.com>
Suggested-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'lib/util.h')
-rw-r--r-- | lib/util.h | 2 |
1 files changed, 2 insertions, 0 deletions
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, ...); |