if (dm_h5_read_comments_info(h5_file_id,&n_strings,&string_length,
error_string) != DM_FILEIO_SUCCESS) {
printf("%s\n",error_string);
dm_h5_close(h5_file_id);
exit(1);
}
my_comment_struct.n_strings_max = n_strings;
my_comment_struct.string_length = string_length;
my_comment_struct.string_array =
(char *)malloc(my_comment_struct.n_strings_max*
my_comment_struct.string_length);
my_comment_struct.specimen_name =
(char *)malloc(my_comment_struct.string_length);
my_comment_struct.collection_date =
(char *)malloc(my_comment_struct.string_length);
dm_clear_comments(&my_comment_struct);
Now we can read the actual comments.
if (dm_h5_read_comments(h5_file_id,&my_comment_struct,
error_string) != DM_FILEIO_SUCCESS) {
printf("%s\n",error_string);
dm_h5_close(h5_file_id);
exit(1);
}