test-extensions-lib.c 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* Copyright 1999-2001,2003,2006,2008,2018
  2. Free Software Foundation, Inc.
  3. This file is part of Guile.
  4. Guile is free software: you can redistribute it and/or modify it
  5. under the terms of the GNU Lesser General Public License as published
  6. by the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8. Guile is distributed in the hope that it will be useful, but WITHOUT
  9. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10. FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
  11. License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with Guile. If not, see
  14. <https://www.gnu.org/licenses/>. */
  15. #ifdef HAVE_CONFIG_H
  16. # include <config.h>
  17. #endif
  18. #include <libguile.h>
  19. SCM init2_count;
  20. void libtest_extensions_init2 (void);
  21. void libtest_extensions_init (void);
  22. void
  23. libtest_extensions_init2 (void)
  24. {
  25. scm_variable_set_x (init2_count,
  26. scm_from_int (scm_to_int (scm_variable_ref (init2_count)) + 1));
  27. }
  28. void
  29. libtest_extensions_init (void)
  30. {
  31. scm_c_define ("init2-count", scm_from_int (0));
  32. init2_count = scm_permanent_object (scm_c_lookup ("init2-count"));
  33. scm_c_register_extension ("libtest-extensions", "libtest_extensions_init2",
  34. (scm_t_extension_init_func)libtest_extensions_init2, NULL);
  35. }