This commit was generated by cvs2svn to compensate for changes in r2,
[ircu2.10.12-pk.git] / include / numnicks.h
1 /*
2  * IRC - Internet Relay Chat, include/h.h
3  * Copyright (C) 1996 - 1997 Carlo Wood
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, or (at your option)
8  * any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */
19
20 #ifndef INCLUDED_numnicks_h
21 #define INCLUDED_numnicks_h
22 #ifndef INCLUDED_sys_types_h
23 #include <sys/types.h>
24 #define INCLUDED_sys_types_h
25 #endif
26
27 /*=============================================================================
28  * General defines
29  */
30
31 /*
32  * used for buffer size calculations in channel.c
33  */
34 #define NUMNICKLEN 5            /* strlen("YYXXX") */
35
36 /*=============================================================================
37  * Macros
38  */
39
40 /*
41  * Use this macro as follows: sprintf(buf, "%s%s ...", NumNick(cptr), ...);
42  */
43 #define NumNick(c) (c)->user->server->yxx, (c)->yxx
44
45 /*
46  * Use this macro as follows: sprintf(buf, "%s ...", NumServ(cptr), ...);
47  */
48 #define NumServ(c) (c)->yxx
49
50 /*
51  * Use this macro as follows: sprintf(buf, "%s%s ...", NumServCap(cptr), ...);
52  */
53 #define NumServCap(c) (c)->yxx, (c)->serv->nn_capacity
54
55 /*=============================================================================
56  * Structures
57  */
58 struct Client;
59
60 /*=============================================================================
61  * Proto types
62  */
63 extern int SetRemoteNumNick(struct Client *cptr, const char *yxx);
64 extern void SetLocalNumNick(struct Client *cptr);
65 extern void RemoveYXXClient(struct Client *server, const char *yxx);
66 extern void SetServerYXX(struct Client *cptr,
67     struct Client *server, const char *yxx);
68 extern void ClearServerYXX(const struct Client *server);
69
70 extern void SetYXXCapacity(struct Client *myself, size_t max_clients);
71 extern void SetYXXServerName(struct Client *myself, unsigned int numeric);
72
73 extern int markMatchexServer(const char *cmask, int minlen);
74 extern struct Client *find_match_server(char *mask);
75 extern struct Client *findNUser(const char *yxx);
76 extern struct Client *FindNServer(const char *numeric);
77
78 extern unsigned int base64toint(const char *str);
79 extern const char *inttobase64(char *buf, unsigned int v, size_t count);
80
81 #ifndef NO_PROTOCOL9
82 extern const char *CreateNNforProtocol9server(const struct Client *server);
83 #endif
84
85 #endif /* INCLUDED_numnicks_h */