# pragma warning(disable:4100) // unreferenced formal parameter
#endif
+// suppress some Salford C++ warnings
+#ifdef __SALFORDC__
+# pragma suppress 353 // Possible nested comments
+# pragma suppress 593 // Define not used
+# pragma suppress 61 // enum has no name (doesn't suppress!)
+# pragma suppress 106 // unnamed, unused parameter
+# pragma suppress 571 // Virtual function hiding
+#endif
+
//////////////////////////////////////////////////////////////////////////////////
// Currently Only MS-Windows/NT, XView and Motif are supported
//
#endif
#elif defined(__SC__)
typedef unsigned int bool;
+#elif defined(__SALFORDC__)
+ typedef unsigned int bool;
#elif defined(_MSC_VER) && (_MSC_VER <= 1000)
typedef unsigned int bool;
#elif defined(_MSC_VER) && (_MSC_VER == 1020)
// types of sizeof()<=sizeof(long) or pointers if sizeof(pointer)<=sizeof(long)
//
// NB: it has only inline functions => takes no space at all
+// Mod by JACS: Salford C++ doesn't like 'var->operator=' syntax, as in:
+// { ((wxBaseArray *)this)->operator=((const wxBaseArray&)src);
+// so using a temporary variable instead.
// ----------------------------------------------------------------------------
#define _WX_DEFINE_ARRAY(T, name) \
typedef int (CMPFUNC_CONV *CMPFUNC##T)(T *pItem1, T *pItem2); \
{ wxASSERT( sizeof(T) <= sizeof(long) ); } \
\
name& operator=(const name& src) \
- { ((wxBaseArray *)this)->operator=((const wxBaseArray&)src); \
+ { wxBaseArray* temp = (wxBaseArray*) this; \
+ (*temp) = ((const wxBaseArray&)src); \
return *this; } \
\
T& operator[](size_t uiIndex) const \
// the normal arrays otherwise.
//
// NB: it has only inline functions => takes no space at all
+// Mod by JACS: Salford C++ doesn't like 'var->operator=' syntax, as in:
+// { ((wxBaseArray *)this)->operator=((const wxBaseArray&)src);
+// so using a temporary variable instead.
// ----------------------------------------------------------------------------
#define _WX_DEFINE_SORTED_ARRAY(T, name) \
typedef int (CMPFUNC_CONV *SCMPFUNC##T)(T pItem1, T pItem2); \
{ wxASSERT( sizeof(T) <= sizeof(long) ); m_fnCompare = fn; } \
\
name& operator=(const name& src) \
- { ((wxBaseArray *)this)->operator=((const wxBaseArray&)src); \
+ { wxBaseArray* temp = (wxBaseArray*) this; \
+ (*temp) = ((const wxBaseArray&)src); \
m_fnCompare = src.m_fnCompare; \
return *this; } \
\
#endif
#include "wx/defs.h"
-
-#ifdef wxUSE_CONFIG
-
-#include "wx/confbase.h"
#include "wx/textfile.h"
#include "wx/string.h"
+// ----------------------------------------------------------------------------
+// compile options
+// ----------------------------------------------------------------------------
+
+// it won't compile without it anyhow
+#ifndef wxUSE_CONFIG
+ #error "Please define wxUSE_CONFIG or remove fileconf.cpp from your makefile"
+#endif // wxUSE_CONFIG
// ----------------------------------------------------------------------------
// wxFileConfig
(it's on by default, the current status can be retrieved with
IsExpandingEnvVars function).
*/
+ class wxFileConfig; //linea nueva
+ class ConfigGroup;
+ class ConfigEntry;
+
+ // we store all lines of the local config file as a linked list in memory
+ class LineList
+ {
+ public:
+ void SetNext(LineList *pNext) { m_pNext = pNext; }
+ void SetPrev(LineList *pPrev) { m_pPrev = pPrev; }
+
+ // ctor
+ LineList(const wxString& str, LineList *pNext = (LineList *) NULL) : m_strLine(str)
+ { SetNext(pNext); SetPrev((LineList *) NULL); }
-class WXDLLEXPORT wxFileConfig : public wxConfigBase
+ //
+ LineList *Next() const { return m_pNext; }
+ LineList *Prev() const { return m_pPrev; }
+
+ //
+ void SetText(const wxString& str) { m_strLine = str; }
+ const wxString& Text() const { return m_strLine; }
+
+ private:
+ wxString m_strLine; // line contents
+ LineList *m_pNext, // next node
+ *m_pPrev; // previous one
+ };
+
+
+class wxFileConfig : public wxConfigBase
{
public:
// construct the "standard" full name for global (system-wide) and
public:
// fwd decl
- class ConfigGroup;
- class ConfigEntry;
-
- // we store all lines of the local config file as a linked list in memory
- class LineList
- {
- public:
- void SetNext(LineList *pNext) { m_pNext = pNext; }
- void SetPrev(LineList *pPrev) { m_pPrev = pPrev; }
-
- // ctor
- LineList(const wxString& str, LineList *pNext = (LineList *) NULL) : m_strLine(str)
- { SetNext(pNext); SetPrev((LineList *) NULL); }
-
- //
- LineList *Next() const { return m_pNext; }
- LineList *Prev() const { return m_pPrev; }
-
- //
- void SetText(const wxString& str) { m_strLine = str; }
- const wxString& Text() const { return m_strLine; }
-
- private:
- wxString m_strLine; // line contents
- LineList *m_pNext, // next node
- *m_pPrev; // previous one
- };
// functions to work with this list
LineList *LineListAppend(const wxString& str);
WX_DEFINE_SORTED_ARRAY(ConfigEntry *, ArrayEntries);
WX_DEFINE_SORTED_ARRAY(ConfigGroup *, ArrayGroups);
+};
+
class ConfigEntry
{
private:
private:
wxFileConfig *m_pConfig; // config object we belong to
ConfigGroup *m_pParent; // parent group (NULL for root group)
- ArrayEntries m_aEntries; // entries in this group
- ArrayGroups m_aSubgroups; // subgroups
+ wxFileConfig::ArrayEntries m_aEntries; // entries in this group
+ wxFileConfig::ArrayGroups m_aSubgroups; // subgroups
wxString m_strName; // group's name
bool m_bDirty; // if FALSE => all subgroups are not dirty
LineList *m_pLine; // pointer to our line in the linked list
wxFileConfig *Config() const { return m_pConfig; }
bool IsDirty() const { return m_bDirty; }
- const ArrayEntries& Entries() const { return m_aEntries; }
- const ArrayGroups& Groups() const { return m_aSubgroups; }
+ const wxFileConfig::ArrayEntries& Entries() const { return m_aEntries; }
+ const wxFileConfig::ArrayGroups& Groups() const { return m_aSubgroups; }
bool IsEmpty() const { return Entries().IsEmpty() && Groups().IsEmpty(); }
// find entry/subgroup (NULL if not found)
void SetLastEntry(ConfigEntry *pEntry) { m_pLastEntry = pEntry; }
void SetLastGroup(ConfigGroup *pGroup) { m_pLastGroup = pGroup; }
};
-};
-#endif
- // wxUSE_CONFIG
+#endif //_FILECONF_H
+
+
+
+
-#endif
- //_FILECONF_H
void SetMask( bool mask = TRUE );
bool HasMask() const;
- inline wxImage& operator = (const wxImage& image)
+ inline wxImage& operator = (const wxImage& image)
{ if (*this == image) return (*this); Ref(image); return *this; }
- inline bool operator == (const wxImage& image)
+ inline bool operator == (const wxImage& image)
{ return m_refData == image.m_refData; }
inline bool operator != (const wxImage& image)
{ return m_refData != image.m_refData; }
{ wxASSERT( m_count==0 ); m_keyType = keyType; }
protected:
+
// all methods here are "overloaded" in derived classes to provide compile
// time type checking
void *data,
const wxListKey& key = wxDefaultListKey) = 0;
+// Can't access these from derived classes otherwise (bug in Salford C++?)
+#ifdef __SALFORDC__
+public:
+#endif
+
// ctors
// from an array
wxListBase(size_t count, void *elements[]);
// from a sequence of objects
wxListBase(void *object, ... /* terminate with NULL */);
+protected:
// copy ctor and assignment operator
wxListBase(const wxListBase& list)
{ DoCopy(list); }
#include "wx/defs.h"
#include "wx/object.h"
+#include "wx/event.h"
class WXDLLEXPORT wxFrame;
class WXDLLEXPORT wxWindow;
void Reset(void) { m_current = 0; }
void Reset(const wxRegion& region);
- operator bool (void) const { return m_current < m_numRects; }
- bool HaveRects(void) const { return m_current < m_numRects; }
+#ifndef __SALFORDC__
+ operator bool (void) const { return (m_current < m_numRects); }
+#endif
+
+ bool HaveRects(void) const { return (m_current < m_numRects); }
void operator ++ (void);
void operator ++ (int);
Type_Multi_String, // Multiple Unicode strings
Type_Resource_list, // Resource list in the resource map
Type_Full_resource_descriptor, // Resource list in the hardware description
- Type_Resource_requirements_list, // ???
+ Type_Resource_requirements_list // ???
#endif //WIN32
};
// predefined registry keys
enum StdKey
{
- HKCR, // classes root
+ HKCR // classes root
#ifdef __WIN32__
- HKCU, // current user
+ , HKCU, // current user
HKLM, // local machine
HKUSR, // users
- HKPD, // performance data (@@ NT only?)
+ HKPD // performance data (@@ NT only?)
#if WINVER >= 0x0400
- HKCC, // current config
- HKDD, // dynamic data
+ , HKCC, // current config
+ HKDD // dynamic data
#endif // Winver
#endif // Win32/16
};
#define wxUSE_NATIVE_STATUSBAR 0
#endif
+// Salford C++ doesn't like some of the memory operator definitions
+#ifdef __SALFORDC__
+#undef wxUSE_MEMORY_TRACING
+#define wxUSE_MEMORY_TRACING 0
+
+#undef wxUSE_GLOBAL_MEMORY_OPERATORS
+#define wxUSE_GLOBAL_MEMORY_OPERATORS 0
+
+#undef wxUSE_DEBUG_NEW_ALWAYS
+#define wxUSE_DEBUG_NEW_ALWAYS 0
+#endif
+
// Minimal setup e.g. for compiling small utilities
#define MINIMAL_WXWINDOWS_SETUP 0
#define wxSTD_STRING_COMPATIBILITY
// define to derive wxString from wxObject
+#ifdef WXSTRING_IS_WXOBJECT
#undef WXSTRING_IS_WXOBJECT
+#endif
// maximum possible length for a string means "take all string" everywhere
// (as sizeof(StringData) is unknown here we substract 100)
return _stricmp(psz1, psz2);
#elif defined(__SC__)
return _stricmp(psz1, psz2);
+#elif defined(__SALFORDC__)
+ return stricmp(psz1, psz2);
#elif defined(__BORLANDC__)
return stricmp(psz1, psz2);
#elif defined(__WATCOMC__)
// wxString comparison functions: operator versions are always case sensitive
// ---------------------------------------------------------------------------
//
-inline bool operator==(const wxString& s1, const wxString& s2) { return s1.Cmp(s2) == 0; }
+inline bool operator==(const wxString& s1, const wxString& s2) { return (s1.Cmp(s2) == 0); }
//
-inline bool operator==(const wxString& s1, const char * s2) { return s1.Cmp(s2) == 0; }
+inline bool operator==(const wxString& s1, const char * s2) { return (s1.Cmp(s2) == 0); }
//
-inline bool operator==(const char * s1, const wxString& s2) { return s2.Cmp(s1) == 0; }
+inline bool operator==(const char * s1, const wxString& s2) { return (s2.Cmp(s1) == 0); }
//
-inline bool operator!=(const wxString& s1, const wxString& s2) { return s1.Cmp(s2) != 0; }
+inline bool operator!=(const wxString& s1, const wxString& s2) { return (s1.Cmp(s2) != 0); }
//
-inline bool operator!=(const wxString& s1, const char * s2) { return s1.Cmp(s2) != 0; }
+inline bool operator!=(const wxString& s1, const char * s2) { return (s1.Cmp(s2) != 0); }
//
-inline bool operator!=(const char * s1, const wxString& s2) { return s2.Cmp(s1) != 0; }
+inline bool operator!=(const char * s1, const wxString& s2) { return (s2.Cmp(s1) != 0); }
//
-inline bool operator< (const wxString& s1, const wxString& s2) { return s1.Cmp(s2) < 0; }
+inline bool operator< (const wxString& s1, const wxString& s2) { return (s1.Cmp(s2) < 0); }
//
-inline bool operator< (const wxString& s1, const char * s2) { return s1.Cmp(s2) < 0; }
+inline bool operator< (const wxString& s1, const char * s2) { return (s1.Cmp(s2) < 0); }
//
-inline bool operator< (const char * s1, const wxString& s2) { return s2.Cmp(s1) > 0; }
+inline bool operator< (const char * s1, const wxString& s2) { return (s2.Cmp(s1) > 0); }
//
-inline bool operator> (const wxString& s1, const wxString& s2) { return s1.Cmp(s2) > 0; }
+inline bool operator> (const wxString& s1, const wxString& s2) { return (s1.Cmp(s2) > 0); }
//
-inline bool operator> (const wxString& s1, const char * s2) { return s1.Cmp(s2) > 0; }
+inline bool operator> (const wxString& s1, const char * s2) { return (s1.Cmp(s2) > 0); }
//
-inline bool operator> (const char * s1, const wxString& s2) { return s2.Cmp(s1) < 0; }
+inline bool operator> (const char * s1, const wxString& s2) { return (s2.Cmp(s1) < 0); }
//
-inline bool operator<=(const wxString& s1, const wxString& s2) { return s1.Cmp(s2) <= 0; }
+inline bool operator<=(const wxString& s1, const wxString& s2) { return (s1.Cmp(s2) <= 0); }
//
-inline bool operator<=(const wxString& s1, const char * s2) { return s1.Cmp(s2) <= 0; }
+inline bool operator<=(const wxString& s1, const char * s2) { return (s1.Cmp(s2) <= 0); }
//
-inline bool operator<=(const char * s1, const wxString& s2) { return s2.Cmp(s1) >= 0; }
+inline bool operator<=(const char * s1, const wxString& s2) { return (s2.Cmp(s1) >= 0); }
//
-inline bool operator>=(const wxString& s1, const wxString& s2) { return s1.Cmp(s2) >= 0; }
+inline bool operator>=(const wxString& s1, const wxString& s2) { return (s1.Cmp(s2) >= 0); }
//
-inline bool operator>=(const wxString& s1, const char * s2) { return s1.Cmp(s2) >= 0; }
+inline bool operator>=(const wxString& s1, const char * s2) { return (s1.Cmp(s2) >= 0); }
//
-inline bool operator>=(const char * s1, const wxString& s2) { return s2.Cmp(s1) <= 0; }
+inline bool operator>=(const char * s1, const wxString& s2) { return (s2.Cmp(s1) <= 0); }
wxString WXDLLEXPORT operator+(const wxString& string1, const wxString& string2);
wxString WXDLLEXPORT operator+(const wxString& string, char ch);
public:
PropFormFrame(wxPropertyFormView *v, wxFrame *parent, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
- long style = wxDEFAULT_FRAME, const wxString& name = "frame"):
+ long style = wxDEFAULT_FRAME_STYLE, const wxString& name = "frame"):
wxPropertyFormFrame(v, parent, title, pos, size, style, name)
{
}
{
// Make another frame, containing a canvas
MyChild *subframe = new MyChild(frame, "Canvas Frame", wxPoint(10, 10), wxSize(300, 300),
- wxDEFAULT_FRAME);
+ wxDEFAULT_FRAME_STYLE);
char titleBuf[100];
sprintf(titleBuf, "Canvas Frame %d", winNumber);
#include <commdlg.h>
#endif
-#if defined(__WATCOMC__) || defined(__SC__)
+#if defined(__WATCOMC__) || defined(__SC__) || defined(__SALFORDC__)
#include <windowsx.h>
#include <commdlg.h>
#endif
#if defined(__WXMSW__) && !defined(__GNUWIN32__)
#include <io.h>
+#ifndef __SALFORDC__
#define WIN32_LEAN_AND_MEAN
#define NOSERVICE
#define NOIME
#define NOKANJI
#define NOCRYPT
#define NOMCX
+#endif
+
#include <windows.h> // for GetTempFileName
#elif (defined(__UNIX__) || defined(__GNUWIN32__))
#include <unistd.h>
#include <stdio.h> // SEEK_xxx constants
#include <fcntl.h> // O_RDONLY &c
+
#ifndef __MWERKS__
#include <sys/types.h> // needed for stat
#include <sys/stat.h> // stat
#define O_BINARY (0)
#endif //__UNIX__
+
+#ifdef __SALFORDC__
+#include <unix.h>
+#endif
+
// wxWindows
#include <wx/string.h>
#include <wx/intl.h>
// ----------------------------------------------------------------------------
bool wxFile::Exists(const char *name)
{
+#ifdef __SALFORDC__
+ struct _stat st;
+#else
struct stat st;
- return !access(name, 0) && !stat(name, &st) && (st.st_mode & S_IFREG);
+#endif
+
+ return !access(name, 0) && !stat((char*) name, &st) && (st.st_mode & S_IFREG);
}
bool wxFile::Access(const char *name, OpenMode mode)
}
// create the file, fail if it already exists and bOverwrite
-bool wxFile::Create(const char *szFileName, bool bOverwrite, int access)
+bool wxFile::Create(const char *szFileName, bool bOverwrite, int accessMode)
{
// if bOverwrite we create a new file or truncate the existing one,
// otherwise we only create the new file and fail if it already exists
+#ifdef __SALFORDC__
int fd = open(szFileName, O_WRONLY | O_CREAT |
- (bOverwrite ? O_TRUNC : O_EXCL), access);
+ (bOverwrite ? O_TRUNC : O_EXCL));
+#else
+ int fd = open(szFileName, O_WRONLY | O_CREAT |
+ (bOverwrite ? O_TRUNC : O_EXCL), accessMode);
+#endif
if ( fd == -1 ) {
wxLogSysError(_("can't create file '%s'"), szFileName);
}
// open the file
-bool wxFile::Open(const char *szFileName, OpenMode mode, int access)
+bool wxFile::Open(const char *szFileName, OpenMode mode, int accessMode)
{
int flags = O_BINARY;
break;
}
- int fd = open(szFileName, flags, access);
+#ifdef __SALFORDC__
+ int fd = open(szFileName, flags);
+#else
+ int fd = open(szFileName, flags, accessMode);
+#endif
if ( fd == -1 ) {
wxLogSysError(_("can't open file '%s'"), szFileName);
int iRc;
- #if defined(__UNIX__) || defined(__GNUWIN32__) || defined( __MWERKS__ )
+ #if defined(__UNIX__) || defined(__GNUWIN32__) || defined( __MWERKS__ ) || defined(__SALFORDC__)
// @@ this doesn't work, of course, on unseekable file descriptors
off_t ofsCur = Tell(),
ofsMax = Length();
#pragma implementation "fileconf.h"
#endif
+// ============================================================================
+// declarations
+// ============================================================================
+
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/wxprec.h"
-#include "wx/fileconf.h"
-
-#ifdef wxUSE_CONFIG
-
#ifdef __BORLANDC__
#pragma hdrstop
#endif //__BORLANDC__
#ifndef WX_PRECOMP
- #include "wx/wx.h"
+ #include "wx/string.h"
+ #include "wx/intl.h"
#endif //WX_PRECOMP
#include "wx/app.h"
#include "wx/log.h"
#include "wx/textfile.h"
#include "wx/config.h"
+#include "wx/fileconf.h"
#include "wx/utils.h" // for wxGetHomeDir
inline bool IsValid(char c) { return isalnum(c) || strchr("@_/-!.*%", c); }
// compare functions for sorting the arrays
-static int CompareEntries(wxFileConfig::ConfigEntry *p1,
- wxFileConfig::ConfigEntry *p2);
-static int CompareGroups(wxFileConfig::ConfigGroup *p1,
- wxFileConfig::ConfigGroup *p2);
+static int CompareEntries(ConfigEntry *p1,
+ ConfigEntry *p2);
+static int CompareGroups(ConfigGroup *p1,
+ ConfigGroup *p2);
// filter strings
static wxString FilterIn(const wxString& str);
strDir = "/etc/";
#elif defined(__WXSTUBS__)
wxASSERT_MSG( FALSE, "TODO" ) ;
- #elif defined(__WXMAC__)
- wxASSERT_MSG( FALSE, "TODO" ) ;
#else // Windows
char szWinDir[MAX_PATH];
::GetWindowsDirectory(szWinDir, MAX_PATH);
// ----------------------------------------------------------------------------
// append a new line to the end of the list
-wxFileConfig::LineList *wxFileConfig::LineListAppend(const wxString& str)
+LineList *wxFileConfig::LineListAppend(const wxString& str)
{
LineList *pLine = new LineList(str);
}
// insert a new line after the given one or in the very beginning if !pLine
-wxFileConfig::LineList *wxFileConfig::LineListInsert(const wxString& str,
+LineList *wxFileConfig::LineListInsert(const wxString& str,
LineList *pLine)
{
if ( pLine == m_linesTail )
// ----------------------------------------------------------------------------
// ctor
-wxFileConfig::ConfigGroup::ConfigGroup(wxFileConfig::ConfigGroup *pParent,
+ConfigGroup::ConfigGroup(ConfigGroup *pParent,
const wxString& strName,
wxFileConfig *pConfig)
: m_aEntries(CompareEntries),
}
// dtor deletes all children
-wxFileConfig::ConfigGroup::~ConfigGroup()
+ConfigGroup::~ConfigGroup()
{
// entries
size_t n, nCount = m_aEntries.Count();
// line
// ----------------------------------------------------------------------------
-void wxFileConfig::ConfigGroup::SetLine(LineList *pLine)
+void ConfigGroup::SetLine(LineList *pLine)
{
wxASSERT( m_pLine == NULL ); // shouldn't be called twice
// Return the line which contains "[our name]". If we're still not in the list,
// add our line to it immediately after the last line of our parent group if we
// have it or in the very beginning if we're the root group.
-wxFileConfig::LineList *wxFileConfig::ConfigGroup::GetGroupLine()
+LineList *ConfigGroup::GetGroupLine()
{
if ( m_pLine == NULL ) {
ConfigGroup *pParent = Parent();
// Return the last line belonging to the subgroups of this group (after which
// we can add a new subgroup), if we don't have any subgroups or entries our
// last line is the group line (m_pLine) itself.
-wxFileConfig::LineList *wxFileConfig::ConfigGroup::GetLastGroupLine()
+LineList *ConfigGroup::GetLastGroupLine()
{
// if we have any subgroups, our last line is the last line of the last
// subgroup
if ( m_pLastGroup != NULL ) {
- wxFileConfig::LineList *pLine = m_pLastGroup->GetLastGroupLine();
+ LineList *pLine = m_pLastGroup->GetLastGroupLine();
wxASSERT( pLine != NULL ); // last group must have !NULL associated line
return pLine;
// return the last line belonging to the entries of this group (after which
// we can add a new entry), if we don't have any entries we will add the new
// one immediately after the group line itself.
-wxFileConfig::LineList *wxFileConfig::ConfigGroup::GetLastEntryLine()
+LineList *ConfigGroup::GetLastEntryLine()
{
if ( m_pLastEntry != NULL ) {
- wxFileConfig::LineList *pLine = m_pLastEntry->GetLine();
+ LineList *pLine = m_pLastEntry->GetLine();
wxASSERT( pLine != NULL ); // last entry must have !NULL associated line
return pLine;
// group name
// ----------------------------------------------------------------------------
-wxString wxFileConfig::ConfigGroup::GetFullName() const
+wxString ConfigGroup::GetFullName() const
{
if ( Parent() )
return Parent()->GetFullName() + wxCONFIG_PATH_SEPARATOR + Name();
// ----------------------------------------------------------------------------
// use binary search because the array is sorted
-wxFileConfig::ConfigEntry *
-wxFileConfig::ConfigGroup::FindEntry(const char *szName) const
+ConfigEntry *
+ConfigGroup::FindEntry(const char *szName) const
{
size_t i,
lo = 0,
hi = m_aEntries.Count();
int res;
- wxFileConfig::ConfigEntry *pEntry;
+ ConfigEntry *pEntry;
while ( lo < hi ) {
i = (lo + hi)/2;
return NULL;
}
-wxFileConfig::ConfigGroup *
-wxFileConfig::ConfigGroup::FindSubgroup(const char *szName) const
+ConfigGroup *
+ConfigGroup::FindSubgroup(const char *szName) const
{
size_t i,
lo = 0,
hi = m_aSubgroups.Count();
int res;
- wxFileConfig::ConfigGroup *pGroup;
+ ConfigGroup *pGroup;
while ( lo < hi ) {
i = (lo + hi)/2;
// ----------------------------------------------------------------------------
// create a new entry and add it to the current group
-wxFileConfig::ConfigEntry *
-wxFileConfig::ConfigGroup::AddEntry(const wxString& strName, int nLine)
+ConfigEntry *
+ConfigGroup::AddEntry(const wxString& strName, int nLine)
{
wxASSERT( FindEntry(strName) == NULL );
}
// create a new group and add it to the current group
-wxFileConfig::ConfigGroup *
-wxFileConfig::ConfigGroup::AddSubgroup(const wxString& strName)
+ConfigGroup *
+ConfigGroup::AddSubgroup(const wxString& strName)
{
wxASSERT( FindSubgroup(strName) == NULL );
delete several of them.
*/
-bool wxFileConfig::ConfigGroup::DeleteSubgroupByName(const char *szName)
+bool ConfigGroup::DeleteSubgroupByName(const char *szName)
{
return DeleteSubgroup(FindSubgroup(szName));
}
// doesn't delete the subgroup itself, but does remove references to it from
// all other data structures (and normally the returned pointer should be
// deleted a.s.a.p. because there is nothing much to be done with it anyhow)
-bool wxFileConfig::ConfigGroup::DeleteSubgroup(ConfigGroup *pGroup)
+bool ConfigGroup::DeleteSubgroup(ConfigGroup *pGroup)
{
wxCHECK( pGroup != NULL, FALSE ); // deleting non existing group?
return TRUE;
}
-bool wxFileConfig::ConfigGroup::DeleteEntry(const char *szName)
+bool ConfigGroup::DeleteEntry(const char *szName)
{
ConfigEntry *pEntry = FindEntry(szName);
wxCHECK( pEntry != NULL, FALSE ); // deleting non existing item?
// ----------------------------------------------------------------------------
//
// ----------------------------------------------------------------------------
-void wxFileConfig::ConfigGroup::SetDirty()
+void ConfigGroup::SetDirty()
{
m_bDirty = TRUE;
if ( Parent() != NULL ) // propagate upwards
// ----------------------------------------------------------------------------
// ctor
// ----------------------------------------------------------------------------
-wxFileConfig::ConfigEntry::ConfigEntry(wxFileConfig::ConfigGroup *pParent,
+ConfigEntry::ConfigEntry(ConfigGroup *pParent,
const wxString& strName,
int nLine)
: m_strName(strName)
// set value
// ----------------------------------------------------------------------------
-void wxFileConfig::ConfigEntry::SetLine(LineList *pLine)
+void ConfigEntry::SetLine(LineList *pLine)
{
if ( m_pLine != NULL ) {
wxLogWarning(_("entry '%s' appears more than once in group '%s'"),
// second parameter is FALSE if we read the value from file and prevents the
// entry from being marked as 'dirty'
-void wxFileConfig::ConfigEntry::SetValue(const wxString& strValue, bool bUser)
+void ConfigEntry::SetValue(const wxString& strValue, bool bUser)
{
if ( bUser && IsImmutable() ) {
wxLogWarning(_("attempt to change immutable key '%s' ignored."),
}
}
-void wxFileConfig::ConfigEntry::SetDirty()
+void ConfigEntry::SetDirty()
{
m_bDirty = TRUE;
Group()->SetDirty();
// compare functions for array sorting
// ----------------------------------------------------------------------------
-int CompareEntries(wxFileConfig::ConfigEntry *p1,
- wxFileConfig::ConfigEntry *p2)
+int CompareEntries(ConfigEntry *p1,
+ ConfigEntry *p2)
{
#if wxCONFIG_CASE_SENSITIVE
return strcmp(p1->Name(), p2->Name());
#endif
}
-int CompareGroups(wxFileConfig::ConfigGroup *p1,
- wxFileConfig::ConfigGroup *p2)
+int CompareGroups(ConfigGroup *p1,
+ ConfigGroup *p2)
{
#if wxCONFIG_CASE_SENSITIVE
return strcmp(p1->Name(), p2->Name());
return strResult;
}
-#endif
- // wxUSE_CONFIG
+
+
+
+
+
#endif
#ifdef __WINDOWS__
-#if !defined( __GNUWIN32__ ) && !defined( __MWERKS__ )
+#if !defined( __GNUWIN32__ ) && !defined( __MWERKS__ ) && !defined(__SALFORDC__)
#include <direct.h>
#include <dos.h>
#endif
#include <dir.h>
#endif
+#ifdef __SALFORDC__
+#include <dir.h>
+#include <unix.h>
+#endif
+
#include "wx/setup.h"
#include "wx/log.h"
return TRUE;
return FALSE ;
#else
+
+#ifdef __SALFORDC__
+ struct _stat stbuf;
+#else
struct stat stbuf;
+#endif
if ((filename != "") && stat ((char *)(const char *)filename, &stbuf) == 0)
return TRUE;
wxUnix2MacFilename( gwxMacFileName ) ;
return (rmdir(WXSTRINGCAST gwxMacFileName) == 0);
#else
+
+#ifdef __SALFORDC__
+ return FALSE; // What to do?
+#else
return (rmdir(WXSTRINGCAST dir) == 0);
#endif
+
+#endif
}
#if 0
if ( wxEndsWithPathSeparator(pszPathName) && pszPathName[1] != '\0' )
strPath.Last() = '\0';
+#ifdef __SALFORDC__
+ struct _stat st;
+#else
struct stat st;
- return stat(strPath, &st) == 0 && (st.st_mode & S_IFDIR);
+#endif
+
+ return stat((char*) (const char*) strPath, &st) == 0 && (st.st_mode & S_IFDIR);
}
// Get a temporary filename, opening and closing the file.
#include "wx/wfstream.h"
#include "wx/intl.h"
+#ifdef __SALFORDC__
+#ifdef FAR
+#undef FAR
+#endif
+#endif
+
#ifdef __WXMSW__
#include <windows.h>
#endif
{
wxImageHandler *handler = (wxImageHandler*)node->Data();
if (handler->GetName() == name) return handler;
+
node = node->Next();
}
return (wxImageHandler *)NULL;
OBJ2 = zutil$(O) inflate$(O) infblock$(O) inftrees$(O) infcodes$(O) \
infutil$(O) inffast$(O)
-all: $(LIBTARGET)
-
adler32.obj: adler32.c zutil.h zlib.h zconf.h
$(CC) -c $(CFLAGS) $*.c
echo hello world | minigzip | minigzip -d >test
type test
-clean:
+clean: .SYMBOLIC
-erase *.obj
-erase *.exe
-erase $(LIBTARGET)