]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vapigen: Support array_length_type for method return values
authorJürg Billeter <j@bitron.ch>
Tue, 20 Jul 2010 19:20:27 +0000 (21:20 +0200)
committerJürg Billeter <j@bitron.ch>
Tue, 20 Jul 2010 19:20:27 +0000 (21:20 +0200)
vala/valacodewriter.vala
vapigen/valagidlparser.vala

index 721ce3f6136868668864b42912c8234ebd83ec25..e72545885a8a04b14642c314b5aa0840b719967e 100644 (file)
@@ -989,6 +989,10 @@ public class Vala.CodeWriter : CodeVisitor {
                        ccode_params.append_printf ("%sarray_null_terminated = true", separator);
                        separator = ", ";
                }
+               if (m.array_length_type != null && m.return_type is ArrayType) {
+                       ccode_params.append_printf ("%sarray_length_type = \"%s\"", separator, m.array_length_type);
+                       separator = ", ";
+               }
                if (!float_equal (m.cdelegate_target_parameter_position, -3)) {
                        ccode_params.append_printf ("%sdelegate_target_pos = %g", separator, m.cdelegate_target_parameter_position);
                        separator = ", ";
index 8751964dcec0604cd3de2f1666065fd32065e407..3bbf6bae487fb3ee9558c2f94a16e397b37febe1 100644 (file)
@@ -1729,6 +1729,8 @@ public class Vala.GIdlParser : CodeVisitor {
                                                m.no_array_length = true;
                                                m.array_null_terminated = true;
                                        }
+                               } else if (nv[0] == "array_length_type") {
+                                       m.array_length_type = eval (nv[1]);
                                } else if (nv[0] == "type_name") {
                                        var sym = new UnresolvedSymbol (null, eval (nv[1]));
                                        if (return_type is UnresolvedType) {