6d2587a20b42fa8174076d311bea8628b680df2d
[ossec-hids.git] / src / os_maild / mail_list.h
1 /* @(#) $Id: ./src/os_maild/mail_list.h, 2011/09/08 dcid Exp $
2  */
3
4 /* Copyright (C) 2009 Trend Micro Inc.
5  * All rights reserved.
6  *
7  * This program is a free software; you can redistribute it
8  * and/or modify it under the terms of the GNU General Public
9  * License (version 2) as published by the FSF - Free Software
10  * Foundation
11  */
12
13
14 #ifndef _MAILIST__H
15 #define _MAILIST__H
16
17
18 /* Events List structure */
19 typedef struct _MailNode
20 {
21     MailMsg *mail;
22     struct _MailNode *next;
23     struct _MailNode *prev;
24 }MailNode;
25
26
27 /* Add an email to the list  */
28 void OS_AddMailtoList(MailMsg *ml);
29
30 /* Return the last event from the Event list
31  * removing it from there
32  */
33 MailNode *OS_PopLastMail();
34
35 /* Returns a pointer to the last email, not removing it */
36 MailNode *OS_CheckLastMail();
37
38 /* Create the mail list. Maxsize must be specified */
39 void OS_CreateMailList(int maxsize);
40
41 /* Free an email node */
42 void FreeMail(MailNode *ml);
43
44 /* Free email msg */
45 void FreeMailMsg(MailMsg *ml);
46
47 #endif