Logo Search packages:      
Sourcecode: virtualbox-ose version File versions  Download package

scm.cpp File Reference


Detailed Description

IPRT Testcase / Tool - Source Code Massager.

Definition in file scm.cpp.

#include <iprt/assert.h>
#include <iprt/ctype.h>
#include <iprt/dir.h>
#include <iprt/env.h>
#include <iprt/file.h>
#include <iprt/err.h>
#include <iprt/getopt.h>
#include <iprt/initterm.h>
#include <iprt/mem.h>
#include <iprt/message.h>
#include <iprt/param.h>
#include <iprt/path.h>
#include <iprt/process.h>
#include <iprt/stream.h>
#include <iprt/string.h>

Go to the source code of this file.

Classes

struct  SCMCFGENTRY
struct  SCMDIFFSTATE
struct  SCMPATRNOPTPAIR
struct  SCMRWSTATE
struct  SCMSETTINGS
struct  SCMSETTINGSBASE
struct  SCMSTREAM
struct  SCMSTREAMLINE
struct  SCMSVNPROP

Defines

#define SCM_SETTINGS_FILENAME   ".scm-settings"
#define SCM_WITHOUT_LIBSVN

Typedefs

typedef SCMCFGENTRY const * PCSCMCFGENTRY
typedef SCMSETTINGS const * PCSCMSETTINGS
typedef struct SCMSETTINGSBASE
const * 
PCSCMSETTINGSBASE
typedef SCMSTREAM const * PCSCMSTREAM
typedef SCMSVNPROP const * PCSCMSVNPROP
typedef bool(* PFNSCMREWRITER )(PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings)
typedef SCMCFGENTRYPSCMCFGENTRY
typedef SCMDIFFSTATEPSCMDIFFSTATE
typedef SCMEOLPSCMEOL
typedef SCMPATRNOPTPAIRPSCMPATRNOPTPAIR
typedef SCMRWSTATEPSCMRWSTATE
typedef struct SCMSETTINGSPSCMSETTINGS
typedef SCMSETTINGSBASEPSCMSETTINGSBASE
typedef SCMSTREAMPSCMSTREAM
typedef SCMSTREAMLINEPSCMSTREAMLINE
typedef SCMSVNPROPPSCMSVNPROP

Enumerations

enum  SCMEOL { SCMEOL_NONE = 0, SCMEOL_LF = 1, SCMEOL_CRLF = 2 }
enum  SCMOPT {
  SCMOPT_CONVERT_EOL = 10000, SCMOPT_NO_CONVERT_EOL, SCMOPT_CONVERT_TABS, SCMOPT_NO_CONVERT_TABS,
  SCMOPT_FORCE_FINAL_EOL, SCMOPT_NO_FORCE_FINAL_EOL, SCMOPT_FORCE_TRAILING_LINE, SCMOPT_NO_FORCE_TRAILING_LINE,
  SCMOPT_STRIP_TRAILING_BLANKS, SCMOPT_NO_STRIP_TRAILING_BLANKS, SCMOPT_STRIP_TRAILING_LINES, SCMOPT_NO_STRIP_TRAILING_LINES,
  SCMOPT_ONLY_SVN_DIRS, SCMOPT_NOT_ONLY_SVN_DIRS, SCMOPT_ONLY_SVN_FILES, SCMOPT_NOT_ONLY_SVN_FILES,
  SCMOPT_SET_SVN_EOL, SCMOPT_DONT_SET_SVN_EOL, SCMOPT_SET_SVN_EXECUTABLE, SCMOPT_DONT_SET_SVN_EXECUTABLE,
  SCMOPT_SET_SVN_KEYWORDS, SCMOPT_DONT_SET_SVN_KEYWORDS, SCMOPT_TAB_SIZE, SCMOPT_FILTER_OUT_DIRS,
  SCMOPT_FILTER_FILES, SCMOPT_FILTER_OUT_FILES, SCMOPT_LAST_SETTINGS = SCMOPT_FILTER_OUT_FILES, SCMOPT_DIFF_IGNORE_EOL,
  SCMOPT_DIFF_NO_IGNORE_EOL, SCMOPT_DIFF_IGNORE_SPACE, SCMOPT_DIFF_NO_IGNORE_SPACE, SCMOPT_DIFF_IGNORE_LEADING_SPACE,
  SCMOPT_DIFF_NO_IGNORE_LEADING_SPACE, SCMOPT_DIFF_IGNORE_TRAILING_SPACE, SCMOPT_DIFF_NO_IGNORE_TRAILING_SPACE, SCMOPT_DIFF_SPECIAL_CHARS,
  SCMOPT_DIFF_NO_SPECIAL_CHARS, SCMOPT_END
}

