]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vapigen: support setting array_length_type for parameters
authorEvan Nemerson <evan@coeus-group.com>
Thu, 29 Apr 2010 16:38:38 +0000 (09:38 -0700)
committerEvan Nemerson <evan@coeus-group.com>
Thu, 29 Apr 2010 16:44:16 +0000 (09:44 -0700)
vala/valacodewriter.vala
vapigen/valagidlparser.vala

index cb9c70cf55c4269a4ffe7cfbbe26284a3592010a..a2bb0f9912694644643fec27ee3f190ada686c37 100644 (file)
@@ -765,6 +765,10 @@ public class Vala.CodeWriter : CodeVisitor {
                                ccode_params.append_printf ("%sarray_length = false", separator);
                                separator = ", ";
                        }
+                       if (param.array_length_type != null && param.parameter_type is ArrayType) {
+                               ccode_params.append_printf ("%sarray_length_type = \"%s\"", separator, param.array_length_type);
+                               separator = ", ";
+                       }
                        if (!float_equal (param.carray_length_parameter_position, i + 0.1)) {
                                ccode_params.append_printf ("%sarray_length_pos = %g", separator, param.carray_length_parameter_position);
                                separator = ", ";
index 85e861b61b6896b1274f41636e3921773c1698bf..16b79013b2b91e654dc12a67591aaef6ba2bbf9e 100644 (file)
@@ -1803,6 +1803,8 @@ public class Vala.GIdlParser : CodeVisitor {
                                                if (eval (nv[1]) == "1") {
                                                        p.no_array_length = true;
                                                }
+                                       } else if (nv[0] == "array_length_type") {
+                                               p.array_length_type = eval (nv[1]);
                                        } else if (nv[0] == "array_null_terminated") {
                                                if (eval (nv[1]) == "1") {
                                                        p.no_array_length = true;