]> arthur.barton.de Git - ngircd-alex.git/blob - src/ngircd/client-cap.c
Remove imp.h and exp.h header files
[ngircd-alex.git] / src / ngircd / client-cap.c
1 /*
2  * ngIRCd -- The Next Generation IRC Daemon
3  * Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors.
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  * Please read the file COPYING, README and AUTHORS for more information.
10  */
11
12 #define __client_cap_c__
13
14 #include "portab.h"
15
16 /**
17  * @file
18  * Functions to deal with IRC Capabilities
19  */
20
21 #include <assert.h>
22
23 #include "defines.h"
24 #include "conn.h"
25 #include "client.h"
26 #include "log.h"
27
28 #include "client-cap.h"
29
30 GLOBAL int
31 Client_Cap(CLIENT *Client)
32 {
33         assert (Client != NULL);
34
35         return Client->capabilities;
36 }
37
38 GLOBAL void
39 Client_CapSet(CLIENT *Client, int Cap)
40 {
41         assert(Client != NULL);
42         assert(Cap >= 0);
43
44         Client->capabilities = Cap;
45         LogDebug("Set new capability of \"%s\" to %d.",
46                  Client_ID(Client), Client->capabilities);
47 }
48
49 GLOBAL void
50 Client_CapAdd(CLIENT *Client, int Cap)
51 {
52         assert(Client != NULL);
53         assert(Cap > 0);
54
55         Client->capabilities |= Cap;
56         LogDebug("Add capability %d, new capability of \"%s\" is %d.",
57                  Cap, Client_ID(Client), Client->capabilities);
58 }
59
60 GLOBAL void
61 Client_CapDel(CLIENT *Client, int Cap)
62 {
63         assert(Client != NULL);
64         assert(Cap > 0);
65
66         Client->capabilities &= ~Cap;
67         LogDebug("Delete capability %d, new capability of \"%s\" is %d.",
68                  Cap, Client_ID(Client), Client->capabilities);
69 }
70
71 /* -eof- */