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