10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 50Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 60Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 70Sstevel@tonic-gate * with the License. 80Sstevel@tonic-gate * 90Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 100Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 110Sstevel@tonic-gate * See the License for the specific language governing permissions 120Sstevel@tonic-gate * and limitations under the License. 130Sstevel@tonic-gate * 140Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 150Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 160Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 170Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 180Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 190Sstevel@tonic-gate * 200Sstevel@tonic-gate * CDDL HEADER END 210Sstevel@tonic-gate */ 220Sstevel@tonic-gate /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 230Sstevel@tonic-gate /* All Rights Reserved */ 240Sstevel@tonic-gate 250Sstevel@tonic-gate /* 260Sstevel@tonic-gate * University Copyright- Copyright (c) 1982, 1986, 1988 270Sstevel@tonic-gate * The Regents of the University of California 280Sstevel@tonic-gate * All Rights Reserved 290Sstevel@tonic-gate * 300Sstevel@tonic-gate * University Acknowledgment- Portions of this document are derived from 310Sstevel@tonic-gate * software developed by the University of California, Berkeley, and its 320Sstevel@tonic-gate * contributors. 330Sstevel@tonic-gate */ 340Sstevel@tonic-gate 350Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 360Sstevel@tonic-gate 370Sstevel@tonic-gate #include "def.h" 380Sstevel@tonic-gate 390Sstevel@tonic-gate /* 400Sstevel@tonic-gate * mailx -- a modified version of a University of California at Berkeley 410Sstevel@tonic-gate * mail program 420Sstevel@tonic-gate * 430Sstevel@tonic-gate * Define all of the command names and bindings. 440Sstevel@tonic-gate */ 450Sstevel@tonic-gate 460Sstevel@tonic-gate /* 470Sstevel@tonic-gate * Since the type of the argument to the procedures in the 480Sstevel@tonic-gate * command table depends on the flags in the table, and since 490Sstevel@tonic-gate * the argument type must be specified in struct cmd for C++ 500Sstevel@tonic-gate * compatibility, and since I didn't want to change all the 510Sstevel@tonic-gate * command procedures to expect an argument of type void *, 520Sstevel@tonic-gate * the following cast "makes it all work". Yes, it's ugly. 530Sstevel@tonic-gate */ 540Sstevel@tonic-gate #define C (int (*)(void *)) 550Sstevel@tonic-gate 56*18Srobbin const struct cmd cmdtab[] = { 570Sstevel@tonic-gate "next", C next, NDMLIST, 0, MMNDEL, 580Sstevel@tonic-gate "alias", C group, M|RAWLIST, 0, 1000, 590Sstevel@tonic-gate "print", C type, MSGLIST, 0, MMNDEL, 600Sstevel@tonic-gate "type", C type, MSGLIST, 0, MMNDEL, 610Sstevel@tonic-gate "Type", C Type, MSGLIST, 0, MMNDEL, 620Sstevel@tonic-gate "Print", C Type, MSGLIST, 0, MMNDEL, 630Sstevel@tonic-gate "visual", C visual, I|MSGLIST, 0, MMNORM, 640Sstevel@tonic-gate "top", C top, MSGLIST, 0, MMNDEL, 650Sstevel@tonic-gate "touch", C stouch, W|MSGLIST, 0, MMNDEL, 660Sstevel@tonic-gate "preserve", C preserve, I|W|MSGLIST, 0, MMNDEL, 670Sstevel@tonic-gate "delete", C delm, W|P|MSGLIST, 0, MMNDEL, 680Sstevel@tonic-gate "dp", C deltype, W|MSGLIST, 0, MMNDEL, 690Sstevel@tonic-gate "dt", C deltype, W|MSGLIST, 0, MMNDEL, 700Sstevel@tonic-gate "undelete", C undelete, P|MSGLIST, MDELETED,MMNDEL, 710Sstevel@tonic-gate "unset", C unset, M|RAWLIST, 1, 1000, 720Sstevel@tonic-gate "mail", C sendm, R|M|I|STRLIST, 0, 0, 730Sstevel@tonic-gate "Mail", C Sendm, R|M|I|STRLIST, 0, 0, 740Sstevel@tonic-gate "mbox", C mboxit, W|MSGLIST, 0, 0, 750Sstevel@tonic-gate "more", C more, MSGLIST, 0, MMNDEL, 760Sstevel@tonic-gate "page", C more, MSGLIST, 0, MMNDEL, 770Sstevel@tonic-gate "More", C More, MSGLIST, 0, MMNDEL, 780Sstevel@tonic-gate "Page", C More, MSGLIST, 0, MMNDEL, 790Sstevel@tonic-gate "unread", C unread, MSGLIST, 0, MMNDEL, 800Sstevel@tonic-gate "Unread", C unread, MSGLIST, 0, MMNDEL, 810Sstevel@tonic-gate "new", C unread, MSGLIST, 0, MMNDEL, 820Sstevel@tonic-gate "New", C unread, MSGLIST, 0, MMNDEL, 830Sstevel@tonic-gate "!", C shell, I|STRLIST, 0, 0, 840Sstevel@tonic-gate "copy", C copycmd, M|STRLIST, 0, 0, 850Sstevel@tonic-gate "Copy", C Copy, M|MSGLIST, 0, 0, 860Sstevel@tonic-gate "chdir", C schdir, M|STRLIST, 0, 0, 870Sstevel@tonic-gate "cd", C schdir, M|STRLIST, 0, 0, 880Sstevel@tonic-gate "save", C save, STRLIST, 0, 0, 890Sstevel@tonic-gate "Save", C Save, MSGLIST, 0, 0, 900Sstevel@tonic-gate "source", C source, M|STRLIST, 0, 0, 910Sstevel@tonic-gate "set", C set, M|RAWLIST, 0, 1000, 920Sstevel@tonic-gate "shell", C dosh, I|NOLIST, 0, 0, 930Sstevel@tonic-gate "version", C pversion, M|NOLIST, 0, 0, 940Sstevel@tonic-gate "group", C group, M|RAWLIST, 0, 1000, 950Sstevel@tonic-gate "unalias", C ungroup, M|RAWLIST, 0, 1000, 960Sstevel@tonic-gate "ungroup", C ungroup, M|RAWLIST, 0, 1000, 970Sstevel@tonic-gate "write", C swrite, STRLIST, 0, 0, 980Sstevel@tonic-gate "from", C from, MSGLIST, 0, MMNORM, 990Sstevel@tonic-gate "followup", C followup, R|I|MSGLIST, 0, MMNDEL, 1000Sstevel@tonic-gate "Followup", C Followup, R|I|MSGLIST, 0, MMNDEL, 1010Sstevel@tonic-gate "file", C file, T|M|RAWLIST, 0, 1, 1020Sstevel@tonic-gate "folder", C file, T|M|RAWLIST, 0, 1, 1030Sstevel@tonic-gate "folders", C folders, T|M|RAWLIST, 0, 1, 1040Sstevel@tonic-gate "?", C help, M|NOLIST, 0, 0, 1050Sstevel@tonic-gate "z", C scroll, M|STRLIST, 0, 0, 1060Sstevel@tonic-gate "headers", C headers, MSGLIST, 0, MMNDEL, 1070Sstevel@tonic-gate "help", C help, M|NOLIST, 0, 0, 1080Sstevel@tonic-gate "=", C pdot, NOLIST, 0, 0, 1090Sstevel@tonic-gate "Reply", C Respond, R|I|MSGLIST, 0, MMNDEL, 1100Sstevel@tonic-gate "Respond", C Respond, R|I|MSGLIST, 0, MMNDEL, 1110Sstevel@tonic-gate "reply", C respond, R|I|MSGLIST, 0, MMNDEL, 1120Sstevel@tonic-gate "respond", C respond, R|I|MSGLIST, 0, MMNDEL, 1130Sstevel@tonic-gate "replyall", C replyall, R|I|MSGLIST, 0, MMNDEL, 1140Sstevel@tonic-gate "replysender", C replysender, R|I|MSGLIST, 0, MMNDEL, 1150Sstevel@tonic-gate "edit", C editor, I|MSGLIST, 0, MMNORM, 1160Sstevel@tonic-gate "echo", C echo, M|RAWLIST, 0, 1000, 1170Sstevel@tonic-gate "quit", C edstop, NOLIST, 0, 0, 1180Sstevel@tonic-gate "list", C pcmdlist, M|NOLIST, 0, 0, 1190Sstevel@tonic-gate "load", C loadmsg, W|STRLIST, 0, 0, 1200Sstevel@tonic-gate "xit", C rexit, M|NOLIST, 0, 0, 1210Sstevel@tonic-gate "exit", C rexit, M|NOLIST, 0, 0, 1220Sstevel@tonic-gate "size", C messize, MSGLIST, 0, MMNDEL, 1230Sstevel@tonic-gate "hold", C preserve, I|W|MSGLIST, 0, MMNDEL, 1240Sstevel@tonic-gate "if", C ifcmd, F|M|RAWLIST, 1, 1, 1250Sstevel@tonic-gate "else", C elsecmd, F|M|RAWLIST, 0, 0, 1260Sstevel@tonic-gate "endif", C endifcmd, F|M|RAWLIST, 0, 0, 1270Sstevel@tonic-gate "alternates", C alternates, M|RAWLIST, 0, 1000, 1280Sstevel@tonic-gate "ignore", C igfield, M|RAWLIST, 0, 1000, 1290Sstevel@tonic-gate "discard", C igfield, M|RAWLIST, 0, 1000, 1300Sstevel@tonic-gate "unignore", C unigfield, M|RAWLIST, 0, 1000, 1310Sstevel@tonic-gate "undiscard", C unigfield, M|RAWLIST, 0, 1000, 1320Sstevel@tonic-gate "retain", C retfield, M|RAWLIST, 0, 1000, 1330Sstevel@tonic-gate "unretain", C unretfield, M|RAWLIST, 0, 1000, 1340Sstevel@tonic-gate /* "Header", C Header, STRLIST, 0, 1000, */ 1350Sstevel@tonic-gate "#", C null, M|NOLIST, 0, 0, 1360Sstevel@tonic-gate "pipe", C dopipe, STRLIST, 0, 0, 1370Sstevel@tonic-gate "|", C dopipe, STRLIST, 0, 0, 1380Sstevel@tonic-gate "inc", C inc, T|NOLIST, 0, 0, 1390Sstevel@tonic-gate "field", C field, STRLIST, 0, 0, 1400Sstevel@tonic-gate "put", C sput, STRLIST, 0, 0, 1410Sstevel@tonic-gate "Put", C Sput, STRLIST, 0, 0, 1420Sstevel@tonic-gate 0, C 0, 0, 0, 0 1430Sstevel@tonic-gate }; 144