+static
+int wxCALLBACK wxFileDataSizeCompare( long data1, long data2, long data)
+{
+ wxFileData *fd1 = (wxFileData*)data1;
+ wxFileData *fd2 = (wxFileData*)data2;
+ if (fd1->GetFileName() == wxT("..")) return -data;
+ if (fd2->GetFileName() == wxT("..")) return data;
+ if (fd1->IsDir() && !fd2->IsDir()) return -data;
+ if (fd2->IsDir() && !fd1->IsDir()) return data;
+ if (fd1->IsLink() && !fd2->IsLink()) return -data;
+ if (fd2->IsLink() && !fd1->IsLink()) return data;
+ return data*(fd1->GetSize() - fd2->GetSize());
+}
+
+static
+int wxCALLBACK wxFileDataTypeCompare( long data1, long data2, long data)
+{
+ wxFileData *fd1 = (wxFileData*)data1;
+ wxFileData *fd2 = (wxFileData*)data2;
+ if (fd1->GetFileName() == wxT("..")) return -data;
+ if (fd2->GetFileName() == wxT("..")) return data;
+ if (fd1->IsDir() && !fd2->IsDir()) return -data;
+ if (fd2->IsDir() && !fd1->IsDir()) return data;
+ if (fd1->IsLink() && !fd2->IsLink()) return -data;
+ if (fd2->IsLink() && !fd1->IsLink()) return data;
+ return data*wxStrcmp( fd1->GetFileType(), fd2->GetFileType() );
+}
+
+static
+int wxCALLBACK wxFileDataTimeCompare( long data1, long data2, long data)
+{
+ wxFileData *fd1 = (wxFileData*)data1;
+ wxFileData *fd2 = (wxFileData*)data2;
+ if (fd1->GetFileName() == wxT("..")) return -data;
+ if (fd2->GetFileName() == wxT("..")) return data;
+ if (fd1->IsDir() && !fd2->IsDir()) return -data;
+ if (fd2->IsDir() && !fd1->IsDir()) return data;
+
+ return fd1->GetDateTime().IsLaterThan(fd2->GetDateTime()) ? int(data) : -int(data);
+}
+
+#if defined(__UNIX__) && !defined(__OS2__)
+#define IsTopMostDir(dir) (dir == wxT("/"))
+#endif
+
+#if defined(__DOS__) || defined(__WINDOWS__) || defined (__OS2__)
+#define IsTopMostDir(dir) (dir.IsEmpty())
+#endif
+
+#if defined(__DOS__) || defined(__WINDOWS__) || defined(__OS2__)
+// defined in src/generic/dirctrlg.cpp
+extern bool wxIsDriveAvailable(const wxString& dirName);
+#endif
+
+// defined in src/generic/dirctrlg.cpp
+extern size_t wxGetAvailableDrives(wxArrayString &paths, wxArrayString &names, wxArrayInt &icon_ids);
+