Ruby  1.9.3p448(2013-06-27revision41675)
include/ruby/missing.h
Go to the documentation of this file.
00001 /************************************************
00002 
00003   missing.h - prototype for *.c in ./missing, and
00004               for missing timeval struct
00005 
00006   $Author: usa $
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 #include "ruby/config.h"
00022 #include <stddef.h>
00023 #ifdef RUBY_EXTCONF_H
00024 #include RUBY_EXTCONF_H
00025 #endif
00026 
00027 #if !defined(HAVE_STRUCT_TIMEVAL) || !defined(HAVE_STRUCT_TIMESPEC)
00028 #if defined(HAVE_TIME_H)
00029 # include <time.h>
00030 #endif
00031 #if defined(HAVE_SYS_TIME_H)
00032 # include <sys/time.h>
00033 #endif
00034 #endif
00035 
00036 #if !defined(HAVE_STRUCT_TIMEVAL)
00037 struct timeval {
00038     time_t tv_sec;      /* seconds */
00039     long tv_usec;       /* microseconds */
00040 };
00041 #endif /* HAVE_STRUCT_TIMEVAL */
00042 
00043 #if !defined(HAVE_STRUCT_TIMESPEC)
00044 struct timespec {
00045     time_t tv_sec;      /* seconds */
00046     long tv_nsec;       /* nanoseconds */
00047 };
00048 #endif
00049 
00050 #if !defined(HAVE_STRUCT_TIMEZONE)
00051 struct timezone {
00052     int tz_minuteswest;
00053     int tz_dsttime;
00054 };
00055 #endif
00056 
00057 #ifdef RUBY_EXPORT
00058 #undef RUBY_EXTERN
00059 #endif
00060 #ifndef RUBY_EXTERN
00061 #define RUBY_EXTERN extern
00062 #endif
00063 
00064 #if defined __GNUC__ && __GNUC__ >= 4
00065 #pragma GCC visibility push(default)
00066 #endif
00067 
00068 #ifndef HAVE_ACOSH
00069 RUBY_EXTERN double acosh(double);
00070 RUBY_EXTERN double asinh(double);
00071 RUBY_EXTERN double atanh(double);
00072 #endif
00073 
00074 #ifndef HAVE_CRYPT
00075 RUBY_EXTERN char *crypt(const char *, const char *);
00076 #endif
00077 
00078 #ifndef HAVE_DUP2
00079 RUBY_EXTERN int dup2(int, int);
00080 #endif
00081 
00082 #ifndef HAVE_EACCESS
00083 RUBY_EXTERN int eaccess(const char*, int);
00084 #endif
00085 
00086 #ifndef HAVE_ROUND
00087 RUBY_EXTERN double round(double);       /* numeric.c */
00088 #endif
00089 
00090 #ifndef HAVE_FINITE
00091 RUBY_EXTERN int finite(double);
00092 #endif
00093 
00094 #ifndef HAVE_FLOCK
00095 RUBY_EXTERN int flock(int, int);
00096 #endif
00097 
00098 /*
00099 #ifndef HAVE_FREXP
00100 RUBY_EXTERN double frexp(double, int *);
00101 #endif
00102 */
00103 
00104 #ifndef HAVE_HYPOT
00105 RUBY_EXTERN double hypot(double, double);
00106 #endif
00107 
00108 #ifndef HAVE_ERF
00109 RUBY_EXTERN double erf(double);
00110 RUBY_EXTERN double erfc(double);
00111 #endif
00112 
00113 #ifndef HAVE_TGAMMA
00114 RUBY_EXTERN double tgamma(double);
00115 #endif
00116 
00117 #ifndef HAVE_LGAMMA_R
00118 RUBY_EXTERN double lgamma_r(double, int *);
00119 #endif
00120 
00121 #ifndef HAVE_CBRT
00122 RUBY_EXTERN double cbrt(double);
00123 #endif
00124 
00125 #ifdef INFINITY
00126 # define HAVE_INFINITY
00127 #else
00128 
00129 RUBY_EXTERN const unsigned char rb_infinity[];
00130 # define INFINITY (*(float *)rb_infinity)
00131 #endif
00132 
00133 #ifdef NAN
00134 # define HAVE_NAN
00135 #else
00136 
00137 RUBY_EXTERN const unsigned char rb_nan[];
00138 # define NAN (*(float *)rb_nan)
00139 #endif
00140 
00141 #ifndef isinf
00142 # ifndef HAVE_ISINF
00143 #  if defined(HAVE_FINITE) && defined(HAVE_ISNAN)
00144 #    ifdef HAVE_IEEEFP_H
00145 #    include <ieeefp.h>
00146 #    endif
00147 #  define isinf(x) (!finite(x) && !isnan(x))
00148 #  else
00149 RUBY_EXTERN int isinf(double);
00150 #  endif
00151 # endif
00152 #endif
00153 
00154 #ifndef isnan
00155 # ifndef HAVE_ISNAN
00156 RUBY_EXTERN int isnan(double);
00157 # endif
00158 #endif
00159 
00160 /*
00161 #ifndef HAVE_MEMCMP
00162 RUBY_EXTERN int memcmp(const void *, const void *, size_t);
00163 #endif
00164 */
00165 
00166 #ifndef HAVE_MEMMOVE
00167 RUBY_EXTERN void *memmove(void *, const void *, size_t);
00168 #endif
00169 
00170 /*
00171 #ifndef HAVE_MODF
00172 RUBY_EXTERN double modf(double, double *);
00173 #endif
00174 */
00175 
00176 #ifndef HAVE_STRCHR
00177 RUBY_EXTERN char *strchr(const char *, int);
00178 RUBY_EXTERN char *strrchr(const char *, int);
00179 #endif
00180 
00181 #ifndef HAVE_STRERROR
00182 RUBY_EXTERN char *strerror(int);
00183 #endif
00184 
00185 #ifndef HAVE_STRSTR
00186 RUBY_EXTERN char *strstr(const char *, const char *);
00187 #endif
00188 
00189 /*
00190 #ifndef HAVE_STRTOL
00191 RUBY_EXTERN long strtol(const char *, char **, int);
00192 #endif
00193 */
00194 
00195 #ifndef HAVE_STRLCPY
00196 RUBY_EXTERN size_t strlcpy(char *, const char*, size_t);
00197 #endif
00198 
00199 #ifndef HAVE_STRLCAT
00200 RUBY_EXTERN size_t strlcat(char *, const char*, size_t);
00201 #endif
00202 
00203 #ifndef HAVE_SIGNBIT
00204 RUBY_EXTERN int signbit(double x);
00205 #endif
00206 
00207 #ifndef HAVE_FFS
00208 RUBY_EXTERN int ffs(int);
00209 #endif
00210 
00211 #ifdef BROKEN_CLOSE
00212 #include <sys/types.h>
00213 #include <sys/socket.h>
00214 RUBY_EXTERN int ruby_getpeername(int, struct sockaddr *, socklen_t *);
00215 RUBY_EXTERN int ruby_getsockname(int, struct sockaddr *, socklen_t *);
00216 RUBY_EXTERN int ruby_shutdown(int, int);
00217 RUBY_EXTERN int ruby_close(int);
00218 #endif
00219 
00220 #ifndef HAVE_SETPROCTITLE
00221 RUBY_EXTERN void setproctitle(const char *fmt, ...);
00222 #endif
00223 
00224 #if defined __GNUC__ && __GNUC__ >= 4
00225 #pragma GCC visibility pop
00226 #endif
00227 
00228 #if defined(__cplusplus)
00229 #if 0
00230 { /* satisfy cc-mode */
00231 #endif
00232 }  /* extern "C" { */
00233 #endif
00234 
00235 #endif /* RUBY_MISSING_H */
00236