ReactOS  0.4.14-dev-50-g13bb5e2
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 
8 typedef 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 
28 typedef struct Command *CommandPtr;
29 typedef 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  */
41 typedef struct Command {
42  const char *name;
44  const char *usage, *help;
45  int flags;
47 } Command;
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 */
69 void InitCommandList(void);
70 CommandPtr GetCommandByIndex(const int);
71 CommandPtr GetCommandByName(const char *const, int);
74 int MakeArgv(char *, int *, const char **, int, char *, size_t, int *, int);
75 void XferCanceller(int);
76 void BackToTop(int);
77 void Cancel(int);
78 void CommandShell(void);
static int argc
Definition: ServiceArgs.c:12
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
char argbuf[256]
Definition: shell.h:12
const char * cargv[64]
Definition: shell.h:9
CommandPtr GetCommandByName(const char *const, int)
Definition: shell.c:156
const char * usage
Definition: shell.h:44
CommandPtr GetCommandByIndex(const int)
Definition: shell.c:140
Definition: shell.h:41
const char * name
Definition: shell.h:42
#define argv
Definition: mplay32.c:18
void PrintCmdUsage(CommandPtr)
Definition: shell.c:210
void InitCommandList(void)
Definition: shell.c:90
int MakeArgv(char *, int *, const char **, int, char *, size_t, int *, int)
Definition: shell.c:221
int minargs
Definition: shell.h:46
void XferCanceller(int)
Definition: shell.c:419
int noglobargv[64]
Definition: shell.h:10
void CommandShell(void)
Definition: shell.c:499
struct Command Command
int cargc
Definition: shell.h:11
void Cancel(int)
Definition: shell.c:481
struct ArgvInfo * ArgvInfoPtr
int maxargs
Definition: shell.h:46
CmdProc proc
Definition: shell.h:43
Definition: shell.h:8
int flags
Definition: shell.h:45
void PrintCmdHelp(CommandPtr)
Definition: shell.c:200
const char * help
Definition: shell.h:44
void(* CmdProc)(const int argc, const char **const argv, const CommandPtr cmdp, const ArgvInfoPtr aip)
Definition: shell.h:29
struct ArgvInfo ArgvInfo
struct Command * CommandPtr
Definition: shell.h:28
void BackToTop(int)
Definition: shell.c:452