[BACK]Return to client-cap.c CVS log [TXT][DIR] Up to [local] / ircnowd / src / ngircd

Annotation of ircnowd/src/ngircd/client-cap.c, Revision 1.1.1.1

1.1       tomglok     1: /*
                      2:  * ngIRCd -- The Next Generation IRC Daemon
                      3:  * Copyright (c)2001-2014 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 "conn.h"
                     24: #include "log.h"
                     25:
                     26: #include "client-cap.h"
                     27:
                     28: GLOBAL int
                     29: Client_Cap(CLIENT *Client)
                     30: {
                     31:        assert (Client != NULL);
                     32:
                     33:        return Client->capabilities;
                     34: }
                     35:
                     36: GLOBAL void
                     37: Client_CapSet(CLIENT *Client, int Cap)
                     38: {
                     39:        assert(Client != NULL);
                     40:        assert(Cap >= 0);
                     41:
                     42:        Client->capabilities = Cap;
                     43:        LogDebug("Set new capability of \"%s\" to %d.",
                     44:                 Client_ID(Client), Client->capabilities);
                     45: }
                     46:
                     47: GLOBAL void
                     48: Client_CapAdd(CLIENT *Client, int Cap)
                     49: {
                     50:        assert(Client != NULL);
                     51:        assert(Cap > 0);
                     52:
                     53:        Client->capabilities |= Cap;
                     54:        LogDebug("Add capability %d, new capability of \"%s\" is %d.",
                     55:                 Cap, Client_ID(Client), Client->capabilities);
                     56: }
                     57:
                     58: GLOBAL void
                     59: Client_CapDel(CLIENT *Client, int Cap)
                     60: {
                     61:        assert(Client != NULL);
                     62:        assert(Cap > 0);
                     63:
                     64:        Client->capabilities &= ~Cap;
                     65:        LogDebug("Delete capability %d, new capability of \"%s\" is %d.",
                     66:                 Cap, Client_ID(Client), Client->capabilities);
                     67: }
                     68:
                     69: /* -eof- */

CVSweb