cmd.exe: Support del /p.
[wine/wine-gecko.git] / programs / cmd / wcmd.h
blobd6357f0a203ec963cc8aeaad8bdedc2ac0b831e8
1 /*
2 * CMD - Wine-compatible command line interface.
4 * Copyright (C) 1999 D A Pickles
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #define IDI_ICON1 1
22 #include <windows.h>
23 #ifndef RC_INVOKED
24 #include <string.h>
25 #include <stdlib.h>
26 #include <stdarg.h>
27 #include <stdio.h>
28 #include <ctype.h>
30 void WCMD_batch (char *, char *, int, char *, HANDLE);
31 void WCMD_call (char *command);
32 void WCMD_change_tty (void);
33 void WCMD_clear_screen (void);
34 void WCMD_copy (void);
35 void WCMD_create_dir (void);
36 void WCMD_delete (int recurse);
37 void WCMD_directory (void);
38 void WCMD_echo (const char *);
39 void WCMD_endlocal (void);
40 void WCMD_enter_paged_mode(void);
41 void WCMD_exit (void);
42 void WCMD_for (char *);
43 void WCMD_give_help (char *command);
44 void WCMD_goto (void);
45 void WCMD_if (char *);
46 void WCMD_leave_paged_mode(void);
47 void WCMD_move (void);
48 void WCMD_output (const char *format, ...);
49 void WCMD_output_asis (const char *message);
50 void WCMD_parse (char *s, char *q, char *p1, char *p2);
51 void WCMD_pause (void);
52 void WCMD_pipe (char *command);
53 void WCMD_popd (void);
54 void WCMD_print_error (void);
55 void WCMD_process_command (char *command);
56 void WCMD_pushd (void);
57 int WCMD_read_console (char *string, int str_len);
58 void WCMD_remove_dir (void);
59 void WCMD_rename (void);
60 void WCMD_run_program (char *command, int called);
61 void WCMD_setlocal (const char *command);
62 void WCMD_setshow_attrib (void);
63 void WCMD_setshow_date (void);
64 void WCMD_setshow_default (void);
65 void WCMD_setshow_env (char *command);
66 void WCMD_setshow_path (char *command);
67 void WCMD_setshow_prompt (void);
68 void WCMD_setshow_time (void);
69 void WCMD_shift (void);
70 void WCMD_show_prompt (void);
71 void WCMD_title (char *);
72 void WCMD_type (void);
73 void WCMD_verify (char *command);
74 void WCMD_version (void);
75 int WCMD_volume (int mode, char *command);
77 char *WCMD_fgets (char *s, int n, HANDLE stream);
78 char *WCMD_parameter (char *s, int n, char **where);
79 char *WCMD_strtrim_leading_spaces (char *string);
80 void WCMD_strtrim_trailing_spaces (char *string);
81 void WCMD_opt_s_strip_quotes(char *cmd);
82 void WCMD_HandleTildaModifiers(char **start, char *forVariable);
83 BOOL WCMD_ask_confirm (char *message, BOOL showSureText);
85 void WCMD_splitpath(const CHAR* path, CHAR* drv, CHAR* dir, CHAR* name, CHAR* ext);
87 /* Data structure to hold context when executing batch files */
89 typedef struct {
90 char *command; /* The command which invoked the batch file */
91 HANDLE h; /* Handle to the open batch file */
92 int shift_count; /* Number of SHIFT commands executed */
93 void *prev_context; /* Pointer to the previous context block */
94 BOOL skip_rest; /* Skip the rest of the batch program and exit */
95 } BATCH_CONTEXT;
97 #endif /* !RC_INVOKED */
100 * Serial nos of builtin commands. These constants must be in step with
101 * the list of strings defined in WCMD.C, and WCMD_EXIT *must* always be
102 * the last one.
104 * Yes it *would* be nice to use an enumeration here, but the Resource
105 * Compiler won't accept resource IDs from enumerations :-(
108 #define WCMD_ATTRIB 0
109 #define WCMD_CALL 1
110 #define WCMD_CD 2
111 #define WCMD_CHDIR 3
112 #define WCMD_CLS 4
113 #define WCMD_COPY 5
114 #define WCMD_CTTY 6
115 #define WCMD_DATE 7
116 #define WCMD_DEL 8
117 #define WCMD_DIR 9
118 #define WCMD_ECHO 10
119 #define WCMD_ERASE 11
120 #define WCMD_FOR 12
121 #define WCMD_GOTO 13
122 #define WCMD_HELP 14
123 #define WCMD_IF 15
124 #define WCMD_LABEL 16
125 #define WCMD_MD 17
126 #define WCMD_MKDIR 18
127 #define WCMD_MOVE 19
128 #define WCMD_PATH 20
129 #define WCMD_PAUSE 21
130 #define WCMD_PROMPT 22
131 #define WCMD_REM 23
132 #define WCMD_REN 24
133 #define WCMD_RENAME 25
134 #define WCMD_RD 26
135 #define WCMD_RMDIR 27
136 #define WCMD_SET 28
137 #define WCMD_SHIFT 29
138 #define WCMD_TIME 30
139 #define WCMD_TITLE 31
140 #define WCMD_TYPE 32
141 #define WCMD_VERIFY 33
142 #define WCMD_VER 34
143 #define WCMD_VOL 35
145 #define WCMD_ENDLOCAL 36
146 #define WCMD_SETLOCAL 37
147 #define WCMD_PUSHD 38
148 #define WCMD_POPD 39
150 /* Must be last in list */
151 #define WCMD_EXIT 40
153 /* Some standard messages */
154 extern const char nyi[];
155 extern const char newline[];
156 extern const char version_string[];
157 extern const char anykey[];
159 /* Translated messages */
160 #define WCMD_CONFIRM 1001
161 #define WCMD_YES 1002
162 #define WCMD_NO 1003
164 /* msdn specified max for Win XP */
165 #define MAXSTRING 8192