1*7c478bd9Sstevel@tonic-gate /* 2*7c478bd9Sstevel@tonic-gate * CDDL HEADER START 3*7c478bd9Sstevel@tonic-gate * 4*7c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*7c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*7c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*7c478bd9Sstevel@tonic-gate * with the License. 8*7c478bd9Sstevel@tonic-gate * 9*7c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*7c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*7c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 12*7c478bd9Sstevel@tonic-gate * and limitations under the License. 13*7c478bd9Sstevel@tonic-gate * 14*7c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*7c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*7c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*7c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*7c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*7c478bd9Sstevel@tonic-gate * 20*7c478bd9Sstevel@tonic-gate * CDDL HEADER END 21*7c478bd9Sstevel@tonic-gate */ 22*7c478bd9Sstevel@tonic-gate /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 23*7c478bd9Sstevel@tonic-gate /* All Rights Reserved */ 24*7c478bd9Sstevel@tonic-gate 25*7c478bd9Sstevel@tonic-gate 26*7c478bd9Sstevel@tonic-gate /* 27*7c478bd9Sstevel@tonic-gate * University Copyright- Copyright (c) 1982, 1986, 1988 28*7c478bd9Sstevel@tonic-gate * The Regents of the University of California 29*7c478bd9Sstevel@tonic-gate * All Rights Reserved 30*7c478bd9Sstevel@tonic-gate * 31*7c478bd9Sstevel@tonic-gate * University Acknowledgment- Portions of this document are derived from 32*7c478bd9Sstevel@tonic-gate * software developed by the University of California, Berkeley, and its 33*7c478bd9Sstevel@tonic-gate * contributors. 34*7c478bd9Sstevel@tonic-gate */ 35*7c478bd9Sstevel@tonic-gate 36*7c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 37*7c478bd9Sstevel@tonic-gate 38*7c478bd9Sstevel@tonic-gate #include "def.h" 39*7c478bd9Sstevel@tonic-gate 40*7c478bd9Sstevel@tonic-gate /* 41*7c478bd9Sstevel@tonic-gate * mailx -- a modified version of a University of California at Berkeley 42*7c478bd9Sstevel@tonic-gate * mail program 43*7c478bd9Sstevel@tonic-gate * 44*7c478bd9Sstevel@tonic-gate * Define all of the command names and bindings. 45*7c478bd9Sstevel@tonic-gate */ 46*7c478bd9Sstevel@tonic-gate 47*7c478bd9Sstevel@tonic-gate /* 48*7c478bd9Sstevel@tonic-gate * Since the type of the argument to the procedures in the 49*7c478bd9Sstevel@tonic-gate * command table depends on the flags in the table, and since 50*7c478bd9Sstevel@tonic-gate * the argument type must be specified in struct cmd for C++ 51*7c478bd9Sstevel@tonic-gate * compatibility, and since I didn't want to change all the 52*7c478bd9Sstevel@tonic-gate * command procedures to expect an argument of type void *, 53*7c478bd9Sstevel@tonic-gate * the following cast "makes it all work". Yes, it's ugly. 54*7c478bd9Sstevel@tonic-gate */ 55*7c478bd9Sstevel@tonic-gate #define C (int (*)(void *)) 56*7c478bd9Sstevel@tonic-gate 57*7c478bd9Sstevel@tonic-gate extern const struct cmd cmdtab[] = { 58*7c478bd9Sstevel@tonic-gate "next", C next, NDMLIST, 0, MMNDEL, 59*7c478bd9Sstevel@tonic-gate "alias", C group, M|RAWLIST, 0, 1000, 60*7c478bd9Sstevel@tonic-gate "print", C type, MSGLIST, 0, MMNDEL, 61*7c478bd9Sstevel@tonic-gate "type", C type, MSGLIST, 0, MMNDEL, 62*7c478bd9Sstevel@tonic-gate "Type", C Type, MSGLIST, 0, MMNDEL, 63*7c478bd9Sstevel@tonic-gate "Print", C Type, MSGLIST, 0, MMNDEL, 64*7c478bd9Sstevel@tonic-gate "visual", C visual, I|MSGLIST, 0, MMNORM, 65*7c478bd9Sstevel@tonic-gate "top", C top, MSGLIST, 0, MMNDEL, 66*7c478bd9Sstevel@tonic-gate "touch", C stouch, W|MSGLIST, 0, MMNDEL, 67*7c478bd9Sstevel@tonic-gate "preserve", C preserve, I|W|MSGLIST, 0, MMNDEL, 68*7c478bd9Sstevel@tonic-gate "delete", C delm, W|P|MSGLIST, 0, MMNDEL, 69*7c478bd9Sstevel@tonic-gate "dp", C deltype, W|MSGLIST, 0, MMNDEL, 70*7c478bd9Sstevel@tonic-gate "dt", C deltype, W|MSGLIST, 0, MMNDEL, 71*7c478bd9Sstevel@tonic-gate "undelete", C undelete, P|MSGLIST, MDELETED,MMNDEL, 72*7c478bd9Sstevel@tonic-gate "unset", C unset, M|RAWLIST, 1, 1000, 73*7c478bd9Sstevel@tonic-gate "mail", C sendm, R|M|I|STRLIST, 0, 0, 74*7c478bd9Sstevel@tonic-gate "Mail", C Sendm, R|M|I|STRLIST, 0, 0, 75*7c478bd9Sstevel@tonic-gate "mbox", C mboxit, W|MSGLIST, 0, 0, 76*7c478bd9Sstevel@tonic-gate "more", C more, MSGLIST, 0, MMNDEL, 77*7c478bd9Sstevel@tonic-gate "page", C more, MSGLIST, 0, MMNDEL, 78*7c478bd9Sstevel@tonic-gate "More", C More, MSGLIST, 0, MMNDEL, 79*7c478bd9Sstevel@tonic-gate "Page", C More, MSGLIST, 0, MMNDEL, 80*7c478bd9Sstevel@tonic-gate "unread", C unread, MSGLIST, 0, MMNDEL, 81*7c478bd9Sstevel@tonic-gate "Unread", C unread, MSGLIST, 0, MMNDEL, 82*7c478bd9Sstevel@tonic-gate "new", C unread, MSGLIST, 0, MMNDEL, 83*7c478bd9Sstevel@tonic-gate "New", C unread, MSGLIST, 0, MMNDEL, 84*7c478bd9Sstevel@tonic-gate "!", C shell, I|STRLIST, 0, 0, 85*7c478bd9Sstevel@tonic-gate "copy", C copycmd, M|STRLIST, 0, 0, 86*7c478bd9Sstevel@tonic-gate "Copy", C Copy, M|MSGLIST, 0, 0, 87*7c478bd9Sstevel@tonic-gate "chdir", C schdir, M|STRLIST, 0, 0, 88*7c478bd9Sstevel@tonic-gate "cd", C schdir, M|STRLIST, 0, 0, 89*7c478bd9Sstevel@tonic-gate "save", C save, STRLIST, 0, 0, 90*7c478bd9Sstevel@tonic-gate "Save", C Save, MSGLIST, 0, 0, 91*7c478bd9Sstevel@tonic-gate "source", C source, M|STRLIST, 0, 0, 92*7c478bd9Sstevel@tonic-gate "set", C set, M|RAWLIST, 0, 1000, 93*7c478bd9Sstevel@tonic-gate "shell", C dosh, I|NOLIST, 0, 0, 94*7c478bd9Sstevel@tonic-gate "version", C pversion, M|NOLIST, 0, 0, 95*7c478bd9Sstevel@tonic-gate "group", C group, M|RAWLIST, 0, 1000, 96*7c478bd9Sstevel@tonic-gate "unalias", C ungroup, M|RAWLIST, 0, 1000, 97*7c478bd9Sstevel@tonic-gate "ungroup", C ungroup, M|RAWLIST, 0, 1000, 98*7c478bd9Sstevel@tonic-gate "write", C swrite, STRLIST, 0, 0, 99*7c478bd9Sstevel@tonic-gate "from", C from, MSGLIST, 0, MMNORM, 100*7c478bd9Sstevel@tonic-gate "followup", C followup, R|I|MSGLIST, 0, MMNDEL, 101*7c478bd9Sstevel@tonic-gate "Followup", C Followup, R|I|MSGLIST, 0, MMNDEL, 102*7c478bd9Sstevel@tonic-gate "file", C file, T|M|RAWLIST, 0, 1, 103*7c478bd9Sstevel@tonic-gate "folder", C file, T|M|RAWLIST, 0, 1, 104*7c478bd9Sstevel@tonic-gate "folders", C folders, T|M|RAWLIST, 0, 1, 105*7c478bd9Sstevel@tonic-gate "?", C help, M|NOLIST, 0, 0, 106*7c478bd9Sstevel@tonic-gate "z", C scroll, M|STRLIST, 0, 0, 107*7c478bd9Sstevel@tonic-gate "headers", C headers, MSGLIST, 0, MMNDEL, 108*7c478bd9Sstevel@tonic-gate "help", C help, M|NOLIST, 0, 0, 109*7c478bd9Sstevel@tonic-gate "=", C pdot, NOLIST, 0, 0, 110*7c478bd9Sstevel@tonic-gate "Reply", C Respond, R|I|MSGLIST, 0, MMNDEL, 111*7c478bd9Sstevel@tonic-gate "Respond", C Respond, R|I|MSGLIST, 0, MMNDEL, 112*7c478bd9Sstevel@tonic-gate "reply", C respond, R|I|MSGLIST, 0, MMNDEL, 113*7c478bd9Sstevel@tonic-gate "respond", C respond, R|I|MSGLIST, 0, MMNDEL, 114*7c478bd9Sstevel@tonic-gate "replyall", C replyall, R|I|MSGLIST, 0, MMNDEL, 115*7c478bd9Sstevel@tonic-gate "replysender", C replysender, R|I|MSGLIST, 0, MMNDEL, 116*7c478bd9Sstevel@tonic-gate "edit", C editor, I|MSGLIST, 0, MMNORM, 117*7c478bd9Sstevel@tonic-gate "echo", C echo, M|RAWLIST, 0, 1000, 118*7c478bd9Sstevel@tonic-gate "quit", C edstop, NOLIST, 0, 0, 119*7c478bd9Sstevel@tonic-gate "list", C pcmdlist, M|NOLIST, 0, 0, 120*7c478bd9Sstevel@tonic-gate "load", C loadmsg, W|STRLIST, 0, 0, 121*7c478bd9Sstevel@tonic-gate "xit", C rexit, M|NOLIST, 0, 0, 122*7c478bd9Sstevel@tonic-gate "exit", C rexit, M|NOLIST, 0, 0, 123*7c478bd9Sstevel@tonic-gate "size", C messize, MSGLIST, 0, MMNDEL, 124*7c478bd9Sstevel@tonic-gate "hold", C preserve, I|W|MSGLIST, 0, MMNDEL, 125*7c478bd9Sstevel@tonic-gate "if", C ifcmd, F|M|RAWLIST, 1, 1, 126*7c478bd9Sstevel@tonic-gate "else", C elsecmd, F|M|RAWLIST, 0, 0, 127*7c478bd9Sstevel@tonic-gate "endif", C endifcmd, F|M|RAWLIST, 0, 0, 128*7c478bd9Sstevel@tonic-gate "alternates", C alternates, M|RAWLIST, 0, 1000, 129*7c478bd9Sstevel@tonic-gate "ignore", C igfield, M|RAWLIST, 0, 1000, 130*7c478bd9Sstevel@tonic-gate "discard", C igfield, M|RAWLIST, 0, 1000, 131*7c478bd9Sstevel@tonic-gate "unignore", C unigfield, M|RAWLIST, 0, 1000, 132*7c478bd9Sstevel@tonic-gate "undiscard", C unigfield, M|RAWLIST, 0, 1000, 133*7c478bd9Sstevel@tonic-gate "retain", C retfield, M|RAWLIST, 0, 1000, 134*7c478bd9Sstevel@tonic-gate "unretain", C unretfield, M|RAWLIST, 0, 1000, 135*7c478bd9Sstevel@tonic-gate /* "Header", C Header, STRLIST, 0, 1000, */ 136*7c478bd9Sstevel@tonic-gate "#", C null, M|NOLIST, 0, 0, 137*7c478bd9Sstevel@tonic-gate "pipe", C dopipe, STRLIST, 0, 0, 138*7c478bd9Sstevel@tonic-gate "|", C dopipe, STRLIST, 0, 0, 139*7c478bd9Sstevel@tonic-gate "inc", C inc, T|NOLIST, 0, 0, 140*7c478bd9Sstevel@tonic-gate "field", C field, STRLIST, 0, 0, 141*7c478bd9Sstevel@tonic-gate "put", C sput, STRLIST, 0, 0, 142*7c478bd9Sstevel@tonic-gate "Put", C Sput, STRLIST, 0, 0, 143*7c478bd9Sstevel@tonic-gate 0, C 0, 0, 0, 0 144*7c478bd9Sstevel@tonic-gate }; 145