WCMD_batch: increase possible line length and warn if still too small.
[wine] / programs / wcmd / wcmd.h
1 /*
2  * WCMD - Wine-compatible command line interface.
3  *
4  * Copyright (C) 1999 D A Pickles
5  *
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.
10  *
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.
15  *
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
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>
29
30 #ifdef WINELIB
31 #include <winbase.h>
32 #include <wincon.h>
33 #endif /* !WINELIB */
34
35 void WCMD_batch (char *, char *, int);
36 void WCMD_change_tty (void);
37 void WCMD_clear_screen (void);
38 void WCMD_copy (void);
39 void WCMD_create_dir (void);
40 void WCMD_delete (int recurse);
41 void WCMD_directory (void);
42 void WCMD_echo (char *);
43 void WCMD_for (char *);
44 void WCMD_give_help (char *command);
45 void WCMD_goto (void);
46 void WCMD_if (char *);
47 void WCMD_move (void);
48 void WCMD_output (char *format, ...);
49 void WCMD_output_asis (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_print_error (void);
54 void WCMD_process_command (char *command);
55 int WCMD_read_console (char *string, int str_len);
56 void WCMD_remove_dir (void);
57 void WCMD_rename (void);
58 void WCMD_run_program (char *command);
59 void WCMD_setshow_attrib (void);
60 void WCMD_setshow_date (void);
61 void WCMD_setshow_default (void);
62 void WCMD_setshow_env (char *command);
63 void WCMD_setshow_path (void);
64 void WCMD_setshow_prompt (void);
65 void WCMD_setshow_time (void);
66 void WCMD_shift (void);
67 void WCMD_show_prompt (void);
68 void WCMD_title (char *);
69 void WCMD_type (void);
70 void WCMD_verify (char *command);
71 void WCMD_version (void);
72 int  WCMD_volume (int mode, char *command);
73
74 char *WCMD_fgets (char *s, int n, HANDLE stream);
75 char *WCMD_parameter (char *s, int n, char **where);
76 char *WCMD_strtrim_leading_spaces (char *string);
77 void WCMD_strtrim_trailing_spaces (char *string);
78
79 /*      Data structure to hold context when executing batch files */
80
81 typedef struct {
82   char *command;        /* The command which invoked the batch file */
83   HANDLE h;             /* Handle to the open batch file */
84   int shift_count;      /* Number of SHIFT commands executed */
85   void *prev_context;   /* Pointer to the previous context block */
86 } BATCH_CONTEXT;
87
88 #endif /* !RC_INVOKED */
89
90 /*
91  *      Serial nos of builtin commands. These constants must be in step with
92  *      the list of strings defined in WCMD.C, and WCMD_EXIT *must* always be
93  *      the last one.
94  *
95  *      Yes it *would* be nice to use an enumeration here, but the Resource
96  *      Compiler won't accept resource IDs from enumerations :-(
97  */
98
99 #define WCMD_ATTRIB  0
100 #define WCMD_CALL    1
101 #define WCMD_CD      2
102 #define WCMD_CHDIR   3
103 #define WCMD_CLS     4
104 #define WCMD_COPY    5
105 #define WCMD_CTTY    6
106 #define WCMD_DATE    7
107 #define WCMD_DEL     8
108 #define WCMD_DIR     9
109 #define WCMD_ECHO   10
110 #define WCMD_ERASE  11
111 #define WCMD_FOR    12
112 #define WCMD_GOTO   13
113 #define WCMD_HELP   14
114 #define WCMD_IF     15
115 #define WCMD_LABEL  16
116 #define WCMD_MD     17
117 #define WCMD_MKDIR  18
118 #define WCMD_MOVE   19
119 #define WCMD_PATH   20
120 #define WCMD_PAUSE  21
121 #define WCMD_PROMPT 22
122 #define WCMD_REM    23
123 #define WCMD_REN    24
124 #define WCMD_RENAME 25
125 #define WCMD_RD     26
126 #define WCMD_RMDIR  27
127 #define WCMD_SET    28
128 #define WCMD_SHIFT  29
129 #define WCMD_TIME   30
130 #define WCMD_TITLE  31
131 #define WCMD_TYPE   32
132 #define WCMD_VERIFY 33
133 #define WCMD_VER    34
134 #define WCMD_VOL    35
135
136 /* Must be last in list */
137 #define WCMD_EXIT   36
138
139
140