1 --- libcaca-0.99.beta17/configure.ac~ 2010-02-08 13:34:28.000000000 +0100
2 +++ libcaca-0.99.beta17/configure.ac 2010-03-02 17:34:37.239187424 +0100
4 if test "${enable_ruby}" != "no"; then
5 AC_PATH_PROG(RUBY, ruby, no)
6 if test "${RUBY}" != "no"; then
7 - RUBY_CFLAGS="-I$(ruby -r rbconfig -e 'print Config::CONFIG@<:@"archdir"@:>@')"
8 + RUBY_CFLAGS=`($RUBY -rmkmf -e 'puts "-I#$hdrdir/#{CONFIG["arch"]} -I#$hdrdir"') 2>/dev/null`
9 RUBY_LIBS="-L$(ruby -r rbconfig -e 'print Config::CONFIG@<:@"libdir"@:>@') -l$(ruby -r rbconfig -e 'print Config::CONFIG@<:@"RUBY_SO_NAME"@:>@')"
10 RUBY_SITEARCHDIR=`ruby -r rbconfig -e 'print Config::CONFIG@<:@"sitearchdir"@:>@'`
11 RUBY_SITELIBDIR=`ruby -r rbconfig -e 'print Config::CONFIG@<:@"sitelibdir"@:>@'`
12 --- libcaca-0.99.beta17/ruby/caca-canvas.c~ 2009-12-14 18:38:56.000000000 +0100
13 +++ libcaca-0.99.beta17/ruby/caca-canvas.c 2010-03-02 17:40:06.868186374 +0100
18 - n = RARRAY(points)->len;
19 + n = RARRAY_LEN(points);
21 ax = (int*)malloc(n*sizeof(int));
26 v = rb_ary_entry(points, i);
27 - if((TYPE(v) == T_ARRAY) && (RARRAY(v)->len == 2))
28 + if((TYPE(v) == T_ARRAY) && (RARRAY_LEN(v) == 2))
30 x = rb_ary_entry(v,0);
31 y = rb_ary_entry(v,1);
36 - n = RARRAY(points)->len;
37 + n = RARRAY_LEN(points);
39 ax = (int*)malloc(n*sizeof(int));
44 v = rb_ary_entry(points, i);
45 - if((TYPE(v) == T_ARRAY) && (RARRAY(v)->len == 2))
46 + if((TYPE(v) == T_ARRAY) && (RARRAY_LEN(v) == 2))
48 x = rb_ary_entry(v,0);
49 y = rb_ary_entry(v,1);
54 - l = RARRAY(coords)->len;
55 + l = RARRAY_LEN(coords);
58 rb_raise(rb_eArgError, "invalid coords list");
60 ccoords[i] = NUM2INT(v);
63 - if((TYPE(v) != T_ARRAY) || (RARRAY(v)->len != 2))
64 + if((TYPE(v) != T_ARRAY) || (RARRAY_LEN(v) != 2))
65 rb_raise(rb_eArgError, "invalid coords list");
66 ccoords[2*i] = NUM2INT(rb_ary_entry(v, 0));
67 ccoords[2*i+1] = NUM2INT(rb_ary_entry(v, 1));
71 - l = RARRAY(uv)->len;
75 rb_raise(rb_eArgError, "invalid uv list");
80 - if((TYPE(v) != T_ARRAY) || (RARRAY(v)->len != 2))
81 + if((TYPE(v) != T_ARRAY) || (RARRAY_LEN(v) != 2))
82 rb_raise(rb_eArgError, "invalid uv list");
83 ccoords[2*i] = NUM2DBL(rb_ary_entry(v, 0));
84 ccoords[2*i+1] = NUM2DBL(rb_ary_entry(v, 1));
86 static VALUE import_from_memory(VALUE self, VALUE data, VALUE format)
89 - bytes = caca_import_canvas_from_memory (_SELF, StringValuePtr(data), RSTRING(StringValue(data))->len, StringValuePtr(format));
90 + bytes = caca_import_canvas_from_memory (_SELF, StringValuePtr(data), RSTRING_LEN(StringValue(data)), StringValuePtr(format));
92 rb_raise(rb_eRuntimeError, strerror(errno));
95 static VALUE import_area_from_memory(VALUE self, VALUE x, VALUE y, VALUE data, VALUE format)
98 - bytes = caca_import_area_from_memory (_SELF, NUM2INT(x), NUM2INT(y), StringValuePtr(data), RSTRING(StringValue(data))->len, StringValuePtr(format));
99 + bytes = caca_import_area_from_memory (_SELF, NUM2INT(x), NUM2INT(y), StringValuePtr(data), RSTRING_LEN(StringValue(data)), StringValuePtr(format));
101 rb_raise(rb_eRuntimeError, strerror(errno));
103 --- libcaca-0.99.beta17/ruby/caca-dither.c~ 2009-11-17 16:58:37.000000000 +0100
104 +++ libcaca-0.99.beta17/ruby/caca-dither.c 2010-03-02 17:40:33.434124529 +0100
109 - if(RARRAY(palette)->len != 256)
110 + if(RARRAY_LEN(palette) != 256)
112 rb_raise(rb_eArgError, "Palette must contain 256 elements");
117 v = rb_ary_entry(palette, i);
118 - if((TYPE(v) == T_ARRAY) && (RARRAY(v)->len == 4))
119 + if((TYPE(v) == T_ARRAY) && (RARRAY_LEN(v) == 4))
121 r = rb_ary_entry(v,0);
122 g = rb_ary_entry(v,1);