version.c 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* version.c -- Get information about versions.
  2. *
  3. * Copyright (C) 2013 Artyom V. Poptsov <poptsov.artyom@gmail.com>
  4. *
  5. * This file is part of Guile-SSH.
  6. *
  7. * Guile-SSH is free software: you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation, either version 3 of the
  10. * License, or (at your option) any later version.
  11. *
  12. * Guile-SSH is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with Guile-SSH. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. #include <config.h>
  21. #include <libguile.h>
  22. #include <libssh/libssh.h>
  23. /* Get version of the libssh. */
  24. SCM_DEFINE (guile_ssh_get_libssh_version, "%get-libssh-version", 0, 0, 0,
  25. (),
  26. "\
  27. Get version of the libssh.\
  28. ")
  29. {
  30. const char *version = ssh_version (0);
  31. return scm_from_locale_string (version);
  32. }
  33. /* Get version of the Guile-SSH. */
  34. SCM_DEFINE (guile_ssh_get_library_version, "get-library-version", 0, 0, 0,
  35. (),
  36. "Get version of the Guile-SSH.")
  37. {
  38. return scm_from_locale_string (PACKAGE_VERSION);
  39. }
  40. void
  41. init_version (void)
  42. {
  43. #include "version.x"
  44. }
  45. /* version.c ends here */