names.c: fix compiler warnings
[s-mailx.git] / cmdtab.c
blob3957b7d7376a3b280febcbfc66222b83b1278321
1 /*
2 * Heirloom mailx - a mail user agent derived from Berkeley Mail.
4 * Copyright (c) 2000-2004 Gunnar Ritter, Freiburg i. Br., Germany.
5 */
6 /*
7 * Copyright (c) 1980, 1993
8 * The Regents of the University of California. All rights reserved.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the University of
21 * California, Berkeley and its contributors.
22 * 4. Neither the name of the University nor the names of its contributors
23 * may be used to endorse or promote products derived from this software
24 * without specific prior written permission.
26 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
39 #ifndef lint
40 #ifdef DOSCCS
41 static char sccsid[] = "@(#)cmdtab.c 2.51 (gritter) 3/4/06";
42 #endif
43 #endif /* not lint */
45 #include "rcv.h"
46 #include "extern.h"
49 * Mail -- a mail program
51 * Define all of the command names and bindings.
54 const struct cmd cmdtab[] = {
55 { "next", next, A|NDMLIST, 0, MMNDEL },
56 { "alias", group, M|RAWLIST, 0, 1000 },
57 { "print", type, A|MSGLIST, 0, MMNDEL },
58 { "type", type, A|MSGLIST, 0, MMNDEL },
59 { "Type", Type, A|MSGLIST, 0, MMNDEL },
60 { "Print", Type, A|MSGLIST, 0, MMNDEL },
61 { "visual", visual, A|I|MSGLIST, 0, MMNORM },
62 { "top", top, A|MSGLIST, 0, MMNDEL },
63 { "touch", stouch, A|W|MSGLIST, 0, MMNDEL },
64 { "preserve", preserve, A|W|MSGLIST, 0, MMNDEL },
65 { "delete", delete, A|W|P|MSGLIST, 0, MMNDEL },
66 { "dp", deltype, A|W|MSGLIST, 0, MMNDEL },
67 { "dt", deltype, A|W|MSGLIST, 0, MMNDEL },
68 { "undelete", undeletecmd, A|P|MSGLIST, MDELETED,MMNDEL },
69 { "unset", unset, M|RAWLIST, 1, 1000 },
70 { "mail", sendmail, R|M|I|STRLIST, 0, 0 },
71 { "Mail", Sendmail, R|M|I|STRLIST, 0, 0 },
72 { "mbox", mboxit, A|W|MSGLIST, 0, 0 },
73 { "more", more, A|MSGLIST, 0, MMNDEL },
74 { "page", more, A|MSGLIST, 0, MMNDEL },
75 { "More", More, A|MSGLIST, 0, MMNDEL },
76 { "Page", More, A|MSGLIST, 0, MMNDEL },
77 { "unread", unread, A|MSGLIST, 0, MMNDEL },
78 { "Unread", unread, A|MSGLIST, 0, MMNDEL },
79 { "new", unread, A|MSGLIST, 0, MMNDEL },
80 { "New", unread, A|MSGLIST, 0, MMNDEL },
81 { "!", shell, I|STRLIST, 0, 0 },
82 { "copy", copycmd, A|M|STRLIST, 0, 0 },
83 { "Copy", Copycmd, A|M|STRLIST, 0, 0 },
84 { "chdir", schdir, M|RAWLIST, 0, 1 },
85 { "cd", schdir, M|RAWLIST, 0, 1 },
86 { "save", save, A|STRLIST, 0, 0 },
87 { "Save", Save, A|STRLIST, 0, 0 },
88 { "source", source, M|RAWLIST, 1, 1 },
89 { "set", set, M|RAWLIST, 0, 1000 },
90 { "shell", dosh, I|NOLIST, 0, 0 },
91 { "version", pversion, M|NOLIST, 0, 0 },
92 { "group", group, M|RAWLIST, 0, 1000 },
93 { "ungroup", ungroup, M|RAWLIST, 0, 1000 },
94 { "unalias", ungroup, M|RAWLIST, 0, 1000 },
95 { "write", cwrite, A|STRLIST, 0, 0 },
96 { "from", from, A|MSGLIST, 0, MMNORM },
97 { "file", cfile, T|M|RAWLIST, 0, 1 },
98 { "followup", followup, A|R|I|MSGLIST, 0, MMNDEL },
99 { "followupall", followupall, A|R|I|MSGLIST, 0, MMNDEL },
100 { "followupsender", followupsender, A|R|I|MSGLIST, 0, MMNDEL },
101 { "folder", cfile, T|M|RAWLIST, 0, 1 },
102 { "folders", folders, T|M|RAWLIST, 0, 1 },
103 { "?", help, M|NOLIST, 0, 0 },
104 { "z", scroll, A|M|STRLIST, 0, 0 },
105 { "Z", Scroll, A|M|STRLIST, 0, 0 },
106 { "headers", headers, A|MSGLIST, 0, MMNDEL },
107 { "help", help, M|NOLIST, 0, 0 },
108 { "=", pdot, A|NOLIST, 0, 0 },
109 { "Reply", Respond, A|R|I|MSGLIST, 0, MMNDEL },
110 { "Respond", Respond, A|R|I|MSGLIST, 0, MMNDEL },
111 { "Followup", Followup, A|R|I|MSGLIST, 0, MMNDEL },
112 { "reply", respond, A|R|I|MSGLIST, 0, MMNDEL },
113 { "replyall", respondall, A|R|I|MSGLIST, 0, MMNDEL },
114 { "replysender", respondsender, A|R|I|MSGLIST, 0, MMNDEL },
115 { "respond", respond, A|R|I|MSGLIST, 0, MMNDEL },
116 { "respondall", respondall, A|R|I|MSGLIST, 0, MMNDEL },
117 { "respondsender", respondsender, A|R|I|MSGLIST,0, MMNDEL },
118 { "Resend", Resendcmd, A|R|STRLIST, 0, MMNDEL },
119 { "Redirect", Resendcmd, A|R|STRLIST, 0, MMNDEL },
120 { "resend", resendcmd, A|R|STRLIST, 0, MMNDEL },
121 { "redirect", resendcmd, A|R|STRLIST, 0, MMNDEL },
122 { "Forward", Forwardcmd, A|R|STRLIST, 0, MMNDEL },
123 { "Fwd", Forwardcmd, A|R|STRLIST, 0, MMNDEL },
124 { "forward", forwardcmd, A|R|STRLIST, 0, MMNDEL },
125 { "fwd", forwardcmd, A|R|STRLIST, 0, MMNDEL },
126 { "edit", editor, A|I|MSGLIST, 0, MMNORM },
127 { "echo", echo, M|ECHOLIST, 0, 1000 },
128 { "quit", quitcmd, NOLIST, 0, 0 },
129 { "list", pcmdlist, M|NOLIST, 0, 0 },
130 { "xit", rexit, M|NOLIST, 0, 0 },
131 { "exit", rexit, M|NOLIST, 0, 0 },
132 { "pipe", pipecmd, A|STRLIST, 0, MMNDEL },
133 { "|", pipecmd, A|STRLIST, 0, MMNDEL },
134 { "Pipe", Pipecmd, A|STRLIST, 0, MMNDEL },
135 { "size", messize, A|MSGLIST, 0, MMNDEL },
136 { "hold", preserve, A|W|MSGLIST, 0, MMNDEL },
137 { "if", ifcmd, F|M|RAWLIST, 1, 1 },
138 { "else", elsecmd, F|M|RAWLIST, 0, 0 },
139 { "endif", endifcmd, F|M|RAWLIST, 0, 0 },
140 { "alternates", alternates, M|RAWLIST, 0, 1000 },
141 { "ignore", igfield, M|RAWLIST, 0, 1000 },
142 { "discard", igfield, M|RAWLIST, 0, 1000 },
143 { "retain", retfield, M|RAWLIST, 0, 1000 },
144 { "saveignore", saveigfield, M|RAWLIST, 0, 1000 },
145 { "savediscard",saveigfield, M|RAWLIST, 0, 1000 },
146 { "saveretain", saveretfield, M|RAWLIST, 0, 1000 },
147 { "unignore", unignore, M|RAWLIST, 0, 1000 },
148 { "unretain", unretain, M|RAWLIST, 0, 1000 },
149 { "unsaveignore", unsaveignore, M|RAWLIST, 0, 1000 },
150 { "unsaveretain", unsaveretain, M|RAWLIST, 0, 1000 },
151 { "inc", newmail, A|T|NOLIST, 0, 0 },
152 { "newmail", newmail, A|T|NOLIST, 0, 0 },
153 { "shortcut", shortcut, M|RAWLIST, 0, 1000 },
154 { "unshortcut", unshortcut, M|RAWLIST, 0, 1000 },
155 { "imap", imap_imap, A|STRLIST, 0, 1000 },
156 { "account", account, M|RAWLIST, 0, 1000 },
157 { "thread", thread, A|MSGLIST, 0, 0 },
158 { "unthread", unthread, A|MSGLIST, 0, 0 },
159 { "online", cconnect, A|NOLIST, 0, 0 },
160 { "connect", cconnect, A|NOLIST, 0, 0 },
161 { "disconnect", cdisconnect, A|NDMLIST, 0, 0 },
162 { "sort", sort, A|RAWLIST, 0, 1 },
163 { "unsort", unthread, A|MSGLIST, 0, 0 },
164 { "cache", ccache, A|MSGLIST, 0, 0 },
165 { "flag", cflag, A|M|MSGLIST, 0, 0 },
166 { "unflag", cunflag, A|M|MSGLIST, 0, 0 },
167 { "answered", canswered, A|M|MSGLIST, 0, 0 },
168 { "unanswered", cunanswered, A|M|MSGLIST, 0, 0 },
169 { "draft", cdraft, A|M|MSGLIST, 0, 0 },
170 { "undraft", cundraft, A|M|MSGLIST, 0, 0 },
171 { "kill", ckill, A|M|MSGLIST, 0, 0 },
172 { "unkill", cunkill, A|M|MSGLIST, 0, 0 },
173 { "score", cscore, A|M|STRLIST, 0, 0 },
174 { "define", cdefine, M|RAWLIST, 0, 2 },
175 { "defines", cdefines, M|RAWLIST, 0, 0 },
176 { "undef", cundef, M|RAWLIST, 0, 1000 },
177 { "call", ccall, M|RAWLIST, 0, 1 },
178 { "move", cmove, A|M|STRLIST, 0, 0 },
179 { "mv", cmove, A|M|STRLIST, 0, 0 },
180 { "Move", cMove, A|M|STRLIST, 0, 0 },
181 { "Mv", cMove, A|M|STRLIST, 0, 0 },
182 { "noop", cnoop, A|M|RAWLIST, 0, 0 },
183 { "collapse", ccollapse, A|MSGLIST, 0, 0 },
184 { "uncollapse", cuncollapse, A|MSGLIST, 0, 0 },
185 { "verify", cverify, A|MSGLIST, 0, 0 },
186 { "decrypt", cdecrypt, A|M|STRLIST, 0, 0 },
187 { "Decrypt", cDecrypt, A|M|STRLIST, 0, 0 },
188 { "certsave", ccertsave, A|STRLIST, 0, 0 },
189 { "rename", crename, M|RAWLIST, 0, 2 },
190 { "remove", cremove, M|RAWLIST, 0, 1000 },
191 { "classify", cclassify, A|M|MSGLIST, 0, 0 },
192 { "junk", cjunk, A|M|MSGLIST, 0, 0 },
193 { "bad", cjunk, A|M|MSGLIST, 0, 0 },
194 { "good", cgood, A|M|MSGLIST, 0, 0 },
195 { "unjunk", cunjunk, A|M|MSGLIST, 0, 0 },
196 { "ungood", cungood, A|M|MSGLIST, 0, 0 },
197 { "probability",cprobability, M|RAWLIST, 0, 1000 },
198 { "show", show, A|MSGLIST, 0, MMNDEL },
199 { "Show", show, A|MSGLIST, 0, MMNDEL },
200 { "seen", seen, A|M|MSGLIST, 0, MMNDEL },
201 { "Seen", seen, A|M|MSGLIST, 0, MMNDEL },
202 { "fwdignore", fwdigfield, M|RAWLIST, 0, 1000 },
203 { "fwddiscard",fwdigfield, M|RAWLIST, 0, 1000 },
204 { "fwdretain", fwdretfield, M|RAWLIST, 0, 1000 },
205 { "unfwdignore", unfwdignore, M|RAWLIST, 0, 1000 },
206 { "unfwdretain", unfwdretain, M|RAWLIST, 0, 1000 },
207 /* { "Header", Header, STRLIST, 0, 1000 }, */
208 #ifdef DEBUG_COMMANDS
209 { "core", core, M|NOLIST, 0, 0 },
210 { "clobber", clobber, M|RAWLIST, 0, 1 },
211 #endif /* DEBUG_COMMANDS */
212 { 0, 0, 0, 0, 0 }