From: Uwe Hermann Date: Wed, 6 Apr 2011 19:51:36 +0000 (+0200) Subject: input/output formats: s/extension/id/. X-Git-Tag: libsigrok-0.1.0~293 X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=cdb3573ceba61b02b80f7fc979d166db5b6ff3bc 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. --- diff --git a/input/input_binary.c b/input/input_binary.c index e89dc84c..2b5580d9 100644 --- a/input/input_binary.c +++ b/input/input_binary.c @@ -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, diff --git a/output/output_analog.c b/output/output_analog.c index e45100ca..5118b5ae 100644 --- a/output/output_analog.c +++ b/output/output_analog.c @@ -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, diff --git a/output/output_binary.c b/output/output_binary.c index 7cc25a52..f5429585 100644 --- a/output/output_binary.c +++ b/output/output_binary.c @@ -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, diff --git a/output/output_gnuplot.c b/output/output_gnuplot.c index 1b6d78c2..af24865f 100644 --- a/output/output_gnuplot.c +++ b/output/output_gnuplot.c @@ -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, diff --git a/output/output_ols.c b/output/output_ols.c index 8116472d..df94c8c9 100644 --- a/output/output_ols.c +++ b/output/output_ols.c @@ -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, diff --git a/output/output_skeleton.c b/output/output_skeleton.c index af82d5b4..44074ce1 100644 --- a/output/output_skeleton.c +++ b/output/output_skeleton.c @@ -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, diff --git a/output/output_vcd.c b/output/output_vcd.c index bd16bc2e..94efd2eb 100644 --- a/output/output_vcd.c +++ b/output/output_vcd.c @@ -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, diff --git a/output/text/ascii.c b/output/text/ascii.c index 4d1611fa..fd6c924e 100644 --- a/output/text/ascii.c +++ b/output/text/ascii.c @@ -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, diff --git a/output/text/bits.c b/output/text/bits.c index cc17a929..de526e18 100644 --- a/output/text/bits.c +++ b/output/text/bits.c @@ -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, diff --git a/output/text/hex.c b/output/text/hex.c index e4806355..e604d973 100644 --- a/output/text/hex.c +++ b/output/text/hex.c @@ -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, diff --git a/sigrok.h b/sigrok.h index 1ad12e96..22428d01 100644 --- a/sigrok.h +++ b/sigrok.h @@ -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);