]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/portabase/metakit-2.4.9.3/metakit-2.4.9.3.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / portabase / metakit-2.4.9.3 / metakit-2.4.9.3.patch
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
4 @@ -217,6 +217,9 @@
5  bool operator< (const t4_i64 a_, const t4_i64 b_);
6  #endif
7  
8 +typedef int ((*StringCompareFunc)(const char*, const char*));
9 +typedef int ((*Win32FileOpenFunc)(const char*, int));
10 +
11  //---------------------------------------------------------------------------
12  
13  class c4_View
14 @@ -330,6 +333,7 @@
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;
19    
20  protected:
21    void _IncSeqRef();
22 @@ -554,6 +558,8 @@
23    bool LoadFrom(c4_Stream&);
24    void SaveTo(c4_Stream&);
25  
26 +  static Win32FileOpenFunc win32FileOpenFunc;
27 +
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
34 @@ -321,7 +321,7 @@
35  
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);
40    if (fd != -1)
41      _cleanup = _file = _fdopen(fd, mode_ > 0 ? "r+b" : "rb");
42  #else
43 @@ -339,7 +339,8 @@
44  
45    if (mode_ > 0) {
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);
50      if (fd != -1)
51        _cleanup = _file = _fdopen(fd, "w+b");
52  #else
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
56 @@ -923,7 +923,7 @@
57    c4_String v1 ((const char*) b1_.Contents(), b1_.Size());
58    c4_String v2 ((const char*) b2_.Contents(), b2_.Size());
59    
60 -  return v1.CompareNoCase(v2);
61 +  return (*c4_View::stringCompareFunc)(v1, v2);
62  }
63  
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
68 @@ -18,6 +18,10 @@
69  #if !q4_INLINE
70  #include "store.inl"
71  #endif
72 +
73 +#if q4_WIN32
74 +#include <io.h>
75 +#endif
76    
77  /////////////////////////////////////////////////////////////////////////////
78  
79 @@ -426,6 +430,17 @@
80    c4_Persist::Save(&stream_, Persist()->Root());
81  }
82  
83 +int f4_Latin1OpenFunc(const char *fname_, int mode_)
84 +{
85 +#if q4_WIN32
86 +  return _open(fname_, mode_);
87 +#else
88 +  return -1;
89 +#endif
90 +}
91 +
92 +Win32FileOpenFunc c4_Storage::win32FileOpenFunc = f4_Latin1OpenFunc;
93 +
94  /////////////////////////////////////////////////////////////////////////////
95  
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;
102  }
103  
104 +StringCompareFunc c4_View::stringCompareFunc = strcmp;
105 +
106  /////////////////////////////////////////////////////////////////////////////
107  
108  /** @class c4_Cursor