Skip to content

Commit

Permalink
This commit was manufactured by cvs2svn to create tag
Browse files Browse the repository at this point in the history
'v1_3_1_990128'.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_3_1_990128@383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
(no author) committed Jan 28, 1999
1 parent 62e648e commit 8dae765
Show file tree
Hide file tree
Showing 120 changed files with 5,940 additions and 15,938 deletions.
17 changes: 0 additions & 17 deletions .cvsignore

This file was deleted.

23 changes: 23 additions & 0 deletions ChangeLog
@@ -1,3 +1,26 @@
Wed Jan 27 17:50:02 1999 Kazuhiro HIWADA <hiwada@kuee.kyoto-u.ac.jp>

* bignum.c (dbl2big): raised error if double is too big to cast
into long. check added.

Wed Jan 27 03:16:18 1999 Yukihiro Matsumoto <matz@netlab.co.jp>

* variable.c (rb_mod_const_at): can't list constants of the
untainted objects in safe mode.

* class.c (method_list): can't list methods of untainted objects
in safe mode.

Tue Jan 26 02:40:41 1999 GOTO Kentaro <gotoken@math.sci.hokudai.ac.jp>

* prec.c: Precision support for numbers.

Thu Jan 21 19:08:14 1999 Yukihiro Matsumoto <matz@netlab.co.jp>

* eval.c (rb_f_raise): calls `exception' method, not `new'.

* error.c (exc_exception): renamed from `new'.

Wed Jan 20 03:39:48 1999 Yukihiro Matsumoto <matz@netlab.co.jp>

* parse.y (yycompile): rb_in_compile renamed to ruby_in_compile.
Expand Down
1 change: 1 addition & 0 deletions MANIFEST
Expand Up @@ -50,6 +50,7 @@ object.c
pack.c
parse.c
parse.y
prec.c
process.c
random.c
range.c
Expand Down
27 changes: 21 additions & 6 deletions Makefile.in
Expand Up @@ -2,6 +2,12 @@ SHELL = /bin/sh

#### Start of system configuration section. ####

MAJOR= @MAJOR@
MINOR= @MINOR@
TEENY= @TEENY@

RUBY_INSTALL_NAME=@RUBY_INSTALL_NAME@

srcdir = @srcdir@
VPATH = @srcdir@:@srcdir@/missing

Expand All @@ -25,7 +31,9 @@ binsuffix = @binsuffix@

#### End of system configuration section. ####


LIBRUBY_A = @LIBRUBY_A@
LIBRUBY_SO = @LIBRUBY_SO@
LIBRUBY_ALIASES= @LIBRUBY_ALIASES@
LIBRUBY = @LIBRUBY@
LIBRUBYARG = @LIBRUBYARG@

Expand All @@ -50,6 +58,7 @@ OBJS = array.o \
inits.o \
io.o \
marshal.o \
prec.o \
math.o \
numeric.o \
object.o \
Expand All @@ -75,25 +84,30 @@ OBJS = array.o \
all: miniruby$(binsuffix) rbconfig.rb
@./miniruby$(binsuffix) -Xext extmk.rb @EXTSTATIC@

miniruby$(binsuffix): libruby.a $(MAINOBJ) dmyext.o
miniruby$(binsuffix): $(LIBRUBY_A) $(MAINOBJ) dmyext.o
@rm -f $@
$(PURIFY) $(CC) $(LDFLAGS) $(MAINOBJ) dmyext.o libruby.a $(LIBS) -o $@
$(PURIFY) $(CC) $(LDFLAGS) $(MAINOBJ) dmyext.o $(LIBRUBY_A) $(LIBS) -o $@

ruby$(binsuffix): $(LIBRUBY) $(MAINOBJ) $(EXTOBJS)
@rm -f $@
$(PURIFY) $(CC) $(LDFLAGS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@

libruby.a: $(OBJS) dmyext.o
$(LIBRUBY_A): $(OBJS) dmyext.o
@AR@ rcu $@ $(OBJS) dmyext.o
@-@RANLIB@ $@ 2> /dev/null || true

libruby.so: $(OBJS) dmyext.o
$(LIBRUBY_SO): $(OBJS) dmyext.o
$(LDSHARED) $(DLDFLAGS) $(SOLIBS) $(OBJS) dmyext.o -o $@
@for alias in $(LIBRUBY_ALIASES); do \
rm -f $$alias \
&& @LN_S@ $(LIBRUBY_SO) $$alias \
&& echo ln @LN_S@ $(LIBRUBY_SO) $$alias; \
done

install: rbconfig.rb
./miniruby$(binsuffix) $(srcdir)/instruby.rb $(DESTDIR)

clean:; @rm -f $(OBJS) $(LIBRUBY) $(MAINOBJ) rbconfig.rb
clean:; @rm -f $(OBJS) $(LIBRUBY_A) $(LIBRUBY_SO) $(LIBRUBY_ALIASES) $(MAINOBJ) rbconfig.rb
@rm -f ext/extinit.c ext/extinit.o dmyext.o
@if test -f ./miniruby$(binsuffix); then \
./miniruby$(binsuffix) -Xext extmk.rb clean; \
Expand Down Expand Up @@ -208,6 +222,7 @@ inits.o: inits.c ruby.h config.h defines.h intern.h
io.o: io.c ruby.h config.h defines.h intern.h rubyio.h rubysig.h
main.o: main.c ruby.h config.h defines.h intern.h
marshal.o: marshal.c ruby.h config.h defines.h intern.h rubyio.h st.h
prec.o: prec.c ruby.h config.h defines.h intern.h
math.o: math.c ruby.h config.h defines.h intern.h
numeric.o: numeric.c ruby.h config.h defines.h intern.h
object.o: object.c ruby.h config.h defines.h intern.h st.h
Expand Down
95 changes: 45 additions & 50 deletions README.EXT
Expand Up @@ -133,11 +133,11 @@ FIXNUM
����VALUE���Ѵ�����ޥ����ϰʲ��Τ�Τ�����ޤ���ɬ�פ˱���
�ƻȤ�ʬ���Ƥ���������

INT2FIX() ��Ȥ�������31bit����˼��ޤ��
INT2NUM() Ǥ�դ���������VALUE��
INT2FIX() for intergers within 31bits.
INT2NUM() for arbitrary sized integer.

INT2NUM()��������FIXNUM���ϰϤ˼��ޤ�ʤ���硤Bignum���Ѵ�
���Ƥ���ޤ�(���������٤�)��
INT2NUM() converts integers into Bignums, if it is out of FIXNUM
range, but bit slower.

1.5 Manipulate Ruby data

Expand Down Expand Up @@ -205,8 +205,6 @@ Ruby
* Methods, Singleton Methods
* Constants

�ǤϽ�˾Ҳ𤷤ޤ���

2.1.1 Class/module definition

To define class or module, use functions below:
Expand Down Expand Up @@ -643,23 +641,21 @@ extconf.rb

(6) prepare depend (optional)

�⤷���ǥ��쥯�ȥ��depend�Ȥ����ե����뤬¸�ߤ���С�
Makefile����¸�ط�������å����Ƥ���ޤ���
If the file named depend exists, Makefile will include that file to
check dependency. You can make this file by invoking

% gcc -MM *.c > depend

�ʤɤǺ�뤳�Ȥ�����ޤ������ä�»��̵���Ǥ��礦��
It's no harm. Prepare it.

(7) MANIFEST�ե�����˥ե�����̾�������

% ls > MANIFEST
% find * -type f -print > MANIFEST
% vi MANIFEST

*.o, *~�ʤ���ɬ�פʥե�����ʳ���MANIFEST���ɲä��Ƥ����ޤ���
make���ˤ�MANIFEST�����Ƥϻ��Ȥ��ޤ���Τǡ����ΤޤޤǤ�����
�ϵ����ޤ��󤬡��ѥå������󥰤λ��˻��Ȥ��뤳�Ȥ�����Τȡ�
ɬ�פʥե��������̤Ǥ���Τǡ��Ѱդ��Ƥ����������ɤ��Ǥ���
����
Append file names into MANIFEST. The compilation scheme requires
MANIFEST only to be exist. But, you'd better take this step to
distinguish required files.

(8) make

Expand All @@ -676,9 +672,9 @@ so that you can inspect the module by the debugger.

(10) done, now you have the extension library

��Ϥ��ä���Ȥ��ʤꡤ������������ʤꡤ���ʤꡤ����ͳ�ˤ�
�Ȥ�����������Ruby�κ�Ԥϳ�ĥ�饤�֥��˴ؤ��ư��ڤθ�����
��ĥ���ޤ���
You can do anything you want with your library. The author of Ruby
will not claim any restriction about your code depending Ruby API.
Feel free to use, modify, distribute or sell your program.

Appendix A. Ruby�Υ����������ɤ�ʬ��

Expand Down Expand Up @@ -737,7 +733,7 @@ class library
struct.c
time.c

Appendix B. ��ĥ�Ѵؿ���ե����
Appendix B. Ruby extension API reference

C���줫��Ruby�ε�ǽ�����Ѥ���API�ϰʲ����̤�Ǥ��롥

Expand All @@ -764,7 +760,7 @@ const: Qtrue object(default true value)

const: Qfalse object

** C�ǡ����Υ��ץ��벽
** C pointer wrapping

Data_Wrap_Struct(VALUE class, void (*mark)(), void (*free)(), void *sval)

Expand All @@ -783,33 +779,33 @@ type

data����type���Υݥ��󥿤���Ф��ѿ�sval����������ޥ�����

** ���饹/�⥸�塼�����
** defining class/module

VALUE rb_define_class(char *name, VALUE super)

super�Υ��֥��饹�Ȥ��ƿ�����Ruby���饹��������롥
Defines new Ruby class as subclass of super.

VALUE rb_define_class_under(VALUE module, char *name, VALUE super)

super�Υ��֥��饹�Ȥ��ƿ�����Ruby���饹���������module����
���Ȥ���������롥
Creates new Ruby class as subclass of super, under the module's
namespace.

VALUE rb_define_module(char *name)

������Ruby�⥸�塼���������롥
Defines new Ruby module.

VALUE rb_define_module_under(VALUE module, char *name, VALUE super)

������Ruby�⥸�塼����������module������Ȥ���������롥
Defines new Ruby module, under the modules's namespace.

void rb_include_module(VALUE class, VALUE module)

�⥸�塼��򥤥󥯥롼�ɤ��롥class�����Ǥ�module�򥤥󥯥롼
�ɤ��Ƥ�����ˤϲ��⤷�ʤ�(¿�ť��󥯥롼�ɤζػ�)��
Includes module into class. If class already includes it, just
ignore.

void rb_extend_object(VALUE object, VALUE module)

���֥������Ȥ�⥸�塼��(���������Ƥ���᥽�å�)�dz�ĥ���롥
Extend the object with module's attribute.

** Defining Global Variables

Expand Down Expand Up @@ -871,19 +867,20 @@ Defines global contant. This is just work as

rb_define_method(VALUE class, char *name, VALUE (*func)(), int argc)

�᥽�åɤ�������롥argc��self����������ο���argc��-1�λ�,
�ؿ��ˤϰ����ο�(self��ޤޤʤ�)����1����, �������������2��
���Ȥ��������Ϳ������(��3������self)��argc��-2�λ�, ��1��
����self, ��2������args(args�ϰ�����ޤ�Ruby������)�Ȥ�����
����Ϳ�����롥
Defines a method for the class. func is the function pointer. argc
is the number of arguments. if argc is -1, the function will receive
3 arguments argc, argv, and self. if argc is -2, the function will
receive 2 arguments, self and args, where args is the Ruby array of
the method arguments.

rb_define_private_method(VALUE class, char *name, VALUE (*func)(), int argc)

private�᥽�åɤ�������롥������rb_define_method()��Ʊ����
Defines a private method for the class. Arguments are same as
rb_define_method().

rb_define_singleton_method(VALUE class, char *name, VALUE (*func)(), int argc)

�ðۥ᥽�åɤ�������롥������rb_define_method()��Ʊ����
Defines a singleton method. Arguments are same as rb_define_method().

rb_scan_args(int atgc, VALUE *argv, char *fmt, ...)

Expand All @@ -899,42 +896,40 @@ argc,argv

VALUE rb_funcall(VALUE recv, ID mid, int narg, ...)

�᥽�åɸƤӽФ���ʸ���󤫤�mid�����뤿��ˤ�rb_intern()��Ȥ���
Invokes the method. To retrieve mid from method name, use rb_intern().

VALUE rb_funcall2(VALUE recv, ID mid, int argc, VALUE *argv)

�᥽�åɸƤӽФ���������argc,argv�������Ϥ���
Invokes method, passing arguments by array of values.

VALUE rb_eval_string(char *str)

ʸ�����Ruby�ȥ�����ץȤ��ƥ���ѥ��롦�¹Ԥ��롥
Compiles and executes the string as Ruby program.

ID rb_intern(char *name)

ʸ������б�����ID���֤���
Returns ID corresponding the name.

char *rb_id2name(ID id)

ID���б�����ʸ������֤�(�ǥХå���)��
Returns the name corresponding ID.

char *rb_class2name(VALUE class)

class��̾�����֤�(�ǥХå���)��class��̾��������ʤ����ˤ�,
������̤ä�̾������ĥ��饹��̾�����֤���
Returns the name of the class.

** ���󥹥����ѿ�
** Instance Variables

VALUE rb_iv_get(VALUE obj, char *name)

obj�Υ��󥹥����ѿ����ͤ����롥`@'�ǻϤޤ�ʤ����󥹥���
�ѿ��� Ruby�ץ�����फ�饢�������Ǥ��ʤ��ֱ��줿�ץ��󥹥�
���ѿ��ˤʤ롥
Retrieve the value of the instance variable. If the name is not
prefixed by `@', that variable shall be inaccessible from Ruby.

VALUE rb_iv_set(VALUE obj, char *name, VALUE val)

obj�Υ��󥹥����ѿ���val�˥��åȤ��롥
Sets the value of the instance variable.

** ���湽¤
** Control Structure

VALUE rb_iterate(VALUE (*func1)(), void *arg1, VALUE (*func2)(), void *arg2)

Expand Down Expand Up @@ -1024,6 +1019,6 @@ this method, the compilation will not be done.

/*
* Local variables:
* fill-column: 60
* fill-column: 70
* end:
*/
2 changes: 1 addition & 1 deletion README.EXT.jp
Expand Up @@ -723,7 +723,7 @@ Makefile

(7) MANIFEST�ե�����˥ե�����̾�������

% ls > MANIFEST
% find * -type f -print > MANIFEST
% vi MANIFEST

*.o, *~�ʤ���ɬ�פʥե�����ʳ���MANIFEST���ɲä��Ƥ����ޤ���
Expand Down
5 changes: 3 additions & 2 deletions ToDo
@@ -1,8 +1,10 @@
Language Spec.

* package or access control for global variables
* named arguments like foo(nation:="german").
* named arguments like foo(nation:="german" or nation: "german").
* method to retrieve argument information (need new C API)
* multiple return values, yield values. maybe imcompatible
* cascading method invocation.

Hacking Interpreter

Expand All @@ -12,7 +14,6 @@ Hacking Interpreter
* remove rb_eval() recursions
* syntax tree -> bytecode ???
* scrambled script, or script filter
* regular expression bug /(?:\s+\d+){2}/ URGENT!!

Extension Libraries

Expand Down

0 comments on commit 8dae765

Please sign in to comment.