10#define IS_SPACE(ch) ((ch) == TEXT(' ') || (ch) == TEXT('\t'))
14 #define PrintLine PrintLineW
15 #define TextCompare TextCompareW
18 #define PrintLine PrintLineA
19 #define TextCompare TextCompareA
44 node->lineno = lineno;
92 for (pch0 = pch1 = psz; *pch0; ++pch0)
156 pszNew[ich++] =
TEXT(
' ');
161 pszNew[ich++] = *
pch;
168#define HASH_EOF 0xFFFFFFFF
169#define HASH_MASK 0x7FFFFFFF
194 node->lineno = lineno;
231 if (node0->hash != node1->hash)
234 psz0 = (pFC->
dwFlags &
FLAG_W) ? node0->pszComp : node0->pszLine;
235 psz1 = (pFC->
dwFlags &
FLAG_W) ? node1->pszComp : node1->pszLine;
260 DWORD lineno = 1, ich,
cch, ichNext, cbView, cchNode;
265 if (*phMapping ==
NULL)
287 (ichNext ==
cch && (fLast || ich == 0))))
289 bCR = (ichNext > 0) && (psz[ichNext - 1] ==
TEXT(
'\r'));
290 cchNode = ichNext - ich - bCR;
365 struct list *ptr0 = *pptr0, *ptr1 = *pptr1;
383 struct list *ptr0 = *pptr0, *ptr1 = *pptr1;
389 if (node0->lineno >= lineno0)
391 if (node1->lineno >= lineno1)
410 struct list *ptr0 = *pptr0, *ptr1 = *pptr1, *tmp0, *tmp1;
417 if (node0->lineno >= lineno0)
419 if (node1->lineno >= lineno1)
448 struct list *list0 = &pFC->
list[0], *list1 = &pFC->
list[1];
449 DWORD lineno0, lineno1;
454 lineno0 = node0->lineno + pFC->
n;
455 lineno1 = node1->lineno + pFC->
n;
461 for (ptr1 =
list_next(list1, *pptr1), i1 = 0; ptr1; ptr1 =
list_next(list1, ptr1), ++i1)
464 if (node1->lineno >= lineno1)
466 for (ptr0 =
list_next(list0, *pptr0), i0 = 0; ptr0; ptr0 =
list_next(list0, ptr0), ++i0)
469 if (node0->lineno >= lineno0)
473 penalty =
min(i0, i1) +
abs(i1 - i0);
474 if (min_penalty > penalty)
476 min_penalty = penalty;
488 ret =
ScanDiff(pFC, &save0, &save1, lineno0, lineno1);
497 for (ptr0 = *pptr0; ptr0; ptr0 =
list_next(list0, ptr0))
500 if (node0->lineno == lineno0)
503 for (ptr1 = *pptr1; ptr1; ptr1 =
list_next(list1, ptr1))
506 if (node1->lineno == lineno1)
537 struct list *ptr0, *ptr1, *save0, *save1, *next0, *next1;
538 NODE* node0, * node1;
541 struct list *list0 = &pFC->
list[0], *list1 = &pFC->
list[1];
547 ret0 =
ParseLines(pFC, phMapping0, &ib0, pcb0, list0);
553 ret1 =
ParseLines(pFC, phMapping1, &ib1, pcb1, list1);
595 next0 = ptr0 ?
list_next(list0, ptr0) : ptr0;
596 next1 = ptr1 ?
list_next(list1, ptr1) : ptr1;
597 ShowDiff(pFC, 0, save0, (next0 ? next0 : ptr0));
598 ShowDiff(pFC, 1, save1, (next1 ? next1 : ptr1));
VOID PrintCaption(LPCWSTR file)
VOID PrintEndOfDiff(VOID)
FCRET Different(LPCWSTR file0, LPCWSTR file1)
static VOID DeleteList(struct list *list)
static NODE * AllocNode(LPTSTR psz, DWORD lineno)
static VOID SkipIdentical(FILECOMPARE *pFC, struct list **pptr0, struct list **pptr1)
static DWORD SkipIdenticalN(FILECOMPARE *pFC, struct list **pptr0, struct list **pptr1, DWORD nnnn, DWORD lineno0, DWORD lineno1)
static BOOL ConvertNode(const FILECOMPARE *pFC, NODE *node)
static BOOL FindNextLine(LPCTSTR pch, DWORD ich, DWORD cch, LPDWORD pich)
static FCRET Finalize(FILECOMPARE *pFC, struct list *ptr0, struct list *ptr1, BOOL fDifferent)
static VOID DeleteDuplicateSpaces(LPTSTR psz)
static FCRET ScanDiff(FILECOMPARE *pFC, struct list **pptr0, struct list **pptr1, DWORD lineno0, DWORD lineno1)
static LPTSTR ExpandTab(LPCTSTR line)
static FCRET CompareNode(const FILECOMPARE *pFC, const NODE *node0, const NODE *node1)
static __inline LPCTSTR SkipSpace(LPCTSTR pch)
static LPTSTR AllocLine(LPCTSTR pch, DWORD cch)
static NODE * AllocEOFNode(DWORD lineno)
static INT ExpandTabLength(LPCTSTR line)
static DWORD GetHash(LPCTSTR psz, BOOL bIgnoreCase)
static FCRET ParseLines(const FILECOMPARE *pFC, HANDLE *phMapping, LARGE_INTEGER *pib, const LARGE_INTEGER *pcb, struct list *list)
static VOID ShowDiff(FILECOMPARE *pFC, INT i, struct list *begin, struct list *end)
static FCRET Resync(FILECOMPARE *pFC, struct list **pptr0, struct list **pptr1)
static __inline BOOL IsEOFNode(NODE *node)
static __inline VOID DeleteNode(NODE *node)
static __inline LPCTSTR FindLastNonSpace(LPCTSTR pch)
static LPTSTR CompressSpace(LPCTSTR line)
void quit(int argc, const char *argv[])
static void list_remove(struct list_entry *entry)
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
static void list_init(struct list_entry *head)
static void cleanup(void)
GLuint GLuint GLsizei count
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define memcpy(s1, s2, n)
static DWORD DWORD void LPSTR DWORD cch
#define LOCALE_USER_DEFAULT
__WINE_SERVER_LIST_INLINE struct list * list_prev(const struct list *list, const struct list *elem)
__WINE_SERVER_LIST_INLINE struct list * list_next(const struct list *list, const struct list *elem)