[vala/0.48] girparser: Add support for "copy_/free_function" metadata for compact classes
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.48] girparser: Add support for "copy_/free_function" metadata for compact classes
- Date: Mon, 21 Mar 2022 08:17:08 +0000 (UTC)
commit 9963da3d50c3d32ec5e88c8eee7921c7e6326478
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Mon Feb 28 12:12:56 2022 +0100
girparser: Add support for "copy_/free_function" metadata for compact classes
vala/valagirparser.vala | 8 ++++++++
1 file changed, 8 insertions(+)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index f3435e335..7657bd1a1 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -88,6 +88,8 @@ public class Vala.GirParser : CodeVisitor {
FLOATING,
TYPE_ID,
TYPE_GET_FUNCTION,
+ COPY_FUNCTION,
+ FREE_FUNCTION,
REF_FUNCTION,
REF_SINK_FUNCTION,
UNREF_FUNCTION,
@@ -3564,6 +3566,12 @@ public class Vala.GirParser : CodeVisitor {
if (metadata.has_argument (ArgumentType.BASE_TYPE)) {
cl.add_base_type (parse_type_from_string (metadata.get_string
(ArgumentType.BASE_TYPE), true, metadata.get_source_reference (ArgumentType.BASE_TYPE)));
}
+ if (metadata.has_argument (ArgumentType.COPY_FUNCTION)) {
+ cl.set_attribute_string ("CCode", "copy_function", metadata.get_string
(ArgumentType.COPY_FUNCTION));
+ }
+ if (metadata.has_argument (ArgumentType.FREE_FUNCTION)) {
+ cl.set_attribute_string ("CCode", "free_function", metadata.get_string
(ArgumentType.FREE_FUNCTION));
+ }
if (metadata.has_argument (ArgumentType.REF_FUNCTION)) {
cl.set_attribute_string ("CCode", "ref_function", metadata.get_string
(ArgumentType.REF_FUNCTION));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]