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