Index: /trunk/include/iprt/string.h
===================================================================
--- /trunk/include/iprt/string.h	(revision 96159)
+++ /trunk/include/iprt/string.h	(revision 96160)
@@ -2873,5 +2873,5 @@
  * @param   pu64            Where to store the converted number. (optional)
  */
-RTDECL(int) RTStrToUInt64Full(const char *pszValue, unsigned uBase, uint64_t *pu64);
+RTDECL(int) RTStrToUInt64Full(const char *pszValue, unsigned uBaseAndMaxLen, uint64_t *pu64);
 
 /**
@@ -2907,5 +2907,5 @@
  * @param   pu32            Where to store the converted number. (optional)
  */
-RTDECL(int) RTStrToUInt32Ex(const char *pszValue, char **ppszNext, unsigned uBase, uint32_t *pu32);
+RTDECL(int) RTStrToUInt32Ex(const char *pszValue, char **ppszNext, unsigned uBaseAndMaxLen, uint32_t *pu32);
 
 /**
@@ -2930,5 +2930,5 @@
  * @param   pu32            Where to store the converted number. (optional)
  */
-RTDECL(int) RTStrToUInt32Full(const char *pszValue, unsigned uBase, uint32_t *pu32);
+RTDECL(int) RTStrToUInt32Full(const char *pszValue, unsigned uBaseAndMaxLen, uint32_t *pu32);
 
 /**
@@ -2964,5 +2964,5 @@
  * @param   pu16            Where to store the converted number. (optional)
  */
-RTDECL(int) RTStrToUInt16Ex(const char *pszValue, char **ppszNext, unsigned uBase, uint16_t *pu16);
+RTDECL(int) RTStrToUInt16Ex(const char *pszValue, char **ppszNext, unsigned uBaseAndMaxLen, uint16_t *pu16);
 
 /**
@@ -2979,10 +2979,13 @@
  * @retval  VERR_TRAILING_CHARS
  *
- * @param   pszValue    Pointer to the string value.
- * @param   uBase       The base of the representation used.
- *                      If 0 the function will look for known prefixes before defaulting to 10.
- * @param   pu16        Where to store the converted number. (optional)
- */
-RTDECL(int) RTStrToUInt16Full(const char *pszValue, unsigned uBase, uint16_t *pu16);
+ * @param   pszValue        Pointer to the string value.
+ * @param   uBaseAndMaxLen  The low byte is the base of the representation, the
+ *                          upper 24 bits are the max length to parse.  If the base
+ *                          is zero the function will look for known prefixes before
+ *                          defaulting to 10.  A max length of zero means no length
+ *                          restriction.
+ * @param   pu16            Where to store the converted number. (optional)
+ */
+RTDECL(int) RTStrToUInt16Full(const char *pszValue, unsigned uBaseAndMaxLen, uint16_t *pu16);
 
 /**
@@ -3018,5 +3021,5 @@
  * @param   pu8             Where to store the converted number. (optional)
  */
-RTDECL(int) RTStrToUInt8Ex(const char *pszValue, char **ppszNext, unsigned uBase, uint8_t *pu8);
+RTDECL(int) RTStrToUInt8Ex(const char *pszValue, char **ppszNext, unsigned uBaseAndMaxLen, uint8_t *pu8);
 
 /**
@@ -3041,5 +3044,5 @@
  * @param   pu8             Where to store the converted number. (optional)
  */
