mirror of
https://github.com/hpd840321/craftlabs-authorization-sdk.git
synced 2026-06-10 02:20:28 +08:00
3894315759
Made-with: Cursor
26 lines
559 B
C++
26 lines
559 B
C++
/*
|
|
* C++ 调用示例:初始化、校验许可、销毁句柄。
|
|
*
|
|
* 版权所有 © 广州创飞人工智能技术有限公司
|
|
* 开发者:huangping@craftlabs.cn
|
|
*/
|
|
#include "craftlabs_auth.h"
|
|
|
|
#include <cstdio>
|
|
#include <cstdlib>
|
|
|
|
int main() {
|
|
AuthHandle h = auth_initialize("{}");
|
|
if (!h) {
|
|
return EXIT_FAILURE;
|
|
}
|
|
AuthResult r = auth_check_license(h);
|
|
if (r.success == 0) {
|
|
auth_destroy(h);
|
|
return EXIT_FAILURE;
|
|
}
|
|
auth_destroy(h);
|
|
std::printf("example cpp ok\n");
|
|
return EXIT_SUCCESS;
|
|
}
|