ReactOS 0.4.16-dev-297-gc569aee
fc.h File Reference
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <windows.h>
#include <wine/list.h>
#include "resource.h"
Include dependency graph for fc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  NODE_W
 
struct  NODE_A
 
struct  FILECOMPARE
 

Macros

#define FLAG_A   (1 << 0)
 
#define FLAG_B   (1 << 1)
 
#define FLAG_C   (1 << 2)
 
#define FLAG_L   (1 << 3)
 
#define FLAG_LBn   (1 << 4)
 
#define FLAG_N   (1 << 5)
 
#define FLAG_OFFLINE   (1 << 6)
 
#define FLAG_T   (1 << 7)
 
#define FLAG_U   (1 << 8)
 
#define FLAG_W   (1 << 9)
 
#define FLAG_nnnn   (1 << 10)
 
#define FLAG_HELP   (1 << 11)
 
#define MAX_VIEW_SIZE   (64 * 1024 * 1024)
 

Typedefs

typedef enum FCRET FCRET
 
typedef struct NODE_W NODE_W
 
typedef struct NODE_A NODE_A
 
typedef struct FILECOMPARE FILECOMPARE
 

Enumerations

enum  FCRET {
  FCRET_INVALID = -1 , FCRET_IDENTICAL = 0 , FCRET_DIFFERENT = 1 , FCRET_CANT_FIND = 2 ,
  FCRET_NO_MORE_DATA = 3
}
 

Functions

FCRET TextCompareW (FILECOMPARE *pFC, HANDLE *phMapping0, const LARGE_INTEGER *pcb0, HANDLE *phMapping1, const LARGE_INTEGER *pcb1)
 
FCRET TextCompareA (FILECOMPARE *pFC, HANDLE *phMapping0, const LARGE_INTEGER *pcb0, HANDLE *phMapping1, const LARGE_INTEGER *pcb1)
 
VOID PrintLineW (const FILECOMPARE *pFC, DWORD lineno, LPCWSTR psz)
 
VOID PrintLineA (const FILECOMPARE *pFC, DWORD lineno, LPCSTR psz)
 
VOID PrintCaption (LPCWSTR file)
 
VOID PrintEndOfDiff (VOID)
 
VOID PrintDots (VOID)
 
FCRET NoDifference (VOID)
 
FCRET Different (LPCWSTR file0, LPCWSTR file1)
 
FCRET LongerThan (LPCWSTR file0, LPCWSTR file1)
 
FCRET OutOfMemory (VOID)
 
FCRET CannotRead (LPCWSTR file)
 
FCRET InvalidSwitch (VOID)
 
FCRET ResyncFailed (VOID)
 
HANDLE DoOpenFileForInput (LPCWSTR file)
 

Macro Definition Documentation

◆ FLAG_A

#define FLAG_A   (1 << 0)

Definition at line 49 of file fc.h.

◆ FLAG_B

#define FLAG_B   (1 << 1)

Definition at line 50 of file fc.h.

◆ FLAG_C

#define FLAG_C   (1 << 2)

Definition at line 51 of file fc.h.

◆ FLAG_HELP

#define FLAG_HELP   (1 << 11)

Definition at line 60 of file fc.h.

◆ FLAG_L

#define FLAG_L   (1 << 3)

Definition at line 52 of file fc.h.

◆ FLAG_LBn

#define FLAG_LBn   (1 << 4)

Definition at line 53 of file fc.h.

◆ FLAG_N

#define FLAG_N   (1 << 5)

Definition at line 54 of file fc.h.

◆ FLAG_nnnn

#define FLAG_nnnn   (1 << 10)

Definition at line 59 of file fc.h.

◆ FLAG_OFFLINE

#define FLAG_OFFLINE   (1 << 6)

Definition at line 55 of file fc.h.

◆ FLAG_T

#define FLAG_T   (1 << 7)

Definition at line 56 of file fc.h.

◆ FLAG_U

#define FLAG_U   (1 << 8)

Definition at line 57 of file fc.h.

◆ FLAG_W

#define FLAG_W   (1 << 9)

Definition at line 58 of file fc.h.

◆ MAX_VIEW_SIZE

#define MAX_VIEW_SIZE   (64 * 1024 * 1024)

Definition at line 96 of file fc.h.

Typedef Documentation

◆ FCRET

typedef enum FCRET FCRET

◆ FILECOMPARE

◆ NODE_A

typedef struct NODE_A NODE_A

◆ NODE_W

typedef struct NODE_W NODE_W

Enumeration Type Documentation

◆ FCRET

Enumerator
FCRET_INVALID 
FCRET_IDENTICAL 
FCRET_DIFFERENT 
FCRET_CANT_FIND 
FCRET_NO_MORE_DATA 

Definition at line 23 of file fc.h.

24{
25 FCRET_INVALID = -1,
29 FCRET_NO_MORE_DATA = 3 // (extension)
30} FCRET;
FCRET
Definition: fc.h:24
@ FCRET_IDENTICAL
Definition: fc.h:26
@ FCRET_INVALID
Definition: fc.h:25
@ FCRET_NO_MORE_DATA
Definition: fc.h:29
@ FCRET_CANT_FIND
Definition: fc.h:28
@ FCRET_DIFFERENT
Definition: fc.h:27

Function Documentation

◆ CannotRead()

FCRET CannotRead ( LPCWSTR  file)

Definition at line 70 of file fc.c.

