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: #ifndef lint
   8: static char copyright[] = "Copyright (c) 1990 Regents of the University of California.\nAll rights reserved.\n";
   9: static char SccsId[] = "@(#)@(#)pop_dele.c	2.1  2.1 3/18/91";
  10: #endif not lint
  11: 
  12: #include <stdio.h>
  13: #include <sys/types.h>
  14: #include <ctype.h>
  15: #include "popper.h"
  16: 
  17: /*
  18:  *  dele:   Delete a message from the POP maildrop
  19:  */
  20: pop_dele (p)
  21: POP     *   p;
  22: {
  23:     MsgInfoList     *   mp;         /*  Pointer to message info list */
  24:     int                 msg_num;
  25: 
  26:     /*  Convert the message number parameter to an integer */
  27:     msg_num = atoi(p->pop_parm[1]);
  28: 
  29:     /*  Is requested message out of range? */
  30:     if ((msg_num < 1) || (msg_num > p->msg_count))
  31:         return (pop_msg (p,POP_FAILURE,"Message %u does not exist.",msg_num));
  32: 
  33:     /*  Get a pointer to the message in the message list */
  34:     mp = &(p->mlp[msg_num-1]);
  35: 
  36:     /*  Is the message already flagged for deletion? */
  37:     if (mp->del_flag)
  38:         return (pop_msg (p,POP_FAILURE,"Message %u has already been deleted.",
  39:             msg_num));
  40: 
  41:     /*  Flag the message for deletion */
  42:     mp->del_flag = TRUE;
  43: 
  44: #ifdef DEBUG
  45:     if(p->debug)
  46:         pop_log(p,POP_DEBUG,"Deleting message %u at offset %ld of length %ld\n",
  47:             mp->number,mp->offset,mp->length);
  48: #endif DEBUG
  49: 
  50:     /*  Update the messages_deleted and bytes_deleted counters */
  51:     p->msgs_deleted++;
  52:     p->bytes_deleted += mp->length;
  53: 
  54:     /*  Update the last-message-accessed number if it is lower than
  55:         the deleted message */
  56:     if (p->last_msg < msg_num) p->last_msg = msg_num;
  57: 
  58:     return (pop_msg (p,POP_SUCCESS,"Message %u has been deleted.",msg_num));
  59: }

Defined functions

pop_dele defined in line 20; used 1 times

Defined variables

SccsId defined in line 9; never used
copyright defined in line 8; never used
Last modified: 1992-06-25
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 2436
Valid CSS Valid XHTML 1.0 Strict