VirtualBox

Changeset 93057 in vbox for trunk/include


Ignore:
Timestamp:
Dec 22, 2021 2:21:25 PM (3 years ago)
Author:
vboxsync
Message:

IPRT: Added RTStrDupNEx and RTStrDupNExTag.

Location:
trunk/include/iprt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/mangling.h

    r93019 r93057  
    22282228# define RTStrDupExTag                                  RT_MANGLER(RTStrDupExTag)
    22292229# define RTStrDupNTag                                   RT_MANGLER(RTStrDupNTag)
     2230# define RTStrDupNExTag                                 RT_MANGLER(RTStrDupNExTag)
    22302231# define RTStrDupTag                                    RT_MANGLER(RTStrDupTag)
    22312232# define RTStrEnd                                       RT_MANGLER(RTStrEnd)
  • trunk/include/iprt/string.h

    r88128 r93057  
    310310 *
    311311 * @returns iprt status code.
    312  * @param   ppszString      Receives pointer of the allocated UTF-8 string.
     312 * @param   ppszCopy        Receives pointer of the allocated UTF-8 string.
    313313 *                          The returned pointer must be freed using RTStrFree().
    314314 * @param   pszString       UTF-8 string to duplicate.
    315315 */
    316 #define RTStrDupEx(ppszString, pszString)   RTStrDupExTag((ppszString), (pszString), RTSTR_TAG)
     316#define RTStrDupEx(ppszCopy, pszString)     RTStrDupExTag((ppszCopy), (pszString), RTSTR_TAG)
    317317
    318318/**
     
    320320 *
    321321 * @returns iprt status code.
    322  * @param   ppszString      Receives pointer of the allocated UTF-8 string.
     322 * @param   ppszCopy        Receives pointer of the allocated UTF-8 string.
    323323 *                          The returned pointer must be freed using RTStrFree().
    324324 * @param   pszString       UTF-8 string to duplicate.
    325325 * @param   pszTag          Allocation tag used for statistics and such.
    326326 */
    327 RTDECL(int)  RTStrDupExTag(char **ppszString, const char *pszString, const char *pszTag);
     327RTDECL(int)  RTStrDupExTag(char **ppszCopy, const char *pszString, const char *pszTag);
    328328
    329329/**
     
    347347 */
    348348RTDECL(char *) RTStrDupNTag(const char *pszString, size_t cchMax, const char *pszTag);
     349
     350/**
     351 * Allocates a new copy of the given UTF-8 substring (default tag).
     352 *
     353 * @returns iprt status code (VINF_SUCCESS or VERR_NO_STR_MEMORY).
     354 * @param   ppszCopy        Receives pointer of the allocated UTF-8 substring.
     355 *                          The returned pointer must be freed using RTStrFree().
     356 * @param   pszString       UTF-8 string to duplicate.
     357 * @param   cchMax          The max number of chars to duplicate, not counting
     358 *                          the terminator.
     359 * @param   pszTag          Allocation tag used for statistics and such.
     360 */
     361#define RTStrDupNEx(ppszCopy, pszString, cchMax)    RTStrDupNExTag((ppszCopy), (pszString), (cchMax), RTSTR_TAG)
     362
     363/**
     364 * Allocates a new copy of the given UTF-8 substring (custom tag).
     365 *
     366 * @returns iprt status code (VINF_SUCCESS or VERR_NO_STR_MEMORY).
     367 * @param   ppszCopy        Receives pointer of the allocated UTF-8 substring.
     368 *                          The returned pointer must be freed using RTStrFree().
     369 * @param   pszString       UTF-8 string to duplicate.
     370 * @param   cchMax          The max number of chars to duplicate, not counting
     371 *                          the terminator.
     372 * @param   pszTag          Allocation tag used for statistics and such.
     373 */
     374RTDECL(int) RTStrDupNExTag(char **ppszCopy, const char *pszString, size_t cchMax, const char *pszTag);
    349375
    350376/**
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette