xref: /illumos-gate/usr/src/cmd/mail/clr_hinfo.c (revision dd17f1f499b3f8622fb4d4d8e00ee4a9adc1bb68)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
23 /*	  All Rights Reserved  	*/
24 
25 /*
26     NAME
27 	clr_hinfo, clrhdr - clean out mail header information
28 
29     SYNOPSIS
30 	void clr_hinfo()
31 	void clrhdr(int hdrtype)
32 
33     DESCRIPTION
34 	Clr_hinfo() cleans out hdrlines[] and other associated data
35 	in preparation for the next message.
36 
37 	Clrhdr() does a single hdrlines[].
38 */
39 
40 #include "mail.h"
41 
42 void
43 clr_hinfo()
44 {
45 	register	int	i;
46 	static		int	firsttime = 1;
47 	static char		pn[] = "clr_hinfo";
48 
49 	Dout(pn, 0, "\n");
50 	if (firsttime) {
51 		firsttime = 0;
52 		return;
53 	}
54 	fnuhdrtype = 0;
55 	orig_aff = orig_rcv = 0;
56 	for (i = 0; i < H_CONT; i++) {
57 		clrhdr(i);
58 	}
59 	return;
60 }
61 
62 void clrhdr(hdrtype)
63 int	hdrtype;
64 {
65 	while (hdrlines[hdrtype].head != (struct hdrs *)NULL) {
66 		poplist (hdrtype, HEAD);
67 	}
68 }
69