ruby-dcl 1.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (319) hide show
  1. data/ChangeLog +321 -0
  2. data/GenWrapper/Makefile +14 -0
  3. data/GenWrapper/cproto2init.rb +41 -0
  4. data/GenWrapper/dcl_narrayed_funcs.rb +181 -0
  5. data/GenWrapper/dcl_rb_footing +29 -0
  6. data/GenWrapper/dcl_rb_heading +129 -0
  7. data/GenWrapper/def.rb +20 -0
  8. data/GenWrapper/elim_ary_size.rb +398 -0
  9. data/GenWrapper/etc/Mk_proto +375 -0
  10. data/GenWrapper/etc/dcl_gen +13 -0
  11. data/GenWrapper/etc/p_header +63 -0
  12. data/GenWrapper/etc/p_init +410 -0
  13. data/GenWrapper/pparse.rb +137 -0
  14. data/GenWrapper/proto/Makefile +35 -0
  15. data/GenWrapper/proto/grph1_00 +17 -0
  16. data/GenWrapper/proto/grph1_csgi.fp +27 -0
  17. data/GenWrapper/proto/grph1_scpack.fp +442 -0
  18. data/GenWrapper/proto/grph1_sgpack.fp +1406 -0
  19. data/GenWrapper/proto/grph1_slpack.fp +316 -0
  20. data/GenWrapper/proto/grph1_stpack.fp +411 -0
  21. data/GenWrapper/proto/grph1_swpack.fp +746 -0
  22. data/GenWrapper/proto/grph2_00 +16 -0
  23. data/GenWrapper/proto/grph2_grpack.fp +139 -0
  24. data/GenWrapper/proto/grph2_ucpack.fp +522 -0
  25. data/GenWrapper/proto/grph2_udpack.fp +692 -0
  26. data/GenWrapper/proto/grph2_uepack.fp +601 -0
  27. data/GenWrapper/proto/grph2_ugpack.fp +436 -0
  28. data/GenWrapper/proto/grph2_uhpack.fp +246 -0
  29. data/GenWrapper/proto/grph2_ulpack.fp +516 -0
  30. data/GenWrapper/proto/grph2_umpack.fp +676 -0
  31. data/GenWrapper/proto/grph2_uspack.fp +989 -0
  32. data/GenWrapper/proto/grph2_uupack.fp +663 -0
  33. data/GenWrapper/proto/grph2_uvpack.fp +246 -0
  34. data/GenWrapper/proto/grph2_uwpack.fp +203 -0
  35. data/GenWrapper/proto/grph2_uxpack.fp +295 -0
  36. data/GenWrapper/proto/grph2_uypack.fp +295 -0
  37. data/GenWrapper/proto/grph2_uzpack.fp +574 -0
  38. data/GenWrapper/proto/math1_00 +12 -0
  39. data/GenWrapper/proto/math1_blklib.fp +58 -0
  40. data/GenWrapper/proto/math1_chrlib.fp +83 -0
  41. data/GenWrapper/proto/math1_fnclib.fp +79 -0
  42. data/GenWrapper/proto/math1_gnmlib.fp +118 -0
  43. data/GenWrapper/proto/math1_gt2dlib.fp +144 -0
  44. data/GenWrapper/proto/math1_ifalib.fp +123 -0
  45. data/GenWrapper/proto/math1_indxlib.fp +222 -0
  46. data/GenWrapper/proto/math1_intlib.fp +46 -0
  47. data/GenWrapper/proto/math1_lrllib.fp +276 -0
  48. data/GenWrapper/proto/math1_maplib.fp +24 -0
  49. data/GenWrapper/proto/math1_oslib.fp +28 -0
  50. data/GenWrapper/proto/math1_rfalib.fp +420 -0
  51. data/GenWrapper/proto/math1_rfblib.fp +51 -0
  52. data/GenWrapper/proto/math1_sublib.fp +60 -0
  53. data/GenWrapper/proto/math1_syslib.fp +767 -0
  54. data/GenWrapper/proto/math1_vialib.fp +339 -0
  55. data/GenWrapper/proto/math1_viblib.fp +264 -0
  56. data/GenWrapper/proto/math1_vralib.fp +339 -0
  57. data/GenWrapper/proto/math1_vrblib.fp +264 -0
  58. data/GenWrapper/proto/math1_xfclib.fp +68 -0
  59. data/GenWrapper/proto/math2_00 +12 -0
  60. data/GenWrapper/proto/math2_fftlib.fp +803 -0
  61. data/GenWrapper/proto/math2_intrlib.fp +32 -0
  62. data/GenWrapper/proto/math2_odelib.fp_notused +568 -0
  63. data/GenWrapper/proto/math2_rnmlib.fp +54 -0
  64. data/GenWrapper/proto/math2_shtlib.fp +1292 -0
  65. data/GenWrapper/proto/math2_shtlib.fp_old +1294 -0
  66. data/GenWrapper/proto/math2_vstlib.fp +84 -0
  67. data/GenWrapper/proto/misc1_00 +17 -0
  68. data/GenWrapper/proto/misc1_chnlib.fp +47 -0
  69. data/GenWrapper/proto/misc1_datelib.fp +352 -0
  70. data/GenWrapper/proto/misc1_fmtlib.fp +19 -0
  71. data/GenWrapper/proto/misc1_misclib.fp +26 -0
  72. data/GenWrapper/proto/misc1_randlib.fp +36 -0
  73. data/GenWrapper/proto/misc1_timelib.fp +151 -0
  74. data/GenWrapper/proto2c.rb +13 -0
  75. data/GenWrapper/prototype.rb +209 -0
  76. data/GenWrapper/util.rb +9 -0
  77. data/GenWrapper/variable.rb +671 -0
  78. data/README +29 -0
  79. data/Rakefile +44 -0
  80. data/ToDo +2 -0
  81. data/dcl_cary2obj.c +354 -0
  82. data/dcl_narrayed_funcs.c +518 -0
  83. data/dcl_obj2cary.c +512 -0
  84. data/dcl_rubydcloriginal.c +129 -0
  85. data/demo/gokuraku/hop/hop.rb +26 -0
  86. data/demo/gokuraku/jump/jump1.rb +64 -0
  87. data/demo/gokuraku/jump/jump2.rb +50 -0
  88. data/demo/gokuraku/layout/lay1.rb +46 -0
  89. data/demo/gokuraku/layout/lay2.rb +44 -0
  90. data/demo/gokuraku/step/step0.rb +34 -0
  91. data/demo/gokuraku/step/step1.rb +84 -0
  92. data/demo/gokuraku/step/step2.rb +62 -0
  93. data/demo/gokuraku/u1d/u1d1.rb +37 -0
  94. data/demo/gokuraku/u1d/u1d2.rb +50 -0
  95. data/demo/gokuraku/u2d/u2d1.rb +46 -0
  96. data/demo/gokuraku/u2d/u2d2.rb +49 -0
  97. data/demo/gokuraku/u2d/u2d3.rb +45 -0
  98. data/demo/gokuraku/u2d/u2d4.rb +61 -0
  99. data/demo/grph1/scpack/scpkt2.rb +40 -0
  100. data/demo/grph1/scpack/scpkt3.rb +102 -0
  101. data/demo/grph1/scpack/scpkt6.rb +84 -0
  102. data/demo/grph1/scpack/scpkt7.rb +59 -0
  103. data/demo/grph1/scpack/scpkt8.rb +60 -0
  104. data/demo/grph1/scpack/t810630.dat +296 -0
  105. data/demo/grph1/scpack/t811231.dat +296 -0
  106. data/demo/grph1/sgpack/sgfont.rb +52 -0
  107. data/demo/grph1/sgpack/sgfonz.rb +53 -0
  108. data/demo/grph1/sgpack/sgksx1.rb +44 -0
  109. data/demo/grph1/sgpack/sgksx2.rb +90 -0
  110. data/demo/grph1/sgpack/sgksx3.rb +75 -0
  111. data/demo/grph1/sgpack/sglidx.rb +40 -0
  112. data/demo/grph1/sgpack/sgltyp.rb +48 -0
  113. data/demo/grph1/sgpack/sgpk01.rb +39 -0
  114. data/demo/grph1/sgpack/sgpk02.rb +79 -0
  115. data/demo/grph1/sgpack/sgpk03.rb +107 -0
  116. data/demo/grph1/sgpack/sgpk04.rb +86 -0
  117. data/demo/grph1/sgpack/sgpk05.rb +66 -0
  118. data/demo/grph1/sgpack/sgpk06.rb +91 -0
  119. data/demo/grph1/sgpack/sgpk07.rb +66 -0
  120. data/demo/grph1/sgpack/sgpk08.rb +67 -0
  121. data/demo/grph1/sgpack/sgpk09.rb +61 -0
  122. data/demo/grph1/sgpack/sgpk10.rb +58 -0
  123. data/demo/grph1/sgpack/sgtclr.rb +59 -0
  124. data/demo/grph1/sgpack/sgtone.rb +70 -0
  125. data/demo/grph1/sgpack/sgtonz.rb +66 -0
  126. data/demo/grph1/slpack/slpk01.rb +37 -0
  127. data/demo/grph1/slpack/slpk02.rb +29 -0
  128. data/demo/grph1/slpack/slpk03.rb +36 -0
  129. data/demo/grph1/slpack/slpk04.rb +36 -0
  130. data/demo/grph2/g2pack/g2pk01.rb +78 -0
  131. data/demo/grph2/g2pack/g2pk02.rb +75 -0
  132. data/demo/grph2/grpack/grpk01.rb +65 -0
  133. data/demo/grph2/ucpack/ucpk01.rb +95 -0
  134. data/demo/grph2/ucpack/ucpk02.rb +95 -0
  135. data/demo/grph2/udegpk/u2df01.rb +50 -0
  136. data/demo/grph2/udegpk/u2df02.rb +76 -0
  137. data/demo/grph2/udegpk/u2df03.rb +80 -0
  138. data/demo/grph2/udegpk/u2df04.rb +52 -0
  139. data/demo/grph2/udegpk/u2df05.rb +70 -0
  140. data/demo/grph2/udegpk/u2df06.rb +59 -0
  141. data/demo/grph2/udegpk/u2df07.rb +68 -0
  142. data/demo/grph2/udegpk/u2df08.rb +91 -0
  143. data/demo/grph2/udegpk/u2df09b.rb +88 -0
  144. data/demo/grph2/udegpk/u2df09c.rb +89 -0
  145. data/demo/grph2/udegpk/u2df09e.rb +88 -0
  146. data/demo/grph2/udegpk/u2df09f.rb +89 -0
  147. data/demo/grph2/ulpack/ulpk01.rb +111 -0
  148. data/demo/grph2/ulpack/ulpk01n.rb +111 -0
  149. data/demo/grph2/ulpack/ulpk02.rb +111 -0
  150. data/demo/grph2/ulpack/ulpk02n.rb +111 -0
  151. data/demo/grph2/umpack/t811231.dat +296 -0
  152. data/demo/grph2/umpack/test01.rb +69 -0
  153. data/demo/grph2/umpack/test02.rb +64 -0
  154. data/demo/grph2/umpack/test03.rb +84 -0
  155. data/demo/grph2/umpack/test04.rb +54 -0
  156. data/demo/grph2/umpack/test05.rb +85 -0
  157. data/demo/grph2/umpack/test06.rb +44 -0
  158. data/demo/grph2/umpack/test07.rb +43 -0
  159. data/demo/grph2/umpack/test08.rb +37 -0
  160. data/demo/grph2/umpack/test09.rb +86 -0
  161. data/demo/grph2/umpack/test10.rb +52 -0
  162. data/demo/grph2/umpack/umpk01.rb +65 -0
  163. data/demo/grph2/umpack/umpk02.rb +54 -0
  164. data/demo/grph2/umpack/umpk03.rb +46 -0
  165. data/demo/grph2/umpack/umpk04.rb +65 -0
  166. data/demo/grph2/umpack/umpk05.rb +84 -0
  167. data/demo/grph2/uspack/uspk01.rb +39 -0
  168. data/demo/grph2/uspack/uspk02.rb +47 -0
  169. data/demo/grph2/uspack/uspk03.rb +38 -0
  170. data/demo/grph2/uspack/uspk04.rb +64 -0
  171. data/demo/grph2/uspack/uspk05.rb +68 -0
  172. data/demo/grph2/uspack/uspk06.rb +43 -0
  173. data/demo/grph2/uspack/uspk07.rb +62 -0
  174. data/demo/grph2/uspack/uspk08.rb +46 -0
  175. data/demo/grph2/uspack/uspk09.rb +89 -0
  176. data/demo/grph2/uspack/uspk10.rb +48 -0
  177. data/demo/grph2/uspack/uspk11.rb +71 -0
  178. data/demo/grph2/uspack/uspk12.rb +51 -0
  179. data/demo/grph2/uupack/uupk01.rb +50 -0
  180. data/demo/grph2/uupack/uupk02.rb +74 -0
  181. data/demo/grph2/uupack/uupk03.rb +56 -0
  182. data/demo/grph2/uupack/uupk04.rb +84 -0
  183. data/demo/grph2/uupack/uupk05.rb +74 -0
  184. data/demo/grph2/uupack/uupk06.rb +77 -0
  185. data/demo/grph2/uupack/uupk07.rb +88 -0
  186. data/demo/grph2/uxyzpk/uxyz01.rb +38 -0
  187. data/demo/grph2/uxyzpk/uxyz02.rb +36 -0
  188. data/demo/grph2/uxyzpk/uxyz03.rb +37 -0
  189. data/demo/grph2/uxyzpk/uxyz04.rb +54 -0
  190. data/demo/grph2/uxyzpk/uxyz05.rb +41 -0
  191. data/demo/grph2/uxyzpk/uxyz06.rb +42 -0
  192. data/demo/grph2/uxyzpk/uxyz07.rb +38 -0
  193. data/demo/grph2/uxyzpk/uxyz08.rb +60 -0
  194. data/demo/grph2/uxyzpk/uxyz09.rb +52 -0
  195. data/demo/grph2/uxyzpk/uxyz10.rb +57 -0
  196. data/demo/grph2/ximage/MEMO +23 -0
  197. data/demo/grph2/ximage/tomsclm.dat +1344 -0
  198. data/demo/grph2/ximage/ximg01.rb +145 -0
  199. data/demo/math1/gt2dlib/gt2d01.rb +33 -0
  200. data/demo/math2/fftlib/fftl01.rb +28 -0
  201. data/demo/math2/fftlib/fftl02.rb +224 -0
  202. data/demo/math2/intrlib/intr01.rb +22 -0
  203. data/demo/math2/rnmlib/rnml01.rb +21 -0
  204. data/demo/math2/vstlib/vstl01.rb +29 -0
  205. data/demo/math2/vstlib/vstl02.rb +38 -0
  206. data/demo/rakuraku/color/color1.rb +61 -0
  207. data/demo/rakuraku/color/color2.rb +57 -0
  208. data/demo/rakuraku/color/color3.rb +81 -0
  209. data/demo/rakuraku/kihon/kihon1.rb +39 -0
  210. data/demo/rakuraku/kihon/kihon2.rb +56 -0
  211. data/demo/rakuraku/kihon/kihon3.rb +57 -0
  212. data/demo/rakuraku/kihon/kihon4.rb +70 -0
  213. data/demo/rakuraku/kihon/kihon5.rb +56 -0
  214. data/demo/rakuraku/kihon/kihon6.rb +40 -0
  215. data/demo/rakuraku/kihon/kihon7.rb +98 -0
  216. data/demo/rakuraku/kihon/kihon8.rb +93 -0
  217. data/demo/rakuraku/kihon/kihon9.rb +77 -0
  218. data/demo/rakuraku/kihon/kihona.rb +123 -0
  219. data/demo/rakuraku/kihon/kihonb.rb +73 -0
  220. data/demo/rakuraku/kihon/kihonc.rb +110 -0
  221. data/demo/rakuraku/layout/lay1.rb +29 -0
  222. data/demo/rakuraku/layout/lay2.rb +28 -0
  223. data/demo/rakuraku/layout/lay3.rb +29 -0
  224. data/demo/rakuraku/map3d/map3d1.rb +68 -0
  225. data/demo/rakuraku/map3d/map3d2.rb +67 -0
  226. data/demo/rakuraku/map3d/map3d3.rb +66 -0
  227. data/demo/rakuraku/map3d/map3d4.rb +107 -0
  228. data/demo/rakuraku/map3d/map3d5.rb +118 -0
  229. data/demo/rakuraku/map3d/map3d6.rb +96 -0
  230. data/demo/rakuraku/map3d/map3d7.rb +98 -0
  231. data/demo/rakuraku/miss/miss1.rb +76 -0
  232. data/demo/rakuraku/miss/miss2.rb +60 -0
  233. data/demo/rakuraku/quick/quick1.rb +35 -0
  234. data/demo/rakuraku/quick/quick2.rb +33 -0
  235. data/demo/rakuraku/quick/quick3.rb +46 -0
  236. data/demo/rakuraku/quick/quick4.rb +47 -0
  237. data/demo/rakuraku/quick/quick5.rb +46 -0
  238. data/demo/rakuraku/u2d/u2d1.rb +50 -0
  239. data/demo/rakuraku/u2d/u2d2.rb +51 -0
  240. data/demo/rakuraku/u2d/u2d3.rb +70 -0
  241. data/demo/rakuraku/u2d/u2d4.rb +59 -0
  242. data/demo/rakuraku/u2d/u2d5.rb +61 -0
  243. data/demo/rakuraku/u2d/u2d6.rb +57 -0
  244. data/demo/rakuraku/u2d/u2d7.rb +103 -0
  245. data/demo/rakuraku/uspack/uspac1.rb +35 -0
  246. data/demo/rakuraku/uspack/uspac2.rb +66 -0
  247. data/demo/rakuraku/uspack/uspac3.rb +37 -0
  248. data/demo/rakuraku/uspack/uspac4.rb +49 -0
  249. data/demo/rakuraku/uxyz/uxyz1.rb +37 -0
  250. data/demo/rakuraku/uxyz/uxyz2.rb +35 -0
  251. data/demo/rakuraku/uxyz/uxyz3.rb +38 -0
  252. data/demo/rakuraku/uxyz/uxyz4.rb +36 -0
  253. data/demo/rakuraku/uxyz/uxyz5.rb +57 -0
  254. data/demo/rakuraku/uxyz/uxyz6.rb +43 -0
  255. data/demo/rakuraku/uxyz/uxyz7.rb +39 -0
  256. data/demo/rakuraku/uxyz/uxyz8.rb +56 -0
  257. data/demo/rubydcloriginal/uemrkz1.rb +37 -0
  258. data/dummy.c +9 -0
  259. data/extconf.rb +133 -0
  260. data/grph1_csgi.c +119 -0
  261. data/grph1_scpack.c +1388 -0
  262. data/grph1_sgpack.c +3876 -0
  263. data/grph1_slpack.c +432 -0
  264. data/grph1_stpack.c +1044 -0
  265. data/grph1_swpack.c +1922 -0
  266. data/grph1_zgpack.c.org +141 -0
  267. data/grph2_grpack.c +368 -0
  268. data/grph2_ucpack.c +1232 -0
  269. data/grph2_udpack.c +1404 -0
  270. data/grph2_uepack.c +1443 -0
  271. data/grph2_ugpack.c +1073 -0
  272. data/grph2_uhpack.c +943 -0
  273. data/grph2_ulpack.c +1304 -0
  274. data/grph2_umpack.c +1540 -0
  275. data/grph2_uspack.c +2481 -0
  276. data/grph2_uupack.c +1689 -0
  277. data/grph2_uvpack.c +943 -0
  278. data/grph2_uwpack.c +552 -0
  279. data/grph2_uxpack.c +555 -0
  280. data/grph2_uypack.c +555 -0
  281. data/grph2_uzpack.c +1455 -0
  282. data/init.c.default +187 -0
  283. data/init.c.gtk +189 -0
  284. data/lib/dcl.rb +5084 -0
  285. data/math1_blklib.c +227 -0
  286. data/math1_chrlib.c +239 -0
  287. data/math1_fnclib.c +254 -0
  288. data/math1_gnmlib.c +356 -0
  289. data/math1_gt2dlib.c +514 -0
  290. data/math1_ifalib.c +427 -0
  291. data/math1_indxlib.c +709 -0
  292. data/math1_intlib.c +167 -0
  293. data/math1_lrllib.c +817 -0
  294. data/math1_maplib.c +172 -0
  295. data/math1_oslib.c +111 -0
  296. data/math1_rfalib.c +1417 -0
  297. data/math1_rfblib.c +232 -0
  298. data/math1_sublib.c +221 -0
  299. data/math1_syslib.c +2025 -0
  300. data/math1_vialib.c +1156 -0
  301. data/math1_viblib.c +1027 -0
  302. data/math1_vralib.c +1156 -0
  303. data/math1_vrblib.c +1027 -0
  304. data/math1_xfclib.c +142 -0
  305. data/math2_fftlib.c +833 -0
  306. data/math2_intrlib.c +138 -0
  307. data/math2_rnmlib.c +226 -0
  308. data/math2_shtlib.c +1568 -0
  309. data/math2_vstlib.c +366 -0
  310. data/misc1_chnlib.c +179 -0
  311. data/misc1_datelib.c +953 -0
  312. data/misc1_fmtlib.c +99 -0
  313. data/misc1_misclib.c +118 -0
  314. data/misc1_randlib.c +142 -0
  315. data/misc1_timelib.c +380 -0
  316. data/obsolete/README +2 -0
  317. data/obsolete/dcl_ext.html +112 -0
  318. data/obsolete/dcl_ext.rb +313 -0
  319. metadata +433 -0
