summaryrefslogtreecommitdiffstats
path: root/ext/md5
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-01-20 04:59:39 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-01-20 04:59:39 +0000
commita2af08da0c33d2dcde870b491f62a8bd0c1c6b81 (patch)
treefeb35473da45947378fbc02defe39bcd79ef600e /ext/md5
parentc5f4657aaa8a92db27dc722dee741f1b8e0da809 (diff)
downloadruby-a2af08da0c33d2dcde870b491f62a8bd0c1c6b81.tar.gz
ruby-a2af08da0c33d2dcde870b491f62a8bd0c1c6b81.tar.xz
ruby-a2af08da0c33d2dcde870b491f62a8bd0c1c6b81.zip
This commit was generated by cvs2svn to compensate for changes in r372,
which included commits to RCS files with non-trunk default branches. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/md5')
-rw-r--r--ext/md5/md5init.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/ext/md5/md5init.c b/ext/md5/md5init.c
index 47f913792..a825f96d4 100644
--- a/ext/md5/md5init.c
+++ b/ext/md5/md5init.c
@@ -5,7 +5,7 @@
$Author$
created at: Fri Aug 2 09:24:12 JST 1996
- Copyright (C) 1995 Yukihiro Matsumoto
+ Copyright (C) 1995-1998 Yukihiro Matsumoto
************************************************/
/* This module provides an interface to the RSA Data Security,
@@ -42,7 +42,7 @@ md5_digest(obj)
ctx = *md5;
MD5Final(digest, &ctx);
- return str_new(digest, 16);
+ return rb_str_new(digest, 16);
}
static VALUE
@@ -53,7 +53,7 @@ md5_clone(obj)
MD5_CTX *md5, *md5_new;
Data_Get_Struct(obj, MD5_CTX, md5);
- obj = Data_Make_Struct(CLASS_OF(obj), MD5_CTX, 0, 0, md5_new);
+ obj = Data_Make_Struct(CLASS_OF(obj), MD5_CTX, 0, free, md5_new);
*md5_new = *md5;
return obj;
@@ -61,6 +61,9 @@ md5_clone(obj)
static VALUE
md5_new(argc, argv, class)
+ int argc;
+ VALUE* argv;
+ VALUE class;
{
int i;
VALUE arg, obj;
@@ -69,18 +72,19 @@ md5_new(argc, argv, class)
rb_scan_args(argc, argv, "01", &arg);
if (!NIL_P(arg)) Check_Type(arg, T_STRING);
- obj = Data_Make_Struct(class, MD5_CTX, 0, 0, md5);
+ obj = Data_Make_Struct(class, MD5_CTX, 0, free, md5);
MD5Init(md5);
if (!NIL_P(arg)) {
md5_update(obj, arg);
}
+ rb_obj_call_init(obj);
return obj;
}
Init_md5()
{
- cMD5 = rb_define_class("MD5", cObject);
+ cMD5 = rb_define_class("MD5", rb_cObject);
rb_define_singleton_method(cMD5, "new", md5_new, -1);