code: function init(vm_options) {
      /* Set references to external libraries */
      set_references( vm_options );
  
      VM = vm_options.vm;
      if (GiDispa)
          GiDispa.set_vm(VM);
  
      vm_options.accept = accept_ui_event;
  
      GlkOte.init(vm_options);
  
      option_exit_warning = vm_options.exit_warning;
      option_do_vm_autosave = vm_options.do_vm_autosave;
      option_before_select_hook = vm_options.before_select_hook;
      option_extevent_hook = vm_options.extevent_hook;
      option_glk_gestalt_hook = vm_options.glk_gestalt_hook;
  
      if (option_before_select_hook) {
          option_before_select_hook();
      }
  }
docs: /* Initialize the library, initialize the VM, and set it running. (It will
  run until the first glk_select() or glk_exit() call.)
  
  The vm_options argument must have a vm_options.vm field, which must be an
  appropriate VM interface object. (For example, Quixe.) This must have
  init() and resume() methods.
  
  The vm_options argument is also passed through to GlkOte as the game
  interface object. It can be used to affect some GlkOte display options,
  such as window spacing.
  
  (You do not need to provide a vm_options.accept() function. The Glk
  library sets that up for you.)