Commit 975179f9 authored by Joachim Eibl's avatar Joachim Eibl

Corrections for 0.9.81:

- Fix for configure --enable-final
- Bugfixes
- First steps towards internationalisation


git-svn-id: https://kdiff3.svn.sourceforge.net/svnroot/kdiff3/trunk@56 c8aa9fed-2811-0410-8543-893ada326672
parent 9bf4ebab
Version 0.9.81 - 2004/01/08
===========================
- Allow to compile with --enable-final
- Bugfix for 3 file-compare (and A or B don't exist, crashed)
- Bugfix for crash when second directory is merged
- Some keyboard-shortcuts for selection of merge-operation didn't work correctly.
- Shortcuts Ctrl-1/2/3 are possible in textmergewindow and in dirmergewindow,
depending on the focus.
- First steps towards internationalisation
- Manpage doc/en/kdiff3.1 by Eike Sauer (for Debian)
- Directory rescan shortcut SHIFT-F5
Version 0.9.80 - 2003/12/08
===========================
New Text Diff/Merge Features:
......
......@@ -3,16 +3,19 @@ KDiff3-Readme
Author: Joachim Eibl (joachim.eibl@gmx.de)
Copyright: (C) 2002-2003 by Joachim Eibl
KDiff3-Version: 0.9.80
KDiff3-Version: 0.9.81
KDiff3 is a program that
- compares two or three input files,
- compares and merges two or three input files or directories,
- shows the differences line by line and character by character (!),
- provides an automatic merge-facility and
- an integrated editor for comfortable solving of merge-conflicts
- and has an intuitive graphical user interface,
- and allows directory comparison and merge.
- has support for KDE-KIO (ftp, sftp, http, fish, smb)
- and has an intuitive graphical user interface.
Do you want help translating? Read the README in the po-subdirectory!
Licence:
......@@ -42,19 +45,19 @@ Exception from the GPL:
Requirements & Installation:
Version 0.9.80 provides special support for KDE3, but it can also be
Version 0.9.81 provides special support for KDE3, but it can also be
built without KDE3 if the Qt-libraries are available.
(I also tested the program under Windows.)
You always need
- kdiff3-0.9.80.tar.gz
- kdiff3-0.9.81.tar.gz
For building the KDE3-version
- KDE>=3.1 and QT>=3.1-libraries.
- gcc, g++ with version >=3.2
For building the Qt-only-version
- QT-libraries (version 2.3.0 or >=3.1.0).
- QT-libraries (version >=3.1.0).
(www.trolltech.com)
- for Un*x: gcc, g++ with version >=3.2
- for Windows: VC6
......@@ -64,7 +67,7 @@ Installation for KDE3:
- Make sure your shell-variable QTDIR is correct. (echo $QTDIR).
If it doesn't contain the correct path, type
export QTDIR=your_path_to_qt (e.g. /usr/lib/qt3)
- cd into the directory kdiff3-0.9.80 and type
- cd into the directory kdiff3-0.9.81 and type
- ./configure --prefix=/opt/kde3 (your KDE3 directory here)
- (make clean) (Required if you already compiled once.)
- make (Run compilation)
......@@ -87,13 +90,22 @@ Installation for KDE3:
executable. To avoid confusion, better remove the local version then.
(rm -R `find $KDEHOME -name "*kdiff3*" -not -name "kdiff3*rc"`)
Upgrading KDiff3 for KDE:
If you already installed an older version or KDiff3 and you have the
impression, that the new version doesn't work as described, you should try to
remove all files belonging to KDiff3 before reinstalling.
Try this search command to locate KDiff3-related files:
find $HOME/.kde /usr /opt -iname "*kdiff3*"
(Will take a few minutes.)
Installation for the Qt-only-platforms for Un*x:
(for Qt >=3.1.0)
- Make sure your shell-variable QTDIR is correct. (echo $QTDIR).
If it doesn't contain the correct path, type
export QTDIR=your_path_to_qt (e.g. /usr/lib/qt)
- cd into the directory kdiff3-0.9.80/src and type
- cd into the directory kdiff3-0.9.81/src and type
- make -f Makefile.qt
- make -f Makefile.qt install (You must have root-rights for this step.)
(copies the files into /usr/local/bin and /usr/local/share/doc/kdiff3)
......@@ -103,17 +115,7 @@ Installation for the Qt-only-platforms for Un*x:
Build for Windows:
(Qt 2.3-non commercial)
- Start some console.
- Make sure your shell-variable QTDIR is correct. (echo %QTDIR%).
If it doesn't contain the correct path, type
set QTDIR=your_path_to_qt (e.g. c:\qt)
- Make sure your VC6 environment variables are set. Run VCVARS32.BAT.
(Typically located in "c:\programs\Microsoft Visual Studio\VC98\bin")
- cd into the directory kdiff3-0.9.80\src and type
- nmake /f Makefile.win_qt230
- For execution the Qt-DLL must be in the path or in the same directory.
For newer versions of Qt, use qmake and kdiff3.pro to generate
Use qmake and kdiff3.pro to generate
an appropriate Makefile.
qmake kdiff3.pro -o Makefile
......@@ -124,7 +126,7 @@ Build for Mac:
- qmake kdiff3.pro -o Makefile
- If you succeed, I'd like to know how so I can document it here.
Start from commandline:
- Comparing 2 files: kdiff3 file1 file2
- Merging 2 files: kdiff3 file1 file2 -o outputfile
......
####### kdevelop will overwrite this part!!! (begin)##########
SUBDIRS = en
####### kdevelop will overwrite this part!!! (end)############
# the SUBDIRS is filled automatically by am_edit. If files are
# in this directory they are installed into the english dir
KDE_LANG = en
KDE_DOCS = kdiff3
SUBDIRS = $(AUTODIRS)
KDE_DOCS = kdiff3
KDE_LANG = en
man1_MANS=kdiff3.1
####### kdevelop will overwrite this part!!! (begin)##########
####### kdevelop will overwrite this part!!! (end)############
POFILES = AUTO
#############################################################################
# Makefile for building: kdiff3
# Generated by qmake (1.06c) (Qt 3.2.1) on: Mon Dec 8 20:06:47 2003
# Generated by qmake (1.06c) (Qt 3.2.1) on: Sun Jan 4 12:48:04 2004
# Project: kdiff3.pro
# Template: app
# Command: $(QMAKE) -o Makefile kdiff3.pro
......@@ -255,14 +255,13 @@ kreplacements.o: kreplacements/kreplacements.cpp kreplacements/kreplacements.h \
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o kreplacements.o kreplacements/kreplacements.cpp
gnudiff_analyze.o: gnudiff_analyze.cpp gnudiff_diff.h \
gnudiff_xalloc.h \
gnudiff_system.h
gnudiff_io.o: gnudiff_io.cpp gnudiff_diff.h \
gnudiff_xalloc.h \
gnudiff_system.h
gnudiff_xmalloc.o: gnudiff_xmalloc.cpp gnudiff_xalloc.h
gnudiff_xmalloc.o: gnudiff_xmalloc.cpp gnudiff_diff.h \
gnudiff_system.h
moc_diff.o: moc_diff.cpp diff.h common.h \
fileaccess.h
......
......@@ -1078,13 +1078,11 @@ void calcWhiteDiff3Lines(
void debugLineCheck( Diff3LineList& d3ll, int size, int idx )
{
Diff3LineList::iterator it = d3ll.begin();
int i=0;
for ( it = d3ll.begin(); it!= d3ll.end(); ++it )
{
int l;
int l=0;
if (idx==1) l=(*it).lineA;
else if (idx==2) l=(*it).lineB;
else if (idx==3) l=(*it).lineC;
......
......@@ -30,6 +30,7 @@
#include <qdragobject.h>
#include <klocale.h>
#undef leftInfoWidth
#define leftInfoWidth (4+m_lineNumberWidth) // Nr of information columns on left side
......
......@@ -365,6 +365,7 @@ bool DirectoryMergeWindow::init
clear();
m_mergeItemList.clear();
m_currentItemForOperation = m_mergeItemList.end();
m_dirA = dirA;
......@@ -396,7 +397,7 @@ bool DirectoryMergeWindow::init
(m_dirDest.prettyAbsPath() == m_dirA.prettyAbsPath() || m_dirDest.prettyAbsPath()==m_dirB.prettyAbsPath() ) )
{
KMessageBox::error(this,
i18n( "The destination directory must not be the same as A or B when"
i18n( "The destination directory must not be the same as A or B when "
"three directories are merged.\nCheck again before continuing."),
i18n("Parameter Warning"));
return false;
......@@ -610,8 +611,8 @@ static void setMergeOperation( QListViewItem* pLVI, e_MergeOperation eMergeOp )
// Merge current item (merge mode)
void DirectoryMergeWindow::slotCurrentDoNothing() { setMergeOperation(currentItem(), eNoOperation ); }
void DirectoryMergeWindow::slotCurrentChooseA() { setMergeOperation(currentItem(), eCopyAToDest ); }
void DirectoryMergeWindow::slotCurrentChooseB() { setMergeOperation(currentItem(), eCopyBToDest ); }
void DirectoryMergeWindow::slotCurrentChooseA() { setMergeOperation(currentItem(), m_bSyncMode ? eCopyAToB : eCopyAToDest ); }
void DirectoryMergeWindow::slotCurrentChooseB() { setMergeOperation(currentItem(), m_bSyncMode ? eCopyBToA : eCopyBToDest ); }
void DirectoryMergeWindow::slotCurrentChooseC() { setMergeOperation(currentItem(), eCopyCToDest ); }
void DirectoryMergeWindow::slotCurrentMerge()
{
......@@ -677,6 +678,14 @@ void DirectoryMergeWindow::keyPressEvent( QKeyEvent* e )
QListView::keyPressEvent(e);
}
void DirectoryMergeWindow::focusInEvent(QFocusEvent*)
{
updateAvailabilities();
}
void DirectoryMergeWindow::focusOutEvent(QFocusEvent*)
{
updateAvailabilities();
}
void DirectoryMergeWindow::setAllMergeOperations( e_MergeOperation eDefaultOperation )
{
......@@ -1600,8 +1609,15 @@ void DirectoryMergeWindow::slotRunOperationForCurrentItem()
if ( m_mergeItemList.empty() )
{
QListViewItem* pBegin = currentItem();
QListViewItem* pEnd = pBegin;
while ( pEnd!=0 && pEnd->nextSibling()==0 )
{
pEnd = pEnd->parent();
}
if ( pEnd!=0 )
pEnd=pEnd->nextSibling();
prepareMergeStart( pBegin, pBegin->nextSibling(), bVerbose );
prepareMergeStart( pBegin, pEnd, bVerbose );
mergeContinue(true, bVerbose);
}
else
......@@ -1671,7 +1687,7 @@ void DirectoryMergeWindow::mergeContinue(bool bStart, bool bVerbose)
// Count the number of completed items (for the progress bar).
for( MergeItemList::iterator i = m_mergeItemList.begin(); i!=m_mergeItemList.end(); ++i )
{
DirMergeItem* pDMI = static_cast<DirMergeItem*>(*i);
DirMergeItem* pDMI = *i;
++nrOfItems;
if ( pDMI->m_pMFI->m_bOperationComplete )
++nrOfCompletedItems;
......@@ -2117,15 +2133,11 @@ bool DirectoryMergeWindow::makeDir( const QString& name, bool bQuiet )
}
DirectoryMergeInfo::DirectoryMergeInfo( QWidget* pParent )
: QFrame(pParent)
{
QVBoxLayout *topLayout = new QVBoxLayout( this );
QGridLayout *grid = new QGridLayout( topLayout );
grid->setColStretch(1,10);
......@@ -2261,7 +2273,7 @@ void DirectoryMergeWindow::initDirectoryMergeActions( QObject* pKDiff3App, KActi
dirMergeCurrent = new KAction(i18n("Merge Current File"), QIconSet(QPixmap(startmerge)), 0, pKDiff3App, SLOT(slotMergeCurrentFile()), ac, "merge_current");
dirFoldAll = new KAction(i18n("Fold All Subdirs"), 0, p, SLOT(slotFoldAllSubdirs()), ac, "dir_fold_all");
dirUnfoldAll = new KAction(i18n("Unfold All Subdirs"), 0, p, SLOT(slotUnfoldAllSubdirs()), ac, "dir_unfold_all");
dirRescan = new KAction(i18n("Rescan"), 0, p, SLOT(reload()), ac, "dir_rescan");
dirRescan = new KAction(i18n("Rescan"), SHIFT+Key_F5, p, SLOT(reload()), ac, "dir_rescan");
dirChooseAEverywhere = new KAction(i18n("Choose A for All Items"), 0, p, SLOT(slotChooseAEverywhere()), ac, "dir_choose_a_everywhere");
dirChooseBEverywhere = new KAction(i18n("Choose B for All Items"), 0, p, SLOT(slotChooseBEverywhere()), ac, "dir_choose_b_everywhere");
dirChooseCEverywhere = new KAction(i18n("Choose C for All Items"), 0, p, SLOT(slotChooseCEverywhere()), ac, "dir_choose_c_everywhere");
......@@ -2287,7 +2299,8 @@ void DirectoryMergeWindow::initDirectoryMergeActions( QObject* pKDiff3App, KActi
}
void DirectoryMergeWindow::updateAvailabilities( bool bDirCompare, bool bDiffWindowVisible )
void DirectoryMergeWindow::updateAvailabilities( bool bDirCompare, bool bDiffWindowVisible,
KToggleAction* chooseA, KToggleAction* chooseB, KToggleAction* chooseC )
{
dirStartOperation->setEnabled( bDirCompare );
dirRunOperationForCurrentItem->setEnabled( bDirCompare );
......@@ -2317,13 +2330,24 @@ void DirectoryMergeWindow::updateAvailabilities( bool bDirCompare, bool bDiffWin
bool bMergeMode = bThreeDirs || !m_bSyncMode;
bool bFTConflict = pMFI==0 ? false : conflictingFileTypes(*pMFI);
bool bDirWindowHasFocus = isVisible() && hasFocus();
dirCurrentDoNothing->setEnabled( bItemActive && bMergeMode );
dirCurrentChooseA->setEnabled( bItemActive && bMergeMode && pMFI->m_bExistsInA );
dirCurrentChooseB->setEnabled( bItemActive && bMergeMode && pMFI->m_bExistsInB );
dirCurrentChooseC->setEnabled( bItemActive && bMergeMode && pMFI->m_bExistsInC );
dirCurrentMerge->setEnabled( bItemActive && bMergeMode && !bFTConflict );
dirCurrentDelete->setEnabled( bItemActive && bMergeMode );
if ( bDirWindowHasFocus )
{
chooseA->setEnabled( bItemActive && pMFI->m_bExistsInA );
chooseB->setEnabled( bItemActive && pMFI->m_bExistsInB );
chooseC->setEnabled( bItemActive && pMFI->m_bExistsInC );
chooseA->setChecked( false );
chooseB->setChecked( false );
chooseC->setChecked( false );
}
dirCurrentSyncDoNothing->setEnabled( bItemActive && !bMergeMode );
dirCurrentSyncCopyAToB->setEnabled( bItemActive && !bMergeMode && pMFI->m_bExistsInA );
dirCurrentSyncCopyBToA->setEnabled( bItemActive && !bMergeMode && pMFI->m_bExistsInB );
......
......@@ -140,9 +140,12 @@ public:
int totalColumnWidth();
bool isSyncMode() { return m_bSyncMode; }
void initDirectoryMergeActions( QObject* pKDiff3App, KActionCollection* ac );
void updateAvailabilities( bool bDirCompare, bool bDiffWindowVisible );
void updateAvailabilities( bool bDirCompare, bool bDiffWindowVisible,
KToggleAction* chooseA, KToggleAction* chooseB, KToggleAction* chooseC );
virtual void keyPressEvent( QKeyEvent* e );
virtual void focusInEvent( QFocusEvent* e );
virtual void focusOutEvent( QFocusEvent* e );
public slots:
void reload();
......@@ -278,6 +281,7 @@ protected slots:
class DirectoryMergeInfo : public QFrame
{
Q_OBJECT
public:
DirectoryMergeInfo( QWidget* pParent );
void setInfo(
......
......@@ -844,10 +844,10 @@ bool FileAccessJobHandler::copyFile( const QString& dest )
std::vector<char> buffer(100000);
Q_LONG bufSize = buffer.size();
Q_LONG srcSize = srcFile.size();
while ( srcSize > 0 )
while ( srcSize > 0 && !g_pProgressDialog->wasCancelled() )
{
Q_LONG readSize = srcFile.readBlock( &buffer[0], min2( srcSize, bufSize ) );
if ( readSize==-1 )
if ( readSize==-1 || readSize==0 )
{
m_pFileAccess->m_statusText = i18n("Error during file copy operation: Reading failed. Filename: %1").arg(srcName);
return false;
......@@ -856,7 +856,7 @@ bool FileAccessJobHandler::copyFile( const QString& dest )
while ( readSize > 0 )
{
Q_LONG writeSize = destFile.writeBlock( &buffer[0], readSize );
if ( writeSize==-1 )
if ( writeSize==-1 || writeSize==0 )
{
m_pFileAccess->m_statusText = i18n("Error during file copy operation: Writing failed. Filename: %1").arg(destName);
return false;
......@@ -864,6 +864,7 @@ bool FileAccessJobHandler::copyFile( const QString& dest )
readSize -= writeSize;
}
destFile.flush();
g_pProgressDialog->setSubCurrent( (double)(srcFile.size()-srcSize)/srcFile.size(), false );
}
srcFile.close();
destFile.close();
......
/* Analyze file differences for GNU DIFF.
Modified for KDiff3 by Joachim Eibl 2003.
The original file was part of GNU DIFF.
Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1998, 2001, 2002
Free Software Foundation, Inc.
This file is part of GNU DIFF.
GNU DIFF is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
......@@ -40,7 +39,6 @@
#include "gnudiff_diff.h"
//#include <error.h>
#include <stdlib.h>
#include "gnudiff_xalloc.h"
static lin *xvec, *yvec; /* Vectors being compared. */
static lin *fdiag; /* Vector, indexed by diagonal, containing
......@@ -55,7 +53,7 @@ static lin too_expensive; /* Edit scripts longer than this are too
expensive to compute. */
#define SNAKE_LIMIT 20 /* Snakes bigger than this are considered `big'. */
namespace GnuDiff {
struct partition
{
......@@ -95,8 +93,8 @@ struct partition
the worst this can do is cause suboptimal diff output.
It cannot cause incorrect diff output. */
static lin
diag (lin xoff, lin xlim, lin yoff, lin ylim, bool find_minimal,
lin
GnuDiff::diag (lin xoff, lin xlim, lin yoff, lin ylim, bool find_minimal,
struct partition *part)
{
lin *const fd = fdiag; /* Give the compiler a chance. */
......@@ -334,8 +332,7 @@ diag (lin xoff, lin xlim, lin yoff, lin ylim, bool find_minimal,
If FIND_MINIMAL, find a minimal difference no matter how
expensive it is. */
static void
compareseq (lin xoff, lin xlim, lin yoff, lin ylim, bool find_minimal)
void GnuDiff::compareseq (lin xoff, lin xlim, lin yoff, lin ylim, bool find_minimal)
{
lin * const xv = xvec; /* Help the compiler. */
lin * const yv = yvec;
......@@ -400,8 +397,7 @@ compareseq (lin xoff, lin xlim, lin yoff, lin ylim, bool find_minimal)
When we discard a line, we also mark it as a deletion or insertion
so that it will be printed in the output. */
static void
discard_confusing_lines (struct file_data filevec[])
void GnuDiff::discard_confusing_lines (struct file_data filevec[])
{
int f;
lin i;
......@@ -609,8 +605,7 @@ discard_confusing_lines (struct file_data filevec[])
but usually it is cleaner to consider the following identical line
to be the "change". */
static void
shift_boundaries (struct file_data filevec[])
void GnuDiff::shift_boundaries (struct file_data filevec[])
{
int f;
......@@ -714,9 +709,7 @@ shift_boundaries (struct file_data filevec[])
If DELETED is 0 then LINE0 is the number of the line before
which the insertion was done; vice versa for INSERTED and LINE1. */
static struct change *
add_change (lin line0, lin line1, lin deleted, lin inserted,
struct change *old)
GnuDiff::change* GnuDiff::add_change (lin line0, lin line1, lin deleted, lin inserted, struct change *old)
{
struct change *newChange = (change*) xmalloc (sizeof *newChange);
......@@ -731,8 +724,7 @@ add_change (lin line0, lin line1, lin deleted, lin inserted,
/* Scan the tables of which lines are inserted and deleted,
producing an edit script in reverse order. */
static struct change *
build_reverse_script (struct file_data const filevec[])
GnuDiff::change* GnuDiff::build_reverse_script (struct file_data const filevec[])
{
struct change *script = 0;
bool *changed0 = filevec[0].changed;
......@@ -768,8 +760,7 @@ build_reverse_script (struct file_data const filevec[])
/* Scan the tables of which lines are inserted and deleted,
producing an edit script in forward order. */
static struct change *
build_script (struct file_data const filevec[])
GnuDiff::change* GnuDiff::build_script (struct file_data const filevec[])
{
struct change *script = 0;
bool *changed0 = filevec[0].changed;
......@@ -801,7 +792,7 @@ build_script (struct file_data const filevec[])
/* Report the differences of two files. */
struct change* diff_2_files (struct comparison *cmp)
GnuDiff::change* GnuDiff::diff_2_files (struct comparison *cmp)
{
lin diags;
int f;
......@@ -884,11 +875,6 @@ struct change* diff_2_files (struct comparison *cmp)
return script;
}
inline bool isWhite( char c )
{
return c==' ' || c=='\t' || c=='\r';
}
/* Compare two lines (typically one from each input file)
according to the command line options.
For efficiency, this is invoked only when the lines do not match exactly
......@@ -896,7 +882,7 @@ inline bool isWhite( char c )
Return nonzero if the lines differ. */
bool
lines_differ (char const *s1, char const *s2)
GnuDiff::lines_differ (char const *s1, char const *s2)
{
register unsigned char const *t1 = (unsigned char const *) s1;
register unsigned char const *t2 = (unsigned char const *) s2;
......@@ -1034,4 +1020,4 @@ lines_differ (char const *s1, char const *s2)
return 1;
}
} // namespace GnuDiff
/* Shared definitions for GNU DIFF
Modified for KDiff3 by Joachim Eibl 2003.
The original file was part of GNU DIFF.
Copyright (C) 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1998, 2001,
2002 Free Software Foundation, Inc.
This file is part of GNU DIFF.
GNU DIFF is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
......@@ -22,15 +21,18 @@
If not, write to the Free Software Foundation,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef GNUDIFF_DIFF_H
#define GNUDIFF_DIFF_H
#include "gnudiff_system.h"
#include <stdio.h>
#define TAB_WIDTH 8
namespace GnuDiff
class GnuDiff
{
public:
/* What kind of changes a hunk contains. */
enum changes
{
......@@ -49,12 +51,6 @@ enum changes
/* Variables for command line options */
#ifndef GDIFF_MAIN
# define XTERN extern
#else
# define XTERN
#endif
enum output_style
{
/* No output style specified. */
......@@ -89,24 +85,24 @@ enum output_style
i.e. can handle a file that ends in a non-newline. */
#define ROBUST_OUTPUT_STYLE(S) ((S) != OUTPUT_ED && (S) != OUTPUT_FORWARD_ED)
XTERN enum output_style output_style;
enum output_style output_style;
/* Nonzero if output cannot be generated for identical files. */
XTERN bool no_diff_means_no_output;
bool no_diff_means_no_output;
/* Number of lines of context to show in each set of diffs.
This is zero when context is not to be shown. */
XTERN lin context;
lin context;
/* Consider all files as text files (-a).
Don't interpret codes over 0177 as implying a "binary file". */
XTERN bool text;
bool text;
/* Number of lines to keep in identical prefix and suffix. */
XTERN lin horizon_lines;
lin horizon_lines;
/* The significance of white space during comparisons. */
XTERN enum
enum
{
/* All white space is significant (the default). */
IGNORE_NO_WHITE_SPACE,
......@@ -122,94 +118,94 @@ XTERN enum
} ignore_white_space;
/* Ignore changes that affect only blank lines (-B). */
XTERN bool ignore_blank_lines;
bool ignore_blank_lines;
/* Ignore changes that affect only numbers. (J. Eibl) */
XTERN bool bIgnoreNumbers;
XTERN bool bIgnoreWhiteSpace;
bool bIgnoreNumbers;
bool bIgnoreWhiteSpace;
/* Files can be compared byte-by-byte, as if they were binary.
This depends on various options. */
XTERN bool files_can_be_treated_as_binary;
bool files_can_be_treated_as_binary;
/* Ignore differences in case of letters (-i). */
XTERN bool ignore_case;
bool ignore_case;
/* Ignore differences in case of letters in file names. */
XTERN bool ignore_file_name_case;
bool ignore_file_name_case;
/* File labels for `-c' output headers (--label). */
XTERN char *file_label[2];
char *file_label[2];
/* Regexp to identify function-header lines (-F). */
//XTERN struct re_pattern_buffer function_regexp;
//struct re_pattern_buffer function_regexp;
/* Ignore changes that affect only lines matching this regexp (-I). */
//XTERN struct re_pattern_buffer ignore_regexp;
//struct re_pattern_buffer ignore_regexp;
/* Say only whether files differ, not how (-q). */
XTERN bool brief;
bool brief;
/* Expand tabs in the output so the text lines up properly
despite the characters added to the front of each line (-t). */
XTERN bool expand_tabs;
bool expand_tabs;
/* Use a tab in the output, rather than a space, before the text of an
input line, so as to keep the proper alignment in the input line
without changing the characters in it (-T). */
XTERN bool initial_tab;
bool initial_tab;
/* Remove trailing carriage returns from input. */
XTERN bool strip_trailing_cr;
bool strip_trailing_cr;
/* In directory comparison, specify file to start with (-S).
This is used for resuming an aborted comparison.
All file names less than this name are ignored. */
XTERN char const *starting_file;
char const *starting_file;
/* Pipe each file's output through pr (-l). */
XTERN bool paginate;
bool paginate;
/* Line group formats for unchanged, old, new, and changed groups. */
XTERN char const *group_format[CHANGED + 1];
char const *group_format[CHANGED + 1];
/* Line formats for unchanged, old, and new lines. */
XTERN char const *line_format[NEW + 1];
char const *line_format[NEW + 1];
/* If using OUTPUT_SDIFF print extra information to help the sdiff filter. */
XTERN bool sdiff_merge_assist;
bool sdiff_merge_assist;
/* Tell OUTPUT_SDIFF to show only the left version of common lines. */
XTERN bool left_column;
bool left_column;
/* Tell OUTPUT_SDIFF to not show common lines. */
XTERN bool suppress_common_lines;
bool suppress_common_lines;
/* The half line width and column 2 offset for OUTPUT_SDIFF. */
XTERN unsigned int sdiff_half_width;
XTERN unsigned int sdiff_column2_offset;
unsigned int sdiff_half_width;
unsigned int sdiff_column2_offset;
/* String containing all the command options diff received,
with spaces between and at the beginning but none at the end.
If there were no options given, this string is empty. */
XTERN char *switch_string;
char *switch_string;
/* Use heuristics for better speed with large files with a small
density of changes. */
XTERN bool speed_large_files;
bool speed_large_files;
/* Patterns that match file names to be excluded. */
XTERN struct exclude *excluded;
struct exclude *excluded;
/* Don't discard lines. This makes things slower (sometimes much
slower) but will find a guaranteed minimal set of changes. */
XTERN bool minimal;
bool minimal;
/* Name of program the user invoked (for error messages). */
XTERN char *program_name;
char *program_name;
/* The strftime format to use for time strings. */
XTERN char const *time_format;
char const *time_format;
/* The result of comparison is an "edit script": a chain of `struct change'.
Each `struct change' represents one place where some lines are deleted
......@@ -317,11 +313,11 @@ struct comparison
/* Describe the two files currently being compared. */
XTERN struct file_data files[2];
struct file_data files[2];
/* Stdio stream to output diffs to. */
XTERN FILE *outfile;
FILE *outfile;
/* Declare various functions. */
......@@ -356,8 +352,8 @@ void print_rcs_script (struct change *);
void print_sdiff_script (struct change *);
/* util.c */
extern char const change_letter[4];
extern char const pr_program[];
//extern char const change_letter[4];
//extern char const pr_program[];
char *concat (char const *, char const *, char const *);
char *dir_file_pathname (char const *, char const *);
bool lines_differ (char const *, char const *);
......@@ -383,5 +379,56 @@ void setup_output (char const *, char const *, bool);
void translate_range (struct file_data const *, lin, lin, long *, long *);
/* version.c */
extern char const version_string[];
} // namespace GnuDiff
//extern char const version_string[];
private:
// gnudiff_analyze.cpp
lin diag (lin xoff, lin xlim, lin yoff, lin ylim, bool find_minimal, struct partition *part);
void compareseq (lin xoff, lin xlim, lin yoff, lin ylim, bool find_minimal);
void discard_confusing_lines (struct file_data filevec[]);
void shift_boundaries (struct file_data filevec[]);
struct change * add_change (lin line0, lin line1, lin deleted, lin inserted, struct change *old);