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/grph1_swpack.c ADDED
@@ -0,0 +1,1922 @@
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_swdopn(obj)
66
+ VALUE obj;
67
+ {
68
+ swdopn_();
69
+
70
+ return Qnil;
71
+
72
+ }
73
+
74
+ static VALUE
75
+ dcl_swdcls(obj)
76
+ VALUE obj;
77
+ {
78
+ swdcls_();
79
+
80
+ return Qnil;
81
+
82
+ }
83
+
84
+ static VALUE
85
+ dcl_swpopn(obj)
86
+ VALUE obj;
87
+ {
88
+ swpopn_();
89
+
90
+ return Qnil;
91
+
92
+ }
93
+
94
+ static VALUE
95
+ dcl_swpcls(obj)
96
+ VALUE obj;
97
+ {
98
+ swpcls_();
99
+
100
+ return Qnil;
101
+
102
+ }
103
+
104
+ static VALUE
105
+ dcl_swoopn(obj, cobj, comm)
106
+ VALUE obj, cobj, comm;
107
+ {
108
+ char *i_cobj;
109
+ char *i_comm;
110
+
111
+ if (TYPE(cobj) != T_STRING) {
112
+ cobj = rb_funcall(cobj, rb_intern("to_str"), 0);
113
+ }
114
+ if (TYPE(comm) != T_STRING) {
115
+ comm = rb_funcall(comm, rb_intern("to_str"), 0);
116
+ }
117
+
118
+ i_cobj = StringValuePtr(cobj);
119
+ i_comm = StringValuePtr(comm);
120
+
121
+
122
+ swoopn_(i_cobj, i_comm, (ftnlen)strlen(i_cobj), (ftnlen)strlen(i_comm));
123
+
124
+ return Qnil;
125
+
126
+ }
127
+
128
+ static VALUE
129
+ dcl_swocls(obj, cobj)
130
+ VALUE obj, cobj;
131
+ {
132
+ char *i_cobj;
133
+
134
+ if (TYPE(cobj) != T_STRING) {
135
+ cobj = rb_funcall(cobj, rb_intern("to_str"), 0);
136
+ }
137
+
138
+ i_cobj = StringValuePtr(cobj);
139
+
140
+
141
+ swocls_(i_cobj, (ftnlen)strlen(i_cobj));
142
+
143
+ return Qnil;
144
+
145
+ }
146
+
147
+ static VALUE
148
+ dcl_swswdi(obj, iwdidx)
149
+ VALUE obj, iwdidx;
150
+ {
151
+ integer i_iwdidx;
152
+
153
+ if ((TYPE(iwdidx) != T_BIGNUM) || (TYPE(iwdidx) != T_FIXNUM)) {
154
+ iwdidx = rb_funcall(iwdidx, rb_intern("to_i"), 0);
155
+ }
156
+
157
+ i_iwdidx = NUM2INT(iwdidx);
158
+
159
+
160
+ swswdi_(&i_iwdidx);
161
+
162
+ return Qnil;
163
+
164
+ }
165
+
166
+ static VALUE
167
+ dcl_swscli(obj, iclidx)
168
+ VALUE obj, iclidx;
169
+ {
170
+ integer i_iclidx;
171
+
172
+ if ((TYPE(iclidx) != T_BIGNUM) || (TYPE(iclidx) != T_FIXNUM)) {
173
+ iclidx = rb_funcall(iclidx, rb_intern("to_i"), 0);
174
+ }
175
+
176
+ i_iclidx = NUM2INT(iclidx);
177
+
178
+
179
+ swscli_(&i_iclidx);
180
+
181
+ return Qnil;
182
+
183
+ }
184
+
185
+ static VALUE
186
+ dcl_swgopn(obj)
187
+ VALUE obj;
188
+ {
189
+ swgopn_();
190
+
191
+ return Qnil;
192
+
193
+ }
194
+
195
+ static VALUE
196
+ dcl_swgmov(obj, wx, wy)
197
+ VALUE obj, wx, wy;
198
+ {
199
+ real i_wx;
200
+ real i_wy;
201
+
202
+ if (TYPE(wx) != T_FLOAT) {
203
+ wx = rb_funcall(wx, rb_intern("to_f"), 0);
204
+ }
205
+ if (TYPE(wy) != T_FLOAT) {
206
+ wy = rb_funcall(wy, rb_intern("to_f"), 0);
207
+ }
208
+
209
+ i_wx = (real)NUM2DBL(wx);
210
+ i_wy = (real)NUM2DBL(wy);
211
+
212
+
213
+ swgmov_(&i_wx, &i_wy);
214
+
215
+ return Qnil;
216
+
217
+ }
218
+
219
+ static VALUE
220
+ dcl_swgplt(obj, wx, wy)
221
+ VALUE obj, wx, wy;
222
+ {
223
+ real i_wx;
224
+ real i_wy;
225
+
226
+ if (TYPE(wx) != T_FLOAT) {
227
+ wx = rb_funcall(wx, rb_intern("to_f"), 0);
228
+ }
229
+ if (TYPE(wy) != T_FLOAT) {
230
+ wy = rb_funcall(wy, rb_intern("to_f"), 0);
231
+ }
232
+
233
+ i_wx = (real)NUM2DBL(wx);
234
+ i_wy = (real)NUM2DBL(wy);
235
+
236
+
237
+ swgplt_(&i_wx, &i_wy);
238
+
239
+ return Qnil;
240
+
241
+ }
242
+
243
+ static VALUE
244
+ dcl_swgcls(obj)
245
+ VALUE obj;
246
+ {
247
+ swgcls_();
248
+
249
+ return Qnil;
250
+
251
+ }
252
+
253
+ static VALUE
254
+ dcl_swgton(obj, np, wpx, wpy, itpat)
255
+ VALUE obj, np, wpx, wpy, itpat;
256
+ {
257
+ integer i_np;
258
+ real *i_wpx;
259
+ real *i_wpy;
260
+ integer i_itpat;
261
+
262
+ if ((TYPE(np) != T_BIGNUM) || (TYPE(np) != T_FIXNUM)) {
263
+ np = rb_funcall(np, rb_intern("to_i"), 0);
264
+ }
265
+ if (TYPE(wpx) == T_FLOAT) {
266
+ wpx = rb_Array(wpx);
267
+ }
268
+ /* if ((TYPE(wpx) != T_ARRAY) &&
269
+ (rb_obj_is_kind_of(wpx, cNArray) != Qtrue)) {
270
+ rb_raise(rb_eTypeError, "invalid type");
271
+ } -- no check since obj2c*ary will do that */
272
+ if (TYPE(wpy) == T_FLOAT) {
273
+ wpy = rb_Array(wpy);
274
+ }
275
+ /* if ((TYPE(wpy) != T_ARRAY) &&
276
+ (rb_obj_is_kind_of(wpy, cNArray) != Qtrue)) {
277
+ rb_raise(rb_eTypeError, "invalid type");
278
+ } -- no check since obj2c*ary will do that */
279
+ if ((TYPE(itpat) != T_BIGNUM) || (TYPE(itpat) != T_FIXNUM)) {
280
+ itpat = rb_funcall(itpat, rb_intern("to_i"), 0);
281
+ }
282
+
283
+ i_np = NUM2INT(np);
284
+ i_itpat = NUM2INT(itpat);
285
+ i_wpx = dcl_obj2crealary(wpx);
286
+ i_wpy = dcl_obj2crealary(wpy);
287
+
288
+
289
+ swgton_(&i_np, i_wpx, i_wpy, &i_itpat);
290
+
291
+ dcl_freecrealary(i_wpx);
292
+ dcl_freecrealary(i_wpy);
293
+
294
+ return Qnil;
295
+
296
+ }
297
+
298
+ static VALUE
299
+ dcl_swiopn(obj, iwx, iwy, imw, imh)
300
+ VALUE obj, iwx, iwy, imw, imh;
301
+ {
302
+ integer i_iwx;
303
+ integer i_iwy;
304
+ integer i_imw;
305
+ integer i_imh;
306
+
307
+ if ((TYPE(iwx) != T_BIGNUM) || (TYPE(iwx) != T_FIXNUM)) {
308
+ iwx = rb_funcall(iwx, rb_intern("to_i"), 0);
309
+ }
310
+ if ((TYPE(iwy) != T_BIGNUM) || (TYPE(iwy) != T_FIXNUM)) {
311
+ iwy = rb_funcall(iwy, rb_intern("to_i"), 0);
312
+ }
313
+ if ((TYPE(imw) != T_BIGNUM) || (TYPE(imw) != T_FIXNUM)) {
314
+ imw = rb_funcall(imw, rb_intern("to_i"), 0);
315
+ }
316
+ if ((TYPE(imh) != T_BIGNUM) || (TYPE(imh) != T_FIXNUM)) {
317
+ imh = rb_funcall(imh, rb_intern("to_i"), 0);
318
+ }
319
+
320
+ i_iwx = NUM2INT(iwx);
321
+ i_iwy = NUM2INT(iwy);
322
+ i_imw = NUM2INT(imw);
323
+ i_imh = NUM2INT(imh);
324
+
325
+
326
+ swiopn_(&i_iwx, &i_iwy, &i_imw, &i_imh);
327
+
328
+ return Qnil;
329
+
330
+ }
331
+
332
+ static VALUE
333
+ dcl_swidat(obj, image, nlen)
334
+ VALUE obj, image, nlen;
335
+ {
336
+ integer *i_image;
337
+ integer i_nlen;
338
+
339
+ if ((TYPE(image) == T_BIGNUM) || (TYPE(image) == T_FIXNUM)) {
340
+ image = rb_Array(image);
341
+ }
342
+ /* if ((TYPE(image) != T_ARRAY) &&
343
+ (rb_obj_is_kind_of(image, cNArray) != Qtrue)) {
344
+ rb_raise(rb_eTypeError, "invalid type");
345
+ } -- no check since obj2c*ary will do that */
346
+ if ((TYPE(nlen) != T_BIGNUM) || (TYPE(nlen) != T_FIXNUM)) {
347
+ nlen = rb_funcall(nlen, rb_intern("to_i"), 0);
348
+ }
349
+
350
+ i_nlen = NUM2INT(nlen);
351
+ i_image = dcl_obj2cintegerary(image);
352
+
353
+
354
+ swidat_(i_image, &i_nlen);
355
+
356
+ dcl_freecintegerary(i_image);
357
+
358
+ return Qnil;
359
+
360
+ }
361
+
362
+ static VALUE
363
+ dcl_swicls(obj)
364
+ VALUE obj;
365
+ {
366
+ swicls_();
367
+
368
+ return Qnil;
369
+
370
+ }
371
+
372
+ static VALUE
373
+ dcl_swqpnt(obj)
374
+ VALUE obj;
375
+ {
376
+ real o_wx;
377
+ real o_wy;
378
+ integer o_mb;
379
+ VALUE wx;
380
+ VALUE wy;
381
+ VALUE mb;
382
+
383
+ swqpnt_(&o_wx, &o_wy, &o_mb);
384
+
385
+ wx = rb_float_new((double)o_wx);
386
+ wy = rb_float_new((double)o_wy);
387
+ mb = INT2NUM(o_mb);
388
+
389
+
390
+ return rb_ary_new3(3, wx, wy, mb);
391
+
392
+ }
393
+
394
+ static VALUE
395
+ dcl_swfint(obj, wx, wy)
396
+ VALUE obj, wx, wy;
397
+ {
398
+ real i_wx;
399
+ real i_wy;
400
+ integer o_iwx;
401
+ integer o_iwy;
402
+ VALUE iwx;
403
+ VALUE iwy;
404
+
405
+ if (TYPE(wx) != T_FLOAT) {
406
+ wx = rb_funcall(wx, rb_intern("to_f"), 0);
407
+ }
408
+ if (TYPE(wy) != T_FLOAT) {
409
+ wy = rb_funcall(wy, rb_intern("to_f"), 0);
410
+ }
411
+
412
+ i_wx = (real)NUM2DBL(wx);
413
+ i_wy = (real)NUM2DBL(wy);
414
+
415
+
416
+ swfint_(&i_wx, &i_wy, &o_iwx, &o_iwy);
417
+
418
+ iwx = INT2NUM(o_iwx);
419
+ iwy = INT2NUM(o_iwy);
420
+
421
+
422
+ return rb_ary_new3(2, iwx, iwy);
423
+
424
+ }
425
+
426
+ static VALUE
427
+ dcl_swiint(obj, iwx, iwy)
428
+ VALUE obj, iwx, iwy;
429
+ {
430
+ integer i_iwx;
431
+ integer i_iwy;
432
+ real o_wx;
433
+ real o_wy;
434
+ VALUE wx;
435
+ VALUE wy;
436
+
437
+ if ((TYPE(iwx) != T_BIGNUM) || (TYPE(iwx) != T_FIXNUM)) {
438
+ iwx = rb_funcall(iwx, rb_intern("to_i"), 0);
439
+ }
440
+ if ((TYPE(iwy) != T_BIGNUM) || (TYPE(iwy) != T_FIXNUM)) {
441
+ iwy = rb_funcall(iwy, rb_intern("to_i"), 0);
442
+ }
443
+
444
+ i_iwx = NUM2INT(iwx);
445
+ i_iwy = NUM2INT(iwy);
446
+
447
+
448
+ swiint_(&i_iwx, &i_iwy, &o_wx, &o_wy);
449
+
450
+ wx = rb_float_new((double)o_wx);
451
+ wy = rb_float_new((double)o_wy);
452
+
453
+
454
+ return rb_ary_new3(2, wx, wy);
455
+
456
+ }
457
+
458
+ static VALUE
459
+ dcl_swqwdc(obj)
460
+ VALUE obj;
461
+ {
462
+ logical o_lwdatr;
463
+ VALUE lwdatr;
464
+
465
+ swqwdc_(&o_lwdatr);
466
+
467
+ lwdatr = (o_lwdatr == FALSE_) ? Qfalse : Qtrue;
468
+
469
+
470
+ return lwdatr;
471
+
472
+ }
473
+
474
+ static VALUE
475
+ dcl_swqclc(obj)
476
+ VALUE obj;
477
+ {
478
+ logical o_lclatr;
479
+ VALUE lclatr;
480
+
481
+ swqclc_(&o_lclatr);
482
+
483
+ lclatr = (o_lclatr == FALSE_) ? Qfalse : Qtrue;
484
+
485
+
486
+ return lclatr;
487
+
488
+ }
489
+
490
+ static VALUE
491
+ dcl_swqtnc(obj)
492
+ VALUE obj;
493
+ {
494
+ logical o_ltnatr;
495
+ VALUE ltnatr;
496
+
497
+ swqtnc_(&o_ltnatr);
498
+
499
+ ltnatr = (o_ltnatr == FALSE_) ? Qfalse : Qtrue;
500
+
501
+
502
+ return ltnatr;
503
+
504
+ }
505
+
506
+ static VALUE
507
+ dcl_swqimc(obj)
508
+ VALUE obj;
509
+ {
510
+ logical o_limatr;
511
+ VALUE limatr;
512
+
513
+ swqimc_(&o_limatr);
514
+
515
+ limatr = (o_limatr == FALSE_) ? Qfalse : Qtrue;
516
+
517
+
518
+ return limatr;
519
+
520
+ }
521
+
522
+ static VALUE
523
+ dcl_swqptc(obj)
524
+ VALUE obj;
525
+ {
526
+ logical o_lptatr;
527
+ VALUE lptatr;
528
+
529
+ swqptc_(&o_lptatr);
530
+
531
+ lptatr = (o_lptatr == FALSE_) ? Qfalse : Qtrue;
532
+
533
+
534
+ return lptatr;
535
+
536
+ }
537
+
538
+ static VALUE
539
+ dcl_swqrct(obj)
540
+ VALUE obj;
541
+ {
542
+ real o_wsxmn;
543
+ real o_wsxmx;
544
+ real o_wsymn;
545
+ real o_wsymx;
546
+ real o_fact;
547
+ VALUE wsxmn;
548
+ VALUE wsxmx;
549
+ VALUE wsymn;
550
+ VALUE wsymx;
551
+ VALUE fact;
552
+
553
+ swqrct_(&o_wsxmn, &o_wsxmx, &o_wsymn, &o_wsymx, &o_fact);
554
+
555
+ wsxmn = rb_float_new((double)o_wsxmn);
556
+ wsxmx = rb_float_new((double)o_wsxmx);
557
+ wsymn = rb_float_new((double)o_wsymn);
558
+ wsymx = rb_float_new((double)o_wsymx);
559
+ fact = rb_float_new((double)o_fact);
560
+
561
+
562
+ return rb_ary_new3(5, wsxmn, wsxmx, wsymn, wsymx, fact);
563
+
564
+ }
565
+
566
+ static VALUE
567
+ dcl_swsrot(obj, iwtrot)
568
+ VALUE obj, iwtrot;
569
+ {
570
+ integer i_iwtrot;
571
+
572
+ if ((TYPE(iwtrot) != T_BIGNUM) || (TYPE(iwtrot) != T_FIXNUM)) {
573
+ iwtrot = rb_funcall(iwtrot, rb_intern("to_i"), 0);
574
+ }
575
+
576
+ i_iwtrot = NUM2INT(iwtrot);
577
+
578
+
579
+ swsrot_(&i_iwtrot);
580
+
581
+ return Qnil;
582
+
583
+ }
584
+
585
+ static VALUE
586
+ dcl_swpqnp(obj)
587
+ VALUE obj;
588
+ {
589
+ integer o_ncp;
590
+ VALUE ncp;
591
+
592
+ swpqnp_(&o_ncp);
593
+
594
+ ncp = INT2NUM(o_ncp);
595
+
596
+
597
+ return ncp;
598
+
599
+ }
600
+
601
+ static VALUE
602
+ dcl_swpqid(obj, cp)
603
+ VALUE obj, cp;
604
+ {
605
+ char *i_cp;
606
+ integer o_idx;
607
+ VALUE idx;
608
+
609
+ if (TYPE(cp) != T_STRING) {
610
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
611
+ }
612
+
613
+ i_cp = StringValuePtr(cp);
614
+
615
+
616
+ swpqid_(i_cp, &o_idx, (ftnlen)strlen(i_cp));
617
+
618
+ idx = INT2NUM(o_idx);
619
+
620
+
621
+ return idx;
622
+
623
+ }
624
+
625
+ static VALUE
626
+ dcl_swpqcp(obj, idx)
627
+ VALUE obj, idx;
628
+ {
629
+ integer i_idx;
630
+ char *o_cp;
631
+ VALUE cp;
632
+
633
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
634
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
635
+ }
636
+
637
+ i_idx = NUM2INT(idx);
638
+
639
+ o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
640
+ memset(o_cp, '\0', DFLT_SIZE+1);
641
+
642
+ swpqcp_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
643
+
644
+ cp = rb_str_new2(o_cp);
645
+
646
+
647
+ return cp;
648
+
649
+ }
650
+
651
+ static VALUE
652
+ dcl_swpqcl(obj, idx)
653
+ VALUE obj, idx;
654
+ {
655
+ integer i_idx;
656
+ char *o_cp;
657
+ VALUE cp;
658
+
659
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
660
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
661
+ }
662
+
663
+ i_idx = NUM2INT(idx);
664
+
665
+ o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
666
+ memset(o_cp, '\0', DFLT_SIZE+1);
667
+
668
+ swpqcl_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
669
+
670
+ cp = rb_str_new2(o_cp);
671
+
672
+
673
+ return cp;
674
+
675
+ }
676
+
677
+ static VALUE
678
+ dcl_swpqit(obj, idx)
679
+ VALUE obj, idx;
680
+ {
681
+ integer i_idx;
682
+ integer o_itp;
683
+ VALUE itp;
684
+
685
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
686
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
687
+ }
688
+
689
+ i_idx = NUM2INT(idx);
690
+
691
+
692
+ swpqit_(&i_idx, &o_itp);
693
+
694
+ itp = INT2NUM(o_itp);
695
+
696
+
697
+ return itp;
698
+
699
+ }
700
+
701
+ static VALUE
702
+ dcl_swpqvl(obj, idx)
703
+ VALUE obj, idx;
704
+ {
705
+ integer i_idx;
706
+ integer o_ipara;
707
+ VALUE ipara;
708
+
709
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
710
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
711
+ }
712
+
713
+ i_idx = NUM2INT(idx);
714
+
715
+
716
+ swpqvl_(&i_idx, &o_ipara);
717
+
718
+ ipara = INT2NUM(o_ipara);
719
+
720
+
721
+ return ipara;
722
+
723
+ }
724
+
725
+ static VALUE
726
+ dcl_swpsvl(obj, idx, ipara)
727
+ VALUE obj, idx, ipara;
728
+ {
729
+ integer i_idx;
730
+ integer i_ipara;
731
+
732
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
733
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
734
+ }
735
+ if ((TYPE(ipara) != T_BIGNUM) || (TYPE(ipara) != T_FIXNUM)) {
736
+ ipara = rb_funcall(ipara, rb_intern("to_i"), 0);
737
+ }
738
+
739
+ i_idx = NUM2INT(idx);
740
+ i_ipara = NUM2INT(ipara);
741
+
742
+
743
+ swpsvl_(&i_idx, &i_ipara);
744
+
745
+ return Qnil;
746
+
747
+ }
748
+
749
+ static VALUE
750
+ dcl_swpqin(obj, cp)
751
+ VALUE obj, cp;
752
+ {
753
+ char *i_cp;
754
+ integer o_in;
755
+ VALUE in;
756
+
757
+ if (TYPE(cp) != T_STRING) {
758
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
759
+ }
760
+
761
+ i_cp = StringValuePtr(cp);
762
+
763
+
764
+ swpqin_(i_cp, &o_in, (ftnlen)strlen(i_cp));
765
+
766
+ in = INT2NUM(o_in);
767
+
768
+
769
+ return in;
770
+
771
+ }
772
+
773
+ static VALUE
774
+ dcl_swcget(obj, cp)
775
+ VALUE obj, cp;
776
+ {
777
+ char *i_cp;
778
+ char *o_cpara;
779
+ VALUE cpara;
780
+
781
+ if (TYPE(cp) != T_STRING) {
782
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
783
+ }
784
+
785
+ i_cp = StringValuePtr(cp);
786
+
787
+ o_cpara= ALLOCA_N(char, (DFLT_SIZE+1));
788
+ memset(o_cpara, '\0', DFLT_SIZE+1);
789
+
790
+ swcget_(i_cp, o_cpara, (ftnlen)strlen(i_cp), (ftnlen)DFLT_SIZE);
791
+
792
+ cpara = rb_str_new2(o_cpara);
793
+
794
+
795
+ return cpara;
796
+
797
+ }
798
+
799
+ static VALUE
800
+ dcl_swcset(obj, cp, cpara)
801
+ VALUE obj, cp, cpara;
802
+ {
803
+ char *i_cp;
804
+ char *i_cpara;
805
+
806
+ if (TYPE(cp) != T_STRING) {
807
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
808
+ }
809
+ if (TYPE(cpara) != T_STRING) {
810
+ cpara = rb_funcall(cpara, rb_intern("to_str"), 0);
811
+ }
812
+
813
+ i_cp = StringValuePtr(cp);
814
+ i_cpara = StringValuePtr(cpara);
815
+
816
+
817
+ swcset_(i_cp, i_cpara, (ftnlen)strlen(i_cp), (ftnlen)strlen(i_cpara));
818
+
819
+ return Qnil;
820
+
821
+ }
822
+
823
+ static VALUE
824
+ dcl_swcstx(obj, cp, cpara)
825
+ VALUE obj, cp, cpara;
826
+ {
827
+ char *i_cp;
828
+ char *i_cpara;
829
+
830
+ if (TYPE(cp) != T_STRING) {
831
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
832
+ }
833
+ if (TYPE(cpara) != T_STRING) {
834
+ cpara = rb_funcall(cpara, rb_intern("to_str"), 0);
835
+ }
836
+
837
+ i_cp = StringValuePtr(cp);
838
+ i_cpara = StringValuePtr(cpara);
839
+
840
+
841
+ swcstx_(i_cp, i_cpara, (ftnlen)strlen(i_cp), (ftnlen)strlen(i_cpara));
842
+
843
+ return Qnil;
844
+
845
+ }
846
+
847
+ static VALUE
848
+ dcl_swqfnm(obj, cpara)
849
+ VALUE obj, cpara;
850
+ {
851
+ char *i_cpara;
852
+ char *o_cfname;
853
+ VALUE cfname;
854
+
855
+ if (TYPE(cpara) != T_STRING) {
856
+ cpara = rb_funcall(cpara, rb_intern("to_str"), 0);
857
+ }
858
+
859
+ i_cpara = StringValuePtr(cpara);
860
+
861
+ o_cfname= ALLOCA_N(char, (DFLT_SIZE+1));
862
+ memset(o_cfname, '\0', DFLT_SIZE+1);
863
+
864
+ swqfnm_(i_cpara, o_cfname, (ftnlen)strlen(i_cpara), (ftnlen)DFLT_SIZE);
865
+
866
+ cfname = rb_str_new2(o_cfname);
867
+
868
+
869
+ return cfname;
870
+
871
+ }
872
+
873
+ static VALUE
874
+ dcl_swcqnp(obj)
875
+ VALUE obj;
876
+ {
877
+ integer o_ncp;
878
+ VALUE ncp;
879
+
880
+ swcqnp_(&o_ncp);
881
+
882
+ ncp = INT2NUM(o_ncp);
883
+
884
+
885
+ return ncp;
886
+
887
+ }
888
+
889
+ static VALUE
890
+ dcl_swcqid(obj, cp)
891
+ VALUE obj, cp;
892
+ {
893
+ char *i_cp;
894
+ integer o_idx;
895
+ VALUE idx;
896
+
897
+ if (TYPE(cp) != T_STRING) {
898
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
899
+ }
900
+
901
+ i_cp = StringValuePtr(cp);
902
+
903
+
904
+ swcqid_(i_cp, &o_idx, (ftnlen)strlen(i_cp));
905
+
906
+ idx = INT2NUM(o_idx);
907
+
908
+
909
+ return idx;
910
+
911
+ }
912
+
913
+ static VALUE
914
+ dcl_swcqcp(obj, idx)
915
+ VALUE obj, idx;
916
+ {
917
+ integer i_idx;
918
+ char *o_cp;
919
+ VALUE cp;
920
+
921
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
922
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
923
+ }
924
+
925
+ i_idx = NUM2INT(idx);
926
+
927
+ o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
928
+ memset(o_cp, '\0', DFLT_SIZE+1);
929
+
930
+ swcqcp_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
931
+
932
+ cp = rb_str_new2(o_cp);
933
+
934
+
935
+ return cp;
936
+
937
+ }
938
+
939
+ static VALUE
940
+ dcl_swcqcl(obj, idx)
941
+ VALUE obj, idx;
942
+ {
943
+ integer i_idx;
944
+ char *o_cp;
945
+ VALUE cp;
946
+
947
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
948
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
949
+ }
950
+
951
+ i_idx = NUM2INT(idx);
952
+
953
+ o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
954
+ memset(o_cp, '\0', DFLT_SIZE+1);
955
+
956
+ swcqcl_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
957
+
958
+ cp = rb_str_new2(o_cp);
959
+
960
+
961
+ return cp;
962
+
963
+ }
964
+
965
+ static VALUE
966
+ dcl_swcqvl(obj, idx)
967
+ VALUE obj, idx;
968
+ {
969
+ integer i_idx;
970
+ char *o_cval;
971
+ VALUE cval;
972
+
973
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
974
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
975
+ }
976
+
977
+ i_idx = NUM2INT(idx);
978
+
979
+ o_cval= ALLOCA_N(char, (DFLT_SIZE+1));
980
+ memset(o_cval, '\0', DFLT_SIZE+1);
981
+
982
+ swcqvl_(&i_idx, o_cval, (ftnlen)DFLT_SIZE);
983
+
984
+ cval = rb_str_new2(o_cval);
985
+
986
+
987
+ return cval;
988
+
989
+ }
990
+
991
+ static VALUE
992
+ dcl_swcsvl(obj, idx, cval)
993
+ VALUE obj, idx, cval;
994
+ {
995
+ integer i_idx;
996
+ char *i_cval;
997
+
998
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
999
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
1000
+ }
1001
+ if (TYPE(cval) != T_STRING) {
1002
+ cval = rb_funcall(cval, rb_intern("to_str"), 0);
1003
+ }
1004
+
1005
+ i_idx = NUM2INT(idx);
1006
+ i_cval = StringValuePtr(cval);
1007
+
1008
+
1009
+ swcsvl_(&i_idx, i_cval, (ftnlen)strlen(i_cval));
1010
+
1011
+ return Qnil;
1012
+
1013
+ }
1014
+
1015
+ static VALUE
1016
+ dcl_swcqin(obj, cp)
1017
+ VALUE obj, cp;
1018
+ {
1019
+ char *i_cp;
1020
+ integer o_in;
1021
+ VALUE in;
1022
+
1023
+ if (TYPE(cp) != T_STRING) {
1024
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1025
+ }
1026
+
1027
+ i_cp = StringValuePtr(cp);
1028
+
1029
+
1030
+ swcqin_(i_cp, &o_in, (ftnlen)strlen(i_cp));
1031
+
1032
+ in = INT2NUM(o_in);
1033
+
1034
+
1035
+ return in;
1036
+
1037
+ }
1038
+
1039
+ static VALUE
1040
+ dcl_swiget(obj, cp)
1041
+ VALUE obj, cp;
1042
+ {
1043
+ char *i_cp;
1044
+ integer o_ipara;
1045
+ VALUE ipara;
1046
+
1047
+ if (TYPE(cp) != T_STRING) {
1048
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1049
+ }
1050
+
1051
+ i_cp = StringValuePtr(cp);
1052
+
1053
+
1054
+ swiget_(i_cp, &o_ipara, (ftnlen)strlen(i_cp));
1055
+
1056
+ ipara = INT2NUM(o_ipara);
1057
+
1058
+
1059
+ return ipara;
1060
+
1061
+ }
1062
+
1063
+ static VALUE
1064
+ dcl_swiset(obj, cp, ipara)
1065
+ VALUE obj, cp, ipara;
1066
+ {
1067
+ char *i_cp;
1068
+ integer i_ipara;
1069
+
1070
+ if (TYPE(cp) != T_STRING) {
1071
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1072
+ }
1073
+ if ((TYPE(ipara) != T_BIGNUM) || (TYPE(ipara) != T_FIXNUM)) {
1074
+ ipara = rb_funcall(ipara, rb_intern("to_i"), 0);
1075
+ }
1076
+
1077
+ i_cp = StringValuePtr(cp);
1078
+ i_ipara = NUM2INT(ipara);
1079
+
1080
+
1081
+ swiset_(i_cp, &i_ipara, (ftnlen)strlen(i_cp));
1082
+
1083
+ return Qnil;
1084
+
1085
+ }
1086
+
1087
+ static VALUE
1088
+ dcl_swistx(obj, cp, ipara)
1089
+ VALUE obj, cp, ipara;
1090
+ {
1091
+ char *i_cp;
1092
+ integer i_ipara;
1093
+
1094
+ if (TYPE(cp) != T_STRING) {
1095
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1096
+ }
1097
+ if ((TYPE(ipara) != T_BIGNUM) || (TYPE(ipara) != T_FIXNUM)) {
1098
+ ipara = rb_funcall(ipara, rb_intern("to_i"), 0);
1099
+ }
1100
+
1101
+ i_cp = StringValuePtr(cp);
1102
+ i_ipara = NUM2INT(ipara);
1103
+
1104
+
1105
+ swistx_(i_cp, &i_ipara, (ftnlen)strlen(i_cp));
1106
+
1107
+ return Qnil;
1108
+
1109
+ }
1110
+
1111
+ static VALUE
1112
+ dcl_swiqnp(obj)
1113
+ VALUE obj;
1114
+ {
1115
+ integer o_ncp;
1116
+ VALUE ncp;
1117
+
1118
+ swiqnp_(&o_ncp);
1119
+
1120
+ ncp = INT2NUM(o_ncp);
1121
+
1122
+
1123
+ return ncp;
1124
+
1125
+ }
1126
+
1127
+ static VALUE
1128
+ dcl_swiqid(obj, cp)
1129
+ VALUE obj, cp;
1130
+ {
1131
+ char *i_cp;
1132
+ integer o_idx;
1133
+ VALUE idx;
1134
+
1135
+ if (TYPE(cp) != T_STRING) {
1136
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1137
+ }
1138
+
1139
+ i_cp = StringValuePtr(cp);
1140
+
1141
+
1142
+ swiqid_(i_cp, &o_idx, (ftnlen)strlen(i_cp));
1143
+
1144
+ idx = INT2NUM(o_idx);
1145
+
1146
+
1147
+ return idx;
1148
+
1149
+ }
1150
+
1151
+ static VALUE
1152
+ dcl_swiqcp(obj, idx)
1153
+ VALUE obj, idx;
1154
+ {
1155
+ integer i_idx;
1156
+ char *o_cp;
1157
+ VALUE cp;
1158
+
1159
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
1160
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
1161
+ }
1162
+
1163
+ i_idx = NUM2INT(idx);
1164
+
1165
+ o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
1166
+ memset(o_cp, '\0', DFLT_SIZE+1);
1167
+
1168
+ swiqcp_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
1169
+
1170
+ cp = rb_str_new2(o_cp);
1171
+
1172
+
1173
+ return cp;
1174
+
1175
+ }
1176
+
1177
+ static VALUE
1178
+ dcl_swiqcl(obj, idx)
1179
+ VALUE obj, idx;
1180
+ {
1181
+ integer i_idx;
1182
+ char *o_cp;
1183
+ VALUE cp;
1184
+
1185
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
1186
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
1187
+ }
1188
+
1189
+ i_idx = NUM2INT(idx);
1190
+
1191
+ o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
1192
+ memset(o_cp, '\0', DFLT_SIZE+1);
1193
+
1194
+ swiqcl_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
1195
+
1196
+ cp = rb_str_new2(o_cp);
1197
+
1198
+
1199
+ return cp;
1200
+
1201
+ }
1202
+
1203
+ static VALUE
1204
+ dcl_swiqvl(obj, idx)
1205
+ VALUE obj, idx;
1206
+ {
1207
+ integer i_idx;
1208
+ integer o_ipara;
1209
+ VALUE ipara;
1210
+
1211
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
1212
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
1213
+ }
1214
+
1215
+ i_idx = NUM2INT(idx);
1216
+
1217
+
1218
+ swiqvl_(&i_idx, &o_ipara);
1219
+
1220
+ ipara = INT2NUM(o_ipara);
1221
+
1222
+
1223
+ return ipara;
1224
+
1225
+ }
1226
+
1227
+ static VALUE
1228
+ dcl_swisvl(obj, idx, ipara)
1229
+ VALUE obj, idx, ipara;
1230
+ {
1231
+ integer i_idx;
1232
+ integer i_ipara;
1233
+
1234
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
1235
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
1236
+ }
1237
+ if ((TYPE(ipara) != T_BIGNUM) || (TYPE(ipara) != T_FIXNUM)) {
1238
+ ipara = rb_funcall(ipara, rb_intern("to_i"), 0);
1239
+ }
1240
+
1241
+ i_idx = NUM2INT(idx);
1242
+ i_ipara = NUM2INT(ipara);
1243
+
1244
+
1245
+ swisvl_(&i_idx, &i_ipara);
1246
+
1247
+ return Qnil;
1248
+
1249
+ }
1250
+
1251
+ static VALUE
1252
+ dcl_swiqin(obj, cp)
1253
+ VALUE obj, cp;
1254
+ {
1255
+ char *i_cp;
1256
+ integer o_in;
1257
+ VALUE in;
1258
+
1259
+ if (TYPE(cp) != T_STRING) {
1260
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1261
+ }
1262
+
1263
+ i_cp = StringValuePtr(cp);
1264
+
1265
+
1266
+ swiqin_(i_cp, &o_in, (ftnlen)strlen(i_cp));
1267
+
1268
+ in = INT2NUM(o_in);
1269
+
1270
+
1271
+ return in;
1272
+
1273
+ }
1274
+
1275
+ static VALUE
1276
+ dcl_swlget(obj, cp)
1277
+ VALUE obj, cp;
1278
+ {
1279
+ char *i_cp;
1280
+ logical o_lpara;
1281
+ VALUE lpara;
1282
+
1283
+ if (TYPE(cp) != T_STRING) {
1284
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1285
+ }
1286
+
1287
+ i_cp = StringValuePtr(cp);
1288
+
1289
+
1290
+ swlget_(i_cp, &o_lpara, (ftnlen)strlen(i_cp));
1291
+
1292
+ lpara = (o_lpara == FALSE_) ? Qfalse : Qtrue;
1293
+
1294
+
1295
+ return lpara;
1296
+
1297
+ }
1298
+
1299
+ static VALUE
1300
+ dcl_swlset(obj, cp, lpara)
1301
+ VALUE obj, cp, lpara;
1302
+ {
1303
+ char *i_cp;
1304
+ logical i_lpara;
1305
+
1306
+ if (TYPE(cp) != T_STRING) {
1307
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1308
+ }
1309
+
1310
+ i_cp = StringValuePtr(cp);
1311
+ i_lpara = ((lpara == Qnil)||(lpara == Qfalse)) ? FALSE_ : TRUE_;
1312
+
1313
+
1314
+ swlset_(i_cp, &i_lpara, (ftnlen)strlen(i_cp));
1315
+
1316
+ return Qnil;
1317
+
1318
+ }
1319
+
1320
+ static VALUE
1321
+ dcl_swlstx(obj, cp, lpara)
1322
+ VALUE obj, cp, lpara;
1323
+ {
1324
+ char *i_cp;
1325
+ logical i_lpara;
1326
+
1327
+ if (TYPE(cp) != T_STRING) {
1328
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1329
+ }
1330
+
1331
+ i_cp = StringValuePtr(cp);
1332
+ i_lpara = ((lpara == Qnil)||(lpara == Qfalse)) ? FALSE_ : TRUE_;
1333
+
1334
+
1335
+ swlstx_(i_cp, &i_lpara, (ftnlen)strlen(i_cp));
1336
+
1337
+ return Qnil;
1338
+
1339
+ }
1340
+
1341
+ static VALUE
1342
+ dcl_swlqnp(obj)
1343
+ VALUE obj;
1344
+ {
1345
+ integer o_ncp;
1346
+ VALUE ncp;
1347
+
1348
+ swlqnp_(&o_ncp);
1349
+
1350
+ ncp = INT2NUM(o_ncp);
1351
+
1352
+
1353
+ return ncp;
1354
+
1355
+ }
1356
+
1357
+ static VALUE
1358
+ dcl_swlqid(obj, cp)
1359
+ VALUE obj, cp;
1360
+ {
1361
+ char *i_cp;
1362
+ integer o_idx;
1363
+ VALUE idx;
1364
+
1365
+ if (TYPE(cp) != T_STRING) {
1366
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1367
+ }
1368
+
1369
+ i_cp = StringValuePtr(cp);
1370
+
1371
+
1372
+ swlqid_(i_cp, &o_idx, (ftnlen)strlen(i_cp));
1373
+
1374
+ idx = INT2NUM(o_idx);
1375
+
1376
+
1377
+ return idx;
1378
+
1379
+ }
1380
+
1381
+ static VALUE
1382
+ dcl_swlqcp(obj, idx)
1383
+ VALUE obj, idx;
1384
+ {
1385
+ integer i_idx;
1386
+ char *o_cp;
1387
+ VALUE cp;
1388
+
1389
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
1390
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
1391
+ }
1392
+
1393
+ i_idx = NUM2INT(idx);
1394
+
1395
+ o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
1396
+ memset(o_cp, '\0', DFLT_SIZE+1);
1397
+
1398
+ swlqcp_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
1399
+
1400
+ cp = rb_str_new2(o_cp);
1401
+
1402
+
1403
+ return cp;
1404
+
1405
+ }
1406
+
1407
+ static VALUE
1408
+ dcl_swlqcl(obj, idx)
1409
+ VALUE obj, idx;
1410
+ {
1411
+ integer i_idx;
1412
+ char *o_cp;
1413
+ VALUE cp;
1414
+
1415
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
1416
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
1417
+ }
1418
+
1419
+ i_idx = NUM2INT(idx);
1420
+
1421
+ o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
1422
+ memset(o_cp, '\0', DFLT_SIZE+1);
1423
+
1424
+ swlqcl_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
1425
+
1426
+ cp = rb_str_new2(o_cp);
1427
+
1428
+
1429
+ return cp;
1430
+
1431
+ }
1432
+
1433
+ static VALUE
1434
+ dcl_swlqvl(obj, idx)
1435
+ VALUE obj, idx;
1436
+ {
1437
+ integer i_idx;
1438
+ logical o_lpara;
1439
+ VALUE lpara;
1440
+
1441
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
1442
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
1443
+ }
1444
+
1445
+ i_idx = NUM2INT(idx);
1446
+
1447
+
1448
+ swlqvl_(&i_idx, &o_lpara);
1449
+
1450
+ lpara = (o_lpara == FALSE_) ? Qfalse : Qtrue;
1451
+
1452
+
1453
+ return lpara;
1454
+
1455
+ }
1456
+
1457
+ static VALUE
1458
+ dcl_swlsvl(obj, idx, lpara)
1459
+ VALUE obj, idx, lpara;
1460
+ {
1461
+ integer i_idx;
1462
+ logical i_lpara;
1463
+
1464
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
1465
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
1466
+ }
1467
+
1468
+ i_idx = NUM2INT(idx);
1469
+ i_lpara = ((lpara == Qnil)||(lpara == Qfalse)) ? FALSE_ : TRUE_;
1470
+
1471
+
1472
+ swlsvl_(&i_idx, &i_lpara);
1473
+
1474
+ return Qnil;
1475
+
1476
+ }
1477
+
1478
+ static VALUE
1479
+ dcl_swlqin(obj, cp)
1480
+ VALUE obj, cp;
1481
+ {
1482
+ char *i_cp;
1483
+ integer o_in;
1484
+ VALUE in;
1485
+
1486
+ if (TYPE(cp) != T_STRING) {
1487
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1488
+ }
1489
+
1490
+ i_cp = StringValuePtr(cp);
1491
+
1492
+
1493
+ swlqin_(i_cp, &o_in, (ftnlen)strlen(i_cp));
1494
+
1495
+ in = INT2NUM(o_in);
1496
+
1497
+
1498
+ return in;
1499
+
1500
+ }
1501
+
1502
+ static VALUE
1503
+ dcl_swrget(obj, cp)
1504
+ VALUE obj, cp;
1505
+ {
1506
+ char *i_cp;
1507
+ real o_rpara;
1508
+ VALUE rpara;
1509
+
1510
+ if (TYPE(cp) != T_STRING) {
1511
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1512
+ }
1513
+
1514
+ i_cp = StringValuePtr(cp);
1515
+
1516
+
1517
+ swrget_(i_cp, &o_rpara, (ftnlen)strlen(i_cp));
1518
+
1519
+ rpara = rb_float_new((double)o_rpara);
1520
+
1521
+
1522
+ return rpara;
1523
+
1524
+ }
1525
+
1526
+ static VALUE
1527
+ dcl_swrset(obj, cp, rpara)
1528
+ VALUE obj, cp, rpara;
1529
+ {
1530
+ char *i_cp;
1531
+ real i_rpara;
1532
+
1533
+ if (TYPE(cp) != T_STRING) {
1534
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1535
+ }
1536
+ if (TYPE(rpara) != T_FLOAT) {
1537
+ rpara = rb_funcall(rpara, rb_intern("to_f"), 0);
1538
+ }
1539
+
1540
+ i_cp = StringValuePtr(cp);
1541
+ i_rpara = (real)NUM2DBL(rpara);
1542
+
1543
+
1544
+ swrset_(i_cp, &i_rpara, (ftnlen)strlen(i_cp));
1545
+
1546
+ return Qnil;
1547
+
1548
+ }
1549
+
1550
+ static VALUE
1551
+ dcl_swrstx(obj, cp, rpara)
1552
+ VALUE obj, cp, rpara;
1553
+ {
1554
+ char *i_cp;
1555
+ real i_rpara;
1556
+
1557
+ if (TYPE(cp) != T_STRING) {
1558
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1559
+ }
1560
+ if (TYPE(rpara) != T_FLOAT) {
1561
+ rpara = rb_funcall(rpara, rb_intern("to_f"), 0);
1562
+ }
1563
+
1564
+ i_cp = StringValuePtr(cp);
1565
+ i_rpara = (real)NUM2DBL(rpara);
1566
+
1567
+
1568
+ swrstx_(i_cp, &i_rpara, (ftnlen)strlen(i_cp));
1569
+
1570
+ return Qnil;
1571
+
1572
+ }
1573
+
1574
+ static VALUE
1575
+ dcl_swrqnp(obj)
1576
+ VALUE obj;
1577
+ {
1578
+ integer o_ncp;
1579
+ VALUE ncp;
1580
+
1581
+ swrqnp_(&o_ncp);
1582
+
1583
+ ncp = INT2NUM(o_ncp);
1584
+
1585
+
1586
+ return ncp;
1587
+
1588
+ }
1589
+
1590
+ static VALUE
1591
+ dcl_swrqid(obj, cp)
1592
+ VALUE obj, cp;
1593
+ {
1594
+ char *i_cp;
1595
+ integer o_idx;
1596
+ VALUE idx;
1597
+
1598
+ if (TYPE(cp) != T_STRING) {
1599
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1600
+ }
1601
+
1602
+ i_cp = StringValuePtr(cp);
1603
+
1604
+
1605
+ swrqid_(i_cp, &o_idx, (ftnlen)strlen(i_cp));
1606
+
1607
+ idx = INT2NUM(o_idx);
1608
+
1609
+
1610
+ return idx;
1611
+
1612
+ }
1613
+
1614
+ static VALUE
1615
+ dcl_swrqcp(obj, idx)
1616
+ VALUE obj, idx;
1617
+ {
1618
+ integer i_idx;
1619
+ char *o_cp;
1620
+ VALUE cp;
1621
+
1622
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
1623
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
1624
+ }
1625
+
1626
+ i_idx = NUM2INT(idx);
1627
+
1628
+ o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
1629
+ memset(o_cp, '\0', DFLT_SIZE+1);
1630
+
1631
+ swrqcp_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
1632
+
1633
+ cp = rb_str_new2(o_cp);
1634
+
1635
+
1636
+ return cp;
1637
+
1638
+ }
1639
+
1640
+ static VALUE
1641
+ dcl_swrqcl(obj, idx)
1642
+ VALUE obj, idx;
1643
+ {
1644
+ integer i_idx;
1645
+ char *o_cp;
1646
+ VALUE cp;
1647
+
1648
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
1649
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
1650
+ }
1651
+
1652
+ i_idx = NUM2INT(idx);
1653
+
1654
+ o_cp= ALLOCA_N(char, (DFLT_SIZE+1));
1655
+ memset(o_cp, '\0', DFLT_SIZE+1);
1656
+
1657
+ swrqcl_(&i_idx, o_cp, (ftnlen)DFLT_SIZE);
1658
+
1659
+ cp = rb_str_new2(o_cp);
1660
+
1661
+
1662
+ return cp;
1663
+
1664
+ }
1665
+
1666
+ static VALUE
1667
+ dcl_swrqvl(obj, idx)
1668
+ VALUE obj, idx;
1669
+ {
1670
+ integer i_idx;
1671
+ real o_rpara;
1672
+ VALUE rpara;
1673
+
1674
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
1675
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
1676
+ }
1677
+
1678
+ i_idx = NUM2INT(idx);
1679
+
1680
+
1681
+ swrqvl_(&i_idx, &o_rpara);
1682
+
1683
+ rpara = rb_float_new((double)o_rpara);
1684
+
1685
+
1686
+ return rpara;
1687
+
1688
+ }
1689
+
1690
+ static VALUE
1691
+ dcl_swrsvl(obj, idx, rpara)
1692
+ VALUE obj, idx, rpara;
1693
+ {
1694
+ integer i_idx;
1695
+ real i_rpara;
1696
+
1697
+ if ((TYPE(idx) != T_BIGNUM) || (TYPE(idx) != T_FIXNUM)) {
1698
+ idx = rb_funcall(idx, rb_intern("to_i"), 0);
1699
+ }
1700
+ if (TYPE(rpara) != T_FLOAT) {
1701
+ rpara = rb_funcall(rpara, rb_intern("to_f"), 0);
1702
+ }
1703
+
1704
+ i_idx = NUM2INT(idx);
1705
+ i_rpara = (real)NUM2DBL(rpara);
1706
+
1707
+
1708
+ swrsvl_(&i_idx, &i_rpara);
1709
+
1710
+ return Qnil;
1711
+
1712
+ }
1713
+
1714
+ static VALUE
1715
+ dcl_swrqin(obj, cp)
1716
+ VALUE obj, cp;
1717
+ {
1718
+ char *i_cp;
1719
+ integer o_in;
1720
+ VALUE in;
1721
+
1722
+ if (TYPE(cp) != T_STRING) {
1723
+ cp = rb_funcall(cp, rb_intern("to_str"), 0);
1724
+ }
1725
+
1726
+ i_cp = StringValuePtr(cp);
1727
+
1728
+
1729
+ swrqin_(i_cp, &o_in, (ftnlen)strlen(i_cp));
1730
+
1731
+ in = INT2NUM(o_in);
1732
+
1733
+
1734
+ return in;
1735
+
1736
+ }
1737
+
1738
+ #if DCLVER >= 530
1739
+
1740
+ static VALUE
1741
+ dcl_swcmll(obj)
1742
+ VALUE obj;
1743
+ {
1744
+ swcmll_();
1745
+
1746
+ return Qnil;
1747
+
1748
+ }
1749
+
1750
+ #endif
1751
+
1752
+ #if DCLVER >= 530
1753
+
1754
+ static VALUE
1755
+ dcl_swqcmn(obj)
1756
+ VALUE obj;
1757
+ {
1758
+ integer o_nn;
1759
+ VALUE nn;
1760
+
1761
+ swqcmn_(&o_nn);
1762
+
1763
+ nn = INT2NUM(o_nn);
1764
+
1765
+
1766
+ return nn;
1767
+
1768
+ }
1769
+
1770
+ #endif
1771
+
1772
+ #if DCLVER >= 530
1773
+
1774
+ static VALUE
1775
+ dcl_swqcmf(obj, ntx)
1776
+ VALUE obj, ntx;
1777
+ {
1778
+ integer i_ntx;
1779
+ char *o_ctf;
1780
+ VALUE ctf;
1781
+
1782
+ if ((TYPE(ntx) != T_BIGNUM) || (TYPE(ntx) != T_FIXNUM)) {
1783
+ ntx = rb_funcall(ntx, rb_intern("to_i"), 0);
1784
+ }
1785
+
1786
+ i_ntx = NUM2INT(ntx);
1787
+
1788
+ o_ctf= ALLOCA_N(char, (DFLT_SIZE+1));
1789
+ memset(o_ctf, '\0', DFLT_SIZE+1);
1790
+
1791
+ swqcmf_(&i_ntx, o_ctf, (ftnlen)DFLT_SIZE);
1792
+
1793
+ ctf = rb_str_new2(o_ctf);
1794
+
1795
+
1796
+ return ctf;
1797
+
1798
+ }
1799
+
1800
+ #endif
1801
+
1802
+ #if DCLVER >= 530
1803
+
1804
+ static VALUE
1805
+ dcl_swqcmd(obj, ntx)
1806
+ VALUE obj, ntx;
1807
+ {
1808
+ integer i_ntx;
1809
+ char *o_ctd;
1810
+ VALUE ctd;
1811
+
1812
+ if ((TYPE(ntx) != T_BIGNUM) || (TYPE(ntx) != T_FIXNUM)) {
1813
+ ntx = rb_funcall(ntx, rb_intern("to_i"), 0);
1814
+ }
1815
+
1816
+ i_ntx = NUM2INT(ntx);
1817
+
1818
+ o_ctd= ALLOCA_N(char, (DFLT_SIZE+1));
1819
+ memset(o_ctd, '\0', DFLT_SIZE+1);
1820
+
1821
+ swqcmd_(&i_ntx, o_ctd, (ftnlen)DFLT_SIZE);
1822
+
1823
+ ctd = rb_str_new2(o_ctd);
1824
+
1825
+
1826
+ return ctd;
1827
+
1828
+ }
1829
+
1830
+ #endif
1831
+ void
1832
+ init_grph1_swpack(mDCL)
1833
+ VALUE mDCL;
1834
+ {
1835
+ rb_define_module_function(mDCL, "swdopn", dcl_swdopn, 0);
1836
+ rb_define_module_function(mDCL, "swdcls", dcl_swdcls, 0);
1837
+ rb_define_module_function(mDCL, "swpopn", dcl_swpopn, 0);
1838
+ rb_define_module_function(mDCL, "swpcls", dcl_swpcls, 0);
1839
+ rb_define_module_function(mDCL, "swoopn", dcl_swoopn, 2);
1840
+ rb_define_module_function(mDCL, "swocls", dcl_swocls, 1);
1841
+ rb_define_module_function(mDCL, "swswdi", dcl_swswdi, 1);
1842
+ rb_define_module_function(mDCL, "swscli", dcl_swscli, 1);
1843
+ rb_define_module_function(mDCL, "swgopn", dcl_swgopn, 0);
1844
+ rb_define_module_function(mDCL, "swgmov", dcl_swgmov, 2);
1845
+ rb_define_module_function(mDCL, "swgplt", dcl_swgplt, 2);
1846
+ rb_define_module_function(mDCL, "swgcls", dcl_swgcls, 0);
1847
+ rb_define_module_function(mDCL, "swgton", dcl_swgton, 4);
1848
+ rb_define_module_function(mDCL, "swiopn", dcl_swiopn, 4);
1849
+ rb_define_module_function(mDCL, "swidat", dcl_swidat, 2);
1850
+ rb_define_module_function(mDCL, "swicls", dcl_swicls, 0);
1851
+ rb_define_module_function(mDCL, "swqpnt", dcl_swqpnt, 0);
1852
+ rb_define_module_function(mDCL, "swfint", dcl_swfint, 2);
1853
+ rb_define_module_function(mDCL, "swiint", dcl_swiint, 2);
1854
+ rb_define_module_function(mDCL, "swqwdc", dcl_swqwdc, 0);
1855
+ rb_define_module_function(mDCL, "swqclc", dcl_swqclc, 0);
1856
+ rb_define_module_function(mDCL, "swqtnc", dcl_swqtnc, 0);
1857
+ rb_define_module_function(mDCL, "swqimc", dcl_swqimc, 0);
1858
+ rb_define_module_function(mDCL, "swqptc", dcl_swqptc, 0);
1859
+ rb_define_module_function(mDCL, "swqrct", dcl_swqrct, 0);
1860
+ rb_define_module_function(mDCL, "swsrot", dcl_swsrot, 1);
1861
+ rb_define_module_function(mDCL, "swpqnp", dcl_swpqnp, 0);
1862
+ rb_define_module_function(mDCL, "swpqid", dcl_swpqid, 1);
1863
+ rb_define_module_function(mDCL, "swpqcp", dcl_swpqcp, 1);
1864
+ rb_define_module_function(mDCL, "swpqcl", dcl_swpqcl, 1);
1865
+ rb_define_module_function(mDCL, "swpqit", dcl_swpqit, 1);
1866
+ rb_define_module_function(mDCL, "swpqvl", dcl_swpqvl, 1);
1867
+ rb_define_module_function(mDCL, "swpsvl", dcl_swpsvl, 2);
1868
+ rb_define_module_function(mDCL, "swpqin", dcl_swpqin, 1);
1869
+ rb_define_module_function(mDCL, "swcget", dcl_swcget, 1);
1870
+ rb_define_module_function(mDCL, "swcset", dcl_swcset, 2);
1871
+ rb_define_module_function(mDCL, "swcstx", dcl_swcstx, 2);
1872
+ rb_define_module_function(mDCL, "swqfnm", dcl_swqfnm, 1);
1873
+ rb_define_module_function(mDCL, "swcqnp", dcl_swcqnp, 0);
1874
+ rb_define_module_function(mDCL, "swcqid", dcl_swcqid, 1);
1875
+ rb_define_module_function(mDCL, "swcqcp", dcl_swcqcp, 1);
1876
+ rb_define_module_function(mDCL, "swcqcl", dcl_swcqcl, 1);
1877
+ rb_define_module_function(mDCL, "swcqvl", dcl_swcqvl, 1);
1878
+ rb_define_module_function(mDCL, "swcsvl", dcl_swcsvl, 2);
1879
+ rb_define_module_function(mDCL, "swcqin", dcl_swcqin, 1);
1880
+ rb_define_module_function(mDCL, "swiget", dcl_swiget, 1);
1881
+ rb_define_module_function(mDCL, "swiset", dcl_swiset, 2);
1882
+ rb_define_module_function(mDCL, "swistx", dcl_swistx, 2);
1883
+ rb_define_module_function(mDCL, "swiqnp", dcl_swiqnp, 0);
1884
+ rb_define_module_function(mDCL, "swiqid", dcl_swiqid, 1);
1885
+ rb_define_module_function(mDCL, "swiqcp", dcl_swiqcp, 1);
1886
+ rb_define_module_function(mDCL, "swiqcl", dcl_swiqcl, 1);
1887
+ rb_define_module_function(mDCL, "swiqvl", dcl_swiqvl, 1);
1888
+ rb_define_module_function(mDCL, "swisvl", dcl_swisvl, 2);
1889
+ rb_define_module_function(mDCL, "swiqin", dcl_swiqin, 1);
1890
+ rb_define_module_function(mDCL, "swlget", dcl_swlget, 1);
1891
+ rb_define_module_function(mDCL, "swlset", dcl_swlset, 2);
1892
+ rb_define_module_function(mDCL, "swlstx", dcl_swlstx, 2);
1893
+ rb_define_module_function(mDCL, "swlqnp", dcl_swlqnp, 0);
1894
+ rb_define_module_function(mDCL, "swlqid", dcl_swlqid, 1);
1895
+ rb_define_module_function(mDCL, "swlqcp", dcl_swlqcp, 1);
1896
+ rb_define_module_function(mDCL, "swlqcl", dcl_swlqcl, 1);
1897
+ rb_define_module_function(mDCL, "swlqvl", dcl_swlqvl, 1);
1898
+ rb_define_module_function(mDCL, "swlsvl", dcl_swlsvl, 2);
1899
+ rb_define_module_function(mDCL, "swlqin", dcl_swlqin, 1);
1900
+ rb_define_module_function(mDCL, "swrget", dcl_swrget, 1);
1901
+ rb_define_module_function(mDCL, "swrset", dcl_swrset, 2);
1902
+ rb_define_module_function(mDCL, "swrstx", dcl_swrstx, 2);
1903
+ rb_define_module_function(mDCL, "swrqnp", dcl_swrqnp, 0);
1904
+ rb_define_module_function(mDCL, "swrqid", dcl_swrqid, 1);
1905
+ rb_define_module_function(mDCL, "swrqcp", dcl_swrqcp, 1);
1906
+ rb_define_module_function(mDCL, "swrqcl", dcl_swrqcl, 1);
1907
+ rb_define_module_function(mDCL, "swrqvl", dcl_swrqvl, 1);
1908
+ rb_define_module_function(mDCL, "swrsvl", dcl_swrsvl, 2);
1909
+ rb_define_module_function(mDCL, "swrqin", dcl_swrqin, 1);
1910
+ #if DCLVER >= 530
1911
+ rb_define_module_function(mDCL, "swcmll", dcl_swcmll, 0);
1912
+ #endif
1913
+ #if DCLVER >= 530
1914
+ rb_define_module_function(mDCL, "swqcmn", dcl_swqcmn, 0);
1915
+ #endif
1916
+ #if DCLVER >= 530
1917
+ rb_define_module_function(mDCL, "swqcmf", dcl_swqcmf, 1);
1918
+ #endif
1919
+ #if DCLVER >= 530
1920
+ rb_define_module_function(mDCL, "swqcmd", dcl_swqcmd, 1);
1921
+ #endif
1922
+ }