www.pudn.com > DTMS.rar > DELETE.C


#include	"mail.h"

/* Delete the specified record */

int
mail_delete(MAIL *mail, const char *key)
{
	int		rc;

	if (_mail_find(mail, key, 1) == 0) {
		rc = _mail_dodelete(mail);	/* record found */
		mail->cnt_delok++;
	} else {
		rc = -1;				/* not found */
		mail->cnt_delerr++;
	}

	if (un_lock(mail->idxfd, mail->chainoff, SEEK_SET, 1) < 0)
		err_dump("un_lock error");
	return(rc);
}