/* * ---------------------------------------------------------------- * Night Light IRC Proxy - Channel Mode Header * ---------------------------------------------------------------- * Copyright (C) 1997-2007 Jonas Kvinge * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Last modified by: * Jonas Kvinge (25.11.2007) * */ #ifdef CHAN_MODE_H #warning "chan_mode.h already included." #else #define CHAN_MODE_H #define CHANMODE_PRIOHIGHEST 0 #define CHANMODE_PRIOHIGH 1 #define CHANMODE_PRIOMEDIUM 2 #define CHANMODE_PRIOLOW 3 #define CHANMODE_PRIOLOWEST 4 #define CHANMODEFLUSHMODESTIME 3 #define CHANMODEEXPIRESENTMODESTIME 3 #define CHANMODESENTMODETTL 15 #define CHANMODEPRIOMODE CHANMODE_PRIOHIGHEST #define CHANMODEPRIOVOICE CHANMODE_PRIOHIGHEST #define CHANMODEPRIODEVOICE CHANMODE_PRIOHIGHEST #define CHANMODEPRIOOP CHANMODE_PRIOHIGHEST #define CHANMODEPRIODEOP CHANMODE_PRIOHIGHEST #define CHANMODEPRIOBAN CHANMODE_PRIOHIGHEST #define CHANMODEPRIOUNBAN CHANMODE_PRIOHIGHEST /* STRUCTURES - JONAS (31.07.2001) */ struct ChanMode_Struct { char *Mode; time_t Time; unsigned short int Priority; unsigned short int Delay; unsigned short int Flushed; struct ChanMode_Struct *Prev; struct ChanMode_Struct *Next; }; struct ChanSentMode_Struct { char *Mode; time_t Time; struct ChanSentMode_Struct *Prev; struct ChanSentMode_Struct *Next; }; /* FUNCTION PROTOTYPES - JONAS (31.07.2001) */ struct ChanMode_Struct *chan_addmode(struct Conn_Struct *ConnS, struct Chan_Struct *ChanS, const char *const ModePT, const unsigned short int Priority, const unsigned short int Delay); void chan_remmode(struct Conn_Struct *ConnS, struct Chan_Struct *ChanS, struct ChanMode_Struct *ChanMode); struct ChanMode_Struct *chan_getmode(struct Conn_Struct *ConnS, struct Chan_Struct *ChanS, const char *const ModePT); void chan_initmode(struct Conn_Struct *ConnS, struct Chan_Struct *ChanS, struct ChanMode_Struct *ChanMode); void chan_destroymodes(struct Conn_Struct *ConnS, struct Chan_Struct *ChanS); struct ChanSentMode_Struct *chan_addsentmode(struct Conn_Struct *ConnS, struct Chan_Struct *ChanS, const char *const ModePT); void chan_remsentmode(struct Conn_Struct *ConnS, struct Chan_Struct *ChanS, struct ChanSentMode_Struct *ChanSentMode); struct ChanSentMode_Struct *chan_getsentmode(struct Conn_Struct *ConnS, struct Chan_Struct *ChanS, const char *const ModePT); void chan_initsentmode(struct Conn_Struct *ConnS, struct Chan_Struct *ChanS, struct ChanSentMode_Struct *ChanSentMode); void chan_destroysentmodes(struct Conn_Struct *ConnS, struct Chan_Struct *ChanS); void chan_expiresentmodes(struct Conn_Struct *ConnS, struct Chan_Struct *ChanS); signed short int chan_mode(struct Conn_Struct *ConnS, struct Chan_Struct *ChanS, const char *const ModePT, const unsigned short int Priority, const unsigned short int Delay); void chan_flushmodes(struct Conn_Struct *ConnS, struct Chan_Struct *ChanS); #endif