message-type.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* Copyright (C) 2013, 2014 Artyom V. Poptsov <poptsov.artyom@gmail.com>
  2. *
  3. * This file is part of Guile-SSH.
  4. *
  5. * Guile-SSH is free software: you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation, either version 3 of the
  8. * License, or (at your option) any later version.
  9. *
  10. * Guile-SSH is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with Guile-SSH. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef __MESSAGE_TYPE_H__
  19. #define __MESSAGE_TYPE_H__
  20. #include <libguile.h>
  21. #include <libssh/libssh.h>
  22. extern scm_t_bits message_tag;
  23. /* Smob data. */
  24. struct message_data {
  25. /* Reference to the parent session. We need to keep the reference
  26. to prevent the session from premature freeing by the GC. */
  27. SCM session;
  28. ssh_message message;
  29. };
  30. extern void init_message_type (void);
  31. /* Helper procedures. */
  32. extern SCM _scm_from_ssh_message (const ssh_message message, SCM session);
  33. extern struct message_data *_scm_to_message_data (SCM x);
  34. #endif /* ifndef __MESSAGE_TYPE_H__ */
  35. /* message-type.h ends here */