]> git.sur5r.net Git - ngadmin/blobdiff - cli/commands.h
Fix crash when writing the wrong type of VLAN
[ngadmin] / cli / commands.h
index f289e716d30bd45caf4b65e285248e36276f263b..2aeada5d345a1e4b0594d919e5c120ae53f132a3 100644 (file)
@@ -6,25 +6,21 @@
 #include "common.h"
 
 
-
-
 struct TreeNode {
- const char *name;
- bool (* const comfunc)(int, const char**, struct ngadmin*);
- bool hasArgs;
- const struct TreeNode *sub;
+       const char *name;
+       int (*comfunc)(int, const char**, struct ngadmin*);
+       const struct TreeNode *sub;
 };
 
 
-#define COM_ROOT_START(v)              const struct TreeNode v={.name="<root>", .comfunc=NULL, .hasArgs=false, .sub=(const struct TreeNode[]){
-#define COM_ROOT_END                   {.name=NULL, .comfunc=NULL, .hasArgs=false, .sub=NULL}}};
-#define COM_START(nam)                 {.name=#nam, .comfunc=NULL, .hasArgs=false, .sub=(const struct TreeNode[]){
-#define COM_TERM(nam, func, args)      {.name=#nam, .comfunc=func, .hasArgs=args, .sub=NULL}, 
-#define COM_END                                {.name=NULL, .comfunc=NULL, .hasArgs=false, .sub=NULL}}},
-
+#define COM_ROOT_START(v)      const struct TreeNode v = {.name = "<root>", .comfunc = NULL, .sub = (const struct TreeNode[]){
+#define COM_ROOT_END           {.name = NULL, .comfunc = NULL, .sub = NULL}}};
+#define COM_START(nam)         {.name = #nam, .comfunc = NULL, .sub = (const struct TreeNode[]){
+#define COM_END                        {.name = NULL, .comfunc = NULL, .sub = NULL}}},
+#define COM_TERM(nam, func)    {.name = #nam, .comfunc = func, .sub = NULL},
 
-extern const struct TreeNode coms;
 
+extern const struct TreeNode commands;
 
 
 #endif