null-opener.c 512 B

123456789101112131415161718192021
  1. /*
  2. * Null implementation of DeferredSocketOpener. Doesn't even bother to
  3. * allocate and free itself: there's just one static implementation
  4. * which we hand out to any caller.
  5. */
  6. #include "putty.h"
  7. static void null_opener_free(DeferredSocketOpener *opener) {}
  8. static const DeferredSocketOpenerVtable NullOpener_vt = {
  9. .free = null_opener_free,
  10. };
  11. static DeferredSocketOpener null_opener = { .vt = &NullOpener_vt };
  12. DeferredSocketOpener *null_deferred_socket_opener(void)
  13. {
  14. return &null_opener;
  15. }