pterm.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * pterm main program.
  3. */
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6. #include "putty.h"
  7. const bool use_event_log = false; /* pterm doesn't need it */
  8. const bool new_session = false, saved_sessions = false; /* or these */
  9. const bool dup_check_launchable = false; /* no need to check host name
  10. * in conf */
  11. const bool use_pty_argv = true;
  12. const unsigned cmdline_tooltype = TOOLTYPE_NONNETWORK;
  13. /* window.c will call this, and in pterm it's not needed */
  14. void noise_ultralight(NoiseSourceId id, unsigned long data) { }
  15. const struct BackendVtable *select_backend(Conf *conf)
  16. {
  17. return &pty_backend;
  18. }
  19. void initial_config_box(Conf *conf, post_dialog_fn_t after, void *afterctx)
  20. {
  21. /*
  22. * This is a no-op in pterm, except that we'll ensure the protocol
  23. * is set to -1 to inhibit the useless Connection panel in the
  24. * config box. So we do that and then just immediately call the
  25. * post-dialog function with a positive result.
  26. */
  27. conf_set_int(conf, CONF_protocol, -1);
  28. after(afterctx, 1);
  29. }
  30. void cleanup_exit(int code)
  31. {
  32. exit(code);
  33. }
  34. void setup(bool single)
  35. {
  36. settings_set_default_protocol(-1);
  37. if (single)
  38. pty_pre_init();
  39. }