ekg2  GIT master
msgqueue.h
Idź do dokumentacji tego pliku.
1 /* $Id$ */
2 
3 /*
4  * (C) Copyright 2001-2003 Piotr Domagalski <szalik@szalik.net>
5  * Wojtek Kaniewski <wojtekka@irc.pl>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License Version 2 as
9  * published by the Free Software Foundation.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  */
20 
21 #ifndef __EKG_MSGQUEUE_H
22 #define __EKG_MSGQUEUE_H
23 
24 #include <sys/types.h>
25 #include <time.h>
26 
27 #include "dynstuff.h"
28 #include "protocol.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 typedef struct msg_queue {
35  struct msg_queue *next;
36 
37  char *session; /* do której sesji należy */
38  char *rcpts; /* uidy odbiorców */
39  char *message; /* treść */
40  char *seq; /* numer sekwencyjny */
41  time_t time; /* czas wysłania */
42  unsigned int mark : 1; /* if added during cleanup */
44 } msg_queue_t;
45 
46 extern msg_queue_t *msgs_queue;
47 
48 int msg_queue_add(const char *session, const char *rcpts, const char *message, const char *seq, msgclass_t mclass);
49 void msgs_queue_destroy();
50 int msg_queue_count_session(const char *uid);
51 int msg_queue_remove_uid(const char *uid);
52 int msg_queue_remove_seq(const char *seq);
53 int msg_queue_flush(const char *session);
54 int msg_queue_read();
55 int msg_queue_write();
56 
57 #ifdef __cplusplus
58 }
59 #endif
60 
61 #endif /* __EKG_MSGQUEUE_H */
62 
63 /*
64  * Local Variables:
65  * mode: c
66  * c-file-style: "k&r"
67  * c-basic-offset: 8
68  * indent-tabs-mode: t
69  * End:
70  */
unsigned int mark
Definition: msgqueue.h:42
int msg_queue_count_session(const char *uid)
Definition: msgqueue.c:184
char * rcpts
Definition: msgqueue.h:38
time_t time
Definition: msgqueue.h:41
void msgs_queue_destroy()
Definition: msgqueue.c:42
int msg_queue_flush(const char *session)
Definition: msgqueue.c:132
Definition: msgqueue.h:34
char * message
Definition: msgqueue.h:39
int msg_queue_read()
Definition: msgqueue.c:251
msg_queue_t * msgs_queue
Definition: msgqueue.c:35
msgclass_t mclass
Definition: msgqueue.h:43
char * seq
Definition: msgqueue.h:40
struct msg_queue * next
Definition: msgqueue.h:35
int msg_queue_add(const char *session, const char *rcpts, const char *message, const char *seq, msgclass_t mclass)
Definition: msgqueue.c:56
char * session
Definition: msgqueue.h:37
msgclass_t
Definition: protocol.h:71
int msg_queue_remove_seq(const char *seq)
Definition: msgqueue.c:106
int msg_queue_remove_uid(const char *uid)
Definition: msgqueue.c:82
int msg_queue_write()
Definition: msgqueue.c:204
struct msg_queue msg_queue_t