]> git.lizzy.rs Git - rust.git/commitdiff
move fs routines to c-stack-stdlib
authorNiko Matsakis <niko@alum.mit.edu>
Thu, 20 Oct 2011 04:53:02 +0000 (21:53 -0700)
committerBrian Anderson <banderson@mozilla.com>
Mon, 24 Oct 2011 23:06:16 +0000 (16:06 -0700)
src/lib/fs.rs
src/lib/posix_fs.rs
src/lib/win32_fs.rs
src/rt/rust_builtin.cpp

index ec389593f5beeceebf91012cb1abbc93b854fb0a..9a539f4b826de3f6bc73f024597d5dc7076c5fd5 100644 (file)
@@ -2,7 +2,7 @@
 import os::getcwd;
 import os_fs;
 
-native "rust" mod rustrt {
+native "c-stack-cdecl" mod rustrt {
     fn rust_file_is_dir(path: str::sbuf) -> int;
 }
 
index 5ebebc2748a35f9dcbac1bfe038e19b71764719c..3a518c7b9665f2ab6f82b60cd1fa1de86092f4f0 100644 (file)
@@ -1,5 +1,5 @@
 
-native "rust" mod rustrt {
+native "c-stack-cdecl" mod rustrt {
     fn rust_list_files(&&path: str) -> [str];
 }
 
index e1bfb24b6d1829bad06ccbe15338d9613c1071f5..2fe6acd43997fb3f308a7ad3cf676286db0033d5 100644 (file)
@@ -1,6 +1,6 @@
 
 
-native "rust" mod rustrt {
+native "c-stack-cdecl" mod rustrt {
     fn rust_list_files(&&path: str) -> [str];
     fn rust_file_is_dir(&&path: str) -> int;
 }
index 57d682ec4978154a7be21f66d03f3dd82b88bd05..ae129a9380d4882d708ba9df31765c2f1ff3ed27 100644 (file)
@@ -325,12 +325,12 @@ debug_ptrcast(type_desc *from_ty,
 }
 
 extern "C" CDECL rust_vec*
-rust_list_files(rust_vec **path) {
+rust_list_files(rust_str *path) {
     rust_task *task = rust_scheduler::get_task();
     array_list<rust_str*> strings;
 #if defined(__WIN32__)
     WIN32_FIND_DATA FindFileData;
-    HANDLE hFind = FindFirstFile((char*)(*path)->data, &FindFileData);
+    HANDLE hFind = FindFirstFile((char*)path->data, &FindFileData);
     if (hFind != INVALID_HANDLE_VALUE) {
         do {
             rust_str *str = make_str(task->kernel, FindFileData.cFileName,
@@ -341,7 +341,7 @@ rust_list_files(rust_vec **path) {
         FindClose(hFind);
     }
 #else
-    DIR *dirp = opendir((char*)(*path)->data);
+    DIR *dirp = opendir((char*)path->data);
   if (dirp) {
       struct dirent *dp;
       while ((dp = readdir(dirp))) {