00001 /** 00002 * $Id: ms_msg_list.h 5003 2008-09-26 11:01:51Z henningw $ 00003 * 00004 * MSILO module 00005 * 00006 * Copyright (C) 2001-2003 FhG Fokus 00007 * 00008 * This file is part of Kamailio, a free SIP server. 00009 * 00010 * Kamailio is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version 00014 * 00015 * Kamailio is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU General Public License 00021 * along with this program; if not, write to the Free Software 00022 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00023 * 00024 * History: 00025 * -------- 00026 * 2003-03-11 major locking changes, now it uses locking.h (andrei) 00027 */ 00028 00029 #ifndef _MS_MSG_LIST_H_ 00030 #define _MS_MSG_LIST_H_ 00031 00032 00033 #include "../../locking.h" 00034 00035 #define MS_MSG_NULL 0 00036 #define MS_MSG_SENT 1 00037 #define MS_MSG_DONE 4 00038 #define MS_MSG_ERRO 8 00039 #define MS_MSG_TSND 16 00040 00041 #define MS_SEM_SENT 0 00042 #define MS_SEM_DONE 1 00043 00044 #define MSG_LIST_OK 0 00045 #define MSG_LIST_ERR -1 00046 #define MSG_LIST_EXIST 1 00047 00048 typedef struct _msg_list_el 00049 { 00050 int msgid; 00051 int flag; 00052 struct _msg_list_el * prev; 00053 struct _msg_list_el * next; 00054 } t_msg_list_el, *msg_list_el; 00055 00056 typedef struct _msg_list 00057 { 00058 int nrsent; 00059 int nrdone; 00060 msg_list_el lsent; 00061 msg_list_el ldone; 00062 gen_lock_t sem_sent; 00063 gen_lock_t sem_done; 00064 } t_msg_list, *msg_list; 00065 00066 msg_list_el msg_list_el_new(void); 00067 void msg_list_el_free(msg_list_el); 00068 void msg_list_el_free_all(msg_list_el); 00069 00070 msg_list msg_list_init(void); 00071 void msg_list_free(msg_list); 00072 int msg_list_check_msg(msg_list, int); 00073 int msg_list_set_flag(msg_list, int, int); 00074 int msg_list_check(msg_list); 00075 msg_list_el msg_list_reset(msg_list); 00076 00077 #endif 00078
1.5.6