/* Return TRUE if a capture with a given GArray of encapsulation types and a given bitset of comment types can be written in a specified format, and FALSE if it can't.  */
static gboolean wtap_dump_can_write_format(int ft, const GArray *file_encaps, guint32 required_comment_types)
/* Return TRUE if a capture with a given GArray of encapsulation types and a given bitset of comment types can be written in a specified format, and FALSE if it can't.  */
static gboolean wtap_dump_can_write_format(int ft, const GArray *file_encaps, guint32 required_comment_types)
{
	guint i;
	if (!wtap_dump_can_open(ft)) {
		return FALSE;
	}
	if (!wtap_dump_supports_comment_types(ft, required_comment_types)) {
		return FALSE;
	}
	if (!wtap_dump_can_write_encap(ft, wtap_dump_file_encap_type(file_encaps))) {
		return FALSE;
	}
	for (i = 0; i < file_encaps->len; i++) {
		if (!wtap_dump_can_write_encap(ft,
		    g_array_index(file_encaps, int, i))) {
			return FALSE;
		}
	}
	return TRUE;
}