[vala/staging] 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/staging] girparser: Add support for "copy_/free_function" metadata for compact classes
- Date: Mon, 28 Feb 2022 11:15:27 +0000 (UTC)
commit b575891887a3aa16ea96a20af5beb141f433c55a
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 88f38434b..53d073926 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,
@@ -3615,6 +3617,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]