ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/ermyth/include/users.h
Revision: 1.1
Committed: Thu Jul 19 08:24:51 2007 UTC (16 years, 10 months ago) by pippijn
Content type: text/plain
Branch: MAIN
Log Message:
initial import. the most important changes since Atheme are:
- fixed many memory leaks
- fixed many bugs
- converted to C++ and use more STL containers
- added a (not very enhanced yet) perl module
- greatly improved XML-RPC speed
- added a JSON-RPC module with code from json-cpp
- added a valgrind memcheck module to operserv
- added a more object oriented base64 implementation
- added a specialised unit test framework
- improved stability
- use gettimeofday() if available
- reworked adding/removing commands
- MemoServ IGNORE DEL can now remove indices

File Contents

# Content
1 /*
2 * Copyright © 2005 William Pitcock, et al.
3 * Rights to this code are as documented in doc/LICENSE.
4 *
5 * Data structures for connected clients.
6 *
7 * $Id: users.h 8235 2007-05-06 22:54:53Z jilles $
8 */
9
10 #ifndef USERS_H
11 #define USERS_H
12
13 struct user_t
14 {
15 int mu_index; // index used in myuser_t::login_vector
16
17 char nick[NICKLEN];
18 char user[USERLEN];
19 char host[HOSTLEN]; /* Real host */
20 char gecos[GECOSLEN];
21 char vhost[HOSTLEN]; /* Visible host */
22 char uid[IDLEN]; /* Used for TS6, P10, IRCNet ircd. */
23 char ip[HOSTIPLEN];
24
25 list_t channels;
26
27 server_t *server;
28 myuser_t *myuser;
29
30 unsigned int offenses;
31 unsigned int msgs;
32 time_t lastmsg;
33
34 unsigned int flags;
35
36 time_t ts;
37 };
38
39 #define UF_AWAY 0x00000002
40 #define UF_INVIS 0x00000004
41 #define UF_IRCOP 0x00000010
42 #define UF_ADMIN 0x00000020
43 #define UF_SEENINFO 0x00000080
44 #define UF_HIDEHOSTREQ 0x00000200 /* host hiding requested */
45
46 #define CLIENT_NAME(user) ((user)->uid[0] ? (user)->uid : (user)->nick)
47
48 /* function.c */
49 E bool is_ircop (user_t *user);
50 E bool is_admin (user_t *user);
51 E bool is_internal_client (user_t *user);
52
53 /* users.c */
54 E dictionary_tree_t *userlist;
55 E dictionary_tree_t *uidlist;
56
57 E void init_users (void);
58
59 E user_t *user_add (const char *nick, const char *user, const char *host, const char *vhost, const char *ip, const char *uid, const char *gecos, server_t *server, time_t ts);
60 E void user_delete (user_t *u);
61 E user_t *user_find (const char *nick);
62 E user_t *user_find_named (const char *nick);
63 E void user_changeuid (user_t *u, const char *uid);
64 E void user_changenick (user_t *u, const char *nick, time_t ts);
65 E void user_mode (user_t *user, char *modes);
66
67 /* uid.c */
68 E void init_uid (void);
69 E char *uid_get (void);
70
71 #endif