fprintf(fd, "[error] %s: unable to find struct field declaration type\n", __func__);
return -EINVAL;
}
+
+ /* Check if field with same name already exists */
+ if (struct_declaration_lookup_field_index(struct_declaration, field_name) >= 0) {
+ fprintf(fd, "[error] %s: duplicate field %s in struct\n", __func__, g_quark_to_string(field_name));
+ return -EINVAL;
+ }
+
struct_declaration_add_field(struct_declaration,
g_quark_to_string(field_name),
field_declaration);
stream->declaration_scope = new_declaration_scope(parent_declaration_scope);
stream->events_by_id = g_ptr_array_new();
stream->event_quark_to_id = g_hash_table_new(g_direct_hash, g_direct_equal);
- stream->files = g_ptr_array_new();
+ stream->streams = g_ptr_array_new();
if (node) {
cds_list_for_each_entry(iter, &node->u.stream.declaration_list, siblings) {
ret = ctf_stream_declaration_visit(fd, depth + 1, iter, stream, trace);
declaration_unref(&stream->event_context_decl->p);
if (stream->packet_context_decl)
declaration_unref(&stream->packet_context_decl->p);
- g_ptr_array_free(stream->files, TRUE);
+ g_ptr_array_free(stream->streams, TRUE);
g_ptr_array_free(stream->events_by_id, TRUE);
g_hash_table_destroy(stream->event_quark_to_id);
free_declaration_scope(stream->declaration_scope);