]> sigrok.org Git - libsigrok.git/blobdiff - src/backend.c
Refactor scan options check.
[libsigrok.git] / src / backend.c
index e0e18175645ca5207be10348f4d786a0e92b0562..6500bf54d484446582a6be9b6366d85d9be909f4 100644 (file)
@@ -215,7 +215,7 @@ static int sanity_check_all_drivers(void)
 static int sanity_check_all_input_modules(void)
 {
        int i, errors, ret = SR_OK;
-       struct sr_input_format **inputs;
+       const struct sr_input_module **inputs;
        const char *d;
 
        sr_spew("Sanity-checking all input modules.");
@@ -230,20 +230,24 @@ static int sanity_check_all_input_modules(void)
                        sr_err("No ID in module %d ('%s').", i, d);
                        errors++;
                }
-               if (!inputs[i]->description) {
-                       sr_err("No description in module %d ('%s').", i, d);
+               if (!inputs[i]->name) {
+                       sr_err("No name in module %d ('%s').", i, d);
                        errors++;
                }
-               if (!inputs[i]->format_match) {
-                       sr_err("No format_match in module %d ('%s').", i, d);
+               if (!inputs[i]->desc) {
+                       sr_err("No description in module %d ('%s').", i, d);
                        errors++;
                }
                if (!inputs[i]->init) {
                        sr_err("No init in module %d ('%s').", i, d);
                        errors++;
                }
-               if (!inputs[i]->loadfile) {
-                       sr_err("No loadfile in module %d ('%s').", i, d);
+               if (!inputs[i]->receive) {
+                       sr_err("No receive in module %d ('%s').", i, d);
+                       errors++;
+               }
+               if (!inputs[i]->end) {
+                       sr_err("No end in module %d ('%s').", i, d);
                        errors++;
                }
 
@@ -265,7 +269,7 @@ static int sanity_check_all_input_modules(void)
 static int sanity_check_all_output_modules(void)
 {
        int i, errors, ret = SR_OK;
-       struct sr_output_format **outputs;
+       const struct sr_output_module **outputs;
        const char *d;
 
        sr_spew("Sanity-checking all output modules.");
@@ -280,7 +284,11 @@ static int sanity_check_all_output_modules(void)
                        sr_err("No ID in module %d ('%s').", i, d);
                        errors++;
                }
-               if (!outputs[i]->description) {
+               if (!outputs[i]->name) {
+                       sr_err("No name in module %d ('%s').", i, d);
+                       errors++;
+               }
+               if (!outputs[i]->desc) {
                        sr_err("No description in module '%s'.", d);
                        errors++;
                }