- FILE *fp1 = (FILE *) NULL;
- FILE *fp2 = (FILE *) NULL;
- FILE *fp3 = (FILE *) NULL;
- // Open the inputs and outputs
-#ifdef __WXMAC__
- strcpy( gwxMacFileName , file1 ) ;
- wxUnix2MacFilename( gwxMacFileName ) ;
- strcpy( gwxMacFileName2 , file2) ;
- wxUnix2MacFilename( gwxMacFileName2 ) ;
- strcpy( gwxMacFileName3 , outfile) ;
- wxUnix2MacFilename( gwxMacFileName3 ) ;
-
- if ((fp1 = fopen (gwxMacFileName, "rb")) == NULL ||
- (fp2 = fopen (gwxMacFileName2, "rb")) == NULL ||
- (fp3 = fopen (gwxMacFileName3, "wb")) == NULL)
+#ifndef __DARWIN__
+
+wxString wxMac2UnixFilename (const wxChar *str)
+{
+ wxChar *s = sMacFileNameConversion ;
+ wxStrcpy( s , str ) ;
+ if (s)
+ {
+ memmove( s+1 , s ,wxStrlen( s ) + 1 * sizeof(wxChar)) ;
+ if ( *s == ':' )
+ *s = '.' ;
+ else
+ *s = '/' ;
+
+ while (*s)
+ {
+ if (*s == ':')
+ *s = '/';
+ else
+ *s = wxTolower(*s); // Case INDEPENDENT
+ s++;
+ }
+ }
+ return wxString(sMacFileNameConversion) ;
+}
+
+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 wxChar *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)