guile.c 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /* Copyright (C) 1996,1997,2000,2001, 2006, 2008 Free Software Foundation, Inc.
  2. *
  3. * This library is free software; you can redistribute it and/or
  4. * modify it under the terms of the GNU Lesser General Public License
  5. * as published by the Free Software Foundation; either version 3 of
  6. * the License, or (at your option) any later version.
  7. *
  8. * This library is distributed in the hope that it will be useful, but
  9. * WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. * Lesser General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU Lesser General Public
  14. * License along with this library; if not, write to the Free Software
  15. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  16. * 02110-1301 USA
  17. */
  18. /* This is the 'main' function for the `guile' executable. It is not
  19. included in libguile.a.
  20. Eventually, we hope this file will be automatically generated,
  21. based on the list of installed, statically linked libraries on the
  22. system. For now, please don't put interesting code in here. */
  23. #ifdef HAVE_CONFIG_H
  24. # include <config.h>
  25. #endif
  26. #ifdef __MINGW32__
  27. # define SCM_IMPORT 1
  28. #endif
  29. #include <libguile.h>
  30. #ifdef HAVE_CONFIG_H
  31. #include <libguile/scmconfig.h>
  32. #endif
  33. #include <ltdl.h>
  34. #ifdef HAVE_WINSOCK2_H
  35. #include <winsock2.h>
  36. #endif
  37. /* Debugger interface (don't change the order of the following lines) */
  38. #define GDB_TYPE SCM
  39. #include <libguile/gdb_interface.h>
  40. GDB_INTERFACE;
  41. static void
  42. inner_main (void *closure SCM_UNUSED, int argc, char **argv)
  43. {
  44. #ifdef __MINGW32__
  45. /* This is necessary to startup the Winsock API under Win32. */
  46. WSADATA WSAData;
  47. WSAStartup (0x0202, &WSAData);
  48. GDB_INTERFACE_INIT;
  49. #endif /* __MINGW32__ */
  50. /* module initializations would go here */
  51. scm_shell (argc, argv);
  52. #ifdef __MINGW32__
  53. WSACleanup ();
  54. #endif /* __MINGW32__ */
  55. }
  56. int
  57. main (int argc, char **argv)
  58. {
  59. scm_boot_guile (argc, argv, inner_main, 0);
  60. return 0; /* never reached */
  61. }
  62. /*
  63. Local Variables:
  64. c-file-style: "gnu"
  65. End:
  66. */