Functions

 DECLINLINE (bool) scmDiffCompare(PSCMDIFFSTATE pState
static bool rewrite_AdjustTrailingLines (PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings)
static bool rewrite_C_and_CPP (PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings)
static bool rewrite_ExpandTabs (PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings)
static bool rewrite_ForceCRLF (PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings)
static bool rewrite_ForceLF (PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings)
static bool rewrite_ForceNativeEol (PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings)
static bool rewrite_Makefile_kmk (PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings)
static bool rewrite_Makefile_kup (PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings)
static bool rewrite_StripTrailingBlanks (PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings)
static bool rewrite_SvnKeywords (PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings)
static bool rewrite_SvnNoExecutable (PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings)
static bool scmDiffCompareSlow (PSCMDIFFSTATE pState, const char *pchLeft, size_t cchLeft, SCMEOL enmEolLeft, const char *pchRight, size_t cchRight, SCMEOL enmEolRight)
static void scmDiffPrintLines (PSCMDIFFSTATE pState, char chPrefix, PSCMSTREAM pStream, size_t iLine, size_t cLines)
static size_t scmDiffReport (PSCMDIFFSTATE pState, size_t cMatches, size_t iLeft, size_t cLeft, size_t iRight, size_t cRight)
int ScmStreamCheckItegrity (PSCMSTREAM pStream)
int ScmStreamCopyLines (PSCMSTREAM pDst, PSCMSTREAM pSrc, size_t cLines)
size_t ScmStreamCountLines (PSCMSTREAM pStream)
void ScmStreamDelete (PSCMSTREAM pStream)
SCMEOL ScmStreamGetEol (PSCMSTREAM pStream)
SCMEOL ScmStreamGetEolByLine (PSCMSTREAM pStream, size_t iLine)
static const char * ScmStreamGetLine (PSCMSTREAM pStream, size_t *pcchLine, PSCMEOL penmEol)
static const char * ScmStreamGetLineByNo (PSCMSTREAM pStream, size_t iLine, size_t *pcchLine, PSCMEOL penmEol)
static const char * scmStreamGetLineInternal (PSCMSTREAM pStream, size_t *pcchLine, PSCMEOL penmEol)
int ScmStreamGetStatus (PCSCMSTREAM pStream)
static int scmStreamGrowBuffer (PSCMSTREAM pStream, size_t cbAppending)
static int scmStreamGrowLines (PSCMSTREAM pStream, size_t iMinLine)
int ScmStreamInitForReading (PSCMSTREAM pStream, const char *pszFilename)
int ScmStreamInitForWriting (PSCMSTREAM pStream, PCSCMSTREAM pRelatedStream)
static void scmStreamInitInternal (PSCMSTREAM pStream, bool fWriteOrRead)
bool ScmStreamIsText (PSCMSTREAM pStream)
static bool ScmStreamIsWhiteLine (PSCMSTREAM pStream, size_t iLine)
static int scmStreamLineate (PSCMSTREAM pStream)
int ScmStreamPutCh (PSCMSTREAM pStream, char ch)
int ScmStreamPutLine (PSCMSTREAM pStream, const char *pchLine, size_t cchLine, SCMEOL enmEol)
static int ScmStreamRead (PSCMSTREAM pStream, void *pvBuf, size_t cbToRead)
void ScmStreamRewindForReading (PSCMSTREAM pStream)
void ScmStreamRewindForWriting (PSCMSTREAM pStream)
int ScmStreamSeekAbsolute (PSCMSTREAM pStream, size_t offAbsolute)
int ScmStreamSeekByLine (PSCMSTREAM pStream, size_t iLine)
int ScmStreamSeekRelative (PSCMSTREAM pStream, ssize_t offRelative)
size_t ScmStreamSize (PSCMSTREAM pStream)
size_t ScmStreamTell (PSCMSTREAM pStream)
size_t ScmStreamTellLine (PSCMSTREAM pStream)
int ScmStreamWrite (PSCMSTREAM pStream, const char *pchBuf, size_t cchBuf)
int ScmStreamWriteToFile (PSCMSTREAM pStream, const char *pszFilenameFmt,...)

Variables

const char size_t cchLeft
const char size_t SCMEOL const
char size_t 
cchRight
const char size_t SCMEOL enmEolLeft
static SCMCFGENTRY const g_aConfigs []
static PFNSCMREWRITER const g_aRewritersFor_BatchFiles []
static PFNSCMREWRITER const g_aRewritersFor_C_and_CPP []
static PFNSCMREWRITER const g_aRewritersFor_H_and_HPP []
static PFNSCMREWRITER const g_aRewritersFor_Makefile_kmk []
static PFNSCMREWRITER const g_aRewritersFor_Makefile_kup []
static PFNSCMREWRITER const g_aRewritersFor_RC []
static PFNSCMREWRITER const g_aRewritersFor_ShellScripts []
static RTGETOPTDEF g_aScmOpts []
static SCMSETTINGSBASE const g_Defaults
static bool g_fDiffIgnoreEol = false
static bool g_fDiffIgnoreLeadingWS = false
static bool g_fDiffIgnoreTrailingWS = false
static bool g_fDiffSpecialChars = true
static bool g_fDryRun = true
static int g_iVerbosity = 2
static const char * g_pszChangedSuff = ""
static const char * g_pszFileFilter = NULL
static const char g_szProgName [] = "scm"
static const char g_szTabSpaces [16+1] = " "
const char * pchLeft
const char size_t SCMEOL const
char * 
pchRight


Generated by  Doxygen 1.6.0   Back to index