_scm.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /* classes: h_files */
  2. #ifndef _SCMH
  3. #define _SCMH
  4. /* Copyright (C) 1995,1996, 2000, 2001 Free Software Foundation, Inc.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2, or (at your option)
  9. * any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this software; see the file COPYING. If not, write to
  18. * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  19. * Boston, MA 02110-1301 USA
  20. *
  21. * As a special exception, the Free Software Foundation gives permission
  22. * for additional uses of the text contained in its release of GUILE.
  23. *
  24. * The exception is that, if you link the GUILE library with other files
  25. * to produce an executable, this does not by itself cause the
  26. * resulting executable to be covered by the GNU General Public License.
  27. * Your use of that executable is in no way restricted on account of
  28. * linking the GUILE library code into it.
  29. *
  30. * This exception does not however invalidate any other reasons why
  31. * the executable file might be covered by the GNU General Public License.
  32. *
  33. * This exception applies only to the code released by the
  34. * Free Software Foundation under the name GUILE. If you copy
  35. * code from other Free Software Foundation releases into a copy of
  36. * GUILE, as the General Public License permits, the exception does
  37. * not apply to the code that you add in this way. To avoid misleading
  38. * anyone as to the status of such modified files, you must delete
  39. * this exception notice from them.
  40. *
  41. * If you write modifications of your own for GUILE, it is your choice
  42. * whether to permit this exception to apply to your modifications.
  43. * If you do not wish that, delete this exception notice. */
  44. #include "libguile/__scm.h"
  45. /* "What's the difference between _scm.h and __scm.h?"
  46. _scm.h is not installed; it's only visible to the libguile sources
  47. themselves.
  48. __scm.h is installed, and is #included by <libguile.h>. If both
  49. the client and libguile need some piece of information, and it
  50. doesn't fit well into the header file for any particular module, it
  51. should go in __scm.h. */
  52. /* Include headers for those files central to the implementation. The
  53. rest should be explicitly #included in the C files themselves. */
  54. #include "libguile/error.h" /* Everyone signals errors. */
  55. #include "libguile/print.h" /* Everyone needs to print. */
  56. #include "libguile/pairs.h" /* Everyone conses. */
  57. #include "libguile/list.h" /* Everyone makes lists. */
  58. #include "libguile/gc.h" /* Everyone allocates. */
  59. #include "libguile/gsubr.h" /* Everyone defines global functions. */
  60. #include "libguile/procs.h" /* Same. */
  61. #include "libguile/numbers.h" /* Everyone deals with fixnums. */
  62. #include "libguile/symbols.h" /* For length, chars, values, miscellany. */
  63. #include "libguile/boolean.h" /* Everyone wonders about the truth. */
  64. #ifdef USE_THREADS
  65. #include "libguile/threads.h" /* The cooperative thread package does
  66. switching at async ticks. */
  67. #endif
  68. #include "libguile/snarf.h" /* Everyone snarfs. */
  69. #include "libguile/variable.h"
  70. #include "libguile/modules.h"
  71. /* SCM_SYSCALL retries system calls that have been interrupted (EINTR).
  72. However this can be avoided if the operating system can restart
  73. system calls automatically. We assume this is the case if
  74. sigaction is available and SA_RESTART is defined; they will be used
  75. when installing signal handlers.
  76. */
  77. #ifdef HAVE_RESTARTABLE_SYSCALLS
  78. #define SCM_SYSCALL(line) line
  79. #endif
  80. #ifndef SCM_SYSCALL
  81. #ifdef vms
  82. # ifndef __GNUC__
  83. # include <ssdef.h>
  84. # define SCM_SYSCALL(line) do{errno = 0;line;} \
  85. while(EVMSERR==errno && (vaxc$errno>>3)==(SS$_CONTROLC>>3))
  86. # endif /* ndef __GNUC__ */
  87. #endif /* def vms */
  88. #endif /* ndef SCM_SYSCALL */
  89. #ifndef SCM_SYSCALL
  90. # ifdef EINTR
  91. # if (EINTR > 0)
  92. # define SCM_SYSCALL(line) do{errno = 0;line;}while(EINTR==errno)
  93. # endif /* (EINTR > 0) */
  94. # endif /* def EINTR */
  95. #endif /* ndef SCM_SYSCALL */
  96. #ifndef SCM_SYSCALL
  97. # define SCM_SYSCALL(line) line;
  98. #endif /* ndef SCM_SYSCALL */
  99. #if !defined (MSDOS) && !defined (__MINGW32__)
  100. # ifdef ARM_ULIB
  101. extern volatile int errno;
  102. # else
  103. extern int errno;
  104. # endif /* def ARM_ULIB */
  105. #endif /* ndef MSDOS && ndef __MINGW32__*/
  106. #ifndef min
  107. #define min(A,B) ((A) <= (B) ? (A) : (B))
  108. #endif
  109. #ifndef max
  110. #define max(A,B) ((A) >= (B) ? (A) : (B))
  111. #endif
  112. #endif /* _SCMH */
  113. /*
  114. Local Variables:
  115. c-file-style: "gnu"
  116. End:
  117. */