VirtualBox

Changeset 91789 in vbox


Ignore:
Timestamp:
Oct 17, 2021 6:16:11 PM (3 years ago)
Author:
vboxsync
Message:

SUPDrv,IPRT,VBoxGuest: Don't export ellipsis functions from SUPDrv, as that makes switching back to the kernel stack unsafe. Exports has changes (added+removed), but not bumping major IOC version as that was done a few hours ago already and it's Sunday. bugref:10124

Location:
trunk
Files:
3 added
26 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/sup.h

    r91785 r91789  
    22102210
    22112211/**
     2212 * Writes to the debugger and/or kernel log, va_list version.
     2213 *
     2214 * The length of the formatted message is somewhat limited, so keep things short
     2215 * and to the point.
     2216 *
     2217 * @returns Number of bytes written, mabye.
     2218 * @param   pszFormat       IPRT format string.
     2219 * @param   va              Arguments referenced by the format string.
     2220 */
     2221SUPR0DECL(int)  SUPR0PrintfV(const char *pszFormat, va_list va) RT_IPRT_FORMAT_ATTR(1, 0);
     2222
     2223/**
    22122224 * Writes to the debugger and/or kernel log.
    22132225 *
     
    22192231 * @param   ...             Arguments referenced by the format string.
    22202232 */
    2221 SUPR0DECL(int)  SUPR0Printf(const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(1, 2);
     2233DECLINLINE(int) SUPR0Printf(const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(1, 2); /* RT_IPRT_FORMAT_ATTR only allowed on proto */
     2234DECLINLINE(int) SUPR0Printf(const char *pszFormat, ...)
     2235{
     2236    va_list va;
     2237    va_start(va, pszFormat);
     2238    SUPR0PrintfV(pszFormat, va);
     2239    va_end(va);
     2240    return 0;
     2241}
    22222242
    22232243#ifdef IN_RING0
  • trunk/include/iprt/log.h

    r90974 r91789  
    21242124 * @param   ...         Format arguments.
    21252125 */
    2126 RTR0DECL(int) RTLogSetR0ThreadNameF(PRTLOGGER pLogger, const char *pszNameFmt, ...) RT_IPRT_FORMAT_ATTR(1, 2);
     2126RTR0DECL(int) RTLogSetR0ThreadNameF(PRTLOGGER pLogger, const char *pszNameFmt, ...) RT_IPRT_FORMAT_ATTR(2, 3);
     2127
     2128/**
     2129 * Sets the thread name for a thread specific ring-0 logger.
     2130 *
     2131 * @returns IPRT status code.
     2132 * @param   pLogger     The logger. NULL is not allowed.
     2133 * @param   pszNameFmt  The format string for the thread name.
     2134 * @param   va          Format arguments.
     2135 */
     2136RTR0DECL(int) RTLogSetR0ThreadNameV(PRTLOGGER pLogger, const char *pszNameFmt, va_list va) RT_IPRT_FORMAT_ATTR(2, 0);
    21272137
    21282138/**
     
    23532363 * @param   args        Format arguments.
    23542364 */
    2355 RTDECL(void) RTLogLoggerV(PRTLOGGER pLogger, const char *pszFormat, va_list args) RT_IPRT_FORMAT_ATTR(3, 0);
     2365RTDECL(void) RTLogLoggerV(PRTLOGGER pLogger, const char *pszFormat, va_list args) RT_IPRT_FORMAT_ATTR(2, 0);
    23562366
    23572367/**
  • trunk/src/VBox/Additions/common/VBoxGuest/freebsd/Makefile

    r90829 r91789  
    6666        logrelellipsis.c \
    6767        logcom.c \
    68         logformat.c
     68        logformat.c \
     69        RTLogCreateEx.c
    6970
    7071.PATH:  ${.CURDIR}/common/misc
     
    9798        stringalloc.c \
    9899        strformat.c \
     100        RTStrFormat.c \
    99101        strformatnum.c \
    100102        strformatrt.c \
    101103        strformattype.c \
    102104        strprintf.c \
     105        strprintf-ellipsis.c \
    103106        strprintf2.c \
     107        strprintf2-ellipsis.c \
    104108        strtonum.c \
    105109        memchr.c \
  • trunk/src/VBox/Additions/common/VBoxGuest/freebsd/files_vboxguest

    r90829 r91789  
    108108    ${PATH_ROOT}/src/VBox/Runtime/common/log/logcom.cpp=>common/log/logcom.c \
    109109    ${PATH_ROOT}/src/VBox/Runtime/common/log/logformat.cpp=>common/log/logformat.c \
     110    ${PATH_ROOT}/src/VBox/Runtime/common/log/RTLogCreateEx.cpp=>common/log/RTLogCreateEx.c \
    110111    ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletable.cpp=>common/misc/handletable.c \
    111112    ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletable.h=>common/misc/handletable.h \
     
    133134    ${PATH_ROOT}/src/VBox/Runtime/common/string/stringalloc.cpp=>common/string/stringalloc.c \
    134135    ${PATH_ROOT}/src/VBox/Runtime/common/string/strformat.cpp=>common/string/strformat.c \
     136    ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrFormat.cpp=>common/string/RTStrFormat.c \
    135137    ${PATH_ROOT}/src/VBox/Runtime/common/string/strformatnum.cpp=>common/string/strformatnum.c \
    136138    ${PATH_ROOT}/src/VBox/Runtime/common/string/strformatrt.cpp=>common/string/strformatrt.c \
    137139    ${PATH_ROOT}/src/VBox/Runtime/common/string/strformattype.cpp=>common/string/strformattype.c \
    138140    ${PATH_ROOT}/src/VBox/Runtime/common/string/strprintf.cpp=>common/string/strprintf.c \
     141    ${PATH_ROOT}/src/VBox/Runtime/common/string/strprintf-ellipsis.cpp=>common/string/strprintf-ellipsis.c \
    139142    ${PATH_ROOT}/src/VBox/Runtime/common/string/strprintf2.cpp=>common/string/strprintf2.c \
     143    ${PATH_ROOT}/src/VBox/Runtime/common/string/strprintf2-ellipsis.cpp=>common/string/strprintf2-ellipsis.c \
    140144    ${PATH_ROOT}/src/VBox/Runtime/common/string/strtonum.cpp=>common/string/strtonum.c \
    141145    ${PATH_ROOT}/src/VBox/Runtime/common/string/memchr.cpp=>common/string/memchr.c \
  • trunk/src/VBox/Additions/common/VBoxGuest/linux/Makefile

    r90829 r91789  
    8383        common/log/logcom.o \
    8484        common/log/logformat.o \
     85        common/log/RTLogCreateEx.o \
    8586        common/misc/RTAssertMsg1Weak.o \
    8687        common/misc/RTAssertMsg2.o \
     
    104105        common/string/stringalloc.o \
    105106        common/string/strformat.o \
     107        common/string/RTStrFormat.o \
    106108        common/string/strformatnum.o \
    107109        common/string/strformatrt.o \
    108110        common/string/strformattype.o \
    109111        common/string/strprintf.o \
     112        common/string/strprintf-ellipsis.o \
    110113        common/string/strprintf2.o \
     114        common/string/strprintf2-ellipsis.o \
    111115        common/string/strtonum.o \
    112116        common/string/utf-8.o \
  • trunk/src/VBox/Additions/common/VBoxGuest/linux/combined-agnostic.c

    r90829 r91789  
    7070#include "common/log/logformat.c"
    7171#undef LOG_GROUP
     72#include "common/log/RTLogCreateEx.c"
     73#undef LOG_GROUP
    7274#include "common/misc/RTAssertMsg1Weak.c"
    7375#undef LOG_GROUP
     
    112114#include "common/string/strformat.c"
    113115#undef LOG_GROUP
     116#include "common/string/RTStrFormat.c"
     117#undef LOG_GROUP
    114118#include "common/string/strformatnum.c"
    115119#undef LOG_GROUP
     
    118122#include "common/string/strprintf.c"
    119123#undef LOG_GROUP
     124#include "common/string/strprintf-ellipsis.c"
     125#undef LOG_GROUP
    120126#include "common/string/strprintf2.c"
     127#undef LOG_GROUP
     128#include "common/string/strprintf2-ellipsis.c"
    121129#undef LOG_GROUP
    122130#include "common/string/strtonum.c"
  • trunk/src/VBox/Additions/common/VBoxGuest/linux/files_vboxguest

    r90829 r91789  
    124124    ${PATH_ROOT}/src/VBox/Runtime/common/log/logformat.cpp=>common/log/logformat.c \
    125125    ${PATH_ROOT}/src/VBox/Runtime/common/log/logcom.cpp=>common/log/logcom.c \
     126    ${PATH_ROOT}/src/VBox/Runtime/common/log/RTLogCreateEx.cpp=>common/log/RTLogCreateEx.c \
    126127    ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/divdi3.c=>common/math/gcc/divdi3.c \
    127128    ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/divmoddi4.c=>common/math/gcc/divmoddi4.c \
     
    153154    ${PATH_ROOT}/src/VBox/Runtime/common/string/stringalloc.cpp=>common/string/stringalloc.c \
    154155    ${PATH_ROOT}/src/VBox/Runtime/common/string/strformat.cpp=>common/string/strformat.c \
     156    ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrFormat.cpp=>common/string/RTStrFormat.c \
    155157    ${PATH_ROOT}/src/VBox/Runtime/common/string/strformatnum.cpp=>common/string/strformatnum.c \
    156158    ${PATH_ROOT}/src/VBox/Runtime/common/string/strformatrt.cpp=>common/string/strformatrt.c \
    157159    ${PATH_ROOT}/src/VBox/Runtime/common/string/strformattype.cpp=>common/string/strformattype.c \
    158160    ${PATH_ROOT}/src/VBox/Runtime/common/string/strprintf.cpp=>common/string/strprintf.c \
     161    ${PATH_ROOT}/src/VBox/Runtime/common/string/strprintf-ellipsis.cpp=>common/string/strprintf-ellipsis.c \
    159162    ${PATH_ROOT}/src/VBox/Runtime/common/string/strprintf2.cpp=>common/string/strprintf2.c \
     163    ${PATH_ROOT}/src/VBox/Runtime/common/string/strprintf2-ellipsis.cpp=>common/string/strprintf2-ellipsis.c \
    160164    ${PATH_ROOT}/src/VBox/Runtime/common/string/strtonum.cpp=>common/string/strtonum.c \
    161165    ${PATH_ROOT}/src/VBox/Runtime/common/string/utf-8.cpp=>common/string/utf-8.c \
  • trunk/src/VBox/HostDrivers/Support/SUPDrv.cpp

    r91785 r91789  
    241241    { STKOKAY("SUPR0HCPhysToVirt"),                      (void *)(uintptr_t)SUPR0HCPhysToVirt },         /* only-linux, only-solaris, only-freebsd */
    242242#endif
    243     { STKBACK("SUPR0Printf"),                            (void *)(uintptr_t)SUPR0Printf },
     243    { STKBACK("SUPR0PrintfV"),                           (void *)(uintptr_t)SUPR0PrintfV },
    244244    { STKBACK("SUPR0GetSessionGVM"),                     (void *)(uintptr_t)SUPR0GetSessionGVM },
    245245    { STKBACK("SUPR0GetSessionVM"),                      (void *)(uintptr_t)SUPR0GetSessionVM },
     
    298298    { STKBACK("RTLogBulkUpdate"),                        (void *)(uintptr_t)RTLogBulkUpdate},
    299299    { STKBACK("RTLogCheckGroupFlags"),                   (void *)(uintptr_t)RTLogCheckGroupFlags },
    300     { STKBACK("RTLogCreateEx"),                          (void *)(uintptr_t)RTLogCreateEx },
     300    { STKBACK("RTLogCreateExV"),                         (void *)(uintptr_t)RTLogCreateExV },
    301301    { STKBACK("RTLogDestroy"),                           (void *)(uintptr_t)RTLogDestroy },
    302302    { STKBACK("RTLogDefaultInstance"),                   (void *)(uintptr_t)RTLogDefaultInstance },
     
    314314    { STKBACK("RTLogSetFlushCallback"),                  (void *)(uintptr_t)RTLogSetFlushCallback },
    315315    { STKBACK("RTLogSetR0ProgramStart"),                 (void *)(uintptr_t)RTLogSetR0ProgramStart },
    316     { STKBACK("RTLogSetR0ThreadNameF"),                  (void *)(uintptr_t)RTLogSetR0ThreadNameF },
     316    { STKBACK("RTLogSetR0ThreadNameV"),                  (void *)(uintptr_t)RTLogSetR0ThreadNameV },
    317317    { STKBACK("RTMemAllocExTag"),                        (void *)(uintptr_t)RTMemAllocExTag },
    318318    { STKBACK("RTMemAllocTag"),                          (void *)(uintptr_t)RTMemAllocTag },
     
    345345    { STKBACK("RTMpOnSpecific"),                         (void *)(uintptr_t)RTMpOnSpecific },
    346346    { STKBACK("RTMpPokeCpu"),                            (void *)(uintptr_t)RTMpPokeCpu },
    347     { STKBACK("RTNetIPv4AddDataChecksum"),               (void *)(uintptr_t)RTNetIPv4AddDataChecksum },
    348     { STKBACK("RTNetIPv4AddTCPChecksum"),                (void *)(uintptr_t)RTNetIPv4AddTCPChecksum },
    349     { STKBACK("RTNetIPv4AddUDPChecksum"),                (void *)(uintptr_t)RTNetIPv4AddUDPChecksum },
    350     { STKBACK("RTNetIPv4FinalizeChecksum"),              (void *)(uintptr_t)RTNetIPv4FinalizeChecksum },
     347    { STKOKAY("RTNetIPv4AddDataChecksum"),               (void *)(uintptr_t)RTNetIPv4AddDataChecksum },
     348    { STKOKAY("RTNetIPv4AddTCPChecksum"),                (void *)(uintptr_t)RTNetIPv4AddTCPChecksum },
     349    { STKOKAY("RTNetIPv4AddUDPChecksum"),                (void *)(uintptr_t)RTNetIPv4AddUDPChecksum },
     350    { STKOKAY("RTNetIPv4FinalizeChecksum"),              (void *)(uintptr_t)RTNetIPv4FinalizeChecksum },
    351351    { STKOKAY("RTNetIPv4HdrChecksum"),                   (void *)(uintptr_t)RTNetIPv4HdrChecksum },
    352352    { STKOKAY("RTNetIPv4IsDHCPValid"),                   (void *)(uintptr_t)RTNetIPv4IsDHCPValid },
     
    444444    { STKOKAY("RTStrCopy"),                              (void *)(uintptr_t)RTStrCopy },
    445445    { STKBACK("RTStrDupTag"),                            (void *)(uintptr_t)RTStrDupTag },
    446     { STKBACK("RTStrFormat"),                            (void *)(uintptr_t)RTStrFormat },
    447446    { STKBACK("RTStrFormatNumber"),                      (void *)(uintptr_t)RTStrFormatNumber },
    448447    { STKBACK("RTStrFormatTypeDeregister"),              (void *)(uintptr_t)RTStrFormatTypeDeregister },
     
    452451    { STKBACK("RTStrFree"),                              (void *)(uintptr_t)RTStrFree },
    453452    { STKOKAY("RTStrNCmp"),                              (void *)(uintptr_t)RTStrNCmp },
    454     { STKBACK("RTStrPrintf"),                            (void *)(uintptr_t)RTStrPrintf },
    455     { STKBACK("RTStrPrintfEx"),                          (void *)(uintptr_t)RTStrPrintfEx },
    456453    { STKBACK("RTStrPrintfExV"),                         (void *)(uintptr_t)RTStrPrintfExV },
    457454    { STKBACK("RTStrPrintfV"),                           (void *)(uintptr_t)RTStrPrintfV },
     455    { STKBACK("RTStrPrintf2ExV"),                        (void *)(uintptr_t)RTStrPrintf2ExV },
     456    { STKBACK("RTStrPrintf2V"),                          (void *)(uintptr_t)RTStrPrintf2V },
    458457    { STKBACK("RTThreadCreate"),                         (void *)(uintptr_t)RTThreadCreate },
    459458    { STKBACK("RTThreadCtxHookIsEnabled"),               (void *)(uintptr_t)RTThreadCtxHookIsEnabled },
  • trunk/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp

    r90780 r91789  
    20232023
    20242024
    2025 RTDECL(int) SUPR0Printf(const char *pszFormat, ...)
     2025RTDECL(int) SUPR0PrintfV(const char *pszFormat, va_list va)
    20262026{
    20272027    IPRT_DARWIN_SAVE_EFL_AC();
    2028     va_list     va;
    2029     char        szMsg[512];
    2030 
    2031     va_start(va, pszFormat);
     2028
     2029    char szMsg[512];
    20322030    RTStrPrintfV(szMsg, sizeof(szMsg) - 1, pszFormat, va);
    2033     va_end(va);
    20342031    szMsg[sizeof(szMsg) - 1] = '\0';
    20352032
  • trunk/src/VBox/HostDrivers/Support/freebsd/Makefile

    r90829 r91789  
    6969        logrelellipsis.c \
    7070        logcom.c \
    71         logformat.c
     71        logformat.c \
     72        RTLogCreateEx.c
    7273
    7374.PATH:  ${.CURDIR}/common/misc
     
    9798        RTStrEnd.c \
    9899        strformat.c \
     100        RTStrFormat.c \
    99101        strformatnum.c \
    100102        strformatrt.c \
    101103        strformattype.c \
    102104        strprintf.c \
     105        strprintf-ellipsis.c \
    103106        strprintf2.c \
     107        strprintf2-ellipsis.c \
    104108        strtonum.c \
    105109        memchr.c \
  • trunk/src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c

    r91785 r91789  
    650650
    651651
    652 SUPR0DECL(int) SUPR0Printf(const char *pszFormat, ...)
    653 {
    654     va_list va;
     652SUPR0DECL(int) SUPR0PrintfV(const char *pszFormat, va_list va)
     653{
    655654    char szMsg[256];
    656     int cch;
    657 
    658     va_start(va, pszFormat);
    659     cch = RTStrPrintfV(szMsg, sizeof(szMsg), pszFormat, va);
    660     va_end(va);
     655    RTStrPrintfV(szMsg, sizeof(szMsg), pszFormat, va);
     656    szMsg[sizeof(szMsg) - 1] = '\0';
    661657
    662658    printf("%s", szMsg);
    663 
    664     return cch;
     659    return 0;
    665660}
    666661
  • trunk/src/VBox/HostDrivers/Support/freebsd/files_vboxdrv

    r90829 r91789  
    109109    ${PATH_ROOT}/src/VBox/Runtime/common/log/logcom.cpp=>common/log/logcom.c \
    110110    ${PATH_ROOT}/src/VBox/Runtime/common/log/logformat.cpp=>common/log/logformat.c \
     111    ${PATH_ROOT}/src/VBox/Runtime/common/log/RTLogCreateEx.cpp=>common/log/RTLogCreateEx.c \
    111112    ${PATH_ROOT}/src/VBox/Runtime/common/misc/RTAssertMsg1Weak.cpp=>common/misc/RTAssertMsg1Weak.c \
    112113    ${PATH_ROOT}/src/VBox/Runtime/common/misc/RTAssertMsg2.cpp=>common/misc/RTAssertMsg2.c \
     
    131132    ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrNLen.cpp=>common/string/RTStrNLen.c \
    132133    ${PATH_ROOT}/src/VBox/Runtime/common/string/strformat.cpp=>common/string/strformat.c \
     134    ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrFormat.cpp=>common/string/RTStrFormat.c \
    133135    ${PATH_ROOT}/src/VBox/Runtime/common/string/strformatnum.cpp=>common/string/strformatnum.c \
    134136    ${PATH_ROOT}/src/VBox/Runtime/common/string/strformatrt.cpp=>common/string/strformatrt.c \
    135137    ${PATH_ROOT}/src/VBox/Runtime/common/string/strformattype.cpp=>common/string/strformattype.c \
    136138    ${PATH_ROOT}/src/VBox/Runtime/common/string/strprintf.cpp=>common/string/strprintf.c \
     139    ${PATH_ROOT}/src/VBox/Runtime/common/string/strprintf-ellipsis.cpp=>common/string/strprintf-ellipsis.c \
    137140    ${PATH_ROOT}/src/VBox/Runtime/common/string/strprintf2.cpp=>common/string/strprintf2.c \
     141    ${PATH_ROOT}/src/VBox/Runtime/common/string/strprintf2-ellipsis.cpp=>common/string/strprintf2-ellipsis.c \
    138142    ${PATH_ROOT}/src/VBox/Runtime/common/string/strtonum.cpp=>common/string/strtonum.c \
    139143    ${PATH_ROOT}/src/VBox/Runtime/common/string/memchr.cpp=>common/string/memchr.c \
  • trunk/src/VBox/HostDrivers/Support/linux/Makefile

    r90829 r91789  
    8585        common/log/logcom.o \
    8686        common/log/logformat.o \
     87        common/log/RTLogCreateEx.o \
    8788        common/misc/RTAssertMsg1Weak.o \
    8889        common/misc/RTAssertMsg2.o \
     
    105106        common/string/stringalloc.o \
    106107        common/string/strformat.o \
     108        common/string/RTStrFormat.o \
    107109        common/string/strformatnum.o \
    108110        common/string/strformattype.o \
    109111        common/string/strprintf.o \
     112        common/string/strprintf-ellipsis.o \
    110113        common/string/strprintf2.o \
     114        common/string/strprintf2-ellipsis.o \
    111115        common/string/strtonum.o \
    112116        common/table/avlpv.o \
  • trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c

    r91552 r91789  
    16941694
    16951695
    1696 RTDECL(int) SUPR0Printf(const char *pszFormat, ...)
    1697 {
    1698     va_list va;
     1696RTDECL(int) SUPR0PrintfV(const char *pszFormat, va_list va)
     1697{
    16991698    char    szMsg[512];
    17001699    IPRT_LINUX_SAVE_EFL_AC();
    17011700
    1702     va_start(va, pszFormat);
    17031701    RTStrPrintfV(szMsg, sizeof(szMsg) - 1, pszFormat, va);
    1704     va_end(va);
    17051702    szMsg[sizeof(szMsg) - 1] = '\0';
    17061703
  • trunk/src/VBox/HostDrivers/Support/linux/combined-agnostic1.c

    r85523 r91789  
    6464#include "common/log/logformat.c"
    6565#undef LOG_GROUP
     66#include "common/log/RTLogCreateEx.c"
     67#undef LOG_GROUP
    6668#include "common/misc/RTAssertMsg1Weak.c"
    6769#undef LOG_GROUP
  • trunk/src/VBox/HostDrivers/Support/linux/combined-agnostic2.c

    r90829 r91789  
    4848#include "common/string/strformat.c"
    4949#undef LOG_GROUP
     50#include "common/string/RTStrFormat.c"
     51#undef LOG_GROUP
    5052#include "common/string/strformatnum.c"
    5153#undef LOG_GROUP
     
    5456#include "common/string/strprintf.c"
    5557#undef LOG_GROUP
     58#include "common/string/strprintf-ellipsis.c"
     59#undef LOG_GROUP
    5660#include "common/string/strprintf2.c"
     61#undef LOG_GROUP
     62#include "common/string/strprintf2-ellipsis.c"
    5763#undef LOG_GROUP
    5864#include "common/string/strtonum.c"
  • trunk/src/VBox/HostDrivers/Support/linux/files_vboxdrv

    r90829 r91789  
    114114    ${PATH_ROOT}/src/VBox/Runtime/common/log/logcom.cpp=>common/log/logcom.c \
    115115    ${PATH_ROOT}/src/VBox/Runtime/common/log/logformat.cpp=>common/log/logformat.c \
     116    ${PATH_ROOT}/src/VBox/Runtime/common/log/RTLogCreateEx.cpp=>common/log/RTLogCreateEx.c \
    116117    ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/divdi3.c=>math/gcc/divdi3.c \
    117118    ${PATH_ROOT}/src/VBox/Runtime/common/math/gcc/divmoddi4.c=>math/gcc/divmoddi4.c \
     
    143144    ${PATH_ROOT}/src/VBox/Runtime/common/string/stringalloc.cpp=>common/string/stringalloc.c \
    144145    ${PATH_ROOT}/src/VBox/Runtime/common/string/strformat.cpp=>common/string/strformat.c \
     146    ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrFormat.cpp=>common/string/RTStrFormat.c \
    145147    ${PATH_ROOT}/src/VBox/Runtime/common/string/strformatnum.cpp=>common/string/strformatnum.c \
    146148    ${PATH_ROOT}/src/VBox/Runtime/common/string/strformatrt.cpp=>common/string/strformatrt.c \
    147149    ${PATH_ROOT}/src/VBox/Runtime/common/string/strformattype.cpp=>common/string/strformattype.c \
    148150    ${PATH_ROOT}/src/VBox/Runtime/common/string/strprintf.cpp=>common/string/strprintf.c \
     151    ${PATH_ROOT}/src/VBox/Runtime/common/string/strprintf-ellipsis.cpp=>common/string/strprintf-ellipsis.c \
    149152    ${PATH_ROOT}/src/VBox/Runtime/common/string/strprintf2.cpp=>common/string/strprintf2.c \
     153    ${PATH_ROOT}/src/VBox/Runtime/common/string/strprintf2-ellipsis.cpp=>common/string/strprintf2-ellipsis.c \
    150154    ${PATH_ROOT}/src/VBox/Runtime/common/string/strtonum.cpp=>common/string/strtonum.c \
    151155    ${PATH_ROOT}/src/VBox/Runtime/common/table/avlpv.cpp=>common/table/avlpv.c \
  • trunk/src/VBox/HostDrivers/Support/os2/SUPDrv-os2.cpp

    r87700 r91789  
    536536
    537537
    538 SUPR0DECL(int) SUPR0Printf(const char *pszFormat, ...)
    539 {
    540     va_list va;
    541 
     538SUPR0DECL(int) SUPR0PrintfV(const char *pszFormat, va_list va)
     539{
    542540#if 0 //def DEBUG_bird
    543     va_start(va, pszFormat);
    544     RTLogComPrintfV(pszFormat, va);
    545     va_end(va);
     541    va_list va2;
     542    va_copy(va2, va);
     543    RTLogComPrintfV(pszFormat, va2);
     544    va_end(va2);
    546545#endif
    547546
    548     va_start(va, pszFormat);
    549     int cch = RTLogFormatV(VBoxDrvLogOutput, NULL, pszFormat, va);
    550     va_end(va);
    551 
    552     return cch;
     547    RTLogFormatV(VBoxDrvLogOutput, NULL, pszFormat, va);
     548    return 0;
    553549}
    554550
  • trunk/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c

    r90780 r91789  
    13031303
    13041304
    1305 RTDECL(int) SUPR0Printf(const char *pszFormat, ...)
    1306 {
    1307     va_list     args;
    1308     char        szMsg[512];
    1309 
     1305RTDECL(int) SUPR0PrintfV(const char *pszFormat, va_list va)
     1306{
    13101307    /* cmn_err() acquires adaptive mutexes. Not preemption safe, see @bugref{6657}. */
    1311     if (!RTThreadPreemptIsEnabled(NIL_RTTHREAD))
    1312         return 0;
    1313 
    1314     va_start(args, pszFormat);
    1315     RTStrPrintfV(szMsg, sizeof(szMsg) - 1, pszFormat, args);
    1316     va_end(args);
    1317 
    1318     szMsg[sizeof(szMsg) - 1] = '\0';
    1319     cmn_err(CE_CONT, "%s", szMsg);
     1308    if (RTThreadPreemptIsEnabled(NIL_RTTHREAD))
     1309    {
     1310        char szMsg[512];
     1311        RTStrPrintfV(szMsg, sizeof(szMsg) - 1, pszFormat, va);
     1312        szMsg[sizeof(szMsg) - 1] = '\0';
     1313
     1314        cmn_err(CE_CONT, "%s", szMsg);
     1315    }
    13201316    return 0;
    13211317}
  • trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp

    r91559 r91789  
    29522952
    29532953
    2954 SUPR0DECL(int) SUPR0Printf(const char *pszFormat, ...)
    2955 {
    2956     va_list va;
    2957     char    szMsg[384];
    2958 
    2959     va_start(va, pszFormat);
     2954SUPR0DECL(int) SUPR0PrintfV(const char *pszFormat, va_list va)
     2955{
     2956    char szMsg[384];
    29602957    size_t cch = RTStrPrintfV(szMsg, sizeof(szMsg) - 1, pszFormat, va);
    29612958    szMsg[sizeof(szMsg) - 1] = '\0';
    2962     va_end(va);
    29632959
    29642960    RTLogWriteDebugger(szMsg, cch);
  • trunk/src/VBox/Runtime/Makefile.kmk

    r91559 r91789  
    501501        common/log/tracelogreader.cpp \
    502502        common/log/tracelogwriter.cpp \
     503        common/log/RTLogCreateEx.cpp \
    503504        common/math/bignum.cpp \
    504505        common/misc/RTAssertMsg1Weak.cpp \
     
    626627        common/string/straprintf.cpp \
    627628        common/string/strformat.cpp \
     629        common/string/RTStrFormat.cpp \
    628630        common/string/strformatnum.cpp \
    629631        common/string/strformatrt.cpp \
     
    632634        common/string/stringalloc.cpp \
    633635        common/string/strprintf.cpp \
     636        common/string/strprintf-ellipsis.cpp \
    634637        common/string/strprintf2.cpp \
     638        common/string/strprintf2-ellipsis.cpp \
    635639        common/string/strcache.cpp \
    636640        common/string/strspace.cpp \
     
    18161820        common/log/logrel.cpp \
    18171821        common/log/logrelellipsis.cpp \
     1822        common/log/RTLogCreateEx.cpp \
    18181823        common/math/bignum.cpp \
    18191824        common/misc/assert.cpp \
     
    18981903        common/string/strcache.cpp \
    18991904        common/string/strformat.cpp \
     1905        common/string/RTStrFormat.cpp \
    19001906        common/string/strformatnum.cpp \
    19011907        common/string/strformatrt.cpp \
     
    19041910        common/string/stringalloc.cpp \
    19051911        common/string/strprintf.cpp \
     1912        common/string/strprintf-ellipsis.cpp \
    19061913        common/string/strprintf2.cpp \
     1914        common/string/strprintf2-ellipsis.cpp \
    19071915        common/string/strspace.cpp \
    19081916        common/string/strstrip.cpp \
     
    26642672        common/string/straprintf.cpp \
    26652673        common/string/strformat.cpp \
     2674        common/string/RTStrFormat.cpp \
    26662675        common/string/strformatnum.cpp \
    26672676        common/string/strformatrt.cpp \
    26682677        common/string/strformattype.cpp \
    26692678        common/string/strprintf.cpp \
     2679        common/string/strprintf-ellipsis.cpp \
    26702680        common/string/strprintf2.cpp \
     2681        common/string/strprintf2-ellipsis.cpp \
    26712682        common/string/stringalloc.cpp \
    26722683        common/string/strtonum.cpp \
     
    27412752        common/log/tracebuf.cpp \
    27422753        common/log/tracedefault.cpp \
     2754        common/log/RTLogCreateEx.cpp \
     2755        common/log/RTLogSetR0ThreadNameF.cpp \
    27432756        common/misc/RTAssertMsg1Weak.cpp \
    27442757        common/misc/RTAssertMsg2.cpp \
     
    27542767        common/misc/term.cpp \
    27552768        common/path/RTPathFilename.cpp \
     2769        common/string/strprintf-ellipsis.cpp \
     2770        common/string/strprintf2-ellipsis.cpp \
    27562771        common/string/strhash1.cpp \
    27572772        common/string/strncmp.cpp \
     
    29272942        common/log/tracebuf.cpp \
    29282943        common/log/tracedefault.cpp \
     2944        common/log/RTLogCreateEx.cpp \
    29292945        common/misc/RTAssertMsg1Weak.cpp \
    29302946        common/misc/RTAssertMsg2.cpp \
     
    29802996        common/string/straprintf.cpp \
    29812997        common/string/strformat.cpp \
     2998        common/string/RTStrFormat.cpp \
    29822999        common/string/strformatnum.cpp \
    29833000        common/string/strformatrt.cpp \
     
    29853002        common/string/strhash1.cpp \
    29863003        common/string/strprintf.cpp \
     3004        common/string/strprintf-ellipsis.cpp \
    29873005        common/string/strprintf2.cpp \
     3006        common/string/strprintf2-ellipsis.cpp \
    29883007        common/string/strtonum.cpp \
    29893008        common/string/stringalloc.cpp \
     
    36643683        common/log/tracebuf.cpp \
    36653684        common/log/tracedefault.cpp \
     3685        common/log/RTLogCreateEx.cpp \
    36663686        common/misc/RTAssertMsg1Weak.cpp \
    36673687        common/misc/RTAssertMsg2.cpp \
     
    36773697        common/path/RTPathFilename.cpp \
    36783698        common/string/strformat.cpp \
     3699        common/string/RTStrFormat.cpp \
    36793700        common/string/strformatnum.cpp \
    36803701        common/string/strformatrt.cpp \
     
    36833704        common/string/strpbrk.cpp \
    36843705        common/string/strprintf.cpp \
     3706        common/string/strprintf-ellipsis.cpp \
    36853707        common/string/strprintf2.cpp \
     3708        common/string/strprintf2-ellipsis.cpp \
    36863709        common/string/RTStrCmp.cpp \
    36873710        common/string/RTStrCopy.cpp \
  • trunk/src/VBox/Runtime/common/log/log.cpp

    r90974 r91789  
    13551355
    13561356
    1357 RTDECL(int) RTLogCreateEx(PRTLOGGER *ppLogger, const char *pszEnvVarBase, uint64_t fFlags, const char *pszGroupSettings,
    1358                           unsigned cGroups, const char * const *papszGroups, uint32_t cMaxEntriesPerGroup,
    1359                           uint32_t cBufDescs, PRTLOGBUFFERDESC paBufDescs, uint32_t fDestFlags,
    1360                           PFNRTLOGPHASE pfnPhase, uint32_t cHistory, uint64_t cbHistoryFileMax, uint32_t cSecsHistoryTimeSlot,
    1361                           PRTERRINFO pErrInfo, const char *pszFilenameFmt, ...)
    1362 {
    1363     va_list va;
    1364     int     rc;
    1365 
    1366     va_start(va, pszFilenameFmt);
    1367     rc = RTLogCreateExV(ppLogger, pszEnvVarBase, fFlags, pszGroupSettings, cGroups, papszGroups, cMaxEntriesPerGroup,
    1368                         cBufDescs, paBufDescs, fDestFlags,
    1369                         pfnPhase, cHistory, cbHistoryFileMax, cSecsHistoryTimeSlot,
    1370                         pErrInfo, pszFilenameFmt, va);
    1371     va_end(va);
    1372     return rc;
    1373 }
    1374 RT_EXPORT_SYMBOL(RTLogCreateEx);
    1375 
    1376 
    13771357/**
    13781358 * Destroys a logger instance.
     
    20562036#ifdef IN_RING0
    20572037
    2058 RTR0DECL(int) RTLogSetR0ThreadNameF(PRTLOGGER pLogger, const char *pszNameFmt, ...)
     2038RTR0DECL(int) RTLogSetR0ThreadNameV(PRTLOGGER pLogger, const char *pszNameFmt, va_list va)
    20592039{
    20602040    PRTLOGGERINTERNAL pLoggerInt = (PRTLOGGERINTERNAL)pLogger;
     
    20622042    if (pLoggerInt)
    20632043    {
    2064         va_list va;
    2065         va_start(va, pszNameFmt);
    2066 
    20672044        rc = rtlogLock(pLoggerInt);
    20682045        if (RT_SUCCESS(rc))
     
    20722049            rc = cch > 0 ? VINF_SUCCESS : VERR_BUFFER_OVERFLOW;
    20732050        }
    2074 
    2075         va_end(va);
    20762051    }
    20772052    else
     
    20792054    return rc;
    20802055}
    2081 RT_EXPORT_SYMBOL(RTLogSetR0ThreadNameF);
     2056RT_EXPORT_SYMBOL(RTLogSetR0ThreadNameV);
    20822057
    20832058
  • trunk/src/VBox/Runtime/common/string/strformat.cpp

    r90821 r91789  
    833833RT_EXPORT_SYMBOL(RTStrFormatV);
    834834
    835 
    836 /**
    837  * Partial implementation of a printf like formatter.
    838  * It doesn't do everything correct, and there is no floating point support.
    839  * However, it supports custom formats by the means of a format callback.
    840  *
    841  * @returns number of bytes formatted.
    842  * @param   pfnOutput   Output worker.
    843  *                      Called in two ways. Normally with a string an it's length.
    844  *                      For termination, it's called with NULL for string, 0 for length.
    845  * @param   pvArgOutput Argument to the output worker.
    846  * @param   pfnFormat   Custom format worker.
    847  * @param   pvArgFormat Argument to the format worker.
    848  * @param   pszFormat   Format string.
    849  * @param   ...         Argument list.
    850  */
    851 RTDECL(size_t) RTStrFormat(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput, PFNSTRFORMAT pfnFormat, void *pvArgFormat, const char *pszFormat, ...)
    852 {
    853     size_t cch;
    854     va_list args;
    855     va_start(args, pszFormat);
    856     cch = RTStrFormatV(pfnOutput, pvArgOutput, pfnFormat, pvArgFormat, pszFormat, args);
    857     va_end(args);
    858     return cch;
    859 }
    860 RT_EXPORT_SYMBOL(RTStrFormat);
    861 
  • trunk/src/VBox/Runtime/common/string/strprintf-ellipsis.cpp

    r91787 r91789  
    11/* $Id$ */
    22/** @file
    3  * IPRT - String Formatters.
     3 * IPRT - String Formatters, Ellipsis Functions.
    44 */
    55
     
    3232#include "internal/iprt.h"
    3333
    34 #include <iprt/assert.h>
    35 
    36 
    37 /*********************************************************************************************************************************
    38 *   Structures and Typedefs                                                                                                      *
    39 *********************************************************************************************************************************/
    40 /** strbufoutput() argument structure. */
    41 typedef struct STRBUFARG
    42 {
    43     /** Pointer to current buffer position. */
    44     char   *psz;
    45     /** Number of bytes left in the buffer - not including the trailing zero. */
    46     size_t  cch;
    47 } STRBUFARG;
    48 /** Pointer to a strbufoutput() argument structure. */
    49 typedef STRBUFARG *PSTRBUFARG;
    50 
    51 
    52 /*********************************************************************************************************************************
    53 *   Internal Functions                                                                                                           *
    54 *********************************************************************************************************************************/
    55 static DECLCALLBACK(size_t) strbufoutput(void *pvArg, const char *pachChars, size_t cbChars);
    56 
    57 
    58 /**
    59  * Output callback.
    60  *
    61  * @returns number of bytes written.
    62  * @param   pvArg       Pointer to a STRBUFARG structure.
    63  * @param   pachChars   Pointer to an array of utf-8 characters.
    64  * @param   cbChars     Number of bytes in the character array pointed to by pachChars.
    65  */
    66 static DECLCALLBACK(size_t) strbufoutput(void *pvArg, const char *pachChars, size_t cbChars)
    67 {
    68     PSTRBUFARG  pArg = (PSTRBUFARG)pvArg;
    69     char *pszCur = pArg->psz; /* We actually have to spell this out for VS2010, or it will load for each case. */
    70 
    71     cbChars = RT_MIN(pArg->cch, cbChars);
    72     if (cbChars)
    73     {
    74         pArg->cch -= cbChars;
    75 
    76         /* Note! For VS2010/64 we need at least 7 case statements before it generates a jump table. */
    77         switch (cbChars)
    78         {
    79             default:
    80                 memcpy(pszCur, pachChars, cbChars);
    81                 break;
    82             case 8: pszCur[7] = pachChars[7]; RT_FALL_THRU();
    83             case 7: pszCur[6] = pachChars[6]; RT_FALL_THRU();
    84             case 6: pszCur[5] = pachChars[5]; RT_FALL_THRU();
    85             case 5: pszCur[4] = pachChars[4]; RT_FALL_THRU();
    86             case 4: pszCur[3] = pachChars[3]; RT_FALL_THRU();
    87             case 3: pszCur[2] = pachChars[2]; RT_FALL_THRU();
    88             case 2: pszCur[1] = pachChars[1]; RT_FALL_THRU();
    89             case 1: pszCur[0] = pachChars[0]; RT_FALL_THRU();
    90             case 0:
    91                 break;
    92         }
    93         pArg->psz = pszCur += cbChars;
    94     }
    95     *pszCur = '\0';
    96 
    97     return cbChars;
    98 }
    99 
    100 
    101 RTDECL(size_t) RTStrPrintfV(char *pszBuffer, size_t cchBuffer, const char *pszFormat, va_list args)
    102 {
    103     STRBUFARG Arg;
    104     AssertMsgReturn(cchBuffer, ("Excellent idea! Format a string with no space for the output!\n"), 0);
    105     Arg.psz = pszBuffer;
    106     Arg.cch = cchBuffer - 1;
    107     return RTStrFormatV(strbufoutput, &Arg, NULL, NULL, pszFormat, args);
    108 }
    109 RT_EXPORT_SYMBOL(RTStrPrintfV);
    110 
    11134
    11235RTDECL(size_t) RTStrPrintf(char *pszBuffer, size_t cchBuffer, const char *pszFormat, ...)
     
    12245
    12346
    124 RTDECL(size_t) RTStrPrintfExV(PFNSTRFORMAT pfnFormat, void *pvArg, char *pszBuffer, size_t cchBuffer, const char *pszFormat, va_list args)
    125 {
    126     STRBUFARG Arg;
    127     AssertMsgReturn(cchBuffer, ("Excellent idea! Format a string with no space for the output!\n"), 0);
    128     Arg.psz = pszBuffer;
    129     Arg.cch = cchBuffer - 1;
    130     return RTStrFormatV(strbufoutput, &Arg, pfnFormat, pvArg, pszFormat, args);
    131 }
    132 RT_EXPORT_SYMBOL(RTStrPrintfExV);
    133 
    134 
    135 
    13647RTDECL(size_t) RTStrPrintfEx(PFNSTRFORMAT pfnFormat, void *pvArg, char *pszBuffer, size_t cchBuffer, const char *pszFormat, ...)
    13748{
  • trunk/src/VBox/Runtime/common/string/strprintf.cpp

    r91787 r91789  
    110110
    111111
    112 RTDECL(size_t) RTStrPrintf(char *pszBuffer, size_t cchBuffer, const char *pszFormat, ...)
    113 {
    114     size_t  cbRet;
    115     va_list va;
    116     va_start(va, pszFormat);
    117     cbRet = RTStrPrintfV(pszBuffer, cchBuffer, pszFormat, va);
    118     va_end(va);
    119     return cbRet;
    120 }
    121 RT_EXPORT_SYMBOL(RTStrPrintf);
    122 
    123 
    124112RTDECL(size_t) RTStrPrintfExV(PFNSTRFORMAT pfnFormat, void *pvArg, char *pszBuffer, size_t cchBuffer, const char *pszFormat, va_list args)
    125113{
     
    132120RT_EXPORT_SYMBOL(RTStrPrintfExV);
    133121
    134 
    135 
    136 RTDECL(size_t) RTStrPrintfEx(PFNSTRFORMAT pfnFormat, void *pvArg, char *pszBuffer, size_t cchBuffer, const char *pszFormat, ...)
    137 {
    138     va_list args;
    139     size_t cbRet;
    140     va_start(args, pszFormat);
    141     cbRet = RTStrPrintfExV(pfnFormat, pvArg, pszBuffer, cchBuffer, pszFormat, args);
    142     va_end(args);
    143     return cbRet;
    144 }
    145 RT_EXPORT_SYMBOL(RTStrPrintfEx);
    146 
  • trunk/src/VBox/Runtime/common/string/strprintf2-ellipsis.cpp

    r91788 r91789  
    11/* $Id$ */
    22/** @file
    3  * IPRT - String Formatters, alternative.
     3 * IPRT - String Formatters, alternative, ellipsis.
    44 */
    55
     
    3232#include "internal/iprt.h"
    3333
    34 #include <iprt/assert.h>
    35 
    36 
    37 /*********************************************************************************************************************************
    38 *   Structures and Typedefs                                                                                                      *
    39 *********************************************************************************************************************************/
    40 /** rtStrPrintf2Output() argument structure. */
    41 typedef struct STRPRINTF2OUTPUTARGS
    42 {
    43     /** Pointer to current buffer position. */
    44     char   *pszCur;
    45     /** Number of bytes left in the buffer (including the trailing zero). */
    46     size_t  cbLeft;
    47     /** Set if we overflowed. */
    48     bool    fOverflowed;
    49 } STRPRINTF2OUTPUTARGS;
    50 /** Pointer to a rtStrPrintf2Output() argument structure. */
    51 typedef STRPRINTF2OUTPUTARGS *PSTRPRINTF2OUTPUTARGS;
    52 
    53 
    54 /**
    55  * Output callback.
    56  *
    57  * @returns cbChars
    58  *
    59  * @param   pvArg       Pointer to a STRBUFARG structure.
    60  * @param   pachChars   Pointer to an array of utf-8 characters.
    61  * @param   cbChars     Number of bytes in the character array pointed to by pachChars.
    62  */
    63 static DECLCALLBACK(size_t) rtStrPrintf2Output(void *pvArg, const char *pachChars, size_t cbChars)
    64 {
    65     PSTRPRINTF2OUTPUTARGS pArgs = (PSTRPRINTF2OUTPUTARGS)pvArg;
    66     char *pszCur = pArgs->pszCur; /* We actually have to spell this out for VS2010, or it will load it for each case. */
    67 
    68     if (cbChars < pArgs->cbLeft)
    69     {
    70         pArgs->cbLeft -= cbChars;
    71 
    72         /* Note! For VS2010/64 we need at least 7 case statements before it generates a jump table. */
    73         switch (cbChars)
    74         {
    75             default:
    76                 memcpy(pszCur, pachChars, cbChars);
    77                 break;
    78             case 8: pszCur[7] = pachChars[7]; RT_FALL_THRU();
    79             case 7: pszCur[6] = pachChars[6]; RT_FALL_THRU();
    80             case 6: pszCur[5] = pachChars[5]; RT_FALL_THRU();
    81             case 5: pszCur[4] = pachChars[4]; RT_FALL_THRU();
    82             case 4: pszCur[3] = pachChars[3]; RT_FALL_THRU();
    83             case 3: pszCur[2] = pachChars[2]; RT_FALL_THRU();
    84             case 2: pszCur[1] = pachChars[1]; RT_FALL_THRU();
    85             case 1: pszCur[0] = pachChars[0]; RT_FALL_THRU();
    86             case 0:
    87                 break;
    88         }
    89         pArgs->pszCur = pszCur += cbChars;
    90         *pszCur = '\0';
    91     }
    92     else
    93     {
    94         size_t cbLeft = pArgs->cbLeft;
    95         if (cbLeft-- > 1)
    96         {
    97             memcpy(pszCur, pachChars, cbLeft);
    98             pArgs->pszCur = pszCur += cbLeft;
    99             *pszCur = '\0';
    100             pArgs->cbLeft = 1;
    101         }
    102         pArgs->fOverflowed = true;
    103     }
    104 
    105     return cbChars;
    106 }
    107 
    108 RTDECL(ssize_t) RTStrPrintf2V(char *pszBuffer, size_t cchBuffer, const char *pszFormat, va_list args)
    109 {
    110     STRPRINTF2OUTPUTARGS Args;
    111     size_t cchRet;
    112     AssertMsg(cchBuffer > 0, ("Excellent idea! Format a string with no space for the output!\n"));
    113 
    114     Args.pszCur      = pszBuffer;
    115     Args.cbLeft      = cchBuffer;
    116     Args.fOverflowed = false;
    117 
    118     cchRet = RTStrFormatV(rtStrPrintf2Output, &Args, NULL, NULL, pszFormat, args);
    119 
    120     return !Args.fOverflowed ? (ssize_t)cchRet : -(ssize_t)cchRet - 1;
    121 }
    122 RT_EXPORT_SYMBOL(RTStrPrintf2V);
    123 
    124 
    12534
    12635RTDECL(ssize_t) RTStrPrintf2(char *pszBuffer, size_t cchBuffer, const char *pszFormat, ...)
     
    13645
    13746
    138 RTDECL(ssize_t) RTStrPrintf2ExV(PFNSTRFORMAT pfnFormat, void *pvArg, char *pszBuffer, size_t cchBuffer,
    139                                 const char *pszFormat,  va_list args)
    140 {
    141     STRPRINTF2OUTPUTARGS Args;
    142     size_t cchRet;
    143     AssertMsg(cchBuffer > 0, ("Excellent idea! Format a string with no space for the output!\n"));
    144 
    145     Args.pszCur      = pszBuffer;
    146     Args.cbLeft      = cchBuffer;
    147     Args.fOverflowed = false;
    148     cchRet = RTStrFormatV(rtStrPrintf2Output, &Args, pfnFormat, pvArg, pszFormat, args);
    149     return !Args.fOverflowed ? (ssize_t)cchRet : -(ssize_t)cchRet - 1;
    150 }
    151 RT_EXPORT_SYMBOL(RTStrPrintf2ExV);
    152 
    153 
    15447RTDECL(ssize_t) RTStrPrintf2Ex(PFNSTRFORMAT pfnFormat, void *pvArg, char *pszBuffer, size_t cchBuffer, const char *pszFormat, ...)
    15548{
  • trunk/src/VBox/Runtime/common/string/strprintf2.cpp

    r91788 r91789  
    106106}
    107107
     108
    108109RTDECL(ssize_t) RTStrPrintf2V(char *pszBuffer, size_t cchBuffer, const char *pszFormat, va_list args)
    109110{
     
    123124
    124125
    125 
    126 RTDECL(ssize_t) RTStrPrintf2(char *pszBuffer, size_t cchBuffer, const char *pszFormat, ...)
    127 {
    128     va_list va;
    129     ssize_t cbRet;
    130     va_start(va, pszFormat);
    131     cbRet = RTStrPrintf2V(pszBuffer, cchBuffer, pszFormat, va);
    132     va_end(va);
    133     return cbRet;
    134 }
    135 RT_EXPORT_SYMBOL(RTStrPrintf2);
    136 
    137 
    138126RTDECL(ssize_t) RTStrPrintf2ExV(PFNSTRFORMAT pfnFormat, void *pvArg, char *pszBuffer, size_t cchBuffer,
    139127                                const char *pszFormat,  va_list args)
     
    151139RT_EXPORT_SYMBOL(RTStrPrintf2ExV);
    152140
    153 
    154 RTDECL(ssize_t) RTStrPrintf2Ex(PFNSTRFORMAT pfnFormat, void *pvArg, char *pszBuffer, size_t cchBuffer, const char *pszFormat, ...)
    155 {
    156     va_list args;
    157     ssize_t cbRet;
    158     va_start(args, pszFormat);
    159     cbRet = RTStrPrintf2ExV(pfnFormat, pvArg, pszBuffer, cchBuffer, pszFormat, args);
    160     va_end(args);
    161     return cbRet;
    162 }
    163 RT_EXPORT_SYMBOL(RTStrPrintf2Ex);
    164 
  • trunk/src/VBox/VMM/VMMR0/VMMR0.def

    r90997 r91789  
    4343    RTLogLoggerEx
    4444    RTLogLoggerExV
     45    RTStrPrintf
    4546    RTTimeMilliTS
    4647    RTTraceBufAddMsgF
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