Remove rust_list_files from std and rt
This commit is contained in:
parent
d1b3ed8c3f
commit
8561f7654c
4 changed files with 0 additions and 28 deletions
|
@ -1,6 +1,5 @@
|
||||||
|
|
||||||
native "rust" mod rustrt {
|
native "rust" mod rustrt {
|
||||||
fn rust_list_files(path: str) -> vec[str];
|
|
||||||
fn rust_list_files_ivec(path: str) -> @[str];
|
fn rust_list_files_ivec(path: str) -> @[str];
|
||||||
fn rust_dirent_filename(ent: os::libc::dirent) -> str;
|
fn rust_dirent_filename(ent: os::libc::dirent) -> str;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
|
|
||||||
native "rust" mod rustrt {
|
native "rust" mod rustrt {
|
||||||
fn rust_list_files(path: str) -> vec[str];
|
|
||||||
fn rust_list_files_ivec(path: str) -> @[str];
|
fn rust_list_files_ivec(path: str) -> @[str];
|
||||||
fn rust_file_is_dir(path: str) -> int;
|
fn rust_file_is_dir(path: str) -> int;
|
||||||
}
|
}
|
||||||
|
|
|
@ -442,31 +442,6 @@ rust_str* c_str_to_rust(rust_task *task, char const *str) {
|
||||||
return vec_alloc_with_data(task, len, len, 1, (void*)str);
|
return vec_alloc_with_data(task, len, len, 1, (void*)str);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" CDECL rust_vec*
|
|
||||||
rust_list_files(rust_task *task, rust_str *path) {
|
|
||||||
array_list<rust_str*> strings;
|
|
||||||
#if defined(__WIN32__)
|
|
||||||
WIN32_FIND_DATA FindFileData;
|
|
||||||
HANDLE hFind = FindFirstFile((char*)path->data, &FindFileData);
|
|
||||||
if (hFind != INVALID_HANDLE_VALUE) {
|
|
||||||
do {
|
|
||||||
strings.push(c_str_to_rust(task, FindFileData.cFileName));
|
|
||||||
} while (FindNextFile(hFind, &FindFileData));
|
|
||||||
FindClose(hFind);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
DIR *dirp = opendir((char*)path->data);
|
|
||||||
if (dirp) {
|
|
||||||
struct dirent *dp;
|
|
||||||
while ((dp = readdir(dirp)))
|
|
||||||
strings.push(c_str_to_rust(task, dp->d_name));
|
|
||||||
closedir(dirp);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
return vec_alloc_with_data(task, strings.size(), strings.size(),
|
|
||||||
sizeof(rust_str*), strings.data());
|
|
||||||
}
|
|
||||||
|
|
||||||
extern "C" CDECL rust_box*
|
extern "C" CDECL rust_box*
|
||||||
rust_list_files_ivec(rust_task *task, rust_str *path) {
|
rust_list_files_ivec(rust_task *task, rust_str *path) {
|
||||||
array_list<rust_str*> strings;
|
array_list<rust_str*> strings;
|
||||||
|
|
|
@ -48,7 +48,6 @@ rust_dirent_filename
|
||||||
rust_file_is_dir
|
rust_file_is_dir
|
||||||
rust_get_stdin
|
rust_get_stdin
|
||||||
rust_get_stdout
|
rust_get_stdout
|
||||||
rust_list_files
|
|
||||||
rust_list_files_ivec
|
rust_list_files_ivec
|
||||||
rust_process_wait
|
rust_process_wait
|
||||||
rust_ptr_eq
|
rust_ptr_eq
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue