[vala] vapigen: Support array_length_type for method return values
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] vapigen: Support array_length_type for method return values
- Date: Tue, 20 Jul 2010 19:25:38 +0000 (UTC)
commit 254081594aa7dd357dc162a1549469717877cbdd
Author: Jürg Billeter <j bitron ch>
Date: Tue Jul 20 21:20:27 2010 +0200
vapigen: Support array_length_type for method return values
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 721ce3f..e725458 100644
--- a/vala/valacodewriter.vala
+++ b/vala/valacodewriter.vala
@@ -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 = ", ";
diff --git a/vapigen/valagidlparser.vala b/vapigen/valagidlparser.vala
index 8751964..3bbf6ba 100644
--- a/vapigen/valagidlparser.vala
+++ b/vapigen/valagidlparser.vala
@@ -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) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]