00001 /* $Id$ */ 00002 00003 /* 00004 * (C) Copyright 2001-2003 Piotr Domagalski <szalik@szalik.net> 00005 * Wojtek Kaniewski <wojtekka@irc.pl> 00006 * 00007 * This program is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License Version 2 as 00009 * published by the Free Software Foundation. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00019 */ 00020 00021 #ifndef __EKG_MSGQUEUE_H 00022 #define __EKG_MSGQUEUE_H 00023 00024 #include <sys/types.h> 00025 #include <time.h> 00026 00027 #include "dynstuff.h" 00028 #include "protocol.h" 00029 00030 #ifdef __cplusplus 00031 extern "C" { 00032 #endif 00033 00034 typedef struct msg_queue { 00035 struct msg_queue *next; 00036 00037 char *session; /* do której sesji należy */ 00038 char *rcpts; /* uidy odbiorców */ 00039 char *message; /* treść */ 00040 char *seq; /* numer sekwencyjny */ 00041 time_t time; /* czas wysłania */ 00042 unsigned int mark : 1; /* if added during cleanup */ 00043 msgclass_t mclass; 00044 } msg_queue_t; 00045 00046 extern msg_queue_t *msgs_queue; 00047 00048 int msg_queue_add(const char *session, const char *rcpts, const char *message, const char *seq, msgclass_t mclass); 00049 void msgs_queue_destroy(); 00050 int msg_queue_count_session(const char *uid); 00051 int msg_queue_remove_uid(const char *uid); 00052 int msg_queue_remove_seq(const char *seq); 00053 int msg_queue_flush(const char *session); 00054 int msg_queue_read(); 00055 int msg_queue_write(); 00056 00057 #ifdef __cplusplus 00058 } 00059 #endif 00060 00061 #endif /* __EKG_MSGQUEUE_H */ 00062 00063 /* 00064 * Local Variables: 00065 * mode: c 00066 * c-file-style: "k&r" 00067 * c-basic-offset: 8 00068 * indent-tabs-mode: t 00069 * End: 00070 */