/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#include "mail.h"
/*
* display headers, indicating current and status
*
* current is the displacement into the mailfile of the
* current letter
*
* all indicates how many headers should be shown.
* 0 -> show window +/-6 around current
* 1 -> show all messages
* 2 -> show deleted messages
*
* Only 100 characters of the From (first) header line will
* be read in. This line is assumed to be in the following
* format:
* From <sender address> <date>
* where
* <sender address> is either a UUCP-style (sysa!sysb!user)
* or domain-style address (user@host).
*
* If the sender address contains a UUCP-style address, then
* the user name displayed is made up of the characters following
* the final '!' in the sender address, otherwise the sender
* address is considered to be the user name.
*
* The maximum number of characters of a user name displayed
* is 19.
*
*/
int
{
int displayed = 0;
char *hold;
char *wline;
int ln;
char mark;
char *uucpptr;
int uucpstart;
int sender_size;
printf("%d letters found in %s, %d scheduled for deletion, "
return (0);
if (!flgr) {
if (all) {
stop = -1;
}
} else {
if (all) {
start = 0;
}
}
return (1);
}
return (1);
}
return (1);
}
/* skip past trailing white space after header tag */
;
}
/*
* If UUCP-style sender address, then read past
* last "!" to get the start of the user name.
*/
uucpstart = 0;
if (uucpstart > sender_size) {
uucpstart = 0;
}
}
/* Get the user name out of the sender address. */
}
} else {
}
/*
* Skip past the rest of the sender address, and
* delimiting white space.
*/
;
;
/* Get the date information. */
;
else mark = ' ';
if (all == 2) {
return (0);
}
}
displayed++;
}
return (0);
}
void
tmperr(void)
{
}
/*
* Write a string out to tmp file, with error checking.
* Return 1 on success, else 0
*/
int
{
tmperr();
return (0);
}
return (1);
}
/*
* Read a line from stdin, assign it to line and
* return number of bytes in length
*/
int
{
int i, ch;
ptr2line[i] = '\0';
return (i);
}
/*
* Make temporary file for letter
*/
void
mktmp(void)
{
done(0);
}
}
/*
* Get a number from user's reply,
* return its value or zero if none present, -1 on error
*/
int
getnumbr(char *s)
{
int k = 0;
while (*s == ' ' || *s == '\t') s++;
if (*s != '\0') {
if ((k = atoi(s)) != 0)
if (!validmsg(k))
return (-1);
for (; *s >= '0' && *s <= '9'; ) s++;
if (*s != '\0' && *s != '\n') {
printf("Illegal numeric\n");
return (-1);
}
return (k);
}
return (0);
}
/*
* If valid msgnum return 1,
* else print message and return 0
*/
int
validmsg(int i)
{
if ((i < 0) || (i > nlet)) {
printf("No such message\n");
return (0);
}
return (1);
}
/*
* Set letter to passed status, and adjust changed as necessary
*/
void
{
if (status == ' ') {
} else {
}
}