]> sigrok.org Git - libsigrok.git/commitdiff
input/output formats: Explicit struct member names.
authorUwe Hermann <redacted>
Wed, 6 Apr 2011 17:42:49 +0000 (19:42 +0200)
committerUwe Hermann <redacted>
Sun, 10 Apr 2011 21:03:33 +0000 (23:03 +0200)
This makes it immediately clear what an entry is supposed to be, no
need to look it up in some header file.

input/input_binary.c
output/output_analog.c
output/output_binary.c
output/output_gnuplot.c
output/output_ols.c
output/output_skeleton.c
output/output_vcd.c
output/text/ascii.c
output/text/bits.c
output/text/hex.c

index be67f2d2d33767e8f9b59f5ee7356d38197193b0..e89dc84c1ed6f4d839a2a062154a18bbe4c169d1 100644 (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,
 };
index 0f60dd35795912fc2a775eae30d0546ef27d84b7..e45100ca491aad4d66c99f60621ac0bbe529ab91 100644 (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
index 076d497ce2b5c9a2f6d04796ebd3fd3a104c0539..fb7c3f588c103a3a3f232f091b281ee850e85210 100644 (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,
 };
index a52c3dc1a7dcfb597ffa952ebad82cc36d19e98f..1b6d78c278cb340cf0b1b5fba8107fa1783dc4bd 100644 (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
index dd9ffdf672f7e5d1b3ccaafb1aea4638df5ab2c9..8116472d45d4a5d12aade5fc22b61a3e061d7544 100644 (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,
 };
index e4b3baf61c46532bfdbf4887b50fb81951ccd3b1..af82d5b4a80266a5bbcdc73e55d41d7cf96fb2c0 100644 (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,
 };
index 1c5d723d1abd9664ab40368d953c719851cfe809..bd16bc2e1d26e7829893a90f76aeecea1761d60d 100644 (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,
 };
index 75ab60b98c88f14598c1037a47f4a3b6a42d6f36..4d1611fa2a6fbc5567a0f872eaae3c4644556f89 100644 (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,
 };
index cb8ec5984f79996340721233ddc8b7db500a3e7d..cc17a9290c1a6f0f4c6998949a4e9ac763eced5b 100644 (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,
 };
index 285102ee461f7005289e7ee0bc3b7d39fc69227e..e4806355b371b6519f93cf7e296388dece019669 100644 (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,
 };