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_udpack.c ADDED
@@ -0,0 +1,1404 @@
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_udcntr(obj, z, mx, nx, ny)
66
+ VALUE obj, z, mx, nx, ny;
67
+ {
68
+ real *i_z;
69
+ integer i_mx;
70
+ integer i_nx;
71
+ integer i_ny;
72
+
73
+ if (TYPE(z) == T_FLOAT) {
74
+ z = rb_Array(z);
75
+ }
76
+ /* if ((TYPE(z) != T_ARRAY) &&
77
+ (rb_obj_is_kind_of(z, cNArray) != Qtrue)) {
78
+ rb_raise(rb_eTypeError, "invalid type");
79
+ } -- no check since obj2c*ary will do that */
80
+ if ((TYPE(mx) != T_BIGNUM) || (TYPE(mx) != T_FIXNUM)) {
81
+ mx = rb_funcall(mx, rb_intern("to_i"), 0);
82
+ }
83
+ if ((TYPE(nx) != T_BIGNUM) || (TYPE(nx) != T_FIXNUM)) {
84
+ nx = rb_funcall(nx, rb_intern("to_i"), 0);
85
+ }
86
+ if ((TYPE(ny) != T_BIGNUM) || (TYPE(ny) != T_FIXNUM)) {
87
+ ny = rb_funcall(ny, rb_intern("to_i"), 0);
88
+ }
89
+
90
+ i_mx = NUM2INT(mx);
91
+ i_nx = NUM2INT(nx);
92
+ i_ny = NUM2INT(ny);
93
+ i_z = dcl_obj2crealary(z);
94
+
95
+
96
+ udcntr_(i_z, &i_mx, &i_nx, &i_ny);
97
+
98
+ dcl_freecrealary(i_z);
99
+
100
+ return Qnil;
101
+
102
+ }
103
+
104
+ static VALUE
105
+ dcl_udcntz(obj, z, mx, nx, ny, nbr2)
106
+ VALUE obj, z, mx, nx, ny, nbr2;
107
+ {
108
+ real *i_z;
109
+ integer i_mx;
110
+ integer i_nx;
111
+ integer i_ny;
112
+ integer *w_ibr;
113
+ integer i_nbr2;
114
+
115
+ if (TYPE(z) == T_FLOAT) {
116
+ z = rb_Array(z);
117
+ }
118
+ /* if ((TYPE(z) != T_ARRAY) &&
119
+ (rb_obj_is_kind_of(z, cNArray) != Qtrue)) {
120
+ rb_raise(rb_eTypeError, "invalid type");
121
+ } -- no check since obj2c*ary will do that */
122
+ if ((TYPE(mx) != T_BIGNUM) || (TYPE(mx) != T_FIXNUM)) {
123
+ mx = rb_funcall(mx, rb_intern("to_i"), 0);
124
+ }
125
+ if ((TYPE(nx) != T_BIGNUM) || (TYPE(nx) != T_FIXNUM)) {
126
+ nx = rb_funcall(nx, rb_intern("to_i"), 0);
127
+ }
128
+ if ((TYPE(ny) != T_BIGNUM) || (TYPE(ny) != T_FIXNUM)) {
129
+ ny = rb_funcall(ny, rb_intern("to_i"), 0);
130
+ }
131
+ if ((TYPE(nbr2) != T_BIGNUM) || (TYPE(nbr2) != T_FIXNUM)) {
132
+ nbr2 = rb_funcall(nbr2, rb_intern("to_i"), 0);
133
+ }
134
+
135
+ i_mx = NUM2INT(mx);
136
+ i_nx = NUM2INT(nx);
137
+ i_ny = NUM2INT(ny);
138
+ i_nbr2 = NUM2INT(nbr2);
139
+ i_z = dcl_obj2crealary(z);
140
+
141
+ w_ibr= ALLOCA_N(integer, (i_nbr2));
142
+
143
+ udcntz_(i_z, &i_mx, &i_nx, &i_ny, w_ibr, &i_nbr2);
144
+
145
+ dcl_freecrealary(i_z);
146
+
147
+ return Qnil;
148
+
149
+ }
150
+
151
+ static VALUE
152
+ dcl_udgcla(obj, xmin, xmax, dx)
153
+ VALUE obj, xmin, xmax, dx;
154
+ {
155
+ real i_xmin;
156
+ real i_xmax;
157
+ real i_dx;
158
+
159
+ if (TYPE(xmin) != T_FLOAT) {
160
+ xmin = rb_funcall(xmin, rb_intern("to_f"), 0);
161
+ }
162
+ if (TYPE(xmax) != T_FLOAT) {
163
+ xmax = rb_funcall(xmax, rb_intern("to_f"), 0);
164
+ }
165
+ if (TYPE(dx) != T_FLOAT) {
166
+ dx = rb_funcall(dx, rb_intern("to_f"), 0);
167
+ }
168
+
169
+ i_xmin = (real)NUM2DBL(xmin);
170
+ i_xmax = (real)NUM2DBL(xmax);
171
+ i_dx = (real)NUM2DBL(dx);
172
+
173
+
174
+ udgcla_(&i_xmin, &i_xmax, &i_dx);
175
+
176
+ return Qnil;
177
+
178
+ }
179
+
180
+ static VALUE
181
+ dcl_udgclb(obj, z, mx, nx, ny, dx)
182
+ VALUE obj, z, mx, nx, ny, dx;
183
+ {
184
+ real *i_z;
185
+ integer i_mx;
186
+ integer i_nx;
187
+ integer i_ny;
188
+ real i_dx;
189
+
190
+ if (TYPE(z) == T_FLOAT) {
191
+ z = rb_Array(z);
192
+ }
193
+ /* if ((TYPE(z) != T_ARRAY) &&
194
+ (rb_obj_is_kind_of(z, cNArray) != Qtrue)) {
195
+ rb_raise(rb_eTypeError, "invalid type");
196
+ } -- no check since obj2c*ary will do that */
197
+ if ((TYPE(mx) != T_BIGNUM) || (TYPE(mx) != T_FIXNUM)) {
198
+ mx = rb_funcall(mx, rb_intern("to_i"), 0);
199
+ }
200
+ if ((TYPE(nx) != T_BIGNUM) || (TYPE(nx) != T_FIXNUM)) {
201
+ nx = rb_funcall(nx, rb_intern("to_i"), 0);
202
+ }
203
+ if ((TYPE(ny) != T_BIGNUM) || (TYPE(ny) != T_FIXNUM)) {
204
+ ny = rb_funcall(ny, rb_intern("to_i"), 0);
205
+ }
206
+ if (TYPE(dx) != T_FLOAT) {
207
+ dx = rb_funcall(dx, rb_intern("to_f"), 0);
208
+ }
209
+
210
+ i_mx = NUM2INT(mx);
211
+ i_nx = NUM2INT(nx);
212
+ i_ny = NUM2INT(ny);
213
+ i_dx = (real)NUM2DBL(dx);
214
+ i_z = dcl_obj2crealary(z);
215
+
216
+
217
+ udgclb_(i_z, &i_mx, &i_nx, &i_ny, &i_dx);
218
+
219
+ dcl_freecrealary(i_z);
220
+
221
+ return Qnil;
222
+
223
+ }
224
+
225
+ static VALUE
226
+ dcl_udiclv(obj)
227
+ VALUE obj;
228
+ {
229
+ udiclv_();
230
+
231
+ return Qnil;
232
+
233
+ }
234
+
235
+ static VALUE
236
+ dcl_udsclv(obj, zlev, indx, ityp, clv, hl)
237
+ VALUE obj, zlev, indx, ityp, clv, hl;
238
+ {
239
+ real i_zlev;
240
+ integer i_indx;
241
+ integer i_ityp;
242
+ char *i_clv;
243
+ real i_hl;
244
+
245
+ if (TYPE(zlev) != T_FLOAT) {
246
+ zlev = rb_funcall(zlev, rb_intern("to_f"), 0);
247
+ }
248
+ if ((TYPE(indx) != T_BIGNUM) || (TYPE(indx) != T_FIXNUM)) {
249
+ indx = rb_funcall(indx, rb_intern("to_i"), 0);
250
+ }
251
+ if ((TYPE(ityp) != T_BIGNUM) || (TYPE(ityp) != T_FIXNUM)) {
252
+ ityp = rb_funcall(ityp, rb_intern("to_i"), 0);
253
+ }
254
+ if (TYPE(clv) != T_STRING) {
255
+ clv = rb_funcall(clv, rb_intern("to_str"), 0);
256
+ }
257
+ if (TYPE(hl) != T_FLOAT) {
258
+ hl = rb_funcall(hl, rb_intern("to_f"), 0);
259
+ }
260
+
261
+ i_zlev = (real)NUM2DBL(zlev);
262
+ i_indx = NUM2INT(indx);
263
+ i_ityp = NUM2INT(ityp);
264
+ i_clv = StringValuePtr(clv);
265
+ i_hl = (real)NUM2DBL(hl);
266
+
267
+
268
+ udsclv_(&i_zlev, &i_indx, &i_ityp, i_clv, &i_hl, (ftnlen)strlen(i_clv));
269
+
270
+ return Qnil;
271
+
272
+ }
273
+
274
+ static VALUE
275
+ dcl_udqclv(obj, nlev)
276
+ VALUE obj, nlev;
277
+ {
278
+ real o_zlev;
279
+ integer o_indx;
280
+ integer o_ityp;
281
+ char *o_clv;
282
+ real o_hl;
283
+ integer i_nlev;
284
+ VALUE zlev;
285
+ VALUE indx;
286
+ VALUE ityp;
287
+ VALUE clv;
288
+ VALUE hl;
289
+
290
+ if ((TYPE(nlev) != T_BIGNUM) || (TYPE(nlev) != T_FIXNUM)) {
291
+ nlev = rb_funcall(nlev, rb_intern("to_i"), 0);
292
+ }
293
+
294
+ i_nlev = NUM2INT(nlev);
295
+
296
+ o_clv= ALLOCA_N(char, (DFLT_SIZE+1));
297
+ memset(o_clv, '\0', DFLT_SIZE+1);
298
+
299
+ udqclv_(&o_zlev, &o_indx, &o_ityp, o_clv, &o_hl, &i_nlev, (ftnlen)DFLT_SIZE);
300
+
301
+ zlev = rb_float_new((double)o_zlev);
302
+ indx = INT2NUM(o_indx);
303
+ ityp = INT2NUM(o_ityp);
304
+ clv = rb_str_new2(o_clv);
305
+ hl = rb_float_new((double)o_hl);
306
+
307
+
308
+ return rb_ary_new3(5, zlev, indx, ityp, clv, hl);
309
+
310
+ }
311
+
312
+ static VALUE
313
+ dcl_udqcln(obj)
314
+ VALUE obj;
315
+ {
316
+ integer o_nlev;
317
+ VALUE nlev;
318
+
319
+ udqcln_(&o_nlev);
320
+
321
+ nlev = INT2NUM(o_nlev);
322
+
323
+
324
+ return nlev;
325
+
326
+ }
327
+
328
+ static VALUE
329
+ dcl_uddclv(obj, zlev)
330
+ VALUE obj, zlev;
331
+ {
332
+ real i_zlev;
333
+
334
+ if (TYPE(zlev) != T_FLOAT) {
335
+ zlev = rb_funcall(zlev, rb_intern("to_f"), 0);
336
+ }
337
+
338
+ i_zlev = (real)NUM2DBL(zlev);
339
+
340
+
341
+ uddclv_(&i_zlev);
342
+
343
+ return Qnil;
344
+
345
+ }
346
+
347
+ static VALUE
348
+ dcl_rudlev(obj, nlev)
349
+ VALUE obj, nlev;
350
+ {
351
+ integer i_nlev;
352
+ real o_rtn_val;
353
+ VALUE rtn_val;
354
+
355
+ if ((TYPE(nlev) != T_BIGNUM) || (TYPE(nlev) != T_FIXNUM)) {
356
+ nlev = rb_funcall(nlev, rb_intern("to_i"), 0);
357
+ }
358
+
359
+ i_nlev = NUM2INT(nlev);
360
+
361
+
362
+ o_rtn_val = rudlev_(&i_nlev);
363
+
364
+ rtn_val = rb_float_new((double)o_rtn_val);
365
+
366
+
367
+ return rtn_val;
368
+
369
+ }
370
+
371
+ static VALUE
372
+ dcl_udiclr(obj, n)
373
+ VALUE obj, n;
374
+ {
375
+ integer *o_ix;
376
+ integer i_n;
377
+ VALUE ix;
378
+
379
+ if ((TYPE(n) != T_BIGNUM) || (TYPE(n) != T_FIXNUM)) {
380
+ n = rb_funcall(n, rb_intern("to_i"), 0);
381
+ }
382
+
383
+ i_n = NUM2INT(n);
384
+
385
+ o_ix= ALLOCA_N(integer, (i_n));
386
+
387
+ udiclr_(o_ix, &i_n);
388
+
389
+ {int array_shape[1] = {i_n};
390
+ ix = dcl_cintegerary2obj(o_ix, (i_n), 1, array_shape);
391
+ }
392
+
393
+
394
+ return ix;
395
+
396
+ }
397
+
398
+ static VALUE
399
+ dcl_udlabl(obj, val)
400
+ VALUE obj, val;
401
+ {
402
+ real i_val;
403
+ char *o_cval;
404
+ VALUE cval;
405
+
406
+ if (TYPE(val) != T_FLOAT) {
407
+ val = rb_funcall(val, rb_intern("to_f"), 0);
408
+ }
409
+
410
+ i_val = (real)NUM2DBL(val);
411
+
412
+ o_cval= ALLOCA_N(char, (DFLT_SIZE+1));
413
+ memset(o_cval, '\0', DFLT_SIZE+1);
414
+
415
+ udlabl_(&i_val, o_cval, (ftnlen)DFLT_SIZE);
416
+
417
+ cval = rb_str_new2(o_cval);
418
+
419
+
420
+ return cval;
421
+
422
+ }
423
+
424
+ static VALUE
425
+ dcl_udsfmt(obj, cfmt)
426
+ VALUE obj, cfmt;
427
+ {
428
+ char *i_cfmt;
429
+
430
+ if (TYPE(cfmt) != T_STRING) {
431
+ cfmt = rb_funcall(cfmt, rb_intern("to_str"), 0);
432
+ }
433
+
434
+ i_cfmt = StringValuePtr(cfmt);
435
+
436
+
437
+ udsfmt_(i_cfmt, (ftnlen)strlen(i_cfmt));
438
+
439
+ return Qnil;
440
+
441
+ }
442
+
443
+ static VALUE
444
+ dcl_udqfmt(obj)
445
+ VALUE obj;
446
+ {
447
+ char *o_cfmt;
448
+ VALUE cfmt;
449
+
450
+ o_cfmt= ALLOCA_N(char, (DFLT_SIZE+1));
451
+ memset(o_cfmt, '\0', DFLT_SIZE+1);
452
+
453
+ udqfmt_(o_cfmt, (ftnlen)DFLT_SIZE);
454
+
455
+ cfmt = rb_str_new2(o_cfmt);
456
+
457
+
458
+ return cfmt;
459
+
460
+ }
461
+
462
+ static VALUE
463
+ dcl_udpqnp(obj)
464
+ VALUE obj;
465
+ {
466
+ integer o_ncp;
467
+ VALUE ncp;
468
+
469
+ udpqnp_(&o_ncp);
470
+
471
+ ncp = INT2NUM(o_ncp);
472
+
473
+
474
+ return ncp;
475
+
476
+ }
477
+
478
+ static VALUE
479
+ dcl_udpqid(obj, cp)
480
+ VALUE obj, cp;
481
+ {
482
+ char *i_cp;
483
+ integer o_idx;
484
+ VALUE idx;
485
+
486
+ if (TYPE(cp) != T_STRING) {
487
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
488
+ }
489
+
490
+ i_cp = StringValuePtr(cp);
491
+
492
+
493
+ udpqid_(i_cp, &o_idx, (ftnlen)strlen(i_cp));
494
+
495
+ idx = INT2NUM(o_idx);
496
+
497
+
498
+ return idx;
499
+
500
+ }
501
+
502
+ static VALUE
503
+ dcl_udpqcp(obj, idx)
504
+ VALUE obj, idx;
505
+ {
506
+ integer i_idx;
507
+ char *o_cp;
508
+ VALUE cp;
509
+
510
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
511
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
512
+ }
513
+
514
+ i_idx = NUM2INT(idx);
515
+
516
+ o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
517
+ memset(o_cp, '\0', DFLT_SIZE+1);
518
+
519
+ udpqcp_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
520
+
521
+ cp = rb_str_new2(o_cp);
522
+
523
+
524
+ return cp;
525
+
526
+ }
527
+
528
+ static VALUE
529
+ dcl_udpqcl(obj, idx)
530
+ VALUE obj, idx;
531
+ {
532
+ integer i_idx;
533
+ char *o_cp;
534
+ VALUE cp;
535
+
536
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
537
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
538
+ }
539
+
540
+ i_idx = NUM2INT(idx);
541
+
542
+ o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
543
+ memset(o_cp, '\0', DFLT_SIZE+1);
544
+
545
+ udpqcl_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
546
+
547
+ cp = rb_str_new2(o_cp);
548
+
549
+
550
+ return cp;
551
+
552
+ }
553
+
554
+ static VALUE
555
+ dcl_udpqit(obj, idx)
556
+ VALUE obj, idx;
557
+ {
558
+ integer i_idx;
559
+ integer o_itp;
560
+ VALUE itp;
561
+
562
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
563
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
564
+ }
565
+
566
+ i_idx = NUM2INT(idx);
567
+
568
+
569
+ udpqit_(&i_idx, &o_itp);
570
+
571
+ itp = INT2NUM(o_itp);
572
+
573
+
574
+ return itp;
575
+
576
+ }
577
+
578
+ static VALUE
579
+ dcl_udpqvl(obj, idx)
580
+ VALUE obj, idx;
581
+ {
582
+ integer i_idx;
583
+ integer o_ipara;
584
+ VALUE ipara;
585
+
586
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
587
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
588
+ }
589
+
590
+ i_idx = NUM2INT(idx);
591
+
592
+
593
+ udpqvl_(&i_idx, &o_ipara);
594
+
595
+ ipara = INT2NUM(o_ipara);
596
+
597
+
598
+ return ipara;
599
+
600
+ }
601
+
602
+ static VALUE
603
+ dcl_udpsvl(obj, idx, ipara)
604
+ VALUE obj, idx, ipara;
605
+ {
606
+ integer i_idx;
607
+ integer i_ipara;
608
+
609
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
610
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
611
+ }
612
+ if ((TYPE(ipara) != T_BIGNUM) || (TYPE(ipara) != T_FIXNUM)) {
613
+ ipara = rb_funcall(ipara, rb_intern("to_i"), 0);
614
+ }
615
+
616
+ i_idx = NUM2INT(idx);
617
+ i_ipara = NUM2INT(ipara);
618
+
619
+
620
+ udpsvl_(&i_idx, &i_ipara);
621
+
622
+ return Qnil;
623
+
624
+ }
625
+
626
+ static VALUE
627
+ dcl_udpqin(obj, cp)
628
+ VALUE obj, cp;
629
+ {
630
+ char *i_cp;
631
+ integer o_in;
632
+ VALUE in;
633
+
634
+ if (TYPE(cp) != T_STRING) {
635
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
636
+ }
637
+
638
+ i_cp = StringValuePtr(cp);
639
+
640
+
641
+ udpqin_(i_cp, &o_in, (ftnlen)strlen(i_cp));
642
+
643
+ in = INT2NUM(o_in);
644
+
645
+
646
+ return in;
647
+
648
+ }
649
+
650
+ static VALUE
651
+ dcl_udiget(obj, cp)
652
+ VALUE obj, cp;
653
+ {
654
+ char *i_cp;
655
+ integer o_ipara;
656
+ VALUE ipara;
657
+
658
+ if (TYPE(cp) != T_STRING) {
659
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
660
+ }
661
+
662
+ i_cp = StringValuePtr(cp);
663
+
664
+
665
+ udiget_(i_cp, &o_ipara, (ftnlen)strlen(i_cp));
666
+
667
+ ipara = INT2NUM(o_ipara);
668
+
669
+
670
+ return ipara;
671
+
672
+ }
673
+
674
+ static VALUE
675
+ dcl_udiset(obj, cp, ipara)
676
+ VALUE obj, cp, ipara;
677
+ {
678
+ char *i_cp;
679
+ integer i_ipara;
680
+
681
+ if (TYPE(cp) != T_STRING) {
682
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
683
+ }
684
+ if ((TYPE(ipara) != T_BIGNUM) || (TYPE(ipara) != T_FIXNUM)) {
685
+ ipara = rb_funcall(ipara, rb_intern("to_i"), 0);
686
+ }
687
+
688
+ i_cp = StringValuePtr(cp);
689
+ i_ipara = NUM2INT(ipara);
690
+
691
+
692
+ udiset_(i_cp, &i_ipara, (ftnlen)strlen(i_cp));
693
+
694
+ return Qnil;
695
+
696
+ }
697
+
698
+ static VALUE
699
+ dcl_udistx(obj, cp, ipara)
700
+ VALUE obj, cp, ipara;
701
+ {
702
+ char *i_cp;
703
+ integer i_ipara;
704
+
705
+ if (TYPE(cp) != T_STRING) {
706
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
707
+ }
708
+ if ((TYPE(ipara) != T_BIGNUM) || (TYPE(ipara) != T_FIXNUM)) {
709
+ ipara = rb_funcall(ipara, rb_intern("to_i"), 0);
710
+ }
711
+
712
+ i_cp = StringValuePtr(cp);
713
+ i_ipara = NUM2INT(ipara);
714
+
715
+
716
+ udistx_(i_cp, &i_ipara, (ftnlen)strlen(i_cp));
717
+
718
+ return Qnil;
719
+
720
+ }
721
+
722
+ static VALUE
723
+ dcl_udiqnp(obj)
724
+ VALUE obj;
725
+ {
726
+ integer o_ncp;
727
+ VALUE ncp;
728
+
729
+ udiqnp_(&o_ncp);
730
+
731
+ ncp = INT2NUM(o_ncp);
732
+
733
+
734
+ return ncp;
735
+
736
+ }
737
+
738
+ static VALUE
739
+ dcl_udiqid(obj, cp)
740
+ VALUE obj, cp;
741
+ {
742
+ char *i_cp;
743
+ integer o_idx;
744
+ VALUE idx;
745
+
746
+ if (TYPE(cp) != T_STRING) {
747
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
748
+ }
749
+
750
+ i_cp = StringValuePtr(cp);
751
+
752
+
753
+ udiqid_(i_cp, &o_idx, (ftnlen)strlen(i_cp));
754
+
755
+ idx = INT2NUM(o_idx);
756
+
757
+
758
+ return idx;
759
+
760
+ }
761
+
762
+ static VALUE
763
+ dcl_udiqcp(obj, idx)
764
+ VALUE obj, idx;
765
+ {
766
+ integer i_idx;
767
+ char *o_cp;
768
+ VALUE cp;
769
+
770
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
771
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
772
+ }
773
+
774
+ i_idx = NUM2INT(idx);
775
+
776
+ o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
777
+ memset(o_cp, '\0', DFLT_SIZE+1);
778
+
779
+ udiqcp_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
780
+
781
+ cp = rb_str_new2(o_cp);
782
+
783
+
784
+ return cp;
785
+
786
+ }
787
+
788
+ static VALUE
789
+ dcl_udiqcl(obj, idx)
790
+ VALUE obj, idx;
791
+ {
792
+ integer i_idx;
793
+ char *o_cp;
794
+ VALUE cp;
795
+
796
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
797
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
798
+ }
799
+
800
+ i_idx = NUM2INT(idx);
801
+
802
+ o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
803
+ memset(o_cp, '\0', DFLT_SIZE+1);
804
+
805
+ udiqcl_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
806
+
807
+ cp = rb_str_new2(o_cp);
808
+
809
+
810
+ return cp;
811
+
812
+ }
813
+
814
+ static VALUE
815
+ dcl_udiqvl(obj, idx)
816
+ VALUE obj, idx;
817
+ {
818
+ integer i_idx;
819
+ integer o_ipara;
820
+ VALUE ipara;
821
+
822
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
823
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
824
+ }
825
+
826
+ i_idx = NUM2INT(idx);
827
+
828
+
829
+ udiqvl_(&i_idx, &o_ipara);
830
+
831
+ ipara = INT2NUM(o_ipara);
832
+
833
+
834
+ return ipara;
835
+
836
+ }
837
+
838
+ static VALUE
839
+ dcl_udisvl(obj, idx, ipara)
840
+ VALUE obj, idx, ipara;
841
+ {
842
+ integer i_idx;
843
+ integer i_ipara;
844
+
845
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
846
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
847
+ }
848
+ if ((TYPE(ipara) != T_BIGNUM) || (TYPE(ipara) != T_FIXNUM)) {
849
+ ipara = rb_funcall(ipara, rb_intern("to_i"), 0);
850
+ }
851
+
852
+ i_idx = NUM2INT(idx);
853
+ i_ipara = NUM2INT(ipara);
854
+
855
+
856
+ udisvl_(&i_idx, &i_ipara);
857
+
858
+ return Qnil;
859
+
860
+ }
861
+
862
+ static VALUE
863
+ dcl_udiqin(obj, cp)
864
+ VALUE obj, cp;
865
+ {
866
+ char *i_cp;
867
+ integer o_in;
868
+ VALUE in;
869
+
870
+ if (TYPE(cp) != T_STRING) {
871
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
872
+ }
873
+
874
+ i_cp = StringValuePtr(cp);
875
+
876
+
877
+ udiqin_(i_cp, &o_in, (ftnlen)strlen(i_cp));
878
+
879
+ in = INT2NUM(o_in);
880
+
881
+
882
+ return in;
883
+
884
+ }
885
+
886
+ static VALUE
887
+ dcl_udlget(obj, cp)
888
+ VALUE obj, cp;
889
+ {
890
+ char *i_cp;
891
+ logical o_lpara;
892
+ VALUE lpara;
893
+
894
+ if (TYPE(cp) != T_STRING) {
895
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
896
+ }
897
+
898
+ i_cp = StringValuePtr(cp);
899
+
900
+
901
+ udlget_(i_cp, &o_lpara, (ftnlen)strlen(i_cp));
902
+
903
+ lpara = (o_lpara == FALSE_) ? Qfalse : Qtrue;
904
+
905
+
906
+ return lpara;
907
+
908
+ }
909
+
910
+ static VALUE
911
+ dcl_udlset(obj, cp, lpara)
912
+ VALUE obj, cp, lpara;
913
+ {
914
+ char *i_cp;
915
+ logical i_lpara;
916
+
917
+ if (TYPE(cp) != T_STRING) {
918
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
919
+ }
920
+
921
+ i_cp = StringValuePtr(cp);
922
+ i_lpara = ((lpara == Qnil)||(lpara == Qfalse)) ? FALSE_ : TRUE_;
923
+
924
+
925
+ udlset_(i_cp, &i_lpara, (ftnlen)strlen(i_cp));
926
+
927
+ return Qnil;
928
+
929
+ }
930
+
931
+ static VALUE
932
+ dcl_udlstx(obj, cp, lpara)
933
+ VALUE obj, cp, lpara;
934
+ {
935
+ char *i_cp;
936
+ logical i_lpara;
937
+
938
+ if (TYPE(cp) != T_STRING) {
939
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
940
+ }
941
+
942
+ i_cp = StringValuePtr(cp);
943
+ i_lpara = ((lpara == Qnil)||(lpara == Qfalse)) ? FALSE_ : TRUE_;
944
+
945
+
946
+ udlstx_(i_cp, &i_lpara, (ftnlen)strlen(i_cp));
947
+
948
+ return Qnil;
949
+
950
+ }
951
+
952
+ static VALUE
953
+ dcl_udlqnp(obj)
954
+ VALUE obj;
955
+ {
956
+ integer o_ncp;
957
+ VALUE ncp;
958
+
959
+ udlqnp_(&o_ncp);
960
+
961
+ ncp = INT2NUM(o_ncp);
962
+
963
+
964
+ return ncp;
965
+
966
+ }
967
+
968
+ static VALUE
969
+ dcl_udlqid(obj, cp)
970
+ VALUE obj, cp;
971
+ {
972
+ char *i_cp;
973
+ integer o_idx;
974
+ VALUE idx;
975
+
976
+ if (TYPE(cp) != T_STRING) {
977
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
978
+ }
979
+
980
+ i_cp = StringValuePtr(cp);
981
+
982
+
983
+ udlqid_(i_cp, &o_idx, (ftnlen)strlen(i_cp));
984
+
985
+ idx = INT2NUM(o_idx);
986
+
987
+
988
+ return idx;
989
+
990
+ }
991
+
992
+ static VALUE
993
+ dcl_udlqcp(obj, idx)
994
+ VALUE obj, idx;
995
+ {
996
+ integer i_idx;
997
+ char *o_cp;
998
+ VALUE cp;
999
+
1000
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
1001
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
1002
+ }
1003
+
1004
+ i_idx = NUM2INT(idx);
1005
+
1006
+ o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
1007
+ memset(o_cp, '\0', DFLT_SIZE+1);
1008
+
1009
+ udlqcp_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
1010
+
1011
+ cp = rb_str_new2(o_cp);
1012
+
1013
+
1014
+ return cp;
1015
+
1016
+ }
1017
+
1018
+ static VALUE
1019
+ dcl_udlqcl(obj, idx)
1020
+ VALUE obj, idx;
1021
+ {
1022
+ integer i_idx;
1023
+ char *o_cp;
1024
+ VALUE cp;
1025
+
1026
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
1027
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
1028
+ }
1029
+
1030
+ i_idx = NUM2INT(idx);
1031
+
1032
+ o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
1033
+ memset(o_cp, '\0', DFLT_SIZE+1);
1034
+
1035
+ udlqcl_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
1036
+
1037
+ cp = rb_str_new2(o_cp);
1038
+
1039
+
1040
+ return cp;
1041
+
1042
+ }
1043
+
1044
+ static VALUE
1045
+ dcl_udlqvl(obj, idx)
1046
+ VALUE obj, idx;
1047
+ {
1048
+ integer i_idx;
1049
+ logical o_lpara;
1050
+ VALUE lpara;
1051
+
1052
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
1053
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
1054
+ }
1055
+
1056
+ i_idx = NUM2INT(idx);
1057
+
1058
+
1059
+ udlqvl_(&i_idx, &o_lpara);
1060
+
1061
+ lpara = (o_lpara == FALSE_) ? Qfalse : Qtrue;
1062
+
1063
+
1064
+ return lpara;
1065
+
1066
+ }
1067
+
1068
+ static VALUE
1069
+ dcl_udlsvl(obj, idx, lpara)
1070
+ VALUE obj, idx, lpara;
1071
+ {
1072
+ integer i_idx;
1073
+ logical i_lpara;
1074
+
1075
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
1076
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
1077
+ }
1078
+
1079
+ i_idx = NUM2INT(idx);
1080
+ i_lpara = ((lpara == Qnil)||(lpara == Qfalse)) ? FALSE_ : TRUE_;
1081
+
1082
+
1083
+ udlsvl_(&i_idx, &i_lpara);
1084
+
1085
+ return Qnil;
1086
+
1087
+ }
1088
+
1089
+ static VALUE
1090
+ dcl_udlqin(obj, cp)
1091
+ VALUE obj, cp;
1092
+ {
1093
+ char *i_cp;
1094
+ integer o_in;
1095
+ VALUE in;
1096
+
1097
+ if (TYPE(cp) != T_STRING) {
1098
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1099
+ }
1100
+
1101
+ i_cp = StringValuePtr(cp);
1102
+
1103
+
1104
+ udlqin_(i_cp, &o_in, (ftnlen)strlen(i_cp));
1105
+
1106
+ in = INT2NUM(o_in);
1107
+
1108
+
1109
+ return in;
1110
+
1111
+ }
1112
+
1113
+ static VALUE
1114
+ dcl_udrget(obj, cp)
1115
+ VALUE obj, cp;
1116
+ {
1117
+ char *i_cp;
1118
+ real o_rpara;
1119
+ VALUE rpara;
1120
+
1121
+ if (TYPE(cp) != T_STRING) {
1122
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1123
+ }
1124
+
1125
+ i_cp = StringValuePtr(cp);
1126
+
1127
+
1128
+ udrget_(i_cp, &o_rpara, (ftnlen)strlen(i_cp));
1129
+
1130
+ rpara = rb_float_new((double)o_rpara);
1131
+
1132
+
1133
+ return rpara;
1134
+
1135
+ }
1136
+
1137
+ static VALUE
1138
+ dcl_udrset(obj, cp, rpara)
1139
+ VALUE obj, cp, rpara;
1140
+ {
1141
+ char *i_cp;
1142
+ real i_rpara;
1143
+
1144
+ if (TYPE(cp) != T_STRING) {
1145
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1146
+ }
1147
+ if (TYPE(rpara) != T_FLOAT) {
1148
+ rpara = rb_funcall(rpara, rb_intern("to_f"), 0);
1149
+ }
1150
+
1151
+ i_cp = StringValuePtr(cp);
1152
+ i_rpara = (real)NUM2DBL(rpara);
1153
+
1154
+
1155
+ udrset_(i_cp, &i_rpara, (ftnlen)strlen(i_cp));
1156
+
1157
+ return Qnil;
1158
+
1159
+ }
1160
+
1161
+ static VALUE
1162
+ dcl_udrstx(obj, cp, rpara)
1163
+ VALUE obj, cp, rpara;
1164
+ {
1165
+ char *i_cp;
1166
+ real i_rpara;
1167
+
1168
+ if (TYPE(cp) != T_STRING) {
1169
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1170
+ }
1171
+ if (TYPE(rpara) != T_FLOAT) {
1172
+ rpara = rb_funcall(rpara, rb_intern("to_f"), 0);
1173
+ }
1174
+
1175
+ i_cp = StringValuePtr(cp);
1176
+ i_rpara = (real)NUM2DBL(rpara);
1177
+
1178
+
1179
+ udrstx_(i_cp, &i_rpara, (ftnlen)strlen(i_cp));
1180
+
1181
+ return Qnil;
1182
+
1183
+ }
1184
+
1185
+ static VALUE
1186
+ dcl_udrqnp(obj)
1187
+ VALUE obj;
1188
+ {
1189
+ integer o_ncp;
1190
+ VALUE ncp;
1191
+
1192
+ udrqnp_(&o_ncp);
1193
+
1194
+ ncp = INT2NUM(o_ncp);
1195
+
1196
+
1197
+ return ncp;
1198
+
1199
+ }
1200
+
1201
+ static VALUE
1202
+ dcl_udrqid(obj, cp)
1203
+ VALUE obj, cp;
1204
+ {
1205
+ char *i_cp;
1206
+ integer o_idx;
1207
+ VALUE idx;
1208
+
1209
+ if (TYPE(cp) != T_STRING) {
1210
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1211
+ }
1212
+
1213
+ i_cp = StringValuePtr(cp);
1214
+
1215
+
1216
+ udrqid_(i_cp, &o_idx, (ftnlen)strlen(i_cp));
1217
+
1218
+ idx = INT2NUM(o_idx);
1219
+
1220
+
1221
+ return idx;
1222
+
1223
+ }
1224
+
1225
+ static VALUE
1226
+ dcl_udrqcp(obj, idx)
1227
+ VALUE obj, idx;
1228
+ {
1229
+ integer i_idx;
1230
+ char *o_cp;
1231
+ VALUE cp;
1232
+
1233
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
1234
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
1235
+ }
1236
+
1237
+ i_idx = NUM2INT(idx);
1238
+
1239
+ o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
1240
+ memset(o_cp, '\0', DFLT_SIZE+1);
1241
+
1242
+ udrqcp_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
1243
+
1244
+ cp = rb_str_new2(o_cp);
1245
+
1246
+
1247
+ return cp;
1248
+
1249
+ }
1250
+
1251
+ static VALUE
1252
+ dcl_udrqcl(obj, idx)
1253
+ VALUE obj, idx;
1254
+ {
1255
+ integer i_idx;
1256
+ char *o_cp;
1257
+ VALUE cp;
1258
+
1259
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
1260
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
1261
+ }
1262
+
1263
+ i_idx = NUM2INT(idx);
1264
+
1265
+ o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
1266
+ memset(o_cp, '\0', DFLT_SIZE+1);
1267
+
1268
+ udrqcl_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
1269
+
1270
+ cp = rb_str_new2(o_cp);
1271
+
1272
+
1273
+ return cp;
1274
+
1275
+ }
1276
+
1277
+ static VALUE
1278
+ dcl_udrqvl(obj, idx)
1279
+ VALUE obj, idx;
1280
+ {
1281
+ integer i_idx;
1282
+ real o_rpara;
1283
+ VALUE rpara;
1284
+
1285
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
1286
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
1287
+ }
1288
+
1289
+ i_idx = NUM2INT(idx);
1290
+
1291
+
1292
+ udrqvl_(&i_idx, &o_rpara);
1293
+
1294
+ rpara = rb_float_new((double)o_rpara);
1295
+
1296
+
1297
+ return rpara;
1298
+
1299
+ }
1300
+
1301
+ static VALUE
1302
+ dcl_udrsvl(obj, idx, rpara)
1303
+ VALUE obj, idx, rpara;
1304
+ {
1305
+ integer i_idx;
1306
+ real i_rpara;
1307
+
1308
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
1309
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
1310
+ }
1311
+ if (TYPE(rpara) != T_FLOAT) {
1312
+ rpara = rb_funcall(rpara, rb_intern("to_f"), 0);
1313
+ }
1314
+
1315
+ i_idx = NUM2INT(idx);
1316
+ i_rpara = (real)NUM2DBL(rpara);
1317
+
1318
+
1319
+ udrsvl_(&i_idx, &i_rpara);
1320
+
1321
+ return Qnil;
1322
+
1323
+ }
1324
+
1325
+ static VALUE
1326
+ dcl_udrqin(obj, cp)
1327
+ VALUE obj, cp;
1328
+ {
1329
+ char *i_cp;
1330
+ integer o_in;
1331
+ VALUE in;
1332
+
1333
+ if (TYPE(cp) != T_STRING) {
1334
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1335
+ }
1336
+
1337
+ i_cp = StringValuePtr(cp);
1338
+
1339
+
1340
+ udrqin_(i_cp, &o_in, (ftnlen)strlen(i_cp));
1341
+
1342
+ in = INT2NUM(o_in);
1343
+
1344
+
1345
+ return in;
1346
+
1347
+ }
1348
+ void
1349
+ init_grph2_udpack(mDCL)
1350
+ VALUE mDCL;
1351
+ {
1352
+ rb_define_module_function(mDCL, "udcntr", dcl_udcntr, 4);
1353
+ rb_define_module_function(mDCL, "udcntz", dcl_udcntz, 5);
1354
+ rb_define_module_function(mDCL, "udgcla", dcl_udgcla, 3);
1355
+ rb_define_module_function(mDCL, "udgclb", dcl_udgclb, 5);
1356
+ rb_define_module_function(mDCL, "udiclv", dcl_udiclv, 0);
1357
+ rb_define_module_function(mDCL, "udsclv", dcl_udsclv, 5);
1358
+ rb_define_module_function(mDCL, "udqclv", dcl_udqclv, 1);
1359
+ rb_define_module_function(mDCL, "udqcln", dcl_udqcln, 0);
1360
+ rb_define_module_function(mDCL, "uddclv", dcl_uddclv, 1);
1361
+ rb_define_module_function(mDCL, "rudlev", dcl_rudlev, 1);
1362
+ rb_define_module_function(mDCL, "udiclr", dcl_udiclr, 1);
1363
+ rb_define_module_function(mDCL, "udlabl", dcl_udlabl, 1);
1364
+ rb_define_module_function(mDCL, "udsfmt", dcl_udsfmt, 1);
1365
+ rb_define_module_function(mDCL, "udqfmt", dcl_udqfmt, 0);
1366
+ rb_define_module_function(mDCL, "udpqnp", dcl_udpqnp, 0);
1367
+ rb_define_module_function(mDCL, "udpqid", dcl_udpqid, 1);
1368
+ rb_define_module_function(mDCL, "udpqcp", dcl_udpqcp, 1);
1369
+ rb_define_module_function(mDCL, "udpqcl", dcl_udpqcl, 1);
1370
+ rb_define_module_function(mDCL, "udpqit", dcl_udpqit, 1);
1371
+ rb_define_module_function(mDCL, "udpqvl", dcl_udpqvl, 1);
1372
+ rb_define_module_function(mDCL, "udpsvl", dcl_udpsvl, 2);
1373
+ rb_define_module_function(mDCL, "udpqin", dcl_udpqin, 1);
1374
+ rb_define_module_function(mDCL, "udiget", dcl_udiget, 1);
1375
+ rb_define_module_function(mDCL, "udiset", dcl_udiset, 2);
1376
+ rb_define_module_function(mDCL, "udistx", dcl_udistx, 2);
1377
+ rb_define_module_function(mDCL, "udiqnp", dcl_udiqnp, 0);
1378
+ rb_define_module_function(mDCL, "udiqid", dcl_udiqid, 1);
1379
+ rb_define_module_function(mDCL, "udiqcp", dcl_udiqcp, 1);
1380
+ rb_define_module_function(mDCL, "udiqcl", dcl_udiqcl, 1);
1381
+ rb_define_module_function(mDCL, "udiqvl", dcl_udiqvl, 1);
1382
+ rb_define_module_function(mDCL, "udisvl", dcl_udisvl, 2);
1383
+ rb_define_module_function(mDCL, "udiqin", dcl_udiqin, 1);
1384
+ rb_define_module_function(mDCL, "udlget", dcl_udlget, 1);
1385
+ rb_define_module_function(mDCL, "udlset", dcl_udlset, 2);
1386
+ rb_define_module_function(mDCL, "udlstx", dcl_udlstx, 2);
1387
+ rb_define_module_function(mDCL, "udlqnp", dcl_udlqnp, 0);
1388
+ rb_define_module_function(mDCL, "udlqid", dcl_udlqid, 1);
1389
+ rb_define_module_function(mDCL, "udlqcp", dcl_udlqcp, 1);
1390
+ rb_define_module_function(mDCL, "udlqcl", dcl_udlqcl, 1);
1391
+ rb_define_module_function(mDCL, "udlqvl", dcl_udlqvl, 1);
1392
+ rb_define_module_function(mDCL, "udlsvl", dcl_udlsvl, 2);
1393
+ rb_define_module_function(mDCL, "udlqin", dcl_udlqin, 1);
1394
+ rb_define_module_function(mDCL, "udrget", dcl_udrget, 1);
1395
+ rb_define_module_function(mDCL, "udrset", dcl_udrset, 2);
1396
+ rb_define_module_function(mDCL, "udrstx", dcl_udrstx, 2);
1397
+ rb_define_module_function(mDCL, "udrqnp", dcl_udrqnp, 0);
1398
+ rb_define_module_function(mDCL, "udrqid", dcl_udrqid, 1);
1399
+ rb_define_module_function(mDCL, "udrqcp", dcl_udrqcp, 1);
1400
+ rb_define_module_function(mDCL, "udrqcl", dcl_udrqcl, 1);
1401
+ rb_define_module_function(mDCL, "udrqvl", dcl_udrqvl, 1);
1402
+ rb_define_module_function(mDCL, "udrsvl", dcl_udrsvl, 2);
1403
+ rb_define_module_function(mDCL, "udrqin", dcl_udrqin, 1);
1404
+ }