|
Ruby 1.9.2p290(2011-07-09revision32553)
|
00001 /************************************************ 00002 00003 missing.h - prototype for *.c in ./missing, and 00004 for missing timeval struct 00005 00006 $Author: mame $ 00007 created at: Sat May 11 23:46:03 JST 2002 00008 00009 ************************************************/ 00010 00011 #ifndef RUBY_MISSING_H 00012 #define RUBY_MISSING_H 1 00013 00014 #if defined(__cplusplus) 00015 extern "C" { 00016 #if 0 00017 } /* satisfy cc-mode */ 00018 #endif 00019 #endif 00020 00021 #if defined(HAVE_SYS_TIME_H) 00022 # include <sys/time.h> 00023 #elif !defined(_WIN32) 00024 # define time_t long 00025 struct timeval { 00026 time_t tv_sec; /* seconds */ 00027 long tv_usec; /* microseconds */ 00028 }; 00029 #endif 00030 #if defined(HAVE_SYS_TYPES_H) 00031 # include <sys/types.h> 00032 #endif 00033 00034 #if !defined(HAVE_STRUCT_TIMESPEC) 00035 struct timespec { 00036 time_t tv_sec; /* seconds */ 00037 long tv_nsec; /* nanoseconds */ 00038 }; 00039 #endif 00040 00041 #if !defined(HAVE_STRUCT_TIMEZONE) 00042 struct timezone { 00043 int tz_minuteswest; 00044 int tz_dsttime; 00045 }; 00046 #endif 00047 00048 #ifndef RUBY_EXTERN 00049 #define RUBY_EXTERN extern 00050 #endif 00051 00052 #ifndef HAVE_ACOSH 00053 RUBY_EXTERN double acosh(double); 00054 RUBY_EXTERN double asinh(double); 00055 RUBY_EXTERN double atanh(double); 00056 #endif 00057 00058 #ifndef HAVE_CRYPT 00059 RUBY_EXTERN char *crypt(const char *, const char *); 00060 #endif 00061 00062 #ifndef HAVE_DUP2 00063 RUBY_EXTERN int dup2(int, int); 00064 #endif 00065 00066 #ifndef HAVE_EACCESS 00067 RUBY_EXTERN int eaccess(const char*, int); 00068 #endif 00069 00070 #ifndef HAVE_FINITE 00071 RUBY_EXTERN int finite(double); 00072 #endif 00073 00074 #ifndef HAVE_FLOCK 00075 RUBY_EXTERN int flock(int, int); 00076 #endif 00077 00078 /* 00079 #ifndef HAVE_FREXP 00080 RUBY_EXTERN double frexp(double, int *); 00081 #endif 00082 */ 00083 00084 #ifndef HAVE_HYPOT 00085 RUBY_EXTERN double hypot(double, double); 00086 #endif 00087 00088 #ifndef HAVE_ERF 00089 RUBY_EXTERN double erf(double); 00090 RUBY_EXTERN double erfc(double); 00091 #endif 00092 00093 #ifndef HAVE_TGAMMA 00094 RUBY_EXTERN double tgamma(double); 00095 #endif 00096 00097 #ifndef HAVE_LGAMMA_R 00098 RUBY_EXTERN double lgamma_r(double, int *); 00099 #endif 00100 00101 #ifndef HAVE_CBRT 00102 RUBY_EXTERN double cbrt(double); 00103 #endif 00104 00105 #ifndef isinf 00106 # ifndef HAVE_ISINF 00107 # if defined(HAVE_FINITE) && defined(HAVE_ISNAN) 00108 # define isinf(x) (!finite(x) && !isnan(x)) 00109 # else 00110 RUBY_EXTERN int isinf(double); 00111 # endif 00112 # endif 00113 #endif 00114 00115 #ifndef isnan 00116 # ifndef HAVE_ISNAN 00117 RUBY_EXTERN int isnan(double); 00118 # endif 00119 #endif 00120 00121 /* 00122 #ifndef HAVE_MEMCMP 00123 RUBY_EXTERN int memcmp(const void *, const void *, size_t); 00124 #endif 00125 */ 00126 00127 #ifndef HAVE_MEMMOVE 00128 RUBY_EXTERN void *memmove(void *, const void *, size_t); 00129 #endif 00130 00131 /* 00132 #ifndef HAVE_MODF 00133 RUBY_EXTERN double modf(double, double *); 00134 #endif 00135 */ 00136 00137 #ifndef HAVE_STRCHR 00138 RUBY_EXTERN char *strchr(const char *, int); 00139 RUBY_EXTERN char *strrchr(const char *, int); 00140 #endif 00141 00142 #ifndef HAVE_STRERROR 00143 RUBY_EXTERN char *strerror(int); 00144 #endif 00145 00146 #ifndef HAVE_STRSTR 00147 RUBY_EXTERN char *strstr(const char *, const char *); 00148 #endif 00149 00150 /* 00151 #ifndef HAVE_STRTOL 00152 RUBY_EXTERN long strtol(const char *, char **, int); 00153 #endif 00154 */ 00155 00156 #ifndef HAVE_STRLCPY 00157 RUBY_EXTERN size_t strlcpy(char *, const char*, size_t); 00158 #endif 00159 00160 #ifndef HAVE_STRLCAT 00161 RUBY_EXTERN size_t strlcat(char *, const char*, size_t); 00162 #endif 00163 00164 #ifndef HAVE_SIGNBIT 00165 RUBY_EXTERN int signbit(double x); 00166 #endif 00167 00168 #ifndef HAVE_FFS 00169 RUBY_EXTERN int ffs(int); 00170 #endif 00171 00172 #ifdef BROKEN_CLOSE 00173 #include <sys/types.h> 00174 #include <sys/socket.h> 00175 RUBY_EXTERN int ruby_getpeername(int, struct sockaddr *, socklen_t *); 00176 RUBY_EXTERN int ruby_getsockname(int, struct sockaddr *, socklen_t *); 00177 RUBY_EXTERN int ruby_shutdown(int, int); 00178 RUBY_EXTERN int ruby_close(int); 00179 #endif 00180 00181 #if defined(__cplusplus) 00182 #if 0 00183 { /* satisfy cc-mode */ 00184 #endif 00185 } /* extern "C" { */ 00186 #endif 00187 00188 #endif /* RUBY_MISSING_H */ 00189
1.7.3