Merge from vendor branch LIBARCHIVE:
[dragonfly.git] / crypto / heimdal-0.6.3 / appl / popper / pop_rset.c
1 /*
2  * Copyright (c) 1989 Regents of the University of California.
3  * All rights reserved.  The Berkeley software License Agreement
4  * specifies the terms and conditions for redistribution.
5  */
6
7 #include <popper.h>
8 RCSID("$Id: pop_rset.c,v 1.9 1998/04/23 17:38:08 joda Exp $");
9
10 /* 
11  *  rset:   Unflag all messages flagged for deletion in a POP maildrop
12  */
13
14 int
15 pop_rset (POP *p)
16 {
17     MsgInfoList     *   mp;         /*  Pointer to the message info list */
18     int                 i;
19
20     /*  Unmark all the messages */
21     for (i = p->msg_count, mp = p->mlp; i > 0; i--, mp++)
22         mp->flags &= ~DEL_FLAG;
23     
24     /*  Reset the messages-deleted and bytes-deleted counters */
25     p->msgs_deleted = 0;
26     p->bytes_deleted = 0;
27     
28     /*  Reset the last-message-access flag */
29     p->last_msg = 0;
30
31     return (pop_msg(p,POP_SUCCESS,"Maildrop has %u messages (%ld octets)",
32                     p->msg_count, p->drop_size));
33 }