Commit fcdfd9d9 authored by Jakob Bornecrantz's avatar Jakob Bornecrantz

st/oxr: Pipe some path functions down into the path store

parent 77b3b7b8
Pipeline #30227 passed with stages
in 41 seconds
......@@ -145,14 +145,29 @@ oxr_xrStructureTypeToString(XrInstance instance,
}
XrResult
oxr_xrStringToPath(XrInstance instance, const char* pathString, XrPath* path)
oxr_xrStringToPath(XrInstance instance,
const char* pathString,
XrPath* out_path)
{
struct oxr_instance* inst;
struct oxr_logger log;
XrResult ret;
XrPath path;
OXR_VERIFY_INSTANCE_AND_INIT_LOG(&log, instance, inst,
"xrStringToPath");
OXR_WARN_ONCE(&log, "fill in properly");
ret = oxr_verify_full_path_c(&log, pathString, "pathString");
if (ret != XR_SUCCESS) {
return ret;
}
ret = oxr_path_get_or_create(&log, inst, pathString, strlen(pathString),
&path);
if (ret != XR_SUCCESS) {
return ret;
}
*out_path = path;
return XR_SUCCESS;
}
......@@ -166,19 +181,27 @@ oxr_xrPathToString(XrInstance instance,
{
struct oxr_instance* inst;
struct oxr_logger log;
const char* str;
size_t length;
XrResult ret;
OXR_VERIFY_INSTANCE_AND_INIT_LOG(&log, instance, inst,
"xrPathToString");
OXR_WARN_ONCE(&log, "fill in properly");
if (bufferCountOutput != NULL) {
*bufferCountOutput = 1;
if (path == XR_NULL_PATH) {
return oxr_error(&log, XR_ERROR_PATH_INVALID,
"(path == XR_NULL_PATH)");
}
if (buffer != NULL && bufferCapacityInput > 0) {
buffer[0] = '\0';
ret = oxr_path_get_string(&log, inst, path, &str, &length);
if (ret != XR_SUCCESS) {
return ret;
}
// Length is the number of valid characters, not including the null
// termination character (but a extra null byte is always reserved).
OXR_TWO_CALL_HELPER(&log, bufferCapacityInput, bufferCountOutput,
buffer, length + 1, str);
return XR_SUCCESS;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment