refactor(native): rename C API auth_* -> craft_* across header, core, JNI bridge, and smoke tests

This commit is contained in:
2026-04-28 18:27:34 +08:00
parent 5073a4193f
commit 53c52a0b3e
3 changed files with 25 additions and 25 deletions
+9 -9
View File
@@ -39,14 +39,14 @@ void ensure_adapters_registered_once() {
extern "C" {
CRAFTLABS_API AuthHandle auth_initialize(const char* /* config_json */) {
CRAFTLABS_API AuthHandle craft_initialize(const char* /* config_json */) {
ensure_adapters_registered_once();
auto* ctx = new AuthContext{};
ctx->dummy = 1;
return reinterpret_cast<AuthHandle>(ctx);
}
CRAFTLABS_API AuthResult auth_activate(AuthHandle handle, const char* /* license_key */) {
CRAFTLABS_API AuthResult craft_activate(AuthHandle handle, const char* /* license_key */) {
if (!handle) {
return k_fail;
}
@@ -54,14 +54,14 @@ CRAFTLABS_API AuthResult auth_activate(AuthHandle handle, const char* /* license
return k_ok;
}
CRAFTLABS_API AuthResult auth_check_license(AuthHandle handle) {
CRAFTLABS_API AuthResult craft_check_license(AuthHandle handle) {
if (!handle) {
return k_fail;
}
return k_ok;
}
CRAFTLABS_API LicenseInfo* auth_get_license_info(AuthHandle handle) {
CRAFTLABS_API LicenseInfo* craft_get_license_info(AuthHandle handle) {
if (!handle) {
return nullptr;
}
@@ -77,32 +77,32 @@ CRAFTLABS_API LicenseInfo* auth_get_license_info(AuthHandle handle) {
return info;
}
CRAFTLABS_API void auth_free_license_info(LicenseInfo* info) {
CRAFTLABS_API void craft_free_license_info(LicenseInfo* info) {
std::free(info);
}
CRAFTLABS_API int32_t auth_has_feature(AuthHandle handle, const char* /* feature_name */) {
CRAFTLABS_API int32_t craft_has_feature(AuthHandle handle, const char* /* feature_name */) {
if (!handle) {
return 0;
}
return 1;
}
CRAFTLABS_API AuthResult auth_release(AuthHandle handle) {
CRAFTLABS_API AuthResult craft_release(AuthHandle handle) {
if (!handle) {
return k_fail;
}
return k_ok;
}
CRAFTLABS_API AuthResult auth_heartbeat(AuthHandle handle) {
CRAFTLABS_API AuthResult craft_heartbeat(AuthHandle handle) {
if (!handle) {
return k_fail;
}
return k_ok;
}
CRAFTLABS_API void auth_destroy(AuthHandle handle) {
CRAFTLABS_API void craft_destroy(AuthHandle handle) {
if (!handle) {
return;
}