+wxString wxUnix2MacFilename (const wxChar *str)
+{
+ wxChar *s = sMacFileNameConversion ;
+ wxStrcpy( s , str ) ;
+ if (s)
+ {
+ if ( *s == '.' )
+ {
+ // relative path , since it goes on with slash which is translated to a :
+ memmove( s , s+1 ,wxStrlen( s ) * sizeof(wxChar)) ;
+ }
+ else if ( *s == '/' )
+ {
+ // absolute path -> on mac just start with the drive name
+ memmove( s , s+1 ,wxStrlen( s ) * sizeof(wxChar) ) ;
+ }
+ else
+ {
+ wxASSERT_MSG( 1 , wxT("unkown path beginning") ) ;
+ }
+ while (*s)
+ {
+ if (*s == '/' || *s == '\\')
+ {
+ // convert any back-directory situations
+ if ( *(s+1) == '.' && *(s+2) == '.' && ( (*(s+3) == '/' || *(s+3) == '\\') ) )
+ {
+ *s = ':';
+ memmove( s+1 , s+3 ,(wxStrlen( s+3 ) + 1)*sizeof(wxChar) ) ;
+ }
+ else
+ *s = ':';
+ }
+ s++ ;
+ }
+ }
+ return wxString(sMacFileNameConversion) ;
+}
+
+wxString wxMacFSSpec2UnixFilename( const FSSpec *spec )
+{
+ return wxMac2UnixFilename( wxMacFSSpec2MacFilename( spec) ) ;
+}
+
+void wxUnixFilename2FSSpec( const char *path , FSSpec *spec )
+{
+ wxString var = wxUnix2MacFilename( path ) ;
+ wxMacFilename2FSSpec( var , spec ) ;
+}
+#endif // ! __DARWIN__
+
+#endif // __WXMAC__
+
+void
+wxDos2UnixFilename (wxChar *s)
+{
+ if (s)
+ while (*s)
+ {
+ if (*s == _T('\\'))
+ *s = _T('/');
+#ifdef __WXMSW__
+ else
+ *s = wxTolower (*s); // Case INDEPENDENT
+#endif
+ s++;
+ }
+}
+
+void
+#if defined(__WXMSW__) || defined(__OS2__)
+wxUnix2DosFilename (wxChar *s)
+#else
+wxUnix2DosFilename (wxChar *WXUNUSED(s) )
+#endif
+{
+// Yes, I really mean this to happen under DOS only! JACS
+#if defined(__WXMSW__) || defined(__OS2__)
+ if (s)
+ while (*s)
+ {
+ if (*s == wxT('/'))
+ *s = wxT('\\');
+ s++;
+ }
+#endif
+}
+
+// Concatenate two files to form third