1
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
23
24
25
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/* ... */
#ifndef JIM_SUBCMD_H
#define JIM_SUBCMD_H
#include <jim.h>
#ifdef __cplusplus
extern "C" {
#endif
#define JIM_MODFLAG_HIDDEN 0x0001
#define JIM_MODFLAG_FULLARGV 0x0002
/* ... */
typedef int jim_subcmd_function(Jim_Interp *interp, int argc, Jim_Obj *const *argv);
typedef struct {
const char *cmd;
const char *args;
jim_subcmd_function *function;
short minargs;
short maxargs;
unsigned short flags;
...} jim_subcmd_type;
/* ... */
const jim_subcmd_type *
Jim_ParseSubCmd(Jim_Interp *interp, const jim_subcmd_type *command_table, int argc, Jim_Obj *const *argv);
/* ... */
int Jim_SubCmdProc(Jim_Interp *interp, int argc, Jim_Obj *const *argv);
/* ... */
int Jim_CallSubCmd(Jim_Interp *interp, const jim_subcmd_type *ct, int argc, Jim_Obj *const *argv);
#ifdef __cplusplus
}extern "C" { ... }
#endif
/* ... */
#endif