#include "sgen-entry-stream.h"
#include "sgen-grep-binprot.h"
+/* FIXME Add grepers for specific endianness */
+GrepEntriesFunction grepers [] = {
+ sgen_binary_protocol_grep_entries32p, /* We have header, structures are packed, 32 bit word */
+ sgen_binary_protocol_grep_entries64p, /* We have header, structures are packed, 64 bit word */
+ sgen_binary_protocol_grep_entries /* No header, uses default word size and structure layout */
+};
+
int
main (int argc, char *argv[])
{
input_file = input_path ? open (input_path, O_RDONLY) : STDIN_FILENO;
init_stream (&stream, input_file);
- sgen_binary_protocol_grep_entries (&stream, num_nums, nums, num_vtables, vtables,
- dump_all, pause_times, color_output, first_entry_to_consider);
+ for (i = 0; i < sizeof (grepers) / sizeof (GrepEntriesFunction); i++) {
+ if (grepers [i] (&stream, num_nums, nums, num_vtables, vtables, dump_all,
+ pause_times, color_output, first_entry_to_consider)) {
+ /* Success */
+ break;
+ }
+ reset_stream (&stream);
+ }
close_stream (&stream);
if (input_path)
close (input_file);