Пример #1
0
void platformServicePort(Dart_NativeArguments arguments) {
    Dart_EnterScope();
    Dart_SetReturnValue(arguments, Dart_Null());
    Dart_Port service_port =
            Dart_NewNativePort("PlatformService", wrappedPlatformService, true);
    if (service_port != ILLEGAL_PORT) {
        Dart_Handle send_port = HandleError(Dart_NewSendPort(service_port));
        Dart_SetReturnValue(arguments, send_port);
    }
    Dart_ExitScope();
}
Пример #2
0
Dart_NativeFunction ResolveName(Dart_Handle name,
                                int argc,
                                bool* auto_setup_scope) {
  *auto_setup_scope = true;
  Dart_NativeFunction result;
  if (!Dart_IsString(name)) return NULL;
  Dart_EnterScope();
  const char* cname;
  HandleError(Dart_StringToCString(name, &cname));

  for (int i=0; function_list[i].name != NULL; ++i) {
    if (strcmp(function_list[i].name, cname) == 0) {
      result = function_list[i].function;
      break;
    }
  }
  
  Dart_ExitScope();
  return result; 
  
}
Пример #3
0
void getVersion(Dart_NativeArguments arguments) {
  Dart_EnterScope();
  Dart_Handle result = Dart_NewInteger(PDFLIB_MAJORVERSION);
  Dart_SetReturnValue(arguments, result);
  Dart_ExitScope();
}