VirtualBox

Changeset 85845 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Aug 20, 2020 2:28:33 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
140013
Message:

Shared Clipboard/X11: Fixes for empty strings (was too strict before), don't include the terminating zeros when return string lengths to match IPRT. Also should fix the testcases.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/GuestHost/clipboard-helper.h

    r85837 r85845  
    5454 * @param   pcwszSrc            UTF-16 string to return size for.
    5555 * @param   cwcSrc              Length of the string in RTUTF16 units.
    56  * @param   pchLen              Where to return the length (in UTF-8 characters). Includes terminator.
     56 * @param   pchLen              Where to return the length (in UTF-8 characters).
     57 *                              Does not include terminator.
    5758 */
    5859int ShClUtf16LFLenUtf8(PCRTUTF16 pcwszSrc, size_t cwcSrc, size_t *pchLen);
     
    6465 * @param   pcwszSrc            UTF-16 string to return size for.
    6566 * @param   cwcSrc              Length of the source string in RTUTF16 units.
    66  * @param   pchLen              Where to return the length (in UTF-8 characters). Includes terminator.
     67 * @param   pchLen              Where to return the length (in UTF-8 characters).
     68 *                              Does not include terminator.
    6769 */
    6870int ShClUtf16CRLFLenUtf8(PCRTUTF16 pcwszSrc, size_t cwcSrc, size_t *pchLen);
     
    7476 * @param  pcwszSrc             UTF-16 string to return size for.
    7577 * @param  cwcSrc               Length of the source string in RTUTF16 units.
    76  * @param  pchLen               Where to return the length (in UTF-8 characters). Includes terminator.
     78 * @param  pchLen               Where to return the length (in UTF-8 characters).
     79 *                              Does not include terminator.
    7780 */
    7881int ShClUtf16LenUtf8(PCRTUTF16 pcwszSrc, size_t cwcSrc, size_t *pchLen);
     
    8588 * @param   cwcSrc              Size of the string int RTUTF16 units.
    8689 * @param   pwszDst             Buffer to store the converted string to.
    87  * @param   cwcDst              Size of the buffer for the converted string in RTUTF16 units. Includes terminator.
     90 * @param   cwcDst              The size of \a pwszDst in RTUTF16 units.
    8891 */
    8992int ShClConvUtf16LFToCRLF(PCRTUTF16 pcwszSrc, size_t cwcSrc, PRTUTF16 pwszDst, size_t cwcDst);
     
    98101 * @param   cwcSrc              Size of the string int RTUTF16 units.
    99102 * @param   ppwszDst            Where to return the allocated converted string. Must be free'd by the caller.
    100  * @param   pcwDst              Where to return the size of the converted string in RTUTF16 units. Includes terminator.
     103 * @param   pcwDst              Where to return the size of the converted string in RTUTF16 units.
     104 *                              Does not include the terminator.
    101105 */
    102106int ShClConvUtf16LFToCRLFA(PCRTUTF16 pcwszSrc, size_t cwcSrc, PRTUTF16 *ppwszDst, size_t *pcwDst);
     
    109113 * @param   cwcSrc              Size of the string in RTUTF16 units.
    110114 * @param   pwszDst             Where to store the converted string to.
    111  * @param   cwcDst              The size of \a pwszDst in RTUTF16 chars. Includes terminator.
     115 * @param   cwcDst              The size of \a pwszDst in RTUTF16 units.
    112116 */
    113117int ShClConvUtf16CRLFToLF(PCRTUTF16 pcwszSrc, size_t cwcSrc, PRTUTF16 pwszDst, size_t cwcDst);
     
    121125 * @param  pszBuf               Where to write the converted string.
    122126 * @param  cbBuf                The size of the buffer pointed to by @a pszBuf.
    123  * @param  pcbLen               Where to store the size (in bytes) of the converted string. Includes terminator.
     127 * @param  pcbLen               Where to store the size (in bytes) of the converted string.
     128 *                              Does not include terminator.
    124129 */
    125130int ShClConvUtf16CRLFToUtf8LF(PCRTUTF16 pcwszSrc, size_t cbSrc, char *pszBuf, size_t cbBuf, size_t *pcbLen);
     
    143148 * @param  cbSrc                Size of UTF-8 string to convert (in bytes), not counting the terminating zero.
    144149 * @param  ppwszDst             Where to return the allocated buffer on success.
    145  * @param  pcwDst               Where to return the size (in RTUTF16 units) of the allocated buffer on success. Includes terminator.
    146  */
    147 int ShClConvUtf8LFToUtf16CRLF(const char *pcszSrc, unsigned cbSrc, PRTUTF16 *ppwszDst, size_t *pcwDst);
     150 * @param  pcwDst               Where to return the size (in RTUTF16 units) of the allocated buffer on success.
     151 *                              Does not include terminator.
     152 */
     153int ShClConvUtf8LFToUtf16CRLF(const char *pcszSrc, size_t cbSrc, PRTUTF16 *ppwszDst, size_t *pcwDst);
    148154
    149155/**
     
    154160 * @param  cbSrc                Size of string (in bytes), not counting the terminating zero.
    155161 * @param  ppwszDst             Where to return the allocated buffer on success.
    156  * @param  pcwDst               Where to return the size (in RTUTF16 units) of the allocated buffer on success. Includes terminator.
    157  */
    158 int ShClConvLatin1LFToUtf16CRLF(const char *pcszSrc, unsigned cbSrc, PRTUTF16 *ppwszDst, size_t *pcwDst);
     162 * @param  pcwDst               Where to return the size (in RTUTF16 units) of the allocated buffer on success.
     163 *                              Does not include terminator.
     164 */
     165int ShClConvLatin1LFToUtf16CRLF(const char *pcszSrc, size_t cbSrc, PRTUTF16 *ppwszDst, size_t *pcwDst);
    159166
    160167#pragma pack(1)
Note: See TracChangeset for help on using the changeset viewer.

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