-RTDECL(int) RTStrToUInt8Full(const char *pszValue, unsigned uBase, uint8_t *pu8);
+RTDECL(int) RTStrToUInt8Full(const char *pszValue, unsigned uBaseAndMaxLen, uint8_t *pu8);
 
 /**
@@ -3064,11 +3067,15 @@
  * @retval  VERR_NO_DIGITS
  *
- * @param   pszValue    Pointer to the string value.
- * @param   ppszNext    Where to store the pointer to the first char following the number. (Optional)
- * @param   uBase       The base of the representation used.
- *                      If 0 the function will look for known prefixes before defaulting to 10.
- * @param   pi64        Where to store the converted number. (optional)
- */
-RTDECL(int) RTStrToInt64Ex(const char *pszValue, char **ppszNext, unsigned uBase, int64_t *pi64);
+ * @param   pszValue        Pointer to the string value.
+ * @param   ppszNext        Where to store the pointer to the first char
+ *                          following the number. (Optional)
+ * @param   uBaseAndMaxLen  The low byte is the base of the representation, the
+ *                          upper 24 bits are the max length to parse.  If the base
+ *                          is zero the function will look for known prefixes before
+ *                          defaulting to 10.  A max length of zero means no length
+ *                          restriction.
+ * @param   pi64            Where to store the converted number. (optional)
+ */
+RTDECL(int) RTStrToInt64Ex(const char *pszValue, char **ppszNext, unsigned uBaseAndMaxLen, int64_t *pi64);
 
 /**
@@ -3084,10 +3091,13 @@
  * @retval  VERR_NO_DIGITS
  *
- * @param   pszValue    Pointer to the string value.
- * @param   uBase       The base of the representation used.
- *                      If 0 the function will look for known prefixes before defaulting to 10.
- * @param   pi64        Where to store the converted number. (optional)
- */
-RTDECL(int) RTStrToInt64Full(const char *pszValue, unsigned uBase, int64_t *pi64);
+ * @param   pszValue        Pointer to the string value.
+ * @param   uBaseAndMaxLen  The low byte is the base of the representation, the
+ *                          upper 24 bits are the max length to parse.  If the base
+ *                          is zero the function will look for known prefixes before
+ *                          defaulting to 10.  A max length of zero means no length
+ *                          restriction.
+ * @param   pi64            Where to store the converted number. (optional)
+ */
+RTDECL(int) RTStrToInt64Full(const char *pszValue, unsigned uBaseAndMaxLen, int64_t *pi64);
 
 /**
@@ -3112,11 +3122,15 @@
  * @retval  VERR_NO_DIGITS
  *
- * @param   pszValue    Pointer to the string value.
- * @param   ppszNext    Where to store the pointer to the first char following the number. (Optional)
- * @param   uBase       The base of the representation used.
- *                      If 0 the function will look for known prefixes before defaulting to 10.
- * @param   pi32        Where to store the converted number. (optional)
- */
-RTDECL(int) RTStrToInt32Ex(const char *pszValue, char **ppszNext, unsigned uBase, int32_t *pi32);
+ * @param   pszValue        Pointer to the string value.
+ * @param   ppszNext        Where to store the pointer to the first char
+ *                          following the number. (Optional)
+ * @param   uBaseAndMaxLen  The low byte is the base of the representation, the
+ *                          upper 24 bits are the max length to parse.  If the base
+ *                          is zero the function will look for known prefixes before
+ *                          defaulting to 10.  A max length of zero means no length
+ *                          restriction.
+ * @param   pi32            Where  to store the converted number. (optional)
+ */
+RTDECL(int) RTStrToInt32Ex(const char *pszValue, char **ppszNext, unsigned uBaseAndMaxLen, int32_t *pi32);
 
 /**
@@ -3132,10 +3146,13 @@
  * @retval  VERR_NO_DIGITS
  *
- * @param   pszValue    Pointer to the string value.
- * @param   uBase       The base of the representation used.
- *                      If 0 the function will look for known prefixes before defaulting to 10.
- * @param   pi32        Where to store the converted number. (optional)
- */
-RTDECL(int) RTStrToInt32Full(const char *pszValue, unsigned uBase, int32_t *pi32);
+ * @param   pszValue        Pointer to the string value.
+ * @param   uBaseAndMaxLen  The low byte is the base of the representation, the
+ *                          upper 24 bits are the max length to parse.  If the base
+ *                          is zero the function will look for known prefixes before
+ *                          defaulting to 10.  A max length of zero means no length
+ *                          restriction.
+ * @param   pi32            Where to store the converted number. (optional)
+ */
+RTDECL(int) RTStrToInt32Full(const char *pszValue, unsigned uBaseAndMaxLen, int32_t *pi32);
 
 /**
@@ -3160,11 +3177,15 @@
  * @retval  VERR_NO_DIGITS
  *
- * @param   pszValue    Pointer to the string value.
- * @param   ppszNext    Where to store the pointer to the first char following the number. (Optional)
- * @param   uBase       The base of the representation used.
- *                      If 0 the function will look for known prefixes before defaulting to 10.
- * @param   pi16        Where to store the converted number. (optional)
- */
-RTDECL(int) RTStrToInt16Ex(const char *pszValue, char **ppszNext, unsigned uBase, int16_t *pi16);
+ * @param   pszValue        Pointer to the string value.
+ * @param   ppszNext        Where to store the pointer to the first char
+ *                          following the number. (Optional)
+ * @param   uBaseAndMaxLen  The low byte is the base of the representation, the
+ *                          upper 24 bits are the max length to parse.  If the base
+ *                          is zero the function will look for known prefixes before
+ *                          defaulting to 10.  A max length of zero means no length
+ *                          restriction.
+ * @param   pi16            Where to store the converted number. (optional)
+ */
+RTDECL(int) RTStrToInt16Ex(const char *pszValue, char **ppszNext, unsigned uBaseAndMaxLen, int16_t *pi16);
 
 /**
@@ -3180,10 +3201,13 @@
  * @retval  VERR_NO_DIGITS
  *
- * @param   pszValue    Pointer to the string value.
- * @param   uBase       The base of the representation used.
- *                      If 0 the function will look for known prefixes before defaulting to 10.
- * @param   pi16        Where to store the converted number. (optional)
- */
-RTDECL(int) RTStrToInt16Full(const char *pszValue, unsigned uBase, int16_t *pi16);
+ * @param   pszValue        Pointer to the string value.
+ * @param   uBaseAndMaxLen  The low byte is the base of the representation, the
+ *                          upper 24 bits are the max length to parse.  If the base
+ *                          is zero the function will look for known prefixes before
+ *                          defaulting to 10.  A max length of zero means no length
+ *                          restriction.
+ * @param   pi16            Where to store the converted number. (optional)
+ */
+RTDECL(int) RTStrToInt16Full(const char *pszValue, unsigned uBaseAndMaxLen, int16_t *pi16);
 
 /**
@@ -3208,11 +3232,15 @@
  * @retval  VERR_NO_DIGITS
  *
- * @param   pszValue    Pointer to the string value.
- * @param   ppszNext    Where to store the pointer to the first char following the number. (Optional)
- * @param   uBase       The base of the representation used.
- *                      If 0 the function will look for known prefixes before defaulting to 10.
- * @param   pi8         Where to store the converted number. (optional)
- */
-RTDECL(int) RTStrToInt8Ex(const char *pszValue, char **ppszNext, unsigned uBase, int8_t *pi8);
+ * @param   pszValue        Pointer to the string value.
+ * @param   ppszNext        Where to store the pointer to the first char
+ *                          following the number. (Optional)
+ * @param   uBaseAndMaxLen  The low byte is the base of the representation, the
+ *                          upper 24 bits are the max length to parse.  If the base
+ *                          is zero the function will look for known prefixes before
+ *                          defaulting to 10.  A max length of zero means no length
+ *                          restriction.
+ * @param   pi8             Where to store the converted number. (optional)
+ */
+RTDECL(int) RTStrToInt8Ex(const char *pszValue, char **ppszNext, unsigned uBaseAndMaxLen, int8_t *pi8);
 
 /**
@@ -3228,10 +3256,13 @@
  * @retval  VERR_NO_DIGITS
  *
- * @param   pszValue    Pointer to the string value.
- * @param   uBase       The base of the representation used.
- *                      If 0 the function will look for known prefixes before defaulting to 10.
- * @param   pi8         Where to store the converted number. (optional)
- */
-RTDECL(int) RTStrToInt8Full(const char *pszValue, unsigned uBase, int8_t *pi8);
+ * @param   pszValue        Pointer to the string value.
+ * @param   uBaseAndMaxLen  The low byte is the base of the representation, the
+ *                          upper 24 bits are the max length to parse.  If the base
+ *                          is zero the function will look for known prefixes before
+ *                          defaulting to 10.  A max length of zero means no length
+ *                          restriction.
+ * @param   pi8             Where to store the converted number. (optional)
+ */
+RTDECL(int) RTStrToInt8Full(const char *pszValue, unsigned uBaseAndMaxLen, int8_t *pi8);
 
 /**
@@ -3244,4 +3275,82 @@
  */
 RTDECL(int8_t) RTStrToInt8(const char *pszValue);
+
+
+/**
+ * Converts a string to long double floating point, extended edition.
+ *
+ * Please note that long double can be double precision, extended precision, or
+ * quad precision floating point depending on the platform and architecture. See
+ * RT_COMPILER_WITH_128BIT_LONG_DOUBLE and RT_COMPILER_WITH_80BIT_LONG_DOUBLE.
+ *
+ * @returns IPRT status code.
+ * @retval  VERR_NO_DIGITS if no valid digits found.
+ * @retval  VWRN_FLOAT_UNDERFLOW on underflow with denormal/subnormal return
+ *          value
+ * @retval  VERR_FLOAT_UNDERFLOW on underflow, value set to +/- zero.
+ * @retval  VERR_FLOAT_OVERFLOW on overflow, value set to +/- infinity.
+ * @retval  VWRN_TRAILING_CHARS
+ * @retval  VWRN_TRAILING_SPACES
+ *
+ * @param   pszValue    The string to parse.
+ * @param   ppszNext    Where to store the pointer to the first char following
+ *                      the number.  Optional.
+ * @param   cchMax      Max number of character to parse.  Zero means unlimited.
+ * @param   plrd        Where to return the number.  Optional.
+ *
+ * @note    This code isn't entirely perfect yet.  It could exhibit rounding
+ *          differences compared to strtold & the compiler, and extreme value
+ *          may overflow/underflow prematurely depending on the build config.
+ */
+RTDECL(int) RTStrToLongDoubleEx(const char *pszValue, char **ppszNext, size_t cchMax, long double *plrd);
+
+/**
+ * Converts a string to double precision floating point, extended edition.
+ *
+ * @returns IPRT status code.
+ * @retval  VERR_NO_DIGITS if no valid digits found.
+ * @retval  VWRN_FLOAT_UNDERFLOW on underflow with denormal/subnormal return
+ *          value
+ * @retval  VERR_FLOAT_UNDERFLOW on underflow, value set to +/- zero.
+ * @retval  VERR_FLOAT_OVERFLOW on overflow, value set to +/- infinity.
+ * @retval  VWRN_TRAILING_CHARS
+ * @retval  VWRN_TRAILING_SPACES
+ *
+ * @param   pszValue    The string to parse.
+ * @param   ppszNext    Where to store the pointer to the first char following
+ *                      the number.  Optional.
+ * @param   cchMax      Max number of character to parse.  Zero means unlimited.
+ * @param   plrd        Where to return the number.  Optional.
+ *
+ * @note    This code isn't entirely perfect yet.  It could exhibit rounding
+ *          differences compared to strtold & the compiler, and extreme value
+ *          may overflow/underflow prematurely depending on the build config.
+ */
+RTDECL(int) RTStrToDoubleEx(const char *pszValue, char **ppszNext, size_t cchMax, double *prd);
+
+/**
+ * Converts a string to single precision floating point, extended edition.
+ *
+ * @returns IPRT status code.
+ * @retval  VERR_NO_DIGITS if no valid digits found.
+ * @retval  VWRN_FLOAT_UNDERFLOW on underflow with denormal/subnormal return
+ *          value
+ * @retval  VERR_FLOAT_UNDERFLOW on underflow, value set to +/- zero.
+ * @retval  VERR_FLOAT_OVERFLOW on overflow, value set to +/- infinity.
+ * @retval  VWRN_TRAILING_CHARS
+ * @retval  VWRN_TRAILING_SPACES
+ *
+ * @param   pszValue    The string to parse.
+ * @param   ppszNext    Where to store the pointer to the first char following
+ *                      the number.  Optional.
+ * @param   cchMax      Max number of character to parse.  Zero means unlimited.
+ * @param   plrd        Where to return the number.  Optional.
+ *
+ * @note    This code isn't entirely perfect yet.  It could exhibit rounding
+ *          differences compared to strtold & the compiler, and extreme value
+ *          may overflow/underflow prematurely depending on the build config.
+ */
+RTDECL(int) RTStrToFloatEx(const char *pszValue, char **ppszNext, size_t cchMax, float *pr);
+
 
 /**
@@ -3324,9 +3433,4 @@
 RTDECL(int) RTStrConvertHexBytesEx(char const *pszHex, void *pv, size_t cb, uint32_t fFlags,
                                    const char **ppszNext, size_t *pcbReturned);
-
-
-RTDECL(int) RTStrToLongDoubleEx(const char *pszValue, char **ppszNext, size_t cchMax, long double *plrd);
-RTDECL(int) RTStrToDoubleEx(const char *pszValue, char **ppszNext, size_t cchMax, double *prd);
-RTDECL(int) RTStrToFloatEx(const char *pszValue, char **ppszNext, size_t cchMax, float *pr);
 
 /** @} */
