home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / D / CLISP / CLISPSRC.TAR / clisp-1995-01-01 / src / readline / sysdep.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-19  |  3.3 KB  |  143 lines

  1. /* sysdep.h -- common include file for the readline library */
  2. /* Bruno Haible 1.2.1994 */
  3.  
  4.  
  5. #if !(defined(__MSDOS__) || defined(__EMX__))
  6.  
  7. #include "config.h"
  8.  
  9. #else /* non-Unix systems can't execute the configure script */
  10.  
  11. #if defined(__EMX__) /* emx 0.8f */
  12. #define STDC_HEADERS
  13. #define HAVE_UNISTD_H
  14. #define DIRENT
  15. #define HAVE_TERMIO_H
  16. #define HAVE_SYS_TERMIO_H
  17. #define HAVE_SGTTY_H
  18. #define HAVE_FIONREAD
  19. #define NEED_SYS_IOCTL_H
  20. #define HAVE_ALLOCA_H
  21. #define HAVE_STRCHR
  22. #define HAVE_STRRCHR
  23. #define HAVE_STRPBRK
  24. #define RETSIGTYPE_VOID
  25. #endif
  26.  
  27. #if defined(__GO32__) /* djgpp 1.10 */
  28. #define STDC_HEADERS
  29. #define HAVE_UNISTD_H
  30. #define DIRENT
  31. #define HAVE_STRCHR
  32. #define HAVE_STRRCHR
  33. #define HAVE_STRPBRK
  34. #define RETSIGTYPE_VOID
  35. #endif
  36.  
  37. #endif
  38.  
  39.  
  40. /* For prototypes:  extern int foo RL((int x, int y)); */
  41. #ifdef __STDC__
  42. #define RL(args) args
  43. #else
  44. #define RL(args) ()
  45. #endif
  46.  
  47. #ifdef __GNUC__
  48. #define alloca __builtin_alloca
  49. #else
  50. #ifdef HAVE_ALLOCA_H
  51. #include <alloca.h>
  52. #ifndef alloca
  53. #ifdef __osf__
  54. extern char* alloca RL((int size));
  55. #else
  56. extern void* alloca RL((int size));
  57. #endif
  58. #endif
  59. #else
  60. #ifdef _AIX
  61.  #pragma alloca /* AIX requires this to be the first thing in the file. */
  62. #else
  63. extern void* alloca RL((int size)); /* either from libc.a or from alloca.o */
  64. #endif /* _AIX */
  65. #endif /* HAVE_ALLOCA_H */
  66. #endif /* __GNUC__ */
  67.  
  68. #ifdef STDC_HEADERS
  69. #include <stdlib.h> /* declares malloc(), realloc(), free(), getenv(), abort(), qsort() */
  70. #endif
  71. /* SCO systems may need "#include <malloc.h>" ?? */
  72.  
  73. #ifdef HAVE_UNISTD_H
  74. #include <sys/types.h>
  75. #include <unistd.h> /* declares stat(), open(), read(), write(), close(),
  76.                                 fileno(), fcntl(), ioctl(),
  77.                                 kill (), getpid() */
  78. #endif
  79. #ifdef __EMX__
  80. #include <io.h> /* declares stat(), open(), read(), write(), close(), ioctl() */
  81. #endif
  82.  
  83. #include <string.h> /* declares strlen(), strcmp(), strncmp(), strcpy(), strncpy(), strcat()
  84.                                 and perhaps strchr(), strrchr(), strpbrk() */
  85.  
  86. #ifdef HAVE_STRCHR
  87. /* <string.h> declares strchr() */
  88. #else
  89. /* Systems that don't have strchr should at least have index */
  90. #define strchr index
  91. extern char* strchr();
  92. #endif
  93.  
  94. #ifdef HAVE_STRRCHR
  95. /* <string.h> declares strrchr() */
  96. #else
  97. /* Systems that don't have strrchr should at least have rindex */
  98. #define strrchr rindex
  99. extern char* strrchr();
  100. #endif
  101.  
  102. /* Declaration of dirent, opendir(), readdir(), closedir() */
  103. #if defined(DIRENT) || defined(_POSIX_VERSION)
  104. #include <dirent.h>
  105. typedef struct dirent dirent;
  106. #else
  107. #ifdef SYSNDIR
  108. #include <sys/ndir.h>
  109. #else
  110. #ifdef SYSDIR
  111. #include <sys/dir.h>
  112. #else
  113. #ifdef NDIR
  114. #include <ndir.h>
  115. #else
  116. #include <dir.h>
  117. #endif
  118. #endif
  119. #endif
  120. typedef struct direct dirent;
  121. #endif
  122.  
  123. /* storage class of functions:
  124.  
  125.                                 on declaration    on definition
  126.  
  127.    local to the file                static           static
  128.    globally visible                 extern
  129.    either one, as you like          forward          usable
  130. */
  131. #ifdef LIBRARY
  132. /* Use this when compiling for a library: many functions globally visible. */
  133. #define forward extern
  134. #define usable
  135. #else
  136. /* Use this when compiling for inclusion into a single program: only the
  137.    functions needed are globally visible, the others are `static' and may
  138.    therefore be optimized away. */
  139. #define forward static
  140. #define usable static
  141. #endif
  142.  
  143.