_scm.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. /* classes: h_files */
  2. #ifndef _SCMH
  3. #define _SCMH
  4. /* Copyright (C) 1995,1996, 2000 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., 59 Temple Place, Suite 330,
  19. * Boston, MA 02111-1307 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. /* On VMS, GNU C's errno.h contains a special hack to get link attributes
  70. * for errno correct for linking to the C RTL.
  71. */
  72. #include <errno.h>
  73. /* SCM_SYSCALL retries system calls that have been interrupted (EINTR).
  74. However this can be avoided if the operating system can restart
  75. system calls automatically. We assume this is the case if
  76. sigaction is available and SA_RESTART is defined; they will be used
  77. when installing signal handlers.
  78. */
  79. #ifdef HAVE_RESTARTABLE_SYSCALLS
  80. #define SCM_SYSCALL(line) line
  81. #endif
  82. #ifndef SCM_SYSCALL
  83. #ifdef vms
  84. # ifndef __GNUC__
  85. # include <ssdef.h>
  86. # define SCM_SYSCALL(line) do{errno = 0;line;} \
  87. while(EVMSERR==errno && (vaxc$errno>>3)==(SS$_CONTROLC>>3))
  88. # endif /* ndef __GNUC__ */
  89. #endif /* def vms */
  90. #endif /* ndef SCM_SYSCALL */
  91. #ifndef SCM_SYSCALL
  92. # ifdef EINTR
  93. # if (EINTR > 0)
  94. # define SCM_SYSCALL(line) do{errno = 0;line;}while(EINTR==errno)
  95. # endif /* (EINTR > 0) */
  96. # endif /* def EINTR */
  97. #endif /* ndef SCM_SYSCALL */
  98. #ifndef SCM_SYSCALL
  99. # define SCM_SYSCALL(line) line;
  100. #endif /* ndef SCM_SYSCALL */
  101. #ifndef MSDOS
  102. # ifdef ARM_ULIB
  103. extern volatile int errno;
  104. # else
  105. extern int errno;
  106. # endif /* def ARM_ULIB */
  107. #endif /* ndef MSDOS */
  108. #ifndef min
  109. #define min(A,B) ((A) <= (B) ? (A) : (B))
  110. #endif
  111. #ifndef max
  112. #define max(A,B) ((A) >= (B) ? (A) : (B))
  113. #endif
  114. #endif /* _SCMH */
  115. /*
  116. Local Variables:
  117. c-file-style: "gnu"
  118. End:
  119. */