From d2ae940d847bd5cfba4157f4f9230e7553bb5cca Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Fri, 22 Aug 2003 21:58:37 +0000 Subject: [PATCH] Adding licence text and comments --- Src/files.cpp | 45 ++++++++++++++++++++++++++++++++++++++++----- Src/files.h | 32 ++++++++++++++++++++++++++++++++ Src/readme.txt | 2 ++ 3 files changed, 74 insertions(+), 5 deletions(-) diff --git a/Src/files.cpp b/Src/files.cpp index 3a164890a..5b4ab0031 100644 --- a/Src/files.cpp +++ b/Src/files.cpp @@ -1,6 +1,33 @@ +///////////////////////////////////////////////////////////////////////////// +// License (GPLv2+): +// This program 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 of the License, or (at +// your option) any later version. +// +// This program is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +///////////////////////////////////////////////////////////////////////////// +/** + * @file files.cpp + * + * @brief Code file routines + */ +// RCS ID line follows -- this is updated by CVS +// $Id$ + #include "stdafx.h" #include "files.h" +/** + * @brief Open file as memory-mapped file + */ BOOL files_openFileMapped(MAPPEDFILEDATA *fileData) { DWORD dwProtectFlag = 0; @@ -83,6 +110,9 @@ BOOL files_openFileMapped(MAPPEDFILEDATA *fileData) return bSuccess; } +/** + * @brief Close memory-mapped file + */ BOOL files_closeFileMapped(MAPPEDFILEDATA *fileData, DWORD newSize, BOOL flush) { BOOL bSuccess = TRUE; @@ -116,9 +146,11 @@ BOOL files_closeFileMapped(MAPPEDFILEDATA *fileData, DWORD newSize, BOOL flush) return bSuccess; } -// Reads different EOL formats and returns length of EOL -// This function is safe: it first checks that there are unread bytes, -// so that we do not read past EOF +/** + * @brief Reads different EOL formats and returns length of EOL + * @note This function is safe: it first checks that there are unread bytes, + * @note so that we do not read past EOF + */ int files_readEOL(TCHAR *lpLineEnd, DWORD bytesLeft, BOOL bEOLSensitive) { int eolBytes = 0; @@ -164,11 +196,14 @@ int files_readEOL(TCHAR *lpLineEnd, DWORD bytesLeft, BOOL bEOLSensitive) return eolBytes; } +/** + * @brief Checks memory-mapped file for a binary data + * @note This does not work for UNICODE files + * @note as WinMerge is not compiled UNICODE enabled + */ int files_binCheck(MAPPEDFILEDATA *fileData) { // Use unsigned type for binary compare - // Note that this does not work for UNICODE files - // as WinMerge is not compiled UNICODE enabled TBYTE *lpByte = (TBYTE *)fileData->pMapBase; BOOL bBinary = FALSE; DWORD dwBytesRead = 0; diff --git a/Src/files.h b/Src/files.h index 0b1b3f562..aa356f9b9 100644 --- a/Src/files.h +++ b/Src/files.h @@ -1,6 +1,33 @@ +///////////////////////////////////////////////////////////////////////////// +// License (GPLv2+): +// This program 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 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +///////////////////////////////////////////////////////////////////////////// +/** + * @file files.h + * + * @brief Declaration file for file routines + */ +// RCS ID line follows -- this is updated by CVS +// $Id$ + #ifndef _FILES_H_INCLUDED #define _FILES_H_INCLUDED +/** + * @brief File-operation return-statuses + */ enum { FRESULT_ERROR = 0, @@ -8,6 +35,11 @@ enum FRESULT_BINARY }; +/** + * @brief Memory-mapped file information + * When memory-mapped file is created, related information is + * stored to this structure. + */ struct MAPPEDFILEDATA { TCHAR fileName[_MAX_PATH]; diff --git a/Src/readme.txt b/Src/readme.txt index 978f777db..d49b5eba0 100644 --- a/Src/readme.txt +++ b/Src/readme.txt @@ -2,6 +2,8 @@ PATCH: [ 787495 ] Create diffutils class (CDiffWrapper) WinMerge: Merge.dsp MergeDoc.h MergeDoc.cpp Added: DiffWrapper.h DiffWrapper.cpp + Adding licence text and comments + WinMerge: files.h files.cpp 2003-08-20 Perry PATCH: [ 791924 ] Fix sorting when columns are reordered -- 2.11.0