guile.c 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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
  5. * License as published by the Free Software Foundation; either
  6. * version 2.1 of the License, or (at your option) any later version.
  7. *
  8. * This library is distributed in the hope that it will be useful,
  9. * but 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 02110-1301 USA
  16. */
  17. /* This is the 'main' function for the `guile' executable. It is not
  18. included in libguile.a.
  19. Eventually, we hope this file will be automatically generated,
  20. based on the list of installed, statically linked libraries on the
  21. system. For now, please don't put interesting code in here. */
  22. #ifdef HAVE_CONFIG_H
  23. # include <config.h>
  24. #endif
  25. #ifdef __MINGW32__
  26. # define SCM_IMPORT 1
  27. #endif
  28. #include <libguile.h>
  29. #ifdef HAVE_CONFIG_H
  30. #include <libguile/scmconfig.h>
  31. #endif
  32. #include <ltdl.h>
  33. #ifdef HAVE_WINSOCK2_H
  34. #include <winsock2.h>
  35. #endif
  36. static void
  37. inner_main (void *closure SCM_UNUSED, int argc, char **argv)
  38. {
  39. #ifdef __MINGW32__
  40. /* This is necessary to startup the Winsock API under Win32. */
  41. WSADATA WSAData;
  42. WSAStartup (0x0202, &WSAData);
  43. #endif /* __MINGW32__ */
  44. /* module initializations would go here */
  45. scm_shell (argc, argv);
  46. #ifdef __MINGW32__
  47. WSACleanup ();
  48. #endif /* __MINGW32__ */
  49. }
  50. int
  51. main (int argc, char **argv)
  52. {
  53. scm_boot_guile (argc, argv, inner_main, 0);
  54. return 0; /* never reached */
  55. }
  56. /*
  57. Local Variables:
  58. c-file-style: "gnu"
  59. End:
  60. */