diff options
author | Swen Schillig <swen@linux.ibm.com> | 2019-06-25 10:25:08 +0200 |
---|---|---|
committer | Ralph Boehme <slow@samba.org> | 2019-06-30 11:32:18 +0000 |
commit | 7fd0cd02b75782dc6e9a4755d3404e738a92e719 (patch) | |
tree | 5942d409584e47d3a004ca1a27d1fc00ee10a260 | |
parent | ba021e3cfb2d8497f0e62001782387547e996ded (diff) | |
download | samba-7fd0cd02b75782dc6e9a4755d3404e738a92e719.tar.gz |
lib: Add flag definitions to control the internal string to int conversion routines
The following flags are defined intially
SMB_STR_STANDARD # raise error if negative or non-numeric
SMB_STR_ALLOW_NEGATIVE # allow strings with a leading "-"
SMB_STR_FULL_STR_CONV # entire string must be converted
SMB_STR_ALLOW_NO_CONVERSION # allow empty strings or non-numeric
SMB_STR_GLIBC_STANDARD # act exactly as the standard glibc strtoul
Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
-rw-r--r-- | lib/util/util.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/util/util.h b/lib/util/util.h index fcd81759b9c..2ed036358d0 100644 --- a/lib/util/util.h +++ b/lib/util/util.h @@ -21,6 +21,13 @@ #ifndef __UTIL_SAMBA_UTIL_H__ #define __UTIL_SAMBA_UTIL_H__ +#define SMB_STR_STANDARD 0x00 +#define SMB_STR_ALLOW_NEGATIVE 0x01 +#define SMB_STR_FULL_STR_CONV 0x02 +#define SMB_STR_ALLOW_NO_CONVERSION 0x04 +#define SMB_STR_GLIBC_STANDARD (SMB_STR_ALLOW_NO_CONVERSION | \ + SMB_STR_ALLOW_NEGATIVE) + unsigned long int strtoul_err(const char *nptr, char **endptr, int base, int *err); |