ReactOS 0.4.15-dev-7953-g1f49173
shell.h
Go to the documentation of this file.
1/* shell.h
2 *
3 * Copyright (c) 1992-2001 by Mike Gleason.
4 * All rights reserved.
5 *
6 */
7
8typedef struct ArgvInfo {
9 const char *cargv[64];
10 int noglobargv[64];
11 int cargc;
12 char argbuf[256];
14
15/* How often to no-op the remote site if the user is idle, in seconds. */
16#define kIdleInterval 20
17
18/* If the user has been idle this many seconds, start their background
19 * jobs.
20 */
21#define kIdleBatchLaunch 180
22
23/* If a command (like a transfer) took longer than this many seconds, beep
24 * at the user to notify them that it completed.
25 */
26#define kBeepAfterCmdTime 15
27
28typedef struct Command *CommandPtr;
29typedef void (*CmdProc)(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip);
30
31/* These are used in the command table, to specify that a command
32 * doesn't require an exact number of parameters.
33 */
34#define kNoMax (-1)
35#define kNoMin (-1)
36
37/* Structure of the command table. We keep some extra stuff in the
38 * table, so each command doesn't have to check the number of
39 * arguments and print it's own usage messages if it doesn't want to.
40 */
41typedef struct Command {
42 const char *name;
44 const char *usage, *help;
45 int flags;
48
49/* Parameter to GetCommandOrMacro(). */
50#define kAbbreviatedMatchAllowed 0
51#define kExactMatchRequired 1
52
53/* These can be returned by the GetCommand() routine. */
54#define kAmbiguousCommand ((CommandPtr) -1)
55#define kNoCommand ((CommandPtr) 0)
56
57/* Command flag bits. */
58#define kCmdHidden 00001
59#define kCmdMustBeConnected 00002
60#define kCmdMustBeDisconnected 00004
61#define kCompleteRemoteFile 00010
62#define kCompleteRemoteDir 00020
63#define kCompleteLocalFile 00040
64#define kCompleteLocalDir 00100
65#define kCompleteBookmark 00200
66#define kCompletePrefOpt 00400
67
68/* shell.c */
69void InitCommandList(void);
71CommandPtr GetCommandByName(const char *const, int);
74int MakeArgv(char *, int *, const char **, int, char *, size_t, int *, int);
75void XferCanceller(int);
76void BackToTop(int);
77void Cancel(int);
78void CommandShell(void);
static int argc
Definition: ServiceArgs.c:12
#define argv
Definition: mplay32.c:18
void XferCanceller(int)
Definition: shell.c:419
struct ArgvInfo * ArgvInfoPtr
void(* CmdProc)(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: shell.h:29
void PrintCmdHelp(CommandPtr)
Definition: shell.c:200
void Cancel(int)
Definition: shell.c:481
CommandPtr GetCommandByName(const char *const, int)
Definition: shell.c:156
void PrintCmdUsage(CommandPtr)
Definition: shell.c:210
CommandPtr GetCommandByIndex(const int)
Definition: shell.c:140
struct Command * CommandPtr
Definition: shell.h:28
int MakeArgv(char *, int *, const char **, int, char *, size_t, int *, int)
Definition: shell.c:221
void InitCommandList(void)
Definition: shell.c:90
void CommandShell(void)
Definition: shell.c:499
void BackToTop(int)
Definition: shell.c:452
Definition: shell.h:8
int cargc
Definition: shell.h:11
int noglobargv[64]
Definition: shell.h:10
const char * cargv[64]
Definition: shell.h:9
char argbuf[256]
Definition: shell.h:12
Definition: shell.h:41
int maxargs
Definition: shell.h:46
const char * help
Definition: shell.h:44
int minargs
Definition: shell.h:46
const char * usage
Definition: shell.h:44
int flags
Definition: shell.h:45
CmdProc proc
Definition: shell.h:43
const char * name
Definition: shell.h:42