refactor(rust): resolve artifacts' path and better stringRef mgmnt

This commit is contained in:
youben11
2022-11-29 14:00:39 +01:00
committed by Ayoub Benaissa
parent ad988de9a3
commit fbc60097ab
3 changed files with 59 additions and 11 deletions

View File

@@ -253,6 +253,22 @@ PublicResult librarySupportServerCall(LibrarySupport support,
return wrap(resultOrError.get().release());
}
MlirStringRef librarySupportGetSharedLibPath(LibrarySupport support) {
auto path = unwrap(support)->getSharedLibPath();
// allocate buffer and copy module string
char *buffer = new char[path.length() + 1];
strcpy(buffer, path.c_str());
return mlirStringRefCreate(buffer, path.length());
}
MlirStringRef librarySupportGetClientParametersPath(LibrarySupport support) {
auto path = unwrap(support)->getClientParametersPath();
// allocate buffer and copy module string
char *buffer = new char[path.length() + 1];
strcpy(buffer, path.c_str());
return mlirStringRefCreate(buffer, path.length());
}
void librarySupportDestroy(LibrarySupport support) { C_STRUCT_CLEANER(support) }
/// ********** ServerLamda CAPI ************************************************