/*
- * $Id: rb_edje.c 331 2005-04-28 18:17:21Z tilman $
+ * $Id: rb_edje.c 334 2005-04-28 19:06:12Z tilman $
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
CHECK_CLASS (msg, cMsg);
- id = NUM2INT (rb_iv_get (msg, "@id"));
+ id = FIX2INT (rb_iv_get (msg, "@id"));
v = rb_iv_get (msg, "@value");
type = get_msg_type (v);
- ary = rb_check_array_type (v);
+ if (!NIL_P (ary = rb_check_array_type (v)))
+ len = RARRAY (ary)->len;
switch (type) {
case EDJE_MESSAGE_NONE:
static VALUE c_msg_init (int argc, VALUE *argv, VALUE self)
{
- VALUE val;
+ VALUE id, val;
- rb_scan_args (argc, argv, "01", &val);
+ if (argc == 2)
+ rb_scan_args (argc, argv, "11", &id, &val);
+ else
+ rb_scan_args (argc, argv, "1*", &id, &val);
+
+ Check_Type (id, T_FIXNUM);
- rb_iv_set (self, "@id", UINT2NUM (0));
+ rb_iv_set (self, "@id", id);
rb_iv_set (self, "@value", val);
return self;