]> git.sur5r.net Git - ngadmin/blobdiff - cli/com_scan.c
Command functions return int instead of bool
[ngadmin] / cli / com_scan.c
index 98744ffc36eb7782b21a6366a9414655104c7dd6..f374d18e69f53b07ed01916c28a7a2b5ef87bc9f 100644 (file)
@@ -2,24 +2,28 @@
 #include "commands.h"
 
 
-
-bool do_scan (int nb UNUSED, const char **com UNUSED, struct ngadmin *nga) {
- int i;
- const struct swi_attr *sa;
- if ( (i=ngadmin_scan(nga))<0 ) {
-  printErrCode(i);
-  return false;
- }
- sa=ngadmin_getSwitchTab(nga, &nb);
- displaySwitchTab(sa, nb);
- return true;
+int do_scan (int argc, const char **argv UNUSED, struct ngadmin *nga)
+{
+       int i;
+       const struct swi_attr *sa;
+       
+       
+       if (argc > 0) {
+               printf("this command takes no argument\n");
+               return 1;
+       }
+       
+       i = ngadmin_scan(nga);
+       if (i < 0) {
+               printErrCode(i);
+               return 1;
+       }
+       
+       sa = ngadmin_getSwitchTab(nga, &i);
+       displaySwitchTab(sa, i);
+       
+       
+       return 0;
 }