[BACK]Return to cmdtab.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / mail

Annotation of src/usr.bin/mail/cmdtab.c, Revision 1.6

1.6     ! millert     1: /*     $OpenBSD: cmdtab.c,v 1.5 2001/01/16 05:36:08 millert Exp $      */
1.4       millert     2: /*     $NetBSD: cmdtab.c,v 1.7 1996/12/28 07:10:59 tls Exp $   */
1.2       niklas      3:
1.1       deraadt     4: /*
                      5:  * Copyright (c) 1980, 1993
                      6:  *     The Regents of the University of California.  All rights reserved.
                      7:  *
                      8:  * Redistribution and use in source and binary forms, with or without
                      9:  * modification, are permitted provided that the following conditions
                     10:  * are met:
                     11:  * 1. Redistributions of source code must retain the above copyright
                     12:  *    notice, this list of conditions and the following disclaimer.
                     13:  * 2. Redistributions in binary form must reproduce the above copyright
                     14:  *    notice, this list of conditions and the following disclaimer in the
                     15:  *    documentation and/or other materials provided with the distribution.
                     16:  * 3. All advertising materials mentioning features or use of this software
                     17:  *    must display the following acknowledgement:
                     18:  *     This product includes software developed by the University of
                     19:  *     California, Berkeley and its contributors.
                     20:  * 4. Neither the name of the University nor the names of its contributors
                     21:  *    may be used to endorse or promote products derived from this software
                     22:  *    without specific prior written permission.
                     23:  *
                     24:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     25:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     26:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     27:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     28:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     29:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     30:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     31:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     32:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     33:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     34:  * SUCH DAMAGE.
                     35:  */
                     36:
                     37: #ifndef lint
1.3       deraadt    38: #if 0
1.6     ! millert    39: static const char sccsid[] = "@(#)cmdtab.c     8.2 (Berkeley) 4/20/95";
1.3       deraadt    40: #else
1.6     ! millert    41: static const char rcsid[] = "$OpenBSD: cmdtab.c,v 1.5 2001/01/16 05:36:08 millert Exp $";
1.3       deraadt    42: #endif
1.1       deraadt    43: #endif /* not lint */
                     44:
                     45: #include "def.h"
                     46: #include "extern.h"
                     47:
                     48: /*
                     49:  * Mail -- a mail program
                     50:  *
                     51:  * Define all of the command names and bindings.
                     52:  */
