ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/ermyth/include/users.h
(Generate patch)

Comparing ermyth/include/users.h (file contents):
Revision 1.5 by pippijn, Sun Sep 16 18:54:42 2007 UTC vs.
Revision 1.6 by pippijn, Sat Sep 22 14:27:26 2007 UTC

7 * 7 *
8 * Portions of this file were derived from sources bearing the following license: 8 * Portions of this file were derived from sources bearing the following license:
9 * Copyright © 2005 William Pitcock, et al. 9 * Copyright © 2005 William Pitcock, et al.
10 * Rights to this code are as documented in doc/pod/license.pod. 10 * Rights to this code are as documented in doc/pod/license.pod.
11 * 11 *
12 * $Id: users.h,v 1.5 2007/09/16 18:54:42 pippijn Exp $ 12 * $Id: users.h,v 1.6 2007/09/22 14:27:26 pippijn Exp $
13 */ 13 */
14 14
15#ifndef USERS_H 15#ifndef USERS_H
16#define USERS_H 16#define USERS_H
17 17
18#include <ermyth/callback.h> 18#include <ermyth/callback.h>
19#include <util/predicates.h>
19 20
20class user_t : public zero_initialised 21class user_t : public zero_initialised
21{ 22{
22 struct callbacks 23 struct callbacks
23 { 24 {
30 functor::callback1<user_t *> oper; 31 functor::callback1<user_t *> oper;
31 functor::callback1<user_t *> deoper; 32 functor::callback1<user_t *> deoper;
32 }; 33 };
33 34
34public: 35public:
36 typedef std::pair<char const * const, user_t *> pair_type;
37 typedef std::map<char const * const, user_t *, irccase_lt> map_type;
38 typedef std::vector<user_t *> vector_type;
39 static map_type map;
40
35 unsigned mu_index; // index used in myuser_t::login_vector 41 unsigned mu_index; // index used in myuser_t::login_vector
36 42
37 char nick[NICKLEN]; 43 char nick[NICKLEN];
38 char user[USERLEN]; 44 char user[USERLEN];
39 char host[HOSTLEN]; /* Real host */ 45 char host[HOSTLEN]; /* Real host */
40 char gecos[GECOSLEN]; 46 char gecos[GECOSLEN];
41 char vhost[HOSTLEN]; /* Visible host */ 47 char vhost[HOSTLEN]; /* Visible host */
71E bool is_ircop (user_t *user); 77E bool is_ircop (user_t *user);
72E bool is_admin (user_t *user); 78E bool is_admin (user_t *user);
73E bool is_internal_client (user_t *user); 79E bool is_internal_client (user_t *user);
74 80
75/* users.C */ 81/* users.C */
76typedef std::pair<char const * const, user_t *> user_pair;
77typedef std::map<char const * const, user_t *, irccase_lt> user_map;
78E user_map userlist;
79
80E void init_users (void); 82E void init_users (void);
81 83
82E user_t *user_add (char const * const nick, char const * const user, char const * const host, char const * const vhost, char const * const ip, char const * const uid, char const * const gecos, server_t *server, time_t ts); 84E user_t *user_add (char const * const nick, char const * const user, char const * const host, char const * const vhost, char const * const ip, char const * const uid, char const * const gecos, server_t *server, time_t ts);
83E void user_delete (user_t *u); 85E void user_delete (user_t *u);
84E user_t *user_find (char const * const nick); 86E user_t *user_find (char const * const nick);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines