input/output formats: Explicit struct member names.

This makes it immediately clear what an entry is supposed to be, no
need to look it up in some header file.
This commit is contained in:
Uwe Hermann 2011-04-06 19:42:49 +02:00
parent f4314d7e06
commit d494a4aa9d
10 changed files with 77 additions and 77 deletions

View File

@ -99,9 +99,9 @@ static int loadfile(struct sr_input *in, const char *filename)
}
struct sr_input_format input_binary = {
"binary",
"Raw binary",
format_match,
init,
loadfile,
.extension = "binary",
.description = "Raw binary",
.format_match = format_match,
.init = init,
.loadfile = loadfile,
};

View File

@ -439,29 +439,29 @@ static int data_ascii(struct sr_output *o, const char *data_in,
#endif
struct sr_output_format output_analog_bits = {
"analog_bits",
"Bits (takes argument, default 64)",
SR_DF_ANALOG,
init_bits,
data_bits,
event,
.extension = "analog_bits",
.description = "Bits (takes argument, default 64)",
.df_type = SR_DF_ANALOG,
.init = init_bits,
.data = data_bits,
.event = event,
};
#if 0
struct sr_output_format output_analog_hex = {
"analog_hex",
"Hexadecimal (takes argument, default 192)",
SR_DF_ANALOG,
init_hex,
data_hex,
event,
.extension = "analog_hex",
.description = "Hexadecimal (takes argument, default 192)",
.df_type = SR_DF_ANALOG,
.init = init_hex,
.data = data_hex,
.event = event,
};
struct sr_output_format output_analog_ascii = {
"analog_ascii",
"ASCII (takes argument, default 74)",
SR_DF_ANALOG,
init_ascii,
data_ascii,
event,
.extension = "analog_ascii",
.description = "ASCII (takes argument, default 74)",
.df_type = SR_DF_ANALOG,
.init = init_ascii,
.data = data_ascii,
.event = event,
};
#endif

View File

@ -43,10 +43,10 @@ static int data(struct sr_output *o, const char *data_in, uint64_t length_in,
}
struct sr_output_format output_binary = {
"binary",
"Raw binary",
SR_DF_LOGIC,
NULL,
data,
NULL,
.extension = "binary",
.description = "Raw binary",
.df_type = SR_DF_LOGIC,
.init = NULL,
.data = data,
.event = NULL,
};

View File

@ -194,12 +194,12 @@ static int data(struct sr_output *o, const char *data_in, uint64_t length_in,
}
struct sr_output_format output_gnuplot = {
"gnuplot",
"Gnuplot",
SR_DF_LOGIC,
init,
data,
event,
.extension = "gnuplot",
.description = "Gnuplot",
.df_type = SR_DF_LOGIC,
.init = init,
.data = data,
.event = event,
};
/* Temporarily disabled. */
@ -340,11 +340,11 @@ static int analog_data(struct sr_output *o, char *data_in, uint64_t length_in,
}
struct sr_output_format output_analog_gnuplot = {
"analog_gnuplot",
"Gnuplot analog",
SR_DF_ANALOG,
analog_init,
analog_data,
event,
.extension = "analog_gnuplot",
.description = "Gnuplot analog",
.df_type = SR_DF_ANALOG,
.init = analog_init,
.data = analog_data,
.event = event,
};
#endif

View File

@ -124,10 +124,10 @@ static int data(struct sr_output *o, const char *data_in, uint64_t length_in,
}
struct sr_output_format output_ols = {
"ols",
"OpenBench Logic Sniffer",
SR_DF_LOGIC,
init,
data,
event,
.extension = "ols",
.description = "OpenBench Logic Sniffer",
.df_type = SR_DF_LOGIC,
.init = init,
.data = data,
.event = event,
};

View File

@ -38,10 +38,10 @@ static int event(struct sr_output *o, int event_type, char **data_out,
}
struct sr_output_format output_foo = {
"foo",
"The foo format",
SR_DF_LOGIC,
init,
data,
event,
.extension = "foo",
.description = "The foo format",
.df_type = SR_DF_LOGIC,
.init = init,
.data = data,
.event = event,
};

View File

@ -213,10 +213,10 @@ static int data(struct sr_output *o, const char *data_in, uint64_t length_in,
}
struct sr_output_format output_vcd = {
"vcd",
"Value Change Dump (VCD)",
SR_DF_LOGIC,
init,
data,
event,
.extension = "vcd",
.description = "Value Change Dump (VCD)",
.df_type = SR_DF_LOGIC,
.init = init,
.data = data,
.event = event,
};

View File

@ -114,10 +114,10 @@ int data_ascii(struct sr_output *o, const char *data_in, uint64_t length_in,
}
struct sr_output_format output_text_ascii = {
"ascii",
"ASCII (takes argument, default 74)",
SR_DF_LOGIC,
init_ascii,
data_ascii,
event,
.extension = "ascii",
.description = "ASCII (takes argument, default 74)",
.df_type = SR_DF_LOGIC,
.init = init_ascii,
.data = data_ascii,
.event = event,
};

View File

@ -101,10 +101,10 @@ int data_bits(struct sr_output *o, const char *data_in, uint64_t length_in,
}
struct sr_output_format output_text_bits = {
"bits",
"Bits (takes argument, default 64)",
SR_DF_LOGIC,
init_bits,
data_bits,
event,
.extension = "bits",
.description = "Bits (takes argument, default 64)",
.df_type = SR_DF_LOGIC,
.init = init_bits,
.data = data_bits,
.event = event,
};

View File

@ -90,10 +90,10 @@ int data_hex(struct sr_output *o, const char *data_in, uint64_t length_in,
}
struct sr_output_format output_text_hex = {
"hex",
"Hexadecimal (takes argument, default 192)",
SR_DF_LOGIC,
init_hex,
data_hex,
event,
.extension = "hex",
.description = "Hexadecimal (takes argument, default 192)",
.df_type = SR_DF_LOGIC,
.init = init_hex,
.data = data_hex,
.event = event,
};