bug report from gumkowsk@nadc.arpa (fix is my own),
[unix-history] / usr / src / usr.bin / mail / cmdtab.c
CommitLineData
b059c7be
DF
1/*
2 * Copyright (c) 1980 Regents of the University of California.
0c5f72fb
KB
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms are permitted
acfc7e9b
KB
6 * provided that the above copyright notice and this paragraph are
7 * duplicated in all such forms and that any documentation,
8 * advertising materials, and other materials related to such
9 * distribution and use acknowledge that the software was developed
10 * by the University of California, Berkeley. The name of the
11 * University may not be used to endorse or promote products derived
12 * from this software without specific prior written permission.
13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
b059c7be
DF
16 */
17
acfc7e9b 18#ifndef lint
20f2beb7 19static char sccsid[] = "@(#)cmdtab.c 5.9 (Berkeley) %G%";
acfc7e9b 20#endif /* not lint */
1d3a1a2f
KS
21
22#include "def.h"
23
24/*
25 * Mail -- a mail program
26 *
27 * Define all of the command names and bindings.
28 */
29
1d3a1a2f 30extern int type(), preserve(), delete(), undelete(), next(), shell(), schdir();
828615a1 31extern int save(), help(), headers(), pdot(), respond(), editor();
0d149b8b 32extern int edstop(), rexit(), pcmdlist(), sendmail(), from(), copycmd();
1d3a1a2f
KS
33extern int messize(), psalloc(), deltype(), unset(), set(), source();
34extern int pversion(), group(), top(), core(), null(), stouch(), visual();
1bd5b11d 35extern int swrite(), dosh(), file(), echo(), Respond(), scroll(), ifcmd();
26210b9d 36extern int elsecmd(), endifcmd(), mboxit(), clobber(), alternates();
20f2beb7 37extern int folders(), igfield(), Type(), retfield(), more(), More();
887efe38 38extern int saveigfield(), saveretfield();
de7ac1f4 39extern int unread(); /* , Header(); */
1d3a1a2f
KS
40
41struct cmd cmdtab[] = {
42 "next", next, NDMLIST, 0, MMNDEL,
43 "alias", group, M|RAWLIST, 0, 1000,
44 "print", type, MSGLIST, 0, MMNDEL,
45 "type", type, MSGLIST, 0, MMNDEL,
e6160718
KS
46 "Type", Type, MSGLIST, 0, MMNDEL,
47 "Print", Type, MSGLIST, 0, MMNDEL,
67cb9e50 48 "visual", visual, I|MSGLIST, 0, MMNORM,
1d3a1a2f 49 "top", top, MSGLIST, 0, MMNDEL,
c548598c
KS
50 "touch", stouch, W|MSGLIST, 0, MMNDEL,
51 "preserve", preserve, W|MSGLIST, 0, MMNDEL,
52 "delete", delete, W|P|MSGLIST, 0, MMNDEL,
53 "dp", deltype, W|MSGLIST, 0, MMNDEL,
54 "dt", deltype, W|MSGLIST, 0, MMNDEL,
1d3a1a2f
KS
55 "undelete", undelete, P|MSGLIST, MDELETED,MMNDEL,
56 "unset", unset, M|RAWLIST, 1, 1000,
cbaa6c31 57 "mail", sendmail, R|M|I|STRLIST, 0, 0,
b06be156 58 "mbox", mboxit, W|MSGLIST, 0, 0,
b041ccec
S
59 "more", more, MSGLIST, 0, MMNDEL,
60 "page", more, MSGLIST, 0, MMNDEL,
61 "More", More, MSGLIST, 0, MMNDEL,
62 "Page", More, MSGLIST, 0, MMNDEL,
de7ac1f4 63 "unread", unread, MSGLIST, 0, MMNDEL,
1d3a1a2f 64 "!", shell, I|STRLIST, 0, 0,
0d149b8b 65 "copy", copycmd, M|STRLIST, 0, 0,
23464f86
EW
66 "chdir", schdir, M|RAWLIST, 0, 1,
67 "cd", schdir, M|RAWLIST, 0, 1,
1d3a1a2f 68 "save", save, STRLIST, 0, 0,
23464f86 69 "source", source, M|RAWLIST, 1, 1,
1d3a1a2f
KS
70 "set", set, M|RAWLIST, 0, 1000,
71 "shell", dosh, I|NOLIST, 0, 0,
72 "version", pversion, M|NOLIST, 0, 0,
73 "group", group, M|RAWLIST, 0, 1000,
74 "write", swrite, STRLIST, 0, 0,
75 "from", from, MSGLIST, 0, MMNORM,
1bd5b11d 76 "file", file, T|M|RAWLIST, 0, 1,
176b7b1e 77 "folder", file, T|M|RAWLIST, 0, 1,
23464f86 78 "folders", folders, T|M|NOLIST, 0, 0,
1d3a1a2f
KS
79 "?", help, M|NOLIST, 0, 0,
80 "z", scroll, M|STRLIST, 0, 0,
81 "headers", headers, MSGLIST, 0, MMNDEL,
82 "help", help, M|NOLIST, 0, 0,
83 "=", pdot, NOLIST, 0, 0,
cbaa6c31
KS
84 "Reply", Respond, R|I|MSGLIST, 0, MMNDEL,
85 "Respond", Respond, R|I|MSGLIST, 0, MMNDEL,
86 "reply", respond, R|I|MSGLIST, 0, MMNDEL,
87 "respond", respond, R|I|MSGLIST, 0, MMNDEL,
67cb9e50 88 "edit", editor, I|MSGLIST, 0, MMNORM,
e90df9d9 89 "echo", echo, M|RAWLIST, 0, 1000,
23464f86 90 "quit", edstop, NOLIST, 0, 0,
1d3a1a2f 91 "list", pcmdlist, M|NOLIST, 0, 0,
8715a8f1
KS
92 "xit", rexit, M|NOLIST, 0, 0,
93 "exit", rexit, M|NOLIST, 0, 0,
1d3a1a2f 94 "size", messize, MSGLIST, 0, MMNDEL,
c548598c 95 "hold", preserve, W|MSGLIST, 0, MMNDEL,
e90df9d9
KS
96 "if", ifcmd, F|M|RAWLIST, 1, 1,
97 "else", elsecmd, F|M|RAWLIST, 0, 0,
98 "endif", endifcmd, F|M|RAWLIST, 0, 0,
26210b9d 99 "alternates", alternates, M|RAWLIST, 0, 1000,
e6160718
KS
100 "ignore", igfield, M|RAWLIST, 0, 1000,
101 "discard", igfield, M|RAWLIST, 0, 1000,
46053c99 102 "retain", retfield, M|RAWLIST, 0, 1000,
887efe38
EW
103 "saveignore", saveigfield, M|RAWLIST, 0, 1000,
104 "savediscard", saveigfield, M|RAWLIST, 0, 1000,
105 "saveretain", saveretfield, M|RAWLIST, 0, 1000,
de7ac1f4 106/* "Header", Header, STRLIST, 0, 1000, */
1d3a1a2f
KS
107 "core", core, M|NOLIST, 0, 0,
108 "#", null, M|NOLIST, 0, 0,
cafd3e72 109 "clobber", clobber, M|RAWLIST, 0, 1,
1d3a1a2f
KS
110 0, 0, 0, 0, 0
111};