Ruby  1.9.3p547(2014-05-14revision45962)
missing.h
Go to the documentation of this file.
1 /************************************************
2 
3  missing.h - prototype for *.c in ./missing, and
4  for missing timeval struct
5 
6  $Author: usa $
7  created at: Sat May 11 23:46:03 JST 2002
8 
9 ************************************************/
10 
11 #ifndef RUBY_MISSING_H
12 #define RUBY_MISSING_H 1
13 
14 #if defined(__cplusplus)
15 extern "C" {
16 #if 0
17 } /* satisfy cc-mode */
18 #endif
19 #endif
20 
21 #include "ruby/config.h"
22 #include <stddef.h>
23 #ifdef RUBY_EXTCONF_H
24 #include RUBY_EXTCONF_H
25 #endif
26 
27 #if !defined(HAVE_STRUCT_TIMEVAL) || !defined(HAVE_STRUCT_TIMESPEC)
28 #if defined(HAVE_TIME_H)
29 # include <time.h>
30 #endif
31 #if defined(HAVE_SYS_TIME_H)
32 # include <sys/time.h>
33 #endif
34 #endif
35 
36 #if !defined(HAVE_STRUCT_TIMEVAL)
37 struct timeval {
38  time_t tv_sec; /* seconds */
39  long tv_usec; /* microseconds */
40 };
41 #endif /* HAVE_STRUCT_TIMEVAL */
42 
43 #if !defined(HAVE_STRUCT_TIMESPEC)
44 struct timespec {
45  time_t tv_sec; /* seconds */
46  long tv_nsec; /* nanoseconds */
47 };
48 #endif
49 
50 #if !defined(HAVE_STRUCT_TIMEZONE)
51 struct timezone {
54 };
55 #endif
56 
57 #ifdef RUBY_EXPORT
58 #undef RUBY_EXTERN
59 #endif
60 #ifndef RUBY_EXTERN
61 #define RUBY_EXTERN extern
62 #endif
63 
64 #if defined __GNUC__ && __GNUC__ >= 4
65 #pragma GCC visibility push(default)
66 #endif
67 
68 #ifndef HAVE_ACOSH
69 RUBY_EXTERN double acosh(double);
70 RUBY_EXTERN double asinh(double);
71 RUBY_EXTERN double atanh(double);
72 #endif
73 
74 #ifndef HAVE_CRYPT
75 RUBY_EXTERN char *crypt(const char *, const char *);
76 #endif
77 
78 #ifndef HAVE_DUP2
79 RUBY_EXTERN int dup2(int, int);
80 #endif
81 
82 #ifndef HAVE_EACCESS
83 RUBY_EXTERN int eaccess(const char*, int);
84 #endif
85 
86 #ifndef HAVE_ROUND
87 RUBY_EXTERN double round(double); /* numeric.c */
88 #endif
89 
90 #ifndef HAVE_FINITE
91 RUBY_EXTERN int finite(double);
92 #endif
93 
94 #ifndef HAVE_FLOCK
95 RUBY_EXTERN int flock(int, int);
96 #endif
97 
98 /*
99 #ifndef HAVE_FREXP
100 RUBY_EXTERN double frexp(double, int *);
101 #endif
102 */
103 
104 #ifndef HAVE_HYPOT
105 RUBY_EXTERN double hypot(double, double);
106 #endif
107 
108 #ifndef HAVE_ERF
109 RUBY_EXTERN double erf(double);
110 RUBY_EXTERN double erfc(double);
111 #endif
112 
113 #ifndef HAVE_TGAMMA
114 RUBY_EXTERN double tgamma(double);
115 #endif
116 
117 #ifndef HAVE_LGAMMA_R
118 RUBY_EXTERN double lgamma_r(double, int *);
119 #endif
120 
121 #ifndef HAVE_CBRT
122 RUBY_EXTERN double cbrt(double);
123 #endif
124 
125 #ifdef INFINITY
126 # define HAVE_INFINITY
127 #else
128 
129 RUBY_EXTERN const unsigned char rb_infinity[];
130 # define INFINITY (*(float *)rb_infinity)
131 #endif
132 
133 #ifdef NAN
134 # define HAVE_NAN
135 #else
136 
137 RUBY_EXTERN const unsigned char rb_nan[];
138 # define NAN (*(float *)rb_nan)
139 #endif
140 
141 #ifndef isinf
142 # ifndef HAVE_ISINF
143 # if defined(HAVE_FINITE) && defined(HAVE_ISNAN)
144 # ifdef HAVE_IEEEFP_H
145 # include <ieeefp.h>
146 # endif
147 # define isinf(x) (!finite(x) && !isnan(x))
148 # else
149 RUBY_EXTERN int isinf(double);
150 # endif
151 # endif
152 #endif
153 
154 #ifndef isnan
155 # ifndef HAVE_ISNAN
156 RUBY_EXTERN int isnan(double);
157 # endif
158 #endif
159 
160 /*
161 #ifndef HAVE_MEMCMP
162 RUBY_EXTERN int memcmp(const void *, const void *, size_t);
163 #endif
164 */
165 
166 #ifndef HAVE_MEMMOVE
167 RUBY_EXTERN void *memmove(void *, const void *, size_t);
168 #endif
169 
170 /*
171 #ifndef HAVE_MODF
172 RUBY_EXTERN double modf(double, double *);
173 #endif
174 */
175 
176 #ifndef HAVE_STRCHR
177 RUBY_EXTERN char *strchr(const char *, int);
178 RUBY_EXTERN char *strrchr(const char *, int);
179 #endif
180 
181 #ifndef HAVE_STRERROR
182 RUBY_EXTERN char *strerror(int);
183 #endif
184 
185 #ifndef HAVE_STRSTR
186 RUBY_EXTERN char *strstr(const char *, const char *);
187 #endif
188 
189 /*
190 #ifndef HAVE_STRTOL
191 RUBY_EXTERN long strtol(const char *, char **, int);
192 #endif
193 */
194 
195 #ifndef HAVE_STRLCPY
196 RUBY_EXTERN size_t strlcpy(char *, const char*, size_t);
197 #endif
198 
199 #ifndef HAVE_STRLCAT
200 RUBY_EXTERN size_t strlcat(char *, const char*, size_t);
201 #endif
202 
203 #ifndef HAVE_SIGNBIT
204 RUBY_EXTERN int signbit(double x);
205 #endif
206 
207 #ifndef HAVE_FFS
208 RUBY_EXTERN int ffs(int);
209 #endif
210 
211 #ifdef BROKEN_CLOSE
212 #include <sys/types.h>
213 #include <sys/socket.h>
214 RUBY_EXTERN int ruby_getpeername(int, struct sockaddr *, socklen_t *);
215 RUBY_EXTERN int ruby_getsockname(int, struct sockaddr *, socklen_t *);
216 RUBY_EXTERN int ruby_shutdown(int, int);
217 RUBY_EXTERN int ruby_close(int);
218 #endif
219 
220 #ifndef HAVE_SETPROCTITLE
221 RUBY_EXTERN void setproctitle(const char *fmt, ...);
222 #endif
223 
224 #if defined __GNUC__ && __GNUC__ >= 4
225 #pragma GCC visibility pop
226 #endif
227 
228 #if defined(__cplusplus)
229 #if 0
230 { /* satisfy cc-mode */
231 #endif
232 } /* extern "C" { */
233 #endif
234 
235 #endif /* RUBY_MISSING_H */
int tz_dsttime
Definition: missing.h:53
RUBY_EXTERN double cbrt(double)
Definition: cbrt.c:4
int ruby_getpeername(int s, struct sockaddr *name, socklen_t *namelen)
Definition: close.c:10
RUBY_EXTERN int signbit(double x)
Definition: signbit.c:5
int ruby_getsockname(int s, struct sockaddr *name, socklen_t *namelen)
Definition: close.c:27
RUBY_EXTERN char * crypt(const char *, const char *)
Definition: crypt.c:500
RUBY_EXTERN int eaccess(const char *, int)
Definition: file.c:1039
time_t tv_sec
Definition: missing.h:38
RUBY_EXTERN int finite(double)
Definition: finite.c:6
RUBY_EXTERN double tgamma(double)
Definition: tgamma.c:72
RUBY_EXTERN void * memmove(void *, const void *, size_t)
Definition: memmove.c:7
time_t tv_sec
Definition: missing.h:45
RUBY_EXTERN double lgamma_r(double, int *)
Definition: lgamma_r.c:63
long tv_usec
Definition: ossl_asn1.c:18
RUBY_EXTERN const unsigned char rb_nan[]
Definition: missing.h:137
RUBY_EXTERN char * strstr(const char *, const char *)
Definition: strstr.c:8
RUBY_EXTERN int flock(int, int)
Definition: flock.c:124
long tv_nsec
Definition: missing.h:46
RUBY_EXTERN char * strrchr(const char *, int)
Definition: strchr.c:20
RUBY_EXTERN double erfc(double)
Definition: erf.c:81
RUBY_EXTERN int isinf(double)
Definition: isinf.c:56
RUBY_EXTERN const unsigned char rb_infinity[]
Definition: missing.h:129
RUBY_EXTERN double atanh(double)
Definition: acosh.c:75
#define RUBY_EXTERN
Definition: missing.h:61
RUBY_EXTERN double hypot(double, double)
Definition: hypot.c:6
RUBY_EXTERN double asinh(double)
Definition: acosh.c:52
RUBY_EXTERN size_t strlcpy(char *, const char *, size_t)
Definition: strlcpy.c:44
RUBY_EXTERN char * strchr(const char *, int)
Definition: strchr.c:8
int ruby_shutdown(int s, int how)
Definition: close.c:44
RUBY_EXTERN int ffs(int)
Definition: ffs.c:6
RUBY_EXTERN double round(double)
Definition: numeric.c:83
int ruby_close(int s)
Definition: close.c:60
RUBY_EXTERN char * strerror(int)
Definition: strerror.c:11
RUBY_EXTERN double acosh(double)
Definition: acosh.c:36
RUBY_EXTERN size_t strlcat(char *, const char *, size_t)
Definition: strlcat.c:46
RUBY_EXTERN int dup2(int, int)
Definition: dup2.c:27
RUBY_EXTERN int isnan(double)
Definition: isnan.c:8
RUBY_EXTERN void setproctitle(const char *fmt,...)
Definition: setproctitle.c:131
RUBY_EXTERN double erf(double)
Definition: erf.c:71
int tz_minuteswest
Definition: missing.h:52