VirtualBox

Changeset 628 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Feb 5, 2007 11:59:58 AM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
18257
Message:

Implement log flag usecrlf, which translates LF line ending to CR/LF.
Activate it by default for Windows builds, only for release log so far.
Also fixed a couple of typos in comments.

Location:
trunk/src/VBox/Runtime
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/log.cpp

    r408 r628  
    11091109            { "buffered",     sizeof("buffered"    ) - 1,   RTLOGFLAGS_BUFFERED,            false },
    11101110            { "unbuffered",   sizeof("unbuffered"  ) - 1,   RTLOGFLAGS_BUFFERED,            true  },
     1111            { "usecrlf",      sizeof("usecrlf"     ) - 1,   RTLOGFLAGS_USECRLF,             true },
     1112            { "uself",        sizeof("uself"       ) - 1,   RTLOGFLAGS_USECRLF,             false  },
    11111113            { "rel",          sizeof("rel"         ) - 1,   RTLOGFLAGS_REL_TS,              false },
    1112             { "abs",          sizeof("rel"         ) - 1,   RTLOGFLAGS_REL_TS,              true  },
     1114            { "abs",          sizeof("abs"         ) - 1,   RTLOGFLAGS_REL_TS,              true  },
    11131115            { "dec",          sizeof("dec"         ) - 1,   RTLOGFLAGS_DECIMAL_TS,          false },
    11141116            { "hex",          sizeof("hex"         ) - 1,   RTLOGFLAGS_DECIMAL_TS,          true  },
     
    20532055            if (pszNewLine)
    20542056            {
    2055                 pLogger->fPendingPrefix = true;
    2056                 cb = pszNewLine - pachChars + 1;
     2057                if (pLogger->fFlags & RTLOGFLAGS_USECRLF)
     2058                    cb = pszNewLine - pachChars;
     2059                else
     2060                {
     2061                    cb = pszNewLine - pachChars + 1;
     2062                    pLogger->fPendingPrefix = true;
     2063                }
    20572064            }
    20582065
     
    20642071            cbRet += cb;
    20652072            cbChars -= cb;
     2073
     2074            if (    pszNewLine
     2075                &&  pLogger->fFlags & RTLOGFLAGS_USECRLF
     2076                &&  pLogger->offScratch + 2 < sizeof(pLogger->achScratch))
     2077            {
     2078                memcpy(&pLogger->achScratch[pLogger->offScratch], "\r\n", 2);
     2079                pLogger->offScratch += 2;
     2080                cbRet++;
     2081                cbChars--;
     2082                cb++;
     2083                pLogger->fPendingPrefix = true;
     2084            }
    20662085
    20672086            /* done? */
  • trunk/src/VBox/Runtime/logformat.cpp

    r1 r628  
    5151 * @param   pfnOutput   Output worker.
    5252 *                      Called in two ways. Normally with a string an it's length.
    53  *                      For termiation, it's called with NULL for string, 0 for length.
     53 *                      For termination, it's called with NULL for string, 0 for length.
    5454 * @param   pvArg       Argument to output worker.
    5555 * @param   pszFormat   Format string.
  • trunk/src/VBox/Runtime/strformat.cpp

    r1 r628  
    291291 * @param   pfnOutput   Output worker.
    292292 *                      Called in two ways. Normally with a string an it's length.
    293  *                      For termiation, it's called with NULL for string, 0 for length.
     293 *                      For termination, it's called with NULL for string, 0 for length.
    294294 * @param   pvArgOutput Argument to the output worker.
    295295 * @param   pfnFormat   Custom format worker.
     
    818818 * @param   pfnOutput   Output worker.
    819819 *                      Called in two ways. Normally with a string an it's length.
    820  *                      For termiation, it's called with NULL for string, 0 for length.
     820 *                      For termination, it's called with NULL for string, 0 for length.
    821821 * @param   pvArgOutput Argument to the output worker.
    822822 * @param   pfnFormat   Custom format worker.
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