swiftiply 0.6.1.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CONTRIBUTORS +2 -0
- data/README.md +62 -0
- data/bin/{mongrel_rails → evented_mongrel_rails} +6 -14
- data/bin/swiftiplied_mongrel_rails +246 -0
- data/bin/swiftiply +136 -116
- data/bin/swiftiply_mongrel_rails +2 -2
- data/bin/swiftiplyctl +283 -0
- data/cleanup.sh +5 -0
- data/ext/deque/extconf.rb +162 -0
- data/ext/deque/swiftcore/rubymain.cpp +435 -0
- data/ext/fastfilereader/extconf.rb +2 -2
- data/ext/fastfilereader/mapper.cpp +2 -0
- data/ext/map/extconf.rb +161 -0
- data/ext/map/rubymain.cpp +500 -0
- data/ext/splaytree/extconf.rb +161 -0
- data/ext/splaytree/swiftcore/rubymain.cpp +580 -0
- data/ext/splaytree/swiftcore/splay_map.h +635 -0
- data/ext/splaytree/swiftcore/splay_set.h +575 -0
- data/ext/splaytree/swiftcore/splay_tree.h +1127 -0
- data/external/httpclient.rb +231 -0
- data/external/package.rb +13 -13
- data/setup.rb +18 -2
- data/src/swiftcore/Swiftiply.rb +417 -773
- data/src/swiftcore/Swiftiply/backend_protocol.rb +213 -0
- data/src/swiftcore/Swiftiply/cache_base.rb +49 -0
- data/src/swiftcore/Swiftiply/cache_base_mixin.rb +52 -0
- data/src/swiftcore/Swiftiply/cluster_managers/rest_based_cluster_manager.rb +9 -0
- data/src/swiftcore/Swiftiply/cluster_protocol.rb +70 -0
- data/src/swiftcore/Swiftiply/config.rb +370 -0
- data/src/swiftcore/Swiftiply/config/rest_updater.rb +26 -0
- data/src/swiftcore/Swiftiply/constants.rb +101 -0
- data/src/swiftcore/Swiftiply/content_cache_entry.rb +44 -0
- data/src/swiftcore/Swiftiply/content_response.rb +45 -0
- data/src/swiftcore/Swiftiply/control_protocol.rb +49 -0
- data/src/swiftcore/Swiftiply/dynamic_request_cache.rb +41 -0
- data/src/swiftcore/Swiftiply/etag_cache.rb +64 -0
- data/src/swiftcore/Swiftiply/file_cache.rb +46 -0
- data/src/swiftcore/Swiftiply/hash_cache_base.rb +22 -0
- data/src/swiftcore/Swiftiply/http_recognizer.rb +267 -0
- data/src/swiftcore/Swiftiply/loggers/Analogger.rb +21 -0
- data/src/swiftcore/Swiftiply/loggers/stderror.rb +13 -0
- data/src/swiftcore/Swiftiply/mocklog.rb +10 -0
- data/src/swiftcore/Swiftiply/proxy.rb +15 -0
- data/src/swiftcore/Swiftiply/proxy_backends/keepalive.rb +286 -0
- data/src/swiftcore/Swiftiply/proxy_backends/traditional.rb +286 -0
- data/src/swiftcore/Swiftiply/proxy_backends/traditional/redis_directory.rb +87 -0
- data/src/swiftcore/Swiftiply/proxy_backends/traditional/static_directory.rb +69 -0
- data/src/swiftcore/Swiftiply/proxy_bag.rb +716 -0
- data/src/swiftcore/Swiftiply/rest_based_cluster_manager.rb +15 -0
- data/src/swiftcore/Swiftiply/splay_cache_base.rb +21 -0
- data/src/swiftcore/Swiftiply/support_pagecache.rb +6 -3
- data/src/swiftcore/Swiftiply/swiftiply_2_http_proxy.rb +7 -0
- data/src/swiftcore/Swiftiply/swiftiply_client.rb +20 -5
- data/src/swiftcore/Swiftiply/version.rb +5 -0
- data/src/swiftcore/evented_mongrel.rb +26 -8
- data/src/swiftcore/hash.rb +43 -0
- data/src/swiftcore/method_builder.rb +28 -0
- data/src/swiftcore/streamer.rb +46 -0
- data/src/swiftcore/swiftiplied_mongrel.rb +91 -23
- data/src/swiftcore/types.rb +20 -3
- data/swiftiply.gemspec +14 -8
- data/test/TC_Deque.rb +152 -0
- data/test/TC_ProxyBag.rb +147 -166
- data/test/TC_Swiftiply.rb +576 -169
- data/test/TC_Swiftiply/mongrel/evented_hello.rb +1 -1
- data/test/TC_Swiftiply/mongrel/swiftiplied_hello.rb +1 -1
- data/test/TC_Swiftiply/test_serve_static_file_xsendfile/sendfile_client.rb +27 -0
- data/test/TC_Swiftiply/test_ssl/bin/validate_ssl_capability.rb +21 -0
- data/test/TC_Swiftiply/test_ssl/test.cert +16 -0
- data/test/TC_Swiftiply/test_ssl/test.key +15 -0
- data/{bin → test/bin}/echo_client +0 -0
- metadata +136 -94
- data/README +0 -126
- data/ext/swiftiply_parse/parse.rl +0 -90
@@ -0,0 +1,435 @@
|
|
1
|
+
#include <deque>
|
2
|
+
#include <iostream>
|
3
|
+
#include <string>
|
4
|
+
using namespace std;
|
5
|
+
|
6
|
+
#include <ruby.h>
|
7
|
+
|
8
|
+
static VALUE SwiftcoreModule;
|
9
|
+
static VALUE DequeClass;
|
10
|
+
|
11
|
+
|
12
|
+
static void deque_mark (deque<VALUE>* dq)
|
13
|
+
{
|
14
|
+
deque<VALUE>::iterator q_iterator;
|
15
|
+
if (dq) {
|
16
|
+
for ( q_iterator = (*dq).begin(); q_iterator != (*dq).end(); q_iterator++ ) {
|
17
|
+
rb_gc_mark(*q_iterator);
|
18
|
+
}
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
static void deque_free (deque<VALUE>* dq)
|
23
|
+
{
|
24
|
+
if (dq)
|
25
|
+
delete dq;
|
26
|
+
}
|
27
|
+
|
28
|
+
static VALUE deque_new (VALUE self)
|
29
|
+
{
|
30
|
+
deque<VALUE>* dq = new deque<VALUE>;
|
31
|
+
VALUE v = Data_Wrap_Struct (DequeClass, deque_mark, deque_free, dq);
|
32
|
+
return v;
|
33
|
+
}
|
34
|
+
|
35
|
+
static VALUE deque_push_front (VALUE self, VALUE obj)
|
36
|
+
{
|
37
|
+
deque<VALUE>* dq = NULL;
|
38
|
+
Data_Get_Struct (self, deque<VALUE>, dq);
|
39
|
+
if (!dq)
|
40
|
+
rb_raise (rb_eException, "No Deque Object");
|
41
|
+
|
42
|
+
(*dq).push_front(obj);
|
43
|
+
|
44
|
+
return self;
|
45
|
+
}
|
46
|
+
|
47
|
+
static VALUE deque_pop_front (VALUE self)
|
48
|
+
{
|
49
|
+
deque<VALUE>* dq = NULL;
|
50
|
+
Data_Get_Struct(self, deque<VALUE>, dq);
|
51
|
+
if (!dq)
|
52
|
+
rb_raise (rb_eException, "No Deque Object");
|
53
|
+
|
54
|
+
if ((*dq).empty()) {
|
55
|
+
return Qnil;
|
56
|
+
} else {
|
57
|
+
VALUE r = (*dq).front();
|
58
|
+
(*dq).pop_front();
|
59
|
+
return r;
|
60
|
+
}
|
61
|
+
}
|
62
|
+
|
63
|
+
static VALUE deque_push_back (VALUE self, VALUE obj)
|
64
|
+
{
|
65
|
+
deque<VALUE>* dq = NULL;
|
66
|
+
Data_Get_Struct (self, deque<VALUE>, dq);
|
67
|
+
if (!dq)
|
68
|
+
rb_raise (rb_eException, "No Deque Object");
|
69
|
+
|
70
|
+
(*dq).push_back(obj);
|
71
|
+
|
72
|
+
return self;
|
73
|
+
}
|
74
|
+
|
75
|
+
static VALUE deque_pop_back (VALUE self)
|
76
|
+
{
|
77
|
+
deque<VALUE>* dq = NULL;
|
78
|
+
Data_Get_Struct(self, deque<VALUE>, dq);
|
79
|
+
if (!dq)
|
80
|
+
rb_raise (rb_eException, "No Deque Object");
|
81
|
+
|
82
|
+
if ((*dq).empty()) {
|
83
|
+
return Qnil;
|
84
|
+
} else {
|
85
|
+
VALUE r = (*dq).back();
|
86
|
+
(*dq).pop_back();
|
87
|
+
return r;
|
88
|
+
}
|
89
|
+
}
|
90
|
+
|
91
|
+
static VALUE deque_size (VALUE self)
|
92
|
+
{
|
93
|
+
deque<VALUE>* dq = NULL;
|
94
|
+
Data_Get_Struct(self, deque<VALUE>, dq);
|
95
|
+
if (!dq)
|
96
|
+
rb_raise (rb_eException, "No Deque Object");
|
97
|
+
|
98
|
+
return INT2NUM((*dq).size());
|
99
|
+
}
|
100
|
+
|
101
|
+
static VALUE deque_max_size (VALUE self)
|
102
|
+
{
|
103
|
+
deque<VALUE>* dq = NULL;
|
104
|
+
Data_Get_Struct(self, deque<VALUE>, dq);
|
105
|
+
if (!dq)
|
106
|
+
rb_raise (rb_eException, "No Deque Object");
|
107
|
+
|
108
|
+
return INT2NUM((*dq).max_size());
|
109
|
+
}
|
110
|
+
|
111
|
+
static VALUE deque_clear (VALUE self)
|
112
|
+
{
|
113
|
+
deque<VALUE>* dq = NULL;
|
114
|
+
Data_Get_Struct(self, deque<VALUE>, dq);
|
115
|
+
if (!dq)
|
116
|
+
rb_raise (rb_eException, "No Deque Object");
|
117
|
+
|
118
|
+
(*dq).clear();
|
119
|
+
return self;
|
120
|
+
}
|
121
|
+
|
122
|
+
static VALUE deque_empty (VALUE self)
|
123
|
+
{
|
124
|
+
deque<VALUE>* dq = NULL;
|
125
|
+
Data_Get_Struct(self, deque<VALUE>, dq);
|
126
|
+
if (!dq)
|
127
|
+
rb_raise (rb_eException, "No Deque Object");
|
128
|
+
|
129
|
+
if ((*dq).empty()) {
|
130
|
+
return Qtrue;
|
131
|
+
} else {
|
132
|
+
return Qfalse;
|
133
|
+
}
|
134
|
+
}
|
135
|
+
|
136
|
+
static VALUE deque_to_s (VALUE self)
|
137
|
+
{
|
138
|
+
VALUE s = rb_str_new2("");
|
139
|
+
ID to_s = rb_intern("to_s");
|
140
|
+
ID concat = rb_intern("concat");
|
141
|
+
|
142
|
+
deque<VALUE>* dq = NULL;
|
143
|
+
deque<VALUE>::iterator q_iterator;
|
144
|
+
Data_Get_Struct(self, deque<VALUE>, dq);
|
145
|
+
if (!dq)
|
146
|
+
rb_raise (rb_eException, "No Deque Object");
|
147
|
+
|
148
|
+
/*
|
149
|
+
for ( q_iterator = (*dq).begin(); q_iterator != (*dq).end(); q_iterator++ ) {
|
150
|
+
rb_funcall(s,concat,1,rb_funcall(*q_iterator,to_s,0));
|
151
|
+
}
|
152
|
+
*/
|
153
|
+
|
154
|
+
for ( q_iterator = (*dq).begin(); q_iterator != (*dq).end(); q_iterator++ ) {
|
155
|
+
s = rb_str_concat(s,rb_funcall(*q_iterator, to_s, 0));
|
156
|
+
}
|
157
|
+
return rb_str_to_str(s);
|
158
|
+
}
|
159
|
+
|
160
|
+
/*
|
161
|
+
static VALUE deque_join (VALUE self, VALUE delimiter)
|
162
|
+
{
|
163
|
+
VALUE s = rb_str_new2("");
|
164
|
+
ID to_s = rb_intern("to_s");
|
165
|
+
ID concat = rb_intern("concat");
|
166
|
+
|
167
|
+
deque<VALUE>* dq = NULL;
|
168
|
+
deque<VALUE>::iterator q_iterator;
|
169
|
+
Data_Get_Struct(self, deque<VALUE>, dq);
|
170
|
+
if (!dq)
|
171
|
+
rb_raise (rb_eException, "No Deque Object");
|
172
|
+
|
173
|
+
for ( q_iterator = (*dq).begin(); q_iterator != (*dq).end(); q_iterator++ ) {
|
174
|
+
rb_funcall(s,concat,1,rb_funcall(*q_iterator,to_s,0));
|
175
|
+
}
|
176
|
+
|
177
|
+
return rb_str_to_str(s);
|
178
|
+
}
|
179
|
+
*/
|
180
|
+
static VALUE deque_to_a (VALUE self)
|
181
|
+
{
|
182
|
+
VALUE ary = rb_ary_new();
|
183
|
+
ID push = rb_intern("push");
|
184
|
+
|
185
|
+
deque<VALUE>* dq = NULL;
|
186
|
+
deque<VALUE>::iterator q_iterator;
|
187
|
+
Data_Get_Struct(self, deque<VALUE>, dq);
|
188
|
+
if (!dq)
|
189
|
+
rb_raise (rb_eException, "No Deque Object");
|
190
|
+
|
191
|
+
for ( q_iterator = (*dq).begin(); q_iterator != (*dq).end(); q_iterator++ ) {
|
192
|
+
//rb_funcall(ary,push,1,*q_iterator);
|
193
|
+
rb_ary_push(ary,*q_iterator);
|
194
|
+
}
|
195
|
+
|
196
|
+
return ary;
|
197
|
+
}
|
198
|
+
|
199
|
+
static VALUE deque_inspect (VALUE self)
|
200
|
+
{
|
201
|
+
VALUE s = rb_str_new2("[");
|
202
|
+
VALUE comma = rb_str_new2(",");
|
203
|
+
ID inspect = rb_intern("inspect");
|
204
|
+
ID concat = rb_intern("concat");
|
205
|
+
|
206
|
+
deque<VALUE>* dq = NULL;
|
207
|
+
deque<VALUE>::iterator q_iterator;
|
208
|
+
deque<VALUE>::iterator last_q_iterator;
|
209
|
+
Data_Get_Struct(self, deque<VALUE>, dq);
|
210
|
+
if (!dq)
|
211
|
+
rb_raise (rb_eException, "No Deque Object");
|
212
|
+
|
213
|
+
last_q_iterator = (*dq).end();
|
214
|
+
|
215
|
+
for ( q_iterator = (*dq).begin(); q_iterator != last_q_iterator; q_iterator++ ) {
|
216
|
+
// rb_funcall(s,concat,1,rb_funcall(*q_iterator,inspect,0));
|
217
|
+
rb_str_concat(s,rb_funcall(*q_iterator,inspect,0));
|
218
|
+
if (q_iterator != (last_q_iterator - 1))
|
219
|
+
// rb_funcall(s,concat,1,comma);
|
220
|
+
rb_str_concat(s,comma);
|
221
|
+
}
|
222
|
+
// rb_funcall(s,concat,1,rb_str_new2("]"));
|
223
|
+
rb_str_concat(s,rb_str_new2("]"));
|
224
|
+
|
225
|
+
return rb_str_to_str(s);
|
226
|
+
}
|
227
|
+
|
228
|
+
static VALUE deque_first (VALUE self)
|
229
|
+
{
|
230
|
+
deque<VALUE>* dq = NULL;
|
231
|
+
Data_Get_Struct(self, deque<VALUE>, dq);
|
232
|
+
if (!dq)
|
233
|
+
rb_raise (rb_eException, "No Deque Object");
|
234
|
+
|
235
|
+
return (*dq).front();
|
236
|
+
}
|
237
|
+
|
238
|
+
static VALUE deque_last (VALUE self)
|
239
|
+
{
|
240
|
+
deque<VALUE>* dq = NULL;
|
241
|
+
Data_Get_Struct(self, deque<VALUE>, dq);
|
242
|
+
if (!dq)
|
243
|
+
rb_raise (rb_eException, "No Deque Object");
|
244
|
+
|
245
|
+
return (*dq).back();
|
246
|
+
}
|
247
|
+
|
248
|
+
static VALUE deque_replace (VALUE self, VALUE new_dq)
|
249
|
+
{
|
250
|
+
deque<VALUE>* dq = NULL;
|
251
|
+
deque<VALUE>* ndq = NULL;
|
252
|
+
deque<VALUE>::iterator q_iterator;
|
253
|
+
Data_Get_Struct(self, deque<VALUE>, dq);
|
254
|
+
Data_Get_Struct(new_dq, deque<VALUE>, ndq);
|
255
|
+
if (!dq)
|
256
|
+
rb_raise (rb_eException, "No Deque Object");
|
257
|
+
|
258
|
+
if (!ndq)
|
259
|
+
rb_raise (rb_eException, "No Deque object to copy");
|
260
|
+
|
261
|
+
(*dq).clear();
|
262
|
+
for ( q_iterator = (*ndq).begin(); q_iterator != (*ndq).end(); q_iterator++ ) {
|
263
|
+
(*dq).push_back(*q_iterator);
|
264
|
+
}
|
265
|
+
|
266
|
+
return self;
|
267
|
+
}
|
268
|
+
|
269
|
+
static VALUE deque_at (VALUE self, VALUE pos)
|
270
|
+
{
|
271
|
+
deque<VALUE>* dq = NULL;
|
272
|
+
long c_pos = rb_num2long(pos);
|
273
|
+
|
274
|
+
Data_Get_Struct(self, deque<VALUE>, dq);
|
275
|
+
|
276
|
+
if (!dq)
|
277
|
+
rb_raise (rb_eException, "No Deque Object");
|
278
|
+
|
279
|
+
if ((c_pos < 0) || (c_pos >= (*dq).size()))
|
280
|
+
rb_raise (rb_eException, "Out of bounds index on Deque object");
|
281
|
+
|
282
|
+
return *((*dq).begin() + c_pos);
|
283
|
+
}
|
284
|
+
|
285
|
+
static VALUE deque_delete (VALUE self, VALUE obj)
|
286
|
+
{
|
287
|
+
deque<VALUE>* dq = NULL;
|
288
|
+
deque<VALUE>::iterator q_iterator;
|
289
|
+
deque<VALUE>::iterator last_q_iterator;
|
290
|
+
|
291
|
+
Data_Get_Struct(self, deque<VALUE>, dq);
|
292
|
+
|
293
|
+
if (!dq)
|
294
|
+
rb_raise (rb_eException, "No Deque Object");
|
295
|
+
|
296
|
+
last_q_iterator = (*dq).end();
|
297
|
+
for ( q_iterator = (*dq).begin(); q_iterator != last_q_iterator; q_iterator++ ) {
|
298
|
+
if (rb_equal(*q_iterator, obj)) {
|
299
|
+
(*dq).erase(q_iterator);
|
300
|
+
break;
|
301
|
+
}
|
302
|
+
}
|
303
|
+
|
304
|
+
return self;
|
305
|
+
}
|
306
|
+
|
307
|
+
static VALUE deque_delete_at (VALUE self, VALUE pos)
|
308
|
+
{
|
309
|
+
deque<VALUE>* dq = NULL;
|
310
|
+
deque<VALUE>::iterator q_iterator;
|
311
|
+
long c_pos = rb_num2long(pos);
|
312
|
+
|
313
|
+
Data_Get_Struct(self, deque<VALUE>, dq);
|
314
|
+
|
315
|
+
if (!dq)
|
316
|
+
rb_raise (rb_eException, "No Deque Object");
|
317
|
+
|
318
|
+
if ((c_pos < 0) || (c_pos >= (*dq).size()))
|
319
|
+
rb_raise (rb_eException, "Out of bounds index on Deque object");
|
320
|
+
|
321
|
+
q_iterator = (*dq).begin();
|
322
|
+
for ( int n = 0; n < c_pos; n++) {
|
323
|
+
q_iterator++;
|
324
|
+
}
|
325
|
+
(*dq).erase(q_iterator);
|
326
|
+
|
327
|
+
return *q_iterator;
|
328
|
+
}
|
329
|
+
|
330
|
+
static VALUE deque_insert (VALUE self, VALUE pos, VALUE val)
|
331
|
+
{
|
332
|
+
deque<VALUE>* dq = NULL;
|
333
|
+
deque<VALUE>::iterator q_iterator;
|
334
|
+
long c_pos = rb_num2long(pos);
|
335
|
+
|
336
|
+
Data_Get_Struct(self, deque<VALUE>, dq);
|
337
|
+
|
338
|
+
if (!dq)
|
339
|
+
rb_raise (rb_eException, "No Deque Object");
|
340
|
+
|
341
|
+
if ((c_pos < 0) || (c_pos > (*dq).size()))
|
342
|
+
rb_raise (rb_eException, "Out of bounds index on Deque object");
|
343
|
+
|
344
|
+
q_iterator = (*dq).begin() + c_pos;
|
345
|
+
(*dq).insert(q_iterator,val);
|
346
|
+
|
347
|
+
return self;
|
348
|
+
}
|
349
|
+
|
350
|
+
static VALUE deque_assign_at (VALUE self, VALUE pos, VALUE val)
|
351
|
+
{
|
352
|
+
deque_delete(self,pos);
|
353
|
+
deque_insert(self,pos,val);
|
354
|
+
|
355
|
+
return self;
|
356
|
+
}
|
357
|
+
|
358
|
+
static VALUE deque_each (VALUE self)
|
359
|
+
{
|
360
|
+
deque<VALUE>* dq = NULL;
|
361
|
+
deque<VALUE>::iterator q_iterator;
|
362
|
+
deque<VALUE>::iterator last_q_iterator;
|
363
|
+
|
364
|
+
Data_Get_Struct(self, deque<VALUE>, dq);
|
365
|
+
|
366
|
+
if (!dq)
|
367
|
+
rb_raise (rb_eException, "No Deque Object");
|
368
|
+
|
369
|
+
last_q_iterator = (*dq).end();
|
370
|
+
for ( q_iterator = (*dq).begin(); q_iterator != last_q_iterator; q_iterator++ ) {
|
371
|
+
rb_yield(*q_iterator);
|
372
|
+
}
|
373
|
+
|
374
|
+
return self;
|
375
|
+
}
|
376
|
+
|
377
|
+
static VALUE deque_index (VALUE self, VALUE match_obj)
|
378
|
+
{
|
379
|
+
deque<VALUE>* dq = NULL;
|
380
|
+
deque<VALUE>::iterator q_iterator;
|
381
|
+
deque<VALUE>::iterator last_q_iterator;
|
382
|
+
|
383
|
+
Data_Get_Struct(self, deque<VALUE>, dq);
|
384
|
+
if (!dq)
|
385
|
+
rb_raise (rb_eException, "No Deque Object");
|
386
|
+
|
387
|
+
last_q_iterator = (*dq).end();
|
388
|
+
int pos = 0;
|
389
|
+
for ( q_iterator = (*dq).begin(); q_iterator != last_q_iterator; q_iterator++ ) {
|
390
|
+
if (rb_equal(*q_iterator,match_obj) == Qtrue) {
|
391
|
+
return INT2NUM(pos);
|
392
|
+
} else {
|
393
|
+
pos++;
|
394
|
+
}
|
395
|
+
}
|
396
|
+
return Qnil;
|
397
|
+
}
|
398
|
+
|
399
|
+
/**********************
|
400
|
+
Init_deque
|
401
|
+
**********************/
|
402
|
+
|
403
|
+
extern "C" void Init_deque()
|
404
|
+
{
|
405
|
+
SwiftcoreModule = rb_define_module ("Swiftcore");
|
406
|
+
DequeClass = rb_define_class_under (SwiftcoreModule, "Deque", rb_cObject);
|
407
|
+
|
408
|
+
rb_define_module_function (DequeClass, "new", (VALUE(*)(...))deque_new, 0);
|
409
|
+
rb_define_method (DequeClass, "unshift", (VALUE(*)(...))deque_push_front,1);
|
410
|
+
rb_define_method (DequeClass, "shift", (VALUE(*)(...))deque_pop_front,0);
|
411
|
+
rb_define_method (DequeClass, "push", (VALUE(*)(...))deque_push_back,1);
|
412
|
+
rb_define_method (DequeClass, "<<", (VALUE(*)(...))deque_push_back,1);
|
413
|
+
rb_define_method (DequeClass, "pop", (VALUE(*)(...))deque_pop_back,0);
|
414
|
+
rb_define_method (DequeClass, "size", (VALUE(*)(...))deque_size,0);
|
415
|
+
rb_define_method (DequeClass, "length", (VALUE(*)(...))deque_size,0);
|
416
|
+
rb_define_method (DequeClass, "max_size", (VALUE(*)(...))deque_max_size,0);
|
417
|
+
rb_define_method (DequeClass, "clear", (VALUE(*)(...))deque_clear,0);
|
418
|
+
rb_define_method (DequeClass, "empty?", (VALUE(*)(...))deque_empty,0);
|
419
|
+
rb_define_method (DequeClass, "to_s", (VALUE(*)(...))deque_to_s,0);
|
420
|
+
rb_define_method (DequeClass, "to_a", (VALUE(*)(...))deque_to_a,0);
|
421
|
+
rb_define_method (DequeClass, "first", (VALUE(*)(...))deque_first,0);
|
422
|
+
rb_define_method (DequeClass, "last", (VALUE(*)(...))deque_last,0);
|
423
|
+
rb_define_method (DequeClass, "replace", (VALUE(*)(...))deque_replace,1);
|
424
|
+
rb_define_method (DequeClass, "inspect", (VALUE(*)(...))deque_inspect,0);
|
425
|
+
rb_define_method (DequeClass, "at", (VALUE(*)(...))deque_at,1);
|
426
|
+
rb_define_method (DequeClass, "[]", (VALUE(*)(...))deque_at,1);
|
427
|
+
rb_define_method (DequeClass, "delete", (VALUE(*)(...))deque_delete,1);
|
428
|
+
rb_define_method (DequeClass, "delete_at", (VALUE(*)(...))deque_delete_at,1);
|
429
|
+
rb_define_method (DequeClass, "insert", (VALUE(*)(...))deque_insert,2);
|
430
|
+
rb_define_method (DequeClass, "[]=", (VALUE(*)(...))deque_assign_at,2);
|
431
|
+
rb_define_method (DequeClass, "each", (VALUE(*)(...))deque_each,0);
|
432
|
+
rb_define_method (DequeClass, "index", (VALUE(*)(...))deque_index,1);
|
433
|
+
|
434
|
+
rb_include_module (DequeClass, rb_mEnumerable);
|
435
|
+
}
|
@@ -126,8 +126,8 @@ when /linux/
|
|
126
126
|
# You might think modifying CONFIG['LINK_SO'] would be a better way to do this,
|
127
127
|
# but it doesn't work because mkmf doesn't look at CONFIG['LINK_SO'] again after
|
128
128
|
# it initializes.
|
129
|
-
linkso = Object.send :remove_const, "LINK_SO"
|
130
|
-
LINK_SO = linkso + "; strip $@"
|
129
|
+
#linkso = Object.send :remove_const, "LINK_SO"
|
130
|
+
#LINK_SO = linkso + "; strip $@"
|
131
131
|
|
132
132
|
else
|
133
133
|
unless have_library('pthread')
|