1 diff -Naur metakit-2.4.9.3/include/mk4.h metakit-2.4.9.3-patched/include/mk4.h
2 --- metakit-2.4.9.3/include/mk4.h 2004-01-26 04:54:45.000000000 -0500
3 +++ metakit-2.4.9.3-patched/include/mk4.h 2004-02-28 21:07:34.000000000 -0500
5 bool operator< (const t4_i64 a_, const t4_i64 b_);
8 +typedef int ((*StringCompareFunc)(const char*, const char*));
9 +typedef int ((*Win32FileOpenFunc)(const char*, int));
11 //---------------------------------------------------------------------------
15 friend bool operator> (const c4_View&, const c4_View&);
16 friend bool operator<= (const c4_View&, const c4_View&);
17 friend bool operator>= (const c4_View&, const c4_View&);
18 + static StringCompareFunc stringCompareFunc;
23 bool LoadFrom(c4_Stream&);
24 void SaveTo(c4_Stream&);
26 + static Win32FileOpenFunc win32FileOpenFunc;
28 //DROPPED: c4_Storage (const char* filename_, const char* description_);
29 //DROPPED: c4_View Store(const char* name_, const c4_View& view_);
30 //DROPPED: c4_HandlerSeq& RootTable() const;
31 diff -Naur metakit-2.4.9.3/src/fileio.cpp metakit-2.4.9.3-patched/src/fileio.cpp
32 --- metakit-2.4.9.3/src/fileio.cpp 2003-11-22 20:42:51.000000000 -0500
33 +++ metakit-2.4.9.3-patched/src/fileio.cpp 2004-02-28 21:07:34.000000000 -0500
36 #if q4_WIN32 && !q4_BORC && !q4_WINCE
37 int flags = _O_BINARY | _O_NOINHERIT | (mode_ > 0 ? _O_RDWR : _O_RDONLY);
38 - int fd = _open(fname_, flags);
39 + int fd = (*c4_Storage::win32FileOpenFunc)(fname_, flags);
41 _cleanup = _file = _fdopen(fd, mode_ > 0 ? "r+b" : "rb");
46 #if q4_WIN32 && !q4_BORC && !q4_WINCE
47 - fd = _open(fname_, flags | _O_CREAT, _S_IREAD | _S_IWRITE);
48 + flags = flags | _O_CREAT, _S_IREAD | _S_IWRITE;
49 + fd = (*c4_Storage::win32FileOpenFunc)(fname_, flags);
51 _cleanup = _file = _fdopen(fd, "w+b");
53 diff -Naur metakit-2.4.9.3/src/format.cpp metakit-2.4.9.3-patched/src/format.cpp
54 --- metakit-2.4.9.3/src/format.cpp 2004-01-19 17:49:43.000000000 -0500
55 +++ metakit-2.4.9.3-patched/src/format.cpp 2004-02-28 21:07:35.000000000 -0500
57 c4_String v1 ((const char*) b1_.Contents(), b1_.Size());
58 c4_String v2 ((const char*) b2_.Contents(), b2_.Size());
60 - return v1.CompareNoCase(v2);
61 + return (*c4_View::stringCompareFunc)(v1, v2);
64 void c4_FormatS::Insert(int index_, const c4_Bytes& buf_, int count_)
65 diff -Naur metakit-2.4.9.3/src/store.cpp metakit-2.4.9.3-patched/src/store.cpp
66 --- metakit-2.4.9.3/src/store.cpp 2003-11-22 20:42:51.000000000 -0500
67 +++ metakit-2.4.9.3-patched/src/store.cpp 2004-02-28 21:09:26.000000000 -0500
77 /////////////////////////////////////////////////////////////////////////////
80 c4_Persist::Save(&stream_, Persist()->Root());
83 +int f4_Latin1OpenFunc(const char *fname_, int mode_)
86 + return _open(fname_, mode_);
92 +Win32FileOpenFunc c4_Storage::win32FileOpenFunc = f4_Latin1OpenFunc;
94 /////////////////////////////////////////////////////////////////////////////
96 c4_DerivedSeq::c4_DerivedSeq (c4_Sequence& seq_)
97 diff -Naur metakit-2.4.9.3/src/view.cpp metakit-2.4.9.3-patched/src/view.cpp
98 --- metakit-2.4.9.3/src/view.cpp 2003-11-22 20:42:51.000000000 -0500
99 +++ metakit-2.4.9.3-patched/src/view.cpp 2004-02-28 21:07:35.000000000 -0500
100 @@ -1005,6 +1005,8 @@
101 return na == nb ? 0 : i < na ? +1 : -1;
104 +StringCompareFunc c4_View::stringCompareFunc = strcmp;
106 /////////////////////////////////////////////////////////////////////////////