ruby-dcl 1.6.3.1 → 1.7.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.
- data/.gitignore +17 -0
- data/ChangeLog +57 -1
- data/Gemfile +4 -0
- data/GenWrapper/Makefile +1 -0
- data/GenWrapper/dcl_rb_heading +2 -8
- data/GenWrapper/elim_ary_size.rb +1 -1
- data/GenWrapper/proto/Makefile +17 -16
- data/GenWrapper/proto/grph1_sgpack.fp +367 -1
- data/GenWrapper/proto/grph1_stpack.fp +45 -1
- data/GenWrapper/proto/grph1_swpack.fp +70 -1
- data/GenWrapper/proto/grph2_uipack.fp +508 -0
- data/GenWrapper/proto/math1_clsplib.fp +74 -0
- data/GenWrapper/proto/misc1_randlib.fp +15 -1
- data/README.md +29 -0
- data/Rakefile +18 -38
- data/dcl_narrayed_funcs.c +23 -22
- data/dcl_rubydcloriginal.c +21 -21
- data/demo/grph2/uipack/uipk01.rb +38 -0
- data/demo/grph2/uipack/uipk02.rb +48 -0
- data/demo/grph2/umpack/test09_2.rb +89 -0
- data/demo/math1/clsplib/cslb01.rb +55 -0
- data/extconf.rb +16 -48
- data/grph1_sgpack.c +1166 -0
- data/grph1_stpack.c +141 -0
- data/grph1_swpack.c +182 -0
- data/grph2_uipack.c +1456 -0
- data/init.c.default +8 -0
- data/lib/.keepme +0 -0
- data/lib/dcl/dcl.rb +5578 -0
- data/lib/dcl/version.rb +3 -0
- data/lib/dcl.rb +2 -5084
- data/math1_clsplib.c +329 -0
- data/misc1_randlib.c +37 -0
- data/ruby-dcl.gemspec +30 -0
- metadata +343 -352
- data/GenWrapper/etc/Mk_proto +0 -375
- data/GenWrapper/etc/dcl_gen +0 -13
- data/GenWrapper/etc/p_init +0 -410
- data/GenWrapper/proto/math2_shtlib.fp_old +0 -1294
- data/README_old +0 -79
- data/dummy.c +0 -9
- data/grph1_zgpack.c.org +0 -141
- data/init.c.gtk +0 -189
data/grph2_uipack.c
ADDED
@@ -0,0 +1,1456 @@
|
|
1
|
+
/*
|
2
|
+
* $Id: p_header,v 1.2 2011-02-23 17:47:10 koshiro Exp $
|
3
|
+
*/
|
4
|
+
|
5
|
+
#include <stdio.h>
|
6
|
+
#include "ruby.h"
|
7
|
+
#include "libtinyf2c.h"
|
8
|
+
#include "narray.h"
|
9
|
+
|
10
|
+
/* for compatibility with ruby 1.6 */
|
11
|
+
#ifndef StringValuePtr
|
12
|
+
#define StringValuePtr(s) STR2CSTR(s)
|
13
|
+
#endif
|
14
|
+
|
15
|
+
#define DFLT_SIZE 32
|
16
|
+
|
17
|
+
extern char *dcl_obj2ccharary(VALUE, int, int);
|
18
|
+
extern integer *dcl_obj2cintegerary(VALUE);
|
19
|
+
extern real *dcl_obj2crealary(VALUE);
|
20
|
+
extern complex *dcl_obj2ccomplexary(VALUE);
|
21
|
+
extern logical *dcl_obj2clogicalary(VALUE);
|
22
|
+
|
23
|
+
extern VALUE dcl_ccharary2obj(char *, int, int);
|
24
|
+
extern VALUE dcl_cintegerary2obj(integer *, int, int, int *);
|
25
|
+
extern VALUE dcl_crealary2obj(real *, int, int, int *);
|
26
|
+
extern VALUE dcl_ccomplexary2obj(complex *, int, char *);
|
27
|
+
extern VALUE dcl_clogicalary2obj(logical *, int, int, int *);
|
28
|
+
|
29
|
+
extern void dcl_freeccharary(char *);
|
30
|
+
extern void dcl_freecintegerary(integer *);
|
31
|
+
extern void dcl_freecrealary(real *);
|
32
|
+
extern void dcl_freeccomplexary(complex *);
|
33
|
+
extern void dcl_freeclogicalary(logical *);
|
34
|
+
|
35
|
+
/* for functions which return real */
|
36
|
+
/* fnclib */
|
37
|
+
extern real rd2r_(real *);
|
38
|
+
extern real rr2d_(real *);
|
39
|
+
extern real rexp_(real *, integer *, integer *);
|
40
|
+
extern real rfpi_(void);
|
41
|
+
extern real rmod_(real *, real *);
|
42
|
+
/* gnmlib */
|
43
|
+
extern real rgnlt_(real *);
|
44
|
+
extern real rgnle_(real *);
|
45
|
+
extern real rgngt_(real *);
|
46
|
+
extern real rgnge_(real *);
|
47
|
+
/* rfalib */
|
48
|
+
extern real rmax_(real *, integer *, integer *);
|
49
|
+
extern real rmin_(real *, integer *, integer *);
|
50
|
+
extern real rsum_(real *, integer *, integer *);
|
51
|
+
extern real rave_(real *, integer *, integer *);
|
52
|
+
extern real rvar_(real *, integer *, integer *);
|
53
|
+
extern real rstd_(real *, integer *, integer *);
|
54
|
+
extern real rrms_(real *, integer *, integer *);
|
55
|
+
extern real ramp_(real *, integer *, integer *);
|
56
|
+
/* rfblib */
|
57
|
+
extern real rprd_(real *, real *, integer *, integer *, integer *);
|
58
|
+
extern real rcov_(real *, real *, integer *, integer *, integer *);
|
59
|
+
extern real rcor_(real *, real *, integer *, integer *, integer *);
|
60
|
+
|
61
|
+
|
62
|
+
extern VALUE mDCL;
|
63
|
+
|
64
|
+
#if DCLVER >= 544
|
65
|
+
|
66
|
+
static VALUE
|
67
|
+
dcl_uipdat(obj, z, mx, nx, ny)
|
68
|
+
VALUE obj, z, mx, nx, ny;
|
69
|
+
{
|
70
|
+
real *i_z;
|
71
|
+
integer i_mx;
|
72
|
+
integer i_nx;
|
73
|
+
integer i_ny;
|
74
|
+
|
75
|
+
if (TYPE(z) == T_FLOAT) {
|
76
|
+
z = rb_Array(z);
|
77
|
+
}
|
78
|
+
/* if ((TYPE(z) != T_ARRAY) &&
|
79
|
+
(rb_obj_is_kind_of(z, cNArray) != Qtrue)) {
|
80
|
+
rb_raise(rb_eTypeError, "invalid type");
|
81
|
+
} -- no check since obj2c*ary will do that */
|
82
|
+
if ((TYPE(mx) != T_BIGNUM) || (TYPE(mx) != T_FIXNUM)) {
|
83
|
+
mx = rb_funcall(mx, rb_intern("to_i"), 0);
|
84
|
+
}
|
85
|
+
if ((TYPE(nx) != T_BIGNUM) || (TYPE(nx) != T_FIXNUM)) {
|
86
|
+
nx = rb_funcall(nx, rb_intern("to_i"), 0);
|
87
|
+
}
|
88
|
+
if ((TYPE(ny) != T_BIGNUM) || (TYPE(ny) != T_FIXNUM)) {
|
89
|
+
ny = rb_funcall(ny, rb_intern("to_i"), 0);
|
90
|
+
}
|
91
|
+
|
92
|
+
i_mx = NUM2INT(mx);
|
93
|
+
i_nx = NUM2INT(nx);
|
94
|
+
i_ny = NUM2INT(ny);
|
95
|
+
i_z = dcl_obj2crealary(z);
|
96
|
+
|
97
|
+
|
98
|
+
uipdat_(i_z, &i_mx, &i_nx, &i_ny);
|
99
|
+
|
100
|
+
dcl_freecrealary(i_z);
|
101
|
+
|
102
|
+
return Qnil;
|
103
|
+
|
104
|
+
}
|
105
|
+
|
106
|
+
static VALUE
|
107
|
+
dcl_uipda2(obj, u, v, mx, nx, ny)
|
108
|
+
VALUE obj, u, v, mx, nx, ny;
|
109
|
+
{
|
110
|
+
real *i_u;
|
111
|
+
real *i_v;
|
112
|
+
integer i_mx;
|
113
|
+
integer i_nx;
|
114
|
+
integer i_ny;
|
115
|
+
|
116
|
+
if (TYPE(u) == T_FLOAT) {
|
117
|
+
u = rb_Array(u);
|
118
|
+
}
|
119
|
+
/* if ((TYPE(u) != T_ARRAY) &&
|
120
|
+
(rb_obj_is_kind_of(u, cNArray) != Qtrue)) {
|
121
|
+
rb_raise(rb_eTypeError, "invalid type");
|
122
|
+
} -- no check since obj2c*ary will do that */
|
123
|
+
if (TYPE(v) == T_FLOAT) {
|
124
|
+
v = rb_Array(v);
|
125
|
+
}
|
126
|
+
/* if ((TYPE(v) != T_ARRAY) &&
|
127
|
+
(rb_obj_is_kind_of(v, cNArray) != Qtrue)) {
|
128
|
+
rb_raise(rb_eTypeError, "invalid type");
|
129
|
+
} -- no check since obj2c*ary will do that */
|
130
|
+
if ((TYPE(mx) != T_BIGNUM) || (TYPE(mx) != T_FIXNUM)) {
|
131
|
+
mx = rb_funcall(mx, rb_intern("to_i"), 0);
|
132
|
+
}
|
133
|
+
if ((TYPE(nx) != T_BIGNUM) || (TYPE(nx) != T_FIXNUM)) {
|
134
|
+
nx = rb_funcall(nx, rb_intern("to_i"), 0);
|
135
|
+
}
|
136
|
+
if ((TYPE(ny) != T_BIGNUM) || (TYPE(ny) != T_FIXNUM)) {
|
137
|
+
ny = rb_funcall(ny, rb_intern("to_i"), 0);
|
138
|
+
}
|
139
|
+
|
140
|
+
i_mx = NUM2INT(mx);
|
141
|
+
i_nx = NUM2INT(nx);
|
142
|
+
i_ny = NUM2INT(ny);
|
143
|
+
i_u = dcl_obj2crealary(u);
|
144
|
+
i_v = dcl_obj2crealary(v);
|
145
|
+
|
146
|
+
|
147
|
+
uipda2_(i_u, i_v, &i_mx, &i_nx, &i_ny);
|
148
|
+
|
149
|
+
dcl_freecrealary(i_u);
|
150
|
+
dcl_freecrealary(i_v);
|
151
|
+
|
152
|
+
return Qnil;
|
153
|
+
|
154
|
+
}
|
155
|
+
|
156
|
+
static VALUE
|
157
|
+
dcl_uipda3(obj, u, v, w, mx, nx, ny)
|
158
|
+
VALUE obj, u, v, w, mx, nx, ny;
|
159
|
+
{
|
160
|
+
real *i_u;
|
161
|
+
real *i_v;
|
162
|
+
real *i_w;
|
163
|
+
integer i_mx;
|
164
|
+
integer i_nx;
|
165
|
+
integer i_ny;
|
166
|
+
|
167
|
+
if (TYPE(u) == T_FLOAT) {
|
168
|
+
u = rb_Array(u);
|
169
|
+
}
|
170
|
+
/* if ((TYPE(u) != T_ARRAY) &&
|
171
|
+
(rb_obj_is_kind_of(u, cNArray) != Qtrue)) {
|
172
|
+
rb_raise(rb_eTypeError, "invalid type");
|
173
|
+
} -- no check since obj2c*ary will do that */
|
174
|
+
if (TYPE(v) == T_FLOAT) {
|
175
|
+
v = rb_Array(v);
|
176
|
+
}
|
177
|
+
/* if ((TYPE(v) != T_ARRAY) &&
|
178
|
+
(rb_obj_is_kind_of(v, cNArray) != Qtrue)) {
|
179
|
+
rb_raise(rb_eTypeError, "invalid type");
|
180
|
+
} -- no check since obj2c*ary will do that */
|
181
|
+
if (TYPE(w) == T_FLOAT) {
|
182
|
+
w = rb_Array(w);
|
183
|
+
}
|
184
|
+
/* if ((TYPE(w) != T_ARRAY) &&
|
185
|
+
(rb_obj_is_kind_of(w, cNArray) != Qtrue)) {
|
186
|
+
rb_raise(rb_eTypeError, "invalid type");
|
187
|
+
} -- no check since obj2c*ary will do that */
|
188
|
+
if ((TYPE(mx) != T_BIGNUM) || (TYPE(mx) != T_FIXNUM)) {
|
189
|
+
mx = rb_funcall(mx, rb_intern("to_i"), 0);
|
190
|
+
}
|
191
|
+
if ((TYPE(nx) != T_BIGNUM) || (TYPE(nx) != T_FIXNUM)) {
|
192
|
+
nx = rb_funcall(nx, rb_intern("to_i"), 0);
|
193
|
+
}
|
194
|
+
if ((TYPE(ny) != T_BIGNUM) || (TYPE(ny) != T_FIXNUM)) {
|
195
|
+
ny = rb_funcall(ny, rb_intern("to_i"), 0);
|
196
|
+
}
|
197
|
+
|
198
|
+
i_mx = NUM2INT(mx);
|
199
|
+
i_nx = NUM2INT(nx);
|
200
|
+
i_ny = NUM2INT(ny);
|
201
|
+
i_u = dcl_obj2crealary(u);
|
202
|
+
i_v = dcl_obj2crealary(v);
|
203
|
+
i_w = dcl_obj2crealary(w);
|
204
|
+
|
205
|
+
|
206
|
+
uipda3_(i_u, i_v, i_w, &i_mx, &i_nx, &i_ny);
|
207
|
+
|
208
|
+
dcl_freecrealary(i_u);
|
209
|
+
dcl_freecrealary(i_v);
|
210
|
+
dcl_freecrealary(i_w);
|
211
|
+
|
212
|
+
return Qnil;
|
213
|
+
|
214
|
+
}
|
215
|
+
|
216
|
+
static VALUE
|
217
|
+
dcl_uiscrg(obj, zmin, zmax)
|
218
|
+
VALUE obj, zmin, zmax;
|
219
|
+
{
|
220
|
+
real i_zmin;
|
221
|
+
real i_zmax;
|
222
|
+
|
223
|
+
if (TYPE(zmin) != T_FLOAT) {
|
224
|
+
zmin = rb_funcall(zmin, rb_intern("to_f"), 0);
|
225
|
+
}
|
226
|
+
if (TYPE(zmax) != T_FLOAT) {
|
227
|
+
zmax = rb_funcall(zmax, rb_intern("to_f"), 0);
|
228
|
+
}
|
229
|
+
|
230
|
+
i_zmin = (real)NUM2DBL(zmin);
|
231
|
+
i_zmax = (real)NUM2DBL(zmax);
|
232
|
+
|
233
|
+
|
234
|
+
uiscrg_(&i_zmin, &i_zmax);
|
235
|
+
|
236
|
+
return Qnil;
|
237
|
+
|
238
|
+
}
|
239
|
+
|
240
|
+
static VALUE
|
241
|
+
dcl_uismrg(obj, zmin, zmax)
|
242
|
+
VALUE obj, zmin, zmax;
|
243
|
+
{
|
244
|
+
real i_zmin;
|
245
|
+
real i_zmax;
|
246
|
+
|
247
|
+
if (TYPE(zmin) != T_FLOAT) {
|
248
|
+
zmin = rb_funcall(zmin, rb_intern("to_f"), 0);
|
249
|
+
}
|
250
|
+
if (TYPE(zmax) != T_FLOAT) {
|
251
|
+
zmax = rb_funcall(zmax, rb_intern("to_f"), 0);
|
252
|
+
}
|
253
|
+
|
254
|
+
i_zmin = (real)NUM2DBL(zmin);
|
255
|
+
i_zmax = (real)NUM2DBL(zmax);
|
256
|
+
|
257
|
+
|
258
|
+
uismrg_(&i_zmin, &i_zmax);
|
259
|
+
|
260
|
+
return Qnil;
|
261
|
+
|
262
|
+
}
|
263
|
+
|
264
|
+
static VALUE
|
265
|
+
dcl_uiscsq(obj, clrlvl, icolor, n)
|
266
|
+
VALUE obj, clrlvl, icolor, n;
|
267
|
+
{
|
268
|
+
real *i_clrlvl;
|
269
|
+
integer *i_icolor;
|
270
|
+
integer i_n;
|
271
|
+
|
272
|
+
if (TYPE(clrlvl) == T_FLOAT) {
|
273
|
+
clrlvl = rb_Array(clrlvl);
|
274
|
+
}
|
275
|
+
/* if ((TYPE(clrlvl) != T_ARRAY) &&
|
276
|
+
(rb_obj_is_kind_of(clrlvl, cNArray) != Qtrue)) {
|
277
|
+
rb_raise(rb_eTypeError, "invalid type");
|
278
|
+
} -- no check since obj2c*ary will do that */
|
279
|
+
if ((TYPE(icolor) == T_BIGNUM) || (TYPE(icolor) == T_FIXNUM)) {
|
280
|
+
icolor = rb_Array(icolor);
|
281
|
+
}
|
282
|
+
/* if ((TYPE(icolor) != T_ARRAY) &&
|
283
|
+
(rb_obj_is_kind_of(icolor, cNArray) != Qtrue)) {
|
284
|
+
rb_raise(rb_eTypeError, "invalid type");
|
285
|
+
} -- no check since obj2c*ary will do that */
|
286
|
+
if ((TYPE(n) != T_BIGNUM) || (TYPE(n) != T_FIXNUM)) {
|
287
|
+
n = rb_funcall(n, rb_intern("to_i"), 0);
|
288
|
+
}
|
289
|
+
|
290
|
+
i_n = NUM2INT(n);
|
291
|
+
i_clrlvl = dcl_obj2crealary(clrlvl);
|
292
|
+
i_icolor = dcl_obj2cintegerary(icolor);
|
293
|
+
|
294
|
+
|
295
|
+
uiscsq_(i_clrlvl, i_icolor, &i_n);
|
296
|
+
|
297
|
+
dcl_freecrealary(i_clrlvl);
|
298
|
+
dcl_freecintegerary(i_icolor);
|
299
|
+
|
300
|
+
return Qnil;
|
301
|
+
|
302
|
+
}
|
303
|
+
|
304
|
+
static VALUE
|
305
|
+
dcl_uiscfl(obj, cdsn)
|
306
|
+
VALUE obj, cdsn;
|
307
|
+
{
|
308
|
+
char *i_cdsn;
|
309
|
+
|
310
|
+
if (TYPE(cdsn) != T_STRING) {
|
311
|
+
cdsn = rb_funcall(cdsn, rb_intern("to_str"), 0);
|
312
|
+
}
|
313
|
+
|
314
|
+
i_cdsn = StringValuePtr(cdsn);
|
315
|
+
|
316
|
+
|
317
|
+
uiscfl_(i_cdsn, (ftnlen)strlen(i_cdsn));
|
318
|
+
|
319
|
+
return Qnil;
|
320
|
+
|
321
|
+
}
|
322
|
+
|
323
|
+
static VALUE
|
324
|
+
dcl_uismsq(obj, shdlvl, shade, n)
|
325
|
+
VALUE obj, shdlvl, shade, n;
|
326
|
+
{
|
327
|
+
real *i_shdlvl;
|
328
|
+
integer *i_shade;
|
329
|
+
integer i_n;
|
330
|
+
|
331
|
+
if (TYPE(shdlvl) == T_FLOAT) {
|
332
|
+
shdlvl = rb_Array(shdlvl);
|
333
|
+
}
|
334
|
+
/* if ((TYPE(shdlvl) != T_ARRAY) &&
|
335
|
+
(rb_obj_is_kind_of(shdlvl, cNArray) != Qtrue)) {
|
336
|
+
rb_raise(rb_eTypeError, "invalid type");
|
337
|
+
} -- no check since obj2c*ary will do that */
|
338
|
+
if ((TYPE(shade) == T_BIGNUM) || (TYPE(shade) == T_FIXNUM)) {
|
339
|
+
shade = rb_Array(shade);
|
340
|
+
}
|
341
|
+
/* if ((TYPE(shade) != T_ARRAY) &&
|
342
|
+
(rb_obj_is_kind_of(shade, cNArray) != Qtrue)) {
|
343
|
+
rb_raise(rb_eTypeError, "invalid type");
|
344
|
+
} -- no check since obj2c*ary will do that */
|
345
|
+
if ((TYPE(n) != T_BIGNUM) || (TYPE(n) != T_FIXNUM)) {
|
346
|
+
n = rb_funcall(n, rb_intern("to_i"), 0);
|
347
|
+
}
|
348
|
+
|
349
|
+
i_n = NUM2INT(n);
|
350
|
+
i_shdlvl = dcl_obj2crealary(shdlvl);
|
351
|
+
i_shade = dcl_obj2cintegerary(shade);
|
352
|
+
|
353
|
+
|
354
|
+
uismsq_(i_shdlvl, i_shade, &i_n);
|
355
|
+
|
356
|
+
dcl_freecrealary(i_shdlvl);
|
357
|
+
dcl_freecintegerary(i_shade);
|
358
|
+
|
359
|
+
return Qnil;
|
360
|
+
|
361
|
+
}
|
362
|
+
|
363
|
+
static VALUE
|
364
|
+
dcl_uismfl(obj, cdsn)
|
365
|
+
VALUE obj, cdsn;
|
366
|
+
{
|
367
|
+
char *i_cdsn;
|
368
|
+
|
369
|
+
if (TYPE(cdsn) != T_STRING) {
|
370
|
+
cdsn = rb_funcall(cdsn, rb_intern("to_str"), 0);
|
371
|
+
}
|
372
|
+
|
373
|
+
i_cdsn = StringValuePtr(cdsn);
|
374
|
+
|
375
|
+
|
376
|
+
uismfl_(i_cdsn, (ftnlen)strlen(i_cdsn));
|
377
|
+
|
378
|
+
return Qnil;
|
379
|
+
|
380
|
+
}
|
381
|
+
|
382
|
+
static VALUE
|
383
|
+
dcl_uixbar(obj, xmin, xmax, ymin, ymax, zmin, zmax, cpos)
|
384
|
+
VALUE obj, xmin, xmax, ymin, ymax, zmin, zmax, cpos;
|
385
|
+
{
|
386
|
+
real i_xmin;
|
387
|
+
real i_xmax;
|
388
|
+
real i_ymin;
|
389
|
+
real i_ymax;
|
390
|
+
real i_zmin;
|
391
|
+
real i_zmax;
|
392
|
+
char *i_cpos;
|
393
|
+
|
394
|
+
if (TYPE(xmin) != T_FLOAT) {
|
395
|
+
xmin = rb_funcall(xmin, rb_intern("to_f"), 0);
|
396
|
+
}
|
397
|
+
if (TYPE(xmax) != T_FLOAT) {
|
398
|
+
xmax = rb_funcall(xmax, rb_intern("to_f"), 0);
|
399
|
+
}
|
400
|
+
if (TYPE(ymin) != T_FLOAT) {
|
401
|
+
ymin = rb_funcall(ymin, rb_intern("to_f"), 0);
|
402
|
+
}
|
403
|
+
if (TYPE(ymax) != T_FLOAT) {
|
404
|
+
ymax = rb_funcall(ymax, rb_intern("to_f"), 0);
|
405
|
+
}
|
406
|
+
if (TYPE(zmin) != T_FLOAT) {
|
407
|
+
zmin = rb_funcall(zmin, rb_intern("to_f"), 0);
|
408
|
+
}
|
409
|
+
if (TYPE(zmax) != T_FLOAT) {
|
410
|
+
zmax = rb_funcall(zmax, rb_intern("to_f"), 0);
|
411
|
+
}
|
412
|
+
if (TYPE(cpos) != T_STRING) {
|
413
|
+
cpos = rb_funcall(cpos, rb_intern("to_str"), 0);
|
414
|
+
}
|
415
|
+
|
416
|
+
i_xmin = (real)NUM2DBL(xmin);
|
417
|
+
i_xmax = (real)NUM2DBL(xmax);
|
418
|
+
i_ymin = (real)NUM2DBL(ymin);
|
419
|
+
i_ymax = (real)NUM2DBL(ymax);
|
420
|
+
i_zmin = (real)NUM2DBL(zmin);
|
421
|
+
i_zmax = (real)NUM2DBL(zmax);
|
422
|
+
i_cpos = StringValuePtr(cpos);
|
423
|
+
|
424
|
+
|
425
|
+
uixbar_(&i_xmin, &i_xmax, &i_ymin, &i_ymax, &i_zmin, &i_zmax, i_cpos, (ftnlen)strlen(i_cpos));
|
426
|
+
|
427
|
+
return Qnil;
|
428
|
+
|
429
|
+
}
|
430
|
+
|
431
|
+
static VALUE
|
432
|
+
dcl_uiybar(obj, xmin, xmax, ymin, ymax, zmin, zmax, cpos)
|
433
|
+
VALUE obj, xmin, xmax, ymin, ymax, zmin, zmax, cpos;
|
434
|
+
{
|
435
|
+
real i_xmin;
|
436
|
+
real i_xmax;
|
437
|
+
real i_ymin;
|
438
|
+
real i_ymax;
|
439
|
+
real i_zmin;
|
440
|
+
real i_zmax;
|
441
|
+
char *i_cpos;
|
442
|
+
|
443
|
+
if (TYPE(xmin) != T_FLOAT) {
|
444
|
+
xmin = rb_funcall(xmin, rb_intern("to_f"), 0);
|
445
|
+
}
|
446
|
+
if (TYPE(xmax) != T_FLOAT) {
|
447
|
+
xmax = rb_funcall(xmax, rb_intern("to_f"), 0);
|
448
|
+
}
|
449
|
+
if (TYPE(ymin) != T_FLOAT) {
|
450
|
+
ymin = rb_funcall(ymin, rb_intern("to_f"), 0);
|
451
|
+
}
|
452
|
+
if (TYPE(ymax) != T_FLOAT) {
|
453
|
+
ymax = rb_funcall(ymax, rb_intern("to_f"), 0);
|
454
|
+
}
|
455
|
+
if (TYPE(zmin) != T_FLOAT) {
|
456
|
+
zmin = rb_funcall(zmin, rb_intern("to_f"), 0);
|
457
|
+
}
|
458
|
+
if (TYPE(zmax) != T_FLOAT) {
|
459
|
+
zmax = rb_funcall(zmax, rb_intern("to_f"), 0);
|
460
|
+
}
|
461
|
+
if (TYPE(cpos) != T_STRING) {
|
462
|
+
cpos = rb_funcall(cpos, rb_intern("to_str"), 0);
|
463
|
+
}
|
464
|
+
|
465
|
+
i_xmin = (real)NUM2DBL(xmin);
|
466
|
+
i_xmax = (real)NUM2DBL(xmax);
|
467
|
+
i_ymin = (real)NUM2DBL(ymin);
|
468
|
+
i_ymax = (real)NUM2DBL(ymax);
|
469
|
+
i_zmin = (real)NUM2DBL(zmin);
|
470
|
+
i_zmax = (real)NUM2DBL(zmax);
|
471
|
+
i_cpos = StringValuePtr(cpos);
|
472
|
+
|
473
|
+
|
474
|
+
uiybar_(&i_xmin, &i_xmax, &i_ymin, &i_ymax, &i_zmin, &i_zmax, i_cpos, (ftnlen)strlen(i_cpos));
|
475
|
+
|
476
|
+
return Qnil;
|
477
|
+
|
478
|
+
}
|
479
|
+
|
480
|
+
static VALUE
|
481
|
+
dcl_uiscr2(obj, umin, umax, vmin, vmax)
|
482
|
+
VALUE obj, umin, umax, vmin, vmax;
|
483
|
+
{
|
484
|
+
real i_umin;
|
485
|
+
real i_umax;
|
486
|
+
real i_vmin;
|
487
|
+
real i_vmax;
|
488
|
+
|
489
|
+
if (TYPE(umin) != T_FLOAT) {
|
490
|
+
umin = rb_funcall(umin, rb_intern("to_f"), 0);
|
491
|
+
}
|
492
|
+
if (TYPE(umax) != T_FLOAT) {
|
493
|
+
umax = rb_funcall(umax, rb_intern("to_f"), 0);
|
494
|
+
}
|
495
|
+
if (TYPE(vmin) != T_FLOAT) {
|
496
|
+
vmin = rb_funcall(vmin, rb_intern("to_f"), 0);
|
497
|
+
}
|
498
|
+
if (TYPE(vmax) != T_FLOAT) {
|
499
|
+
vmax = rb_funcall(vmax, rb_intern("to_f"), 0);
|
500
|
+
}
|
501
|
+
|
502
|
+
i_umin = (real)NUM2DBL(umin);
|
503
|
+
i_umax = (real)NUM2DBL(umax);
|
504
|
+
i_vmin = (real)NUM2DBL(vmin);
|
505
|
+
i_vmax = (real)NUM2DBL(vmax);
|
506
|
+
|
507
|
+
|
508
|
+
uiscr2_(&i_umin, &i_umax, &i_vmin, &i_vmax);
|
509
|
+
|
510
|
+
return Qnil;
|
511
|
+
|
512
|
+
}
|
513
|
+
|
514
|
+
static VALUE
|
515
|
+
dcl_uiqcr2(obj)
|
516
|
+
VALUE obj;
|
517
|
+
{
|
518
|
+
real o_umin;
|
519
|
+
real o_umax;
|
520
|
+
real o_vmin;
|
521
|
+
real o_vmax;
|
522
|
+
VALUE umin;
|
523
|
+
VALUE umax;
|
524
|
+
VALUE vmin;
|
525
|
+
VALUE vmax;
|
526
|
+
|
527
|
+
uiqcr2_(&o_umin, &o_umax, &o_vmin, &o_vmax);
|
528
|
+
|
529
|
+
umin = rb_float_new((double)o_umin);
|
530
|
+
umax = rb_float_new((double)o_umax);
|
531
|
+
vmin = rb_float_new((double)o_vmin);
|
532
|
+
vmax = rb_float_new((double)o_vmax);
|
533
|
+
|
534
|
+
|
535
|
+
return rb_ary_new3(4, umin, umax, vmin, vmax);
|
536
|
+
|
537
|
+
}
|
538
|
+
|
539
|
+
static VALUE
|
540
|
+
dcl_uiscmp(obj, irgb1, irgb2, irgb3, irgb4)
|
541
|
+
VALUE obj, irgb1, irgb2, irgb3, irgb4;
|
542
|
+
{
|
543
|
+
integer i_irgb1;
|
544
|
+
integer i_irgb2;
|
545
|
+
integer i_irgb3;
|
546
|
+
integer i_irgb4;
|
547
|
+
|
548
|
+
if ((TYPE(irgb1) != T_BIGNUM) || (TYPE(irgb1) != T_FIXNUM)) {
|
549
|
+
irgb1 = rb_funcall(irgb1, rb_intern("to_i"), 0);
|
550
|
+
}
|
551
|
+
if ((TYPE(irgb2) != T_BIGNUM) || (TYPE(irgb2) != T_FIXNUM)) {
|
552
|
+
irgb2 = rb_funcall(irgb2, rb_intern("to_i"), 0);
|
553
|
+
}
|
554
|
+
if ((TYPE(irgb3) != T_BIGNUM) || (TYPE(irgb3) != T_FIXNUM)) {
|
555
|
+
irgb3 = rb_funcall(irgb3, rb_intern("to_i"), 0);
|
556
|
+
}
|
557
|
+
if ((TYPE(irgb4) != T_BIGNUM) || (TYPE(irgb4) != T_FIXNUM)) {
|
558
|
+
irgb4 = rb_funcall(irgb4, rb_intern("to_i"), 0);
|
559
|
+
}
|
560
|
+
|
561
|
+
i_irgb1 = NUM2INT(irgb1);
|
562
|
+
i_irgb2 = NUM2INT(irgb2);
|
563
|
+
i_irgb3 = NUM2INT(irgb3);
|
564
|
+
i_irgb4 = NUM2INT(irgb4);
|
565
|
+
|
566
|
+
|
567
|
+
uiscmp_(&i_irgb1, &i_irgb2, &i_irgb3, &i_irgb4);
|
568
|
+
|
569
|
+
return Qnil;
|
570
|
+
|
571
|
+
}
|
572
|
+
|
573
|
+
static VALUE
|
574
|
+
dcl_uipcmp(obj, xmin, xmax, ymin, ymax, cpos)
|
575
|
+
VALUE obj, xmin, xmax, ymin, ymax, cpos;
|
576
|
+
{
|
577
|
+
real i_xmin;
|
578
|
+
real i_xmax;
|
579
|
+
real i_ymin;
|
580
|
+
real i_ymax;
|
581
|
+
char *i_cpos;
|
582
|
+
|
583
|
+
if (TYPE(xmin) != T_FLOAT) {
|
584
|
+
xmin = rb_funcall(xmin, rb_intern("to_f"), 0);
|
585
|
+
}
|
586
|
+
if (TYPE(xmax) != T_FLOAT) {
|
587
|
+
xmax = rb_funcall(xmax, rb_intern("to_f"), 0);
|
588
|
+
}
|
589
|
+
if (TYPE(ymin) != T_FLOAT) {
|
590
|
+
ymin = rb_funcall(ymin, rb_intern("to_f"), 0);
|
591
|
+
}
|
592
|
+
if (TYPE(ymax) != T_FLOAT) {
|
593
|
+
ymax = rb_funcall(ymax, rb_intern("to_f"), 0);
|
594
|
+
}
|
595
|
+
if (TYPE(cpos) != T_STRING) {
|
596
|
+
cpos = rb_funcall(cpos, rb_intern("to_str"), 0);
|
597
|
+
}
|
598
|
+
|
599
|
+
i_xmin = (real)NUM2DBL(xmin);
|
600
|
+
i_xmax = (real)NUM2DBL(xmax);
|
601
|
+
i_ymin = (real)NUM2DBL(ymin);
|
602
|
+
i_ymax = (real)NUM2DBL(ymax);
|
603
|
+
i_cpos = StringValuePtr(cpos);
|
604
|
+
|
605
|
+
|
606
|
+
uipcmp_(&i_xmin, &i_xmax, &i_ymin, &i_ymax, i_cpos, (ftnlen)strlen(i_cpos));
|
607
|
+
|
608
|
+
return Qnil;
|
609
|
+
|
610
|
+
}
|
611
|
+
|
612
|
+
static VALUE
|
613
|
+
dcl_uifpac(obj, ir, ig, ib)
|
614
|
+
VALUE obj, ir, ig, ib;
|
615
|
+
{
|
616
|
+
integer i_ir;
|
617
|
+
integer i_ig;
|
618
|
+
integer i_ib;
|
619
|
+
integer o_irgb;
|
620
|
+
VALUE irgb;
|
621
|
+
|
622
|
+
if ((TYPE(ir) != T_BIGNUM) || (TYPE(ir) != T_FIXNUM)) {
|
623
|
+
ir = rb_funcall(ir, rb_intern("to_i"), 0);
|
624
|
+
}
|
625
|
+
if ((TYPE(ig) != T_BIGNUM) || (TYPE(ig) != T_FIXNUM)) {
|
626
|
+
ig = rb_funcall(ig, rb_intern("to_i"), 0);
|
627
|
+
}
|
628
|
+
if ((TYPE(ib) != T_BIGNUM) || (TYPE(ib) != T_FIXNUM)) {
|
629
|
+
ib = rb_funcall(ib, rb_intern("to_i"), 0);
|
630
|
+
}
|
631
|
+
|
632
|
+
i_ir = NUM2INT(ir);
|
633
|
+
i_ig = NUM2INT(ig);
|
634
|
+
i_ib = NUM2INT(ib);
|
635
|
+
|
636
|
+
|
637
|
+
uifpac_(&i_ir, &i_ig, &i_ib, &o_irgb);
|
638
|
+
|
639
|
+
irgb = INT2NUM(o_irgb);
|
640
|
+
|
641
|
+
|
642
|
+
return irgb;
|
643
|
+
|
644
|
+
}
|
645
|
+
|
646
|
+
static VALUE
|
647
|
+
dcl_uiipac(obj, irgb)
|
648
|
+
VALUE obj, irgb;
|
649
|
+
{
|
650
|
+
integer i_irgb;
|
651
|
+
integer o_ir;
|
652
|
+
integer o_ig;
|
653
|
+
integer o_ib;
|
654
|
+
VALUE ir;
|
655
|
+
VALUE ig;
|
656
|
+
VALUE ib;
|
657
|
+
|
658
|
+
if ((TYPE(irgb) != T_BIGNUM) || (TYPE(irgb) != T_FIXNUM)) {
|
659
|
+
irgb = rb_funcall(irgb, rb_intern("to_i"), 0);
|
660
|
+
}
|
661
|
+
|
662
|
+
i_irgb = NUM2INT(irgb);
|
663
|
+
|
664
|
+
|
665
|
+
uiipac_(&i_irgb, &o_ir, &o_ig, &o_ib);
|
666
|
+
|
667
|
+
ir = INT2NUM(o_ir);
|
668
|
+
ig = INT2NUM(o_ig);
|
669
|
+
ib = INT2NUM(o_ib);
|
670
|
+
|
671
|
+
|
672
|
+
return rb_ary_new3(3, ir, ig, ib);
|
673
|
+
|
674
|
+
}
|
675
|
+
|
676
|
+
static VALUE
|
677
|
+
dcl_uiiget(obj, cp)
|
678
|
+
VALUE obj, cp;
|
679
|
+
{
|
680
|
+
char *i_cp;
|
681
|
+
integer o_ipara;
|
682
|
+
VALUE ipara;
|
683
|
+
|
684
|
+
if (TYPE(cp) != T_STRING) {
|
685
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
686
|
+
}
|
687
|
+
|
688
|
+
i_cp = StringValuePtr(cp);
|
689
|
+
|
690
|
+
|
691
|
+
uiiget_(i_cp, &o_ipara, (ftnlen)strlen(i_cp));
|
692
|
+
|
693
|
+
ipara = INT2NUM(o_ipara);
|
694
|
+
|
695
|
+
|
696
|
+
return ipara;
|
697
|
+
|
698
|
+
}
|
699
|
+
|
700
|
+
static VALUE
|
701
|
+
dcl_uiiset(obj, cp, ipara)
|
702
|
+
VALUE obj, cp, ipara;
|
703
|
+
{
|
704
|
+
char *i_cp;
|
705
|
+
integer i_ipara;
|
706
|
+
|
707
|
+
if (TYPE(cp) != T_STRING) {
|
708
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
709
|
+
}
|
710
|
+
if ((TYPE(ipara) != T_BIGNUM) || (TYPE(ipara) != T_FIXNUM)) {
|
711
|
+
ipara = rb_funcall(ipara, rb_intern("to_i"), 0);
|
712
|
+
}
|
713
|
+
|
714
|
+
i_cp = StringValuePtr(cp);
|
715
|
+
i_ipara = NUM2INT(ipara);
|
716
|
+
|
717
|
+
|
718
|
+
uiiset_(i_cp, &i_ipara, (ftnlen)strlen(i_cp));
|
719
|
+
|
720
|
+
return Qnil;
|
721
|
+
|
722
|
+
}
|
723
|
+
|
724
|
+
static VALUE
|
725
|
+
dcl_uiistx(obj, cp, ipara)
|
726
|
+
VALUE obj, cp, ipara;
|
727
|
+
{
|
728
|
+
char *i_cp;
|
729
|
+
integer i_ipara;
|
730
|
+
|
731
|
+
if (TYPE(cp) != T_STRING) {
|
732
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
733
|
+
}
|
734
|
+
if ((TYPE(ipara) != T_BIGNUM) || (TYPE(ipara) != T_FIXNUM)) {
|
735
|
+
ipara = rb_funcall(ipara, rb_intern("to_i"), 0);
|
736
|
+
}
|
737
|
+
|
738
|
+
i_cp = StringValuePtr(cp);
|
739
|
+
i_ipara = NUM2INT(ipara);
|
740
|
+
|
741
|
+
|
742
|
+
uiistx_(i_cp, &i_ipara, (ftnlen)strlen(i_cp));
|
743
|
+
|
744
|
+
return Qnil;
|
745
|
+
|
746
|
+
}
|
747
|
+
|
748
|
+
static VALUE
|
749
|
+
dcl_uiiqnp(obj)
|
750
|
+
VALUE obj;
|
751
|
+
{
|
752
|
+
integer o_ncp;
|
753
|
+
VALUE ncp;
|
754
|
+
|
755
|
+
uiiqnp_(&o_ncp);
|
756
|
+
|
757
|
+
ncp = INT2NUM(o_ncp);
|
758
|
+
|
759
|
+
|
760
|
+
return ncp;
|
761
|
+
|
762
|
+
}
|
763
|
+
|
764
|
+
static VALUE
|
765
|
+
dcl_uiiqid(obj, cp)
|
766
|
+
VALUE obj, cp;
|
767
|
+
{
|
768
|
+
char *i_cp;
|
769
|
+
integer o_idx;
|
770
|
+
VALUE idx;
|
771
|
+
|
772
|
+
if (TYPE(cp) != T_STRING) {
|
773
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
774
|
+
}
|
775
|
+
|
776
|
+
i_cp = StringValuePtr(cp);
|
777
|
+
|
778
|
+
|
779
|
+
uiiqid_(i_cp, &o_idx, (ftnlen)strlen(i_cp));
|
780
|
+
|
781
|
+
idx = INT2NUM(o_idx);
|
782
|
+
|
783
|
+
|
784
|
+
return idx;
|
785
|
+
|
786
|
+
}
|
787
|
+
|
788
|
+
static VALUE
|
789
|
+
dcl_uiiqcp(obj, idx)
|
790
|
+
VALUE obj, idx;
|
791
|
+
{
|
792
|
+
integer i_idx;
|
793
|
+
char *o_cp;
|
794
|
+
VALUE cp;
|
795
|
+
|
796
|
+
if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
|
797
|
+
idx = rb_funcall(idx, rb_intern("to_i"), 0);
|
798
|
+
}
|
799
|
+
|
800
|
+
i_idx = NUM2INT(idx);
|
801
|
+
|
802
|
+
o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
|
803
|
+
memset(o_cp, '\0', DFLT_SIZE+1);
|
804
|
+
|
805
|
+
uiiqcp_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
|
806
|
+
|
807
|
+
cp = rb_str_new2(o_cp);
|
808
|
+
|
809
|
+
|
810
|
+
return cp;
|
811
|
+
|
812
|
+
}
|
813
|
+
|
814
|
+
static VALUE
|
815
|
+
dcl_uiiqcl(obj, idx)
|
816
|
+
VALUE obj, idx;
|
817
|
+
{
|
818
|
+
integer i_idx;
|
819
|
+
char *o_cp;
|
820
|
+
VALUE cp;
|
821
|
+
|
822
|
+
if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
|
823
|
+
idx = rb_funcall(idx, rb_intern("to_i"), 0);
|
824
|
+
}
|
825
|
+
|
826
|
+
i_idx = NUM2INT(idx);
|
827
|
+
|
828
|
+
o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
|
829
|
+
memset(o_cp, '\0', DFLT_SIZE+1);
|
830
|
+
|
831
|
+
uiiqcl_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
|
832
|
+
|
833
|
+
cp = rb_str_new2(o_cp);
|
834
|
+
|
835
|
+
|
836
|
+
return cp;
|
837
|
+
|
838
|
+
}
|
839
|
+
|
840
|
+
static VALUE
|
841
|
+
dcl_uiiqvl(obj, idx)
|
842
|
+
VALUE obj, idx;
|
843
|
+
{
|
844
|
+
integer i_idx;
|
845
|
+
integer o_ipara;
|
846
|
+
VALUE ipara;
|
847
|
+
|
848
|
+
if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
|
849
|
+
idx = rb_funcall(idx, rb_intern("to_i"), 0);
|
850
|
+
}
|
851
|
+
|
852
|
+
i_idx = NUM2INT(idx);
|
853
|
+
|
854
|
+
|
855
|
+
uiiqvl_(&i_idx, &o_ipara);
|
856
|
+
|
857
|
+
ipara = INT2NUM(o_ipara);
|
858
|
+
|
859
|
+
|
860
|
+
return ipara;
|
861
|
+
|
862
|
+
}
|
863
|
+
|
864
|
+
static VALUE
|
865
|
+
dcl_uiisvl(obj, idx, ipara)
|
866
|
+
VALUE obj, idx, ipara;
|
867
|
+
{
|
868
|
+
integer i_idx;
|
869
|
+
integer i_ipara;
|
870
|
+
|
871
|
+
if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
|
872
|
+
idx = rb_funcall(idx, rb_intern("to_i"), 0);
|
873
|
+
}
|
874
|
+
if ((TYPE(ipara) != T_BIGNUM) || (TYPE(ipara) != T_FIXNUM)) {
|
875
|
+
ipara = rb_funcall(ipara, rb_intern("to_i"), 0);
|
876
|
+
}
|
877
|
+
|
878
|
+
i_idx = NUM2INT(idx);
|
879
|
+
i_ipara = NUM2INT(ipara);
|
880
|
+
|
881
|
+
|
882
|
+
uiisvl_(&i_idx, &i_ipara);
|
883
|
+
|
884
|
+
return Qnil;
|
885
|
+
|
886
|
+
}
|
887
|
+
|
888
|
+
static VALUE
|
889
|
+
dcl_uiiqin(obj, cp)
|
890
|
+
VALUE obj, cp;
|
891
|
+
{
|
892
|
+
char *i_cp;
|
893
|
+
integer o_in;
|
894
|
+
VALUE in;
|
895
|
+
|
896
|
+
if (TYPE(cp) != T_STRING) {
|
897
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
898
|
+
}
|
899
|
+
|
900
|
+
i_cp = StringValuePtr(cp);
|
901
|
+
|
902
|
+
|
903
|
+
uiiqin_(i_cp, &o_in, (ftnlen)strlen(i_cp));
|
904
|
+
|
905
|
+
in = INT2NUM(o_in);
|
906
|
+
|
907
|
+
|
908
|
+
return in;
|
909
|
+
|
910
|
+
}
|
911
|
+
|
912
|
+
static VALUE
|
913
|
+
dcl_uilget(obj, cp)
|
914
|
+
VALUE obj, cp;
|
915
|
+
{
|
916
|
+
char *i_cp;
|
917
|
+
logical o_lpara;
|
918
|
+
VALUE lpara;
|
919
|
+
|
920
|
+
if (TYPE(cp) != T_STRING) {
|
921
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
922
|
+
}
|
923
|
+
|
924
|
+
i_cp = StringValuePtr(cp);
|
925
|
+
|
926
|
+
|
927
|
+
uilget_(i_cp, &o_lpara, (ftnlen)strlen(i_cp));
|
928
|
+
|
929
|
+
lpara = (o_lpara == FALSE_) ? Qfalse : Qtrue;
|
930
|
+
|
931
|
+
|
932
|
+
return lpara;
|
933
|
+
|
934
|
+
}
|
935
|
+
|
936
|
+
static VALUE
|
937
|
+
dcl_uilset(obj, cp, lpara)
|
938
|
+
VALUE obj, cp, lpara;
|
939
|
+
{
|
940
|
+
char *i_cp;
|
941
|
+
logical i_lpara;
|
942
|
+
|
943
|
+
if (TYPE(cp) != T_STRING) {
|
944
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
945
|
+
}
|
946
|
+
|
947
|
+
i_cp = StringValuePtr(cp);
|
948
|
+
i_lpara = ((lpara == Qnil)||(lpara == Qfalse)) ? FALSE_ : TRUE_;
|
949
|
+
|
950
|
+
|
951
|
+
uilset_(i_cp, &i_lpara, (ftnlen)strlen(i_cp));
|
952
|
+
|
953
|
+
return Qnil;
|
954
|
+
|
955
|
+
}
|
956
|
+
|
957
|
+
static VALUE
|
958
|
+
dcl_uilstx(obj, cp, lpara)
|
959
|
+
VALUE obj, cp, lpara;
|
960
|
+
{
|
961
|
+
char *i_cp;
|
962
|
+
logical i_lpara;
|
963
|
+
|
964
|
+
if (TYPE(cp) != T_STRING) {
|
965
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
966
|
+
}
|
967
|
+
|
968
|
+
i_cp = StringValuePtr(cp);
|
969
|
+
i_lpara = ((lpara == Qnil)||(lpara == Qfalse)) ? FALSE_ : TRUE_;
|
970
|
+
|
971
|
+
|
972
|
+
uilstx_(i_cp, &i_lpara, (ftnlen)strlen(i_cp));
|
973
|
+
|
974
|
+
return Qnil;
|
975
|
+
|
976
|
+
}
|
977
|
+
|
978
|
+
static VALUE
|
979
|
+
dcl_uilqnp(obj)
|
980
|
+
VALUE obj;
|
981
|
+
{
|
982
|
+
integer o_ncp;
|
983
|
+
VALUE ncp;
|
984
|
+
|
985
|
+
uilqnp_(&o_ncp);
|
986
|
+
|
987
|
+
ncp = INT2NUM(o_ncp);
|
988
|
+
|
989
|
+
|
990
|
+
return ncp;
|
991
|
+
|
992
|
+
}
|
993
|
+
|
994
|
+
static VALUE
|
995
|
+
dcl_uilqid(obj, cp)
|
996
|
+
VALUE obj, cp;
|
997
|
+
{
|
998
|
+
char *i_cp;
|
999
|
+
integer o_idx;
|
1000
|
+
VALUE idx;
|
1001
|
+
|
1002
|
+
if (TYPE(cp) != T_STRING) {
|
1003
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
1004
|
+
}
|
1005
|
+
|
1006
|
+
i_cp = StringValuePtr(cp);
|
1007
|
+
|
1008
|
+
|
1009
|
+
uilqid_(i_cp, &o_idx, (ftnlen)strlen(i_cp));
|
1010
|
+
|
1011
|
+
idx = INT2NUM(o_idx);
|
1012
|
+
|
1013
|
+
|
1014
|
+
return idx;
|
1015
|
+
|
1016
|
+
}
|
1017
|
+
|
1018
|
+
static VALUE
|
1019
|
+
dcl_uilqcp(obj, idx)
|
1020
|
+
VALUE obj, idx;
|
1021
|
+
{
|
1022
|
+
integer i_idx;
|
1023
|
+
char *o_cp;
|
1024
|
+
VALUE cp;
|
1025
|
+
|
1026
|
+
if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
|
1027
|
+
idx = rb_funcall(idx, rb_intern("to_i"), 0);
|
1028
|
+
}
|
1029
|
+
|
1030
|
+
i_idx = NUM2INT(idx);
|
1031
|
+
|
1032
|
+
o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
|
1033
|
+
memset(o_cp, '\0', DFLT_SIZE+1);
|
1034
|
+
|
1035
|
+
uilqcp_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
|
1036
|
+
|
1037
|
+
cp = rb_str_new2(o_cp);
|
1038
|
+
|
1039
|
+
|
1040
|
+
return cp;
|
1041
|
+
|
1042
|
+
}
|
1043
|
+
|
1044
|
+
static VALUE
|
1045
|
+
dcl_uilqcl(obj, idx)
|
1046
|
+
VALUE obj, idx;
|
1047
|
+
{
|
1048
|
+
integer i_idx;
|
1049
|
+
char *o_cp;
|
1050
|
+
VALUE cp;
|
1051
|
+
|
1052
|
+
if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
|
1053
|
+
idx = rb_funcall(idx, rb_intern("to_i"), 0);
|
1054
|
+
}
|
1055
|
+
|
1056
|
+
i_idx = NUM2INT(idx);
|
1057
|
+
|
1058
|
+
o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
|
1059
|
+
memset(o_cp, '\0', DFLT_SIZE+1);
|
1060
|
+
|
1061
|
+
uilqcl_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
|
1062
|
+
|
1063
|
+
cp = rb_str_new2(o_cp);
|
1064
|
+
|
1065
|
+
|
1066
|
+
return cp;
|
1067
|
+
|
1068
|
+
}
|
1069
|
+
|
1070
|
+
static VALUE
|
1071
|
+
dcl_uilqvl(obj, idx)
|
1072
|
+
VALUE obj, idx;
|
1073
|
+
{
|
1074
|
+
integer i_idx;
|
1075
|
+
logical o_lpara;
|
1076
|
+
VALUE lpara;
|
1077
|
+
|
1078
|
+
if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
|
1079
|
+
idx = rb_funcall(idx, rb_intern("to_i"), 0);
|
1080
|
+
}
|
1081
|
+
|
1082
|
+
i_idx = NUM2INT(idx);
|
1083
|
+
|
1084
|
+
|
1085
|
+
uilqvl_(&i_idx, &o_lpara);
|
1086
|
+
|
1087
|
+
lpara = (o_lpara == FALSE_) ? Qfalse : Qtrue;
|
1088
|
+
|
1089
|
+
|
1090
|
+
return lpara;
|
1091
|
+
|
1092
|
+
}
|
1093
|
+
|
1094
|
+
static VALUE
|
1095
|
+
dcl_uilsvl(obj, idx, lpara)
|
1096
|
+
VALUE obj, idx, lpara;
|
1097
|
+
{
|
1098
|
+
integer i_idx;
|
1099
|
+
logical i_lpara;
|
1100
|
+
|
1101
|
+
if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
|
1102
|
+
idx = rb_funcall(idx, rb_intern("to_i"), 0);
|
1103
|
+
}
|
1104
|
+
|
1105
|
+
i_idx = NUM2INT(idx);
|
1106
|
+
i_lpara = ((lpara == Qnil)||(lpara == Qfalse)) ? FALSE_ : TRUE_;
|
1107
|
+
|
1108
|
+
|
1109
|
+
uilsvl_(&i_idx, &i_lpara);
|
1110
|
+
|
1111
|
+
return Qnil;
|
1112
|
+
|
1113
|
+
}
|
1114
|
+
|
1115
|
+
static VALUE
|
1116
|
+
dcl_uilqin(obj, cp)
|
1117
|
+
VALUE obj, cp;
|
1118
|
+
{
|
1119
|
+
char *i_cp;
|
1120
|
+
integer o_in;
|
1121
|
+
VALUE in;
|
1122
|
+
|
1123
|
+
if (TYPE(cp) != T_STRING) {
|
1124
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
1125
|
+
}
|
1126
|
+
|
1127
|
+
i_cp = StringValuePtr(cp);
|
1128
|
+
|
1129
|
+
|
1130
|
+
uilqin_(i_cp, &o_in, (ftnlen)strlen(i_cp));
|
1131
|
+
|
1132
|
+
in = INT2NUM(o_in);
|
1133
|
+
|
1134
|
+
|
1135
|
+
return in;
|
1136
|
+
|
1137
|
+
}
|
1138
|
+
|
1139
|
+
static VALUE
|
1140
|
+
dcl_uirget(obj, cp)
|
1141
|
+
VALUE obj, cp;
|
1142
|
+
{
|
1143
|
+
char *i_cp;
|
1144
|
+
real o_rpara;
|
1145
|
+
VALUE rpara;
|
1146
|
+
|
1147
|
+
if (TYPE(cp) != T_STRING) {
|
1148
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
1149
|
+
}
|
1150
|
+
|
1151
|
+
i_cp = StringValuePtr(cp);
|
1152
|
+
|
1153
|
+
|
1154
|
+
uirget_(i_cp, &o_rpara, (ftnlen)strlen(i_cp));
|
1155
|
+
|
1156
|
+
rpara = rb_float_new((double)o_rpara);
|
1157
|
+
|
1158
|
+
|
1159
|
+
return rpara;
|
1160
|
+
|
1161
|
+
}
|
1162
|
+
|
1163
|
+
static VALUE
|
1164
|
+
dcl_uirset(obj, cp, rpara)
|
1165
|
+
VALUE obj, cp, rpara;
|
1166
|
+
{
|
1167
|
+
char *i_cp;
|
1168
|
+
real i_rpara;
|
1169
|
+
|
1170
|
+
if (TYPE(cp) != T_STRING) {
|
1171
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
1172
|
+
}
|
1173
|
+
if (TYPE(rpara) != T_FLOAT) {
|
1174
|
+
rpara = rb_funcall(rpara, rb_intern("to_f"), 0);
|
1175
|
+
}
|
1176
|
+
|
1177
|
+
i_cp = StringValuePtr(cp);
|
1178
|
+
i_rpara = (real)NUM2DBL(rpara);
|
1179
|
+
|
1180
|
+
|
1181
|
+
uirset_(i_cp, &i_rpara, (ftnlen)strlen(i_cp));
|
1182
|
+
|
1183
|
+
return Qnil;
|
1184
|
+
|
1185
|
+
}
|
1186
|
+
|
1187
|
+
static VALUE
|
1188
|
+
dcl_uirstx(obj, cp, rpara)
|
1189
|
+
VALUE obj, cp, rpara;
|
1190
|
+
{
|
1191
|
+
char *i_cp;
|
1192
|
+
real i_rpara;
|
1193
|
+
|
1194
|
+
if (TYPE(cp) != T_STRING) {
|
1195
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
1196
|
+
}
|
1197
|
+
if (TYPE(rpara) != T_FLOAT) {
|
1198
|
+
rpara = rb_funcall(rpara, rb_intern("to_f"), 0);
|
1199
|
+
}
|
1200
|
+
|
1201
|
+
i_cp = StringValuePtr(cp);
|
1202
|
+
i_rpara = (real)NUM2DBL(rpara);
|
1203
|
+
|
1204
|
+
|
1205
|
+
uirstx_(i_cp, &i_rpara, (ftnlen)strlen(i_cp));
|
1206
|
+
|
1207
|
+
return Qnil;
|
1208
|
+
|
1209
|
+
}
|
1210
|
+
|
1211
|
+
static VALUE
|
1212
|
+
dcl_uirqnp(obj)
|
1213
|
+
VALUE obj;
|
1214
|
+
{
|
1215
|
+
integer o_ncp;
|
1216
|
+
VALUE ncp;
|
1217
|
+
|
1218
|
+
uirqnp_(&o_ncp);
|
1219
|
+
|
1220
|
+
ncp = INT2NUM(o_ncp);
|
1221
|
+
|
1222
|
+
|
1223
|
+
return ncp;
|
1224
|
+
|
1225
|
+
}
|
1226
|
+
|
1227
|
+
static VALUE
|
1228
|
+
dcl_uirqid(obj, cp)
|
1229
|
+
VALUE obj, cp;
|
1230
|
+
{
|
1231
|
+
char *i_cp;
|
1232
|
+
integer o_idx;
|
1233
|
+
VALUE idx;
|
1234
|
+
|
1235
|
+
if (TYPE(cp) != T_STRING) {
|
1236
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
1237
|
+
}
|
1238
|
+
|
1239
|
+
i_cp = StringValuePtr(cp);
|
1240
|
+
|
1241
|
+
|
1242
|
+
uirqid_(i_cp, &o_idx, (ftnlen)strlen(i_cp));
|
1243
|
+
|
1244
|
+
idx = INT2NUM(o_idx);
|
1245
|
+
|
1246
|
+
|
1247
|
+
return idx;
|
1248
|
+
|
1249
|
+
}
|
1250
|
+
|
1251
|
+
static VALUE
|
1252
|
+
dcl_uirqcp(obj, idx)
|
1253
|
+
VALUE obj, idx;
|
1254
|
+
{
|
1255
|
+
integer i_idx;
|
1256
|
+
char *o_cp;
|
1257
|
+
VALUE cp;
|
1258
|
+
|
1259
|
+
if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
|
1260
|
+
idx = rb_funcall(idx, rb_intern("to_i"), 0);
|
1261
|
+
}
|
1262
|
+
|
1263
|
+
i_idx = NUM2INT(idx);
|
1264
|
+
|
1265
|
+
o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
|
1266
|
+
memset(o_cp, '\0', DFLT_SIZE+1);
|
1267
|
+
|
1268
|
+
uirqcp_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
|
1269
|
+
|
1270
|
+
cp = rb_str_new2(o_cp);
|
1271
|
+
|
1272
|
+
|
1273
|
+
return cp;
|
1274
|
+
|
1275
|
+
}
|
1276
|
+
|
1277
|
+
static VALUE
|
1278
|
+
dcl_uirqcl(obj, idx)
|
1279
|
+
VALUE obj, idx;
|
1280
|
+
{
|
1281
|
+
integer i_idx;
|
1282
|
+
char *o_cp;
|
1283
|
+
VALUE cp;
|
1284
|
+
|
1285
|
+
if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
|
1286
|
+
idx = rb_funcall(idx, rb_intern("to_i"), 0);
|
1287
|
+
}
|
1288
|
+
|
1289
|
+
i_idx = NUM2INT(idx);
|
1290
|
+
|
1291
|
+
o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
|
1292
|
+
memset(o_cp, '\0', DFLT_SIZE+1);
|
1293
|
+
|
1294
|
+
uirqcl_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
|
1295
|
+
|
1296
|
+
cp = rb_str_new2(o_cp);
|
1297
|
+
|
1298
|
+
|
1299
|
+
return cp;
|
1300
|
+
|
1301
|
+
}
|
1302
|
+
|
1303
|
+
static VALUE
|
1304
|
+
dcl_uirqvl(obj, idx)
|
1305
|
+
VALUE obj, idx;
|
1306
|
+
{
|
1307
|
+
integer i_idx;
|
1308
|
+
real o_rpara;
|
1309
|
+
VALUE rpara;
|
1310
|
+
|
1311
|
+
if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
|
1312
|
+
idx = rb_funcall(idx, rb_intern("to_i"), 0);
|
1313
|
+
}
|
1314
|
+
|
1315
|
+
i_idx = NUM2INT(idx);
|
1316
|
+
|
1317
|
+
|
1318
|
+
uirqvl_(&i_idx, &o_rpara);
|
1319
|
+
|
1320
|
+
rpara = rb_float_new((double)o_rpara);
|
1321
|
+
|
1322
|
+
|
1323
|
+
return rpara;
|
1324
|
+
|
1325
|
+
}
|
1326
|
+
|
1327
|
+
static VALUE
|
1328
|
+
dcl_uirsvl(obj, idx, rpara)
|
1329
|
+
VALUE obj, idx, rpara;
|
1330
|
+
{
|
1331
|
+
integer i_idx;
|
1332
|
+
real i_rpara;
|
1333
|
+
|
1334
|
+
if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
|
1335
|
+
idx = rb_funcall(idx, rb_intern("to_i"), 0);
|
1336
|
+
}
|
1337
|
+
if (TYPE(rpara) != T_FLOAT) {
|
1338
|
+
rpara = rb_funcall(rpara, rb_intern("to_f"), 0);
|
1339
|
+
}
|
1340
|
+
|
1341
|
+
i_idx = NUM2INT(idx);
|
1342
|
+
i_rpara = (real)NUM2DBL(rpara);
|
1343
|
+
|
1344
|
+
|
1345
|
+
uirsvl_(&i_idx, &i_rpara);
|
1346
|
+
|
1347
|
+
return Qnil;
|
1348
|
+
|
1349
|
+
}
|
1350
|
+
|
1351
|
+
static VALUE
|
1352
|
+
dcl_uirqin(obj, cp)
|
1353
|
+
VALUE obj, cp;
|
1354
|
+
{
|
1355
|
+
char *i_cp;
|
1356
|
+
integer o_in;
|
1357
|
+
VALUE in;
|
1358
|
+
|
1359
|
+
if (TYPE(cp) != T_STRING) {
|
1360
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
1361
|
+
}
|
1362
|
+
|
1363
|
+
i_cp = StringValuePtr(cp);
|
1364
|
+
|
1365
|
+
|
1366
|
+
uirqin_(i_cp, &o_in, (ftnlen)strlen(i_cp));
|
1367
|
+
|
1368
|
+
in = INT2NUM(o_in);
|
1369
|
+
|
1370
|
+
|
1371
|
+
return in;
|
1372
|
+
|
1373
|
+
}
|
1374
|
+
|
1375
|
+
static VALUE
|
1376
|
+
dcl_uiqfnm(obj, cpara)
|
1377
|
+
VALUE obj, cpara;
|
1378
|
+
{
|
1379
|
+
char *i_cpara;
|
1380
|
+
char *o_cfname;
|
1381
|
+
VALUE cfname;
|
1382
|
+
|
1383
|
+
if (TYPE(cpara) != T_STRING) {
|
1384
|
+
cpara = rb_funcall(cpara, rb_intern("to_str"), 0);
|
1385
|
+
}
|
1386
|
+
|
1387
|
+
i_cpara = StringValuePtr(cpara);
|
1388
|
+
|
1389
|
+
o_cfname= ALLOCA_N(char, (DFLT_SIZE+1));
|
1390
|
+
memset(o_cfname, '\0', DFLT_SIZE+1);
|
1391
|
+
|
1392
|
+
uiqfnm_(i_cpara, o_cfname, (ftnlen)strlen(i_cpara), (ftnlen)DFLT_SIZE);
|
1393
|
+
|
1394
|
+
cfname = rb_str_new2(o_cfname);
|
1395
|
+
|
1396
|
+
|
1397
|
+
return cfname;
|
1398
|
+
|
1399
|
+
}
|
1400
|
+
|
1401
|
+
#endif
|
1402
|
+
void
|
1403
|
+
init_grph2_uipack(mDCL)
|
1404
|
+
VALUE mDCL;
|
1405
|
+
{
|
1406
|
+
#if DCLVER >= 544
|
1407
|
+
rb_define_module_function(mDCL, "uipdat", dcl_uipdat, 4);
|
1408
|
+
rb_define_module_function(mDCL, "uipda2", dcl_uipda2, 5);
|
1409
|
+
rb_define_module_function(mDCL, "uipda3", dcl_uipda3, 6);
|
1410
|
+
rb_define_module_function(mDCL, "uiscrg", dcl_uiscrg, 2);
|
1411
|
+
rb_define_module_function(mDCL, "uismrg", dcl_uismrg, 2);
|
1412
|
+
rb_define_module_function(mDCL, "uiscsq", dcl_uiscsq, 3);
|
1413
|
+
rb_define_module_function(mDCL, "uiscfl", dcl_uiscfl, 1);
|
1414
|
+
rb_define_module_function(mDCL, "uismsq", dcl_uismsq, 3);
|
1415
|
+
rb_define_module_function(mDCL, "uismfl", dcl_uismfl, 1);
|
1416
|
+
rb_define_module_function(mDCL, "uixbar", dcl_uixbar, 7);
|
1417
|
+
rb_define_module_function(mDCL, "uiybar", dcl_uiybar, 7);
|
1418
|
+
rb_define_module_function(mDCL, "uiscr2", dcl_uiscr2, 4);
|
1419
|
+
rb_define_module_function(mDCL, "uiqcr2", dcl_uiqcr2, 0);
|
1420
|
+
rb_define_module_function(mDCL, "uiscmp", dcl_uiscmp, 4);
|
1421
|
+
rb_define_module_function(mDCL, "uipcmp", dcl_uipcmp, 5);
|
1422
|
+
rb_define_module_function(mDCL, "uifpac", dcl_uifpac, 3);
|
1423
|
+
rb_define_module_function(mDCL, "uiipac", dcl_uiipac, 1);
|
1424
|
+
rb_define_module_function(mDCL, "uiiget", dcl_uiiget, 1);
|
1425
|
+
rb_define_module_function(mDCL, "uiiset", dcl_uiiset, 2);
|
1426
|
+
rb_define_module_function(mDCL, "uiistx", dcl_uiistx, 2);
|
1427
|
+
rb_define_module_function(mDCL, "uiiqnp", dcl_uiiqnp, 0);
|
1428
|
+
rb_define_module_function(mDCL, "uiiqid", dcl_uiiqid, 1);
|
1429
|
+
rb_define_module_function(mDCL, "uiiqcp", dcl_uiiqcp, 1);
|
1430
|
+
rb_define_module_function(mDCL, "uiiqcl", dcl_uiiqcl, 1);
|
1431
|
+
rb_define_module_function(mDCL, "uiiqvl", dcl_uiiqvl, 1);
|
1432
|
+
rb_define_module_function(mDCL, "uiisvl", dcl_uiisvl, 2);
|
1433
|
+
rb_define_module_function(mDCL, "uiiqin", dcl_uiiqin, 1);
|
1434
|
+
rb_define_module_function(mDCL, "uilget", dcl_uilget, 1);
|
1435
|
+
rb_define_module_function(mDCL, "uilset", dcl_uilset, 2);
|
1436
|
+
rb_define_module_function(mDCL, "uilstx", dcl_uilstx, 2);
|
1437
|
+
rb_define_module_function(mDCL, "uilqnp", dcl_uilqnp, 0);
|
1438
|
+
rb_define_module_function(mDCL, "uilqid", dcl_uilqid, 1);
|
1439
|
+
rb_define_module_function(mDCL, "uilqcp", dcl_uilqcp, 1);
|
1440
|
+
rb_define_module_function(mDCL, "uilqcl", dcl_uilqcl, 1);
|
1441
|
+
rb_define_module_function(mDCL, "uilqvl", dcl_uilqvl, 1);
|
1442
|
+
rb_define_module_function(mDCL, "uilsvl", dcl_uilsvl, 2);
|
1443
|
+
rb_define_module_function(mDCL, "uilqin", dcl_uilqin, 1);
|
1444
|
+
rb_define_module_function(mDCL, "uirget", dcl_uirget, 1);
|
1445
|
+
rb_define_module_function(mDCL, "uirset", dcl_uirset, 2);
|
1446
|
+
rb_define_module_function(mDCL, "uirstx", dcl_uirstx, 2);
|
1447
|
+
rb_define_module_function(mDCL, "uirqnp", dcl_uirqnp, 0);
|
1448
|
+
rb_define_module_function(mDCL, "uirqid", dcl_uirqid, 1);
|
1449
|
+
rb_define_module_function(mDCL, "uirqcp", dcl_uirqcp, 1);
|
1450
|
+
rb_define_module_function(mDCL, "uirqcl", dcl_uirqcl, 1);
|
1451
|
+
rb_define_module_function(mDCL, "uirqvl", dcl_uirqvl, 1);
|
1452
|
+
rb_define_module_function(mDCL, "uirsvl", dcl_uirsvl, 2);
|
1453
|
+
rb_define_module_function(mDCL, "uirqin", dcl_uirqin, 1);
|
1454
|
+
rb_define_module_function(mDCL, "uiqfnm", dcl_uiqfnm, 1);
|
1455
|
+
#endif
|
1456
|
+
}
|