[valadoc] libvaladoc: Add Struct.copy_function_cname, Struct.destroy_function_cname
- From: Florian Brosch <flobrosch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [valadoc] libvaladoc: Add Struct.copy_function_cname, Struct.destroy_function_cname
- Date: Wed, 10 Apr 2013 17:46:39 +0000 (UTC)
commit 06ae95a8dc8d497e4bc6e8af9dc2129555050638
Author: Florian Brosch <flo brosch gmail com>
Date: Thu Feb 7 19:13:11 2013 +0100
libvaladoc: Add Struct.copy_function_cname, Struct.destroy_function_cname
src/driver/0.14.x/treebuilder.vala | 18 +++++++++++++++++-
src/driver/0.16.x/treebuilder.vala | 10 +++++++++-
src/driver/0.18.x/treebuilder.vala | 10 +++++++++-
src/driver/0.20.x/treebuilder.vala | 10 +++++++++-
src/libvaladoc/api/struct.vala | 21 ++++++++++++++++++++-
5 files changed, 64 insertions(+), 5 deletions(-)
---
diff --git a/src/driver/0.14.x/treebuilder.vala b/src/driver/0.14.x/treebuilder.vala
index c35de4c..6cbec29 100644
--- a/src/driver/0.14.x/treebuilder.vala
+++ b/src/driver/0.14.x/treebuilder.vala
@@ -287,6 +287,14 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
#endif
}
+ private string? get_struct_destroy_function (Vala.Struct element) {
+#if VALA_0_13_0 || VALA_0_13_1
+ return element.get_destroy_function ();
+#else
+ return Vala.CCodeBaseModule.get_ccode_destroy_function (element);
+#endif
+ }
+
private string? get_free_function_name (Vala.Class element) {
if (!element.is_compact) {
return null;
@@ -352,6 +360,14 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
#endif
}
+ private string? get_copy_function (Vala.TypeSymbol sym) {
+#if VALA_0_13_0 || VALA_0_13_1
+ return sym.get_copy_function ();
+#else
+ return Vala.CCodeBaseModule.get_ccode_copy_function (sym);
+#endif
+ }
+
private string get_free_function (Vala.TypeSymbol sym) {
#if VALA_0_13_0 || VALA_0_13_1
return sym.get_free_function ();
@@ -1101,7 +1117,7 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
bool is_basic_type = element.base_type == null && (element.is_boolean_type () ||
element.is_floating_type () || element.is_integer_type ());
- Struct node = new Struct (parent, file, element.name, get_access_modifier(element), comment,
get_cname(element), get_type_macro_name (element), get_type_function_name (element), get_ccode_type_id
(element), get_dup_function (element), get_free_function (element), is_basic_type, element);
+ Struct node = new Struct (parent, file, element.name, get_access_modifier(element), comment,
get_cname(element), get_type_macro_name (element), get_type_function_name (element), get_ccode_type_id
(element), get_dup_function (element), get_copy_function (element), get_struct_destroy_function (element),
get_free_function (element), is_basic_type, element);
symbol_map.set (element, node);
parent.add_child (node);
diff --git a/src/driver/0.16.x/treebuilder.vala b/src/driver/0.16.x/treebuilder.vala
index b090d49..96cece0 100644
--- a/src/driver/0.16.x/treebuilder.vala
+++ b/src/driver/0.16.x/treebuilder.vala
@@ -302,6 +302,14 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
return Vala.CCodeBaseModule.get_ccode_dup_function (sym);
}
+ private string? get_copy_function (Vala.TypeSymbol sym) {
+ return Vala.CCodeBaseModule.get_ccode_copy_function (sym);
+ }
+
+ private string? get_destroy_function (Vala.TypeSymbol sym) {
+ return Vala.CCodeBaseModule.get_ccode_destroy_function (sym);
+ }
+
private string? get_free_function (Vala.TypeSymbol sym) {
return Vala.CCodeBaseModule.get_ccode_free_function (sym);
}
@@ -1009,7 +1017,7 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
bool is_basic_type = element.base_type == null && (element.is_boolean_type () ||
element.is_floating_type () || element.is_integer_type ());
- Struct node = new Struct (parent, file, element.name, get_access_modifier (element), comment,
get_cname (element), get_type_macro_name (element), get_type_function_name (element), get_ccode_type_id
(element), get_dup_function (element), get_free_function (element), is_basic_type, element);
+ Struct node = new Struct (parent, file, element.name, get_access_modifier (element), comment,
get_cname (element), get_type_macro_name (element), get_type_function_name (element), get_ccode_type_id
(element), get_dup_function (element), get_copy_function (element), get_destroy_function (element),
get_free_function (element), is_basic_type, element);
symbol_map.set (element, node);
parent.add_child (node);
diff --git a/src/driver/0.18.x/treebuilder.vala b/src/driver/0.18.x/treebuilder.vala
index d536f4b..c597f27 100644
--- a/src/driver/0.18.x/treebuilder.vala
+++ b/src/driver/0.18.x/treebuilder.vala
@@ -307,6 +307,14 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
return Vala.CCodeBaseModule.get_ccode_dup_function (sym);
}
+ private string? get_copy_function (Vala.TypeSymbol sym) {
+ return Vala.CCodeBaseModule.get_ccode_copy_function (sym);
+ }
+
+ private string? get_destroy_function (Vala.TypeSymbol sym) {
+ return Vala.CCodeBaseModule.get_ccode_destroy_function (sym);
+ }
+
private string? get_free_function (Vala.TypeSymbol sym) {
return Vala.CCodeBaseModule.get_ccode_free_function (sym);
}
@@ -1025,7 +1033,7 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
bool is_basic_type = element.base_type == null && (element.is_boolean_type () ||
element.is_floating_type () || element.is_integer_type ());
- Struct node = new Struct (parent, file, element.name, get_access_modifier (element), comment,
get_cname (element), get_type_macro_name (element), get_type_function_name (element), get_ccode_type_id
(element), get_dup_function (element), get_free_function (element), is_basic_type, element);
+ Struct node = new Struct (parent, file, element.name, get_access_modifier (element), comment,
get_cname (element), get_type_macro_name (element), get_type_function_name (element), get_ccode_type_id
(element), get_dup_function (element), get_copy_function (element), get_destroy_function (element),
get_free_function (element), is_basic_type, element);
symbol_map.set (element, node);
parent.add_child (node);
diff --git a/src/driver/0.20.x/treebuilder.vala b/src/driver/0.20.x/treebuilder.vala
index f9f8fef..4deb224 100644
--- a/src/driver/0.20.x/treebuilder.vala
+++ b/src/driver/0.20.x/treebuilder.vala
@@ -299,6 +299,14 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
return Vala.CCodeBaseModule.get_ccode_dup_function (sym);
}
+ private string? get_copy_function (Vala.TypeSymbol sym) {
+ return Vala.CCodeBaseModule.get_ccode_copy_function (sym);
+ }
+
+ private string? get_destroy_function (Vala.TypeSymbol sym) {
+ return Vala.CCodeBaseModule.get_ccode_destroy_function (sym);
+ }
+
private string? get_free_function (Vala.TypeSymbol sym) {
return Vala.CCodeBaseModule.get_ccode_free_function (sym);
}
@@ -987,7 +995,7 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
bool is_basic_type = element.base_type == null && (element.is_boolean_type () ||
element.is_floating_type () || element.is_integer_type ());
- Struct node = new Struct (parent, file, element.name, get_access_modifier (element), comment,
get_cname (element), get_type_macro_name (element), get_type_function_name (element), get_ccode_type_id
(element), get_dup_function (element), get_free_function (element), is_basic_type, element);
+ Struct node = new Struct (parent, file, element.name, get_access_modifier (element), comment,
get_cname (element), get_type_macro_name (element), get_type_function_name (element), get_ccode_type_id
(element), get_dup_function (element), get_copy_function (element), get_destroy_function (element),
get_free_function (element), is_basic_type, element);
symbol_map.set (element, node);
parent.add_child (node);
diff --git a/src/libvaladoc/api/struct.vala b/src/libvaladoc/api/struct.vala
index 475f6d8..9910994 100644
--- a/src/libvaladoc/api/struct.vala
+++ b/src/libvaladoc/api/struct.vala
@@ -29,15 +29,19 @@ using Valadoc.Content;
*/
public class Valadoc.Api.Struct : TypeSymbol {
private string? dup_function_cname;
+ private string? copy_function_cname;
private string? free_function_cname;
+ private string? destroy_function_cname;
private string? type_id;
private string? cname;
- public Struct (Node parent, SourceFile file, string name, SymbolAccessibility accessibility,
SourceComment? comment, string? cname, string? type_macro_name, string? type_function_name, string? type_id,
string? dup_function_cname, string? free_function_cname, bool is_basic_type, void* data) {
+ public Struct (Node parent, SourceFile file, string name, SymbolAccessibility accessibility,
SourceComment? comment, string? cname, string? type_macro_name, string? type_function_name, string? type_id,
string? dup_function_cname, string? copy_function_cname, string? destroy_function_cname, string?
free_function_cname, bool is_basic_type, void* data) {
base (parent, file, name, accessibility, comment, type_macro_name, null, null,
type_function_name, is_basic_type, data);
this.dup_function_cname = dup_function_cname;
+ this.copy_function_cname = copy_function_cname;
this.free_function_cname = free_function_cname;
+ this.destroy_function_cname = destroy_function_cname;
this.cname = cname;
}
@@ -74,6 +78,14 @@ public class Valadoc.Api.Struct : TypeSymbol {
}
/**
+ * Returns the C function name that copies instances of this data
+ * type.
+ */
+ public string? get_copy_function_cname () {
+ return copy_function_cname;
+ }
+
+ /**
* Returns the C function name that frees instances of this data type.
*/
public string? get_free_function_cname () {
@@ -81,6 +93,13 @@ public class Valadoc.Api.Struct : TypeSymbol {
}
/**
+ * Returns the C function name that destroys instances of this data type.
+ */
+ public string? get_destroy_function_cname () {
+ return destroy_function_cname;
+ }
+
+ /**
* { inheritDoc}
*/
public override NodeType node_type {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]