Ruby
2.1.3p242(2014-09-19revision47630)
Main Page
Modules
Data Structures
Files
File List
Globals
include
ruby
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 */
245
Generated on Mon Sep 22 2014 11:05:32 for Ruby by
1.8.2