input/output formats: s/extension/id/.

The struct entry 'extension' is not really a (filename) extension, but
rather a unique ID used for input or output formats, e.g. in the sigrok
CLI or GUI interface. Thus, rename it accordingly.
This commit is contained in:
Uwe Hermann 2011-04-06 21:51:36 +02:00
parent 8703f512a7
commit cdb3573ceb
11 changed files with 15 additions and 15 deletions

View File

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

View File

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

View File

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

View File

@ -194,7 +194,7 @@ static int data(struct sr_output *o, const char *data_in, uint64_t length_in,
}
struct sr_output_format output_gnuplot = {
.extension = "gnuplot",
.id = "gnuplot",
.description = "Gnuplot",
.df_type = SR_DF_LOGIC,
.init = init,
@ -340,7 +340,7 @@ static int analog_data(struct sr_output *o, char *data_in, uint64_t length_in,
}
struct sr_output_format output_analog_gnuplot = {
.extension = "analog_gnuplot",
.id = "analog_gnuplot",
.description = "Gnuplot analog",
.df_type = SR_DF_ANALOG,
.init = analog_init,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -135,7 +135,7 @@ struct sr_input {
};
struct sr_input_format {
char *extension;
char *id;
char *description;
int (*format_match) (const char *filename);
int (*init) (struct sr_input *in);
@ -150,7 +150,7 @@ struct sr_output {
};
struct sr_output_format {
char *extension;
char *id;
char *description;
int df_type;
int (*init) (struct sr_output *o);