Skip to content

Commit 7b96aed

Browse files
committed
Auto merge of #2321 - devnexen:haiku_find_path, r=Amanieu
haiku adding handy find_path fn.
2 parents 8aa6cea + 7e25e52 commit 7b96aed

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

libc-test/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3286,6 +3286,7 @@ fn test_haiku(target: &str) {
32863286
"kernel/fs_volume.h",
32873287
"kernel/image.h",
32883288
"kernel/scheduler.h",
3289+
"storage/FindDirectory.h",
32893290
"storage/StorageDefs.h",
32903291
"support/Errors.h",
32913292
"support/SupportDefs.h",

src/unix/haiku/native.rs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,36 @@ e! {
6767
SCHEDULER_MODE_LOW_LATENCY,
6868
SCHEDULER_MODE_POWER_SAVING,
6969
}
70+
71+
// FindDirectory.h
72+
pub enum path_base_directory {
73+
B_FIND_PATH_INSTALLATION_LOCATION_DIRECTORY,
74+
B_FIND_PATH_ADD_ONS_DIRECTORY,
75+
B_FIND_PATH_APPS_DIRECTORY,
76+
B_FIND_PATH_BIN_DIRECTORY,
77+
B_FIND_PATH_BOOT_DIRECTORY,
78+
B_FIND_PATH_CACHE_DIRECTORY,
79+
B_FIND_PATH_DATA_DIRECTORY,
80+
B_FIND_PATH_DEVELOP_DIRECTORY,
81+
B_FIND_PATH_DEVELOP_LIB_DIRECTORY,
82+
B_FIND_PATH_DOCUMENTATION_DIRECTORY,
83+
B_FIND_PATH_ETC_DIRECTORY,
84+
B_FIND_PATH_FONTS_DIRECTORY,
85+
B_FIND_PATH_HEADERS_DIRECTORY,
86+
B_FIND_PATH_LIB_DIRECTORY,
87+
B_FIND_PATH_LOG_DIRECTORY,
88+
B_FIND_PATH_MEDIA_NODES_DIRECTORY,
89+
B_FIND_PATH_PACKAGES_DIRECTORY,
90+
B_FIND_PATH_PREFERENCES_DIRECTORY,
91+
B_FIND_PATH_SERVERS_DIRECTORY,
92+
B_FIND_PATH_SETTINGS_DIRECTORY,
93+
B_FIND_PATH_SOUNDS_DIRECTORY,
94+
B_FIND_PATH_SPOOL_DIRECTORY,
95+
B_FIND_PATH_TRANSLATORS_DIRECTORY,
96+
B_FIND_PATH_VAR_DIRECTORY,
97+
B_FIND_PATH_IMAGE_PATH = 1000,
98+
B_FIND_PATH_PACKAGE_PATH,
99+
}
70100
}
71101

72102
s! {
@@ -934,6 +964,13 @@ extern "C" {
934964
info: *mut image_info,
935965
size: ::size_t,
936966
) -> status_t;
967+
pub fn find_path(
968+
codePointer: *const ::c_void,
969+
baseDirectory: path_base_directory,
970+
subPath: *const ::c_char,
971+
pathBuffer: *mut ::c_char,
972+
bufferSize: usize,
973+
) -> status_t;
937974
}
938975

939976
// The following functions are defined as macros in C/C++

0 commit comments

Comments
 (0)