Doxyfy s_user.h and s_user.c.
[ircu2.10.12-pk.git] / include / s_user.h
1 /*
2  * s_user.h
3  *
4  * $Id$
5  */
6 #ifndef INCLUDED_s_user_h
7 #define INCLUDED_s_user_h
8 #ifndef INCLUDED_sys_types_h
9 #include <sys/types.h>
10 #define INCLUDED_sys_types_h
11 #endif
12
13 struct Client;
14 struct User;
15 struct Channel;
16 struct MsgBuf;
17 struct Flags;
18
19 /*
20  * Macros
21  */
22
23 /**
24  * Nick flood limit.
25  * Minimum time between nick changes.
26  * (The first two changes are allowed quickly after another however).
27  */
28 #define NICK_DELAY 30
29
30 /**
31  * Target flood time.
32  * Minimum time between target changes.
33  * (MAXTARGETS are allowed simultaneously however).
34  * Its set to a power of 2 because we devide through it quite a lot.
35  */
36 #define TARGET_DELAY 128
37
38 /* return values for hunt_server() */
39
40 #define HUNTED_NOSUCH   (-1)    /**< if the hunted server is not found */
41 #define HUNTED_ISME     0       /**< if this server should execute the command */
42 #define HUNTED_PASS     1       /**< if message passed onwards successfully */
43
44 /* send sets for send_umode() */
45 #define ALL_UMODES 0  /**< both local and global user modes */
46 #define SEND_UMODES 1  /**< global user modes only */
47 #define SEND_UMODES_BUT_OPER 2  /**< global user modes except for FLAG_OPER */
48
49 /* used when sending to #mask or $mask */
50
51 #define MATCH_SERVER  1 /**< flag for relay_masked_message (etc) to indicate the mask matches a server name */
52 #define MATCH_HOST    2 /**< flag for relay_masked_message (etc) to indicate the mask matches host name */
53
54 #define COOKIE_VERIFIED 0xffffffff /**< value for cli_cookie() to show completion */
55
56 extern struct SLink *opsarray[]; /**< element N is a list of local opers with bit N set in their server notice mask (cli_snomask()) */
57
58 /** Formatter function for send_user_info().
59  * @param who Client being displayed.
60  * @param sptr Client requesting information.
61  * @param buf Message buffer that should receive the response text.
62  */
63 typedef void (*InfoFormatter)(struct Client* who, struct Client *sptr, struct MsgBuf* buf);
64
65 /*
66  * Prototypes
67  */
68 extern struct User* make_user(struct Client *cptr);
69 extern void         free_user(struct User *user);
70 extern int          register_user(struct Client* cptr, struct Client* sptr,
71                                   const char* nick, char* username);
72
73 extern void         user_count_memory(size_t* count_out, size_t* bytes_out);
74
75 extern int set_nick_name(struct Client* cptr, struct Client* sptr,
76                          const char* nick, int parc, char* parv[]);
77 extern void send_umode_out(struct Client* cptr, struct Client* sptr,
78                           struct Flags* old, int prop);
79 extern int whisper(struct Client* source, const char* nick,
80                    const char* channel, const char* text, int is_notice);
81 extern void send_user_info(struct Client* to, char* names, int rpl,
82                            InfoFormatter fmt);
83 extern int add_silence(struct Client* sptr, const char* mask);
84
85 extern int hide_hostmask(struct Client *cptr, unsigned int flags);
86 extern int set_user_mode(struct Client *cptr, struct Client *sptr,
87                          int parc, char *parv[]);
88 extern int is_silenced(struct Client *sptr, struct Client *acptr);
89 extern int hunt_server(int, struct Client *cptr, struct Client *sptr,
90     char *command, int server, int parc, char *parv[]);
91 extern int hunt_server_cmd(struct Client *from, const char *cmd,
92                            const char *tok, struct Client *one,
93                            int MustBeOper, const char *pattern, int server,
94                            int parc, char *parv[]);
95 extern int hunt_server_prio_cmd(struct Client *from, const char *cmd,
96                                 const char *tok, struct Client *one,
97                                 int MustBeOper, const char *pattern,
98                                 int server, int parc, char *parv[]);
99 extern struct Client* next_client(struct Client* next, const char* ch);
100 extern char *umode_str(struct Client *cptr);
101 extern void send_umode(struct Client *cptr, struct Client *sptr,
102                        struct Flags *old, int sendset);
103 extern int del_silence(struct Client *sptr, char *mask);
104 extern void set_snomask(struct Client *, unsigned int, int);
105 extern int is_snomask(char *);
106 extern int check_target_limit(struct Client *sptr, void *target, const char *name,
107     int created);
108 extern void add_target(struct Client *sptr, void *target);
109 extern unsigned int umode_make_snomask(unsigned int oldmask, char *arg,
110                                        int what);
111 extern int send_supported(struct Client *cptr);
112
113 #define NAMES_ALL 1 /**< List all users in channel */
114 #define NAMES_VIS 2 /**< List only visible users in non-secret channels */
115 #define NAMES_EON 4 /**< Add an 'End Of Names' reply to the end */
116 #define NAMES_DEL 8 /**< Show delayed joined users only */
117
118 void do_names(struct Client* sptr, struct Channel* chptr, int filter);
119
120 #endif /* INCLUDED_s_user_h */