test_module_example_Test.c 394 B

1234567891011
  1. #include "pikaScript.h"
  2. // 注入示例 C 源: run_pika.py --module test_module_example 复制使用 (无自动生成)
  3. int test_module_example_Test_add(PikaObj* self, int a, int b){
  4. return a + b;
  5. }
  6. char* test_module_example_Test_greet(PikaObj* self, char* name){
  7. char buf[64];
  8. int n = snprintf(buf, sizeof(buf), "Hello,%s", name);
  9. (void)n;
  10. return obj_cacheStr(self, buf);
  11. }