//visual text comparer //by den po - jdp@bk.ru #define MEMSIZE 1024 * 60 #define ENTRY_POINT #main #include "../lib/fs.h" #include "../lib/strings.h" #include "../lib/obj/console.h" #define MAX_PATH 260 #include "32user32.h" #include "objects.h" #include "diff_gui.h" #define mincmpstrings 2 #define maxcmpstrings 10 #define maxcmpoffset 100 char window_title[] = "Kolibri Diff tool (Visual Text Comparer)"; char* srcfilename; char* dstfilename; dword srcfile; dword dstfile; dword srcfilesize; dword dstfilesize; TCollection srcfilelines; //file lines TCollection dstfilelines; TCollection srcfilenums; //lines numbers TCollection dstfilenums; struct TSimpleCollection:TSortedCollection { TSimpleCollection(); int Compare( int Key1, Key2 ); }; int TSimpleCollection::Compare( int Key1, Key2 ){ return Key1-Key2; } TSimpleCollection::TSimpleCollection():TSortedCollection(1000,1000); { comparemethod=#Compare; } TSimpleCollection diffs; //list of differing strings dword srcfilelinks; //pointer to the previos line with the same first symbol dword dstfilelinks; // getstrings(dword srcfile,srcfilesize,srcfilelines){ ECX=srcfilesize; ESI=srcfile; WHILE(ECX){ $push ECX,ESI EAX=srcfilelines; EAX.TCollection.Insert(ESI); $pop ESI,ECX WHILE(ECX){ $cld $lodsb ECX--; if(AL==0x0D)||(AL==0x0A)DSBYTE[ESI-1]=0; if(AL==0x0D)&&(DSBYTE[ESI]==0x0A){$lodsb;ECX--;} if(AL==0x0D)||(AL==0x0A)BREAK; } } } #include "if.h" bool getparam() { int i, param_len = strlen(#param); if (param[0]=='"') { for (i=1; i=mincmpstrings) { WHILE(bdp