projects
/
ruby-ecore.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Removed an unused variable.
[ruby-ecore.git]
/
src
/
ecore_job
/
rb_job.c
diff --git
a/src/ecore_job/rb_job.c
b/src/ecore_job/rb_job.c
index e6d93f0c0a664ae2ebc96409802ad48090f576c2..5c4ff46c00cc55620c414ac9abacb77b28c8ce95 100644
(file)
--- a/
src/ecore_job/rb_job.c
+++ b/
src/ecore_job/rb_job.c
@@
-1,7
+1,7
@@
/*
/*
- * $Id: rb_job.c
60 2004-08-10 14:12:36
Z tilman $
+ * $Id: rb_job.c
351 2006-02-10 15:25:40
Z tilman $
*
*
- * Copyright (C) 2004
Tilman Sauerbeck (tilman at code-monkey de
)
+ * Copyright (C) 2004
ruby-ecore team (see AUTHORS
)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@
-55,6
+55,15
@@
static void c_free (RbJob *job)
free (job);
}
free (job);
}
+static VALUE c_alloc (VALUE klass)
+{
+ RbJob *job = NULL;
+
+ ecore_init ();
+
+ return Data_Make_Struct (klass, RbJob, c_mark, c_free, job);
+}
+
/*
* call-seq:
* Ecore::Job::Job.new { block } => job
/*
* call-seq:
* Ecore::Job::Job.new { block } => job
@@
-62,23
+71,19
@@
static void c_free (RbJob *job)
* Creates an Ecore::Job::Job object.
* After execution, the object will be deleted.
*/
* Creates an Ecore::Job::Job object.
* After execution, the object will be deleted.
*/
-static VALUE c_
new (VALUE klass
)
+static VALUE c_
init (VALUE self
)
{
{
- VALUE self;
- RbJob *job;
+ RbJob *job = NULL;
if (!rb_block_given_p ())
if (!rb_block_given_p ())
- return Qnil;
-
- self = Data_Make_Struct (klass, RbJob, c_mark, c_free, job);
+ rb_raise (rb_eStandardError, "block missing");
-
ecore_init (
);
+
Data_Get_Struct (self, RbJob, job
);
job->callback = rb_block_proc ();
job->callback = rb_block_proc ();
+ job->deleted = false;
job->real = ecore_job_add (on_job, job);
job->real = ecore_job_add (on_job, job);
- rb_obj_call_init (self, 0, NULL);
-
return self;
}
return self;
}
@@
-109,6
+114,7
@@
void Init_Job (void)
{
VALUE c = rb_define_class_under (mJob, "Job", rb_cObject);
{
VALUE c = rb_define_class_under (mJob, "Job", rb_cObject);
- rb_define_singleton_method (c, "new", c_new, 0);
+ rb_define_alloc_func (c, c_alloc);
+ rb_define_method (c, "initialize", c_init, 0);
rb_define_method (c, "delete", c_delete, 0);
}
rb_define_method (c, "delete", c_delete, 0);
}