mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-05 03:20:46 -05:00
Make Utf8CStr a first class citizen in C++ codebase
Utf8CStr is in many cases a better string view class than std::string_view, because it provides "view" access to a string buffer that is guaranteed to be null terminated. It also has the additional benefit of being UTF-8 verified and can seemlessly cross FFI boundaries. We would want to start use more Utf8CStr in our existing C++ codebase.
This commit is contained in:
@@ -15,23 +15,23 @@
|
||||
#include "init-rs.hpp"
|
||||
|
||||
int magisk_proxy_main(int, char *argv[]);
|
||||
rust::Utf8CStr backup_init();
|
||||
Utf8CStr backup_init();
|
||||
|
||||
// Expose some constants to Rust
|
||||
|
||||
static inline rust::Utf8CStr split_plat_cil() {
|
||||
static inline Utf8CStr split_plat_cil() {
|
||||
return SPLIT_PLAT_CIL;
|
||||
};
|
||||
|
||||
static inline rust::Utf8CStr preload_lib() {
|
||||
static inline Utf8CStr preload_lib() {
|
||||
return PRELOAD_LIB;
|
||||
}
|
||||
|
||||
static inline rust::Utf8CStr preload_policy() {
|
||||
static inline Utf8CStr preload_policy() {
|
||||
return PRELOAD_POLICY;
|
||||
}
|
||||
|
||||
static inline rust::Utf8CStr preload_ack() {
|
||||
static inline Utf8CStr preload_ack() {
|
||||
return PRELOAD_ACK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user