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/math1_syslib.c ADDED
@@ -0,0 +1,2025 @@
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_lchreq(obj, ch1, ch2)
66
+ VALUE obj, ch1, ch2;
67
+ {
68
+ char *i_ch1;
69
+ char *i_ch2;
70
+ logical o_rtn_val;
71
+ VALUE rtn_val;
72
+
73
+ if (TYPE(ch1) != T_STRING) {
74
+ ch1 = rb_funcall(ch1, rb_intern("to_str"), 0);
75
+ }
76
+ if (TYPE(ch2) != T_STRING) {
77
+ ch2 = rb_funcall(ch2, rb_intern("to_str"), 0);
78
+ }
79
+
80
+ i_ch1 = StringValuePtr(ch1);
81
+ i_ch2 = StringValuePtr(ch2);
82
+
83
+
84
+ o_rtn_val = lchreq_(i_ch1, i_ch2, (ftnlen)strlen(i_ch1), (ftnlen)strlen(i_ch2));
85
+
86
+ rtn_val = (o_rtn_val == FALSE_) ? Qfalse : Qtrue;
87
+
88
+
89
+ return rtn_val;
90
+
91
+ }
92
+
93
+ static VALUE
94
+ dcl_msgdmp(obj, clev, csub, cmsg)
95
+ VALUE obj, clev, csub, cmsg;
96
+ {
97
+ char *i_clev;
98
+ char *i_csub;
99
+ char *i_cmsg;
100
+
101
+ if (TYPE(clev) != T_STRING) {
102
+ clev = rb_funcall(clev, rb_intern("to_str"), 0);
103
+ }
104
+ if (TYPE(csub) != T_STRING) {
105
+ csub = rb_funcall(csub, rb_intern("to_str"), 0);
106
+ }
107
+ if (TYPE(cmsg) != T_STRING) {
108
+ cmsg = rb_funcall(cmsg, rb_intern("to_str"), 0);
109
+ }
110
+
111
+ i_clev = StringValuePtr(clev);
112
+ i_csub = StringValuePtr(csub);
113
+ i_cmsg = StringValuePtr(cmsg);
114
+
115
+
116
+ msgdmp_(i_clev, i_csub, i_cmsg, (ftnlen)strlen(i_clev), (ftnlen)strlen(i_csub), (ftnlen)strlen(i_cmsg));
117
+
118
+ return Qnil;
119
+
120
+ }
121
+
122
+ static VALUE
123
+ dcl_mszdmp(obj, cmsg, iunit, lnsize)
124
+ VALUE obj, cmsg, iunit, lnsize;
125
+ {
126
+ char *i_cmsg;
127
+ integer i_iunit;
128
+ integer i_lnsize;
129
+
130
+ if (TYPE(cmsg) != T_STRING) {
131
+ cmsg = rb_funcall(cmsg, rb_intern("to_str"), 0);
132
+ }
133
+ if ((TYPE(iunit) != T_BIGNUM) || (TYPE(iunit) != T_FIXNUM)) {
134
+ iunit = rb_funcall(iunit, rb_intern("to_i"), 0);
135
+ }
136
+ if ((TYPE(lnsize) != T_BIGNUM) || (TYPE(lnsize) != T_FIXNUM)) {
137
+ lnsize = rb_funcall(lnsize, rb_intern("to_i"), 0);
138
+ }
139
+
140
+ i_cmsg = StringValuePtr(cmsg);
141
+ i_iunit = NUM2INT(iunit);
142
+ i_lnsize = NUM2INT(lnsize);
143
+
144
+
145
+ mszdmp_(i_cmsg, &i_iunit, &i_lnsize, (ftnlen)strlen(i_cmsg));
146
+
147
+ return Qnil;
148
+
149
+ }
150
+
151
+ static VALUE
152
+ dcl_glcget(obj, cp)
153
+ VALUE obj, cp;
154
+ {
155
+ char *i_cp;
156
+ char *o_cpara;
157
+ VALUE cpara;
158
+
159
+ if (TYPE(cp) != T_STRING) {
160
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
161
+ }
162
+
163
+ i_cp = StringValuePtr(cp);
164
+
165
+ o_cpara= ALLOCA_N(char, (DFLT_SIZE+1));
166
+ memset(o_cpara, '\0', DFLT_SIZE+1);
167
+
168
+ glcget_(i_cp, o_cpara, (ftnlen)strlen(i_cp), (ftnlen)DFLT_SIZE);
169
+
170
+ cpara = rb_str_new2(o_cpara);
171
+
172
+
173
+ return cpara;
174
+
175
+ }
176
+
177
+ static VALUE
178
+ dcl_glcset(obj, cp, cpara)
179
+ VALUE obj, cp, cpara;
180
+ {
181
+ char *i_cp;
182
+ char *i_cpara;
183
+
184
+ if (TYPE(cp) != T_STRING) {
185
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
186
+ }
187
+ if (TYPE(cpara) != T_STRING) {
188
+ cpara = rb_funcall(cpara, rb_intern("to_str"), 0);
189
+ }
190
+
191
+ i_cp = StringValuePtr(cp);
192
+ i_cpara = StringValuePtr(cpara);
193
+
194
+
195
+ glcset_(i_cp, i_cpara, (ftnlen)strlen(i_cp), (ftnlen)strlen(i_cpara));
196
+
197
+ return Qnil;
198
+
199
+ }
200
+
201
+ static VALUE
202
+ dcl_glcstx(obj, cp, cpara)
203
+ VALUE obj, cp, cpara;
204
+ {
205
+ char *i_cp;
206
+ char *i_cpara;
207
+
208
+ if (TYPE(cp) != T_STRING) {
209
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
210
+ }
211
+ if (TYPE(cpara) != T_STRING) {
212
+ cpara = rb_funcall(cpara, rb_intern("to_str"), 0);
213
+ }
214
+
215
+ i_cp = StringValuePtr(cp);
216
+ i_cpara = StringValuePtr(cpara);
217
+
218
+
219
+ glcstx_(i_cp, i_cpara, (ftnlen)strlen(i_cp), (ftnlen)strlen(i_cpara));
220
+
221
+ return Qnil;
222
+
223
+ }
224
+
225
+ static VALUE
226
+ dcl_glqfnm(obj, cpara)
227
+ VALUE obj, cpara;
228
+ {
229
+ char *i_cpara;
230
+ char *o_cfname;
231
+ VALUE cfname;
232
+
233
+ if (TYPE(cpara) != T_STRING) {
234
+ cpara = rb_funcall(cpara, rb_intern("to_str"), 0);
235
+ }
236
+
237
+ i_cpara = StringValuePtr(cpara);
238
+
239
+ o_cfname= ALLOCA_N(char, (DFLT_SIZE+1));
240
+ memset(o_cfname, '\0', DFLT_SIZE+1);
241
+
242
+ glqfnm_(i_cpara, o_cfname, (ftnlen)strlen(i_cpara), (ftnlen)DFLT_SIZE);
243
+
244
+ cfname = rb_str_new2(o_cfname);
245
+
246
+
247
+ return cfname;
248
+
249
+ }
250
+
251
+ static VALUE
252
+ dcl_iufopn(obj)
253
+ VALUE obj;
254
+ {
255
+ integer o_rtn_val;
256
+ VALUE rtn_val;
257
+
258
+ o_rtn_val = iufopn_();
259
+
260
+ rtn_val = INT2NUM(o_rtn_val);
261
+
262
+
263
+ return rtn_val;
264
+
265
+ }
266
+
267
+ static VALUE
268
+ dcl_cfsrch(obj, cplist, np, cflist, nf)
269
+ VALUE obj, cplist, np, cflist, nf;
270
+ {
271
+ char *i_cplist;
272
+ integer i_np;
273
+ char *i_cflist;
274
+ integer i_nf;
275
+ char *o_cfname;
276
+ VALUE cfname;
277
+
278
+ if (TYPE(cplist) == T_STRING) {
279
+ cplist = rb_Array(cplist);
280
+ }
281
+ if (TYPE(cplist) != T_ARRAY) {
282
+ rb_raise(rb_eTypeError, "invalid type");
283
+ }
284
+ if ((TYPE(np) != T_BIGNUM) || (TYPE(np) != T_FIXNUM)) {
285
+ np = rb_funcall(np, rb_intern("to_i"), 0);
286
+ }
287
+ if (TYPE(cflist) == T_STRING) {
288
+ cflist = rb_Array(cflist);
289
+ }
290
+ if (TYPE(cflist) != T_ARRAY) {
291
+ rb_raise(rb_eTypeError, "invalid type");
292
+ }
293
+ if ((TYPE(nf) != T_BIGNUM) || (TYPE(nf) != T_FIXNUM)) {
294
+ nf = rb_funcall(nf, rb_intern("to_i"), 0);
295
+ }
296
+
297
+ i_np = NUM2INT(np);
298
+ i_nf = NUM2INT(nf);
299
+ i_cplist = dcl_obj2ccharary(cplist, (i_np*80), 80);
300
+ i_cflist = dcl_obj2ccharary(cflist, (i_np*80), 80);
301
+
302
+ o_cfname= ALLOCA_N(char, (DFLT_SIZE+1));
303
+ memset(o_cfname, '\0', DFLT_SIZE+1);
304
+
305
+ cfsrch_(i_cplist, &i_np, i_cflist, &i_nf, o_cfname, (ftnlen)80, (ftnlen)80, (ftnlen)DFLT_SIZE);
306
+
307
+ cfname = rb_str_new2(o_cfname);
308
+
309
+ dcl_freeccharary(i_cplist);
310
+ dcl_freeccharary(i_cflist);
311
+
312
+ return cfname;
313
+
314
+ }
315
+
316
+ static VALUE
317
+ dcl_glpqnp(obj)
318
+ VALUE obj;
319
+ {
320
+ integer o_ncp;
321
+ VALUE ncp;
322
+
323
+ glpqnp_(&o_ncp);
324
+
325
+ ncp = INT2NUM(o_ncp);
326
+
327
+
328
+ return ncp;
329
+
330
+ }
331
+
332
+ static VALUE
333
+ dcl_glpqid(obj, cp)
334
+ VALUE obj, cp;
335
+ {
336
+ char *i_cp;
337
+ integer o_idx;
338
+ VALUE idx;
339
+
340
+ if (TYPE(cp) != T_STRING) {
341
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
342
+ }
343
+
344
+ i_cp = StringValuePtr(cp);
345
+
346
+
347
+ glpqid_(i_cp, &o_idx, (ftnlen)strlen(i_cp));
348
+
349
+ idx = INT2NUM(o_idx);
350
+
351
+
352
+ return idx;
353
+
354
+ }
355
+
356
+ static VALUE
357
+ dcl_glpqcp(obj, idx)
358
+ VALUE obj, idx;
359
+ {
360
+ integer i_idx;
361
+ char *o_cp;
362
+ VALUE cp;
363
+
364
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
365
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
366
+ }
367
+
368
+ i_idx = NUM2INT(idx);
369
+
370
+ o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
371
+ memset(o_cp, '\0', DFLT_SIZE+1);
372
+
373
+ glpqcp_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
374
+
375
+ cp = rb_str_new2(o_cp);
376
+
377
+
378
+ return cp;
379
+
380
+ }
381
+
382
+ static VALUE
383
+ dcl_glpqcl(obj, idx)
384
+ VALUE obj, idx;
385
+ {
386
+ integer i_idx;
387
+ char *o_cp;
388
+ VALUE cp;
389
+
390
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
391
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
392
+ }
393
+
394
+ i_idx = NUM2INT(idx);
395
+
396
+ o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
397
+ memset(o_cp, '\0', DFLT_SIZE+1);
398
+
399
+ glpqcl_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
400
+
401
+ cp = rb_str_new2(o_cp);
402
+
403
+
404
+ return cp;
405
+
406
+ }
407
+
408
+ static VALUE
409
+ dcl_glpqit(obj, idx)
410
+ VALUE obj, idx;
411
+ {
412
+ integer i_idx;
413
+ integer o_itp;
414
+ VALUE itp;
415
+
416
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
417
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
418
+ }
419
+
420
+ i_idx = NUM2INT(idx);
421
+
422
+
423
+ glpqit_(&i_idx, &o_itp);
424
+
425
+ itp = INT2NUM(o_itp);
426
+
427
+
428
+ return itp;
429
+
430
+ }
431
+
432
+ static VALUE
433
+ dcl_glpqvl(obj, idx)
434
+ VALUE obj, idx;
435
+ {
436
+ integer i_idx;
437
+ integer o_ipara;
438
+ VALUE ipara;
439
+
440
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
441
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
442
+ }
443
+
444
+ i_idx = NUM2INT(idx);
445
+
446
+
447
+ glpqvl_(&i_idx, &o_ipara);
448
+
449
+ ipara = INT2NUM(o_ipara);
450
+
451
+
452
+ return ipara;
453
+
454
+ }
455
+
456
+ static VALUE
457
+ dcl_glpsvl(obj, idx, ipara)
458
+ VALUE obj, idx, ipara;
459
+ {
460
+ integer i_idx;
461
+ integer i_ipara;
462
+
463
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
464
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
465
+ }
466
+ if ((TYPE(ipara) != T_BIGNUM) || (TYPE(ipara) != T_FIXNUM)) {
467
+ ipara = rb_funcall(ipara, rb_intern("to_i"), 0);
468
+ }
469
+
470
+ i_idx = NUM2INT(idx);
471
+ i_ipara = NUM2INT(ipara);
472
+
473
+
474
+ glpsvl_(&i_idx, &i_ipara);
475
+
476
+ return Qnil;
477
+
478
+ }
479
+
480
+ static VALUE
481
+ dcl_glpqin(obj, cp)
482
+ VALUE obj, cp;
483
+ {
484
+ char *i_cp;
485
+ integer o_in;
486
+ VALUE in;
487
+
488
+ if (TYPE(cp) != T_STRING) {
489
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
490
+ }
491
+
492
+ i_cp = StringValuePtr(cp);
493
+
494
+
495
+ glpqin_(i_cp, &o_in, (ftnlen)strlen(i_cp));
496
+
497
+ in = INT2NUM(o_in);
498
+
499
+
500
+ return in;
501
+
502
+ }
503
+
504
+ static VALUE
505
+ dcl_gliget(obj, cp)
506
+ VALUE obj, cp;
507
+ {
508
+ char *i_cp;
509
+ integer o_ipara;
510
+ VALUE ipara;
511
+
512
+ if (TYPE(cp) != T_STRING) {
513
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
514
+ }
515
+
516
+ i_cp = StringValuePtr(cp);
517
+
518
+
519
+ gliget_(i_cp, &o_ipara, (ftnlen)strlen(i_cp));
520
+
521
+ ipara = INT2NUM(o_ipara);
522
+
523
+
524
+ return ipara;
525
+
526
+ }
527
+
528
+ static VALUE
529
+ dcl_gliset(obj, cp, ipara)
530
+ VALUE obj, cp, ipara;
531
+ {
532
+ char *i_cp;
533
+ integer i_ipara;
534
+
535
+ if (TYPE(cp) != T_STRING) {
536
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
537
+ }
538
+ if ((TYPE(ipara) != T_BIGNUM) || (TYPE(ipara) != T_FIXNUM)) {
539
+ ipara = rb_funcall(ipara, rb_intern("to_i"), 0);
540
+ }
541
+
542
+ i_cp = StringValuePtr(cp);
543
+ i_ipara = NUM2INT(ipara);
544
+
545
+
546
+ gliset_(i_cp, &i_ipara, (ftnlen)strlen(i_cp));
547
+
548
+ return Qnil;
549
+
550
+ }
551
+
552
+ static VALUE
553
+ dcl_glistx(obj, cp, ipara)
554
+ VALUE obj, cp, ipara;
555
+ {
556
+ char *i_cp;
557
+ integer i_ipara;
558
+
559
+ if (TYPE(cp) != T_STRING) {
560
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
561
+ }
562
+ if ((TYPE(ipara) != T_BIGNUM) || (TYPE(ipara) != T_FIXNUM)) {
563
+ ipara = rb_funcall(ipara, rb_intern("to_i"), 0);
564
+ }
565
+
566
+ i_cp = StringValuePtr(cp);
567
+ i_ipara = NUM2INT(ipara);
568
+
569
+
570
+ glistx_(i_cp, &i_ipara, (ftnlen)strlen(i_cp));
571
+
572
+ return Qnil;
573
+
574
+ }
575
+
576
+ static VALUE
577
+ dcl_gllget(obj, cp)
578
+ VALUE obj, cp;
579
+ {
580
+ char *i_cp;
581
+ logical o_lpara;
582
+ VALUE lpara;
583
+
584
+ if (TYPE(cp) != T_STRING) {
585
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
586
+ }
587
+
588
+ i_cp = StringValuePtr(cp);
589
+
590
+
591
+ gllget_(i_cp, &o_lpara, (ftnlen)strlen(i_cp));
592
+
593
+ lpara = (o_lpara == FALSE_) ? Qfalse : Qtrue;
594
+
595
+
596
+ return lpara;
597
+
598
+ }
599
+
600
+ static VALUE
601
+ dcl_gllset(obj, cp, lpara)
602
+ VALUE obj, cp, lpara;
603
+ {
604
+ char *i_cp;
605
+ logical i_lpara;
606
+
607
+ if (TYPE(cp) != T_STRING) {
608
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
609
+ }
610
+
611
+ i_cp = StringValuePtr(cp);
612
+ i_lpara = ((lpara == Qnil)||(lpara == Qfalse)) ? FALSE_ : TRUE_;
613
+
614
+
615
+ gllset_(i_cp, &i_lpara, (ftnlen)strlen(i_cp));
616
+
617
+ return Qnil;
618
+
619
+ }
620
+
621
+ static VALUE
622
+ dcl_gllstx(obj, cp, lpara)
623
+ VALUE obj, cp, lpara;
624
+ {
625
+ char *i_cp;
626
+ logical i_lpara;
627
+
628
+ if (TYPE(cp) != T_STRING) {
629
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
630
+ }
631
+
632
+ i_cp = StringValuePtr(cp);
633
+ i_lpara = ((lpara == Qnil)||(lpara == Qfalse)) ? FALSE_ : TRUE_;
634
+
635
+
636
+ gllstx_(i_cp, &i_lpara, (ftnlen)strlen(i_cp));
637
+
638
+ return Qnil;
639
+
640
+ }
641
+
642
+ static VALUE
643
+ dcl_rpnenv(obj)
644
+ VALUE obj;
645
+ {
646
+ rpnenv_();
647
+
648
+ return Qnil;
649
+
650
+ }
651
+
652
+ static VALUE
653
+ dcl_rtienv(obj, cpfix, cp)
654
+ VALUE obj, cpfix, cp;
655
+ {
656
+ char *i_cpfix;
657
+ char *i_cp;
658
+ integer o_ipara;
659
+ VALUE ipara;
660
+
661
+ if (TYPE(cpfix) != T_STRING) {
662
+ cpfix = rb_funcall(cpfix, rb_intern("to_str"), 0);
663
+ }
664
+ if (TYPE(cp) != T_STRING) {
665
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
666
+ }
667
+
668
+ i_cpfix = StringValuePtr(cpfix);
669
+ i_cp = StringValuePtr(cp);
670
+
671
+
672
+ rtienv_(i_cpfix, i_cp, &o_ipara, (ftnlen)strlen(i_cpfix), (ftnlen)strlen(i_cp));
673
+
674
+ ipara = INT2NUM(o_ipara);
675
+
676
+
677
+ return ipara;
678
+
679
+ }
680
+
681
+ static VALUE
682
+ dcl_rtlenv(obj, cpfix, cp)
683
+ VALUE obj, cpfix, cp;
684
+ {
685
+ char *i_cpfix;
686
+ char *i_cp;
687
+ logical o_lpara;
688
+ VALUE lpara;
689
+
690
+ if (TYPE(cpfix) != T_STRING) {
691
+ cpfix = rb_funcall(cpfix, rb_intern("to_str"), 0);
692
+ }
693
+ if (TYPE(cp) != T_STRING) {
694
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
695
+ }
696
+
697
+ i_cpfix = StringValuePtr(cpfix);
698
+ i_cp = StringValuePtr(cp);
699
+
700
+
701
+ rtlenv_(i_cpfix, i_cp, &o_lpara, (ftnlen)strlen(i_cpfix), (ftnlen)strlen(i_cp));
702
+
703
+ lpara = (o_lpara == FALSE_) ? Qfalse : Qtrue;
704
+
705
+
706
+ return lpara;
707
+
708
+ }
709
+
710
+ static VALUE
711
+ dcl_rtrenv(obj, cpfix, cp)
712
+ VALUE obj, cpfix, cp;
713
+ {
714
+ char *i_cpfix;
715
+ char *i_cp;
716
+ real o_rpara;
717
+ VALUE rpara;
718
+
719
+ if (TYPE(cpfix) != T_STRING) {
720
+ cpfix = rb_funcall(cpfix, rb_intern("to_str"), 0);
721
+ }
722
+ if (TYPE(cp) != T_STRING) {
723
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
724
+ }
725
+
726
+ i_cpfix = StringValuePtr(cpfix);
727
+ i_cp = StringValuePtr(cp);
728
+
729
+
730
+ rtrenv_(i_cpfix, i_cp, &o_rpara, (ftnlen)strlen(i_cpfix), (ftnlen)strlen(i_cp));
731
+
732
+ rpara = rb_float_new((double)o_rpara);
733
+
734
+
735
+ return rpara;
736
+
737
+ }
738
+
739
+ static VALUE
740
+ dcl_rtcenv(obj, cpfix, cp)
741
+ VALUE obj, cpfix, cp;
742
+ {
743
+ char *i_cpfix;
744
+ char *i_cp;
745
+ char *o_cpara;
746
+ VALUE cpara;
747
+
748
+ if (TYPE(cpfix) != T_STRING) {
749
+ cpfix = rb_funcall(cpfix, rb_intern("to_str"), 0);
750
+ }
751
+ if (TYPE(cp) != T_STRING) {
752
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
753
+ }
754
+
755
+ i_cpfix = StringValuePtr(cpfix);
756
+ i_cp = StringValuePtr(cp);
757
+
758
+ o_cpara= ALLOCA_N(char, (DFLT_SIZE+1));
759
+ memset(o_cpara, '\0', DFLT_SIZE+1);
760
+
761
+ rtcenv_(i_cpfix, i_cp, o_cpara, (ftnlen)strlen(i_cpfix), (ftnlen)strlen(i_cp), (ftnlen)DFLT_SIZE);
762
+
763
+ cpara = rb_str_new2(o_cpara);
764
+
765
+
766
+ return cpara;
767
+
768
+ }
769
+
770
+ static VALUE
771
+ dcl_rlienv(obj, cp)
772
+ VALUE obj, cp;
773
+ {
774
+ char *i_cp;
775
+ integer o_ipara;
776
+ VALUE ipara;
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
+ rlienv_(i_cp, &o_ipara, (ftnlen)strlen(i_cp));
786
+
787
+ ipara = INT2NUM(o_ipara);
788
+
789
+
790
+ return ipara;
791
+
792
+ }
793
+
794
+ static VALUE
795
+ dcl_rllenv(obj, cp)
796
+ VALUE obj, cp;
797
+ {
798
+ char *i_cp;
799
+ logical o_lpara;
800
+ VALUE lpara;
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
+ rllenv_(i_cp, &o_lpara, (ftnlen)strlen(i_cp));
810
+
811
+ lpara = (o_lpara == FALSE_) ? Qfalse : Qtrue;
812
+
813
+
814
+ return lpara;
815
+
816
+ }
817
+
818
+ static VALUE
819
+ dcl_rlrenv(obj, cp)
820
+ VALUE obj, cp;
821
+ {
822
+ char *i_cp;
823
+ real o_rpara;
824
+ VALUE rpara;
825
+
826
+ if (TYPE(cp) != T_STRING) {
827
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
828
+ }
829
+
830
+ i_cp = StringValuePtr(cp);
831
+
832
+
833
+ rlrenv_(i_cp, &o_rpara, (ftnlen)strlen(i_cp));
834
+
835
+ rpara = rb_float_new((double)o_rpara);
836
+
837
+
838
+ return rpara;
839
+
840
+ }
841
+
842
+ static VALUE
843
+ dcl_rlcenv(obj, cp)
844
+ VALUE obj, cp;
845
+ {
846
+ char *i_cp;
847
+ char *o_cpara;
848
+ VALUE cpara;
849
+
850
+ if (TYPE(cp) != T_STRING) {
851
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
852
+ }
853
+
854
+ i_cp = StringValuePtr(cp);
855
+
856
+ o_cpara= ALLOCA_N(char, (DFLT_SIZE+1));
857
+ memset(o_cpara, '\0', DFLT_SIZE+1);
858
+
859
+ rlcenv_(i_cp, o_cpara, (ftnlen)strlen(i_cp), (ftnlen)DFLT_SIZE);
860
+
861
+ cpara = rb_str_new2(o_cpara);
862
+
863
+
864
+ return cpara;
865
+
866
+ }
867
+
868
+ static VALUE
869
+ dcl_glrget(obj, cp)
870
+ VALUE obj, cp;
871
+ {
872
+ char *i_cp;
873
+ real o_rpara;
874
+ VALUE rpara;
875
+
876
+ if (TYPE(cp) != T_STRING) {
877
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
878
+ }
879
+
880
+ i_cp = StringValuePtr(cp);
881
+
882
+
883
+ glrget_(i_cp, &o_rpara, (ftnlen)strlen(i_cp));
884
+
885
+ rpara = rb_float_new((double)o_rpara);
886
+
887
+
888
+ return rpara;
889
+
890
+ }
891
+
892
+ static VALUE
893
+ dcl_glrset(obj, cp, rpara)
894
+ VALUE obj, cp, rpara;
895
+ {
896
+ char *i_cp;
897
+ real i_rpara;
898
+
899
+ if (TYPE(cp) != T_STRING) {
900
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
901
+ }
902
+ if (TYPE(rpara) != T_FLOAT) {
903
+ rpara = rb_funcall(rpara, rb_intern("to_f"), 0);
904
+ }
905
+
906
+ i_cp = StringValuePtr(cp);
907
+ i_rpara = (real)NUM2DBL(rpara);
908
+
909
+
910
+ glrset_(i_cp, &i_rpara, (ftnlen)strlen(i_cp));
911
+
912
+ return Qnil;
913
+
914
+ }
915
+
916
+ static VALUE
917
+ dcl_glrstx(obj, cp, rpara)
918
+ VALUE obj, cp, rpara;
919
+ {
920
+ char *i_cp;
921
+ real i_rpara;
922
+
923
+ if (TYPE(cp) != T_STRING) {
924
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
925
+ }
926
+ if (TYPE(rpara) != T_FLOAT) {
927
+ rpara = rb_funcall(rpara, rb_intern("to_f"), 0);
928
+ }
929
+
930
+ i_cp = StringValuePtr(cp);
931
+ i_rpara = (real)NUM2DBL(rpara);
932
+
933
+
934
+ glrstx_(i_cp, &i_rpara, (ftnlen)strlen(i_cp));
935
+
936
+ return Qnil;
937
+
938
+ }
939
+
940
+ static VALUE
941
+ dcl_gllqnp(obj)
942
+ VALUE obj;
943
+ {
944
+ integer o_ncp;
945
+ VALUE ncp;
946
+
947
+ gllqnp_(&o_ncp);
948
+
949
+ ncp = INT2NUM(o_ncp);
950
+
951
+
952
+ return ncp;
953
+
954
+ }
955
+
956
+ static VALUE
957
+ dcl_gllqid(obj, cp)
958
+ VALUE obj, cp;
959
+ {
960
+ char *i_cp;
961
+ integer o_idx;
962
+ VALUE idx;
963
+
964
+ if (TYPE(cp) != T_STRING) {
965
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
966
+ }
967
+
968
+ i_cp = StringValuePtr(cp);
969
+
970
+
971
+ gllqid_(i_cp, &o_idx, (ftnlen)strlen(i_cp));
972
+
973
+ idx = INT2NUM(o_idx);
974
+
975
+
976
+ return idx;
977
+
978
+ }
979
+
980
+ static VALUE
981
+ dcl_gllqcp(obj, idx)
982
+ VALUE obj, idx;
983
+ {
984
+ integer i_idx;
985
+ char *o_cp;
986
+ VALUE cp;
987
+
988
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
989
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
990
+ }
991
+
992
+ i_idx = NUM2INT(idx);
993
+
994
+ o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
995
+ memset(o_cp, '\0', DFLT_SIZE+1);
996
+
997
+ gllqcp_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
998
+
999
+ cp = rb_str_new2(o_cp);
1000
+
1001
+
1002
+ return cp;
1003
+
1004
+ }
1005
+
1006
+ static VALUE
1007
+ dcl_gllqcl(obj, idx)
1008
+ VALUE obj, idx;
1009
+ {
1010
+ integer i_idx;
1011
+ char *o_cp;
1012
+ VALUE cp;
1013
+
1014
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
1015
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
1016
+ }
1017
+
1018
+ i_idx = NUM2INT(idx);
1019
+
1020
+ o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
1021
+ memset(o_cp, '\0', DFLT_SIZE+1);
1022
+
1023
+ gllqcl_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
1024
+
1025
+ cp = rb_str_new2(o_cp);
1026
+
1027
+
1028
+ return cp;
1029
+
1030
+ }
1031
+
1032
+ static VALUE
1033
+ dcl_gllqvl(obj, idx)
1034
+ VALUE obj, idx;
1035
+ {
1036
+ integer i_idx;
1037
+ logical o_lpara;
1038
+ VALUE lpara;
1039
+
1040
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
1041
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
1042
+ }
1043
+
1044
+ i_idx = NUM2INT(idx);
1045
+
1046
+
1047
+ gllqvl_(&i_idx, &o_lpara);
1048
+
1049
+ lpara = (o_lpara == FALSE_) ? Qfalse : Qtrue;
1050
+
1051
+
1052
+ return lpara;
1053
+
1054
+ }
1055
+
1056
+ static VALUE
1057
+ dcl_gllsvl(obj, idx, lpara)
1058
+ VALUE obj, idx, lpara;
1059
+ {
1060
+ integer i_idx;
1061
+ logical i_lpara;
1062
+
1063
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
1064
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
1065
+ }
1066
+
1067
+ i_idx = NUM2INT(idx);
1068
+ i_lpara = ((lpara == Qnil)||(lpara == Qfalse)) ? FALSE_ : TRUE_;
1069
+
1070
+
1071
+ gllsvl_(&i_idx, &i_lpara);
1072
+
1073
+ return Qnil;
1074
+
1075
+ }
1076
+
1077
+ static VALUE
1078
+ dcl_gllqin(obj, cp)
1079
+ VALUE obj, cp;
1080
+ {
1081
+ char *i_cp;
1082
+ integer o_in;
1083
+ VALUE in;
1084
+
1085
+ if (TYPE(cp) != T_STRING) {
1086
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1087
+ }
1088
+
1089
+ i_cp = StringValuePtr(cp);
1090
+
1091
+
1092
+ gllqin_(i_cp, &o_in, (ftnlen)strlen(i_cp));
1093
+
1094
+ in = INT2NUM(o_in);
1095
+
1096
+
1097
+ return in;
1098
+
1099
+ }
1100
+
1101
+ static VALUE
1102
+ dcl_rpnget(obj)
1103
+ VALUE obj;
1104
+ {
1105
+ rpnget_();
1106
+
1107
+ return Qnil;
1108
+
1109
+ }
1110
+
1111
+ static VALUE
1112
+ dcl_rtiget(obj, cpfix, cps, max)
1113
+ VALUE obj, cpfix, cps, max;
1114
+ {
1115
+ char *i_cpfix;
1116
+ char *i_cps;
1117
+ integer *o_ipara;
1118
+ integer i_max;
1119
+ VALUE ipara;
1120
+
1121
+ if (TYPE(cpfix) != T_STRING) {
1122
+ cpfix = rb_funcall(cpfix, rb_intern("to_str"), 0);
1123
+ }
1124
+ if (TYPE(cps) == T_STRING) {
1125
+ cps = rb_Array(cps);
1126
+ }
1127
+ if (TYPE(cps) != T_ARRAY) {
1128
+ rb_raise(rb_eTypeError, "invalid type");
1129
+ }
1130
+ if ((TYPE(max) != T_BIGNUM) || (TYPE(max) != T_FIXNUM)) {
1131
+ max = rb_funcall(max, rb_intern("to_i"), 0);
1132
+ }
1133
+
1134
+ i_cpfix = StringValuePtr(cpfix);
1135
+ i_max = NUM2INT(max);
1136
+ i_cps = dcl_obj2ccharary(cps, (i_max*8), 8);
1137
+
1138
+ o_ipara= ALLOCA_N(integer, (i_max));
1139
+
1140
+ rtiget_(i_cpfix, i_cps, o_ipara, &i_max, (ftnlen)strlen(i_cpfix), (ftnlen)8);
1141
+
1142
+ {int array_shape[1] = {i_max};
1143
+ ipara = dcl_cintegerary2obj(o_ipara, (i_max), 1, array_shape);
1144
+ }
1145
+
1146
+ dcl_freeccharary(i_cps);
1147
+
1148
+ return ipara;
1149
+
1150
+ }
1151
+
1152
+ static VALUE
1153
+ dcl_rtlget(obj, cpfix, cps, max)
1154
+ VALUE obj, cpfix, cps, max;
1155
+ {
1156
+ char *i_cpfix;
1157
+ char *i_cps;
1158
+ logical *o_lpara;
1159
+ integer i_max;
1160
+ VALUE lpara;
1161
+
1162
+ if (TYPE(cpfix) != T_STRING) {
1163
+ cpfix = rb_funcall(cpfix, rb_intern("to_str"), 0);
1164
+ }
1165
+ if (TYPE(cps) == T_STRING) {
1166
+ cps = rb_Array(cps);
1167
+ }
1168
+ if (TYPE(cps) != T_ARRAY) {
1169
+ rb_raise(rb_eTypeError, "invalid type");
1170
+ }
1171
+ if ((TYPE(max) != T_BIGNUM) || (TYPE(max) != T_FIXNUM)) {
1172
+ max = rb_funcall(max, rb_intern("to_i"), 0);
1173
+ }
1174
+
1175
+ i_cpfix = StringValuePtr(cpfix);
1176
+ i_max = NUM2INT(max);
1177
+ i_cps = dcl_obj2ccharary(cps, (i_max*8), 8);
1178
+
1179
+ o_lpara= ALLOCA_N(logical, (i_max));
1180
+
1181
+ rtlget_(i_cpfix, i_cps, o_lpara, &i_max, (ftnlen)strlen(i_cpfix), (ftnlen)8);
1182
+
1183
+ {int array_shape[1] = {i_max};
1184
+ lpara = dcl_clogicalary2obj(o_lpara, (i_max), 1, array_shape);
1185
+ }
1186
+
1187
+ dcl_freeccharary(i_cps);
1188
+
1189
+ return lpara;
1190
+
1191
+ }
1192
+
1193
+ static VALUE
1194
+ dcl_rtrget(obj, cpfix, cps, max)
1195
+ VALUE obj, cpfix, cps, max;
1196
+ {
1197
+ char *i_cpfix;
1198
+ char *i_cps;
1199
+ real *o_rpara;
1200
+ integer i_max;
1201
+ VALUE rpara;
1202
+
1203
+ if (TYPE(cpfix) != T_STRING) {
1204
+ cpfix = rb_funcall(cpfix, rb_intern("to_str"), 0);
1205
+ }
1206
+ if (TYPE(cps) == T_STRING) {
1207
+ cps = rb_Array(cps);
1208
+ }
1209
+ if (TYPE(cps) != T_ARRAY) {
1210
+ rb_raise(rb_eTypeError, "invalid type");
1211
+ }
1212
+ if ((TYPE(max) != T_BIGNUM) || (TYPE(max) != T_FIXNUM)) {
1213
+ max = rb_funcall(max, rb_intern("to_i"), 0);
1214
+ }
1215
+
1216
+ i_cpfix = StringValuePtr(cpfix);
1217
+ i_max = NUM2INT(max);
1218
+ i_cps = dcl_obj2ccharary(cps, (i_max*8), 8);
1219
+
1220
+ o_rpara= ALLOCA_N(real, (i_max));
1221
+
1222
+ rtrget_(i_cpfix, i_cps, o_rpara, &i_max, (ftnlen)strlen(i_cpfix), (ftnlen)8);
1223
+
1224
+ {int array_shape[1] = {i_max};
1225
+ rpara = dcl_crealary2obj(o_rpara, (i_max), 1, array_shape);
1226
+ }
1227
+
1228
+ dcl_freeccharary(i_cps);
1229
+
1230
+ return rpara;
1231
+
1232
+ }
1233
+
1234
+ static VALUE
1235
+ dcl_rtcget(obj, cpfix, cps, max)
1236
+ VALUE obj, cpfix, cps, max;
1237
+ {
1238
+ char *i_cpfix;
1239
+ char *i_cps;
1240
+ char *o_cpara;
1241
+ integer i_max;
1242
+ VALUE cpara;
1243
+
1244
+ if (TYPE(cpfix) != T_STRING) {
1245
+ cpfix = rb_funcall(cpfix, rb_intern("to_str"), 0);
1246
+ }
1247
+ if (TYPE(cps) == T_STRING) {
1248
+ cps = rb_Array(cps);
1249
+ }
1250
+ if (TYPE(cps) != T_ARRAY) {
1251
+ rb_raise(rb_eTypeError, "invalid type");
1252
+ }
1253
+ if ((TYPE(max) != T_BIGNUM) || (TYPE(max) != T_FIXNUM)) {
1254
+ max = rb_funcall(max, rb_intern("to_i"), 0);
1255
+ }
1256
+
1257
+ i_cpfix = StringValuePtr(cpfix);
1258
+ i_max = NUM2INT(max);
1259
+ i_cps = dcl_obj2ccharary(cps, (i_max*8), 8);
1260
+
1261
+ o_cpara= ALLOCA_N(char, (i_max*80));
1262
+ memset(o_cpara, '\0', (i_max*80));
1263
+
1264
+ rtcget_(i_cpfix, i_cps, o_cpara, &i_max, (ftnlen)strlen(i_cpfix), (ftnlen)8, (ftnlen)80);
1265
+
1266
+ cpara = dcl_ccharary2obj(o_cpara, (i_max*80), 80);
1267
+
1268
+ dcl_freeccharary(i_cps);
1269
+
1270
+ return cpara;
1271
+
1272
+ }
1273
+
1274
+ static VALUE
1275
+ dcl_rliget(obj, cpl, max)
1276
+ VALUE obj, cpl, max;
1277
+ {
1278
+ char *i_cpl;
1279
+ integer *o_ipara;
1280
+ integer i_max;
1281
+ VALUE ipara;
1282
+
1283
+ if (TYPE(cpl) == T_STRING) {
1284
+ cpl = rb_Array(cpl);
1285
+ }
1286
+ if (TYPE(cpl) != T_ARRAY) {
1287
+ rb_raise(rb_eTypeError, "invalid type");
1288
+ }
1289
+ if ((TYPE(max) != T_BIGNUM) || (TYPE(max) != T_FIXNUM)) {
1290
+ max = rb_funcall(max, rb_intern("to_i"), 0);
1291
+ }
1292
+
1293
+ i_max = NUM2INT(max);
1294
+ i_cpl = dcl_obj2ccharary(cpl, (i_max*40), 40);
1295
+
1296
+ o_ipara= ALLOCA_N(integer, (i_max));
1297
+
1298
+ rliget_(i_cpl, o_ipara, &i_max, (ftnlen)40);
1299
+
1300
+ {int array_shape[1] = {i_max};
1301
+ ipara = dcl_cintegerary2obj(o_ipara, (i_max), 1, array_shape);
1302
+ }
1303
+
1304
+ dcl_freeccharary(i_cpl);
1305
+
1306
+ return ipara;
1307
+
1308
+ }
1309
+
1310
+ static VALUE
1311
+ dcl_rllget(obj, cpl, max)
1312
+ VALUE obj, cpl, max;
1313
+ {
1314
+ char *i_cpl;
1315
+ logical *o_lpara;
1316
+ integer i_max;
1317
+ VALUE lpara;
1318
+
1319
+ if (TYPE(cpl) == T_STRING) {
1320
+ cpl = rb_Array(cpl);
1321
+ }
1322
+ if (TYPE(cpl) != T_ARRAY) {
1323
+ rb_raise(rb_eTypeError, "invalid type");
1324
+ }
1325
+ if ((TYPE(max) != T_BIGNUM) || (TYPE(max) != T_FIXNUM)) {
1326
+ max = rb_funcall(max, rb_intern("to_i"), 0);
1327
+ }
1328
+
1329
+ i_max = NUM2INT(max);
1330
+ i_cpl = dcl_obj2ccharary(cpl, (i_max*40), 40);
1331
+
1332
+ o_lpara= ALLOCA_N(logical, (i_max));
1333
+
1334
+ rllget_(i_cpl, o_lpara, &i_max, (ftnlen)40);
1335
+
1336
+ {int array_shape[1] = {i_max};
1337
+ lpara = dcl_clogicalary2obj(o_lpara, (i_max), 1, array_shape);
1338
+ }
1339
+
1340
+ dcl_freeccharary(i_cpl);
1341
+
1342
+ return lpara;
1343
+
1344
+ }
1345
+
1346
+ static VALUE
1347
+ dcl_rlrget(obj, cpl, max)
1348
+ VALUE obj, cpl, max;
1349
+ {
1350
+ char *i_cpl;
1351
+ real *o_rpara;
1352
+ integer i_max;
1353
+ VALUE rpara;
1354
+
1355
+ if (TYPE(cpl) == T_STRING) {
1356
+ cpl = rb_Array(cpl);
1357
+ }
1358
+ if (TYPE(cpl) != T_ARRAY) {
1359
+ rb_raise(rb_eTypeError, "invalid type");
1360
+ }
1361
+ if ((TYPE(max) != T_BIGNUM) || (TYPE(max) != T_FIXNUM)) {
1362
+ max = rb_funcall(max, rb_intern("to_i"), 0);
1363
+ }
1364
+
1365
+ i_max = NUM2INT(max);
1366
+ i_cpl = dcl_obj2ccharary(cpl, (i_max*40), 40);
1367
+
1368
+ o_rpara= ALLOCA_N(real, (i_max));
1369
+
1370
+ rlrget_(i_cpl, o_rpara, &i_max, (ftnlen)40);
1371
+
1372
+ {int array_shape[1] = {i_max};
1373
+ rpara = dcl_crealary2obj(o_rpara, (i_max), 1, array_shape);
1374
+ }
1375
+
1376
+ dcl_freeccharary(i_cpl);
1377
+
1378
+ return rpara;
1379
+
1380
+ }
1381
+
1382
+ static VALUE
1383
+ dcl_rlcget(obj, cpl, max)
1384
+ VALUE obj, cpl, max;
1385
+ {
1386
+ char *i_cpl;
1387
+ char *o_cpara;
1388
+ integer i_max;
1389
+ VALUE cpara;
1390
+
1391
+ if (TYPE(cpl) == T_STRING) {
1392
+ cpl = rb_Array(cpl);
1393
+ }
1394
+ if (TYPE(cpl) != T_ARRAY) {
1395
+ rb_raise(rb_eTypeError, "invalid type");
1396
+ }
1397
+ if ((TYPE(max) != T_BIGNUM) || (TYPE(max) != T_FIXNUM)) {
1398
+ max = rb_funcall(max, rb_intern("to_i"), 0);
1399
+ }
1400
+
1401
+ i_max = NUM2INT(max);
1402
+ i_cpl = dcl_obj2ccharary(cpl, (i_max*40), 40);
1403
+
1404
+ o_cpara= ALLOCA_N(char, (i_max*80));
1405
+ memset(o_cpara, '\0', (i_max*80));
1406
+
1407
+ rlcget_(i_cpl, o_cpara, &i_max, (ftnlen)40, (ftnlen)80);
1408
+
1409
+ cpara = dcl_ccharary2obj(o_cpara, (i_max*80), 80);
1410
+
1411
+ dcl_freeccharary(i_cpl);
1412
+
1413
+ return cpara;
1414
+
1415
+ }
1416
+
1417
+ static VALUE
1418
+ dcl_rpnopt(obj)
1419
+ VALUE obj;
1420
+ {
1421
+ rpnopt_();
1422
+
1423
+ return Qnil;
1424
+
1425
+ }
1426
+
1427
+ static VALUE
1428
+ dcl_rtiopt(obj, cpfix, cp)
1429
+ VALUE obj, cpfix, cp;
1430
+ {
1431
+ char *i_cpfix;
1432
+ char *i_cp;
1433
+ integer o_ipara;
1434
+ VALUE ipara;
1435
+
1436
+ if (TYPE(cpfix) != T_STRING) {
1437
+ cpfix = rb_funcall(cpfix, rb_intern("to_str"), 0);
1438
+ }
1439
+ if (TYPE(cp) != T_STRING) {
1440
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1441
+ }
1442
+
1443
+ i_cpfix = StringValuePtr(cpfix);
1444
+ i_cp = StringValuePtr(cp);
1445
+
1446
+
1447
+ rtiopt_(i_cpfix, i_cp, &o_ipara, (ftnlen)strlen(i_cpfix), (ftnlen)strlen(i_cp));
1448
+
1449
+ ipara = INT2NUM(o_ipara);
1450
+
1451
+
1452
+ return ipara;
1453
+
1454
+ }
1455
+
1456
+ static VALUE
1457
+ dcl_rtlopt(obj, cpfix, cp)
1458
+ VALUE obj, cpfix, cp;
1459
+ {
1460
+ char *i_cpfix;
1461
+ char *i_cp;
1462
+ logical o_lpara;
1463
+ VALUE lpara;
1464
+
1465
+ if (TYPE(cpfix) != T_STRING) {
1466
+ cpfix = rb_funcall(cpfix, rb_intern("to_str"), 0);
1467
+ }
1468
+ if (TYPE(cp) != T_STRING) {
1469
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1470
+ }
1471
+
1472
+ i_cpfix = StringValuePtr(cpfix);
1473
+ i_cp = StringValuePtr(cp);
1474
+
1475
+
1476
+ rtlopt_(i_cpfix, i_cp, &o_lpara, (ftnlen)strlen(i_cpfix), (ftnlen)strlen(i_cp));
1477
+
1478
+ lpara = (o_lpara == FALSE_) ? Qfalse : Qtrue;
1479
+
1480
+
1481
+ return lpara;
1482
+
1483
+ }
1484
+
1485
+ static VALUE
1486
+ dcl_rtropt(obj, cpfix, cp)
1487
+ VALUE obj, cpfix, cp;
1488
+ {
1489
+ char *i_cpfix;
1490
+ char *i_cp;
1491
+ real o_rpara;
1492
+ VALUE rpara;
1493
+
1494
+ if (TYPE(cpfix) != T_STRING) {
1495
+ cpfix = rb_funcall(cpfix, rb_intern("to_str"), 0);
1496
+ }
1497
+ if (TYPE(cp) != T_STRING) {
1498
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1499
+ }
1500
+
1501
+ i_cpfix = StringValuePtr(cpfix);
1502
+ i_cp = StringValuePtr(cp);
1503
+
1504
+
1505
+ rtropt_(i_cpfix, i_cp, &o_rpara, (ftnlen)strlen(i_cpfix), (ftnlen)strlen(i_cp));
1506
+
1507
+ rpara = rb_float_new((double)o_rpara);
1508
+
1509
+
1510
+ return rpara;
1511
+
1512
+ }
1513
+
1514
+ static VALUE
1515
+ dcl_rtcopt(obj, cpfix, cp)
1516
+ VALUE obj, cpfix, cp;
1517
+ {
1518
+ char *i_cpfix;
1519
+ char *i_cp;
1520
+ char *o_cpara;
1521
+ VALUE cpara;
1522
+
1523
+ if (TYPE(cpfix) != T_STRING) {
1524
+ cpfix = rb_funcall(cpfix, rb_intern("to_str"), 0);
1525
+ }
1526
+ if (TYPE(cp) != T_STRING) {
1527
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1528
+ }
1529
+
1530
+ i_cpfix = StringValuePtr(cpfix);
1531
+ i_cp = StringValuePtr(cp);
1532
+
1533
+ o_cpara= ALLOCA_N(char, (DFLT_SIZE+1));
1534
+ memset(o_cpara, '\0', DFLT_SIZE+1);
1535
+
1536
+ rtcopt_(i_cpfix, i_cp, o_cpara, (ftnlen)strlen(i_cpfix), (ftnlen)strlen(i_cp), (ftnlen)DFLT_SIZE);
1537
+
1538
+ cpara = rb_str_new2(o_cpara);
1539
+
1540
+
1541
+ return cpara;
1542
+
1543
+ }
1544
+
1545
+ static VALUE
1546
+ dcl_rliopt(obj, cp)
1547
+ VALUE obj, cp;
1548
+ {
1549
+ char *i_cp;
1550
+ integer o_ipara;
1551
+ VALUE ipara;
1552
+
1553
+ if (TYPE(cp) != T_STRING) {
1554
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1555
+ }
1556
+
1557
+ i_cp = StringValuePtr(cp);
1558
+
1559
+
1560
+ rliopt_(i_cp, &o_ipara, (ftnlen)strlen(i_cp));
1561
+
1562
+ ipara = INT2NUM(o_ipara);
1563
+
1564
+
1565
+ return ipara;
1566
+
1567
+ }
1568
+
1569
+ static VALUE
1570
+ dcl_rllopt(obj, cp)
1571
+ VALUE obj, cp;
1572
+ {
1573
+ char *i_cp;
1574
+ logical o_lpara;
1575
+ VALUE lpara;
1576
+
1577
+ if (TYPE(cp) != T_STRING) {
1578
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1579
+ }
1580
+
1581
+ i_cp = StringValuePtr(cp);
1582
+
1583
+
1584
+ rllopt_(i_cp, &o_lpara, (ftnlen)strlen(i_cp));
1585
+
1586
+ lpara = (o_lpara == FALSE_) ? Qfalse : Qtrue;
1587
+
1588
+
1589
+ return lpara;
1590
+
1591
+ }
1592
+
1593
+ static VALUE
1594
+ dcl_rlropt(obj, cp)
1595
+ VALUE obj, cp;
1596
+ {
1597
+ char *i_cp;
1598
+ real o_rpara;
1599
+ VALUE rpara;
1600
+
1601
+ if (TYPE(cp) != T_STRING) {
1602
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1603
+ }
1604
+
1605
+ i_cp = StringValuePtr(cp);
1606
+
1607
+
1608
+ rlropt_(i_cp, &o_rpara, (ftnlen)strlen(i_cp));
1609
+
1610
+ rpara = rb_float_new((double)o_rpara);
1611
+
1612
+
1613
+ return rpara;
1614
+
1615
+ }
1616
+
1617
+ static VALUE
1618
+ dcl_rlcopt(obj, cp)
1619
+ VALUE obj, cp;
1620
+ {
1621
+ char *i_cp;
1622
+ char *o_cpara;
1623
+ VALUE cpara;
1624
+
1625
+ if (TYPE(cp) != T_STRING) {
1626
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1627
+ }
1628
+
1629
+ i_cp = StringValuePtr(cp);
1630
+
1631
+ o_cpara= ALLOCA_N(char, (DFLT_SIZE+1));
1632
+ memset(o_cpara, '\0', DFLT_SIZE+1);
1633
+
1634
+ rlcopt_(i_cp, o_cpara, (ftnlen)strlen(i_cp), (ftnlen)DFLT_SIZE);
1635
+
1636
+ cpara = rb_str_new2(o_cpara);
1637
+
1638
+
1639
+ return cpara;
1640
+
1641
+ }
1642
+
1643
+ static VALUE
1644
+ dcl_rpnxfl(obj)
1645
+ VALUE obj;
1646
+ {
1647
+ rpnxfl_();
1648
+
1649
+ return Qnil;
1650
+
1651
+ }
1652
+
1653
+ static VALUE
1654
+ dcl_rtixfl(obj, cpfix, cp)
1655
+ VALUE obj, cpfix, cp;
1656
+ {
1657
+ char *i_cpfix;
1658
+ char *i_cp;
1659
+ integer o_ipara;
1660
+ VALUE ipara;
1661
+
1662
+ if (TYPE(cpfix) != T_STRING) {
1663
+ cpfix = rb_funcall(cpfix, rb_intern("to_str"), 0);
1664
+ }
1665
+ if (TYPE(cp) != T_STRING) {
1666
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1667
+ }
1668
+
1669
+ i_cpfix = StringValuePtr(cpfix);
1670
+ i_cp = StringValuePtr(cp);
1671
+
1672
+
1673
+ rtixfl_(i_cpfix, i_cp, &o_ipara, (ftnlen)strlen(i_cpfix), (ftnlen)strlen(i_cp));
1674
+
1675
+ ipara = INT2NUM(o_ipara);
1676
+
1677
+
1678
+ return ipara;
1679
+
1680
+ }
1681
+
1682
+ static VALUE
1683
+ dcl_rtlxfl(obj, cpfix, cp)
1684
+ VALUE obj, cpfix, cp;
1685
+ {
1686
+ char *i_cpfix;
1687
+ char *i_cp;
1688
+ logical o_lpara;
1689
+ VALUE lpara;
1690
+
1691
+ if (TYPE(cpfix) != T_STRING) {
1692
+ cpfix = rb_funcall(cpfix, rb_intern("to_str"), 0);
1693
+ }
1694
+ if (TYPE(cp) != T_STRING) {
1695
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1696
+ }
1697
+
1698
+ i_cpfix = StringValuePtr(cpfix);
1699
+ i_cp = StringValuePtr(cp);
1700
+
1701
+
1702
+ rtlxfl_(i_cpfix, i_cp, &o_lpara, (ftnlen)strlen(i_cpfix), (ftnlen)strlen(i_cp));
1703
+
1704
+ lpara = (o_lpara == FALSE_) ? Qfalse : Qtrue;
1705
+
1706
+
1707
+ return lpara;
1708
+
1709
+ }
1710
+
1711
+ static VALUE
1712
+ dcl_rtrxfl(obj, cpfix, cp)
1713
+ VALUE obj, cpfix, cp;
1714
+ {
1715
+ char *i_cpfix;
1716
+ char *i_cp;
1717
+ real o_rpara;
1718
+ VALUE rpara;
1719
+
1720
+ if (TYPE(cpfix) != T_STRING) {
1721
+ cpfix = rb_funcall(cpfix, rb_intern("to_str"), 0);
1722
+ }
1723
+ if (TYPE(cp) != T_STRING) {
1724
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1725
+ }
1726
+
1727
+ i_cpfix = StringValuePtr(cpfix);
1728
+ i_cp = StringValuePtr(cp);
1729
+
1730
+
1731
+ rtrxfl_(i_cpfix, i_cp, &o_rpara, (ftnlen)strlen(i_cpfix), (ftnlen)strlen(i_cp));
1732
+
1733
+ rpara = rb_float_new((double)o_rpara);
1734
+
1735
+
1736
+ return rpara;
1737
+
1738
+ }
1739
+
1740
+ static VALUE
1741
+ dcl_rtcxfl(obj, cpfix, cp)
1742
+ VALUE obj, cpfix, cp;
1743
+ {
1744
+ char *i_cpfix;
1745
+ char *i_cp;
1746
+ char *o_cval;
1747
+ VALUE cval;
1748
+
1749
+ if (TYPE(cpfix) != T_STRING) {
1750
+ cpfix = rb_funcall(cpfix, rb_intern("to_str"), 0);
1751
+ }
1752
+ if (TYPE(cp) != T_STRING) {
1753
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1754
+ }
1755
+
1756
+ i_cpfix = StringValuePtr(cpfix);
1757
+ i_cp = StringValuePtr(cp);
1758
+
1759
+ o_cval= ALLOCA_N(char, (DFLT_SIZE+1));
1760
+ memset(o_cval, '\0', DFLT_SIZE+1);
1761
+
1762
+ rtcxfl_(i_cpfix, i_cp, o_cval, (ftnlen)strlen(i_cpfix), (ftnlen)strlen(i_cp), (ftnlen)DFLT_SIZE);
1763
+
1764
+ cval = rb_str_new2(o_cval);
1765
+
1766
+
1767
+ return cval;
1768
+
1769
+ }
1770
+
1771
+ static VALUE
1772
+ dcl_rlixfl(obj, cp)
1773
+ VALUE obj, cp;
1774
+ {
1775
+ char *i_cp;
1776
+ integer o_ipara;
1777
+ VALUE ipara;
1778
+
1779
+ if (TYPE(cp) != T_STRING) {
1780
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1781
+ }
1782
+
1783
+ i_cp = StringValuePtr(cp);
1784
+
1785
+
1786
+ rlixfl_(i_cp, &o_ipara, (ftnlen)strlen(i_cp));
1787
+
1788
+ ipara = INT2NUM(o_ipara);
1789
+
1790
+
1791
+ return ipara;
1792
+
1793
+ }
1794
+
1795
+ static VALUE
1796
+ dcl_rllxfl(obj, cp)
1797
+ VALUE obj, cp;
1798
+ {
1799
+ char *i_cp;
1800
+ logical o_lpara;
1801
+ VALUE lpara;
1802
+
1803
+ if (TYPE(cp) != T_STRING) {
1804
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1805
+ }
1806
+
1807
+ i_cp = StringValuePtr(cp);
1808
+
1809
+
1810
+ rllxfl_(i_cp, &o_lpara, (ftnlen)strlen(i_cp));
1811
+
1812
+ lpara = (o_lpara == FALSE_) ? Qfalse : Qtrue;
1813
+
1814
+
1815
+ return lpara;
1816
+
1817
+ }
1818
+
1819
+ static VALUE
1820
+ dcl_rlrxfl(obj, cp)
1821
+ VALUE obj, cp;
1822
+ {
1823
+ char *i_cp;
1824
+ real o_rpara;
1825
+ VALUE rpara;
1826
+
1827
+ if (TYPE(cp) != T_STRING) {
1828
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1829
+ }
1830
+
1831
+ i_cp = StringValuePtr(cp);
1832
+
1833
+
1834
+ rlrxfl_(i_cp, &o_rpara, (ftnlen)strlen(i_cp));
1835
+
1836
+ rpara = rb_float_new((double)o_rpara);
1837
+
1838
+
1839
+ return rpara;
1840
+
1841
+ }
1842
+
1843
+ static VALUE
1844
+ dcl_rlcxfl(obj, cp)
1845
+ VALUE obj, cp;
1846
+ {
1847
+ char *i_cp;
1848
+ char *o_cval;
1849
+ VALUE cval;
1850
+
1851
+ if (TYPE(cp) != T_STRING) {
1852
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1853
+ }
1854
+
1855
+ i_cp = StringValuePtr(cp);
1856
+
1857
+ o_cval= ALLOCA_N(char, (DFLT_SIZE+1));
1858
+ memset(o_cval, '\0', DFLT_SIZE+1);
1859
+
1860
+ rlcxfl_(i_cp, o_cval, (ftnlen)strlen(i_cp), (ftnlen)DFLT_SIZE);
1861
+
1862
+ cval = rb_str_new2(o_cval);
1863
+
1864
+
1865
+ return cval;
1866
+
1867
+ }
1868
+
1869
+ static VALUE
1870
+ dcl_prcopn(obj, cproc)
1871
+ VALUE obj, cproc;
1872
+ {
1873
+ char *i_cproc;
1874
+
1875
+ if (TYPE(cproc) != T_STRING) {
1876
+ cproc = rb_funcall(cproc, rb_intern("to_str"), 0);
1877
+ }
1878
+
1879
+ i_cproc = StringValuePtr(cproc);
1880
+
1881
+
1882
+ prcopn_(i_cproc, (ftnlen)strlen(i_cproc));
1883
+
1884
+ return Qnil;
1885
+
1886
+ }
1887
+
1888
+ static VALUE
1889
+ dcl_prccls(obj, cproc)
1890
+ VALUE obj, cproc;
1891
+ {
1892
+ char *i_cproc;
1893
+
1894
+ if (TYPE(cproc) != T_STRING) {
1895
+ cproc = rb_funcall(cproc, rb_intern("to_str"), 0);
1896
+ }
1897
+
1898
+ i_cproc = StringValuePtr(cproc);
1899
+
1900
+
1901
+ prccls_(i_cproc, (ftnlen)strlen(i_cproc));
1902
+
1903
+ return Qnil;
1904
+
1905
+ }
1906
+
1907
+ static VALUE
1908
+ dcl_prclvl(obj)
1909
+ VALUE obj;
1910
+ {
1911
+ integer o_nlev;
1912
+ VALUE nlev;
1913
+
1914
+ prclvl_(&o_nlev);
1915
+
1916
+ nlev = INT2NUM(o_nlev);
1917
+
1918
+
1919
+ return nlev;
1920
+
1921
+ }
1922
+
1923
+ static VALUE
1924
+ dcl_prcnam(obj, nlev)
1925
+ VALUE obj, nlev;
1926
+ {
1927
+ integer i_nlev;
1928
+ char *o_cproc;
1929
+ VALUE cproc;
1930
+
1931
+ if ((TYPE(nlev) != T_BIGNUM) || (TYPE(nlev) != T_FIXNUM)) {
1932
+ nlev = rb_funcall(nlev, rb_intern("to_i"), 0);
1933
+ }
1934
+
1935
+ i_nlev = NUM2INT(nlev);
1936
+
1937
+ o_cproc= ALLOCA_N(char, (DFLT_SIZE+1));
1938
+ memset(o_cproc, '\0', DFLT_SIZE+1);
1939
+
1940
+ prcnam_(&i_nlev, o_cproc, (ftnlen)DFLT_SIZE);
1941
+
1942
+ cproc = rb_str_new2(o_cproc);
1943
+
1944
+
1945
+ return cproc;
1946
+
1947
+ }
1948
+ void
1949
+ init_math1_syslib(mDCL)
1950
+ VALUE mDCL;
1951
+ {
1952
+ rb_define_module_function(mDCL, "lchreq", dcl_lchreq, 2);
1953
+ rb_define_module_function(mDCL, "msgdmp", dcl_msgdmp, 3);
1954
+ rb_define_module_function(mDCL, "mszdmp", dcl_mszdmp, 3);
1955
+ rb_define_module_function(mDCL, "glcget", dcl_glcget, 1);
1956
+ rb_define_module_function(mDCL, "glcset", dcl_glcset, 2);
1957
+ rb_define_module_function(mDCL, "glcstx", dcl_glcstx, 2);
1958
+ rb_define_module_function(mDCL, "glqfnm", dcl_glqfnm, 1);
1959
+ rb_define_module_function(mDCL, "iufopn", dcl_iufopn, 0);
1960
+ rb_define_module_function(mDCL, "cfsrch", dcl_cfsrch, 4);
1961
+ rb_define_module_function(mDCL, "glpqnp", dcl_glpqnp, 0);
1962
+ rb_define_module_function(mDCL, "glpqid", dcl_glpqid, 1);
1963
+ rb_define_module_function(mDCL, "glpqcp", dcl_glpqcp, 1);
1964
+ rb_define_module_function(mDCL, "glpqcl", dcl_glpqcl, 1);
1965
+ rb_define_module_function(mDCL, "glpqit", dcl_glpqit, 1);
1966
+ rb_define_module_function(mDCL, "glpqvl", dcl_glpqvl, 1);
1967
+ rb_define_module_function(mDCL, "glpsvl", dcl_glpsvl, 2);
1968
+ rb_define_module_function(mDCL, "glpqin", dcl_glpqin, 1);
1969
+ rb_define_module_function(mDCL, "gliget", dcl_gliget, 1);
1970
+ rb_define_module_function(mDCL, "gliset", dcl_gliset, 2);
1971
+ rb_define_module_function(mDCL, "glistx", dcl_glistx, 2);
1972
+ rb_define_module_function(mDCL, "gllget", dcl_gllget, 1);
1973
+ rb_define_module_function(mDCL, "gllset", dcl_gllset, 2);
1974
+ rb_define_module_function(mDCL, "gllstx", dcl_gllstx, 2);
1975
+ rb_define_module_function(mDCL, "rpnenv", dcl_rpnenv, 0);
1976
+ rb_define_module_function(mDCL, "rtienv", dcl_rtienv, 2);
1977
+ rb_define_module_function(mDCL, "rtlenv", dcl_rtlenv, 2);
1978
+ rb_define_module_function(mDCL, "rtrenv", dcl_rtrenv, 2);
1979
+ rb_define_module_function(mDCL, "rtcenv", dcl_rtcenv, 2);
1980
+ rb_define_module_function(mDCL, "rlienv", dcl_rlienv, 1);
1981
+ rb_define_module_function(mDCL, "rllenv", dcl_rllenv, 1);
1982
+ rb_define_module_function(mDCL, "rlrenv", dcl_rlrenv, 1);
1983
+ rb_define_module_function(mDCL, "rlcenv", dcl_rlcenv, 1);
1984
+ rb_define_module_function(mDCL, "glrget", dcl_glrget, 1);
1985
+ rb_define_module_function(mDCL, "glrset", dcl_glrset, 2);
1986
+ rb_define_module_function(mDCL, "glrstx", dcl_glrstx, 2);
1987
+ rb_define_module_function(mDCL, "gllqnp", dcl_gllqnp, 0);
1988
+ rb_define_module_function(mDCL, "gllqid", dcl_gllqid, 1);
1989
+ rb_define_module_function(mDCL, "gllqcp", dcl_gllqcp, 1);
1990
+ rb_define_module_function(mDCL, "gllqcl", dcl_gllqcl, 1);
1991
+ rb_define_module_function(mDCL, "gllqvl", dcl_gllqvl, 1);
1992
+ rb_define_module_function(mDCL, "gllsvl", dcl_gllsvl, 2);
1993
+ rb_define_module_function(mDCL, "gllqin", dcl_gllqin, 1);
1994
+ rb_define_module_function(mDCL, "rpnget", dcl_rpnget, 0);
1995
+ rb_define_module_function(mDCL, "rtiget", dcl_rtiget, 3);
1996
+ rb_define_module_function(mDCL, "rtlget", dcl_rtlget, 3);
1997
+ rb_define_module_function(mDCL, "rtrget", dcl_rtrget, 3);
1998
+ rb_define_module_function(mDCL, "rtcget", dcl_rtcget, 3);
1999
+ rb_define_module_function(mDCL, "rliget", dcl_rliget, 2);
2000
+ rb_define_module_function(mDCL, "rllget", dcl_rllget, 2);
2001
+ rb_define_module_function(mDCL, "rlrget", dcl_rlrget, 2);
2002
+ rb_define_module_function(mDCL, "rlcget", dcl_rlcget, 2);
2003
+ rb_define_module_function(mDCL, "rpnopt", dcl_rpnopt, 0);
2004
+ rb_define_module_function(mDCL, "rtiopt", dcl_rtiopt, 2);
2005
+ rb_define_module_function(mDCL, "rtlopt", dcl_rtlopt, 2);
2006
+ rb_define_module_function(mDCL, "rtropt", dcl_rtropt, 2);
2007
+ rb_define_module_function(mDCL, "rtcopt", dcl_rtcopt, 2);
2008
+ rb_define_module_function(mDCL, "rliopt", dcl_rliopt, 1);
2009
+ rb_define_module_function(mDCL, "rllopt", dcl_rllopt, 1);
2010
+ rb_define_module_function(mDCL, "rlropt", dcl_rlropt, 1);
2011
+ rb_define_module_function(mDCL, "rlcopt", dcl_rlcopt, 1);
2012
+ rb_define_module_function(mDCL, "rpnxfl", dcl_rpnxfl, 0);
2013
+ rb_define_module_function(mDCL, "rtixfl", dcl_rtixfl, 2);
2014
+ rb_define_module_function(mDCL, "rtlxfl", dcl_rtlxfl, 2);
2015
+ rb_define_module_function(mDCL, "rtrxfl", dcl_rtrxfl, 2);
2016
+ rb_define_module_function(mDCL, "rtcxfl", dcl_rtcxfl, 2);
2017
+ rb_define_module_function(mDCL, "rlixfl", dcl_rlixfl, 1);
2018
+ rb_define_module_function(mDCL, "rllxfl", dcl_rllxfl, 1);
2019
+ rb_define_module_function(mDCL, "rlrxfl", dcl_rlrxfl, 1);
2020
+ rb_define_module_function(mDCL, "rlcxfl", dcl_rlcxfl, 1);
2021
+ rb_define_module_function(mDCL, "prcopn", dcl_prcopn, 1);
2022
+ rb_define_module_function(mDCL, "prccls", dcl_prccls, 1);
2023
+ rb_define_module_function(mDCL, "prclvl", dcl_prclvl, 0);
2024
+ rb_define_module_function(mDCL, "prcnam", dcl_prcnam, 1);
2025
+ }