2 * CMD.H - header file for the modules in CMD.EXE
11 * Moved error messages in here
14 * Moved more error messages here
16 * 30-Jul-1998 (John P Price <linux-guru@gcfl.net>)
17 * Added compile date to version
20 // #define WIN32_LEAN_AND_MEAN
25 #define SHELLVER "version 0.0.4 [" __DATE__"]"
27 #define BREAK_BATCHFILE 1
28 #define BREAK_OUTOFBATCH 2
30 #define BREAK_IGNORE 4
32 /* define some error messages */
33 #define NOENVERR "ERROR: no environment"
34 #define INVALIDDRIVE "ERROR: invalid drive"
35 #define INVALIDFUNCTION "ERROR: invalid function"
36 #define ACCESSDENIED "ERROR: access denied"
37 #define BADENVIROMENT "ERROR: bad enviroment"
38 #define BADFORMAT "ERROR: bad format"
39 #define ERROR_E2BIG "ERROR: Argument list too long"
40 #define ERROR_EINVAL "ERROR: Invalid argument"
42 #define SHELLINFO "ReactOS Command Line Interface"
51 /* prototypes for CMD.C */
55 extern WORD wDefColor
;
56 extern BOOL bCtrlBreak
;
57 extern BOOL bIgnoreEcho
;
59 extern int errorlevel
;
62 extern OSVERSIONINFO osvi
;
65 // VOID Execute (char *, char *);
67 VOID
ParseCommandLine (LPTSTR
);
73 /* prototypes for ALIAS.C */
74 VOID
ExpandAlias (char *, int);
75 INT
cmd_alias (LPTSTR
, LPTSTR
);
78 /* prototyped for ATTRIB.C */
79 INT
cmd_attrib (LPTSTR
, LPTSTR
);
82 /* prototypes for CLS.C */
83 INT
cmd_cls (LPTSTR
, LPTSTR
);
86 /* prototypes for CMDINPUT.C */
87 VOID
ReadCommand (LPTSTR
, INT
);
90 /* prototypes for CMDTABLE.C */
92 #define CMD_BATCHONLY 2
94 typedef struct tagCOMMAND
98 INT (*func
) (LPTSTR
, LPTSTR
);
99 } COMMAND
, *LPCOMMAND
;
102 /* prototypes for COLOR.C */
103 VOID
SetScreenColor (WORD
);
104 INT
cmd_color (LPTSTR
, LPTSTR
);
107 /* prototypes for CONSOLE.C */
109 VOID
DebugPrintf (LPTSTR
, ...);
112 VOID
ConInDummy (VOID
);
113 VOID
ConInKey (PINPUT_RECORD
);
115 VOID
ConInString (LPTSTR
, DWORD
);
118 VOID
ConOutChar (TCHAR
);
119 VOID
ConOutPuts (LPTSTR
);
120 VOID
ConOutPrintf (LPTSTR
, ...);
121 VOID
ConErrChar (TCHAR
);
122 VOID
ConErrPuts (LPTSTR
);
123 VOID
ConErrPrintf (LPTSTR
, ...);
128 VOID
goxy (SHORT
, SHORT
);
130 VOID
GetScreenSize (PSHORT
, PSHORT
);
131 VOID
SetCursorType (BOOL
, BOOL
);
134 /* prototypes for COPY.C */
135 INT
cmd_copy (LPTSTR
, LPTSTR
);
138 /* prototypes for DATE.C */
139 INT
cmd_date (LPTSTR
, LPTSTR
);
142 /* prototypes for DEL.C */
143 INT
cmd_del (LPTSTR
, LPTSTR
);
146 /* prototypes for DIR.C */
147 //int incline(int *line, unsigned flags);
148 INT
cmd_dir (LPTSTR
, LPTSTR
);
151 /* prototypes for DIRSTACK.C */
152 VOID
InitDirectoryStack (VOID
);
153 VOID
DestroyDirectoryStack (VOID
);
154 INT
GetDirectoryStackDepth (VOID
);
155 INT
cmd_pushd (LPTSTR
, LPTSTR
);
156 INT
cmd_popd (LPTSTR
, LPTSTR
);
159 /* Prototypes for ERROR.C */
160 VOID
ErrorMessage (DWORD
, LPTSTR
, ...);
162 VOID
error_no_pipe (VOID
);
163 VOID
error_bad_command (VOID
);
164 VOID
error_invalid_drive (VOID
);
165 VOID
error_req_param_missing (VOID
);
166 VOID
error_sfile_not_found (LPTSTR
);
167 VOID
error_file_not_found (VOID
);
168 VOID
error_path_not_found (VOID
);
169 VOID
error_too_many_parameters (LPTSTR
);
170 VOID
error_invalid_switch (TCHAR
);
171 VOID
error_invalid_parameter_format (LPTSTR
);
172 VOID
error_out_of_memory (VOID
);
173 VOID
error_syntax (LPTSTR
);
175 VOID
msg_pause (VOID
);
178 /* prototypes for FILECOMP.C */
179 #ifdef FEATURE_UNIX_FILENAME_COMPLETION
180 VOID
CompleteFilename (LPTSTR
, INT
);
181 INT
ShowCompletionMatches (LPTSTR
, INT
);
183 #ifdef FEATURE_4NT_FILENAME_COMPLETION
187 /* prototypes for HISTORY.C */
188 #ifdef FEATURE_HISTORY
189 VOID
History (INT
, LPTSTR
);
193 /* prototypes for INTERNAL.C */
194 VOID
InitLastPath (VOID
);
195 VOID
FreeLastPath (VOID
);
196 int cmd_chdir(char *, char *);
197 int cmd_mkdir(char *, char *);
198 int cmd_rmdir(char *, char *);
199 int internal_exit(char *, char *);
200 int cmd_rem(char *, char *);
201 int cmd_showcommands(char *, char *);
204 /* prototyped for LABEL.C */
205 INT
cmd_label (LPTSTR
, LPTSTR
);
208 /* prototypes for LOCALE.C */
209 extern TCHAR cDateSeparator
;
210 extern INT nDateFormat
;
211 extern TCHAR cTimeSeparator
;
212 extern INT nTimeFormat
;
213 extern TCHAR aszDayNames
[7][8];
214 extern TCHAR cThousandSeparator
;
215 extern TCHAR cDecimalSeparator
;
216 extern INT nNumberGroups
;
218 VOID
InitLocale (VOID
);
221 /* Prototypes for MISC.C */
222 TCHAR
cgetchar (VOID
);
223 BOOL
CheckCtrlBreak (INT
);
224 LPTSTR
*split (LPTSTR
, LPINT
);
225 VOID
freep (LPTSTR
*);
226 LPTSTR
stpcpy (LPTSTR
, LPTSTR
);
227 BOOL
IsValidPathName (LPCTSTR
);
228 BOOL
IsValidFileName (LPCTSTR
);
229 BOOL
FileGetString (HANDLE
, LPTSTR
, INT
);
232 /* prototypes for MOVE.C */
233 INT
cmd_move (LPTSTR
, LPTSTR
);
236 /* prototypes from PATH.C */
237 INT
cmd_path (LPTSTR
, LPTSTR
);
240 /* prototypes from PROMPT.C */
241 VOID
PrintPrompt (VOID
);
242 INT
cmd_prompt (LPTSTR
, LPTSTR
);
245 /* prototypes for REDIR.C */
246 #define INPUT_REDIRECTION 1
247 #define OUTPUT_REDIRECTION 2
248 #define OUTPUT_APPEND 4
249 #define ERROR_REDIRECTION 8
250 #define ERROR_APPEND 16
251 INT
GetRedirection (LPTSTR
, LPTSTR
, LPTSTR
, LPTSTR
, LPINT
);
254 /* prototypes for REN.C */
255 INT
cmd_rename (LPTSTR
, LPTSTR
);
258 /* prototypes for SET.C */
259 INT
cmd_set (LPTSTR
, LPTSTR
);
262 /* prototypes for TIME.C */
263 INT
cmd_time (LPTSTR
, LPTSTR
);
266 /* prototypes for TYPE.C */
267 INT
cmd_type (LPTSTR
, LPTSTR
);
270 /* prototypes for VER.C */
271 VOID
ShortVersion (VOID
);
272 INT
cmd_ver (LPTSTR
, LPTSTR
);
275 /* prototypes for VERIFY.C */
276 INT
cmd_verify (LPTSTR
, LPTSTR
);
279 /* prototypes for VOL.C */
280 INT
cmd_vol (LPTSTR
, LPTSTR
);
283 /* prototypes for WHERE.C */
284 BOOL
find_which (LPCTSTR
, LPTSTR
);
289 /* The MSDOS Batch Commands [MS-DOS 5.0 User's Guide and Reference p359] */
290 int cmd_call(char *, char *);
291 int cmd_echo(char *, char *);
292 int cmd_for(char *, char *);
293 int cmd_goto(char *, char *);
294 int cmd_if(char *, char *);
295 int cmd_pause(char *, char *);
296 int cmd_shift(char *, char *);
298 int cmd_beep(char *, char *);