71{
73 return FCRET_INVALID;
74}
void ConResPrintf(FILE *fp, UINT nID,...)
Definition: fc.c:33
#define StdErr
Definition: fc.c:15
#define IDS_CANNOT_READ
Definition: resource.h:6
Definition: fci.c:127

Referenced by BinaryFileCompare(), and TextFileCompare().

◆ Different()

FCRET Different ( LPCWSTR  file0,
LPCWSTR  file1 
)

Definition at line 52 of file fc.c.

53{
54 ConResPrintf(StdOut, IDS_DIFFERENT, file0, file1);
55 return FCRET_DIFFERENT;
56}
#define StdOut
Definition: fc.c:14
#define IDS_DIFFERENT
Definition: resource.h:11

Referenced by BinaryFileCompare(), and Finalize().

◆ DoOpenFileForInput()

HANDLE DoOpenFileForInput ( LPCWSTR  file)

Definition at line 118 of file fc.c.

119{
122 {
124 }
125 return hFile;
126}
#define IDS_CANNOT_OPEN
Definition: resource.h:8
#define NULL
Definition: types.h:112
#define OPEN_EXISTING
Definition: compat.h:775
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define GENERIC_READ
Definition: compat.h:135
#define CreateFileW
Definition: compat.h:741
#define FILE_SHARE_READ
Definition: compat.h:136
_In_ HANDLE hFile
Definition: mswsock.h:90

Referenced by BinaryFileCompare(), and TextFileCompare().

◆ InvalidSwitch()

FCRET InvalidSwitch ( VOID  )

Definition at line 76 of file fc.c.

77{
79 return FCRET_INVALID;
80}
void ConResPuts(FILE *fp, UINT nID)
Definition: fc.c:27
#define IDS_INVALID_SWITCH
Definition: resource.h:7

Referenced by wmain().

◆ LongerThan()

FCRET LongerThan ( LPCWSTR  file0,
LPCWSTR  file1 
)

Definition at line 58 of file fc.c.

59{
60 ConResPrintf(StdOut, IDS_LONGER_THAN, file0, file1);
61 return FCRET_DIFFERENT;
62}
#define IDS_LONGER_THAN
Definition: resource.h:3

Referenced by BinaryFileCompare().

◆ NoDifference()

FCRET NoDifference ( VOID  )

Definition at line 46 of file fc.c.

47{
49 return FCRET_IDENTICAL;
50}
#define IDS_NO_DIFFERENCE
Definition: resource.h:2

Referenced by BinaryFileCompare(), Finalize(), and TextFileCompare().

◆ OutOfMemory()

FCRET OutOfMemory ( VOID  )

Definition at line 64 of file fc.c.

65{
67 return FCRET_INVALID;
68}
#define IDS_OUT_OF_MEMORY
Definition: resource.h:5

◆ PrintCaption()

VOID PrintCaption ( LPCWSTR  file)

Definition at line 88 of file fc.c.

89{
90 ConPrintf(StdOut, L"***** %ls\n", file);
91}
void ConPrintf(FILE *fp, LPCWSTR psz,...)
Definition: fc.c:20
#define L(x)
Definition: ntvdm.h:50

Referenced by ShowDiff().

◆ PrintDots()

VOID PrintDots ( VOID  )

Definition at line 98 of file fc.c.

99{
100 ConPuts(StdOut, L"...\n");
101}
void ConPuts(FILE *fp, LPCWSTR psz)
Definition: fc.c:16

Referenced by ShowDiff().

◆ PrintEndOfDiff()

VOID PrintEndOfDiff ( VOID  )

Definition at line 93 of file fc.c.

94{
95 ConPuts(StdOut, L"*****\n\n");
96}

Referenced by Finalize(), and TextCompare().

◆ PrintLineA()

VOID PrintLineA ( const FILECOMPARE pFC,
DWORD  lineno,
LPCSTR  psz 
)

Definition at line 110 of file fc.c.

111{
112 if (pFC->dwFlags & FLAG_N)
113 ConPrintf(StdOut, L"%5d: %hs\n", lineno, psz);
114 else
115 ConPrintf(StdOut, L"%hs\n", psz);
116}
#define FLAG_N
Definition: fc.h:54
DWORD dwFlags
Definition: fc.h:64

◆ PrintLineW()

VOID PrintLineW ( const FILECOMPARE pFC,
DWORD  lineno,
LPCWSTR  psz 
)

Definition at line 103 of file fc.c.

104{
105 if (pFC->dwFlags & FLAG_N)
106 ConPrintf(StdOut, L"%5d: %ls\n", lineno, psz);
107 else
108 ConPrintf(StdOut, L"%ls\n", psz);
109}

◆ ResyncFailed()

FCRET ResyncFailed ( VOID  )

Definition at line 82 of file fc.c.

83{
85 return FCRET_DIFFERENT;
86}
#define IDS_RESYNC_FAILED
Definition: resource.h:13

Referenced by TextCompare().

◆ TextCompareA()

FCRET TextCompareA ( FILECOMPARE pFC,
HANDLE phMapping0,
const LARGE_INTEGER pcb0,
HANDLE phMapping1,
const LARGE_INTEGER pcb1 
)

Referenced by TextFileCompare().

◆ TextCompareW()

FCRET TextCompareW ( FILECOMPARE pFC,
HANDLE phMapping0,
const LARGE_INTEGER pcb0,
HANDLE phMapping1,
const LARGE_INTEGER pcb1 
)

Referenced by TextFileCompare().