ruby-dcl 1.6.2
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +321 -0
- data/GenWrapper/Makefile +14 -0
- data/GenWrapper/cproto2init.rb +41 -0
- data/GenWrapper/dcl_narrayed_funcs.rb +181 -0
- data/GenWrapper/dcl_rb_footing +29 -0
- data/GenWrapper/dcl_rb_heading +129 -0
- data/GenWrapper/def.rb +20 -0
- data/GenWrapper/elim_ary_size.rb +398 -0
- data/GenWrapper/etc/Mk_proto +375 -0
- data/GenWrapper/etc/dcl_gen +13 -0
- data/GenWrapper/etc/p_header +63 -0
- data/GenWrapper/etc/p_init +410 -0
- data/GenWrapper/pparse.rb +137 -0
- data/GenWrapper/proto/Makefile +35 -0
- data/GenWrapper/proto/grph1_00 +17 -0
- data/GenWrapper/proto/grph1_csgi.fp +27 -0
- data/GenWrapper/proto/grph1_scpack.fp +442 -0
- data/GenWrapper/proto/grph1_sgpack.fp +1406 -0
- data/GenWrapper/proto/grph1_slpack.fp +316 -0
- data/GenWrapper/proto/grph1_stpack.fp +411 -0
- data/GenWrapper/proto/grph1_swpack.fp +746 -0
- data/GenWrapper/proto/grph2_00 +16 -0
- data/GenWrapper/proto/grph2_grpack.fp +139 -0
- data/GenWrapper/proto/grph2_ucpack.fp +522 -0
- data/GenWrapper/proto/grph2_udpack.fp +692 -0
- data/GenWrapper/proto/grph2_uepack.fp +601 -0
- data/GenWrapper/proto/grph2_ugpack.fp +436 -0
- data/GenWrapper/proto/grph2_uhpack.fp +246 -0
- data/GenWrapper/proto/grph2_ulpack.fp +516 -0
- data/GenWrapper/proto/grph2_umpack.fp +676 -0
- data/GenWrapper/proto/grph2_uspack.fp +989 -0
- data/GenWrapper/proto/grph2_uupack.fp +663 -0
- data/GenWrapper/proto/grph2_uvpack.fp +246 -0
- data/GenWrapper/proto/grph2_uwpack.fp +203 -0
- data/GenWrapper/proto/grph2_uxpack.fp +295 -0
- data/GenWrapper/proto/grph2_uypack.fp +295 -0
- data/GenWrapper/proto/grph2_uzpack.fp +574 -0
- data/GenWrapper/proto/math1_00 +12 -0
- data/GenWrapper/proto/math1_blklib.fp +58 -0
- data/GenWrapper/proto/math1_chrlib.fp +83 -0
- data/GenWrapper/proto/math1_fnclib.fp +79 -0
- data/GenWrapper/proto/math1_gnmlib.fp +118 -0
- data/GenWrapper/proto/math1_gt2dlib.fp +144 -0
- data/GenWrapper/proto/math1_ifalib.fp +123 -0
- data/GenWrapper/proto/math1_indxlib.fp +222 -0
- data/GenWrapper/proto/math1_intlib.fp +46 -0
- data/GenWrapper/proto/math1_lrllib.fp +276 -0
- data/GenWrapper/proto/math1_maplib.fp +24 -0
- data/GenWrapper/proto/math1_oslib.fp +28 -0
- data/GenWrapper/proto/math1_rfalib.fp +420 -0
- data/GenWrapper/proto/math1_rfblib.fp +51 -0
- data/GenWrapper/proto/math1_sublib.fp +60 -0
- data/GenWrapper/proto/math1_syslib.fp +767 -0
- data/GenWrapper/proto/math1_vialib.fp +339 -0
- data/GenWrapper/proto/math1_viblib.fp +264 -0
- data/GenWrapper/proto/math1_vralib.fp +339 -0
- data/GenWrapper/proto/math1_vrblib.fp +264 -0
- data/GenWrapper/proto/math1_xfclib.fp +68 -0
- data/GenWrapper/proto/math2_00 +12 -0
- data/GenWrapper/proto/math2_fftlib.fp +803 -0
- data/GenWrapper/proto/math2_intrlib.fp +32 -0
- data/GenWrapper/proto/math2_odelib.fp_notused +568 -0
- data/GenWrapper/proto/math2_rnmlib.fp +54 -0
- data/GenWrapper/proto/math2_shtlib.fp +1292 -0
- data/GenWrapper/proto/math2_shtlib.fp_old +1294 -0
- data/GenWrapper/proto/math2_vstlib.fp +84 -0
- data/GenWrapper/proto/misc1_00 +17 -0
- data/GenWrapper/proto/misc1_chnlib.fp +47 -0
- data/GenWrapper/proto/misc1_datelib.fp +352 -0
- data/GenWrapper/proto/misc1_fmtlib.fp +19 -0
- data/GenWrapper/proto/misc1_misclib.fp +26 -0
- data/GenWrapper/proto/misc1_randlib.fp +36 -0
- data/GenWrapper/proto/misc1_timelib.fp +151 -0
- data/GenWrapper/proto2c.rb +13 -0
- data/GenWrapper/prototype.rb +209 -0
- data/GenWrapper/util.rb +9 -0
- data/GenWrapper/variable.rb +671 -0
- data/README +29 -0
- data/Rakefile +44 -0
- data/ToDo +2 -0
- data/dcl_cary2obj.c +354 -0
- data/dcl_narrayed_funcs.c +518 -0
- data/dcl_obj2cary.c +512 -0
- data/dcl_rubydcloriginal.c +129 -0
- data/demo/gokuraku/hop/hop.rb +26 -0
- data/demo/gokuraku/jump/jump1.rb +64 -0
- data/demo/gokuraku/jump/jump2.rb +50 -0
- data/demo/gokuraku/layout/lay1.rb +46 -0
- data/demo/gokuraku/layout/lay2.rb +44 -0
- data/demo/gokuraku/step/step0.rb +34 -0
- data/demo/gokuraku/step/step1.rb +84 -0
- data/demo/gokuraku/step/step2.rb +62 -0
- data/demo/gokuraku/u1d/u1d1.rb +37 -0
- data/demo/gokuraku/u1d/u1d2.rb +50 -0
- data/demo/gokuraku/u2d/u2d1.rb +46 -0
- data/demo/gokuraku/u2d/u2d2.rb +49 -0
- data/demo/gokuraku/u2d/u2d3.rb +45 -0
- data/demo/gokuraku/u2d/u2d4.rb +61 -0
- data/demo/grph1/scpack/scpkt2.rb +40 -0
- data/demo/grph1/scpack/scpkt3.rb +102 -0
- data/demo/grph1/scpack/scpkt6.rb +84 -0
- data/demo/grph1/scpack/scpkt7.rb +59 -0
- data/demo/grph1/scpack/scpkt8.rb +60 -0
- data/demo/grph1/scpack/t810630.dat +296 -0
- data/demo/grph1/scpack/t811231.dat +296 -0
- data/demo/grph1/sgpack/sgfont.rb +52 -0
- data/demo/grph1/sgpack/sgfonz.rb +53 -0
- data/demo/grph1/sgpack/sgksx1.rb +44 -0
- data/demo/grph1/sgpack/sgksx2.rb +90 -0
- data/demo/grph1/sgpack/sgksx3.rb +75 -0
- data/demo/grph1/sgpack/sglidx.rb +40 -0
- data/demo/grph1/sgpack/sgltyp.rb +48 -0
- data/demo/grph1/sgpack/sgpk01.rb +39 -0
- data/demo/grph1/sgpack/sgpk02.rb +79 -0
- data/demo/grph1/sgpack/sgpk03.rb +107 -0
- data/demo/grph1/sgpack/sgpk04.rb +86 -0
- data/demo/grph1/sgpack/sgpk05.rb +66 -0
- data/demo/grph1/sgpack/sgpk06.rb +91 -0
- data/demo/grph1/sgpack/sgpk07.rb +66 -0
- data/demo/grph1/sgpack/sgpk08.rb +67 -0
- data/demo/grph1/sgpack/sgpk09.rb +61 -0
- data/demo/grph1/sgpack/sgpk10.rb +58 -0
- data/demo/grph1/sgpack/sgtclr.rb +59 -0
- data/demo/grph1/sgpack/sgtone.rb +70 -0
- data/demo/grph1/sgpack/sgtonz.rb +66 -0
- data/demo/grph1/slpack/slpk01.rb +37 -0
- data/demo/grph1/slpack/slpk02.rb +29 -0
- data/demo/grph1/slpack/slpk03.rb +36 -0
- data/demo/grph1/slpack/slpk04.rb +36 -0
- data/demo/grph2/g2pack/g2pk01.rb +78 -0
- data/demo/grph2/g2pack/g2pk02.rb +75 -0
- data/demo/grph2/grpack/grpk01.rb +65 -0
- data/demo/grph2/ucpack/ucpk01.rb +95 -0
- data/demo/grph2/ucpack/ucpk02.rb +95 -0
- data/demo/grph2/udegpk/u2df01.rb +50 -0
- data/demo/grph2/udegpk/u2df02.rb +76 -0
- data/demo/grph2/udegpk/u2df03.rb +80 -0
- data/demo/grph2/udegpk/u2df04.rb +52 -0
- data/demo/grph2/udegpk/u2df05.rb +70 -0
- data/demo/grph2/udegpk/u2df06.rb +59 -0
- data/demo/grph2/udegpk/u2df07.rb +68 -0
- data/demo/grph2/udegpk/u2df08.rb +91 -0
- data/demo/grph2/udegpk/u2df09b.rb +88 -0
- data/demo/grph2/udegpk/u2df09c.rb +89 -0
- data/demo/grph2/udegpk/u2df09e.rb +88 -0
- data/demo/grph2/udegpk/u2df09f.rb +89 -0
- data/demo/grph2/ulpack/ulpk01.rb +111 -0
- data/demo/grph2/ulpack/ulpk01n.rb +111 -0
- data/demo/grph2/ulpack/ulpk02.rb +111 -0
- data/demo/grph2/ulpack/ulpk02n.rb +111 -0
- data/demo/grph2/umpack/t811231.dat +296 -0
- data/demo/grph2/umpack/test01.rb +69 -0
- data/demo/grph2/umpack/test02.rb +64 -0
- data/demo/grph2/umpack/test03.rb +84 -0
- data/demo/grph2/umpack/test04.rb +54 -0
- data/demo/grph2/umpack/test05.rb +85 -0
- data/demo/grph2/umpack/test06.rb +44 -0
- data/demo/grph2/umpack/test07.rb +43 -0
- data/demo/grph2/umpack/test08.rb +37 -0
- data/demo/grph2/umpack/test09.rb +86 -0
- data/demo/grph2/umpack/test10.rb +52 -0
- data/demo/grph2/umpack/umpk01.rb +65 -0
- data/demo/grph2/umpack/umpk02.rb +54 -0
- data/demo/grph2/umpack/umpk03.rb +46 -0
- data/demo/grph2/umpack/umpk04.rb +65 -0
- data/demo/grph2/umpack/umpk05.rb +84 -0
- data/demo/grph2/uspack/uspk01.rb +39 -0
- data/demo/grph2/uspack/uspk02.rb +47 -0
- data/demo/grph2/uspack/uspk03.rb +38 -0
- data/demo/grph2/uspack/uspk04.rb +64 -0
- data/demo/grph2/uspack/uspk05.rb +68 -0
- data/demo/grph2/uspack/uspk06.rb +43 -0
- data/demo/grph2/uspack/uspk07.rb +62 -0
- data/demo/grph2/uspack/uspk08.rb +46 -0
- data/demo/grph2/uspack/uspk09.rb +89 -0
- data/demo/grph2/uspack/uspk10.rb +48 -0
- data/demo/grph2/uspack/uspk11.rb +71 -0
- data/demo/grph2/uspack/uspk12.rb +51 -0
- data/demo/grph2/uupack/uupk01.rb +50 -0
- data/demo/grph2/uupack/uupk02.rb +74 -0
- data/demo/grph2/uupack/uupk03.rb +56 -0
- data/demo/grph2/uupack/uupk04.rb +84 -0
- data/demo/grph2/uupack/uupk05.rb +74 -0
- data/demo/grph2/uupack/uupk06.rb +77 -0
- data/demo/grph2/uupack/uupk07.rb +88 -0
- data/demo/grph2/uxyzpk/uxyz01.rb +38 -0
- data/demo/grph2/uxyzpk/uxyz02.rb +36 -0
- data/demo/grph2/uxyzpk/uxyz03.rb +37 -0
- data/demo/grph2/uxyzpk/uxyz04.rb +54 -0
- data/demo/grph2/uxyzpk/uxyz05.rb +41 -0
- data/demo/grph2/uxyzpk/uxyz06.rb +42 -0
- data/demo/grph2/uxyzpk/uxyz07.rb +38 -0
- data/demo/grph2/uxyzpk/uxyz08.rb +60 -0
- data/demo/grph2/uxyzpk/uxyz09.rb +52 -0
- data/demo/grph2/uxyzpk/uxyz10.rb +57 -0
- data/demo/grph2/ximage/MEMO +23 -0
- data/demo/grph2/ximage/tomsclm.dat +1344 -0
- data/demo/grph2/ximage/ximg01.rb +145 -0
- data/demo/math1/gt2dlib/gt2d01.rb +33 -0
- data/demo/math2/fftlib/fftl01.rb +28 -0
- data/demo/math2/fftlib/fftl02.rb +224 -0
- data/demo/math2/intrlib/intr01.rb +22 -0
- data/demo/math2/rnmlib/rnml01.rb +21 -0
- data/demo/math2/vstlib/vstl01.rb +29 -0
- data/demo/math2/vstlib/vstl02.rb +38 -0
- data/demo/rakuraku/color/color1.rb +61 -0
- data/demo/rakuraku/color/color2.rb +57 -0
- data/demo/rakuraku/color/color3.rb +81 -0
- data/demo/rakuraku/kihon/kihon1.rb +39 -0
- data/demo/rakuraku/kihon/kihon2.rb +56 -0
- data/demo/rakuraku/kihon/kihon3.rb +57 -0
- data/demo/rakuraku/kihon/kihon4.rb +70 -0
- data/demo/rakuraku/kihon/kihon5.rb +56 -0
- data/demo/rakuraku/kihon/kihon6.rb +40 -0
- data/demo/rakuraku/kihon/kihon7.rb +98 -0
- data/demo/rakuraku/kihon/kihon8.rb +93 -0
- data/demo/rakuraku/kihon/kihon9.rb +77 -0
- data/demo/rakuraku/kihon/kihona.rb +123 -0
- data/demo/rakuraku/kihon/kihonb.rb +73 -0
- data/demo/rakuraku/kihon/kihonc.rb +110 -0
- data/demo/rakuraku/layout/lay1.rb +29 -0
- data/demo/rakuraku/layout/lay2.rb +28 -0
- data/demo/rakuraku/layout/lay3.rb +29 -0
- data/demo/rakuraku/map3d/map3d1.rb +68 -0
- data/demo/rakuraku/map3d/map3d2.rb +67 -0
- data/demo/rakuraku/map3d/map3d3.rb +66 -0
- data/demo/rakuraku/map3d/map3d4.rb +107 -0
- data/demo/rakuraku/map3d/map3d5.rb +118 -0
- data/demo/rakuraku/map3d/map3d6.rb +96 -0
- data/demo/rakuraku/map3d/map3d7.rb +98 -0
- data/demo/rakuraku/miss/miss1.rb +76 -0
- data/demo/rakuraku/miss/miss2.rb +60 -0
- data/demo/rakuraku/quick/quick1.rb +35 -0
- data/demo/rakuraku/quick/quick2.rb +33 -0
- data/demo/rakuraku/quick/quick3.rb +46 -0
- data/demo/rakuraku/quick/quick4.rb +47 -0
- data/demo/rakuraku/quick/quick5.rb +46 -0
- data/demo/rakuraku/u2d/u2d1.rb +50 -0
- data/demo/rakuraku/u2d/u2d2.rb +51 -0
- data/demo/rakuraku/u2d/u2d3.rb +70 -0
- data/demo/rakuraku/u2d/u2d4.rb +59 -0
- data/demo/rakuraku/u2d/u2d5.rb +61 -0
- data/demo/rakuraku/u2d/u2d6.rb +57 -0
- data/demo/rakuraku/u2d/u2d7.rb +103 -0
- data/demo/rakuraku/uspack/uspac1.rb +35 -0
- data/demo/rakuraku/uspack/uspac2.rb +66 -0
- data/demo/rakuraku/uspack/uspac3.rb +37 -0
- data/demo/rakuraku/uspack/uspac4.rb +49 -0
- data/demo/rakuraku/uxyz/uxyz1.rb +37 -0
- data/demo/rakuraku/uxyz/uxyz2.rb +35 -0
- data/demo/rakuraku/uxyz/uxyz3.rb +38 -0
- data/demo/rakuraku/uxyz/uxyz4.rb +36 -0
- data/demo/rakuraku/uxyz/uxyz5.rb +57 -0
- data/demo/rakuraku/uxyz/uxyz6.rb +43 -0
- data/demo/rakuraku/uxyz/uxyz7.rb +39 -0
- data/demo/rakuraku/uxyz/uxyz8.rb +56 -0
- data/demo/rubydcloriginal/uemrkz1.rb +37 -0
- data/dummy.c +9 -0
- data/extconf.rb +133 -0
- data/grph1_csgi.c +119 -0
- data/grph1_scpack.c +1388 -0
- data/grph1_sgpack.c +3876 -0
- data/grph1_slpack.c +432 -0
- data/grph1_stpack.c +1044 -0
- data/grph1_swpack.c +1922 -0
- data/grph1_zgpack.c.org +141 -0
- data/grph2_grpack.c +368 -0
- data/grph2_ucpack.c +1232 -0
- data/grph2_udpack.c +1404 -0
- data/grph2_uepack.c +1443 -0
- data/grph2_ugpack.c +1073 -0
- data/grph2_uhpack.c +943 -0
- data/grph2_ulpack.c +1304 -0
- data/grph2_umpack.c +1540 -0
- data/grph2_uspack.c +2481 -0
- data/grph2_uupack.c +1689 -0
- data/grph2_uvpack.c +943 -0
- data/grph2_uwpack.c +552 -0
- data/grph2_uxpack.c +555 -0
- data/grph2_uypack.c +555 -0
- data/grph2_uzpack.c +1455 -0
- data/init.c.default +187 -0
- data/init.c.gtk +189 -0
- data/lib/dcl.rb +5084 -0
- data/math1_blklib.c +227 -0
- data/math1_chrlib.c +239 -0
- data/math1_fnclib.c +254 -0
- data/math1_gnmlib.c +356 -0
- data/math1_gt2dlib.c +514 -0
- data/math1_ifalib.c +427 -0
- data/math1_indxlib.c +709 -0
- data/math1_intlib.c +167 -0
- data/math1_lrllib.c +817 -0
- data/math1_maplib.c +172 -0
- data/math1_oslib.c +111 -0
- data/math1_rfalib.c +1417 -0
- data/math1_rfblib.c +232 -0
- data/math1_sublib.c +221 -0
- data/math1_syslib.c +2025 -0
- data/math1_vialib.c +1156 -0
- data/math1_viblib.c +1027 -0
- data/math1_vralib.c +1156 -0
- data/math1_vrblib.c +1027 -0
- data/math1_xfclib.c +142 -0
- data/math2_fftlib.c +833 -0
- data/math2_intrlib.c +138 -0
- data/math2_rnmlib.c +226 -0
- data/math2_shtlib.c +1568 -0
- data/math2_vstlib.c +366 -0
- data/misc1_chnlib.c +179 -0
- data/misc1_datelib.c +953 -0
- data/misc1_fmtlib.c +99 -0
- data/misc1_misclib.c +118 -0
- data/misc1_randlib.c +142 -0
- data/misc1_timelib.c +380 -0
- data/obsolete/README +2 -0
- data/obsolete/dcl_ext.html +112 -0
- data/obsolete/dcl_ext.rb +313 -0
- metadata +433 -0
data/misc1_datelib.c
ADDED
@@ -0,0 +1,953 @@
|
|
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_date12(obj, idate)
|
66
|
+
VALUE obj, idate;
|
67
|
+
{
|
68
|
+
integer i_idate;
|
69
|
+
integer o_iy;
|
70
|
+
integer o_itd;
|
71
|
+
VALUE iy;
|
72
|
+
VALUE itd;
|
73
|
+
|
74
|
+
if ((TYPE(idate) != T_BIGNUM) || (TYPE(idate) != T_FIXNUM)) {
|
75
|
+
idate = rb_funcall(idate, rb_intern("to_i"), 0);
|
76
|
+
}
|
77
|
+
|
78
|
+
i_idate = NUM2INT(idate);
|
79
|
+
|
80
|
+
|
81
|
+
date12_(&i_idate, &o_iy, &o_itd);
|
82
|
+
|
83
|
+
iy = INT2NUM(o_iy);
|
84
|
+
itd = INT2NUM(o_itd);
|
85
|
+
|
86
|
+
|
87
|
+
return rb_ary_new3(2, iy, itd);
|
88
|
+
|
89
|
+
}
|
90
|
+
|
91
|
+
static VALUE
|
92
|
+
dcl_date13(obj, idate)
|
93
|
+
VALUE obj, idate;
|
94
|
+
{
|
95
|
+
integer i_idate;
|
96
|
+
integer o_iy;
|
97
|
+
integer o_im;
|
98
|
+
integer o_id;
|
99
|
+
VALUE iy;
|
100
|
+
VALUE im;
|
101
|
+
VALUE id;
|
102
|
+
|
103
|
+
if ((TYPE(idate) != T_BIGNUM) || (TYPE(idate) != T_FIXNUM)) {
|
104
|
+
idate = rb_funcall(idate, rb_intern("to_i"), 0);
|
105
|
+
}
|
106
|
+
|
107
|
+
i_idate = NUM2INT(idate);
|
108
|
+
|
109
|
+
|
110
|
+
date13_(&i_idate, &o_iy, &o_im, &o_id);
|
111
|
+
|
112
|
+
iy = INT2NUM(o_iy);
|
113
|
+
im = INT2NUM(o_im);
|
114
|
+
id = INT2NUM(o_id);
|
115
|
+
|
116
|
+
|
117
|
+
return rb_ary_new3(3, iy, im, id);
|
118
|
+
|
119
|
+
}
|
120
|
+
|
121
|
+
static VALUE
|
122
|
+
dcl_date21(obj, iy, itd)
|
123
|
+
VALUE obj, iy, itd;
|
124
|
+
{
|
125
|
+
integer o_idate;
|
126
|
+
integer i_iy;
|
127
|
+
integer i_itd;
|
128
|
+
VALUE idate;
|
129
|
+
|
130
|
+
if ((TYPE(iy) != T_BIGNUM) || (TYPE(iy) != T_FIXNUM)) {
|
131
|
+
iy = rb_funcall(iy, rb_intern("to_i"), 0);
|
132
|
+
}
|
133
|
+
if ((TYPE(itd) != T_BIGNUM) || (TYPE(itd) != T_FIXNUM)) {
|
134
|
+
itd = rb_funcall(itd, rb_intern("to_i"), 0);
|
135
|
+
}
|
136
|
+
|
137
|
+
i_iy = NUM2INT(iy);
|
138
|
+
i_itd = NUM2INT(itd);
|
139
|
+
|
140
|
+
|
141
|
+
date21_(&o_idate, &i_iy, &i_itd);
|
142
|
+
|
143
|
+
idate = INT2NUM(o_idate);
|
144
|
+
|
145
|
+
|
146
|
+
return idate;
|
147
|
+
|
148
|
+
}
|
149
|
+
|
150
|
+
static VALUE
|
151
|
+
dcl_date23(obj, iy, itd)
|
152
|
+
VALUE obj, iy, itd;
|
153
|
+
{
|
154
|
+
integer io_iy;
|
155
|
+
integer o_im;
|
156
|
+
integer o_id;
|
157
|
+
integer i_itd;
|
158
|
+
VALUE im;
|
159
|
+
VALUE id;
|
160
|
+
|
161
|
+
if ((TYPE(iy) != T_BIGNUM) || (TYPE(iy) != T_FIXNUM)) {
|
162
|
+
iy = rb_funcall(iy, rb_intern("to_i"), 0);
|
163
|
+
}
|
164
|
+
if ((TYPE(itd) != T_BIGNUM) || (TYPE(itd) != T_FIXNUM)) {
|
165
|
+
itd = rb_funcall(itd, rb_intern("to_i"), 0);
|
166
|
+
}
|
167
|
+
|
168
|
+
io_iy = NUM2INT(iy);
|
169
|
+
i_itd = NUM2INT(itd);
|
170
|
+
|
171
|
+
|
172
|
+
date23_(&io_iy, &o_im, &o_id, &i_itd);
|
173
|
+
|
174
|
+
iy = INT2NUM(io_iy);
|
175
|
+
im = INT2NUM(o_im);
|
176
|
+
id = INT2NUM(o_id);
|
177
|
+
|
178
|
+
|
179
|
+
return rb_ary_new3(3, iy, im, id);
|
180
|
+
|
181
|
+
}
|
182
|
+
|
183
|
+
static VALUE
|
184
|
+
dcl_date31(obj, iy, im, id)
|
185
|
+
VALUE obj, iy, im, id;
|
186
|
+
{
|
187
|
+
integer o_idate;
|
188
|
+
integer i_iy;
|
189
|
+
integer i_im;
|
190
|
+
integer i_id;
|
191
|
+
VALUE idate;
|
192
|
+
|
193
|
+
if ((TYPE(iy) != T_BIGNUM) || (TYPE(iy) != T_FIXNUM)) {
|
194
|
+
iy = rb_funcall(iy, rb_intern("to_i"), 0);
|
195
|
+
}
|
196
|
+
if ((TYPE(im) != T_BIGNUM) || (TYPE(im) != T_FIXNUM)) {
|
197
|
+
im = rb_funcall(im, rb_intern("to_i"), 0);
|
198
|
+
}
|
199
|
+
if ((TYPE(id) != T_BIGNUM) || (TYPE(id) != T_FIXNUM)) {
|
200
|
+
id = rb_funcall(id, rb_intern("to_i"), 0);
|
201
|
+
}
|
202
|
+
|
203
|
+
i_iy = NUM2INT(iy);
|
204
|
+
i_im = NUM2INT(im);
|
205
|
+
i_id = NUM2INT(id);
|
206
|
+
|
207
|
+
|
208
|
+
date31_(&o_idate, &i_iy, &i_im, &i_id);
|
209
|
+
|
210
|
+
idate = INT2NUM(o_idate);
|
211
|
+
|
212
|
+
|
213
|
+
return idate;
|
214
|
+
|
215
|
+
}
|
216
|
+
|
217
|
+
static VALUE
|
218
|
+
dcl_date32(obj, iy, im, id)
|
219
|
+
VALUE obj, iy, im, id;
|
220
|
+
{
|
221
|
+
integer io_iy;
|
222
|
+
integer i_im;
|
223
|
+
integer i_id;
|
224
|
+
integer o_itd;
|
225
|
+
VALUE itd;
|
226
|
+
|
227
|
+
if ((TYPE(iy) != T_BIGNUM) || (TYPE(iy) != T_FIXNUM)) {
|
228
|
+
iy = rb_funcall(iy, rb_intern("to_i"), 0);
|
229
|
+
}
|
230
|
+
if ((TYPE(im) != T_BIGNUM) || (TYPE(im) != T_FIXNUM)) {
|
231
|
+
im = rb_funcall(im, rb_intern("to_i"), 0);
|
232
|
+
}
|
233
|
+
if ((TYPE(id) != T_BIGNUM) || (TYPE(id) != T_FIXNUM)) {
|
234
|
+
id = rb_funcall(id, rb_intern("to_i"), 0);
|
235
|
+
}
|
236
|
+
|
237
|
+
io_iy = NUM2INT(iy);
|
238
|
+
i_im = NUM2INT(im);
|
239
|
+
i_id = NUM2INT(id);
|
240
|
+
|
241
|
+
|
242
|
+
date32_(&io_iy, &i_im, &i_id, &o_itd);
|
243
|
+
|
244
|
+
iy = INT2NUM(io_iy);
|
245
|
+
itd = INT2NUM(o_itd);
|
246
|
+
|
247
|
+
|
248
|
+
return rb_ary_new3(2, iy, itd);
|
249
|
+
|
250
|
+
}
|
251
|
+
|
252
|
+
static VALUE
|
253
|
+
dcl_datef1(obj, n, idate)
|
254
|
+
VALUE obj, n, idate;
|
255
|
+
{
|
256
|
+
integer i_n;
|
257
|
+
integer i_idate;
|
258
|
+
integer o_ndate;
|
259
|
+
VALUE ndate;
|
260
|
+
|
261
|
+
if ((TYPE(n) != T_BIGNUM) || (TYPE(n) != T_FIXNUM)) {
|
262
|
+
n = rb_funcall(n, rb_intern("to_i"), 0);
|
263
|
+
}
|
264
|
+
if ((TYPE(idate) != T_BIGNUM) || (TYPE(idate) != T_FIXNUM)) {
|
265
|
+
idate = rb_funcall(idate, rb_intern("to_i"), 0);
|
266
|
+
}
|
267
|
+
|
268
|
+
i_n = NUM2INT(n);
|
269
|
+
i_idate = NUM2INT(idate);
|
270
|
+
|
271
|
+
|
272
|
+
datef1_(&i_n, &i_idate, &o_ndate);
|
273
|
+
|
274
|
+
ndate = INT2NUM(o_ndate);
|
275
|
+
|
276
|
+
|
277
|
+
return ndate;
|
278
|
+
|
279
|
+
}
|
280
|
+
|
281
|
+
static VALUE
|
282
|
+
dcl_datef2(obj, n, iy, itd)
|
283
|
+
VALUE obj, n, iy, itd;
|
284
|
+
{
|
285
|
+
integer i_n;
|
286
|
+
integer i_iy;
|
287
|
+
integer i_itd;
|
288
|
+
integer o_ny;
|
289
|
+
integer o_ntd;
|
290
|
+
VALUE ny;
|
291
|
+
VALUE ntd;
|
292
|
+
|
293
|
+
if ((TYPE(n) != T_BIGNUM) || (TYPE(n) != T_FIXNUM)) {
|
294
|
+
n = rb_funcall(n, rb_intern("to_i"), 0);
|
295
|
+
}
|
296
|
+
if ((TYPE(iy) != T_BIGNUM) || (TYPE(iy) != T_FIXNUM)) {
|
297
|
+
iy = rb_funcall(iy, rb_intern("to_i"), 0);
|
298
|
+
}
|
299
|
+
if ((TYPE(itd) != T_BIGNUM) || (TYPE(itd) != T_FIXNUM)) {
|
300
|
+
itd = rb_funcall(itd, rb_intern("to_i"), 0);
|
301
|
+
}
|
302
|
+
|
303
|
+
i_n = NUM2INT(n);
|
304
|
+
i_iy = NUM2INT(iy);
|
305
|
+
i_itd = NUM2INT(itd);
|
306
|
+
|
307
|
+
|
308
|
+
datef2_(&i_n, &i_iy, &i_itd, &o_ny, &o_ntd);
|
309
|
+
|
310
|
+
ny = INT2NUM(o_ny);
|
311
|
+
ntd = INT2NUM(o_ntd);
|
312
|
+
|
313
|
+
|
314
|
+
return rb_ary_new3(2, ny, ntd);
|
315
|
+
|
316
|
+
}
|
317
|
+
|
318
|
+
static VALUE
|
319
|
+
dcl_datef3(obj, n, iy, im, id)
|
320
|
+
VALUE obj, n, iy, im, id;
|
321
|
+
{
|
322
|
+
integer i_n;
|
323
|
+
integer i_iy;
|
324
|
+
integer i_im;
|
325
|
+
integer i_id;
|
326
|
+
integer o_ny;
|
327
|
+
integer o_nm;
|
328
|
+
integer o_nd;
|
329
|
+
VALUE ny;
|
330
|
+
VALUE nm;
|
331
|
+
VALUE nd;
|
332
|
+
|
333
|
+
if ((TYPE(n) != T_BIGNUM) || (TYPE(n) != T_FIXNUM)) {
|
334
|
+
n = rb_funcall(n, rb_intern("to_i"), 0);
|
335
|
+
}
|
336
|
+
if ((TYPE(iy) != T_BIGNUM) || (TYPE(iy) != T_FIXNUM)) {
|
337
|
+
iy = rb_funcall(iy, rb_intern("to_i"), 0);
|
338
|
+
}
|
339
|
+
if ((TYPE(im) != T_BIGNUM) || (TYPE(im) != T_FIXNUM)) {
|
340
|
+
im = rb_funcall(im, rb_intern("to_i"), 0);
|
341
|
+
}
|
342
|
+
if ((TYPE(id) != T_BIGNUM) || (TYPE(id) != T_FIXNUM)) {
|
343
|
+
id = rb_funcall(id, rb_intern("to_i"), 0);
|
344
|
+
}
|
345
|
+
|
346
|
+
i_n = NUM2INT(n);
|
347
|
+
i_iy = NUM2INT(iy);
|
348
|
+
i_im = NUM2INT(im);
|
349
|
+
i_id = NUM2INT(id);
|
350
|
+
|
351
|
+
|
352
|
+
datef3_(&i_n, &i_iy, &i_im, &i_id, &o_ny, &o_nm, &o_nd);
|
353
|
+
|
354
|
+
ny = INT2NUM(o_ny);
|
355
|
+
nm = INT2NUM(o_nm);
|
356
|
+
nd = INT2NUM(o_nd);
|
357
|
+
|
358
|
+
|
359
|
+
return rb_ary_new3(3, ny, nm, nd);
|
360
|
+
|
361
|
+
}
|
362
|
+
|
363
|
+
static VALUE
|
364
|
+
dcl_dateg1(obj, idate, ndate)
|
365
|
+
VALUE obj, idate, ndate;
|
366
|
+
{
|
367
|
+
integer o_n;
|
368
|
+
integer i_idate;
|
369
|
+
integer i_ndate;
|
370
|
+
VALUE n;
|
371
|
+
|
372
|
+
if ((TYPE(idate) != T_BIGNUM) || (TYPE(idate) != T_FIXNUM)) {
|
373
|
+
idate = rb_funcall(idate, rb_intern("to_i"), 0);
|
374
|
+
}
|
375
|
+
if ((TYPE(ndate) != T_BIGNUM) || (TYPE(ndate) != T_FIXNUM)) {
|
376
|
+
ndate = rb_funcall(ndate, rb_intern("to_i"), 0);
|
377
|
+
}
|
378
|
+
|
379
|
+
i_idate = NUM2INT(idate);
|
380
|
+
i_ndate = NUM2INT(ndate);
|
381
|
+
|
382
|
+
|
383
|
+
dateg1_(&o_n, &i_idate, &i_ndate);
|
384
|
+
|
385
|
+
n = INT2NUM(o_n);
|
386
|
+
|
387
|
+
|
388
|
+
return n;
|
389
|
+
|
390
|
+
}
|
391
|
+
|
392
|
+
static VALUE
|
393
|
+
dcl_dateg2(obj, iy, itd, ny, ntd)
|
394
|
+
VALUE obj, iy, itd, ny, ntd;
|
395
|
+
{
|
396
|
+
integer o_n;
|
397
|
+
integer i_iy;
|
398
|
+
integer i_itd;
|
399
|
+
integer i_ny;
|
400
|
+
integer i_ntd;
|
401
|
+
VALUE n;
|
402
|
+
|
403
|
+
if ((TYPE(iy) != T_BIGNUM) || (TYPE(iy) != T_FIXNUM)) {
|
404
|
+
iy = rb_funcall(iy, rb_intern("to_i"), 0);
|
405
|
+
}
|
406
|
+
if ((TYPE(itd) != T_BIGNUM) || (TYPE(itd) != T_FIXNUM)) {
|
407
|
+
itd = rb_funcall(itd, rb_intern("to_i"), 0);
|
408
|
+
}
|
409
|
+
if ((TYPE(ny) != T_BIGNUM) || (TYPE(ny) != T_FIXNUM)) {
|
410
|
+
ny = rb_funcall(ny, rb_intern("to_i"), 0);
|
411
|
+
}
|
412
|
+
if ((TYPE(ntd) != T_BIGNUM) || (TYPE(ntd) != T_FIXNUM)) {
|
413
|
+
ntd = rb_funcall(ntd, rb_intern("to_i"), 0);
|
414
|
+
}
|
415
|
+
|
416
|
+
i_iy = NUM2INT(iy);
|
417
|
+
i_itd = NUM2INT(itd);
|
418
|
+
i_ny = NUM2INT(ny);
|
419
|
+
i_ntd = NUM2INT(ntd);
|
420
|
+
|
421
|
+
|
422
|
+
dateg2_(&o_n, &i_iy, &i_itd, &i_ny, &i_ntd);
|
423
|
+
|
424
|
+
n = INT2NUM(o_n);
|
425
|
+
|
426
|
+
|
427
|
+
return n;
|
428
|
+
|
429
|
+
}
|
430
|
+
|
431
|
+
static VALUE
|
432
|
+
dcl_dateg3(obj, iy, im, id, ny, nm, nd)
|
433
|
+
VALUE obj, iy, im, id, ny, nm, nd;
|
434
|
+
{
|
435
|
+
integer o_n;
|
436
|
+
integer i_iy;
|
437
|
+
integer i_im;
|
438
|
+
integer i_id;
|
439
|
+
integer i_ny;
|
440
|
+
integer i_nm;
|
441
|
+
integer i_nd;
|
442
|
+
VALUE n;
|
443
|
+
|
444
|
+
if ((TYPE(iy) != T_BIGNUM) || (TYPE(iy) != T_FIXNUM)) {
|
445
|
+
iy = rb_funcall(iy, rb_intern("to_i"), 0);
|
446
|
+
}
|
447
|
+
if ((TYPE(im) != T_BIGNUM) || (TYPE(im) != T_FIXNUM)) {
|
448
|
+
im = rb_funcall(im, rb_intern("to_i"), 0);
|
449
|
+
}
|
450
|
+
if ((TYPE(id) != T_BIGNUM) || (TYPE(id) != T_FIXNUM)) {
|
451
|
+
id = rb_funcall(id, rb_intern("to_i"), 0);
|
452
|
+
}
|
453
|
+
if ((TYPE(ny) != T_BIGNUM) || (TYPE(ny) != T_FIXNUM)) {
|
454
|
+
ny = rb_funcall(ny, rb_intern("to_i"), 0);
|
455
|
+
}
|
456
|
+
if ((TYPE(nm) != T_BIGNUM) || (TYPE(nm) != T_FIXNUM)) {
|
457
|
+
nm = rb_funcall(nm, rb_intern("to_i"), 0);
|
458
|
+
}
|
459
|
+
if ((TYPE(nd) != T_BIGNUM) || (TYPE(nd) != T_FIXNUM)) {
|
460
|
+
nd = rb_funcall(nd, rb_intern("to_i"), 0);
|
461
|
+
}
|
462
|
+
|
463
|
+
i_iy = NUM2INT(iy);
|
464
|
+
i_im = NUM2INT(im);
|
465
|
+
i_id = NUM2INT(id);
|
466
|
+
i_ny = NUM2INT(ny);
|
467
|
+
i_nm = NUM2INT(nm);
|
468
|
+
i_nd = NUM2INT(nd);
|
469
|
+
|
470
|
+
|
471
|
+
dateg3_(&o_n, &i_iy, &i_im, &i_id, &i_ny, &i_nm, &i_nd);
|
472
|
+
|
473
|
+
n = INT2NUM(o_n);
|
474
|
+
|
475
|
+
|
476
|
+
return n;
|
477
|
+
|
478
|
+
}
|
479
|
+
|
480
|
+
static VALUE
|
481
|
+
dcl_ndate1(obj, idate, ndate)
|
482
|
+
VALUE obj, idate, ndate;
|
483
|
+
{
|
484
|
+
integer i_idate;
|
485
|
+
integer i_ndate;
|
486
|
+
integer o_rtn_val;
|
487
|
+
VALUE rtn_val;
|
488
|
+
|
489
|
+
if ((TYPE(idate) != T_BIGNUM) || (TYPE(idate) != T_FIXNUM)) {
|
490
|
+
idate = rb_funcall(idate, rb_intern("to_i"), 0);
|
491
|
+
}
|
492
|
+
if ((TYPE(ndate) != T_BIGNUM) || (TYPE(ndate) != T_FIXNUM)) {
|
493
|
+
ndate = rb_funcall(ndate, rb_intern("to_i"), 0);
|
494
|
+
}
|
495
|
+
|
496
|
+
i_idate = NUM2INT(idate);
|
497
|
+
i_ndate = NUM2INT(ndate);
|
498
|
+
|
499
|
+
|
500
|
+
o_rtn_val = ndate1_(&i_idate, &i_ndate);
|
501
|
+
|
502
|
+
rtn_val = INT2NUM(o_rtn_val);
|
503
|
+
|
504
|
+
|
505
|
+
return rtn_val;
|
506
|
+
|
507
|
+
}
|
508
|
+
|
509
|
+
static VALUE
|
510
|
+
dcl_ndate2(obj, iy, itd, ny, ntd)
|
511
|
+
VALUE obj, iy, itd, ny, ntd;
|
512
|
+
{
|
513
|
+
integer i_iy;
|
514
|
+
integer i_itd;
|
515
|
+
integer i_ny;
|
516
|
+
integer i_ntd;
|
517
|
+
integer o_rtn_val;
|
518
|
+
VALUE rtn_val;
|
519
|
+
|
520
|
+
if ((TYPE(iy) != T_BIGNUM) || (TYPE(iy) != T_FIXNUM)) {
|
521
|
+
iy = rb_funcall(iy, rb_intern("to_i"), 0);
|
522
|
+
}
|
523
|
+
if ((TYPE(itd) != T_BIGNUM) || (TYPE(itd) != T_FIXNUM)) {
|
524
|
+
itd = rb_funcall(itd, rb_intern("to_i"), 0);
|
525
|
+
}
|
526
|
+
if ((TYPE(ny) != T_BIGNUM) || (TYPE(ny) != T_FIXNUM)) {
|
527
|
+
ny = rb_funcall(ny, rb_intern("to_i"), 0);
|
528
|
+
}
|
529
|
+
if ((TYPE(ntd) != T_BIGNUM) || (TYPE(ntd) != T_FIXNUM)) {
|
530
|
+
ntd = rb_funcall(ntd, rb_intern("to_i"), 0);
|
531
|
+
}
|
532
|
+
|
533
|
+
i_iy = NUM2INT(iy);
|
534
|
+
i_itd = NUM2INT(itd);
|
535
|
+
i_ny = NUM2INT(ny);
|
536
|
+
i_ntd = NUM2INT(ntd);
|
537
|
+
|
538
|
+
|
539
|
+
o_rtn_val = ndate2_(&i_iy, &i_itd, &i_ny, &i_ntd);
|
540
|
+
|
541
|
+
rtn_val = INT2NUM(o_rtn_val);
|
542
|
+
|
543
|
+
|
544
|
+
return rtn_val;
|
545
|
+
|
546
|
+
}
|
547
|
+
|
548
|
+
static VALUE
|
549
|
+
dcl_ndate3(obj, iy, im, id, ny, nm, nd)
|
550
|
+
VALUE obj, iy, im, id, ny, nm, nd;
|
551
|
+
{
|
552
|
+
integer i_iy;
|
553
|
+
integer i_im;
|
554
|
+
integer i_id;
|
555
|
+
integer i_ny;
|
556
|
+
integer i_nm;
|
557
|
+
integer i_nd;
|
558
|
+
integer o_rtn_val;
|
559
|
+
VALUE rtn_val;
|
560
|
+
|
561
|
+
if ((TYPE(iy) != T_BIGNUM) || (TYPE(iy) != T_FIXNUM)) {
|
562
|
+
iy = rb_funcall(iy, rb_intern("to_i"), 0);
|
563
|
+
}
|
564
|
+
if ((TYPE(im) != T_BIGNUM) || (TYPE(im) != T_FIXNUM)) {
|
565
|
+
im = rb_funcall(im, rb_intern("to_i"), 0);
|
566
|
+
}
|
567
|
+
if ((TYPE(id) != T_BIGNUM) || (TYPE(id) != T_FIXNUM)) {
|
568
|
+
id = rb_funcall(id, rb_intern("to_i"), 0);
|
569
|
+
}
|
570
|
+
if ((TYPE(ny) != T_BIGNUM) || (TYPE(ny) != T_FIXNUM)) {
|
571
|
+
ny = rb_funcall(ny, rb_intern("to_i"), 0);
|
572
|
+
}
|
573
|
+
if ((TYPE(nm) != T_BIGNUM) || (TYPE(nm) != T_FIXNUM)) {
|
574
|
+
nm = rb_funcall(nm, rb_intern("to_i"), 0);
|
575
|
+
}
|
576
|
+
if ((TYPE(nd) != T_BIGNUM) || (TYPE(nd) != T_FIXNUM)) {
|
577
|
+
nd = rb_funcall(nd, rb_intern("to_i"), 0);
|
578
|
+
}
|
579
|
+
|
580
|
+
i_iy = NUM2INT(iy);
|
581
|
+
i_im = NUM2INT(im);
|
582
|
+
i_id = NUM2INT(id);
|
583
|
+
i_ny = NUM2INT(ny);
|
584
|
+
i_nm = NUM2INT(nm);
|
585
|
+
i_nd = NUM2INT(nd);
|
586
|
+
|
587
|
+
|
588
|
+
o_rtn_val = ndate3_(&i_iy, &i_im, &i_id, &i_ny, &i_nm, &i_nd);
|
589
|
+
|
590
|
+
rtn_val = INT2NUM(o_rtn_val);
|
591
|
+
|
592
|
+
|
593
|
+
return rtn_val;
|
594
|
+
|
595
|
+
}
|
596
|
+
|
597
|
+
static VALUE
|
598
|
+
dcl_datec1(obj, cform, idate)
|
599
|
+
VALUE obj, cform, idate;
|
600
|
+
{
|
601
|
+
char *io_cform;
|
602
|
+
integer i_idate;
|
603
|
+
|
604
|
+
if (TYPE(cform) != T_STRING) {
|
605
|
+
cform = rb_funcall(cform, rb_intern("to_str"), 0);
|
606
|
+
}
|
607
|
+
if ((TYPE(idate) != T_BIGNUM) || (TYPE(idate) != T_FIXNUM)) {
|
608
|
+
idate = rb_funcall(idate, rb_intern("to_i"), 0);
|
609
|
+
}
|
610
|
+
|
611
|
+
io_cform = ALLOCA_N(char, strlen(StringValuePtr(cform))+1);
|
612
|
+
strcpy(io_cform, StringValuePtr(cform));
|
613
|
+
i_idate = NUM2INT(idate);
|
614
|
+
|
615
|
+
|
616
|
+
datec1_(io_cform, &i_idate, (ftnlen)strlen(io_cform));
|
617
|
+
|
618
|
+
cform = rb_str_new2(io_cform);
|
619
|
+
|
620
|
+
|
621
|
+
return cform;
|
622
|
+
|
623
|
+
}
|
624
|
+
|
625
|
+
static VALUE
|
626
|
+
dcl_datec2(obj, cform, iy, itd)
|
627
|
+
VALUE obj, cform, iy, itd;
|
628
|
+
{
|
629
|
+
char *io_cform;
|
630
|
+
integer i_iy;
|
631
|
+
integer i_itd;
|
632
|
+
|
633
|
+
if (TYPE(cform) != T_STRING) {
|
634
|
+
cform = rb_funcall(cform, rb_intern("to_str"), 0);
|
635
|
+
}
|
636
|
+
if ((TYPE(iy) != T_BIGNUM) || (TYPE(iy) != T_FIXNUM)) {
|
637
|
+
iy = rb_funcall(iy, rb_intern("to_i"), 0);
|
638
|
+
}
|
639
|
+
if ((TYPE(itd) != T_BIGNUM) || (TYPE(itd) != T_FIXNUM)) {
|
640
|
+
itd = rb_funcall(itd, rb_intern("to_i"), 0);
|
641
|
+
}
|
642
|
+
|
643
|
+
io_cform = ALLOCA_N(char, strlen(StringValuePtr(cform))+1);
|
644
|
+
strcpy(io_cform, StringValuePtr(cform));
|
645
|
+
i_iy = NUM2INT(iy);
|
646
|
+
i_itd = NUM2INT(itd);
|
647
|
+
|
648
|
+
|
649
|
+
datec2_(io_cform, &i_iy, &i_itd, (ftnlen)strlen(io_cform));
|
650
|
+
|
651
|
+
cform = rb_str_new2(io_cform);
|
652
|
+
|
653
|
+
|
654
|
+
return cform;
|
655
|
+
|
656
|
+
}
|
657
|
+
|
658
|
+
static VALUE
|
659
|
+
dcl_datec3(obj, cform, iy, im, id)
|
660
|
+
VALUE obj, cform, iy, im, id;
|
661
|
+
{
|
662
|
+
char *io_cform;
|
663
|
+
integer i_iy;
|
664
|
+
integer i_im;
|
665
|
+
integer i_id;
|
666
|
+
|
667
|
+
if (TYPE(cform) != T_STRING) {
|
668
|
+
cform = rb_funcall(cform, rb_intern("to_str"), 0);
|
669
|
+
}
|
670
|
+
if ((TYPE(iy) != T_BIGNUM) || (TYPE(iy) != T_FIXNUM)) {
|
671
|
+
iy = rb_funcall(iy, rb_intern("to_i"), 0);
|
672
|
+
}
|
673
|
+
if ((TYPE(im) != T_BIGNUM) || (TYPE(im) != T_FIXNUM)) {
|
674
|
+
im = rb_funcall(im, rb_intern("to_i"), 0);
|
675
|
+
}
|
676
|
+
if ((TYPE(id) != T_BIGNUM) || (TYPE(id) != T_FIXNUM)) {
|
677
|
+
id = rb_funcall(id, rb_intern("to_i"), 0);
|
678
|
+
}
|
679
|
+
|
680
|
+
io_cform = ALLOCA_N(char, strlen(StringValuePtr(cform))+1);
|
681
|
+
strcpy(io_cform, StringValuePtr(cform));
|
682
|
+
i_iy = NUM2INT(iy);
|
683
|
+
i_im = NUM2INT(im);
|
684
|
+
i_id = NUM2INT(id);
|
685
|
+
|
686
|
+
|
687
|
+
datec3_(io_cform, &i_iy, &i_im, &i_id, (ftnlen)strlen(io_cform));
|
688
|
+
|
689
|
+
cform = rb_str_new2(io_cform);
|
690
|
+
|
691
|
+
|
692
|
+
return cform;
|
693
|
+
|
694
|
+
}
|
695
|
+
|
696
|
+
static VALUE
|
697
|
+
dcl_dateq1(obj)
|
698
|
+
VALUE obj;
|
699
|
+
{
|
700
|
+
integer o_idate;
|
701
|
+
VALUE idate;
|
702
|
+
|
703
|
+
dateq1_(&o_idate);
|
704
|
+
|
705
|
+
idate = INT2NUM(o_idate);
|
706
|
+
|
707
|
+
|
708
|
+
return idate;
|
709
|
+
|
710
|
+
}
|
711
|
+
|
712
|
+
static VALUE
|
713
|
+
dcl_ndmon(obj, iy, im)
|
714
|
+
VALUE obj, iy, im;
|
715
|
+
{
|
716
|
+
integer i_iy;
|
717
|
+
integer i_im;
|
718
|
+
integer o_rtn_val;
|
719
|
+
VALUE rtn_val;
|
720
|
+
|
721
|
+
if ((TYPE(iy) != T_BIGNUM) || (TYPE(iy) != T_FIXNUM)) {
|
722
|
+
iy = rb_funcall(iy, rb_intern("to_i"), 0);
|
723
|
+
}
|
724
|
+
if ((TYPE(im) != T_BIGNUM) || (TYPE(im) != T_FIXNUM)) {
|
725
|
+
im = rb_funcall(im, rb_intern("to_i"), 0);
|
726
|
+
}
|
727
|
+
|
728
|
+
i_iy = NUM2INT(iy);
|
729
|
+
i_im = NUM2INT(im);
|
730
|
+
|
731
|
+
|
732
|
+
o_rtn_val = ndmon_(&i_iy, &i_im);
|
733
|
+
|
734
|
+
rtn_val = INT2NUM(o_rtn_val);
|
735
|
+
|
736
|
+
|
737
|
+
return rtn_val;
|
738
|
+
|
739
|
+
}
|
740
|
+
|
741
|
+
static VALUE
|
742
|
+
dcl_dateq2(obj)
|
743
|
+
VALUE obj;
|
744
|
+
{
|
745
|
+
integer o_iy;
|
746
|
+
integer o_itd;
|
747
|
+
VALUE iy;
|
748
|
+
VALUE itd;
|
749
|
+
|
750
|
+
dateq2_(&o_iy, &o_itd);
|
751
|
+
|
752
|
+
iy = INT2NUM(o_iy);
|
753
|
+
itd = INT2NUM(o_itd);
|
754
|
+
|
755
|
+
|
756
|
+
return rb_ary_new3(2, iy, itd);
|
757
|
+
|
758
|
+
}
|
759
|
+
|
760
|
+
static VALUE
|
761
|
+
dcl_cmon(obj, im)
|
762
|
+
VALUE obj, im;
|
763
|
+
{
|
764
|
+
integer i_im;
|
765
|
+
char *o_rtn_val;
|
766
|
+
VALUE rtn_val;
|
767
|
+
|
768
|
+
if ((TYPE(im) != T_BIGNUM) || (TYPE(im) != T_FIXNUM)) {
|
769
|
+
im = rb_funcall(im, rb_intern("to_i"), 0);
|
770
|
+
}
|
771
|
+
|
772
|
+
i_im = NUM2INT(im);
|
773
|
+
|
774
|
+
o_rtn_val= ALLOCA_N(char, (DFLT_SIZE+1));
|
775
|
+
memset(o_rtn_val, '\0', DFLT_SIZE+1);
|
776
|
+
|
777
|
+
cmon_(o_rtn_val, (ftnlen)DFLT_SIZE, &i_im);
|
778
|
+
|
779
|
+
rtn_val = rb_str_new2(o_rtn_val);
|
780
|
+
|
781
|
+
|
782
|
+
return rtn_val;
|
783
|
+
|
784
|
+
}
|
785
|
+
|
786
|
+
static VALUE
|
787
|
+
dcl_cweek(obj, iw)
|
788
|
+
VALUE obj, iw;
|
789
|
+
{
|
790
|
+
integer i_iw;
|
791
|
+
char *o_rtn_val;
|
792
|
+
VALUE rtn_val;
|
793
|
+
|
794
|
+
if ((TYPE(iw) != T_BIGNUM) || (TYPE(iw) != T_FIXNUM)) {
|
795
|
+
iw = rb_funcall(iw, rb_intern("to_i"), 0);
|
796
|
+
}
|
797
|
+
|
798
|
+
i_iw = NUM2INT(iw);
|
799
|
+
|
800
|
+
o_rtn_val= ALLOCA_N(char, (DFLT_SIZE+1));
|
801
|
+
memset(o_rtn_val, '\0', DFLT_SIZE+1);
|
802
|
+
|
803
|
+
cweek_(o_rtn_val, (ftnlen)DFLT_SIZE, &i_iw);
|
804
|
+
|
805
|
+
rtn_val = rb_str_new2(o_rtn_val);
|
806
|
+
|
807
|
+
|
808
|
+
return rtn_val;
|
809
|
+
|
810
|
+
}
|
811
|
+
|
812
|
+
static VALUE
|
813
|
+
dcl_iweek1(obj, idate)
|
814
|
+
VALUE obj, idate;
|
815
|
+
{
|
816
|
+
integer i_idate;
|
817
|
+
integer o_rtn_val;
|
818
|
+
VALUE rtn_val;
|
819
|
+
|
820
|
+
if ((TYPE(idate) != T_BIGNUM) || (TYPE(idate) != T_FIXNUM)) {
|
821
|
+
idate = rb_funcall(idate, rb_intern("to_i"), 0);
|
822
|
+
}
|
823
|
+
|
824
|
+
i_idate = NUM2INT(idate);
|
825
|
+
|
826
|
+
|
827
|
+
o_rtn_val = iweek1_(&i_idate);
|
828
|
+
|
829
|
+
rtn_val = INT2NUM(o_rtn_val);
|
830
|
+
|
831
|
+
|
832
|
+
return rtn_val;
|
833
|
+
|
834
|
+
}
|
835
|
+
|
836
|
+
static VALUE
|
837
|
+
dcl_iweek2(obj, iy, itd)
|
838
|
+
VALUE obj, iy, itd;
|
839
|
+
{
|
840
|
+
integer i_iy;
|
841
|
+
integer i_itd;
|
842
|
+
integer o_rtn_val;
|
843
|
+
VALUE rtn_val;
|
844
|
+
|
845
|
+
if ((TYPE(iy) != T_BIGNUM) || (TYPE(iy) != T_FIXNUM)) {
|
846
|
+
iy = rb_funcall(iy, rb_intern("to_i"), 0);
|
847
|
+
}
|
848
|
+
if ((TYPE(itd) != T_BIGNUM) || (TYPE(itd) != T_FIXNUM)) {
|
849
|
+
itd = rb_funcall(itd, rb_intern("to_i"), 0);
|
850
|
+
}
|
851
|
+
|
852
|
+
i_iy = NUM2INT(iy);
|
853
|
+
i_itd = NUM2INT(itd);
|
854
|
+
|
855
|
+
|
856
|
+
o_rtn_val = iweek2_(&i_iy, &i_itd);
|
857
|
+
|
858
|
+
rtn_val = INT2NUM(o_rtn_val);
|
859
|
+
|
860
|
+
|
861
|
+
return rtn_val;
|
862
|
+
|
863
|
+
}
|
864
|
+
|
865
|
+
static VALUE
|
866
|
+
dcl_iweek3(obj, iy, im, id)
|
867
|
+
VALUE obj, iy, im, id;
|
868
|
+
{
|
869
|
+
integer i_iy;
|
870
|
+
integer i_im;
|
871
|
+
integer i_id;
|
872
|
+
integer o_rtn_val;
|
873
|
+
VALUE rtn_val;
|
874
|
+
|
875
|
+
if ((TYPE(iy) != T_BIGNUM) || (TYPE(iy) != T_FIXNUM)) {
|
876
|
+
iy = rb_funcall(iy, rb_intern("to_i"), 0);
|
877
|
+
}
|
878
|
+
if ((TYPE(im) != T_BIGNUM) || (TYPE(im) != T_FIXNUM)) {
|
879
|
+
im = rb_funcall(im, rb_intern("to_i"), 0);
|
880
|
+
}
|
881
|
+
if ((TYPE(id) != T_BIGNUM) || (TYPE(id) != T_FIXNUM)) {
|
882
|
+
id = rb_funcall(id, rb_intern("to_i"), 0);
|
883
|
+
}
|
884
|
+
|
885
|
+
i_iy = NUM2INT(iy);
|
886
|
+
i_im = NUM2INT(im);
|
887
|
+
i_id = NUM2INT(id);
|
888
|
+
|
889
|
+
|
890
|
+
o_rtn_val = iweek3_(&i_iy, &i_im, &i_id);
|
891
|
+
|
892
|
+
rtn_val = INT2NUM(o_rtn_val);
|
893
|
+
|
894
|
+
|
895
|
+
return rtn_val;
|
896
|
+
|
897
|
+
}
|
898
|
+
|
899
|
+
static VALUE
|
900
|
+
dcl_ndyear(obj, iy)
|
901
|
+
VALUE obj, iy;
|
902
|
+
{
|
903
|
+
integer i_iy;
|
904
|
+
integer o_rtn_val;
|
905
|
+
VALUE rtn_val;
|
906
|
+
|
907
|
+
if ((TYPE(iy) != T_BIGNUM) || (TYPE(iy) != T_FIXNUM)) {
|
908
|
+
iy = rb_funcall(iy, rb_intern("to_i"), 0);
|
909
|
+
}
|
910
|
+
|
911
|
+
i_iy = NUM2INT(iy);
|
912
|
+
|
913
|
+
|
914
|
+
o_rtn_val = ndyear_(&i_iy);
|
915
|
+
|
916
|
+
rtn_val = INT2NUM(o_rtn_val);
|
917
|
+
|
918
|
+
|
919
|
+
return rtn_val;
|
920
|
+
|
921
|
+
}
|
922
|
+
void
|
923
|
+
init_misc1_datelib(mDCL)
|
924
|
+
VALUE mDCL;
|
925
|
+
{
|
926
|
+
rb_define_module_function(mDCL, "date12", dcl_date12, 1);
|
927
|
+
rb_define_module_function(mDCL, "date13", dcl_date13, 1);
|
928
|
+
rb_define_module_function(mDCL, "date21", dcl_date21, 2);
|
929
|
+
rb_define_module_function(mDCL, "date23", dcl_date23, 2);
|
930
|
+
rb_define_module_function(mDCL, "date31", dcl_date31, 3);
|
931
|
+
rb_define_module_function(mDCL, "date32", dcl_date32, 3);
|
932
|
+
rb_define_module_function(mDCL, "datef1", dcl_datef1, 2);
|
933
|
+
rb_define_module_function(mDCL, "datef2", dcl_datef2, 3);
|
934
|
+
rb_define_module_function(mDCL, "datef3", dcl_datef3, 4);
|
935
|
+
rb_define_module_function(mDCL, "dateg1", dcl_dateg1, 2);
|
936
|
+
rb_define_module_function(mDCL, "dateg2", dcl_dateg2, 4);
|
937
|
+
rb_define_module_function(mDCL, "dateg3", dcl_dateg3, 6);
|
938
|
+
rb_define_module_function(mDCL, "ndate1", dcl_ndate1, 2);
|
939
|
+
rb_define_module_function(mDCL, "ndate2", dcl_ndate2, 4);
|
940
|
+
rb_define_module_function(mDCL, "ndate3", dcl_ndate3, 6);
|
941
|
+
rb_define_module_function(mDCL, "datec1", dcl_datec1, 2);
|
942
|
+
rb_define_module_function(mDCL, "datec2", dcl_datec2, 3);
|
943
|
+
rb_define_module_function(mDCL, "datec3", dcl_datec3, 4);
|
944
|
+
rb_define_module_function(mDCL, "dateq1", dcl_dateq1, 0);
|
945
|
+
rb_define_module_function(mDCL, "ndmon", dcl_ndmon, 2);
|
946
|
+
rb_define_module_function(mDCL, "dateq2", dcl_dateq2, 0);
|
947
|
+
rb_define_module_function(mDCL, "cmon", dcl_cmon, 1);
|
948
|
+
rb_define_module_function(mDCL, "cweek", dcl_cweek, 1);
|
949
|
+
rb_define_module_function(mDCL, "iweek1", dcl_iweek1, 1);
|
950
|
+
rb_define_module_function(mDCL, "iweek2", dcl_iweek2, 2);
|
951
|
+
rb_define_module_function(mDCL, "iweek3", dcl_iweek3, 3);
|
952
|
+
rb_define_module_function(mDCL, "ndyear", dcl_ndyear, 1);
|
953
|
+
}
|