ruby-dcl 1.6.2
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +321 -0
- data/GenWrapper/Makefile +14 -0
- data/GenWrapper/cproto2init.rb +41 -0
- data/GenWrapper/dcl_narrayed_funcs.rb +181 -0
- data/GenWrapper/dcl_rb_footing +29 -0
- data/GenWrapper/dcl_rb_heading +129 -0
- data/GenWrapper/def.rb +20 -0
- data/GenWrapper/elim_ary_size.rb +398 -0
- data/GenWrapper/etc/Mk_proto +375 -0
- data/GenWrapper/etc/dcl_gen +13 -0
- data/GenWrapper/etc/p_header +63 -0
- data/GenWrapper/etc/p_init +410 -0
- data/GenWrapper/pparse.rb +137 -0
- data/GenWrapper/proto/Makefile +35 -0
- data/GenWrapper/proto/grph1_00 +17 -0
- data/GenWrapper/proto/grph1_csgi.fp +27 -0
- data/GenWrapper/proto/grph1_scpack.fp +442 -0
- data/GenWrapper/proto/grph1_sgpack.fp +1406 -0
- data/GenWrapper/proto/grph1_slpack.fp +316 -0
- data/GenWrapper/proto/grph1_stpack.fp +411 -0
- data/GenWrapper/proto/grph1_swpack.fp +746 -0
- data/GenWrapper/proto/grph2_00 +16 -0
- data/GenWrapper/proto/grph2_grpack.fp +139 -0
- data/GenWrapper/proto/grph2_ucpack.fp +522 -0
- data/GenWrapper/proto/grph2_udpack.fp +692 -0
- data/GenWrapper/proto/grph2_uepack.fp +601 -0
- data/GenWrapper/proto/grph2_ugpack.fp +436 -0
- data/GenWrapper/proto/grph2_uhpack.fp +246 -0
- data/GenWrapper/proto/grph2_ulpack.fp +516 -0
- data/GenWrapper/proto/grph2_umpack.fp +676 -0
- data/GenWrapper/proto/grph2_uspack.fp +989 -0
- data/GenWrapper/proto/grph2_uupack.fp +663 -0
- data/GenWrapper/proto/grph2_uvpack.fp +246 -0
- data/GenWrapper/proto/grph2_uwpack.fp +203 -0
- data/GenWrapper/proto/grph2_uxpack.fp +295 -0
- data/GenWrapper/proto/grph2_uypack.fp +295 -0
- data/GenWrapper/proto/grph2_uzpack.fp +574 -0
- data/GenWrapper/proto/math1_00 +12 -0
- data/GenWrapper/proto/math1_blklib.fp +58 -0
- data/GenWrapper/proto/math1_chrlib.fp +83 -0
- data/GenWrapper/proto/math1_fnclib.fp +79 -0
- data/GenWrapper/proto/math1_gnmlib.fp +118 -0
- data/GenWrapper/proto/math1_gt2dlib.fp +144 -0
- data/GenWrapper/proto/math1_ifalib.fp +123 -0
- data/GenWrapper/proto/math1_indxlib.fp +222 -0
- data/GenWrapper/proto/math1_intlib.fp +46 -0
- data/GenWrapper/proto/math1_lrllib.fp +276 -0
- data/GenWrapper/proto/math1_maplib.fp +24 -0
- data/GenWrapper/proto/math1_oslib.fp +28 -0
- data/GenWrapper/proto/math1_rfalib.fp +420 -0
- data/GenWrapper/proto/math1_rfblib.fp +51 -0
- data/GenWrapper/proto/math1_sublib.fp +60 -0
- data/GenWrapper/proto/math1_syslib.fp +767 -0
- data/GenWrapper/proto/math1_vialib.fp +339 -0
- data/GenWrapper/proto/math1_viblib.fp +264 -0
- data/GenWrapper/proto/math1_vralib.fp +339 -0
- data/GenWrapper/proto/math1_vrblib.fp +264 -0
- data/GenWrapper/proto/math1_xfclib.fp +68 -0
- data/GenWrapper/proto/math2_00 +12 -0
- data/GenWrapper/proto/math2_fftlib.fp +803 -0
- data/GenWrapper/proto/math2_intrlib.fp +32 -0
- data/GenWrapper/proto/math2_odelib.fp_notused +568 -0
- data/GenWrapper/proto/math2_rnmlib.fp +54 -0
- data/GenWrapper/proto/math2_shtlib.fp +1292 -0
- data/GenWrapper/proto/math2_shtlib.fp_old +1294 -0
- data/GenWrapper/proto/math2_vstlib.fp +84 -0
- data/GenWrapper/proto/misc1_00 +17 -0
- data/GenWrapper/proto/misc1_chnlib.fp +47 -0
- data/GenWrapper/proto/misc1_datelib.fp +352 -0
- data/GenWrapper/proto/misc1_fmtlib.fp +19 -0
- data/GenWrapper/proto/misc1_misclib.fp +26 -0
- data/GenWrapper/proto/misc1_randlib.fp +36 -0
- data/GenWrapper/proto/misc1_timelib.fp +151 -0
- data/GenWrapper/proto2c.rb +13 -0
- data/GenWrapper/prototype.rb +209 -0
- data/GenWrapper/util.rb +9 -0
- data/GenWrapper/variable.rb +671 -0
- data/README +29 -0
- data/Rakefile +44 -0
- data/ToDo +2 -0
- data/dcl_cary2obj.c +354 -0
- data/dcl_narrayed_funcs.c +518 -0
- data/dcl_obj2cary.c +512 -0
- data/dcl_rubydcloriginal.c +129 -0
- data/demo/gokuraku/hop/hop.rb +26 -0
- data/demo/gokuraku/jump/jump1.rb +64 -0
- data/demo/gokuraku/jump/jump2.rb +50 -0
- data/demo/gokuraku/layout/lay1.rb +46 -0
- data/demo/gokuraku/layout/lay2.rb +44 -0
- data/demo/gokuraku/step/step0.rb +34 -0
- data/demo/gokuraku/step/step1.rb +84 -0
- data/demo/gokuraku/step/step2.rb +62 -0
- data/demo/gokuraku/u1d/u1d1.rb +37 -0
- data/demo/gokuraku/u1d/u1d2.rb +50 -0
- data/demo/gokuraku/u2d/u2d1.rb +46 -0
- data/demo/gokuraku/u2d/u2d2.rb +49 -0
- data/demo/gokuraku/u2d/u2d3.rb +45 -0
- data/demo/gokuraku/u2d/u2d4.rb +61 -0
- data/demo/grph1/scpack/scpkt2.rb +40 -0
- data/demo/grph1/scpack/scpkt3.rb +102 -0
- data/demo/grph1/scpack/scpkt6.rb +84 -0
- data/demo/grph1/scpack/scpkt7.rb +59 -0
- data/demo/grph1/scpack/scpkt8.rb +60 -0
- data/demo/grph1/scpack/t810630.dat +296 -0
- data/demo/grph1/scpack/t811231.dat +296 -0
- data/demo/grph1/sgpack/sgfont.rb +52 -0
- data/demo/grph1/sgpack/sgfonz.rb +53 -0
- data/demo/grph1/sgpack/sgksx1.rb +44 -0
- data/demo/grph1/sgpack/sgksx2.rb +90 -0
- data/demo/grph1/sgpack/sgksx3.rb +75 -0
- data/demo/grph1/sgpack/sglidx.rb +40 -0
- data/demo/grph1/sgpack/sgltyp.rb +48 -0
- data/demo/grph1/sgpack/sgpk01.rb +39 -0
- data/demo/grph1/sgpack/sgpk02.rb +79 -0
- data/demo/grph1/sgpack/sgpk03.rb +107 -0
- data/demo/grph1/sgpack/sgpk04.rb +86 -0
- data/demo/grph1/sgpack/sgpk05.rb +66 -0
- data/demo/grph1/sgpack/sgpk06.rb +91 -0
- data/demo/grph1/sgpack/sgpk07.rb +66 -0
- data/demo/grph1/sgpack/sgpk08.rb +67 -0
- data/demo/grph1/sgpack/sgpk09.rb +61 -0
- data/demo/grph1/sgpack/sgpk10.rb +58 -0
- data/demo/grph1/sgpack/sgtclr.rb +59 -0
- data/demo/grph1/sgpack/sgtone.rb +70 -0
- data/demo/grph1/sgpack/sgtonz.rb +66 -0
- data/demo/grph1/slpack/slpk01.rb +37 -0
- data/demo/grph1/slpack/slpk02.rb +29 -0
- data/demo/grph1/slpack/slpk03.rb +36 -0
- data/demo/grph1/slpack/slpk04.rb +36 -0
- data/demo/grph2/g2pack/g2pk01.rb +78 -0
- data/demo/grph2/g2pack/g2pk02.rb +75 -0
- data/demo/grph2/grpack/grpk01.rb +65 -0
- data/demo/grph2/ucpack/ucpk01.rb +95 -0
- data/demo/grph2/ucpack/ucpk02.rb +95 -0
- data/demo/grph2/udegpk/u2df01.rb +50 -0
- data/demo/grph2/udegpk/u2df02.rb +76 -0
- data/demo/grph2/udegpk/u2df03.rb +80 -0
- data/demo/grph2/udegpk/u2df04.rb +52 -0
- data/demo/grph2/udegpk/u2df05.rb +70 -0
- data/demo/grph2/udegpk/u2df06.rb +59 -0
- data/demo/grph2/udegpk/u2df07.rb +68 -0
- data/demo/grph2/udegpk/u2df08.rb +91 -0
- data/demo/grph2/udegpk/u2df09b.rb +88 -0
- data/demo/grph2/udegpk/u2df09c.rb +89 -0
- data/demo/grph2/udegpk/u2df09e.rb +88 -0
- data/demo/grph2/udegpk/u2df09f.rb +89 -0
- data/demo/grph2/ulpack/ulpk01.rb +111 -0
- data/demo/grph2/ulpack/ulpk01n.rb +111 -0
- data/demo/grph2/ulpack/ulpk02.rb +111 -0
- data/demo/grph2/ulpack/ulpk02n.rb +111 -0
- data/demo/grph2/umpack/t811231.dat +296 -0
- data/demo/grph2/umpack/test01.rb +69 -0
- data/demo/grph2/umpack/test02.rb +64 -0
- data/demo/grph2/umpack/test03.rb +84 -0
- data/demo/grph2/umpack/test04.rb +54 -0
- data/demo/grph2/umpack/test05.rb +85 -0
- data/demo/grph2/umpack/test06.rb +44 -0
- data/demo/grph2/umpack/test07.rb +43 -0
- data/demo/grph2/umpack/test08.rb +37 -0
- data/demo/grph2/umpack/test09.rb +86 -0
- data/demo/grph2/umpack/test10.rb +52 -0
- data/demo/grph2/umpack/umpk01.rb +65 -0
- data/demo/grph2/umpack/umpk02.rb +54 -0
- data/demo/grph2/umpack/umpk03.rb +46 -0
- data/demo/grph2/umpack/umpk04.rb +65 -0
- data/demo/grph2/umpack/umpk05.rb +84 -0
- data/demo/grph2/uspack/uspk01.rb +39 -0
- data/demo/grph2/uspack/uspk02.rb +47 -0
- data/demo/grph2/uspack/uspk03.rb +38 -0
- data/demo/grph2/uspack/uspk04.rb +64 -0
- data/demo/grph2/uspack/uspk05.rb +68 -0
- data/demo/grph2/uspack/uspk06.rb +43 -0
- data/demo/grph2/uspack/uspk07.rb +62 -0
- data/demo/grph2/uspack/uspk08.rb +46 -0
- data/demo/grph2/uspack/uspk09.rb +89 -0
- data/demo/grph2/uspack/uspk10.rb +48 -0
- data/demo/grph2/uspack/uspk11.rb +71 -0
- data/demo/grph2/uspack/uspk12.rb +51 -0
- data/demo/grph2/uupack/uupk01.rb +50 -0
- data/demo/grph2/uupack/uupk02.rb +74 -0
- data/demo/grph2/uupack/uupk03.rb +56 -0
- data/demo/grph2/uupack/uupk04.rb +84 -0
- data/demo/grph2/uupack/uupk05.rb +74 -0
- data/demo/grph2/uupack/uupk06.rb +77 -0
- data/demo/grph2/uupack/uupk07.rb +88 -0
- data/demo/grph2/uxyzpk/uxyz01.rb +38 -0
- data/demo/grph2/uxyzpk/uxyz02.rb +36 -0
- data/demo/grph2/uxyzpk/uxyz03.rb +37 -0
- data/demo/grph2/uxyzpk/uxyz04.rb +54 -0
- data/demo/grph2/uxyzpk/uxyz05.rb +41 -0
- data/demo/grph2/uxyzpk/uxyz06.rb +42 -0
- data/demo/grph2/uxyzpk/uxyz07.rb +38 -0
- data/demo/grph2/uxyzpk/uxyz08.rb +60 -0
- data/demo/grph2/uxyzpk/uxyz09.rb +52 -0
- data/demo/grph2/uxyzpk/uxyz10.rb +57 -0
- data/demo/grph2/ximage/MEMO +23 -0
- data/demo/grph2/ximage/tomsclm.dat +1344 -0
- data/demo/grph2/ximage/ximg01.rb +145 -0
- data/demo/math1/gt2dlib/gt2d01.rb +33 -0
- data/demo/math2/fftlib/fftl01.rb +28 -0
- data/demo/math2/fftlib/fftl02.rb +224 -0
- data/demo/math2/intrlib/intr01.rb +22 -0
- data/demo/math2/rnmlib/rnml01.rb +21 -0
- data/demo/math2/vstlib/vstl01.rb +29 -0
- data/demo/math2/vstlib/vstl02.rb +38 -0
- data/demo/rakuraku/color/color1.rb +61 -0
- data/demo/rakuraku/color/color2.rb +57 -0
- data/demo/rakuraku/color/color3.rb +81 -0
- data/demo/rakuraku/kihon/kihon1.rb +39 -0
- data/demo/rakuraku/kihon/kihon2.rb +56 -0
- data/demo/rakuraku/kihon/kihon3.rb +57 -0
- data/demo/rakuraku/kihon/kihon4.rb +70 -0
- data/demo/rakuraku/kihon/kihon5.rb +56 -0
- data/demo/rakuraku/kihon/kihon6.rb +40 -0
- data/demo/rakuraku/kihon/kihon7.rb +98 -0
- data/demo/rakuraku/kihon/kihon8.rb +93 -0
- data/demo/rakuraku/kihon/kihon9.rb +77 -0
- data/demo/rakuraku/kihon/kihona.rb +123 -0
- data/demo/rakuraku/kihon/kihonb.rb +73 -0
- data/demo/rakuraku/kihon/kihonc.rb +110 -0
- data/demo/rakuraku/layout/lay1.rb +29 -0
- data/demo/rakuraku/layout/lay2.rb +28 -0
- data/demo/rakuraku/layout/lay3.rb +29 -0
- data/demo/rakuraku/map3d/map3d1.rb +68 -0
- data/demo/rakuraku/map3d/map3d2.rb +67 -0
- data/demo/rakuraku/map3d/map3d3.rb +66 -0
- data/demo/rakuraku/map3d/map3d4.rb +107 -0
- data/demo/rakuraku/map3d/map3d5.rb +118 -0
- data/demo/rakuraku/map3d/map3d6.rb +96 -0
- data/demo/rakuraku/map3d/map3d7.rb +98 -0
- data/demo/rakuraku/miss/miss1.rb +76 -0
- data/demo/rakuraku/miss/miss2.rb +60 -0
- data/demo/rakuraku/quick/quick1.rb +35 -0
- data/demo/rakuraku/quick/quick2.rb +33 -0
- data/demo/rakuraku/quick/quick3.rb +46 -0
- data/demo/rakuraku/quick/quick4.rb +47 -0
- data/demo/rakuraku/quick/quick5.rb +46 -0
- data/demo/rakuraku/u2d/u2d1.rb +50 -0
- data/demo/rakuraku/u2d/u2d2.rb +51 -0
- data/demo/rakuraku/u2d/u2d3.rb +70 -0
- data/demo/rakuraku/u2d/u2d4.rb +59 -0
- data/demo/rakuraku/u2d/u2d5.rb +61 -0
- data/demo/rakuraku/u2d/u2d6.rb +57 -0
- data/demo/rakuraku/u2d/u2d7.rb +103 -0
- data/demo/rakuraku/uspack/uspac1.rb +35 -0
- data/demo/rakuraku/uspack/uspac2.rb +66 -0
- data/demo/rakuraku/uspack/uspac3.rb +37 -0
- data/demo/rakuraku/uspack/uspac4.rb +49 -0
- data/demo/rakuraku/uxyz/uxyz1.rb +37 -0
- data/demo/rakuraku/uxyz/uxyz2.rb +35 -0
- data/demo/rakuraku/uxyz/uxyz3.rb +38 -0
- data/demo/rakuraku/uxyz/uxyz4.rb +36 -0
- data/demo/rakuraku/uxyz/uxyz5.rb +57 -0
- data/demo/rakuraku/uxyz/uxyz6.rb +43 -0
- data/demo/rakuraku/uxyz/uxyz7.rb +39 -0
- data/demo/rakuraku/uxyz/uxyz8.rb +56 -0
- data/demo/rubydcloriginal/uemrkz1.rb +37 -0
- data/dummy.c +9 -0
- data/extconf.rb +133 -0
- data/grph1_csgi.c +119 -0
- data/grph1_scpack.c +1388 -0
- data/grph1_sgpack.c +3876 -0
- data/grph1_slpack.c +432 -0
- data/grph1_stpack.c +1044 -0
- data/grph1_swpack.c +1922 -0
- data/grph1_zgpack.c.org +141 -0
- data/grph2_grpack.c +368 -0
- data/grph2_ucpack.c +1232 -0
- data/grph2_udpack.c +1404 -0
- data/grph2_uepack.c +1443 -0
- data/grph2_ugpack.c +1073 -0
- data/grph2_uhpack.c +943 -0
- data/grph2_ulpack.c +1304 -0
- data/grph2_umpack.c +1540 -0
- data/grph2_uspack.c +2481 -0
- data/grph2_uupack.c +1689 -0
- data/grph2_uvpack.c +943 -0
- data/grph2_uwpack.c +552 -0
- data/grph2_uxpack.c +555 -0
- data/grph2_uypack.c +555 -0
- data/grph2_uzpack.c +1455 -0
- data/init.c.default +187 -0
- data/init.c.gtk +189 -0
- data/lib/dcl.rb +5084 -0
- data/math1_blklib.c +227 -0
- data/math1_chrlib.c +239 -0
- data/math1_fnclib.c +254 -0
- data/math1_gnmlib.c +356 -0
- data/math1_gt2dlib.c +514 -0
- data/math1_ifalib.c +427 -0
- data/math1_indxlib.c +709 -0
- data/math1_intlib.c +167 -0
- data/math1_lrllib.c +817 -0
- data/math1_maplib.c +172 -0
- data/math1_oslib.c +111 -0
- data/math1_rfalib.c +1417 -0
- data/math1_rfblib.c +232 -0
- data/math1_sublib.c +221 -0
- data/math1_syslib.c +2025 -0
- data/math1_vialib.c +1156 -0
- data/math1_viblib.c +1027 -0
- data/math1_vralib.c +1156 -0
- data/math1_vrblib.c +1027 -0
- data/math1_xfclib.c +142 -0
- data/math2_fftlib.c +833 -0
- data/math2_intrlib.c +138 -0
- data/math2_rnmlib.c +226 -0
- data/math2_shtlib.c +1568 -0
- data/math2_vstlib.c +366 -0
- data/misc1_chnlib.c +179 -0
- data/misc1_datelib.c +953 -0
- data/misc1_fmtlib.c +99 -0
- data/misc1_misclib.c +118 -0
- data/misc1_randlib.c +142 -0
- data/misc1_timelib.c +380 -0
- data/obsolete/README +2 -0
- data/obsolete/dcl_ext.html +112 -0
- data/obsolete/dcl_ext.rb +313 -0
- metadata +433 -0
data/grph2_uspack.c
ADDED
@@ -0,0 +1,2481 @@
|
|
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
|
+
static VALUE
|
65
|
+
dcl_usgrph(obj, n, x, y)
|
66
|
+
VALUE obj, n, x, y;
|
67
|
+
{
|
68
|
+
integer i_n;
|
69
|
+
real *i_x;
|
70
|
+
real *i_y;
|
71
|
+
|
72
|
+
if ((TYPE(n) != T_BIGNUM) || (TYPE(n) != T_FIXNUM)) {
|
73
|
+
n = rb_funcall(n, rb_intern("to_i"), 0);
|
74
|
+
}
|
75
|
+
if (TYPE(x) == T_FLOAT) {
|
76
|
+
x = rb_Array(x);
|
77
|
+
}
|
78
|
+
/* if ((TYPE(x) != T_ARRAY) &&
|
79
|
+
(rb_obj_is_kind_of(x, cNArray) != Qtrue)) {
|
80
|
+
rb_raise(rb_eTypeError, "invalid type");
|
81
|
+
} -- no check since obj2c*ary will do that */
|
82
|
+
if (TYPE(y) == T_FLOAT) {
|
83
|
+
y = rb_Array(y);
|
84
|
+
}
|
85
|
+
/* if ((TYPE(y) != T_ARRAY) &&
|
86
|
+
(rb_obj_is_kind_of(y, cNArray) != Qtrue)) {
|
87
|
+
rb_raise(rb_eTypeError, "invalid type");
|
88
|
+
} -- no check since obj2c*ary will do that */
|
89
|
+
|
90
|
+
i_n = NUM2INT(n);
|
91
|
+
i_x = dcl_obj2crealary(x);
|
92
|
+
i_y = dcl_obj2crealary(y);
|
93
|
+
|
94
|
+
|
95
|
+
usgrph_(&i_n, i_x, i_y);
|
96
|
+
|
97
|
+
dcl_freecrealary(i_x);
|
98
|
+
dcl_freecrealary(i_y);
|
99
|
+
|
100
|
+
return Qnil;
|
101
|
+
|
102
|
+
}
|
103
|
+
|
104
|
+
static VALUE
|
105
|
+
dcl_ussttl(obj, cxttl, cxunit, cyttl, cyunit)
|
106
|
+
VALUE obj, cxttl, cxunit, cyttl, cyunit;
|
107
|
+
{
|
108
|
+
char *i_cxttl;
|
109
|
+
char *i_cxunit;
|
110
|
+
char *i_cyttl;
|
111
|
+
char *i_cyunit;
|
112
|
+
|
113
|
+
if (TYPE(cxttl) != T_STRING) {
|
114
|
+
cxttl = rb_funcall(cxttl, rb_intern("to_str"), 0);
|
115
|
+
}
|
116
|
+
if (TYPE(cxunit) != T_STRING) {
|
117
|
+
cxunit = rb_funcall(cxunit, rb_intern("to_str"), 0);
|
118
|
+
}
|
119
|
+
if (TYPE(cyttl) != T_STRING) {
|
120
|
+
cyttl = rb_funcall(cyttl, rb_intern("to_str"), 0);
|
121
|
+
}
|
122
|
+
if (TYPE(cyunit) != T_STRING) {
|
123
|
+
cyunit = rb_funcall(cyunit, rb_intern("to_str"), 0);
|
124
|
+
}
|
125
|
+
|
126
|
+
i_cxttl = StringValuePtr(cxttl);
|
127
|
+
i_cxunit = StringValuePtr(cxunit);
|
128
|
+
i_cyttl = StringValuePtr(cyttl);
|
129
|
+
i_cyunit = StringValuePtr(cyunit);
|
130
|
+
|
131
|
+
|
132
|
+
ussttl_(i_cxttl, i_cxunit, i_cyttl, i_cyunit, (ftnlen)strlen(i_cxttl), (ftnlen)strlen(i_cxunit), (ftnlen)strlen(i_cyttl), (ftnlen)strlen(i_cyunit));
|
133
|
+
|
134
|
+
return Qnil;
|
135
|
+
|
136
|
+
}
|
137
|
+
|
138
|
+
static VALUE
|
139
|
+
dcl_usspnt(obj, n, x, y)
|
140
|
+
VALUE obj, n, x, y;
|
141
|
+
{
|
142
|
+
integer i_n;
|
143
|
+
real *i_x;
|
144
|
+
real *i_y;
|
145
|
+
|
146
|
+
if ((TYPE(n) != T_BIGNUM) || (TYPE(n) != T_FIXNUM)) {
|
147
|
+
n = rb_funcall(n, rb_intern("to_i"), 0);
|
148
|
+
}
|
149
|
+
if (TYPE(x) == T_FLOAT) {
|
150
|
+
x = rb_Array(x);
|
151
|
+
}
|
152
|
+
/* if ((TYPE(x) != T_ARRAY) &&
|
153
|
+
(rb_obj_is_kind_of(x, cNArray) != Qtrue)) {
|
154
|
+
rb_raise(rb_eTypeError, "invalid type");
|
155
|
+
} -- no check since obj2c*ary will do that */
|
156
|
+
if (TYPE(y) == T_FLOAT) {
|
157
|
+
y = rb_Array(y);
|
158
|
+
}
|
159
|
+
/* if ((TYPE(y) != T_ARRAY) &&
|
160
|
+
(rb_obj_is_kind_of(y, cNArray) != Qtrue)) {
|
161
|
+
rb_raise(rb_eTypeError, "invalid type");
|
162
|
+
} -- no check since obj2c*ary will do that */
|
163
|
+
|
164
|
+
i_n = NUM2INT(n);
|
165
|
+
i_x = dcl_obj2crealary(x);
|
166
|
+
i_y = dcl_obj2crealary(y);
|
167
|
+
|
168
|
+
|
169
|
+
usspnt_(&i_n, i_x, i_y);
|
170
|
+
|
171
|
+
dcl_freecrealary(i_x);
|
172
|
+
dcl_freecrealary(i_y);
|
173
|
+
|
174
|
+
return Qnil;
|
175
|
+
|
176
|
+
}
|
177
|
+
|
178
|
+
static VALUE
|
179
|
+
dcl_uspfit(obj)
|
180
|
+
VALUE obj;
|
181
|
+
{
|
182
|
+
uspfit_();
|
183
|
+
|
184
|
+
return Qnil;
|
185
|
+
|
186
|
+
}
|
187
|
+
|
188
|
+
static VALUE
|
189
|
+
dcl_usdaxs(obj)
|
190
|
+
VALUE obj;
|
191
|
+
{
|
192
|
+
usdaxs_();
|
193
|
+
|
194
|
+
return Qnil;
|
195
|
+
|
196
|
+
}
|
197
|
+
|
198
|
+
static VALUE
|
199
|
+
dcl_usinit(obj)
|
200
|
+
VALUE obj;
|
201
|
+
{
|
202
|
+
usinit_();
|
203
|
+
|
204
|
+
return Qnil;
|
205
|
+
|
206
|
+
}
|
207
|
+
|
208
|
+
static VALUE
|
209
|
+
dcl_uspqnp(obj)
|
210
|
+
VALUE obj;
|
211
|
+
{
|
212
|
+
integer o_ncp;
|
213
|
+
VALUE ncp;
|
214
|
+
|
215
|
+
uspqnp_(&o_ncp);
|
216
|
+
|
217
|
+
ncp = INT2NUM(o_ncp);
|
218
|
+
|
219
|
+
|
220
|
+
return ncp;
|
221
|
+
|
222
|
+
}
|
223
|
+
|
224
|
+
static VALUE
|
225
|
+
dcl_uspqid(obj, cp)
|
226
|
+
VALUE obj, cp;
|
227
|
+
{
|
228
|
+
char *i_cp;
|
229
|
+
integer o_idx;
|
230
|
+
VALUE idx;
|
231
|
+
|
232
|
+
if (TYPE(cp) != T_STRING) {
|
233
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
234
|
+
}
|
235
|
+
|
236
|
+
i_cp = StringValuePtr(cp);
|
237
|
+
|
238
|
+
|
239
|
+
uspqid_(i_cp, &o_idx, (ftnlen)strlen(i_cp));
|
240
|
+
|
241
|
+
idx = INT2NUM(o_idx);
|
242
|
+
|
243
|
+
|
244
|
+
return idx;
|
245
|
+
|
246
|
+
}
|
247
|
+
|
248
|
+
static VALUE
|
249
|
+
dcl_uspqcp(obj, idx)
|
250
|
+
VALUE obj, idx;
|
251
|
+
{
|
252
|
+
integer i_idx;
|
253
|
+
char *o_cp;
|
254
|
+
VALUE cp;
|
255
|
+
|
256
|
+
if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
|
257
|
+
idx = rb_funcall(idx, rb_intern("to_i"), 0);
|
258
|
+
}
|
259
|
+
|
260
|
+
i_idx = NUM2INT(idx);
|
261
|
+
|
262
|
+
o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
|
263
|
+
memset(o_cp, '\0', DFLT_SIZE+1);
|
264
|
+
|
265
|
+
uspqcp_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
|
266
|
+
|
267
|
+
cp = rb_str_new2(o_cp);
|
268
|
+
|
269
|
+
|
270
|
+
return cp;
|
271
|
+
|
272
|
+
}
|
273
|
+
|
274
|
+
static VALUE
|
275
|
+
dcl_uspqcl(obj, idx)
|
276
|
+
VALUE obj, idx;
|
277
|
+
{
|
278
|
+
integer i_idx;
|
279
|
+
char *o_cp;
|
280
|
+
VALUE cp;
|
281
|
+
|
282
|
+
if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
|
283
|
+
idx = rb_funcall(idx, rb_intern("to_i"), 0);
|
284
|
+
}
|
285
|
+
|
286
|
+
i_idx = NUM2INT(idx);
|
287
|
+
|
288
|
+
o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
|
289
|
+
memset(o_cp, '\0', DFLT_SIZE+1);
|
290
|
+
|
291
|
+
uspqcl_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
|
292
|
+
|
293
|
+
cp = rb_str_new2(o_cp);
|
294
|
+
|
295
|
+
|
296
|
+
return cp;
|
297
|
+
|
298
|
+
}
|
299
|
+
|
300
|
+
static VALUE
|
301
|
+
dcl_uspqit(obj, idx)
|
302
|
+
VALUE obj, idx;
|
303
|
+
{
|
304
|
+
integer i_idx;
|
305
|
+
integer o_itp;
|
306
|
+
VALUE itp;
|
307
|
+
|
308
|
+
if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
|
309
|
+
idx = rb_funcall(idx, rb_intern("to_i"), 0);
|
310
|
+
}
|
311
|
+
|
312
|
+
i_idx = NUM2INT(idx);
|
313
|
+
|
314
|
+
|
315
|
+
uspqit_(&i_idx, &o_itp);
|
316
|
+
|
317
|
+
itp = INT2NUM(o_itp);
|
318
|
+
|
319
|
+
|
320
|
+
return itp;
|
321
|
+
|
322
|
+
}
|
323
|
+
|
324
|
+
static VALUE
|
325
|
+
dcl_uspqvl(obj, idx)
|
326
|
+
VALUE obj, idx;
|
327
|
+
{
|
328
|
+
integer i_idx;
|
329
|
+
integer o_ipara;
|
330
|
+
VALUE ipara;
|
331
|
+
|
332
|
+
if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
|
333
|
+
idx = rb_funcall(idx, rb_intern("to_i"), 0);
|
334
|
+
}
|
335
|
+
|
336
|
+
i_idx = NUM2INT(idx);
|
337
|
+
|
338
|
+
|
339
|
+
uspqvl_(&i_idx, &o_ipara);
|
340
|
+
|
341
|
+
ipara = INT2NUM(o_ipara);
|
342
|
+
|
343
|
+
|
344
|
+
return ipara;
|
345
|
+
|
346
|
+
}
|
347
|
+
|
348
|
+
static VALUE
|
349
|
+
dcl_uspsvl(obj, idx, ipara)
|
350
|
+
VALUE obj, idx, ipara;
|
351
|
+
{
|
352
|
+
integer i_idx;
|
353
|
+
integer i_ipara;
|
354
|
+
|
355
|
+
if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
|
356
|
+
idx = rb_funcall(idx, rb_intern("to_i"), 0);
|
357
|
+
}
|
358
|
+
if ((TYPE(ipara) != T_BIGNUM) || (TYPE(ipara) != T_FIXNUM)) {
|
359
|
+
ipara = rb_funcall(ipara, rb_intern("to_i"), 0);
|
360
|
+
}
|
361
|
+
|
362
|
+
i_idx = NUM2INT(idx);
|
363
|
+
i_ipara = NUM2INT(ipara);
|
364
|
+
|
365
|
+
|
366
|
+
uspsvl_(&i_idx, &i_ipara);
|
367
|
+
|
368
|
+
return Qnil;
|
369
|
+
|
370
|
+
}
|
371
|
+
|
372
|
+
static VALUE
|
373
|
+
dcl_uspqin(obj, cp)
|
374
|
+
VALUE obj, cp;
|
375
|
+
{
|
376
|
+
char *i_cp;
|
377
|
+
integer o_in;
|
378
|
+
VALUE in;
|
379
|
+
|
380
|
+
if (TYPE(cp) != T_STRING) {
|
381
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
382
|
+
}
|
383
|
+
|
384
|
+
i_cp = StringValuePtr(cp);
|
385
|
+
|
386
|
+
|
387
|
+
uspqin_(i_cp, &o_in, (ftnlen)strlen(i_cp));
|
388
|
+
|
389
|
+
in = INT2NUM(o_in);
|
390
|
+
|
391
|
+
|
392
|
+
return in;
|
393
|
+
|
394
|
+
}
|
395
|
+
|
396
|
+
static VALUE
|
397
|
+
dcl_uscget(obj, cp)
|
398
|
+
VALUE obj, cp;
|
399
|
+
{
|
400
|
+
char *i_cp;
|
401
|
+
char *o_cpara;
|
402
|
+
VALUE cpara;
|
403
|
+
|
404
|
+
if (TYPE(cp) != T_STRING) {
|
405
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
406
|
+
}
|
407
|
+
|
408
|
+
i_cp = StringValuePtr(cp);
|
409
|
+
|
410
|
+
o_cpara= ALLOCA_N(char, (DFLT_SIZE+1));
|
411
|
+
memset(o_cpara, '\0', DFLT_SIZE+1);
|
412
|
+
|
413
|
+
uscget_(i_cp, o_cpara, (ftnlen)strlen(i_cp), (ftnlen)DFLT_SIZE);
|
414
|
+
|
415
|
+
cpara = rb_str_new2(o_cpara);
|
416
|
+
|
417
|
+
|
418
|
+
return cpara;
|
419
|
+
|
420
|
+
}
|
421
|
+
|
422
|
+
static VALUE
|
423
|
+
dcl_uscset(obj, cp, cpara)
|
424
|
+
VALUE obj, cp, cpara;
|
425
|
+
{
|
426
|
+
char *i_cp;
|
427
|
+
char *i_cpara;
|
428
|
+
|
429
|
+
if (TYPE(cp) != T_STRING) {
|
430
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
431
|
+
}
|
432
|
+
if (TYPE(cpara) != T_STRING) {
|
433
|
+
cpara = rb_funcall(cpara, rb_intern("to_str"), 0);
|
434
|
+
}
|
435
|
+
|
436
|
+
i_cp = StringValuePtr(cp);
|
437
|
+
i_cpara = StringValuePtr(cpara);
|
438
|
+
|
439
|
+
|
440
|
+
uscset_(i_cp, i_cpara, (ftnlen)strlen(i_cp), (ftnlen)strlen(i_cpara));
|
441
|
+
|
442
|
+
return Qnil;
|
443
|
+
|
444
|
+
}
|
445
|
+
|
446
|
+
static VALUE
|
447
|
+
dcl_uscstx(obj, cp, cpara)
|
448
|
+
VALUE obj, cp, cpara;
|
449
|
+
{
|
450
|
+
char *i_cp;
|
451
|
+
char *i_cpara;
|
452
|
+
|
453
|
+
if (TYPE(cp) != T_STRING) {
|
454
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
455
|
+
}
|
456
|
+
if (TYPE(cpara) != T_STRING) {
|
457
|
+
cpara = rb_funcall(cpara, rb_intern("to_str"), 0);
|
458
|
+
}
|
459
|
+
|
460
|
+
i_cp = StringValuePtr(cp);
|
461
|
+
i_cpara = StringValuePtr(cpara);
|
462
|
+
|
463
|
+
|
464
|
+
uscstx_(i_cp, i_cpara, (ftnlen)strlen(i_cp), (ftnlen)strlen(i_cpara));
|
465
|
+
|
466
|
+
return Qnil;
|
467
|
+
|
468
|
+
}
|
469
|
+
|
470
|
+
static VALUE
|
471
|
+
dcl_uscqnp(obj)
|
472
|
+
VALUE obj;
|
473
|
+
{
|
474
|
+
integer o_ncp;
|
475
|
+
VALUE ncp;
|
476
|
+
|
477
|
+
uscqnp_(&o_ncp);
|
478
|
+
|
479
|
+
ncp = INT2NUM(o_ncp);
|
480
|
+
|
481
|
+
|
482
|
+
return ncp;
|
483
|
+
|
484
|
+
}
|
485
|
+
|
486
|
+
static VALUE
|
487
|
+
dcl_uscqid(obj, cp)
|
488
|
+
VALUE obj, cp;
|
489
|
+
{
|
490
|
+
char *i_cp;
|
491
|
+
integer o_idx;
|
492
|
+
VALUE idx;
|
493
|
+
|
494
|
+
if (TYPE(cp) != T_STRING) {
|
495
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
496
|
+
}
|
497
|
+
|
498
|
+
i_cp = StringValuePtr(cp);
|
499
|
+
|
500
|
+
|
501
|
+
uscqid_(i_cp, &o_idx, (ftnlen)strlen(i_cp));
|
502
|
+
|
503
|
+
idx = INT2NUM(o_idx);
|
504
|
+
|
505
|
+
|
506
|
+
return idx;
|
507
|
+
|
508
|
+
}
|
509
|
+
|
510
|
+
static VALUE
|
511
|
+
dcl_uscqcp(obj, idx)
|
512
|
+
VALUE obj, idx;
|
513
|
+
{
|
514
|
+
integer i_idx;
|
515
|
+
char *o_cp;
|
516
|
+
VALUE cp;
|
517
|
+
|
518
|
+
if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
|
519
|
+
idx = rb_funcall(idx, rb_intern("to_i"), 0);
|
520
|
+
}
|
521
|
+
|
522
|
+
i_idx = NUM2INT(idx);
|
523
|
+
|
524
|
+
o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
|
525
|
+
memset(o_cp, '\0', DFLT_SIZE+1);
|
526
|
+
|
527
|
+
uscqcp_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
|
528
|
+
|
529
|
+
cp = rb_str_new2(o_cp);
|
530
|
+
|
531
|
+
|
532
|
+
return cp;
|
533
|
+
|
534
|
+
}
|
535
|
+
|
536
|
+
static VALUE
|
537
|
+
dcl_uscqcl(obj, idx)
|
538
|
+
VALUE obj, idx;
|
539
|
+
{
|
540
|
+
integer i_idx;
|
541
|
+
char *o_cp;
|
542
|
+
VALUE cp;
|
543
|
+
|
544
|
+
if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
|
545
|
+
idx = rb_funcall(idx, rb_intern("to_i"), 0);
|
546
|
+
}
|
547
|
+
|
548
|
+
i_idx = NUM2INT(idx);
|
549
|
+
|
550
|
+
o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
|
551
|
+
memset(o_cp, '\0', DFLT_SIZE+1);
|
552
|
+
|
553
|
+
uscqcl_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
|
554
|
+
|
555
|
+
cp = rb_str_new2(o_cp);
|
556
|
+
|
557
|
+
|
558
|
+
return cp;
|
559
|
+
|
560
|
+
}
|
561
|
+
|
562
|
+
static VALUE
|
563
|
+
dcl_uscqvl(obj, idx)
|
564
|
+
VALUE obj, idx;
|
565
|
+
{
|
566
|
+
integer i_idx;
|
567
|
+
char *o_cval;
|
568
|
+
VALUE cval;
|
569
|
+
|
570
|
+
if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
|
571
|
+
idx = rb_funcall(idx, rb_intern("to_i"), 0);
|
572
|
+
}
|
573
|
+
|
574
|
+
i_idx = NUM2INT(idx);
|
575
|
+
|
576
|
+
o_cval= ALLOCA_N(char, (DFLT_SIZE+1));
|
577
|
+
memset(o_cval, '\0', DFLT_SIZE+1);
|
578
|
+
|
579
|
+
uscqvl_(&i_idx, o_cval, (ftnlen)DFLT_SIZE);
|
580
|
+
|
581
|
+
cval = rb_str_new2(o_cval);
|
582
|
+
|
583
|
+
|
584
|
+
return cval;
|
585
|
+
|
586
|
+
}
|
587
|
+
|
588
|
+
static VALUE
|
589
|
+
dcl_uscsvl(obj, idx, cval)
|
590
|
+
VALUE obj, idx, cval;
|
591
|
+
{
|
592
|
+
integer i_idx;
|
593
|
+
char *i_cval;
|
594
|
+
|
595
|
+
if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
|
596
|
+
idx = rb_funcall(idx, rb_intern("to_i"), 0);
|
597
|
+
}
|
598
|
+
if (TYPE(cval) != T_STRING) {
|
599
|
+
cval = rb_funcall(cval, rb_intern("to_str"), 0);
|
600
|
+
}
|
601
|
+
|
602
|
+
i_idx = NUM2INT(idx);
|
603
|
+
i_cval = StringValuePtr(cval);
|
604
|
+
|
605
|
+
|
606
|
+
uscsvl_(&i_idx, i_cval, (ftnlen)strlen(i_cval));
|
607
|
+
|
608
|
+
return Qnil;
|
609
|
+
|
610
|
+
}
|
611
|
+
|
612
|
+
static VALUE
|
613
|
+
dcl_uscqin(obj, cp)
|
614
|
+
VALUE obj, cp;
|
615
|
+
{
|
616
|
+
char *i_cp;
|
617
|
+
integer o_in;
|
618
|
+
VALUE in;
|
619
|
+
|
620
|
+
if (TYPE(cp) != T_STRING) {
|
621
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
622
|
+
}
|
623
|
+
|
624
|
+
i_cp = StringValuePtr(cp);
|
625
|
+
|
626
|
+
|
627
|
+
uscqin_(i_cp, &o_in, (ftnlen)strlen(i_cp));
|
628
|
+
|
629
|
+
in = INT2NUM(o_in);
|
630
|
+
|
631
|
+
|
632
|
+
return in;
|
633
|
+
|
634
|
+
}
|
635
|
+
|
636
|
+
static VALUE
|
637
|
+
dcl_usurdl(obj, umin, umax, vmin, vmax)
|
638
|
+
VALUE obj, umin, umax, vmin, vmax;
|
639
|
+
{
|
640
|
+
real io_umin;
|
641
|
+
real io_umax;
|
642
|
+
real i_vmin;
|
643
|
+
real i_vmax;
|
644
|
+
|
645
|
+
if (TYPE(umin) != T_FLOAT) {
|
646
|
+
umin = rb_funcall(umin, rb_intern("to_f"), 0);
|
647
|
+
}
|
648
|
+
if (TYPE(umax) != T_FLOAT) {
|
649
|
+
umax = rb_funcall(umax, rb_intern("to_f"), 0);
|
650
|
+
}
|
651
|
+
if (TYPE(vmin) != T_FLOAT) {
|
652
|
+
vmin = rb_funcall(vmin, rb_intern("to_f"), 0);
|
653
|
+
}
|
654
|
+
if (TYPE(vmax) != T_FLOAT) {
|
655
|
+
vmax = rb_funcall(vmax, rb_intern("to_f"), 0);
|
656
|
+
}
|
657
|
+
|
658
|
+
io_umin = (real)NUM2DBL(umin);
|
659
|
+
io_umax = (real)NUM2DBL(umax);
|
660
|
+
i_vmin = (real)NUM2DBL(vmin);
|
661
|
+
i_vmax = (real)NUM2DBL(vmax);
|
662
|
+
|
663
|
+
|
664
|
+
usurdl_(&io_umin, &io_umax, &i_vmin, &i_vmax);
|
665
|
+
|
666
|
+
umin = rb_float_new((double)io_umin);
|
667
|
+
umax = rb_float_new((double)io_umax);
|
668
|
+
|
669
|
+
|
670
|
+
return rb_ary_new3(2, umin, umax);
|
671
|
+
|
672
|
+
}
|
673
|
+
|
674
|
+
static VALUE
|
675
|
+
dcl_usxaxs(obj, cside)
|
676
|
+
VALUE obj, cside;
|
677
|
+
{
|
678
|
+
char *i_cside;
|
679
|
+
|
680
|
+
if (TYPE(cside) != T_STRING) {
|
681
|
+
cside = rb_funcall(cside, rb_intern("to_str"), 0);
|
682
|
+
}
|
683
|
+
|
684
|
+
i_cside = StringValuePtr(cside);
|
685
|
+
|
686
|
+
|
687
|
+
usxaxs_(i_cside, (ftnlen)strlen(i_cside));
|
688
|
+
|
689
|
+
return Qnil;
|
690
|
+
|
691
|
+
}
|
692
|
+
|
693
|
+
static VALUE
|
694
|
+
dcl_usyaxs(obj, cside)
|
695
|
+
VALUE obj, cside;
|
696
|
+
{
|
697
|
+
char *i_cside;
|
698
|
+
|
699
|
+
if (TYPE(cside) != T_STRING) {
|
700
|
+
cside = rb_funcall(cside, rb_intern("to_str"), 0);
|
701
|
+
}
|
702
|
+
|
703
|
+
i_cside = StringValuePtr(cside);
|
704
|
+
|
705
|
+
|
706
|
+
usyaxs_(i_cside, (ftnlen)strlen(i_cside));
|
707
|
+
|
708
|
+
return Qnil;
|
709
|
+
|
710
|
+
}
|
711
|
+
|
712
|
+
static VALUE
|
713
|
+
dcl_ususcu(obj, caxis, umin, umax, vmin, vmax, mode)
|
714
|
+
VALUE obj, caxis, umin, umax, vmin, vmax, mode;
|
715
|
+
{
|
716
|
+
char *i_caxis;
|
717
|
+
real i_umin;
|
718
|
+
real i_umax;
|
719
|
+
real i_vmin;
|
720
|
+
real i_vmax;
|
721
|
+
integer i_mode;
|
722
|
+
|
723
|
+
if (TYPE(caxis) != T_STRING) {
|
724
|
+
caxis = rb_funcall(caxis, rb_intern("to_str"), 0);
|
725
|
+
}
|
726
|
+
if (TYPE(umin) != T_FLOAT) {
|
727
|
+
umin = rb_funcall(umin, rb_intern("to_f"), 0);
|
728
|
+
}
|
729
|
+
if (TYPE(umax) != T_FLOAT) {
|
730
|
+
umax = rb_funcall(umax, rb_intern("to_f"), 0);
|
731
|
+
}
|
732
|
+
if (TYPE(vmin) != T_FLOAT) {
|
733
|
+
vmin = rb_funcall(vmin, rb_intern("to_f"), 0);
|
734
|
+
}
|
735
|
+
if (TYPE(vmax) != T_FLOAT) {
|
736
|
+
vmax = rb_funcall(vmax, rb_intern("to_f"), 0);
|
737
|
+
}
|
738
|
+
if ((TYPE(mode) != T_BIGNUM) || (TYPE(mode) != T_FIXNUM)) {
|
739
|
+
mode = rb_funcall(mode, rb_intern("to_i"), 0);
|
740
|
+
}
|
741
|
+
|
742
|
+
i_caxis = StringValuePtr(caxis);
|
743
|
+
i_umin = (real)NUM2DBL(umin);
|
744
|
+
i_umax = (real)NUM2DBL(umax);
|
745
|
+
i_vmin = (real)NUM2DBL(vmin);
|
746
|
+
i_vmax = (real)NUM2DBL(vmax);
|
747
|
+
i_mode = NUM2INT(mode);
|
748
|
+
|
749
|
+
|
750
|
+
ususcu_(i_caxis, &i_umin, &i_umax, &i_vmin, &i_vmax, &i_mode, (ftnlen)strlen(i_caxis));
|
751
|
+
|
752
|
+
return Qnil;
|
753
|
+
|
754
|
+
}
|
755
|
+
|
756
|
+
static VALUE
|
757
|
+
dcl_ususcl(obj, caxis, umin, umax, vmin, vmax)
|
758
|
+
VALUE obj, caxis, umin, umax, vmin, vmax;
|
759
|
+
{
|
760
|
+
char *i_caxis;
|
761
|
+
real i_umin;
|
762
|
+
real i_umax;
|
763
|
+
real i_vmin;
|
764
|
+
real i_vmax;
|
765
|
+
|
766
|
+
if (TYPE(caxis) != T_STRING) {
|
767
|
+
caxis = rb_funcall(caxis, rb_intern("to_str"), 0);
|
768
|
+
}
|
769
|
+
if (TYPE(umin) != T_FLOAT) {
|
770
|
+
umin = rb_funcall(umin, rb_intern("to_f"), 0);
|
771
|
+
}
|
772
|
+
if (TYPE(umax) != T_FLOAT) {
|
773
|
+
umax = rb_funcall(umax, rb_intern("to_f"), 0);
|
774
|
+
}
|
775
|
+
if (TYPE(vmin) != T_FLOAT) {
|
776
|
+
vmin = rb_funcall(vmin, rb_intern("to_f"), 0);
|
777
|
+
}
|
778
|
+
if (TYPE(vmax) != T_FLOAT) {
|
779
|
+
vmax = rb_funcall(vmax, rb_intern("to_f"), 0);
|
780
|
+
}
|
781
|
+
|
782
|
+
i_caxis = StringValuePtr(caxis);
|
783
|
+
i_umin = (real)NUM2DBL(umin);
|
784
|
+
i_umax = (real)NUM2DBL(umax);
|
785
|
+
i_vmin = (real)NUM2DBL(vmin);
|
786
|
+
i_vmax = (real)NUM2DBL(vmax);
|
787
|
+
|
788
|
+
|
789
|
+
ususcl_(i_caxis, &i_umin, &i_umax, &i_vmin, &i_vmax, (ftnlen)strlen(i_caxis));
|
790
|
+
|
791
|
+
return Qnil;
|
792
|
+
|
793
|
+
}
|
794
|
+
|
795
|
+
static VALUE
|
796
|
+
dcl_usxaxu(obj, cxs)
|
797
|
+
VALUE obj, cxs;
|
798
|
+
{
|
799
|
+
char *i_cxs;
|
800
|
+
|
801
|
+
if (TYPE(cxs) != T_STRING) {
|
802
|
+
cxs = rb_funcall(cxs, rb_intern("to_str"), 0);
|
803
|
+
}
|
804
|
+
|
805
|
+
i_cxs = StringValuePtr(cxs);
|
806
|
+
|
807
|
+
|
808
|
+
usxaxu_(i_cxs, (ftnlen)strlen(i_cxs));
|
809
|
+
|
810
|
+
return Qnil;
|
811
|
+
|
812
|
+
}
|
813
|
+
|
814
|
+
static VALUE
|
815
|
+
dcl_usxaxl(obj, cxs)
|
816
|
+
VALUE obj, cxs;
|
817
|
+
{
|
818
|
+
char *i_cxs;
|
819
|
+
|
820
|
+
if (TYPE(cxs) != T_STRING) {
|
821
|
+
cxs = rb_funcall(cxs, rb_intern("to_str"), 0);
|
822
|
+
}
|
823
|
+
|
824
|
+
i_cxs = StringValuePtr(cxs);
|
825
|
+
|
826
|
+
|
827
|
+
usxaxl_(i_cxs, (ftnlen)strlen(i_cxs));
|
828
|
+
|
829
|
+
return Qnil;
|
830
|
+
|
831
|
+
}
|
832
|
+
|
833
|
+
static VALUE
|
834
|
+
dcl_usyaxu(obj, cys)
|
835
|
+
VALUE obj, cys;
|
836
|
+
{
|
837
|
+
char *i_cys;
|
838
|
+
|
839
|
+
if (TYPE(cys) != T_STRING) {
|
840
|
+
cys = rb_funcall(cys, rb_intern("to_str"), 0);
|
841
|
+
}
|
842
|
+
|
843
|
+
i_cys = StringValuePtr(cys);
|
844
|
+
|
845
|
+
|
846
|
+
usyaxu_(i_cys, (ftnlen)strlen(i_cys));
|
847
|
+
|
848
|
+
return Qnil;
|
849
|
+
|
850
|
+
}
|
851
|
+
|
852
|
+
static VALUE
|
853
|
+
dcl_usyaxl(obj, cys)
|
854
|
+
VALUE obj, cys;
|
855
|
+
{
|
856
|
+
char *i_cys;
|
857
|
+
|
858
|
+
if (TYPE(cys) != T_STRING) {
|
859
|
+
cys = rb_funcall(cys, rb_intern("to_str"), 0);
|
860
|
+
}
|
861
|
+
|
862
|
+
i_cys = StringValuePtr(cys);
|
863
|
+
|
864
|
+
|
865
|
+
usyaxl_(i_cys, (ftnlen)strlen(i_cys));
|
866
|
+
|
867
|
+
return Qnil;
|
868
|
+
|
869
|
+
}
|
870
|
+
|
871
|
+
static VALUE
|
872
|
+
dcl_usxsub(obj, cxa, cya, clabel, rlbl)
|
873
|
+
VALUE obj, cxa, cya, clabel, rlbl;
|
874
|
+
{
|
875
|
+
char *i_cxa;
|
876
|
+
char *i_cya;
|
877
|
+
char *i_clabel;
|
878
|
+
real i_rlbl;
|
879
|
+
|
880
|
+
if (TYPE(cxa) != T_STRING) {
|
881
|
+
cxa = rb_funcall(cxa, rb_intern("to_str"), 0);
|
882
|
+
}
|
883
|
+
if (TYPE(cya) != T_STRING) {
|
884
|
+
cya = rb_funcall(cya, rb_intern("to_str"), 0);
|
885
|
+
}
|
886
|
+
if (TYPE(clabel) != T_STRING) {
|
887
|
+
clabel = rb_funcall(clabel, rb_intern("to_str"), 0);
|
888
|
+
}
|
889
|
+
if (TYPE(rlbl) != T_FLOAT) {
|
890
|
+
rlbl = rb_funcall(rlbl, rb_intern("to_f"), 0);
|
891
|
+
}
|
892
|
+
|
893
|
+
i_cxa = StringValuePtr(cxa);
|
894
|
+
i_cya = StringValuePtr(cya);
|
895
|
+
i_clabel = StringValuePtr(clabel);
|
896
|
+
i_rlbl = (real)NUM2DBL(rlbl);
|
897
|
+
|
898
|
+
|
899
|
+
usxsub_(i_cxa, i_cya, i_clabel, &i_rlbl, (ftnlen)strlen(i_cxa), (ftnlen)strlen(i_cya), (ftnlen)strlen(i_clabel));
|
900
|
+
|
901
|
+
return Qnil;
|
902
|
+
|
903
|
+
}
|
904
|
+
|
905
|
+
static VALUE
|
906
|
+
dcl_usysub(obj, cya, cxa, clabel, rlbl)
|
907
|
+
VALUE obj, cya, cxa, clabel, rlbl;
|
908
|
+
{
|
909
|
+
char *i_cya;
|
910
|
+
char *i_cxa;
|
911
|
+
char *i_clabel;
|
912
|
+
real i_rlbl;
|
913
|
+
|
914
|
+
if (TYPE(cya) != T_STRING) {
|
915
|
+
cya = rb_funcall(cya, rb_intern("to_str"), 0);
|
916
|
+
}
|
917
|
+
if (TYPE(cxa) != T_STRING) {
|
918
|
+
cxa = rb_funcall(cxa, rb_intern("to_str"), 0);
|
919
|
+
}
|
920
|
+
if (TYPE(clabel) != T_STRING) {
|
921
|
+
clabel = rb_funcall(clabel, rb_intern("to_str"), 0);
|
922
|
+
}
|
923
|
+
if (TYPE(rlbl) != T_FLOAT) {
|
924
|
+
rlbl = rb_funcall(rlbl, rb_intern("to_f"), 0);
|
925
|
+
}
|
926
|
+
|
927
|
+
i_cya = StringValuePtr(cya);
|
928
|
+
i_cxa = StringValuePtr(cxa);
|
929
|
+
i_clabel = StringValuePtr(clabel);
|
930
|
+
i_rlbl = (real)NUM2DBL(rlbl);
|
931
|
+
|
932
|
+
|
933
|
+
usysub_(i_cya, i_cxa, i_clabel, &i_rlbl, (ftnlen)strlen(i_cya), (ftnlen)strlen(i_cxa), (ftnlen)strlen(i_clabel));
|
934
|
+
|
935
|
+
return Qnil;
|
936
|
+
|
937
|
+
}
|
938
|
+
|
939
|
+
static VALUE
|
940
|
+
dcl_csblbl(obj, ufac, uoff, cunit)
|
941
|
+
VALUE obj, ufac, uoff, cunit;
|
942
|
+
{
|
943
|
+
real i_ufac;
|
944
|
+
real i_uoff;
|
945
|
+
char *i_cunit;
|
946
|
+
char *o_rtn_val;
|
947
|
+
VALUE rtn_val;
|
948
|
+
|
949
|
+
if (TYPE(ufac) != T_FLOAT) {
|
950
|
+
ufac = rb_funcall(ufac, rb_intern("to_f"), 0);
|
951
|
+
}
|
952
|
+
if (TYPE(uoff) != T_FLOAT) {
|
953
|
+
uoff = rb_funcall(uoff, rb_intern("to_f"), 0);
|
954
|
+
}
|
955
|
+
if (TYPE(cunit) != T_STRING) {
|
956
|
+
cunit = rb_funcall(cunit, rb_intern("to_str"), 0);
|
957
|
+
}
|
958
|
+
|
959
|
+
i_ufac = (real)NUM2DBL(ufac);
|
960
|
+
i_uoff = (real)NUM2DBL(uoff);
|
961
|
+
i_cunit = StringValuePtr(cunit);
|
962
|
+
|
963
|
+
o_rtn_val= ALLOCA_N(char, (DFLT_SIZE+1));
|
964
|
+
memset(o_rtn_val, '\0', DFLT_SIZE+1);
|
965
|
+
|
966
|
+
csblbl_(o_rtn_val, (ftnlen)DFLT_SIZE, &i_ufac, &i_uoff, i_cunit, (ftnlen)strlen(i_cunit));
|
967
|
+
|
968
|
+
rtn_val = rb_str_new2(o_rtn_val);
|
969
|
+
|
970
|
+
|
971
|
+
return rtn_val;
|
972
|
+
|
973
|
+
}
|
974
|
+
|
975
|
+
static VALUE
|
976
|
+
dcl_uschvl(obj, x)
|
977
|
+
VALUE obj, x;
|
978
|
+
{
|
979
|
+
real i_x;
|
980
|
+
char *o_chx;
|
981
|
+
VALUE chx;
|
982
|
+
|
983
|
+
if (TYPE(x) != T_FLOAT) {
|
984
|
+
x = rb_funcall(x, rb_intern("to_f"), 0);
|
985
|
+
}
|
986
|
+
|
987
|
+
i_x = (real)NUM2DBL(x);
|
988
|
+
|
989
|
+
o_chx= ALLOCA_N(char, (DFLT_SIZE+1));
|
990
|
+
memset(o_chx, '\0', DFLT_SIZE+1);
|
991
|
+
|
992
|
+
uschvl_(&i_x, o_chx, (ftnlen)DFLT_SIZE);
|
993
|
+
|
994
|
+
chx = rb_str_new2(o_chx);
|
995
|
+
|
996
|
+
|
997
|
+
return chx;
|
998
|
+
|
999
|
+
}
|
1000
|
+
|
1001
|
+
static VALUE
|
1002
|
+
dcl_usxoff(obj, cxs)
|
1003
|
+
VALUE obj, cxs;
|
1004
|
+
{
|
1005
|
+
char *i_cxs;
|
1006
|
+
|
1007
|
+
if (TYPE(cxs) != T_STRING) {
|
1008
|
+
cxs = rb_funcall(cxs, rb_intern("to_str"), 0);
|
1009
|
+
}
|
1010
|
+
|
1011
|
+
i_cxs = StringValuePtr(cxs);
|
1012
|
+
|
1013
|
+
|
1014
|
+
usxoff_(i_cxs, (ftnlen)strlen(i_cxs));
|
1015
|
+
|
1016
|
+
return Qnil;
|
1017
|
+
|
1018
|
+
}
|
1019
|
+
|
1020
|
+
static VALUE
|
1021
|
+
dcl_usyoff(obj, cys)
|
1022
|
+
VALUE obj, cys;
|
1023
|
+
{
|
1024
|
+
char *i_cys;
|
1025
|
+
|
1026
|
+
if (TYPE(cys) != T_STRING) {
|
1027
|
+
cys = rb_funcall(cys, rb_intern("to_str"), 0);
|
1028
|
+
}
|
1029
|
+
|
1030
|
+
i_cys = StringValuePtr(cys);
|
1031
|
+
|
1032
|
+
|
1033
|
+
usyoff_(i_cys, (ftnlen)strlen(i_cys));
|
1034
|
+
|
1035
|
+
return Qnil;
|
1036
|
+
|
1037
|
+
}
|
1038
|
+
|
1039
|
+
static VALUE
|
1040
|
+
dcl_uszdgt(obj, umin, umax, dul, maxdgt, uoff, ufact)
|
1041
|
+
VALUE obj, umin, umax, dul, maxdgt, uoff, ufact;
|
1042
|
+
{
|
1043
|
+
real i_umin;
|
1044
|
+
real i_umax;
|
1045
|
+
real i_dul;
|
1046
|
+
integer i_maxdgt;
|
1047
|
+
real io_uoff;
|
1048
|
+
real io_ufact;
|
1049
|
+
integer o_ndgt;
|
1050
|
+
integer o_ldgt;
|
1051
|
+
VALUE ndgt;
|
1052
|
+
VALUE ldgt;
|
1053
|
+
|
1054
|
+
if (TYPE(umin) != T_FLOAT) {
|
1055
|
+
umin = rb_funcall(umin, rb_intern("to_f"), 0);
|
1056
|
+
}
|
1057
|
+
if (TYPE(umax) != T_FLOAT) {
|
1058
|
+
umax = rb_funcall(umax, rb_intern("to_f"), 0);
|
1059
|
+
}
|
1060
|
+
if (TYPE(dul) != T_FLOAT) {
|
1061
|
+
dul = rb_funcall(dul, rb_intern("to_f"), 0);
|
1062
|
+
}
|
1063
|
+
if ((TYPE(maxdgt) != T_BIGNUM) || (TYPE(maxdgt) != T_FIXNUM)) {
|
1064
|
+
maxdgt = rb_funcall(maxdgt, rb_intern("to_i"), 0);
|
1065
|
+
}
|
1066
|
+
if (TYPE(uoff) != T_FLOAT) {
|
1067
|
+
uoff = rb_funcall(uoff, rb_intern("to_f"), 0);
|
1068
|
+
}
|
1069
|
+
if (TYPE(ufact) != T_FLOAT) {
|
1070
|
+
ufact = rb_funcall(ufact, rb_intern("to_f"), 0);
|
1071
|
+
}
|
1072
|
+
|
1073
|
+
i_umin = (real)NUM2DBL(umin);
|
1074
|
+
i_umax = (real)NUM2DBL(umax);
|
1075
|
+
i_dul = (real)NUM2DBL(dul);
|
1076
|
+
i_maxdgt = NUM2INT(maxdgt);
|
1077
|
+
io_uoff = (real)NUM2DBL(uoff);
|
1078
|
+
io_ufact = (real)NUM2DBL(ufact);
|
1079
|
+
|
1080
|
+
|
1081
|
+
uszdgt_(&i_umin, &i_umax, &i_dul, &i_maxdgt, &io_uoff, &io_ufact, &o_ndgt, &o_ldgt);
|
1082
|
+
|
1083
|
+
uoff = rb_float_new((double)io_uoff);
|
1084
|
+
ufact = rb_float_new((double)io_ufact);
|
1085
|
+
ndgt = INT2NUM(o_ndgt);
|
1086
|
+
ldgt = INT2NUM(o_ldgt);
|
1087
|
+
|
1088
|
+
|
1089
|
+
return rb_ary_new3(4, uoff, ufact, ndgt, ldgt);
|
1090
|
+
|
1091
|
+
}
|
1092
|
+
|
1093
|
+
static VALUE
|
1094
|
+
dcl_uswapz(obj, x1, x2, n)
|
1095
|
+
VALUE obj, x1, x2, n;
|
1096
|
+
{
|
1097
|
+
real *io_x1;
|
1098
|
+
real *io_x2;
|
1099
|
+
integer i_n;
|
1100
|
+
|
1101
|
+
if (TYPE(x1) == T_FLOAT) {
|
1102
|
+
x1 = rb_Array(x1);
|
1103
|
+
}
|
1104
|
+
/* if ((TYPE(x1) != T_ARRAY) &&
|
1105
|
+
(rb_obj_is_kind_of(x1, cNArray) != Qtrue)) {
|
1106
|
+
rb_raise(rb_eTypeError, "invalid type");
|
1107
|
+
} -- no check since obj2c*ary will do that */
|
1108
|
+
if (TYPE(x2) == T_FLOAT) {
|
1109
|
+
x2 = rb_Array(x2);
|
1110
|
+
}
|
1111
|
+
/* if ((TYPE(x2) != T_ARRAY) &&
|
1112
|
+
(rb_obj_is_kind_of(x2, cNArray) != Qtrue)) {
|
1113
|
+
rb_raise(rb_eTypeError, "invalid type");
|
1114
|
+
} -- no check since obj2c*ary will do that */
|
1115
|
+
if ((TYPE(n) != T_BIGNUM) || (TYPE(n) != T_FIXNUM)) {
|
1116
|
+
n = rb_funcall(n, rb_intern("to_i"), 0);
|
1117
|
+
}
|
1118
|
+
|
1119
|
+
i_n = NUM2INT(n);
|
1120
|
+
io_x1 = dcl_obj2crealary(x1);
|
1121
|
+
io_x2 = dcl_obj2crealary(x2);
|
1122
|
+
|
1123
|
+
|
1124
|
+
uswapz_(io_x1, io_x2, &i_n);
|
1125
|
+
|
1126
|
+
{int array_shape[1] = {i_n};
|
1127
|
+
x1 = dcl_crealary2obj(io_x1, (i_n), 1, array_shape);
|
1128
|
+
}
|
1129
|
+
{int array_shape[1] = {i_n};
|
1130
|
+
x2 = dcl_crealary2obj(io_x2, (i_n), 1, array_shape);
|
1131
|
+
}
|
1132
|
+
|
1133
|
+
dcl_freecrealary(io_x1);
|
1134
|
+
dcl_freecrealary(io_x2);
|
1135
|
+
|
1136
|
+
return rb_ary_new3(2, x1, x2);
|
1137
|
+
|
1138
|
+
}
|
1139
|
+
|
1140
|
+
static VALUE
|
1141
|
+
dcl_usurdt(obj, umin, umax, vmin, vmax)
|
1142
|
+
VALUE obj, umin, umax, vmin, vmax;
|
1143
|
+
{
|
1144
|
+
real io_umin;
|
1145
|
+
real io_umax;
|
1146
|
+
real i_vmin;
|
1147
|
+
real i_vmax;
|
1148
|
+
real o_dut;
|
1149
|
+
VALUE dut;
|
1150
|
+
|
1151
|
+
if (TYPE(umin) != T_FLOAT) {
|
1152
|
+
umin = rb_funcall(umin, rb_intern("to_f"), 0);
|
1153
|
+
}
|
1154
|
+
if (TYPE(umax) != T_FLOAT) {
|
1155
|
+
umax = rb_funcall(umax, rb_intern("to_f"), 0);
|
1156
|
+
}
|
1157
|
+
if (TYPE(vmin) != T_FLOAT) {
|
1158
|
+
vmin = rb_funcall(vmin, rb_intern("to_f"), 0);
|
1159
|
+
}
|
1160
|
+
if (TYPE(vmax) != T_FLOAT) {
|
1161
|
+
vmax = rb_funcall(vmax, rb_intern("to_f"), 0);
|
1162
|
+
}
|
1163
|
+
|
1164
|
+
io_umin = (real)NUM2DBL(umin);
|
1165
|
+
io_umax = (real)NUM2DBL(umax);
|
1166
|
+
i_vmin = (real)NUM2DBL(vmin);
|
1167
|
+
i_vmax = (real)NUM2DBL(vmax);
|
1168
|
+
|
1169
|
+
|
1170
|
+
usurdt_(&io_umin, &io_umax, &i_vmin, &i_vmax, &o_dut);
|
1171
|
+
|
1172
|
+
umin = rb_float_new((double)io_umin);
|
1173
|
+
umax = rb_float_new((double)io_umax);
|
1174
|
+
dut = rb_float_new((double)o_dut);
|
1175
|
+
|
1176
|
+
|
1177
|
+
return rb_ary_new3(3, umin, umax, dut);
|
1178
|
+
|
1179
|
+
}
|
1180
|
+
|
1181
|
+
static VALUE
|
1182
|
+
dcl_usaxcl(obj, cside, jd0, ctype, nd)
|
1183
|
+
VALUE obj, cside, jd0, ctype, nd;
|
1184
|
+
{
|
1185
|
+
char *i_cside;
|
1186
|
+
integer i_jd0;
|
1187
|
+
char *i_ctype;
|
1188
|
+
integer i_nd;
|
1189
|
+
|
1190
|
+
if (TYPE(cside) != T_STRING) {
|
1191
|
+
cside = rb_funcall(cside, rb_intern("to_str"), 0);
|
1192
|
+
}
|
1193
|
+
if ((TYPE(jd0) != T_BIGNUM) || (TYPE(jd0) != T_FIXNUM)) {
|
1194
|
+
jd0 = rb_funcall(jd0, rb_intern("to_i"), 0);
|
1195
|
+
}
|
1196
|
+
if (TYPE(ctype) != T_STRING) {
|
1197
|
+
ctype = rb_funcall(ctype, rb_intern("to_str"), 0);
|
1198
|
+
}
|
1199
|
+
if ((TYPE(nd) != T_BIGNUM) || (TYPE(nd) != T_FIXNUM)) {
|
1200
|
+
nd = rb_funcall(nd, rb_intern("to_i"), 0);
|
1201
|
+
}
|
1202
|
+
|
1203
|
+
i_cside = StringValuePtr(cside);
|
1204
|
+
i_jd0 = NUM2INT(jd0);
|
1205
|
+
i_ctype = StringValuePtr(ctype);
|
1206
|
+
i_nd = NUM2INT(nd);
|
1207
|
+
|
1208
|
+
|
1209
|
+
usaxcl_(i_cside, &i_jd0, i_ctype, &i_nd, (ftnlen)strlen(i_cside), (ftnlen)strlen(i_ctype));
|
1210
|
+
|
1211
|
+
return Qnil;
|
1212
|
+
|
1213
|
+
}
|
1214
|
+
|
1215
|
+
static VALUE
|
1216
|
+
dcl_usaxdv(obj, cside, dtick, dlbl)
|
1217
|
+
VALUE obj, cside, dtick, dlbl;
|
1218
|
+
{
|
1219
|
+
char *i_cside;
|
1220
|
+
real i_dtick;
|
1221
|
+
real i_dlbl;
|
1222
|
+
|
1223
|
+
if (TYPE(cside) != T_STRING) {
|
1224
|
+
cside = rb_funcall(cside, rb_intern("to_str"), 0);
|
1225
|
+
}
|
1226
|
+
if (TYPE(dtick) != T_FLOAT) {
|
1227
|
+
dtick = rb_funcall(dtick, rb_intern("to_f"), 0);
|
1228
|
+
}
|
1229
|
+
if (TYPE(dlbl) != T_FLOAT) {
|
1230
|
+
dlbl = rb_funcall(dlbl, rb_intern("to_f"), 0);
|
1231
|
+
}
|
1232
|
+
|
1233
|
+
i_cside = StringValuePtr(cside);
|
1234
|
+
i_dtick = (real)NUM2DBL(dtick);
|
1235
|
+
i_dlbl = (real)NUM2DBL(dlbl);
|
1236
|
+
|
1237
|
+
|
1238
|
+
usaxdv_(i_cside, &i_dtick, &i_dlbl, (ftnlen)strlen(i_cside));
|
1239
|
+
|
1240
|
+
return Qnil;
|
1241
|
+
|
1242
|
+
}
|
1243
|
+
|
1244
|
+
static VALUE
|
1245
|
+
dcl_usaxlb(obj, cside, dtick, n1, dlabel, ch, nc, n2)
|
1246
|
+
VALUE obj, cside, dtick, n1, dlabel, ch, nc, n2;
|
1247
|
+
{
|
1248
|
+
char *i_cside;
|
1249
|
+
real *i_dtick;
|
1250
|
+
integer i_n1;
|
1251
|
+
real *i_dlabel;
|
1252
|
+
char *i_ch;
|
1253
|
+
integer i_nc;
|
1254
|
+
integer i_n2;
|
1255
|
+
|
1256
|
+
if (TYPE(cside) != T_STRING) {
|
1257
|
+
cside = rb_funcall(cside, rb_intern("to_str"), 0);
|
1258
|
+
}
|
1259
|
+
if (TYPE(dtick) == T_FLOAT) {
|
1260
|
+
dtick = rb_Array(dtick);
|
1261
|
+
}
|
1262
|
+
/* if ((TYPE(dtick) != T_ARRAY) &&
|
1263
|
+
(rb_obj_is_kind_of(dtick, cNArray) != Qtrue)) {
|
1264
|
+
rb_raise(rb_eTypeError, "invalid type");
|
1265
|
+
} -- no check since obj2c*ary will do that */
|
1266
|
+
if ((TYPE(n1) != T_BIGNUM) || (TYPE(n1) != T_FIXNUM)) {
|
1267
|
+
n1 = rb_funcall(n1, rb_intern("to_i"), 0);
|
1268
|
+
}
|
1269
|
+
if (TYPE(dlabel) == T_FLOAT) {
|
1270
|
+
dlabel = rb_Array(dlabel);
|
1271
|
+
}
|
1272
|
+
/* if ((TYPE(dlabel) != T_ARRAY) &&
|
1273
|
+
(rb_obj_is_kind_of(dlabel, cNArray) != Qtrue)) {
|
1274
|
+
rb_raise(rb_eTypeError, "invalid type");
|
1275
|
+
} -- no check since obj2c*ary will do that */
|
1276
|
+
if (TYPE(ch) == T_STRING) {
|
1277
|
+
ch = rb_Array(ch);
|
1278
|
+
}
|
1279
|
+
if (TYPE(ch) != T_ARRAY) {
|
1280
|
+
rb_raise(rb_eTypeError, "invalid type");
|
1281
|
+
}
|
1282
|
+
if ((TYPE(nc) != T_BIGNUM) || (TYPE(nc) != T_FIXNUM)) {
|
1283
|
+
nc = rb_funcall(nc, rb_intern("to_i"), 0);
|
1284
|
+
}
|
1285
|
+
if ((TYPE(n2) != T_BIGNUM) || (TYPE(n2) != T_FIXNUM)) {
|
1286
|
+
n2 = rb_funcall(n2, rb_intern("to_i"), 0);
|
1287
|
+
}
|
1288
|
+
|
1289
|
+
i_cside = StringValuePtr(cside);
|
1290
|
+
i_n1 = NUM2INT(n1);
|
1291
|
+
i_nc = NUM2INT(nc);
|
1292
|
+
i_n2 = NUM2INT(n2);
|
1293
|
+
i_dtick = dcl_obj2crealary(dtick);
|
1294
|
+
i_dlabel = dcl_obj2crealary(dlabel);
|
1295
|
+
i_ch = dcl_obj2ccharary(ch, (i_n2*DFLT_SIZE), DFLT_SIZE);
|
1296
|
+
|
1297
|
+
|
1298
|
+
usaxlb_(i_cside, i_dtick, &i_n1, i_dlabel, i_ch, &i_nc, &i_n2, (ftnlen)strlen(i_cside), (ftnlen)DFLT_SIZE);
|
1299
|
+
|
1300
|
+
dcl_freecrealary(i_dtick);
|
1301
|
+
dcl_freecrealary(i_dlabel);
|
1302
|
+
dcl_freeccharary(i_ch);
|
1303
|
+
|
1304
|
+
return Qnil;
|
1305
|
+
|
1306
|
+
}
|
1307
|
+
|
1308
|
+
static VALUE
|
1309
|
+
dcl_usaxlg(obj, cside, nlbl, nticks)
|
1310
|
+
VALUE obj, cside, nlbl, nticks;
|
1311
|
+
{
|
1312
|
+
char *i_cside;
|
1313
|
+
integer i_nlbl;
|
1314
|
+
integer i_nticks;
|
1315
|
+
|
1316
|
+
if (TYPE(cside) != T_STRING) {
|
1317
|
+
cside = rb_funcall(cside, rb_intern("to_str"), 0);
|
1318
|
+
}
|
1319
|
+
if ((TYPE(nlbl) != T_BIGNUM) || (TYPE(nlbl) != T_FIXNUM)) {
|
1320
|
+
nlbl = rb_funcall(nlbl, rb_intern("to_i"), 0);
|
1321
|
+
}
|
1322
|
+
if ((TYPE(nticks) != T_BIGNUM) || (TYPE(nticks) != T_FIXNUM)) {
|
1323
|
+
nticks = rb_funcall(nticks, rb_intern("to_i"), 0);
|
1324
|
+
}
|
1325
|
+
|
1326
|
+
i_cside = StringValuePtr(cside);
|
1327
|
+
i_nlbl = NUM2INT(nlbl);
|
1328
|
+
i_nticks = NUM2INT(nticks);
|
1329
|
+
|
1330
|
+
|
1331
|
+
usaxlg_(i_cside, &i_nlbl, &i_nticks, (ftnlen)strlen(i_cside));
|
1332
|
+
|
1333
|
+
return Qnil;
|
1334
|
+
|
1335
|
+
}
|
1336
|
+
|
1337
|
+
static VALUE
|
1338
|
+
dcl_usaxnm(obj, cside, dtick, n1, dlabel, n2)
|
1339
|
+
VALUE obj, cside, dtick, n1, dlabel, n2;
|
1340
|
+
{
|
1341
|
+
char *i_cside;
|
1342
|
+
real *i_dtick;
|
1343
|
+
integer i_n1;
|
1344
|
+
real *i_dlabel;
|
1345
|
+
integer i_n2;
|
1346
|
+
|
1347
|
+
if (TYPE(cside) != T_STRING) {
|
1348
|
+
cside = rb_funcall(cside, rb_intern("to_str"), 0);
|
1349
|
+
}
|
1350
|
+
if (TYPE(dtick) == T_FLOAT) {
|
1351
|
+
dtick = rb_Array(dtick);
|
1352
|
+
}
|
1353
|
+
/* if ((TYPE(dtick) != T_ARRAY) &&
|
1354
|
+
(rb_obj_is_kind_of(dtick, cNArray) != Qtrue)) {
|
1355
|
+
rb_raise(rb_eTypeError, "invalid type");
|
1356
|
+
} -- no check since obj2c*ary will do that */
|
1357
|
+
if ((TYPE(n1) != T_BIGNUM) || (TYPE(n1) != T_FIXNUM)) {
|
1358
|
+
n1 = rb_funcall(n1, rb_intern("to_i"), 0);
|
1359
|
+
}
|
1360
|
+
if (TYPE(dlabel) == T_FLOAT) {
|
1361
|
+
dlabel = rb_Array(dlabel);
|
1362
|
+
}
|
1363
|
+
/* if ((TYPE(dlabel) != T_ARRAY) &&
|
1364
|
+
(rb_obj_is_kind_of(dlabel, cNArray) != Qtrue)) {
|
1365
|
+
rb_raise(rb_eTypeError, "invalid type");
|
1366
|
+
} -- no check since obj2c*ary will do that */
|
1367
|
+
if ((TYPE(n2) != T_BIGNUM) || (TYPE(n2) != T_FIXNUM)) {
|
1368
|
+
n2 = rb_funcall(n2, rb_intern("to_i"), 0);
|
1369
|
+
}
|
1370
|
+
|
1371
|
+
i_cside = StringValuePtr(cside);
|
1372
|
+
i_n1 = NUM2INT(n1);
|
1373
|
+
i_n2 = NUM2INT(n2);
|
1374
|
+
i_dtick = dcl_obj2crealary(dtick);
|
1375
|
+
i_dlabel = dcl_obj2crealary(dlabel);
|
1376
|
+
|
1377
|
+
|
1378
|
+
usaxnm_(i_cside, i_dtick, &i_n1, i_dlabel, &i_n2, (ftnlen)strlen(i_cside));
|
1379
|
+
|
1380
|
+
dcl_freecrealary(i_dtick);
|
1381
|
+
dcl_freecrealary(i_dlabel);
|
1382
|
+
|
1383
|
+
return Qnil;
|
1384
|
+
|
1385
|
+
}
|
1386
|
+
|
1387
|
+
static VALUE
|
1388
|
+
dcl_usaxsc(obj, cside)
|
1389
|
+
VALUE obj, cside;
|
1390
|
+
{
|
1391
|
+
char *i_cside;
|
1392
|
+
|
1393
|
+
if (TYPE(cside) != T_STRING) {
|
1394
|
+
cside = rb_funcall(cside, rb_intern("to_str"), 0);
|
1395
|
+
}
|
1396
|
+
|
1397
|
+
i_cside = StringValuePtr(cside);
|
1398
|
+
|
1399
|
+
|
1400
|
+
usaxsc_(i_cside, (ftnlen)strlen(i_cside));
|
1401
|
+
|
1402
|
+
return Qnil;
|
1403
|
+
|
1404
|
+
}
|
1405
|
+
|
1406
|
+
static VALUE
|
1407
|
+
dcl_usiget(obj, cp)
|
1408
|
+
VALUE obj, cp;
|
1409
|
+
{
|
1410
|
+
char *i_cp;
|
1411
|
+
integer o_ipara;
|
1412
|
+
VALUE ipara;
|
1413
|
+
|
1414
|
+
if (TYPE(cp) != T_STRING) {
|
1415
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
1416
|
+
}
|
1417
|
+
|
1418
|
+
i_cp = StringValuePtr(cp);
|
1419
|
+
|
1420
|
+
|
1421
|
+
usiget_(i_cp, &o_ipara, (ftnlen)strlen(i_cp));
|
1422
|
+
|
1423
|
+
ipara = INT2NUM(o_ipara);
|
1424
|
+
|
1425
|
+
|
1426
|
+
return ipara;
|
1427
|
+
|
1428
|
+
}
|
1429
|
+
|
1430
|
+
static VALUE
|
1431
|
+
dcl_usiset(obj, cp, ipara)
|
1432
|
+
VALUE obj, cp, ipara;
|
1433
|
+
{
|
1434
|
+
char *i_cp;
|
1435
|
+
integer i_ipara;
|
1436
|
+
|
1437
|
+
if (TYPE(cp) != T_STRING) {
|
1438
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
1439
|
+
}
|
1440
|
+
if ((TYPE(ipara) != T_BIGNUM) || (TYPE(ipara) != T_FIXNUM)) {
|
1441
|
+
ipara = rb_funcall(ipara, rb_intern("to_i"), 0);
|
1442
|
+
}
|
1443
|
+
|
1444
|
+
i_cp = StringValuePtr(cp);
|
1445
|
+
i_ipara = NUM2INT(ipara);
|
1446
|
+
|
1447
|
+
|
1448
|
+
usiset_(i_cp, &i_ipara, (ftnlen)strlen(i_cp));
|
1449
|
+
|
1450
|
+
return Qnil;
|
1451
|
+
|
1452
|
+
}
|
1453
|
+
|
1454
|
+
static VALUE
|
1455
|
+
dcl_usistx(obj, cp, ipara)
|
1456
|
+
VALUE obj, cp, ipara;
|
1457
|
+
{
|
1458
|
+
char *i_cp;
|
1459
|
+
integer i_ipara;
|
1460
|
+
|
1461
|
+
if (TYPE(cp) != T_STRING) {
|
1462
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
1463
|
+
}
|
1464
|
+
if ((TYPE(ipara) != T_BIGNUM) || (TYPE(ipara) != T_FIXNUM)) {
|
1465
|
+
ipara = rb_funcall(ipara, rb_intern("to_i"), 0);
|
1466
|
+
}
|
1467
|
+
|
1468
|
+
i_cp = StringValuePtr(cp);
|
1469
|
+
i_ipara = NUM2INT(ipara);
|
1470
|
+
|
1471
|
+
|
1472
|
+
usistx_(i_cp, &i_ipara, (ftnlen)strlen(i_cp));
|
1473
|
+
|
1474
|
+
return Qnil;
|
1475
|
+
|
1476
|
+
}
|
1477
|
+
|
1478
|
+
static VALUE
|
1479
|
+
dcl_usiqnp(obj)
|
1480
|
+
VALUE obj;
|
1481
|
+
{
|
1482
|
+
integer o_ncp;
|
1483
|
+
VALUE ncp;
|
1484
|
+
|
1485
|
+
usiqnp_(&o_ncp);
|
1486
|
+
|
1487
|
+
ncp = INT2NUM(o_ncp);
|
1488
|
+
|
1489
|
+
|
1490
|
+
return ncp;
|
1491
|
+
|
1492
|
+
}
|
1493
|
+
|
1494
|
+
static VALUE
|
1495
|
+
dcl_usiqid(obj, cp)
|
1496
|
+
VALUE obj, cp;
|
1497
|
+
{
|
1498
|
+
char *i_cp;
|
1499
|
+
integer o_idx;
|
1500
|
+
VALUE idx;
|
1501
|
+
|
1502
|
+
if (TYPE(cp) != T_STRING) {
|
1503
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
1504
|
+
}
|
1505
|
+
|
1506
|
+
i_cp = StringValuePtr(cp);
|
1507
|
+
|
1508
|
+
|
1509
|
+
usiqid_(i_cp, &o_idx, (ftnlen)strlen(i_cp));
|
1510
|
+
|
1511
|
+
idx = INT2NUM(o_idx);
|
1512
|
+
|
1513
|
+
|
1514
|
+
return idx;
|
1515
|
+
|
1516
|
+
}
|
1517
|
+
|
1518
|
+
static VALUE
|
1519
|
+
dcl_usiqcp(obj, idx)
|
1520
|
+
VALUE obj, idx;
|
1521
|
+
{
|
1522
|
+
integer i_idx;
|
1523
|
+
char *o_cp;
|
1524
|
+
VALUE cp;
|
1525
|
+
|
1526
|
+
if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
|
1527
|
+
idx = rb_funcall(idx, rb_intern("to_i"), 0);
|
1528
|
+
}
|
1529
|
+
|
1530
|
+
i_idx = NUM2INT(idx);
|
1531
|
+
|
1532
|
+
o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
|
1533
|
+
memset(o_cp, '\0', DFLT_SIZE+1);
|
1534
|
+
|
1535
|
+
usiqcp_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
|
1536
|
+
|
1537
|
+
cp = rb_str_new2(o_cp);
|
1538
|
+
|
1539
|
+
|
1540
|
+
return cp;
|
1541
|
+
|
1542
|
+
}
|
1543
|
+
|
1544
|
+
static VALUE
|
1545
|
+
dcl_usiqcl(obj, idx)
|
1546
|
+
VALUE obj, idx;
|
1547
|
+
{
|
1548
|
+
integer i_idx;
|
1549
|
+
char *o_cp;
|
1550
|
+
VALUE cp;
|
1551
|
+
|
1552
|
+
if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
|
1553
|
+
idx = rb_funcall(idx, rb_intern("to_i"), 0);
|
1554
|
+
}
|
1555
|
+
|
1556
|
+
i_idx = NUM2INT(idx);
|
1557
|
+
|
1558
|
+
o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
|
1559
|
+
memset(o_cp, '\0', DFLT_SIZE+1);
|
1560
|
+
|
1561
|
+
usiqcl_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
|
1562
|
+
|
1563
|
+
cp = rb_str_new2(o_cp);
|
1564
|
+
|
1565
|
+
|
1566
|
+
return cp;
|
1567
|
+
|
1568
|
+
}
|
1569
|
+
|
1570
|
+
static VALUE
|
1571
|
+
dcl_usiqvl(obj, idx)
|
1572
|
+
VALUE obj, idx;
|
1573
|
+
{
|
1574
|
+
integer i_idx;
|
1575
|
+
integer o_ipara;
|
1576
|
+
VALUE ipara;
|
1577
|
+
|
1578
|
+
if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
|
1579
|
+
idx = rb_funcall(idx, rb_intern("to_i"), 0);
|
1580
|
+
}
|
1581
|
+
|
1582
|
+
i_idx = NUM2INT(idx);
|
1583
|
+
|
1584
|
+
|
1585
|
+
usiqvl_(&i_idx, &o_ipara);
|
1586
|
+
|
1587
|
+
ipara = INT2NUM(o_ipara);
|
1588
|
+
|
1589
|
+
|
1590
|
+
return ipara;
|
1591
|
+
|
1592
|
+
}
|
1593
|
+
|
1594
|
+
static VALUE
|
1595
|
+
dcl_usisvl(obj, idx, ipara)
|
1596
|
+
VALUE obj, idx, ipara;
|
1597
|
+
{
|
1598
|
+
integer i_idx;
|
1599
|
+
integer i_ipara;
|
1600
|
+
|
1601
|
+
if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
|
1602
|
+
idx = rb_funcall(idx, rb_intern("to_i"), 0);
|
1603
|
+
}
|
1604
|
+
if ((TYPE(ipara) != T_BIGNUM) || (TYPE(ipara) != T_FIXNUM)) {
|
1605
|
+
ipara = rb_funcall(ipara, rb_intern("to_i"), 0);
|
1606
|
+
}
|
1607
|
+
|
1608
|
+
i_idx = NUM2INT(idx);
|
1609
|
+
i_ipara = NUM2INT(ipara);
|
1610
|
+
|
1611
|
+
|
1612
|
+
usisvl_(&i_idx, &i_ipara);
|
1613
|
+
|
1614
|
+
return Qnil;
|
1615
|
+
|
1616
|
+
}
|
1617
|
+
|
1618
|
+
static VALUE
|
1619
|
+
dcl_usiqin(obj, cp)
|
1620
|
+
VALUE obj, cp;
|
1621
|
+
{
|
1622
|
+
char *i_cp;
|
1623
|
+
integer o_in;
|
1624
|
+
VALUE in;
|
1625
|
+
|
1626
|
+
if (TYPE(cp) != T_STRING) {
|
1627
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
1628
|
+
}
|
1629
|
+
|
1630
|
+
i_cp = StringValuePtr(cp);
|
1631
|
+
|
1632
|
+
|
1633
|
+
usiqin_(i_cp, &o_in, (ftnlen)strlen(i_cp));
|
1634
|
+
|
1635
|
+
in = INT2NUM(o_in);
|
1636
|
+
|
1637
|
+
|
1638
|
+
return in;
|
1639
|
+
|
1640
|
+
}
|
1641
|
+
|
1642
|
+
static VALUE
|
1643
|
+
dcl_uslget(obj, cp)
|
1644
|
+
VALUE obj, cp;
|
1645
|
+
{
|
1646
|
+
char *i_cp;
|
1647
|
+
logical o_lpara;
|
1648
|
+
VALUE lpara;
|
1649
|
+
|
1650
|
+
if (TYPE(cp) != T_STRING) {
|
1651
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
1652
|
+
}
|
1653
|
+
|
1654
|
+
i_cp = StringValuePtr(cp);
|
1655
|
+
|
1656
|
+
|
1657
|
+
uslget_(i_cp, &o_lpara, (ftnlen)strlen(i_cp));
|
1658
|
+
|
1659
|
+
lpara = (o_lpara == FALSE_) ? Qfalse : Qtrue;
|
1660
|
+
|
1661
|
+
|
1662
|
+
return lpara;
|
1663
|
+
|
1664
|
+
}
|
1665
|
+
|
1666
|
+
static VALUE
|
1667
|
+
dcl_uslset(obj, cp, lpara)
|
1668
|
+
VALUE obj, cp, lpara;
|
1669
|
+
{
|
1670
|
+
char *i_cp;
|
1671
|
+
logical i_lpara;
|
1672
|
+
|
1673
|
+
if (TYPE(cp) != T_STRING) {
|
1674
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
1675
|
+
}
|
1676
|
+
|
1677
|
+
i_cp = StringValuePtr(cp);
|
1678
|
+
i_lpara = ((lpara == Qnil)||(lpara == Qfalse)) ? FALSE_ : TRUE_;
|
1679
|
+
|
1680
|
+
|
1681
|
+
uslset_(i_cp, &i_lpara, (ftnlen)strlen(i_cp));
|
1682
|
+
|
1683
|
+
return Qnil;
|
1684
|
+
|
1685
|
+
}
|
1686
|
+
|
1687
|
+
static VALUE
|
1688
|
+
dcl_uslstx(obj, cp, lpara)
|
1689
|
+
VALUE obj, cp, lpara;
|
1690
|
+
{
|
1691
|
+
char *i_cp;
|
1692
|
+
logical i_lpara;
|
1693
|
+
|
1694
|
+
if (TYPE(cp) != T_STRING) {
|
1695
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
1696
|
+
}
|
1697
|
+
|
1698
|
+
i_cp = StringValuePtr(cp);
|
1699
|
+
i_lpara = ((lpara == Qnil)||(lpara == Qfalse)) ? FALSE_ : TRUE_;
|
1700
|
+
|
1701
|
+
|
1702
|
+
uslstx_(i_cp, &i_lpara, (ftnlen)strlen(i_cp));
|
1703
|
+
|
1704
|
+
return Qnil;
|
1705
|
+
|
1706
|
+
}
|
1707
|
+
|
1708
|
+
static VALUE
|
1709
|
+
dcl_uslqnp(obj)
|
1710
|
+
VALUE obj;
|
1711
|
+
{
|
1712
|
+
integer o_ncp;
|
1713
|
+
VALUE ncp;
|
1714
|
+
|
1715
|
+
uslqnp_(&o_ncp);
|
1716
|
+
|
1717
|
+
ncp = INT2NUM(o_ncp);
|
1718
|
+
|
1719
|
+
|
1720
|
+
return ncp;
|
1721
|
+
|
1722
|
+
}
|
1723
|
+
|
1724
|
+
static VALUE
|
1725
|
+
dcl_uslqid(obj, cp)
|
1726
|
+
VALUE obj, cp;
|
1727
|
+
{
|
1728
|
+
char *i_cp;
|
1729
|
+
integer o_idx;
|
1730
|
+
VALUE idx;
|
1731
|
+
|
1732
|
+
if (TYPE(cp) != T_STRING) {
|
1733
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
1734
|
+
}
|
1735
|
+
|
1736
|
+
i_cp = StringValuePtr(cp);
|
1737
|
+
|
1738
|
+
|
1739
|
+
uslqid_(i_cp, &o_idx, (ftnlen)strlen(i_cp));
|
1740
|
+
|
1741
|
+
idx = INT2NUM(o_idx);
|
1742
|
+
|
1743
|
+
|
1744
|
+
return idx;
|
1745
|
+
|
1746
|
+
}
|
1747
|
+
|
1748
|
+
static VALUE
|
1749
|
+
dcl_uslqcp(obj, idx)
|
1750
|
+
VALUE obj, idx;
|
1751
|
+
{
|
1752
|
+
integer i_idx;
|
1753
|
+
char *o_cp;
|
1754
|
+
VALUE cp;
|
1755
|
+
|
1756
|
+
if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
|
1757
|
+
idx = rb_funcall(idx, rb_intern("to_i"), 0);
|
1758
|
+
}
|
1759
|
+
|
1760
|
+
i_idx = NUM2INT(idx);
|
1761
|
+
|
1762
|
+
o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
|
1763
|
+
memset(o_cp, '\0', DFLT_SIZE+1);
|
1764
|
+
|
1765
|
+
uslqcp_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
|
1766
|
+
|
1767
|
+
cp = rb_str_new2(o_cp);
|
1768
|
+
|
1769
|
+
|
1770
|
+
return cp;
|
1771
|
+
|
1772
|
+
}
|
1773
|
+
|
1774
|
+
static VALUE
|
1775
|
+
dcl_uslqcl(obj, idx)
|
1776
|
+
VALUE obj, idx;
|
1777
|
+
{
|
1778
|
+
integer i_idx;
|
1779
|
+
char *o_cp;
|
1780
|
+
VALUE cp;
|
1781
|
+
|
1782
|
+
if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
|
1783
|
+
idx = rb_funcall(idx, rb_intern("to_i"), 0);
|
1784
|
+
}
|
1785
|
+
|
1786
|
+
i_idx = NUM2INT(idx);
|
1787
|
+
|
1788
|
+
o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
|
1789
|
+
memset(o_cp, '\0', DFLT_SIZE+1);
|
1790
|
+
|
1791
|
+
uslqcl_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
|
1792
|
+
|
1793
|
+
cp = rb_str_new2(o_cp);
|
1794
|
+
|
1795
|
+
|
1796
|
+
return cp;
|
1797
|
+
|
1798
|
+
}
|
1799
|
+
|
1800
|
+
static VALUE
|
1801
|
+
dcl_uslqvl(obj, idx)
|
1802
|
+
VALUE obj, idx;
|
1803
|
+
{
|
1804
|
+
integer i_idx;
|
1805
|
+
logical o_lpara;
|
1806
|
+
VALUE lpara;
|
1807
|
+
|
1808
|
+
if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
|
1809
|
+
idx = rb_funcall(idx, rb_intern("to_i"), 0);
|
1810
|
+
}
|
1811
|
+
|
1812
|
+
i_idx = NUM2INT(idx);
|
1813
|
+
|
1814
|
+
|
1815
|
+
uslqvl_(&i_idx, &o_lpara);
|
1816
|
+
|
1817
|
+
lpara = (o_lpara == FALSE_) ? Qfalse : Qtrue;
|
1818
|
+
|
1819
|
+
|
1820
|
+
return lpara;
|
1821
|
+
|
1822
|
+
}
|
1823
|
+
|
1824
|
+
static VALUE
|
1825
|
+
dcl_uslsvl(obj, idx, lpara)
|
1826
|
+
VALUE obj, idx, lpara;
|
1827
|
+
{
|
1828
|
+
integer i_idx;
|
1829
|
+
logical i_lpara;
|
1830
|
+
|
1831
|
+
if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
|
1832
|
+
idx = rb_funcall(idx, rb_intern("to_i"), 0);
|
1833
|
+
}
|
1834
|
+
|
1835
|
+
i_idx = NUM2INT(idx);
|
1836
|
+
i_lpara = ((lpara == Qnil)||(lpara == Qfalse)) ? FALSE_ : TRUE_;
|
1837
|
+
|
1838
|
+
|
1839
|
+
uslsvl_(&i_idx, &i_lpara);
|
1840
|
+
|
1841
|
+
return Qnil;
|
1842
|
+
|
1843
|
+
}
|
1844
|
+
|
1845
|
+
static VALUE
|
1846
|
+
dcl_uslqin(obj, cp)
|
1847
|
+
VALUE obj, cp;
|
1848
|
+
{
|
1849
|
+
char *i_cp;
|
1850
|
+
integer o_in;
|
1851
|
+
VALUE in;
|
1852
|
+
|
1853
|
+
if (TYPE(cp) != T_STRING) {
|
1854
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
1855
|
+
}
|
1856
|
+
|
1857
|
+
i_cp = StringValuePtr(cp);
|
1858
|
+
|
1859
|
+
|
1860
|
+
uslqin_(i_cp, &o_in, (ftnlen)strlen(i_cp));
|
1861
|
+
|
1862
|
+
in = INT2NUM(o_in);
|
1863
|
+
|
1864
|
+
|
1865
|
+
return in;
|
1866
|
+
|
1867
|
+
}
|
1868
|
+
|
1869
|
+
static VALUE
|
1870
|
+
dcl_uspaxs(obj, cside, islct)
|
1871
|
+
VALUE obj, cside, islct;
|
1872
|
+
{
|
1873
|
+
char *i_cside;
|
1874
|
+
integer i_islct;
|
1875
|
+
|
1876
|
+
if (TYPE(cside) != T_STRING) {
|
1877
|
+
cside = rb_funcall(cside, rb_intern("to_str"), 0);
|
1878
|
+
}
|
1879
|
+
if ((TYPE(islct) != T_BIGNUM) || (TYPE(islct) != T_FIXNUM)) {
|
1880
|
+
islct = rb_funcall(islct, rb_intern("to_i"), 0);
|
1881
|
+
}
|
1882
|
+
|
1883
|
+
i_cside = StringValuePtr(cside);
|
1884
|
+
i_islct = NUM2INT(islct);
|
1885
|
+
|
1886
|
+
|
1887
|
+
uspaxs_(i_cside, &i_islct, (ftnlen)strlen(i_cside));
|
1888
|
+
|
1889
|
+
return Qnil;
|
1890
|
+
|
1891
|
+
}
|
1892
|
+
|
1893
|
+
static VALUE
|
1894
|
+
dcl_usplbl(obj, cside, islct, pos, ch, nc, n)
|
1895
|
+
VALUE obj, cside, islct, pos, ch, nc, n;
|
1896
|
+
{
|
1897
|
+
char *i_cside;
|
1898
|
+
integer i_islct;
|
1899
|
+
real *i_pos;
|
1900
|
+
char *i_ch;
|
1901
|
+
integer i_nc;
|
1902
|
+
integer i_n;
|
1903
|
+
|
1904
|
+
if (TYPE(cside) != T_STRING) {
|
1905
|
+
cside = rb_funcall(cside, rb_intern("to_str"), 0);
|
1906
|
+
}
|
1907
|
+
if ((TYPE(islct) != T_BIGNUM) || (TYPE(islct) != T_FIXNUM)) {
|
1908
|
+
islct = rb_funcall(islct, rb_intern("to_i"), 0);
|
1909
|
+
}
|
1910
|
+
if (TYPE(pos) == T_FLOAT) {
|
1911
|
+
pos = rb_Array(pos);
|
1912
|
+
}
|
1913
|
+
/* if ((TYPE(pos) != T_ARRAY) &&
|
1914
|
+
(rb_obj_is_kind_of(pos, cNArray) != Qtrue)) {
|
1915
|
+
rb_raise(rb_eTypeError, "invalid type");
|
1916
|
+
} -- no check since obj2c*ary will do that */
|
1917
|
+
if (TYPE(ch) == T_STRING) {
|
1918
|
+
ch = rb_Array(ch);
|
1919
|
+
}
|
1920
|
+
if (TYPE(ch) != T_ARRAY) {
|
1921
|
+
rb_raise(rb_eTypeError, "invalid type");
|
1922
|
+
}
|
1923
|
+
if ((TYPE(nc) != T_BIGNUM) || (TYPE(nc) != T_FIXNUM)) {
|
1924
|
+
nc = rb_funcall(nc, rb_intern("to_i"), 0);
|
1925
|
+
}
|
1926
|
+
if ((TYPE(n) != T_BIGNUM) || (TYPE(n) != T_FIXNUM)) {
|
1927
|
+
n = rb_funcall(n, rb_intern("to_i"), 0);
|
1928
|
+
}
|
1929
|
+
|
1930
|
+
i_cside = StringValuePtr(cside);
|
1931
|
+
i_islct = NUM2INT(islct);
|
1932
|
+
i_nc = NUM2INT(nc);
|
1933
|
+
i_n = NUM2INT(n);
|
1934
|
+
i_pos = dcl_obj2crealary(pos);
|
1935
|
+
i_ch = dcl_obj2ccharary(ch, (i_n*DFLT_SIZE), DFLT_SIZE);
|
1936
|
+
|
1937
|
+
|
1938
|
+
usplbl_(i_cside, &i_islct, i_pos, i_ch, &i_nc, &i_n, (ftnlen)strlen(i_cside), (ftnlen)DFLT_SIZE);
|
1939
|
+
|
1940
|
+
dcl_freecrealary(i_pos);
|
1941
|
+
dcl_freeccharary(i_ch);
|
1942
|
+
|
1943
|
+
return Qnil;
|
1944
|
+
|
1945
|
+
}
|
1946
|
+
|
1947
|
+
static VALUE
|
1948
|
+
dcl_uspnum(obj, cside, islct, pos, n)
|
1949
|
+
VALUE obj, cside, islct, pos, n;
|
1950
|
+
{
|
1951
|
+
char *i_cside;
|
1952
|
+
integer i_islct;
|
1953
|
+
real *i_pos;
|
1954
|
+
integer i_n;
|
1955
|
+
|
1956
|
+
if (TYPE(cside) != T_STRING) {
|
1957
|
+
cside = rb_funcall(cside, rb_intern("to_str"), 0);
|
1958
|
+
}
|
1959
|
+
if ((TYPE(islct) != T_BIGNUM) || (TYPE(islct) != T_FIXNUM)) {
|
1960
|
+
islct = rb_funcall(islct, rb_intern("to_i"), 0);
|
1961
|
+
}
|
1962
|
+
if (TYPE(pos) == T_FLOAT) {
|
1963
|
+
pos = rb_Array(pos);
|
1964
|
+
}
|
1965
|
+
/* if ((TYPE(pos) != T_ARRAY) &&
|
1966
|
+
(rb_obj_is_kind_of(pos, cNArray) != Qtrue)) {
|
1967
|
+
rb_raise(rb_eTypeError, "invalid type");
|
1968
|
+
} -- no check since obj2c*ary will do that */
|
1969
|
+
if ((TYPE(n) != T_BIGNUM) || (TYPE(n) != T_FIXNUM)) {
|
1970
|
+
n = rb_funcall(n, rb_intern("to_i"), 0);
|
1971
|
+
}
|
1972
|
+
|
1973
|
+
i_cside = StringValuePtr(cside);
|
1974
|
+
i_islct = NUM2INT(islct);
|
1975
|
+
i_n = NUM2INT(n);
|
1976
|
+
i_pos = dcl_obj2crealary(pos);
|
1977
|
+
|
1978
|
+
|
1979
|
+
uspnum_(i_cside, &i_islct, i_pos, &i_n, (ftnlen)strlen(i_cside));
|
1980
|
+
|
1981
|
+
dcl_freecrealary(i_pos);
|
1982
|
+
|
1983
|
+
return Qnil;
|
1984
|
+
|
1985
|
+
}
|
1986
|
+
|
1987
|
+
static VALUE
|
1988
|
+
dcl_usptmk(obj, cside, islct, pos, n)
|
1989
|
+
VALUE obj, cside, islct, pos, n;
|
1990
|
+
{
|
1991
|
+
char *i_cside;
|
1992
|
+
integer i_islct;
|
1993
|
+
real *i_pos;
|
1994
|
+
integer i_n;
|
1995
|
+
|
1996
|
+
if (TYPE(cside) != T_STRING) {
|
1997
|
+
cside = rb_funcall(cside, rb_intern("to_str"), 0);
|
1998
|
+
}
|
1999
|
+
if ((TYPE(islct) != T_BIGNUM) || (TYPE(islct) != T_FIXNUM)) {
|
2000
|
+
islct = rb_funcall(islct, rb_intern("to_i"), 0);
|
2001
|
+
}
|
2002
|
+
if (TYPE(pos) == T_FLOAT) {
|
2003
|
+
pos = rb_Array(pos);
|
2004
|
+
}
|
2005
|
+
/* if ((TYPE(pos) != T_ARRAY) &&
|
2006
|
+
(rb_obj_is_kind_of(pos, cNArray) != Qtrue)) {
|
2007
|
+
rb_raise(rb_eTypeError, "invalid type");
|
2008
|
+
} -- no check since obj2c*ary will do that */
|
2009
|
+
if ((TYPE(n) != T_BIGNUM) || (TYPE(n) != T_FIXNUM)) {
|
2010
|
+
n = rb_funcall(n, rb_intern("to_i"), 0);
|
2011
|
+
}
|
2012
|
+
|
2013
|
+
i_cside = StringValuePtr(cside);
|
2014
|
+
i_islct = NUM2INT(islct);
|
2015
|
+
i_n = NUM2INT(n);
|
2016
|
+
i_pos = dcl_obj2crealary(pos);
|
2017
|
+
|
2018
|
+
|
2019
|
+
usptmk_(i_cside, &i_islct, i_pos, &i_n, (ftnlen)strlen(i_cside));
|
2020
|
+
|
2021
|
+
dcl_freecrealary(i_pos);
|
2022
|
+
|
2023
|
+
return Qnil;
|
2024
|
+
|
2025
|
+
}
|
2026
|
+
|
2027
|
+
static VALUE
|
2028
|
+
dcl_uspttl(obj, cside, islct, cttl, pos)
|
2029
|
+
VALUE obj, cside, islct, cttl, pos;
|
2030
|
+
{
|
2031
|
+
char *i_cside;
|
2032
|
+
integer i_islct;
|
2033
|
+
char *i_cttl;
|
2034
|
+
real i_pos;
|
2035
|
+
|
2036
|
+
if (TYPE(cside) != T_STRING) {
|
2037
|
+
cside = rb_funcall(cside, rb_intern("to_str"), 0);
|
2038
|
+
}
|
2039
|
+
if ((TYPE(islct) != T_BIGNUM) || (TYPE(islct) != T_FIXNUM)) {
|
2040
|
+
islct = rb_funcall(islct, rb_intern("to_i"), 0);
|
2041
|
+
}
|
2042
|
+
if (TYPE(cttl) != T_STRING) {
|
2043
|
+
cttl = rb_funcall(cttl, rb_intern("to_str"), 0);
|
2044
|
+
}
|
2045
|
+
if (TYPE(pos) != T_FLOAT) {
|
2046
|
+
pos = rb_funcall(pos, rb_intern("to_f"), 0);
|
2047
|
+
}
|
2048
|
+
|
2049
|
+
i_cside = StringValuePtr(cside);
|
2050
|
+
i_islct = NUM2INT(islct);
|
2051
|
+
i_cttl = StringValuePtr(cttl);
|
2052
|
+
i_pos = (real)NUM2DBL(pos);
|
2053
|
+
|
2054
|
+
|
2055
|
+
uspttl_(i_cside, &i_islct, i_cttl, &i_pos, (ftnlen)strlen(i_cside), (ftnlen)strlen(i_cttl));
|
2056
|
+
|
2057
|
+
return Qnil;
|
2058
|
+
|
2059
|
+
}
|
2060
|
+
|
2061
|
+
static VALUE
|
2062
|
+
dcl_usrget(obj, cp)
|
2063
|
+
VALUE obj, cp;
|
2064
|
+
{
|
2065
|
+
char *i_cp;
|
2066
|
+
real o_rpara;
|
2067
|
+
VALUE rpara;
|
2068
|
+
|
2069
|
+
if (TYPE(cp) != T_STRING) {
|
2070
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
2071
|
+
}
|
2072
|
+
|
2073
|
+
i_cp = StringValuePtr(cp);
|
2074
|
+
|
2075
|
+
|
2076
|
+
usrget_(i_cp, &o_rpara, (ftnlen)strlen(i_cp));
|
2077
|
+
|
2078
|
+
rpara = rb_float_new((double)o_rpara);
|
2079
|
+
|
2080
|
+
|
2081
|
+
return rpara;
|
2082
|
+
|
2083
|
+
}
|
2084
|
+
|
2085
|
+
static VALUE
|
2086
|
+
dcl_usrset(obj, cp, rpara)
|
2087
|
+
VALUE obj, cp, rpara;
|
2088
|
+
{
|
2089
|
+
char *i_cp;
|
2090
|
+
real i_rpara;
|
2091
|
+
|
2092
|
+
if (TYPE(cp) != T_STRING) {
|
2093
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
2094
|
+
}
|
2095
|
+
if (TYPE(rpara) != T_FLOAT) {
|
2096
|
+
rpara = rb_funcall(rpara, rb_intern("to_f"), 0);
|
2097
|
+
}
|
2098
|
+
|
2099
|
+
i_cp = StringValuePtr(cp);
|
2100
|
+
i_rpara = (real)NUM2DBL(rpara);
|
2101
|
+
|
2102
|
+
|
2103
|
+
usrset_(i_cp, &i_rpara, (ftnlen)strlen(i_cp));
|
2104
|
+
|
2105
|
+
return Qnil;
|
2106
|
+
|
2107
|
+
}
|
2108
|
+
|
2109
|
+
static VALUE
|
2110
|
+
dcl_usrstx(obj, cp, rpara)
|
2111
|
+
VALUE obj, cp, rpara;
|
2112
|
+
{
|
2113
|
+
char *i_cp;
|
2114
|
+
real i_rpara;
|
2115
|
+
|
2116
|
+
if (TYPE(cp) != T_STRING) {
|
2117
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
2118
|
+
}
|
2119
|
+
if (TYPE(rpara) != T_FLOAT) {
|
2120
|
+
rpara = rb_funcall(rpara, rb_intern("to_f"), 0);
|
2121
|
+
}
|
2122
|
+
|
2123
|
+
i_cp = StringValuePtr(cp);
|
2124
|
+
i_rpara = (real)NUM2DBL(rpara);
|
2125
|
+
|
2126
|
+
|
2127
|
+
usrstx_(i_cp, &i_rpara, (ftnlen)strlen(i_cp));
|
2128
|
+
|
2129
|
+
return Qnil;
|
2130
|
+
|
2131
|
+
}
|
2132
|
+
|
2133
|
+
static VALUE
|
2134
|
+
dcl_usrqnp(obj)
|
2135
|
+
VALUE obj;
|
2136
|
+
{
|
2137
|
+
integer o_ncp;
|
2138
|
+
VALUE ncp;
|
2139
|
+
|
2140
|
+
usrqnp_(&o_ncp);
|
2141
|
+
|
2142
|
+
ncp = INT2NUM(o_ncp);
|
2143
|
+
|
2144
|
+
|
2145
|
+
return ncp;
|
2146
|
+
|
2147
|
+
}
|
2148
|
+
|
2149
|
+
static VALUE
|
2150
|
+
dcl_usrqid(obj, cp)
|
2151
|
+
VALUE obj, cp;
|
2152
|
+
{
|
2153
|
+
char *i_cp;
|
2154
|
+
integer o_idx;
|
2155
|
+
VALUE idx;
|
2156
|
+
|
2157
|
+
if (TYPE(cp) != T_STRING) {
|
2158
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
2159
|
+
}
|
2160
|
+
|
2161
|
+
i_cp = StringValuePtr(cp);
|
2162
|
+
|
2163
|
+
|
2164
|
+
usrqid_(i_cp, &o_idx, (ftnlen)strlen(i_cp));
|
2165
|
+
|
2166
|
+
idx = INT2NUM(o_idx);
|
2167
|
+
|
2168
|
+
|
2169
|
+
return idx;
|
2170
|
+
|
2171
|
+
}
|
2172
|
+
|
2173
|
+
static VALUE
|
2174
|
+
dcl_usrqcp(obj, idx)
|
2175
|
+
VALUE obj, idx;
|
2176
|
+
{
|
2177
|
+
integer i_idx;
|
2178
|
+
char *o_cp;
|
2179
|
+
VALUE cp;
|
2180
|
+
|
2181
|
+
if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
|
2182
|
+
idx = rb_funcall(idx, rb_intern("to_i"), 0);
|
2183
|
+
}
|
2184
|
+
|
2185
|
+
i_idx = NUM2INT(idx);
|
2186
|
+
|
2187
|
+
o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
|
2188
|
+
memset(o_cp, '\0', DFLT_SIZE+1);
|
2189
|
+
|
2190
|
+
usrqcp_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
|
2191
|
+
|
2192
|
+
cp = rb_str_new2(o_cp);
|
2193
|
+
|
2194
|
+
|
2195
|
+
return cp;
|
2196
|
+
|
2197
|
+
}
|
2198
|
+
|
2199
|
+
static VALUE
|
2200
|
+
dcl_usrqcl(obj, idx)
|
2201
|
+
VALUE obj, idx;
|
2202
|
+
{
|
2203
|
+
integer i_idx;
|
2204
|
+
char *o_cp;
|
2205
|
+
VALUE cp;
|
2206
|
+
|
2207
|
+
if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
|
2208
|
+
idx = rb_funcall(idx, rb_intern("to_i"), 0);
|
2209
|
+
}
|
2210
|
+
|
2211
|
+
i_idx = NUM2INT(idx);
|
2212
|
+
|
2213
|
+
o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
|
2214
|
+
memset(o_cp, '\0', DFLT_SIZE+1);
|
2215
|
+
|
2216
|
+
usrqcl_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
|
2217
|
+
|
2218
|
+
cp = rb_str_new2(o_cp);
|
2219
|
+
|
2220
|
+
|
2221
|
+
return cp;
|
2222
|
+
|
2223
|
+
}
|
2224
|
+
|
2225
|
+
static VALUE
|
2226
|
+
dcl_usrqvl(obj, idx)
|
2227
|
+
VALUE obj, idx;
|
2228
|
+
{
|
2229
|
+
integer i_idx;
|
2230
|
+
real o_rpara;
|
2231
|
+
VALUE rpara;
|
2232
|
+
|
2233
|
+
if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
|
2234
|
+
idx = rb_funcall(idx, rb_intern("to_i"), 0);
|
2235
|
+
}
|
2236
|
+
|
2237
|
+
i_idx = NUM2INT(idx);
|
2238
|
+
|
2239
|
+
|
2240
|
+
usrqvl_(&i_idx, &o_rpara);
|
2241
|
+
|
2242
|
+
rpara = rb_float_new((double)o_rpara);
|
2243
|
+
|
2244
|
+
|
2245
|
+
return rpara;
|
2246
|
+
|
2247
|
+
}
|
2248
|
+
|
2249
|
+
static VALUE
|
2250
|
+
dcl_usrsvl(obj, idx, rpara)
|
2251
|
+
VALUE obj, idx, rpara;
|
2252
|
+
{
|
2253
|
+
integer i_idx;
|
2254
|
+
real i_rpara;
|
2255
|
+
|
2256
|
+
if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
|
2257
|
+
idx = rb_funcall(idx, rb_intern("to_i"), 0);
|
2258
|
+
}
|
2259
|
+
if (TYPE(rpara) != T_FLOAT) {
|
2260
|
+
rpara = rb_funcall(rpara, rb_intern("to_f"), 0);
|
2261
|
+
}
|
2262
|
+
|
2263
|
+
i_idx = NUM2INT(idx);
|
2264
|
+
i_rpara = (real)NUM2DBL(rpara);
|
2265
|
+
|
2266
|
+
|
2267
|
+
usrsvl_(&i_idx, &i_rpara);
|
2268
|
+
|
2269
|
+
return Qnil;
|
2270
|
+
|
2271
|
+
}
|
2272
|
+
|
2273
|
+
static VALUE
|
2274
|
+
dcl_usrqin(obj, cp)
|
2275
|
+
VALUE obj, cp;
|
2276
|
+
{
|
2277
|
+
char *i_cp;
|
2278
|
+
integer o_in;
|
2279
|
+
VALUE in;
|
2280
|
+
|
2281
|
+
if (TYPE(cp) != T_STRING) {
|
2282
|
+
cp = rb_funcall(cp, rb_intern("to_str"), 0);
|
2283
|
+
}
|
2284
|
+
|
2285
|
+
i_cp = StringValuePtr(cp);
|
2286
|
+
|
2287
|
+
|
2288
|
+
usrqin_(i_cp, &o_in, (ftnlen)strlen(i_cp));
|
2289
|
+
|
2290
|
+
in = INT2NUM(o_in);
|
2291
|
+
|
2292
|
+
|
2293
|
+
return in;
|
2294
|
+
|
2295
|
+
}
|
2296
|
+
|
2297
|
+
static VALUE
|
2298
|
+
dcl_ussaxs(obj, cside)
|
2299
|
+
VALUE obj, cside;
|
2300
|
+
{
|
2301
|
+
char *i_cside;
|
2302
|
+
|
2303
|
+
if (TYPE(cside) != T_STRING) {
|
2304
|
+
cside = rb_funcall(cside, rb_intern("to_str"), 0);
|
2305
|
+
}
|
2306
|
+
|
2307
|
+
i_cside = StringValuePtr(cside);
|
2308
|
+
|
2309
|
+
|
2310
|
+
ussaxs_(i_cside, (ftnlen)strlen(i_cside));
|
2311
|
+
|
2312
|
+
return Qnil;
|
2313
|
+
|
2314
|
+
}
|
2315
|
+
|
2316
|
+
static VALUE
|
2317
|
+
dcl_usxinz(obj, csa)
|
2318
|
+
VALUE obj, csa;
|
2319
|
+
{
|
2320
|
+
char *i_csa;
|
2321
|
+
real o_faca;
|
2322
|
+
real o_offa;
|
2323
|
+
VALUE faca;
|
2324
|
+
VALUE offa;
|
2325
|
+
|
2326
|
+
if (TYPE(csa) != T_STRING) {
|
2327
|
+
csa = rb_funcall(csa, rb_intern("to_str"), 0);
|
2328
|
+
}
|
2329
|
+
|
2330
|
+
i_csa = StringValuePtr(csa);
|
2331
|
+
|
2332
|
+
|
2333
|
+
usxinz_(i_csa, &o_faca, &o_offa, (ftnlen)strlen(i_csa));
|
2334
|
+
|
2335
|
+
faca = rb_float_new((double)o_faca);
|
2336
|
+
offa = rb_float_new((double)o_offa);
|
2337
|
+
|
2338
|
+
|
2339
|
+
return rb_ary_new3(2, faca, offa);
|
2340
|
+
|
2341
|
+
}
|
2342
|
+
|
2343
|
+
static VALUE
|
2344
|
+
dcl_usxtlz(obj)
|
2345
|
+
VALUE obj;
|
2346
|
+
{
|
2347
|
+
usxtlz_();
|
2348
|
+
|
2349
|
+
return Qnil;
|
2350
|
+
|
2351
|
+
}
|
2352
|
+
|
2353
|
+
static VALUE
|
2354
|
+
dcl_usyinz(obj, csa)
|
2355
|
+
VALUE obj, csa;
|
2356
|
+
{
|
2357
|
+
char *i_csa;
|
2358
|
+
real o_faca;
|
2359
|
+
real o_offa;
|
2360
|
+
VALUE faca;
|
2361
|
+
VALUE offa;
|
2362
|
+
|
2363
|
+
if (TYPE(csa) != T_STRING) {
|
2364
|
+
csa = rb_funcall(csa, rb_intern("to_str"), 0);
|
2365
|
+
}
|
2366
|
+
|
2367
|
+
i_csa = StringValuePtr(csa);
|
2368
|
+
|
2369
|
+
|
2370
|
+
usyinz_(i_csa, &o_faca, &o_offa, (ftnlen)strlen(i_csa));
|
2371
|
+
|
2372
|
+
faca = rb_float_new((double)o_faca);
|
2373
|
+
offa = rb_float_new((double)o_offa);
|
2374
|
+
|
2375
|
+
|
2376
|
+
return rb_ary_new3(2, faca, offa);
|
2377
|
+
|
2378
|
+
}
|
2379
|
+
|
2380
|
+
static VALUE
|
2381
|
+
dcl_usytlz(obj)
|
2382
|
+
VALUE obj;
|
2383
|
+
{
|
2384
|
+
usytlz_();
|
2385
|
+
|
2386
|
+
return Qnil;
|
2387
|
+
|
2388
|
+
}
|
2389
|
+
void
|
2390
|
+
init_grph2_uspack(mDCL)
|
2391
|
+
VALUE mDCL;
|
2392
|
+
{
|
2393
|
+
rb_define_module_function(mDCL, "usgrph", dcl_usgrph, 3);
|
2394
|
+
rb_define_module_function(mDCL, "ussttl", dcl_ussttl, 4);
|
2395
|
+
rb_define_module_function(mDCL, "usspnt", dcl_usspnt, 3);
|
2396
|
+
rb_define_module_function(mDCL, "uspfit", dcl_uspfit, 0);
|
2397
|
+
rb_define_module_function(mDCL, "usdaxs", dcl_usdaxs, 0);
|
2398
|
+
rb_define_module_function(mDCL, "usinit", dcl_usinit, 0);
|
2399
|
+
rb_define_module_function(mDCL, "uspqnp", dcl_uspqnp, 0);
|
2400
|
+
rb_define_module_function(mDCL, "uspqid", dcl_uspqid, 1);
|
2401
|
+
rb_define_module_function(mDCL, "uspqcp", dcl_uspqcp, 1);
|
2402
|
+
rb_define_module_function(mDCL, "uspqcl", dcl_uspqcl, 1);
|
2403
|
+
rb_define_module_function(mDCL, "uspqit", dcl_uspqit, 1);
|
2404
|
+
rb_define_module_function(mDCL, "uspqvl", dcl_uspqvl, 1);
|
2405
|
+
rb_define_module_function(mDCL, "uspsvl", dcl_uspsvl, 2);
|
2406
|
+
rb_define_module_function(mDCL, "uspqin", dcl_uspqin, 1);
|
2407
|
+
rb_define_module_function(mDCL, "uscget", dcl_uscget, 1);
|
2408
|
+
rb_define_module_function(mDCL, "uscset", dcl_uscset, 2);
|
2409
|
+
rb_define_module_function(mDCL, "uscstx", dcl_uscstx, 2);
|
2410
|
+
rb_define_module_function(mDCL, "uscqnp", dcl_uscqnp, 0);
|
2411
|
+
rb_define_module_function(mDCL, "uscqid", dcl_uscqid, 1);
|
2412
|
+
rb_define_module_function(mDCL, "uscqcp", dcl_uscqcp, 1);
|
2413
|
+
rb_define_module_function(mDCL, "uscqcl", dcl_uscqcl, 1);
|
2414
|
+
rb_define_module_function(mDCL, "uscqvl", dcl_uscqvl, 1);
|
2415
|
+
rb_define_module_function(mDCL, "uscsvl", dcl_uscsvl, 2);
|
2416
|
+
rb_define_module_function(mDCL, "uscqin", dcl_uscqin, 1);
|
2417
|
+
rb_define_module_function(mDCL, "usurdl", dcl_usurdl, 4);
|
2418
|
+
rb_define_module_function(mDCL, "usxaxs", dcl_usxaxs, 1);
|
2419
|
+
rb_define_module_function(mDCL, "usyaxs", dcl_usyaxs, 1);
|
2420
|
+
rb_define_module_function(mDCL, "ususcu", dcl_ususcu, 6);
|
2421
|
+
rb_define_module_function(mDCL, "ususcl", dcl_ususcl, 5);
|
2422
|
+
rb_define_module_function(mDCL, "usxaxu", dcl_usxaxu, 1);
|
2423
|
+
rb_define_module_function(mDCL, "usxaxl", dcl_usxaxl, 1);
|
2424
|
+
rb_define_module_function(mDCL, "usyaxu", dcl_usyaxu, 1);
|
2425
|
+
rb_define_module_function(mDCL, "usyaxl", dcl_usyaxl, 1);
|
2426
|
+
rb_define_module_function(mDCL, "usxsub", dcl_usxsub, 4);
|
2427
|
+
rb_define_module_function(mDCL, "usysub", dcl_usysub, 4);
|
2428
|
+
rb_define_module_function(mDCL, "csblbl", dcl_csblbl, 3);
|
2429
|
+
rb_define_module_function(mDCL, "uschvl", dcl_uschvl, 1);
|
2430
|
+
rb_define_module_function(mDCL, "usxoff", dcl_usxoff, 1);
|
2431
|
+
rb_define_module_function(mDCL, "usyoff", dcl_usyoff, 1);
|
2432
|
+
rb_define_module_function(mDCL, "uszdgt", dcl_uszdgt, 6);
|
2433
|
+
rb_define_module_function(mDCL, "uswapz", dcl_uswapz, 3);
|
2434
|
+
rb_define_module_function(mDCL, "usurdt", dcl_usurdt, 4);
|
2435
|
+
rb_define_module_function(mDCL, "usaxcl", dcl_usaxcl, 4);
|
2436
|
+
rb_define_module_function(mDCL, "usaxdv", dcl_usaxdv, 3);
|
2437
|
+
rb_define_module_function(mDCL, "usaxlb", dcl_usaxlb, 7);
|
2438
|
+
rb_define_module_function(mDCL, "usaxlg", dcl_usaxlg, 3);
|
2439
|
+
rb_define_module_function(mDCL, "usaxnm", dcl_usaxnm, 5);
|
2440
|
+
rb_define_module_function(mDCL, "usaxsc", dcl_usaxsc, 1);
|
2441
|
+
rb_define_module_function(mDCL, "usiget", dcl_usiget, 1);
|
2442
|
+
rb_define_module_function(mDCL, "usiset", dcl_usiset, 2);
|
2443
|
+
rb_define_module_function(mDCL, "usistx", dcl_usistx, 2);
|
2444
|
+
rb_define_module_function(mDCL, "usiqnp", dcl_usiqnp, 0);
|
2445
|
+
rb_define_module_function(mDCL, "usiqid", dcl_usiqid, 1);
|
2446
|
+
rb_define_module_function(mDCL, "usiqcp", dcl_usiqcp, 1);
|
2447
|
+
rb_define_module_function(mDCL, "usiqcl", dcl_usiqcl, 1);
|
2448
|
+
rb_define_module_function(mDCL, "usiqvl", dcl_usiqvl, 1);
|
2449
|
+
rb_define_module_function(mDCL, "usisvl", dcl_usisvl, 2);
|
2450
|
+
rb_define_module_function(mDCL, "usiqin", dcl_usiqin, 1);
|
2451
|
+
rb_define_module_function(mDCL, "uslget", dcl_uslget, 1);
|
2452
|
+
rb_define_module_function(mDCL, "uslset", dcl_uslset, 2);
|
2453
|
+
rb_define_module_function(mDCL, "uslstx", dcl_uslstx, 2);
|
2454
|
+
rb_define_module_function(mDCL, "uslqnp", dcl_uslqnp, 0);
|
2455
|
+
rb_define_module_function(mDCL, "uslqid", dcl_uslqid, 1);
|
2456
|
+
rb_define_module_function(mDCL, "uslqcp", dcl_uslqcp, 1);
|
2457
|
+
rb_define_module_function(mDCL, "uslqcl", dcl_uslqcl, 1);
|
2458
|
+
rb_define_module_function(mDCL, "uslqvl", dcl_uslqvl, 1);
|
2459
|
+
rb_define_module_function(mDCL, "uslsvl", dcl_uslsvl, 2);
|
2460
|
+
rb_define_module_function(mDCL, "uslqin", dcl_uslqin, 1);
|
2461
|
+
rb_define_module_function(mDCL, "uspaxs", dcl_uspaxs, 2);
|
2462
|
+
rb_define_module_function(mDCL, "usplbl", dcl_usplbl, 6);
|
2463
|
+
rb_define_module_function(mDCL, "uspnum", dcl_uspnum, 4);
|
2464
|
+
rb_define_module_function(mDCL, "usptmk", dcl_usptmk, 4);
|
2465
|
+
rb_define_module_function(mDCL, "uspttl", dcl_uspttl, 4);
|
2466
|
+
rb_define_module_function(mDCL, "usrget", dcl_usrget, 1);
|
2467
|
+
rb_define_module_function(mDCL, "usrset", dcl_usrset, 2);
|
2468
|
+
rb_define_module_function(mDCL, "usrstx", dcl_usrstx, 2);
|
2469
|
+
rb_define_module_function(mDCL, "usrqnp", dcl_usrqnp, 0);
|
2470
|
+
rb_define_module_function(mDCL, "usrqid", dcl_usrqid, 1);
|
2471
|
+
rb_define_module_function(mDCL, "usrqcp", dcl_usrqcp, 1);
|
2472
|
+
rb_define_module_function(mDCL, "usrqcl", dcl_usrqcl, 1);
|
2473
|
+
rb_define_module_function(mDCL, "usrqvl", dcl_usrqvl, 1);
|
2474
|
+
rb_define_module_function(mDCL, "usrsvl", dcl_usrsvl, 2);
|
2475
|
+
rb_define_module_function(mDCL, "usrqin", dcl_usrqin, 1);
|
2476
|
+
rb_define_module_function(mDCL, "ussaxs", dcl_ussaxs, 1);
|
2477
|
+
rb_define_module_function(mDCL, "usxinz", dcl_usxinz, 1);
|
2478
|
+
rb_define_module_function(mDCL, "usxtlz", dcl_usxtlz, 0);
|
2479
|
+
rb_define_module_function(mDCL, "usyinz", dcl_usyinz, 1);
|
2480
|
+
rb_define_module_function(mDCL, "usytlz", dcl_usytlz, 0);
|
2481
|
+
}
|