Ruby 2.1.5p273(2014-11-13revision48405)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

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 {
58 int tz_minuteswest;
59 int tz_dsttime;
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
70 RUBY_SYMBOL_EXPORT_BEGIN
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)
130 union bytesequence4_or_float {
131 unsigned char bytesequence[4];
132 float float_value;
133 };
134 #endif
135
136 #ifdef INFINITY
137 # define HAVE_INFINITY
138 #else
139
140 RUBY_EXTERN const union bytesequence4_or_float rb_infinity;
141 # define INFINITY (rb_infinity.float_value)
142 #endif
143
144 #ifdef NAN
145 # define HAVE_NAN
146 #else
147
148 RUBY_EXTERN const union bytesequence4_or_float rb_nan;
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
235 RUBY_SYMBOL_EXPORT_END
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 */
timezone::tz_dsttime
int tz_dsttime
Definition: missing.h:59
cbrt
RUBY_EXTERN double cbrt(double)
Definition: cbrt.c:4
ruby_getpeername
int ruby_getpeername(int s, struct sockaddr *name, socklen_t *namelen)
Definition: close.c:10
signbit
RUBY_EXTERN int signbit(double x)
Definition: signbit.c:5
rb_infinity
RUBY_EXTERN const union bytesequence4_or_float rb_infinity
Definition: missing.h:140
ruby_getsockname
int ruby_getsockname(int s, struct sockaddr *name, socklen_t *namelen)
Definition: close.c:27
crypt
RUBY_EXTERN char * crypt(const char *, const char *)
Definition: crypt.c:500
eaccess
RUBY_EXTERN int eaccess(const char *, int)
Definition: file.c:1146
timeval::tv_sec
time_t tv_sec
Definition: missing.h:44
finite
RUBY_EXTERN int finite(double)
Definition: finite.c:6
tgamma
RUBY_EXTERN double tgamma(double)
Definition: tgamma.c:72
memmove
RUBY_EXTERN void * memmove(void *, const void *, size_t)
Definition: memmove.c:7
timespec::tv_sec
time_t tv_sec
Definition: missing.h:51
lgamma_r
RUBY_EXTERN double lgamma_r(double, int *)
Definition: lgamma_r.c:63
timeval::tv_usec
long tv_usec
Definition: ossl_asn1.c:18
strstr
RUBY_EXTERN char * strstr(const char *, const char *)
Definition: strstr.c:8
flock
RUBY_EXTERN int flock(int, int)
Definition: flock.c:125
timespec::tv_nsec
long tv_nsec
Definition: missing.h:52
strrchr
RUBY_EXTERN char * strrchr(const char *, int)
Definition: strchr.c:20
acosh
RUBY_SYMBOL_EXPORT_BEGIN RUBY_EXTERN double acosh(double)
Definition: acosh.c:36
erfc
RUBY_EXTERN double erfc(double)
Definition: erf.c:81
isinf
RUBY_EXTERN int isinf(double)
Definition: isinf.c:56
rb_nan
RUBY_EXTERN const union bytesequence4_or_float rb_nan
Definition: missing.h:148
atanh
RUBY_EXTERN double atanh(double)
Definition: acosh.c:75
timeval
Definition: ossl_asn1.c:16
socklen_t
int socklen_t
Definition: getaddrinfo.c:84
RUBY_EXTERN
#define RUBY_EXTERN
Definition: missing.h:67
RUBY_SYMBOL_EXPORT_END
#define RUBY_SYMBOL_EXPORT_END
Definition: missing.h:39
hypot
RUBY_EXTERN double hypot(double, double)
Definition: hypot.c:6
RUBY_SYMBOL_EXPORT_BEGIN
#define RUBY_SYMBOL_EXPORT_BEGIN
Definition: missing.h:38
asinh
RUBY_EXTERN double asinh(double)
Definition: acosh.c:52
strlcpy
RUBY_EXTERN size_t strlcpy(char *, const char *, size_t)
Definition: strlcpy.c:44
strchr
RUBY_EXTERN char * strchr(const char *, int)
Definition: strchr.c:8
bytesequence4_or_float::float_value
float float_value
Definition: missing.h:132
ruby_shutdown
int ruby_shutdown(int s, int how)
Definition: close.c:44
ffs
RUBY_EXTERN int ffs(int)
Definition: ffs.c:6
round
RUBY_EXTERN double round(double)
Definition: numeric.c:92
bytesequence4_or_float
Definition: missing.h:130
ruby_close
int ruby_close(int s)
Definition: close.c:60
strerror
RUBY_EXTERN char * strerror(int)
Definition: strerror.c:11
timespec
Definition: missing.h:50
strlcat
RUBY_EXTERN size_t strlcat(char *, const char *, size_t)
Definition: strlcat.c:46
dup2
RUBY_EXTERN int dup2(int, int)
Definition: dup2.c:27
isnan
RUBY_EXTERN int isnan(double)
Definition: isnan.c:22
timezone
Definition: missing.h:57
setproctitle
RUBY_EXTERN void setproctitle(const char *fmt,...)
Definition: setproctitle.c:135
bytesequence4_or_float::bytesequence
unsigned char bytesequence[4]
Definition: missing.h:131
erf
RUBY_EXTERN double erf(double)
Definition: erf.c:71
timezone::tz_minuteswest
int tz_minuteswest
Definition: missing.h:58