2 * IRC - Internet Relay Chat, include/class.h
3 * Copyright (C) 1990 Darren Reed
4 * Copyright (C) 1996 - 1997 Carlo Wood
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
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.
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.
24 /*=========================================================================
29 unsigned int conClass;
31 unsigned int pingFreq;
32 unsigned int maxLinks;
33 unsigned int maxSendq;
35 struct ConfClass *next;
38 /*=============================================================================
42 #define ConClass(x) ((x)->conClass)
43 #define ConFreq(x) ((x)->conFreq)
44 #define PingFreq(x) ((x)->pingFreq)
45 #define MaxLinks(x) ((x)->maxLinks)
46 #define MaxSendq(x) ((x)->maxSendq)
47 #define Links(x) ((x)->links)
49 #define ConfLinks(x) ((x)->confClass->links)
50 #define ConfMaxLinks(x) ((x)->confClass->maxLinks)
51 #define ConfClass(x) ((x)->confClass->conClass)
52 #define ConfConFreq(x) ((x)->confClass->conFreq)
53 #define ConfPingFreq(x) ((x)->confClass->pingFreq)
54 #define ConfSendq(x) ((x)->confClass->maxSendq)
56 #define FirstClass() classes
57 #define NextClass(x) ((x)->next)
59 #define MarkDelete(x) do { MaxLinks(x) = (unsigned int)-1; } while(0)
60 #define IsMarkedDelete(x) (MaxLinks(x) == (unsigned int)-1)
62 /*=============================================================================
66 extern aConfClass *find_class(unsigned int cclass);
67 extern aConfClass *make_class(void);
68 extern void free_class(aConfClass * tmp);
69 extern unsigned int get_con_freq(aConfClass * clptr);
70 extern unsigned int get_client_ping(aClient *acptr);
71 extern unsigned int get_conf_class(aConfItem *aconf);
72 extern unsigned int get_client_class(aClient *acptr);
73 extern void add_class(unsigned int conclass, unsigned int ping,
74 unsigned int confreq, unsigned int maxli, size_t sendq);
75 extern void check_class(void);
76 extern void initclass(void);
77 extern void report_classes(aClient *sptr);
78 extern size_t get_sendq(aClient *cptr);
80 extern aConfClass *classes;