Annotation of embedaddon/mpd/src/command.h, revision 1.1.1.3
1.1 misho 1:
2: /*
3: * command.h
4: *
5: * Written by Archie Cobbs <archie@freebsd.org>
6: * Copyright (c) 1995-1999 Whistle Communications, Inc. All rights reserved.
7: * See ``COPYRIGHT.whistle''
8: */
9:
10: #ifndef _COMMAND_H_
11: #define _COMMAND_H_
12:
13: #include "vars.h"
14:
15: /*
16: * DEFINITIONS
17: */
18:
1.1.1.3 ! misho 19: #define CMD_SUBMENU ((int (*)(Context ctx, int ac, const char *const av[], const void *arg)) 1)
1.1 misho 20:
21: #define CMD_ERR_USAGE -1
22: #define CMD_ERR_UNDEF -2
23: #define CMD_ERR_AMBIG -3
24: #define CMD_ERR_RECUR -4
25: #define CMD_ERR_UNFIN -5
26: #define CMD_ERR_NOCTX -6
27: #define CMD_ERR_OTHER -7
28:
29: /* Configuration options */
30: enum {
31: #ifdef USE_WRAP
32: GLOBAL_CONF_TCPWRAPPER, /* enable tcp-wrapper */
33: #endif
1.1.1.2 misho 34: GLOBAL_CONF_ONESHOT, /* enable OneShot mode */
35: GLOBAL_CONF_AGENT_CID, /* enable display Agent CID in show session */
36: GLOBAL_CONF_SESS_TIME /* enable display uptime in show session */
1.1 misho 37: };
38:
39: struct globalconf {
40: struct optinfo options;
41: };
42:
43: struct cmdtab;
44: typedef const struct cmdtab *CmdTab;
45: struct cmdtab
46: {
47: const char *name;
48: const char *desc;
1.1.1.3 ! misho 49: int (*func)(Context ctx, int ac, const char *const av[], const void *arg);
1.1 misho 50: int (*admit)(Context ctx, CmdTab cmd);
51: int priv;
1.1.1.3 ! misho 52: const void *arg;
1.1 misho 53: };
54:
55: extern const struct cmdtab gCommands[];
56:
57: /*
58: * FUNCTIONS
59: */
60:
61: extern int DoConsole(void);
1.1.1.3 ! misho 62: extern int DoCommand(Context ctx, int ac, const char *const av[], const char *file, int line);
! 63: extern int DoCommandTab(Context ctx, CmdTab cmdlist, int ac, const char *const av[]);
! 64: extern int HelpCommand(Context ctx, int ac, const char *const av[], const void *arg);
! 65: extern int FindCommand(Context ctx, CmdTab cmds, const char* str, CmdTab *cp);
1.1 misho 66: extern int AdmitBund(Context ctx, CmdTab cmd);
67: extern int AdmitLink(Context ctx, CmdTab cmd);
68: extern int AdmitRep(Context ctx, CmdTab cmd);
69: extern int AdmitPhys(Context ctx, CmdTab cmd);
70: extern int AdmitDev(Context ctx, CmdTab cmd);
71:
72: #endif
73:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>