Annotation of embedaddon/mpd/src/command.h, revision 1.1
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:
! 19: #define CMD_SUBMENU ((int (*)(Context ctx, int ac, char *av[], void *arg)) 1)
! 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
! 34: GLOBAL_CONF_ONESHOT /* enable OneShot mode */
! 35: };
! 36:
! 37: struct globalconf {
! 38: struct optinfo options;
! 39: };
! 40:
! 41: struct cmdtab;
! 42: typedef const struct cmdtab *CmdTab;
! 43: struct cmdtab
! 44: {
! 45: const char *name;
! 46: const char *desc;
! 47: int (*func)(Context ctx, int ac, char *av[], void *arg);
! 48: int (*admit)(Context ctx, CmdTab cmd);
! 49: int priv;
! 50: void *arg;
! 51: };
! 52:
! 53: extern const struct cmdtab gCommands[];
! 54:
! 55: /*
! 56: * FUNCTIONS
! 57: */
! 58:
! 59: extern int DoConsole(void);
! 60: extern int DoCommand(Context ctx, int ac, char *av[], const char *file, int line);
! 61: extern int DoCommandTab(Context ctx, CmdTab cmdlist, int ac, char *av[]);
! 62: extern int HelpCommand(Context ctx, int ac, char *av[], void *arg);
! 63: extern int FindCommand(Context ctx, CmdTab cmds, char* str, CmdTab *cp);
! 64: extern int AdmitBund(Context ctx, CmdTab cmd);
! 65: extern int AdmitLink(Context ctx, CmdTab cmd);
! 66: extern int AdmitRep(Context ctx, CmdTab cmd);
! 67: extern int AdmitPhys(Context ctx, CmdTab cmd);
! 68: extern int AdmitDev(Context ctx, CmdTab cmd);
! 69:
! 70: #endif
! 71:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>