VBoxCmp.cpp revision 894ecda031ec5133d0757b863e5fdc491ed1d089
/* $Id$ */
/** @file
* File Compare - Compares two files byte by byte.
*/
/*
* Copyright (C) 2006-2012 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
/**
* Writes an error message.
*
* @returns RTEXITCODE_FAILURE.
* @param pcszFormat Error message.
* @param ... Format argument referenced in the message.
*/
{
return RTEXITCODE_FAILURE;
}
{
#if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2)
#else
#endif
if (!pFile)
return pFile;
}
{
return RTEXITCODE_FAILURE;
for (;;)
{
break;
{
printErr("0x%x%08x: %#04x (%3d) != %#04x (%3d)\n", (uint32_t)(off >> 32), (uint32_t)off, b1, b1, b2, b2);
cMismatches++;
if (cMismatches > 128)
{
printErr("Too many mismatches, giving up\n");
return rcRet;
}
}
off++;
}
{
else
}
return rcRet;
}
{
if (argc == 3)
{
if (pFile1)
if (pFile2)
}
else
return rcExit;
}