aboutsummaryrefslogtreecommitdiff
path: root/type.h
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2012-09-08 00:52:34 +0200
committerPetr Machata <pmachata@redhat.com>2012-09-22 15:26:38 +0200
commit64d6e060aa1d4607e766e40825bd9c9d13e8e1a4 (patch)
treebe21584f4f9ddd5fc0ac8b66b716d624c3219ec0 /type.h
parente36298a706b96bfdf9335fbe8288827761d77957 (diff)
downloadltrace-64d6e060aa1d4607e766e40825bd9c9d13e8e1a4.tar.gz
Add function type_aggregate_size
That to simply obtain number of elements in a structure or an array. This is a counterpart to type_element.
Diffstat (limited to 'type.h')
-rw-r--r--type.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/type.h b/type.h
index 53123b8..e8dec71 100644
--- a/type.h
+++ b/type.h
@@ -87,6 +87,11 @@ struct arg_type_info *type_struct_get(struct arg_type_info *info, size_t idx);
/* Return number of fields of structure type INFO. */
size_t type_struct_size(struct arg_type_info *info);
+/* Return number of elements of an aggregate type INFO. This can be
+ * either ARGTYPE_STRUCT or ARGTYPE_ARRAY of constant length. If
+ * ARGTYPE_ARRAY does not have a constant length, this returns -1. */
+size_t type_aggregate_size(struct arg_type_info *info);
+
/* Initialize INFO so it becomes ARGTYPE_ARRAY. The element type is
* passed in ELEMENT_INFO, and array length in LENGTH_EXPR. If,
* respectively, OWN_INFO and OWN_LENGTH are true, the pointee and