if (Dart_IsError(parent_library)) return parent_library; Dart_Handle result_code = Dart_SetNativeResolver(parent_library, ResolveName, NULL); if (Dart_IsError(result_code)) return result_code; return Dart_Null(); } void hello(Dart_NativeArguments arguments) { Dart_EnterScope(); printf("Hello\n"); Dart_ExitScope(); } Dart_NativeFunction ResolveName(Dart_Handle name, int argc, bool* auto_setup_scope) { if (!Dart_IsString(name) || auto_setup_scope == NULL) return NULL; Dart_EnterScope(); const char *cname; Dart_StringToCString(name, &cname); Dart_NativeFunction result = NULL; if (strcmp(cname, "hello") == 0) result = hello; Dart_ExitScope(); return result; } 深いレベルで拡張可能 都度 ResolveName する Dart から C を呼ぶ⽅法 ( これまで) 18