[vala/0.54] 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.54] girparser: Add support for "copy_/free_function" metadata for compact classes
- Date: Thu, 17 Mar 2022 11:07:04 +0000 (UTC)
commit 21130a06eb0a9164fd04bc076d9aa87d55badd4d
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 fedf6f03a..a66e5d706 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,
@@ -3616,6 +3618,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]