[vala] vapigen: support setting array_length_type for parameters
- From: Evan Nemerson <evann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] vapigen: support setting array_length_type for parameters
- Date: Thu, 29 Apr 2010 16:44:50 +0000 (UTC)
commit 4392b61d4c96820571ccc1c2cb9914e18f4fd7e3
Author: Evan Nemerson <evan coeus-group com>
Date: Thu Apr 29 09:38:38 2010 -0700
vapigen: support setting array_length_type for parameters
vala/valacodewriter.vala | 4 ++++
vapigen/valagidlparser.vala | 2 ++
2 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/vala/valacodewriter.vala b/vala/valacodewriter.vala
index cb9c70c..a2bb0f9 100644
--- a/vala/valacodewriter.vala
+++ b/vala/valacodewriter.vala
@@ -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 = ", ";
diff --git a/vapigen/valagidlparser.vala b/vapigen/valagidlparser.vala
index 85e861b..16b7901 100644
--- a/vapigen/valagidlparser.vala
+++ b/vapigen/valagidlparser.vala
@@ -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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]