rua 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.txt +9 -1
- data/ext/rua.c +52 -1
- data/ext/rua.h +2 -0
- metadata +10 -7
data/README.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
=
|
1
|
+
= Rua
|
2
2
|
|
3
3
|
Copyright (c) 2007 SUGAWARA Genki <sgwr_dts@yahoo.co.jp>
|
4
4
|
|
@@ -6,6 +6,14 @@ Copyright (c) 2007 SUGAWARA Genki <sgwr_dts@yahoo.co.jp>
|
|
6
6
|
|
7
7
|
Rua is a library for using Lua under Ruby.
|
8
8
|
|
9
|
+
== Project Page
|
10
|
+
|
11
|
+
http://rubyforge.org/projects/rua
|
12
|
+
|
13
|
+
== Download
|
14
|
+
|
15
|
+
http://rubyforge.org/frs/?group_id=4845
|
16
|
+
|
9
17
|
== Example
|
10
18
|
|
11
19
|
require 'rua'
|
data/ext/rua.c
CHANGED
@@ -15,7 +15,7 @@ __declspec(dllexport) void Init_rua(void);
|
|
15
15
|
|
16
16
|
#include "rua.h"
|
17
17
|
|
18
|
-
#define VERSION "0.2.
|
18
|
+
#define VERSION "0.2.1"
|
19
19
|
#define REF_RBOBJ "self"
|
20
20
|
|
21
21
|
static const char *insecure_methods[] = {
|
@@ -97,6 +97,8 @@ void Init_rua() {
|
|
97
97
|
rb_define_alloc_func(RuaFunc, rua_func_alloc);
|
98
98
|
rb_define_private_method(RuaFunc, "initialize", rua_func_initialize, 0);
|
99
99
|
rb_define_method(RuaFunc, "call", rua_func_call, -1);
|
100
|
+
//rb_define_method(RuaFunc, "[]", rua_func_get, 1);
|
101
|
+
//rb_define_method(RuaFunc, "[]=", rua_func_set, 2);
|
100
102
|
|
101
103
|
rb_define_alloc_func(RuaThread, rua_thread_alloc);
|
102
104
|
rb_define_private_method(RuaThread, "initialize", rua_thread_initialize, 0);
|
@@ -128,6 +130,9 @@ static void rua_free(struct rua *p) {
|
|
128
130
|
free(p);
|
129
131
|
}
|
130
132
|
|
133
|
+
/*
|
134
|
+
* new Rua instance.
|
135
|
+
*/
|
131
136
|
static VALUE rua_initialize(int argc, VALUE *argv, VALUE self) {
|
132
137
|
struct rua *p;
|
133
138
|
VALUE error_handler;
|
@@ -147,6 +152,10 @@ static VALUE rua_initialize(int argc, VALUE *argv, VALUE self) {
|
|
147
152
|
return Qnil;
|
148
153
|
}
|
149
154
|
|
155
|
+
/*
|
156
|
+
* open libraries.
|
157
|
+
* see http://www.lua.org/manual/5.1/manual.html#5.
|
158
|
+
*/
|
150
159
|
static VALUE rua_openlibs(int argc, VALUE *argv, VALUE self) {
|
151
160
|
struct rua *p;
|
152
161
|
VALUE arg;
|
@@ -196,6 +205,9 @@ static VALUE rua_openlibs(int argc, VALUE *argv, VALUE self) {
|
|
196
205
|
return Qnil;
|
197
206
|
}
|
198
207
|
|
208
|
+
/*
|
209
|
+
* evaluates string.
|
210
|
+
*/
|
199
211
|
static VALUE rua_eval(VALUE self, VALUE str) {
|
200
212
|
struct rua *p;
|
201
213
|
const char *errmsg;
|
@@ -215,6 +227,9 @@ static VALUE rua_eval(VALUE self, VALUE str) {
|
|
215
227
|
return rua_tomultiretval(p->L, pretop, p->R);
|
216
228
|
}
|
217
229
|
|
230
|
+
/*
|
231
|
+
* set global variable.
|
232
|
+
*/
|
218
233
|
static VALUE rua_get(VALUE self, VALUE key) {
|
219
234
|
struct rua *p;
|
220
235
|
VALUE retval;
|
@@ -226,6 +241,9 @@ static VALUE rua_get(VALUE self, VALUE key) {
|
|
226
241
|
return retval;
|
227
242
|
}
|
228
243
|
|
244
|
+
/*
|
245
|
+
* set global variable.
|
246
|
+
*/
|
229
247
|
static VALUE rua_set(VALUE self, VALUE key, VALUE val) {
|
230
248
|
struct rua *p;
|
231
249
|
|
@@ -240,6 +258,9 @@ static VALUE rua_set(VALUE self, VALUE key, VALUE val) {
|
|
240
258
|
return Qnil;
|
241
259
|
}
|
242
260
|
|
261
|
+
/*
|
262
|
+
* get secure flag.
|
263
|
+
*/
|
243
264
|
static VALUE rua_get_secure(VALUE self) {
|
244
265
|
struct rua *p;
|
245
266
|
|
@@ -247,6 +268,9 @@ static VALUE rua_get_secure(VALUE self) {
|
|
247
268
|
return p->R.secure ? Qtrue : Qfalse;
|
248
269
|
}
|
249
270
|
|
271
|
+
/*
|
272
|
+
* set secure flag.
|
273
|
+
*/
|
250
274
|
static VALUE rua_set_secure(VALUE self, VALUE secure) {
|
251
275
|
struct rua *p;
|
252
276
|
|
@@ -263,6 +287,9 @@ static VALUE rua_set_secure(VALUE self, VALUE secure) {
|
|
263
287
|
return Qnil;
|
264
288
|
}
|
265
289
|
|
290
|
+
/*
|
291
|
+
* dispatch Rua#[], Rua#[]=.
|
292
|
+
*/
|
266
293
|
static VALUE rua_method_missing(int argc, VALUE *argv, VALUE self) {
|
267
294
|
const char *name;
|
268
295
|
size_t len;
|
@@ -293,10 +320,16 @@ static VALUE rua_func_alloc(VALUE klass) {
|
|
293
320
|
return Data_Wrap_Struct(klass, 0, -1, p);
|
294
321
|
}
|
295
322
|
|
323
|
+
/*
|
324
|
+
* new RuaFunc instance.
|
325
|
+
*/
|
296
326
|
static VALUE rua_func_initialize(VALUE self) {
|
297
327
|
return Qnil;
|
298
328
|
}
|
299
329
|
|
330
|
+
/*
|
331
|
+
* call Lua function.
|
332
|
+
*/
|
300
333
|
static VALUE rua_func_call(int argc, VALUE *argv, VALUE self) {
|
301
334
|
struct rua_ref *p;
|
302
335
|
int pretop, i;
|
@@ -319,6 +352,18 @@ static VALUE rua_func_call(int argc, VALUE *argv, VALUE self) {
|
|
319
352
|
return rua_tomultiretval(p->L, pretop, p->R);
|
320
353
|
}
|
321
354
|
|
355
|
+
/*
|
356
|
+
* set local variable.
|
357
|
+
*/
|
358
|
+
//static VALUE rua_func_get(VALUE self, VALUE key) {
|
359
|
+
//}
|
360
|
+
|
361
|
+
/*
|
362
|
+
* set local variable.
|
363
|
+
*/
|
364
|
+
//static VALUE rua_func_set(VALUE self, VALUE key, VALUE val) {
|
365
|
+
//}
|
366
|
+
|
322
367
|
// ------------------------------------------------------------------
|
323
368
|
|
324
369
|
static VALUE rua_thread_alloc(VALUE klass) {
|
@@ -327,10 +372,16 @@ static VALUE rua_thread_alloc(VALUE klass) {
|
|
327
372
|
return Data_Wrap_Struct(klass, 0, -1, p);
|
328
373
|
}
|
329
374
|
|
375
|
+
/*
|
376
|
+
* new RuaThread instance.
|
377
|
+
*/
|
330
378
|
static VALUE rua_thread_initialize(VALUE self) {
|
331
379
|
return Qnil;
|
332
380
|
}
|
333
381
|
|
382
|
+
/*
|
383
|
+
* resume Lua coroutine.
|
384
|
+
*/
|
334
385
|
static VALUE rua_thread_resume(int argc, VALUE *argv, VALUE self) {
|
335
386
|
struct rua_ref *p;
|
336
387
|
VALUE retval;
|
data/ext/rua.h
CHANGED
@@ -32,6 +32,8 @@ static VALUE rua_method_missing(int argc, VALUE *argv, VALUE self);
|
|
32
32
|
static VALUE rua_func_alloc(VALUE klass);
|
33
33
|
static VALUE rua_func_initialize(VALUE self);
|
34
34
|
static VALUE rua_func_call(int argc, VALUE *argv, VALUE self);
|
35
|
+
//static VALUE rua_func_get(VALUE self, VALUE key);
|
36
|
+
//static VALUE rua_func_set(VALUE self, VALUE key, VALUE val);
|
35
37
|
|
36
38
|
static VALUE rua_thread_alloc(VALUE klass);
|
37
39
|
static VALUE rua_thread_initialize(VALUE self);
|
metadata
CHANGED
@@ -3,9 +3,9 @@ rubygems_version: 0.9.2
|
|
3
3
|
specification_version: 1
|
4
4
|
name: rua
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.2.
|
6
|
+
version: 0.2.1
|
7
7
|
date: 2007-11-18 00:00:00 +09:00
|
8
|
-
summary:
|
8
|
+
summary: Rua is a library for using Lua under Ruby.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
11
11
|
email: sgwr_dts@yahoo.co.jp
|
@@ -15,7 +15,7 @@ description:
|
|
15
15
|
autorequire:
|
16
16
|
default_executable:
|
17
17
|
bindir: bin
|
18
|
-
has_rdoc:
|
18
|
+
has_rdoc: true
|
19
19
|
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
20
|
requirements:
|
21
21
|
- - ">"
|
@@ -35,10 +35,13 @@ files:
|
|
35
35
|
- ext/extconf.rb
|
36
36
|
test_files: []
|
37
37
|
|
38
|
-
rdoc_options:
|
39
|
-
|
40
|
-
|
41
|
-
|
38
|
+
rdoc_options:
|
39
|
+
- --title
|
40
|
+
- Rua - RDoc Documentation
|
41
|
+
extra_rdoc_files:
|
42
|
+
- README.txt
|
43
|
+
- ext/rua.c
|
44
|
+
- ext/rua.h
|
42
45
|
executables: []
|
43
46
|
|
44
47
|
extensions:
|