]> git.sur5r.net Git - ngadmin/blob - cli/common.h
Code reorganized.
[ngadmin] / cli / common.h
1
2 #ifndef DEF_COMMON
3 #define DEF_COMMON
4
5
6 #include <stdio.h>
7 #include <stdlib.h>
8
9 #include <ngadmin.h>
10
11
12 #define UNUSED                          __attribute__((unused))
13 #define COM(nam, func, args, ...)       {.name=nam, .comfunc=func, .hasArgs=args, .sub={__VA_ARGS__}}
14
15
16
17 struct TreeNode {
18  const char *name;
19  bool (* const comfunc)(const struct TreeNode*, int, const char**, struct ngadmin*);
20  bool hasArgs;
21  const struct TreeNode *sub[];
22 };
23
24
25
26 extern int cont;
27
28
29
30 extern const struct TreeNode com_quit;
31 extern const struct TreeNode com_login;
32 extern const struct TreeNode com_scan;
33 extern const struct TreeNode com_ports;
34 extern const struct TreeNode com_password;
35 extern const struct TreeNode com_list;
36 extern const struct TreeNode com_list;
37 extern const struct TreeNode com_firmware;
38 extern const struct TreeNode com_name;
39
40
41
42 void displaySwitchTab (const struct swi_attr *sa, int nb);
43 void printErrCode (int err);
44
45
46
47 #endif
48