summaryrefslogtreecommitdiff
path: root/girepository/girparser.c
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@sugarlabs.org>2010-05-03 19:17:00 +0200
committerTomeu Vizoso <tomeu@sugarlabs.org>2010-05-03 19:17:00 +0200
commit39f2997b9f32598fa2288cdac36f513fcab590b5 (patch)
tree90e1e308a99d30edf42480e84d6f0a4fbfe6ceb7 /girepository/girparser.c
parentffc28a47400e06b39e05be4f7e4c8dccef4bd8ea (diff)
downloadgobject-introspection-39f2997b9f32598fa2288cdac36f513fcab590b5.tar.gz
Revert "Add support for GArrays: add g_type_info_get_array_type() and properly scan GArray args"
This reverts commit 87291e08b0fd34b62e1ad9811c174108b38311a9.
Diffstat (limited to 'girepository/girparser.c')
-rw-r--r--girepository/girparser.c48
1 files changed, 15 insertions, 33 deletions
diff --git a/girepository/girparser.c b/girepository/girparser.c
index 85f85e21..5b24604a 100644
--- a/girepository/girparser.c
+++ b/girepository/girparser.c
@@ -1717,40 +1717,22 @@ start_type (GMarkupParseContext *context,
typenode->is_pointer = TRUE;
typenode->is_array = TRUE;
- ctype = find_attribute ("c:type", attribute_names, attribute_values);
- if (g_str_has_prefix (ctype, "GArray")) {
- typenode->array_type = GI_ARRAY_TYPE_ARRAY;
- } else if (g_str_has_prefix (ctype, "GByteArray")) {
- typenode->array_type = GI_ARRAY_TYPE_BYTE_ARRAY;
- } else if (g_str_has_prefix (ctype, "GPtrArray")) {
- typenode->array_type = GI_ARRAY_TYPE_PTR_ARRAY;
- } else {
- typenode->array_type = GI_ARRAY_TYPE_C;
- }
+ zero = find_attribute ("zero-terminated", attribute_names, attribute_values);
+ len = find_attribute ("length", attribute_names, attribute_values);
+ size = find_attribute ("fixed-size", attribute_names, attribute_values);
- if (typenode->array_type == GI_ARRAY_TYPE_C) {
- zero = find_attribute ("zero-terminated", attribute_names, attribute_values);
- len = find_attribute ("length", attribute_names, attribute_values);
- size = find_attribute ("fixed-size", attribute_names, attribute_values);
-
- typenode->has_length = len != NULL;
- typenode->length = typenode->has_length ? atoi (len) : -1;
-
- typenode->has_size = size != NULL;
- typenode->size = typenode->has_size ? atoi (size) : -1;
-
- if (zero)
- typenode->zero_terminated = strcmp(zero, "1") == 0;
- else
- /* If neither zero-terminated nor length nor fixed-size is given, assume zero-terminated. */
- typenode->zero_terminated = !(typenode->has_length || typenode->has_size);
- } else {
- typenode->zero_terminated = FALSE;
- typenode->has_length = FALSE;
- typenode->length = -1;
- typenode->has_size = FALSE;
- typenode->size = -1;
- }
+ typenode->zero_terminated = !(zero && strcmp (zero, "1") != 0);
+ typenode->has_length = len != NULL;
+ typenode->length = typenode->has_length ? atoi (len) : -1;
+
+ typenode->has_size = size != NULL;
+ typenode->size = typenode->has_size ? atoi (size) : -1;
+
+ if (zero)
+ typenode->zero_terminated = strcmp(zero, "1") == 0;
+ else
+ /* If neither zero-terminated nor length nor fixed-size is given, assume zero-terminated. */
+ typenode->zero_terminated = !(typenode->has_length || typenode->has_size);
}
else
{