1.2       niklas     53: const struct cmd cmdtab[] = {
1.5       millert    54:        /*                                              msgmask msgflag  */
                     55:        /* command      function        argtype         result  & mask   */
                     56:        /* -------      --------        -------         ------- -------- */
1.6     ! millert    57:        { "next",       { next },       NDMLIST,        0,      MMNDEL },
        !            58:        { "alias",      { group },      M|RAWLIST,      0,      1000 },
        !            59:        { "print",      { type },       MSGLIST,        0,      MMNDEL },
        !            60:        { "type",       { type },       MSGLIST,        0,      MMNDEL },
        !            61:        { "Type",       { Type },       MSGLIST,        0,      MMNDEL },
        !            62:        { "Print",      { Type },       MSGLIST,        0,      MMNDEL },
        !            63:        { "visual",     { visual },     I|MSGLIST,      0,      MMNORM },
        !            64:        { "top",        { top },        MSGLIST,        0,      MMNDEL },
        !            65:        { "touch",      { stouch },     W|MSGLIST,      0,      MMNDEL },
        !            66:        { "preserve",   { preserve },   W|MSGLIST,      0,      MMNDEL },
        !            67:        { "delete",     { delete },     W|P|MSGLIST,    0,      MMNDEL },
        !            68:        { "dp",         { deltype },    W|MSGLIST,      0,      MMNDEL },
        !            69:        { "dt",         { deltype },    W|MSGLIST,      0,      MMNDEL },
        !            70:        { "undelete",   { undeletecmd }, P|MSGLIST,     MDELETED,MMNDEL },
        !            71:        { "unset",      { unset },      M|RAWLIST,      1,      1000 },
        !            72:        { "mail",       { sendmail },   R|M|I|STRLIST,  0,      0 },
        !            73:        { "mbox",       { mboxit },     W|MSGLIST,      0,      0 },
        !            74:        { "pipe",       { pipeit },     MSGLIST|STRLIST,0,      MMNDEL },
        !            75:        { "|",          { pipeit },     MSGLIST|STRLIST,0,      MMNDEL },
        !            76:        { "more",       { more },       MSGLIST,        0,      MMNDEL },
        !            77:        { "page",       { more },       MSGLIST,        0,      MMNDEL },
        !            78:        { "More",       { More },       MSGLIST,        0,      MMNDEL },
        !            79:        { "Page",       { More },       MSGLIST,        0,      MMNDEL },
        !            80:        { "unread",     { unread },     MSGLIST,        0,      MMNDEL },
        !            81:        { "!",          { shell },      I|STRLIST,      0,      0 },
        !            82:        { "copy",       { copycmd },    M|STRLIST,      0,      0 },
        !            83:        { "chdir",      { schdir },     M|RAWLIST,      0,      1 },
        !            84:        { "cd",         { schdir },     M|RAWLIST,      0,      1 },
        !            85:        { "save",       { save },       STRLIST,        0,      0 },
        !            86:        { "source",     { source },     M|RAWLIST,      1,      1 },
        !            87:        { "set",        { set },        M|RAWLIST,      0,      1000 },
        !            88:        { "shell",      { dosh },       I|NOLIST,       0,      0 },
        !            89:        { "version",    { pversion },   M|NOLIST,       0,      0 },
        !            90:        { "group",      { group },      M|RAWLIST,      0,      1000 },
        !            91:        { "write",      { swrite },     STRLIST,        0,      0 },
        !            92:        { "from",       { from },       MSGLIST,        0,      MMNORM },
        !            93:        { "file",       { file },       T|M|RAWLIST,    0,      1 },
        !            94:        { "folder",     { file },       T|M|RAWLIST,    0,      1 },
        !            95:        { "folders",    { folders },    T|M|STRLIST,    0,      0 },
        !            96:        { "?",          { help },       M|NOLIST,       0,      0 },
        !            97:        { "z",          { scroll },     M|STRLIST,      0,      0 },
        !            98:        { "headers",    { headers },    MSGLIST,        0,      MMNDEL },
        !            99:        { "help",       { help },       M|NOLIST,       0,      0 },
        !           100:        { "=",          { pdot },       NOLIST,         0,      0 },
        !           101:        { "Reply",      { Respond },    R|I|MSGLIST,    0,      MMNDEL },
        !           102:        { "Respond",    { Respond },    R|I|MSGLIST,    0,      MMNDEL },
        !           103:        { "reply",      { respond },    R|I|MSGLIST,    0,      MMNDEL },
        !           104:        { "respond",    { respond },    R|I|MSGLIST,    0,      MMNDEL },
        !           105:        { "edit",       { editor },     I|MSGLIST,      0,      MMNORM },
        !           106:        { "echo",       { echo },       M|RAWLIST,      0,      1000 },
        !           107:        { "quit",       { quitcmd },    NOLIST,         0,      0 },
        !           108:        { "list",       { pcmdlist },   M|NOLIST,       0,      0 },
        !           109:        { "xit",        { rexit },      M|NOLIST,       0,      0 },
        !           110:        { "exit",       { rexit },      M|NOLIST,       0,      0 },
        !           111:        { "size",       { messize },    MSGLIST,        0,      MMNDEL },
        !           112:        { "hold",       { preserve },   W|MSGLIST,      0,      MMNDEL },
        !           113:        { "if",         { ifcmd },      F|M|RAWLIST,    1,      1 },
        !           114:        { "else",       { elsecmd },    F|M|RAWLIST,    0,      0 },
        !           115:        { "endif",      { endifcmd },   F|M|RAWLIST,    0,      0 },
        !           116:        { "alternates", { alternates }, M|RAWLIST,      0,      1000 },
        !           117:        { "ignore",     { igfield },    M|RAWLIST,      0,      1000 },
        !           118:        { "discard",    { igfield },    M|RAWLIST,      0,      1000 },
        !           119:        { "retain",     { retfield },   M|RAWLIST,      0,      1000 },
        !           120:        { "saveignore", { saveigfield }, M|RAWLIST,     0,      1000 },
        !           121:        { "savediscard",{ saveigfield }, M|RAWLIST,     0,      1000 },
        !           122:        { "saveretain", { saveretfield }, M|RAWLIST,    0,      1000 },
        !           123: #if 0
        !           124:        { "Header",     { Header },     STRLIST,        0,      1000 },
        !           125: #endif
        !           126:        { "core",       { core },       M|NOLIST,       0,      0 },
        !           127:        { "#",          { null },       M|NOLIST,       0,      0 },
        !           128:        { "clobber",    { clobber },    M|RAWLIST,      0,      1 },
        !           129:        { "inc",        { inc },        T|NOLIST,       0,      0 },
        !           130:        { "new",        { marknew },    MSGLIST,        0,      MMNDEL },
        !           131:        { 0,            { 0 },          0,              0,      0 }
1.1       deraadt   132: };