ruby-dcl 1.6.3.1 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
data/README_old DELETED
@@ -1,79 +0,0 @@
1
-
2
- RubyDCL -- a ruby interface to DCL library
3
-
4
- by K. Goto, K. Kuroi, N. Kawanabe, and T. Horinouchi
5
-
6
- Last Updated: Aug 27, 2001
7
-
8
-
9
- * WHAT IS THIS?
10
-
11
- This is a one-to-one wrapper to a scientific graphic library DCL
12
- (http://www.gfd-dennou.org/arch/dcl/).
13
- It was originally developed with DCL-5.1 but is currently tested
14
- for use with the ver.5.2.
15
-
16
- * INSTALLATION
17
-
18
- To install this library, the following must have been installed.
19
-
20
- * The C version of dcl: dcl-5.2C_011213 or later
21
- (ftp://www.gfd-dennou.org/arch/dcl/dcl-5.2-C_011213.tar.gz).
22
- Note that dcl-5.2-C.tar.gz in the directory, which is older than
23
- dcl-5.2-C_011213.tar.gz will NOT WORK with ruby-dcl-1.0.0
24
- or a later version of RubyDCL. The reason for that is as follows:
25
- In the later versions of RubyDCL, exception handing was made
26
- compliant to that in Ruby, i.e., to call the "raise" predefined
27
- function. In order to do that, the msgdmp_ function in the C
28
- version of DCL had to be modified.
29
-
30
- * Ruby version 1.6 or later (http://www.ruby-lang.org/).
31
-
32
- * NArray (http://www.ruby-lang.org/en/raa-list.rhtml?name=NArray)
33
- which is a numeric multi-dimensional array class.
34
-
35
- NOTE: By default, the two headers narray.h and narray_config.h
36
- in the narraypackage are assumed to have been copied to
37
- $(sitearchdir), which is normally
38
- /usr/local/lib/ruby/site_ruby/1.6/$(arch)/ if you are using Unix,
39
- where $(arch) is something like sparc-solaris2.6, a combination of
40
- CPU and OS. You can specify the directory that contains these files
41
- explicitly by using an environmental variable WITH_NARRAY_INCLUDE
42
- like this:
43
-
44
- % setenv WITH_NARRAY_INCLUDE '--with-narray-include=/narraydir/include'
45
- or, if you are using bash,
46
- % export WITH_NARRAY_INCLUDE='--with-narray-include=/narraydir/include'
47
-
48
- This cause src/extconf.rb run with its value as:
49
- cd src; ruby extconf.rb --with-narray-include=/narraydir/include;
50
-
51
- If you are using a UNIX operating system, you only need to execute
52
- the following command at the current directly ("%" is a "prompt". Do
53
- not type it):
54
-
55
- % make
56
-
57
- (Development of a Windows version is hoped but has not been done so
58
- far.)
59
-
60
- The command does two things:
61
-
62
- (1) To create source code for the C-interface from a prototype
63
- definition of DCL in the "proto" directory.
64
- (Equivalent to % make prt)
65
- The source code creation is done with ruby.
66
-
67
- The definition is in a format specific to this interface and
68
- is made partly by hand. This is because of a necessity to
69
- distinguish input, output, in-out, work arguments. Therefore,
70
- to catch up future development of DCL, it has to be updated
71
- by hand again.
72
-
73
-
74
- (2) To compile the source code.
75
- (Equivalent to % make lib)
76
-
77
- Unlike (1), commands used for this process are platform
78
- dependent. Auto-configuration is done by src/extconf.rb,
79
- so the user does not have to care platform dependence.
data/dummy.c DELETED
@@ -1,9 +0,0 @@
1
- /*
2
- * $Id: dummy.c,v 1.1.1.1 2011-02-23 07:21:26 horinout Exp $
3
- */
4
-
5
- MAIN__(void)
6
- {
7
- return;
8
- }
9
-
data/grph1_zgpack.c.org DELETED
@@ -1,141 +0,0 @@
1
- #include <gtk/gtk.h>
2
- #include <gdk/gdk.h>
3
- #include "ruby.h"
4
-
5
- #if GTK_MAJOR_VERSION == 1
6
- #define RVAL2GTKWIDGET(obj) (get_widget(obj))
7
- #define RVAL2GDKPIXMAP(obj) (get_gdkpixmap(obj))
8
-
9
-
10
- static GtkObject*
11
- get_gobject(obj)
12
- VALUE obj;
13
- {
14
- struct RData *data;
15
- GtkObject *gtkp;
16
-
17
- if (NIL_P(obj)) {
18
- rb_raise(rb_eTypeError, "wrong argument type nil");
19
- }
20
-
21
- Check_Type(obj, T_OBJECT);
22
- data = RDATA(rb_ivar_get(obj, rb_intern("gtkdata")));
23
- if (NIL_P(data)) {
24
- rb_raise(rb_eTypeError, "not a Gtk object");
25
- }
26
- Data_Get_Struct(data, GtkObject, gtkp);
27
- if (!gtkp) {
28
- rb_raise(rb_eArgError, "destroyed GtkObject");
29
- }
30
- if (!GTK_IS_OBJECT(gtkp)) {
31
- rb_raise(rb_eTypeError, "not a GtkObject");
32
- }
33
-
34
- return gtkp;
35
- }
36
-
37
- static GtkWidget*
38
- get_widget(obj)
39
- VALUE obj;
40
- {
41
- GtkObject *data = get_gobject(obj);
42
-
43
- return GTK_WIDGET(data);
44
- }
45
-
46
- static GdkPixmap*
47
- get_gdkpixmap(obj)
48
- VALUE obj;
49
- {
50
- GdkPixmap *pixmap;
51
-
52
- Data_Get_Struct(obj, GdkPixmap, pixmap);
53
-
54
- return pixmap;
55
- }
56
-
57
-
58
- #elif GTK_MAJOR_VERSION == 2
59
- #define CLASS2GTYPE(klass) (rbgobj_lookup_class(klass)->gtype)
60
- #define RVAL2GOBJ(obj) (rbgobj_instance_from_ruby_object(obj))
61
- #define RVAL2GTYPE(obj) (CLASS2GTYPE(CLASS_OF(obj)))
62
- #define RVAL2GTKWIDGET(obj) ((GtkWidget*)RVAL2GOBJ(obj))
63
- #define RVAL2GDKPIXMAP(obj) ((GdkPixmap*)RVAL2GOBJ(obj))
64
- #define GOBJ2RVAL(gobj) (rbgobj_ruby_object_from_instance(gobj))
65
- #endif
66
-
67
-
68
- static VALUE
69
- dcl_zgsdrw(self, drawable)
70
- VALUE self, drawable;
71
- {
72
- extern zgsdrw_(GtkWidget*);
73
-
74
- zgsdrw_( RVAL2GTKWIDGET(drawable) );
75
-
76
- return Qnil;
77
-
78
- }
79
-
80
- static VALUE
81
- dcl_zgspmp(self, pixmap)
82
- VALUE self, pixmap;
83
- {
84
- extern zgspmp_(GdkPixmap*);
85
-
86
- zgspmp_( RVAL2GDKPIXMAP(pixmap) );
87
-
88
- return Qnil;
89
-
90
- }
91
-
92
- #if GTK_MAJOR_VERSION == 2
93
- static VALUE
94
- dcl_zgqdrw(self)
95
- VALUE self;
96
- {
97
- extern GtkWidget *zgqdrw_();
98
-
99
- return GOBJ2RVAL(zgqdrw_());
100
-
101
- }
102
-
103
- static VALUE
104
- dcl_zgqpmp(self)
105
- VALUE self;
106
- {
107
- extern GtkPixmap *zgqpmp_();
108
-
109
- return GOBJ2RVAL(zgqpmp_());
110
-
111
- }
112
- #endif
113
-
114
- static VALUE
115
- r_gtk_version(self)
116
- VALUE self;
117
- {
118
- return rb_ary_new3(3,
119
- INT2NUM(gtk_major_version),
120
- INT2NUM(gtk_minor_version),
121
- INT2NUM(gtk_micro_version));
122
- }
123
-
124
-
125
- void
126
- init_grph1_zgpack(mDCL)
127
- VALUE mDCL;
128
- {
129
-
130
- rb_define_module_function(mDCL, "gtk_version", r_gtk_version, 0);
131
-
132
- rb_define_module_function(mDCL, "zgsdrw", dcl_zgsdrw, 1);
133
- rb_define_module_function(mDCL, "zgspmp", dcl_zgspmp, 1);
134
-
135
- #if GTK_MAJOR_VERSION == 2
136
- rb_define_module_function(mDCL, "zgqdrw", dcl_zgqdrw, 0);
137
- rb_define_module_function(mDCL, "zgqpmp", dcl_zgqpmp, 0);
138
- #endif
139
-
140
- }
141
-
data/init.c.gtk DELETED
@@ -1,189 +0,0 @@
1
- #include <stdio.h>
2
- #include "ruby.h"
3
- #include "libtinyf2c.h"
4
-
5
- /* for compatibility with ruby 1.6 */
6
- #ifndef RARRAY_PTR
7
- #define RARRAY_PTR(a) (RARRAY(a)->ptr)
8
- #endif
9
- #ifndef RARRAY_LEN
10
- #define RARRAY_LEN(a) (RARRAY(a)->len)
11
- #endif
12
- #ifndef StringValuePtr
13
- #define StringValuePtr(s) STR2CSTR(s)
14
- #endif
15
-
16
- VALUE mDCL;
17
- static VALUE mNumRu;
18
-
19
- void init_grph1_csgi(VALUE mDCL);
20
- void init_grph1_scpack(VALUE mDCL);
21
- void init_grph1_sgpack(VALUE mDCL);
22
- void init_grph1_slpack(VALUE mDCL);
23
- void init_grph1_stpack(VALUE mDCL);
24
- void init_grph1_swpack(VALUE mDCL);
25
- void init_grph1_zgpack(VALUE mDCL);
26
- void init_grph2_grpack(VALUE mDCL);
27
- void init_grph2_ucpack(VALUE mDCL);
28
- void init_grph2_udpack(VALUE mDCL);
29
- void init_grph2_uepack(VALUE mDCL);
30
- void init_grph2_ugpack(VALUE mDCL);
31
- void init_grph2_uhpack(VALUE mDCL);
32
- void init_grph2_ulpack(VALUE mDCL);
33
- void init_grph2_umpack(VALUE mDCL);
34
- void init_grph2_uspack(VALUE mDCL);
35
- void init_grph2_uupack(VALUE mDCL);
36
- void init_grph2_uvpack(VALUE mDCL);
37
- void init_grph2_uwpack(VALUE mDCL);
38
- void init_grph2_uxpack(VALUE mDCL);
39
- void init_grph2_uypack(VALUE mDCL);
40
- void init_grph2_uzpack(VALUE mDCL);
41
- void init_math1_blklib(VALUE mDCL);
42
- void init_math1_chrlib(VALUE mDCL);
43
- void init_math1_fnclib(VALUE mDCL);
44
- void init_math1_gt2dlib(VALUE mDCL);
45
- void init_math1_gnmlib(VALUE mDCL);
46
- void init_math1_ifalib(VALUE mDCL);
47
- void init_math1_indxlib(VALUE mDCL);
48
- void init_math1_intlib(VALUE mDCL);
49
- void init_math1_lrllib(VALUE mDCL);
50
- void init_math1_oslib(VALUE mDCL);
51
- void init_math1_rfalib(VALUE mDCL);
52
- void init_math1_rfblib(VALUE mDCL);
53
- void init_math1_sublib(VALUE mDCL);
54
- void init_math1_syslib(VALUE mDCL);
55
- void init_math1_vialib(VALUE mDCL);
56
- void init_math1_viblib(VALUE mDCL);
57
- void init_math1_vralib(VALUE mDCL);
58
- void init_math1_vrblib(VALUE mDCL);
59
- void init_math1_xfclib(VALUE mDCL);
60
- void init_math2_fftlib(VALUE mDCL);
61
- void init_math2_intrlib(VALUE mDCL);
62
- /*
63
- void init_math2_odelib(VALUE mDCL);
64
- */
65
- void init_math2_rnmlib(VALUE mDCL);
66
- void init_math2_shtlib(VALUE mDCL);
67
- void init_math2_vstlib(VALUE mDCL);
68
- void init_misc1_chnlib(VALUE mDCL);
69
- void init_misc1_datelib(VALUE mDCL);
70
- void init_misc1_fmtlib(VALUE mDCL);
71
- void init_misc1_misclib(VALUE mDCL);
72
- void init_misc1_randlib(VALUE mDCL);
73
- void init_misc1_timelib(VALUE mDCL);
74
-
75
-
76
- static int ruby_msgdmp_err_func(char *csub, char *cmsg,
77
- int csub_len, int cmsg_len)
78
- {
79
- int lmsg, lsub, i;
80
- char msg[300];
81
- lsub = lenc_(csub, csub_len);
82
- if (lsub > 32) {lsub=32;}
83
- lmsg = lenc_(cmsg, cmsg_len);
84
- if (lmsg > 200) {lmsg=200;}
85
- msg[0]='[';
86
- strncpy(msg+1,csub,lsub);
87
- msg[lsub+1]=']';
88
- msg[lsub+2]=' ';
89
- strncpy(msg+lsub+3,cmsg,lmsg);
90
- for(i=lsub+3+lmsg;i<300;i++){msg[i]='\0';}
91
- rb_raise(rb_eRuntimeError, msg);
92
- return(0);
93
- }
94
-
95
- #if DCLVER >= 532
96
- static VALUE
97
- dcl_init_arg(obj, name, ary)
98
- VALUE obj, name, ary;
99
- {
100
- integer argc;
101
- char **argv;
102
- VALUE *ptr;
103
- integer i;
104
-
105
- Check_Type(ary,T_ARRAY);
106
- argc = RARRAY_LEN(ary);
107
- ptr = RARRAY_PTR(ary);
108
- argv = ALLOC_N(char*,argc+1);
109
- argv[0] = StringValuePtr(name);
110
- for (i=0;i<argc;i++)
111
- argv[i+1] = StringValuePtr(ptr[i]);
112
- init_arg_(argc+1, argv);
113
-
114
- return Qnil;
115
- }
116
- #endif
117
-
118
- void
119
- Init_dcl_raw()
120
- {
121
- set_msgdmp_err_func(ruby_msgdmp_err_func);
122
- mNumRu = rb_define_module("NumRu");
123
- mDCL = rb_define_module_under(mNumRu, "DCL");
124
- rb_define_const(mDCL, "DCLVERSION", rb_str_new2(DCLVersion));
125
-
126
- init_grph1_csgi(mDCL);
127
- init_grph1_scpack(mDCL);
128
- init_grph1_sgpack(mDCL);
129
- init_grph1_slpack(mDCL);
130
- init_grph1_stpack(mDCL);
131
- init_grph1_swpack(mDCL);
132
- init_grph1_zgpack(mDCL);
133
- init_grph2_grpack(mDCL);
134
- init_grph2_ucpack(mDCL);
135
- init_grph2_udpack(mDCL);
136
- init_grph2_uepack(mDCL);
137
- init_grph2_ugpack(mDCL);
138
- init_grph2_uhpack(mDCL);
139
- init_grph2_ulpack(mDCL);
140
- init_grph2_umpack(mDCL);
141
- init_grph2_uspack(mDCL);
142
- init_grph2_uupack(mDCL);
143
- init_grph2_uvpack(mDCL);
144
- init_grph2_uwpack(mDCL);
145
- init_grph2_uxpack(mDCL);
146
- init_grph2_uypack(mDCL);
147
- init_grph2_uzpack(mDCL);
148
- init_math1_blklib(mDCL);
149
- init_math1_chrlib(mDCL);
150
- init_math1_fnclib(mDCL);
151
- #if DCLVER >= 530
152
- init_math1_gt2dlib(mDCL);
153
- #endif
154
- init_math1_gnmlib(mDCL);
155
- init_math1_ifalib(mDCL);
156
- init_math1_indxlib(mDCL);
157
- init_math1_intlib(mDCL);
158
- init_math1_lrllib(mDCL);
159
- init_math1_oslib(mDCL);
160
- init_math1_rfalib(mDCL);
161
- init_math1_rfblib(mDCL);
162
- init_math1_sublib(mDCL);
163
- init_math1_syslib(mDCL);
164
- init_math1_vialib(mDCL);
165
- init_math1_viblib(mDCL);
166
- init_math1_vralib(mDCL);
167
- init_math1_vrblib(mDCL);
168
- init_math1_xfclib(mDCL);
169
- init_math2_fftlib(mDCL);
170
- init_math2_intrlib(mDCL);
171
- /*
172
- init_math2_odelib(mDCL);
173
- */
174
- init_math2_rnmlib(mDCL);
175
- init_math2_shtlib(mDCL);
176
- init_math2_vstlib(mDCL);
177
- init_misc1_chnlib(mDCL);
178
- init_misc1_datelib(mDCL);
179
- init_misc1_fmtlib(mDCL);
180
- init_misc1_misclib(mDCL);
181
- init_misc1_randlib(mDCL);
182
- init_misc1_timelib(mDCL);
183
- #if DCLVER >= 532
184
- rb_define_module_function(mDCL, "init_arg", dcl_init_arg, 2);
185
- #endif
186
-
187
- init_rubydcloriginal(mDCL);
188
- init_narrayed_funcs(mDCL);
189
- }