data/grph2_ugpack.c ADDED
@@ -0,0 +1,1073 @@
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_ugvect(obj, u, mu, v, mv, nx, ny)
66
+ VALUE obj, u, mu, v, mv, nx, ny;
67
+ {
68
+ real *i_u;
69
+ integer i_mu;
70
+ real *i_v;
71
+ integer i_mv;
72
+ integer i_nx;
73
+ integer i_ny;
74
+
75
+ if (TYPE(u) == T_FLOAT) {
76
+ u = rb_Array(u);
77
+ }
78
+ /* if ((TYPE(u) != T_ARRAY) &&
79
+ (rb_obj_is_kind_of(u, cNArray) != Qtrue)) {
80
+ rb_raise(rb_eTypeError, "invalid type");
81
+ } -- no check since obj2c*ary will do that */
82
+ if ((TYPE(mu) != T_BIGNUM) || (TYPE(mu) != T_FIXNUM)) {
83
+ mu = rb_funcall(mu, rb_intern("to_i"), 0);
84
+ }
85
+ if (TYPE(v) == T_FLOAT) {
86
+ v = rb_Array(v);
87
+ }
88
+ /* if ((TYPE(v) != T_ARRAY) &&
89
+ (rb_obj_is_kind_of(v, cNArray) != Qtrue)) {
90
+ rb_raise(rb_eTypeError, "invalid type");
91
+ } -- no check since obj2c*ary will do that */
92
+ if ((TYPE(mv) != T_BIGNUM) || (TYPE(mv) != T_FIXNUM)) {
93
+ mv = rb_funcall(mv, rb_intern("to_i"), 0);
94
+ }
95
+ if ((TYPE(nx) != T_BIGNUM) || (TYPE(nx) != T_FIXNUM)) {
96
+ nx = rb_funcall(nx, rb_intern("to_i"), 0);
97
+ }
98
+ if ((TYPE(ny) != T_BIGNUM) || (TYPE(ny) != T_FIXNUM)) {
99
+ ny = rb_funcall(ny, rb_intern("to_i"), 0);
100
+ }
101
+
102
+ i_mu = NUM2INT(mu);
103
+ i_mv = NUM2INT(mv);
104
+ i_nx = NUM2INT(nx);
105
+ i_ny = NUM2INT(ny);
106
+ i_u = dcl_obj2crealary(u);
107
+ i_v = dcl_obj2crealary(v);
108
+
109
+
110
+ ugvect_(i_u, &i_mu, i_v, &i_mv, &i_nx, &i_ny);
111
+
112
+ dcl_freecrealary(i_u);
113
+ dcl_freecrealary(i_v);
114
+
115
+ return Qnil;
116
+
117
+ }
118
+
119
+ static VALUE
120
+ dcl_ugsut(obj, cside, cttl)
121
+ VALUE obj, cside, cttl;
122
+ {
123
+ char *i_cside;
124
+ char *i_cttl;
125
+
126
+ if (TYPE(cside) != T_STRING) {
127
+ cside = rb_funcall(cside, rb_intern("to_str"), 0);
128
+ }
129
+ if (TYPE(cttl) != T_STRING) {
130
+ cttl = rb_funcall(cttl, rb_intern("to_str"), 0);
131
+ }
132
+
133
+ i_cside = StringValuePtr(cside);
134
+ i_cttl = StringValuePtr(cttl);
135
+
136
+
137
+ ugsut_(i_cside, i_cttl, (ftnlen)strlen(i_cside), (ftnlen)strlen(i_cttl));
138
+
139
+ return Qnil;
140
+
141
+ }
142
+
143
+ static VALUE
144
+ dcl_ugpqnp(obj)
145
+ VALUE obj;
146
+ {
147
+ integer o_ncp;
148
+ VALUE ncp;
149
+
150
+ ugpqnp_(&o_ncp);
151
+
152
+ ncp = INT2NUM(o_ncp);
153
+
154
+
155
+ return ncp;
156
+
157
+ }
158
+
159
+ static VALUE
160
+ dcl_ugpqid(obj, cp)
161
+ VALUE obj, cp;
162
+ {
163
+ char *i_cp;
164
+ integer o_idx;
165
+ VALUE idx;
166
+
167
+ if (TYPE(cp) != T_STRING) {
168
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
169
+ }
170
+
171
+ i_cp = StringValuePtr(cp);
172
+
173
+
174
+ ugpqid_(i_cp, &o_idx, (ftnlen)strlen(i_cp));
175
+
176
+ idx = INT2NUM(o_idx);
177
+
178
+
179
+ return idx;
180
+
181
+ }
182
+
183
+ static VALUE
184
+ dcl_ugpqcp(obj, idx)
185
+ VALUE obj, idx;
186
+ {
187
+ integer i_idx;
188
+ char *o_cp;
189
+ VALUE cp;
190
+
191
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
192
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
193
+ }
194
+
195
+ i_idx = NUM2INT(idx);
196
+
197
+ o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
198
+ memset(o_cp, '\0', DFLT_SIZE+1);
199
+
200
+ ugpqcp_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
201
+
202
+ cp = rb_str_new2(o_cp);
203
+
204
+
205
+ return cp;
206
+
207
+ }
208
+
209
+ static VALUE
210
+ dcl_ugpqcl(obj, idx)
211
+ VALUE obj, idx;
212
+ {
213
+ integer i_idx;
214
+ char *o_cp;
215
+ VALUE cp;
216
+
217
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
218
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
219
+ }
220
+
221
+ i_idx = NUM2INT(idx);
222
+
223
+ o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
224
+ memset(o_cp, '\0', DFLT_SIZE+1);
225
+
226
+ ugpqcl_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
227
+
228
+ cp = rb_str_new2(o_cp);
229
+
230
+
231
+ return cp;
232
+
233
+ }
234
+
235
+ static VALUE
236
+ dcl_ugpqit(obj, idx)
237
+ VALUE obj, idx;
238
+ {
239
+ integer i_idx;
240
+ integer o_itp;
241
+ VALUE itp;
242
+
243
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
244
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
245
+ }
246
+
247
+ i_idx = NUM2INT(idx);
248
+
249
+
250
+ ugpqit_(&i_idx, &o_itp);
251
+
252
+ itp = INT2NUM(o_itp);
253
+
254
+
255
+ return itp;
256
+
257
+ }
258
+
259
+ static VALUE
260
+ dcl_ugpqvl(obj, idx)
261
+ VALUE obj, idx;
262
+ {
263
+ integer i_idx;
264
+ integer o_ipara;
265
+ VALUE ipara;
266
+
267
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
268
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
269
+ }
270
+
271
+ i_idx = NUM2INT(idx);
272
+
273
+
274
+ ugpqvl_(&i_idx, &o_ipara);
275
+
276
+ ipara = INT2NUM(o_ipara);
277
+
278
+
279
+ return ipara;
280
+
281
+ }
282
+
283
+ static VALUE
284
+ dcl_ugpsvl(obj, idx, ipara)
285
+ VALUE obj, idx, ipara;
286
+ {
287
+ integer i_idx;
288
+ integer i_ipara;
289
+
290
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
291
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
292
+ }
293
+ if ((TYPE(ipara) != T_BIGNUM) || (TYPE(ipara) != T_FIXNUM)) {
294
+ ipara = rb_funcall(ipara, rb_intern("to_i"), 0);
295
+ }
296
+
297
+ i_idx = NUM2INT(idx);
298
+ i_ipara = NUM2INT(ipara);
299
+
300
+
301
+ ugpsvl_(&i_idx, &i_ipara);
302
+
303
+ return Qnil;
304
+
305
+ }
306
+
307
+ static VALUE
308
+ dcl_ugpqin(obj, cp)
309
+ VALUE obj, cp;
310
+ {
311
+ char *i_cp;
312
+ integer o_in;
313
+ VALUE in;
314
+
315
+ if (TYPE(cp) != T_STRING) {
316
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
317
+ }
318
+
319
+ i_cp = StringValuePtr(cp);
320
+
321
+
322
+ ugpqin_(i_cp, &o_in, (ftnlen)strlen(i_cp));
323
+
324
+ in = INT2NUM(o_in);
325
+
326
+
327
+ return in;
328
+
329
+ }
330
+
331
+ static VALUE
332
+ dcl_ugiget(obj, cp)
333
+ VALUE obj, cp;
334
+ {
335
+ char *i_cp;
336
+ integer o_ipara;
337
+ VALUE ipara;
338
+
339
+ if (TYPE(cp) != T_STRING) {
340
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
341
+ }
342
+
343
+ i_cp = StringValuePtr(cp);
344
+
345
+
346
+ ugiget_(i_cp, &o_ipara, (ftnlen)strlen(i_cp));
347
+
348
+ ipara = INT2NUM(o_ipara);
349
+
350
+
351
+ return ipara;
352
+
353
+ }
354
+
355
+ static VALUE
356
+ dcl_ugiset(obj, cp, ipara)
357
+ VALUE obj, cp, ipara;
358
+ {
359
+ char *i_cp;
360
+ integer i_ipara;
361
+
362
+ if (TYPE(cp) != T_STRING) {
363
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
364
+ }
365
+ if ((TYPE(ipara) != T_BIGNUM) || (TYPE(ipara) != T_FIXNUM)) {
366
+ ipara = rb_funcall(ipara, rb_intern("to_i"), 0);
367
+ }
368
+
369
+ i_cp = StringValuePtr(cp);
370
+ i_ipara = NUM2INT(ipara);
371
+
372
+
373
+ ugiset_(i_cp, &i_ipara, (ftnlen)strlen(i_cp));
374
+
375
+ return Qnil;
376
+
377
+ }
378
+
379
+ static VALUE
380
+ dcl_ugistx(obj, cp, ipara)
381
+ VALUE obj, cp, ipara;
382
+ {
383
+ char *i_cp;
384
+ integer i_ipara;
385
+
386
+ if (TYPE(cp) != T_STRING) {
387
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
388
+ }
389
+ if ((TYPE(ipara) != T_BIGNUM) || (TYPE(ipara) != T_FIXNUM)) {
390
+ ipara = rb_funcall(ipara, rb_intern("to_i"), 0);
391
+ }
392
+
393
+ i_cp = StringValuePtr(cp);
394
+ i_ipara = NUM2INT(ipara);
395
+
396
+
397
+ ugistx_(i_cp, &i_ipara, (ftnlen)strlen(i_cp));
398
+
399
+ return Qnil;
400
+
401
+ }
402
+
403
+ static VALUE
404
+ dcl_ugiqnp(obj)
405
+ VALUE obj;
406
+ {
407
+ integer o_ncp;
408
+ VALUE ncp;
409
+
410
+ ugiqnp_(&o_ncp);
411
+
412
+ ncp = INT2NUM(o_ncp);
413
+
414
+
415
+ return ncp;
416
+
417
+ }
418
+
419
+ static VALUE
420
+ dcl_ugiqid(obj, cp)
421
+ VALUE obj, cp;
422
+ {
423
+ char *i_cp;
424
+ integer o_idx;
425
+ VALUE idx;
426
+
427
+ if (TYPE(cp) != T_STRING) {
428
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
429
+ }
430
+
431
+ i_cp = StringValuePtr(cp);
432
+
433
+
434
+ ugiqid_(i_cp, &o_idx, (ftnlen)strlen(i_cp));
435
+
436
+ idx = INT2NUM(o_idx);
437
+
438
+
439
+ return idx;
440
+
441
+ }
442
+
443
+ static VALUE
444
+ dcl_ugiqcp(obj, idx)
445
+ VALUE obj, idx;
446
+ {
447
+ integer i_idx;
448
+ char *o_cp;
449
+ VALUE cp;
450
+
451
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
452
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
453
+ }
454
+
455
+ i_idx = NUM2INT(idx);
456
+
457
+ o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
458
+ memset(o_cp, '\0', DFLT_SIZE+1);
459
+
460
+ ugiqcp_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
461
+
462
+ cp = rb_str_new2(o_cp);
463
+
464
+
465
+ return cp;
466
+
467
+ }
468
+
469
+ static VALUE
470
+ dcl_ugiqcl(obj, idx)
471
+ VALUE obj, idx;
472
+ {
473
+ integer i_idx;
474
+ char *o_cp;
475
+ VALUE cp;
476
+
477
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
478
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
479
+ }
480
+
481
+ i_idx = NUM2INT(idx);
482
+
483
+ o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
484
+ memset(o_cp, '\0', DFLT_SIZE+1);
485
+
486
+ ugiqcl_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
487
+
488
+ cp = rb_str_new2(o_cp);
489
+
490
+
491
+ return cp;
492
+
493
+ }
494
+
495
+ static VALUE
496
+ dcl_ugiqvl(obj, idx)
497
+ VALUE obj, idx;
498
+ {
499
+ integer i_idx;
500
+ integer o_ipara;
501
+ VALUE ipara;
502
+
503
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
504
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
505
+ }
506
+
507
+ i_idx = NUM2INT(idx);
508
+
509
+
510
+ ugiqvl_(&i_idx, &o_ipara);
511
+
512
+ ipara = INT2NUM(o_ipara);
513
+
514
+
515
+ return ipara;
516
+
517
+ }
518
+
519
+ static VALUE
520
+ dcl_ugisvl(obj, idx, ipara)
521
+ VALUE obj, idx, ipara;
522
+ {
523
+ integer i_idx;
524
+ integer i_ipara;
525
+
526
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
527
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
528
+ }
529
+ if ((TYPE(ipara) != T_BIGNUM) || (TYPE(ipara) != T_FIXNUM)) {
530
+ ipara = rb_funcall(ipara, rb_intern("to_i"), 0);
531
+ }
532
+
533
+ i_idx = NUM2INT(idx);
534
+ i_ipara = NUM2INT(ipara);
535
+
536
+
537
+ ugisvl_(&i_idx, &i_ipara);
538
+
539
+ return Qnil;
540
+
541
+ }
542
+
543
+ static VALUE
544
+ dcl_ugiqin(obj, cp)
545
+ VALUE obj, cp;
546
+ {
547
+ char *i_cp;
548
+ integer o_in;
549
+ VALUE in;
550
+
551
+ if (TYPE(cp) != T_STRING) {
552
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
553
+ }
554
+
555
+ i_cp = StringValuePtr(cp);
556
+
557
+
558
+ ugiqin_(i_cp, &o_in, (ftnlen)strlen(i_cp));
559
+
560
+ in = INT2NUM(o_in);
561
+
562
+
563
+ return in;
564
+
565
+ }
566
+
567
+ static VALUE
568
+ dcl_uglget(obj, cp)
569
+ VALUE obj, cp;
570
+ {
571
+ char *i_cp;
572
+ logical o_lpara;
573
+ VALUE lpara;
574
+
575
+ if (TYPE(cp) != T_STRING) {
576
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
577
+ }
578
+
579
+ i_cp = StringValuePtr(cp);
580
+
581
+
582
+ uglget_(i_cp, &o_lpara, (ftnlen)strlen(i_cp));
583
+
584
+ lpara = (o_lpara == FALSE_) ? Qfalse : Qtrue;
585
+
586
+
587
+ return lpara;
588
+
589
+ }
590
+
591
+ static VALUE
592
+ dcl_uglset(obj, cp, lpara)
593
+ VALUE obj, cp, lpara;
594
+ {
595
+ char *i_cp;
596
+ logical i_lpara;
597
+
598
+ if (TYPE(cp) != T_STRING) {
599
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
600
+ }
601
+
602
+ i_cp = StringValuePtr(cp);
603
+ i_lpara = ((lpara == Qnil)||(lpara == Qfalse)) ? FALSE_ : TRUE_;
604
+
605
+
606
+ uglset_(i_cp, &i_lpara, (ftnlen)strlen(i_cp));
607
+
608
+ return Qnil;
609
+
610
+ }
611
+
612
+ static VALUE
613
+ dcl_uglstx(obj, cp, lpara)
614
+ VALUE obj, cp, lpara;
615
+ {
616
+ char *i_cp;
617
+ logical i_lpara;
618
+
619
+ if (TYPE(cp) != T_STRING) {
620
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
621
+ }
622
+
623
+ i_cp = StringValuePtr(cp);
624
+ i_lpara = ((lpara == Qnil)||(lpara == Qfalse)) ? FALSE_ : TRUE_;
625
+
626
+
627
+ uglstx_(i_cp, &i_lpara, (ftnlen)strlen(i_cp));
628
+
629
+ return Qnil;
630
+
631
+ }
632
+
633
+ static VALUE
634
+ dcl_uglqnp(obj)
635
+ VALUE obj;
636
+ {
637
+ integer o_ncp;
638
+ VALUE ncp;
639
+
640
+ uglqnp_(&o_ncp);
641
+
642
+ ncp = INT2NUM(o_ncp);
643
+
644
+
645
+ return ncp;
646
+
647
+ }
648
+
649
+ static VALUE
650
+ dcl_uglqid(obj, cp)
651
+ VALUE obj, cp;
652
+ {
653
+ char *i_cp;
654
+ integer o_idx;
655
+ VALUE idx;
656
+
657
+ if (TYPE(cp) != T_STRING) {
658
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
659
+ }
660
+
661
+ i_cp = StringValuePtr(cp);
662
+
663
+
664
+ uglqid_(i_cp, &o_idx, (ftnlen)strlen(i_cp));
665
+
666
+ idx = INT2NUM(o_idx);
667
+
668
+
669
+ return idx;
670
+
671
+ }
672
+
673
+ static VALUE
674
+ dcl_uglqcp(obj, idx)
675
+ VALUE obj, idx;
676
+ {
677
+ integer i_idx;
678
+ char *o_cp;
679
+ VALUE cp;
680
+
681
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
682
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
683
+ }
684
+
685
+ i_idx = NUM2INT(idx);
686
+
687
+ o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
688
+ memset(o_cp, '\0', DFLT_SIZE+1);
689
+
690
+ uglqcp_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
691
+
692
+ cp = rb_str_new2(o_cp);
693
+
694
+
695
+ return cp;
696
+
697
+ }
698
+
699
+ static VALUE
700
+ dcl_uglqcl(obj, idx)
701
+ VALUE obj, idx;
702
+ {
703
+ integer i_idx;
704
+ char *o_cp;
705
+ VALUE cp;
706
+
707
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
708
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
709
+ }
710
+
711
+ i_idx = NUM2INT(idx);
712
+
713
+ o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
714
+ memset(o_cp, '\0', DFLT_SIZE+1);
715
+
716
+ uglqcl_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
717
+
718
+ cp = rb_str_new2(o_cp);
719
+
720
+
721
+ return cp;
722
+
723
+ }
724
+
725
+ static VALUE
726
+ dcl_uglqvl(obj, idx)
727
+ VALUE obj, idx;
728
+ {
729
+ integer i_idx;
730
+ logical o_lpara;
731
+ VALUE lpara;
732
+
733
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
734
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
735
+ }
736
+
737
+ i_idx = NUM2INT(idx);
738
+
739
+
740
+ uglqvl_(&i_idx, &o_lpara);
741
+
742
+ lpara = (o_lpara == FALSE_) ? Qfalse : Qtrue;
743
+
744
+
745
+ return lpara;
746
+
747
+ }
748
+
749
+ static VALUE
750
+ dcl_uglsvl(obj, idx, lpara)
751
+ VALUE obj, idx, lpara;
752
+ {
753
+ integer i_idx;
754
+ logical i_lpara;
755
+
756
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
757
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
758
+ }
759
+
760
+ i_idx = NUM2INT(idx);
761
+ i_lpara = ((lpara == Qnil)||(lpara == Qfalse)) ? FALSE_ : TRUE_;
762
+
763
+
764
+ uglsvl_(&i_idx, &i_lpara);
765
+
766
+ return Qnil;
767
+
768
+ }
769
+
770
+ static VALUE
771
+ dcl_uglqin(obj, cp)
772
+ VALUE obj, cp;
773
+ {
774
+ char *i_cp;
775
+ integer o_in;
776
+ VALUE in;
777
+
778
+ if (TYPE(cp) != T_STRING) {
779
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
780
+ }
781
+
782
+ i_cp = StringValuePtr(cp);
783
+
784
+
785
+ uglqin_(i_cp, &o_in, (ftnlen)strlen(i_cp));
786
+
787
+ in = INT2NUM(o_in);
788
+
789
+
790
+ return in;
791
+
792
+ }
793
+
794
+ static VALUE
795
+ dcl_ugrget(obj, cp)
796
+ VALUE obj, cp;
797
+ {
798
+ char *i_cp;
799
+ real o_rpara;
800
+ VALUE rpara;
801
+
802
+ if (TYPE(cp) != T_STRING) {
803
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
804
+ }
805
+
806
+ i_cp = StringValuePtr(cp);
807
+
808
+
809
+ ugrget_(i_cp, &o_rpara, (ftnlen)strlen(i_cp));
810
+
811
+ rpara = rb_float_new((double)o_rpara);
812
+
813
+
814
+ return rpara;
815
+
816
+ }
817
+
818
+ static VALUE
819
+ dcl_ugrset(obj, cp, rpara)
820
+ VALUE obj, cp, rpara;
821
+ {
822
+ char *i_cp;
823
+ real i_rpara;
824
+
825
+ if (TYPE(cp) != T_STRING) {
826
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
827
+ }
828
+ if (TYPE(rpara) != T_FLOAT) {
829
+ rpara = rb_funcall(rpara, rb_intern("to_f"), 0);
830
+ }
831
+
832
+ i_cp = StringValuePtr(cp);
833
+ i_rpara = (real)NUM2DBL(rpara);
834
+
835
+
836
+ ugrset_(i_cp, &i_rpara, (ftnlen)strlen(i_cp));
837
+
838
+ return Qnil;
839
+
840
+ }
841
+
842
+ static VALUE
843
+ dcl_ugrstx(obj, cp, rpara)
844
+ VALUE obj, cp, rpara;
845
+ {
846
+ char *i_cp;
847
+ real i_rpara;
848
+
849
+ if (TYPE(cp) != T_STRING) {
850
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
851
+ }
852
+ if (TYPE(rpara) != T_FLOAT) {
853
+ rpara = rb_funcall(rpara, rb_intern("to_f"), 0);
854
+ }
855
+
856
+ i_cp = StringValuePtr(cp);
857
+ i_rpara = (real)NUM2DBL(rpara);
858
+
859
+
860
+ ugrstx_(i_cp, &i_rpara, (ftnlen)strlen(i_cp));
861
+
862
+ return Qnil;
863
+
864
+ }
865
+
866
+ static VALUE
867
+ dcl_ugrqnp(obj)
868
+ VALUE obj;
869
+ {
870
+ integer o_ncp;
871
+ VALUE ncp;
872
+
873
+ ugrqnp_(&o_ncp);
874
+
875
+ ncp = INT2NUM(o_ncp);
876
+
877
+
878
+ return ncp;
879
+
880
+ }
881
+
882
+ static VALUE
883
+ dcl_ugrqid(obj, cp)
884
+ VALUE obj, cp;
885
+ {
886
+ char *i_cp;
887
+ integer o_idx;
888
+ VALUE idx;
889
+
890
+ if (TYPE(cp) != T_STRING) {
891
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
892
+ }
893
+
894
+ i_cp = StringValuePtr(cp);
895
+
896
+
897
+ ugrqid_(i_cp, &o_idx, (ftnlen)strlen(i_cp));
898
+
899
+ idx = INT2NUM(o_idx);
900
+
901
+
902
+ return idx;
903
+
904
+ }
905
+
906
+ static VALUE
907
+ dcl_ugrqcp(obj, idx)
908
+ VALUE obj, idx;
909
+ {
910
+ integer i_idx;
911
+ char *o_cp;
912
+ VALUE cp;
913
+
914
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
915
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
916
+ }
917
+
918
+ i_idx = NUM2INT(idx);
919
+
920
+ o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
921
+ memset(o_cp, '\0', DFLT_SIZE+1);
922
+
923
+ ugrqcp_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
924
+
925
+ cp = rb_str_new2(o_cp);
926
+
927
+
928
+ return cp;
929
+
930
+ }
931
+
932
+ static VALUE
933
+ dcl_ugrqcl(obj, idx)
934
+ VALUE obj, idx;
935
+ {
936
+ integer i_idx;
937
+ char *o_cp;
938
+ VALUE cp;
939
+
940
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
941
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
942
+ }
943
+
944
+ i_idx = NUM2INT(idx);
945
+
946
+ o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
947
+ memset(o_cp, '\0', DFLT_SIZE+1);
948
+
949
+ ugrqcl_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
950
+
951
+ cp = rb_str_new2(o_cp);
952
+
953
+
954
+ return cp;
955
+
956
+ }
957
+
958
+ static VALUE
959
+ dcl_ugrqvl(obj, idx)
960
+ VALUE obj, idx;
961
+ {
962
+ integer i_idx;
963
+ real o_rpara;
964
+ VALUE rpara;
965
+
966
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
967
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
968
+ }
969
+
970
+ i_idx = NUM2INT(idx);
971
+
972
+
973
+ ugrqvl_(&i_idx, &o_rpara);
974
+
975
+ rpara = rb_float_new((double)o_rpara);
976
+
977
+
978
+ return rpara;
979
+
980
+ }
981
+
982
+ static VALUE
983
+ dcl_ugrsvl(obj, idx, rpara)
984
+ VALUE obj, idx, rpara;
985
+ {
986
+ integer i_idx;
987
+ real i_rpara;
988
+
989
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
990
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
991
+ }
992
+ if (TYPE(rpara) != T_FLOAT) {
993
+ rpara = rb_funcall(rpara, rb_intern("to_f"), 0);
994
+ }
995
+
996
+ i_idx = NUM2INT(idx);
997
+ i_rpara = (real)NUM2DBL(rpara);
998
+
999
+
1000
+ ugrsvl_(&i_idx, &i_rpara);
1001
+
1002
+ return Qnil;
1003
+
1004
+ }
1005
+
1006
+ static VALUE
1007
+ dcl_ugrqin(obj, cp)
1008
+ VALUE obj, cp;
1009
+ {
1010
+ char *i_cp;
1011
+ integer o_in;
1012
+ VALUE in;
1013
+
1014
+ if (TYPE(cp) != T_STRING) {
1015
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1016
+ }
1017
+
1018
+ i_cp = StringValuePtr(cp);
1019
+
1020
+
1021
+ ugrqin_(i_cp, &o_in, (ftnlen)strlen(i_cp));
1022
+
1023
+ in = INT2NUM(o_in);
1024
+
1025
+
1026
+ return in;
1027
+
1028
+ }
1029
+ void
1030
+ init_grph2_ugpack(mDCL)
1031
+ VALUE mDCL;
1032
+ {
1033
+ rb_define_module_function(mDCL, "ugvect", dcl_ugvect, 6);
1034
+ rb_define_module_function(mDCL, "ugsut", dcl_ugsut, 2);
1035
+ rb_define_module_function(mDCL, "ugpqnp", dcl_ugpqnp, 0);
1036
+ rb_define_module_function(mDCL, "ugpqid", dcl_ugpqid, 1);
1037
+ rb_define_module_function(mDCL, "ugpqcp", dcl_ugpqcp, 1);
1038
+ rb_define_module_function(mDCL, "ugpqcl", dcl_ugpqcl, 1);
1039
+ rb_define_module_function(mDCL, "ugpqit", dcl_ugpqit, 1);
1040
+ rb_define_module_function(mDCL, "ugpqvl", dcl_ugpqvl, 1);
1041
+ rb_define_module_function(mDCL, "ugpsvl", dcl_ugpsvl, 2);
1042
+ rb_define_module_function(mDCL, "ugpqin", dcl_ugpqin, 1);
1043
+ rb_define_module_function(mDCL, "ugiget", dcl_ugiget, 1);
1044
+ rb_define_module_function(mDCL, "ugiset", dcl_ugiset, 2);
1045
+ rb_define_module_function(mDCL, "ugistx", dcl_ugistx, 2);
1046
+ rb_define_module_function(mDCL, "ugiqnp", dcl_ugiqnp, 0);
1047
+ rb_define_module_function(mDCL, "ugiqid", dcl_ugiqid, 1);
1048
+ rb_define_module_function(mDCL, "ugiqcp", dcl_ugiqcp, 1);
1049
+ rb_define_module_function(mDCL, "ugiqcl", dcl_ugiqcl, 1);
1050
+ rb_define_module_function(mDCL, "ugiqvl", dcl_ugiqvl, 1);
1051
+ rb_define_module_function(mDCL, "ugisvl", dcl_ugisvl, 2);
1052
+ rb_define_module_function(mDCL, "ugiqin", dcl_ugiqin, 1);
1053
+ rb_define_module_function(mDCL, "uglget", dcl_uglget, 1);
1054
+ rb_define_module_function(mDCL, "uglset", dcl_uglset, 2);
1055
+ rb_define_module_function(mDCL, "uglstx", dcl_uglstx, 2);
1056
+ rb_define_module_function(mDCL, "uglqnp", dcl_uglqnp, 0);
1057
+ rb_define_module_function(mDCL, "uglqid", dcl_uglqid, 1);
1058
+ rb_define_module_function(mDCL, "uglqcp", dcl_uglqcp, 1);
1059
+ rb_define_module_function(mDCL, "uglqcl", dcl_uglqcl, 1);
1060
+ rb_define_module_function(mDCL, "uglqvl", dcl_uglqvl, 1);
1061
+ rb_define_module_function(mDCL, "uglsvl", dcl_uglsvl, 2);
1062
+ rb_define_module_function(mDCL, "uglqin", dcl_uglqin, 1);
1063
+ rb_define_module_function(mDCL, "ugrget", dcl_ugrget, 1);
1064
+ rb_define_module_function(mDCL, "ugrset", dcl_ugrset, 2);
1065
+ rb_define_module_function(mDCL, "ugrstx", dcl_ugrstx, 2);
1066
+ rb_define_module_function(mDCL, "ugrqnp", dcl_ugrqnp, 0);
1067
+ rb_define_module_function(mDCL, "ugrqid", dcl_ugrqid, 1);
1068
+ rb_define_module_function(mDCL, "ugrqcp", dcl_ugrqcp, 1);
1069
+ rb_define_module_function(mDCL, "ugrqcl", dcl_ugrqcl, 1);
1070
+ rb_define_module_function(mDCL, "ugrqvl", dcl_ugrqvl, 1);
1071
+ rb_define_module_function(mDCL, "ugrsvl", dcl_ugrsvl, 2);
1072
+ rb_define_module_function(mDCL, "ugrqin", dcl_ugrqin, 1);
1073
+ }