diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-08-05 11:17:08 +0200 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-07-05 08:50:50 +0200 |
commit | 50875bd0105ae2cce809a336dd5a356d4984d971 (patch) | |
tree | 2be01fb868da85296142f39d90f0cc7b5a2c3b8d /src/basic/parse-util.h | |
parent | 80e82f41a485f3045812becb3f6ced94f4d78eed (diff) |
util-lib: unify parsing of nice level values
This adds parse_nice() that parses a nice level and ensures it is in the right
range, via a new nice_is_valid() helper. It then ports over a number of users
to this.
No functional changes.
Diffstat (limited to 'src/basic/parse-util.h')
-rw-r--r-- | src/basic/parse-util.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/basic/parse-util.h b/src/basic/parse-util.h index e9e270904..2bcbadecf 100644 --- a/src/basic/parse-util.h +++ b/src/basic/parse-util.h @@ -110,3 +110,5 @@ int parse_fractional_part_u(const char **s, size_t digits, unsigned *res); int parse_percent_unbounded(const char *p); int parse_percent(const char *p); + +int parse_nice(const char *p, int *ret); |