[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.5

1.5     ! millert     1: /*     $OpenBSD: cmdtab.c,v 1.4 1997/07/13 21:21:10 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.4       millert    39: static char sccsid[] = "@(#)cmdtab.c   8.2 (Berkeley) 4/20/95";
1.3       deraadt    40: #else
1.5     ! millert    41: static char rcsid[] = "$OpenBSD: cmdtab.c,v 1.4 1997/07/13 21:21:10 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:  */
                     53:
1.2       niklas     54: const struct cmd cmdtab[] = {
1.5     ! millert    55:        /*                                              msgmask msgflag  */
        !            56:        /* command      function        argtype         result  & mask   */
        !            57:        /* -------      --------        -------         ------- -------- */
1.3       deraadt    58:        { "next",       next,           NDMLIST,        0,      MMNDEL },
                     59:        { "alias",      group,          M|RAWLIST,      0,      1000 },
                     60:        { "print",      type,           MSGLIST,        0,      MMNDEL },
                     61:        { "type",       type,           MSGLIST,        0,      MMNDEL },
                     62:        { "Type",       Type,           MSGLIST,        0,      MMNDEL },
                     63:        { "Print",      Type,           MSGLIST,        0,      MMNDEL },
                     64:        { "visual",     visual,         I|MSGLIST,      0,      MMNORM },
                     65:        { "top",        top,            MSGLIST,        0,      MMNDEL },
                     66:        { "touch",      stouch,         W|MSGLIST,      0,      MMNDEL },
                     67:        { "preserve",   preserve,       W|MSGLIST,      0,      MMNDEL },
                     68:        { "delete",     delete,         W|P|MSGLIST,    0,      MMNDEL },
                     69:        { "dp",         deltype,        W|MSGLIST,      0,      MMNDEL },
                     70:        { "dt",         deltype,        W|MSGLIST,      0,      MMNDEL },
                     71:        { "undelete",   undeletecmd,    P|MSGLIST,      MDELETED,MMNDEL },
                     72:        { "unset",      unset,          M|RAWLIST,      1,      1000 },
                     73:        { "mail",       sendmail,       R|M|I|STRLIST,  0,      0 },
                     74:        { "mbox",       mboxit,         W|MSGLIST,      0,      0 },
1.5     ! millert    75:        { "pipe",       pipeit,         MSGLIST|STRLIST,0,      MMNDEL },
        !            76:        { "|",          pipeit,         MSGLIST|STRLIST,0,      MMNDEL },
1.3       deraadt    77:        { "more",       more,           MSGLIST,        0,      MMNDEL },
                     78:        { "page",       more,           MSGLIST,        0,      MMNDEL },
                     79:        { "More",       More,           MSGLIST,        0,      MMNDEL },
                     80:        { "Page",       More,           MSGLIST,        0,      MMNDEL },
                     81:        { "unread",     unread,         MSGLIST,        0,      MMNDEL },
                     82:        { "!",          shell,          I|STRLIST,      0,      0 },
                     83:        { "copy",       copycmd,        M|STRLIST,      0,      0 },
                     84:        { "chdir",      schdir,         M|RAWLIST,      0,      1 },
                     85:        { "cd",         schdir,         M|RAWLIST,      0,      1 },
                     86:        { "save",       save,           STRLIST,        0,      0 },
                     87:        { "source",     source,         M|RAWLIST,      1,      1 },
                     88:        { "set",        set,            M|RAWLIST,      0,      1000 },
                     89:        { "shell",      dosh,           I|NOLIST,       0,      0 },
                     90:        { "version",    pversion,       M|NOLIST,       0,      0 },
                     91:        { "group",      group,          M|RAWLIST,      0,      1000 },
                     92:        { "write",      swrite,         STRLIST,        0,      0 },
                     93:        { "from",       from,           MSGLIST,        0,      MMNORM },
                     94:        { "file",       file,           T|M|RAWLIST,    0,      1 },
                     95:        { "folder",     file,           T|M|RAWLIST,    0,      1 },
1.5     ! millert    96:        { "folders",    folders,        T|M|STRLIST,    0,      0 },
1.3       deraadt    97:        { "?",          help,           M|NOLIST,       0,      0 },
                     98:        { "z",          scroll,         M|STRLIST,      0,      0 },
                     99:        { "headers",    headers,        MSGLIST,        0,      MMNDEL },
                    100:        { "help",       help,           M|NOLIST,       0,      0 },
                    101:        { "=",          pdot,           NOLIST,         0,      0 },
                    102:        { "Reply",      Respond,        R|I|MSGLIST,    0,      MMNDEL },
                    103:        { "Respond",    Respond,        R|I|MSGLIST,    0,      MMNDEL },
                    104:        { "reply",      respond,        R|I|MSGLIST,    0,      MMNDEL },
                    105:        { "respond",    respond,        R|I|MSGLIST,    0,      MMNDEL },
                    106:        { "edit",       editor,         I|MSGLIST,      0,      MMNORM },
                    107:        { "echo",       echo,           M|RAWLIST,      0,      1000 },
                    108:        { "quit",       quitcmd,        NOLIST,         0,      0 },
                    109:        { "list",       pcmdlist,       M|NOLIST,       0,      0 },
                    110:        { "xit",        rexit,          M|NOLIST,       0,      0 },
                    111:        { "exit",       rexit,          M|NOLIST,       0,      0 },
                    112:        { "size",       messize,        MSGLIST,        0,      MMNDEL },
                    113:        { "hold",       preserve,       W|MSGLIST,      0,      MMNDEL },
                    114:        { "if",         ifcmd,          F|M|RAWLIST,    1,      1 },
                    115:        { "else",       elsecmd,        F|M|RAWLIST,    0,      0 },
                    116:        { "endif",      endifcmd,       F|M|RAWLIST,    0,      0 },
                    117:        { "alternates", alternates,     M|RAWLIST,      0,      1000 },
                    118:        { "ignore",     igfield,        M|RAWLIST,      0,      1000 },
                    119:        { "discard",    igfield,        M|RAWLIST,      0,      1000 },
                    120:        { "retain",     retfield,       M|RAWLIST,      0,      1000 },
                    121:        { "saveignore", saveigfield,    M|RAWLIST,      0,      1000 },
                    122:        { "savediscard",saveigfield,    M|RAWLIST,      0,      1000 },
                    123:        { "saveretain", saveretfield,   M|RAWLIST,      0,      1000 },
                    124: /*     { "Header",     Header,         STRLIST,        0,      1000 }, */
                    125:        { "core",       core,           M|NOLIST,       0,      0 },
                    126:        { "#",          null,           M|NOLIST,       0,      0 },
                    127:        { "clobber",    clobber,        M|RAWLIST,      0,      1 },
1.4       millert   128:        { "inc",        inc,            T|NOLIST,       0,      0 },
1.5     ! millert   129:        { "new",        marknew,        MSGLIST,        0,      MMNDEL },
1.3       deraadt   130:        { 0,            0,              0,              0,      0 }
1.1       deraadt   131: };