ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/branches/8.2.x/modules/m_close.c
Revision: 1832
Committed: Fri Apr 19 19:16:09 2013 UTC (13 years, 3 months ago) by michael
Content type: text/x-csrc
Original Path: ircd-hybrid/trunk/modules/m_close.c
File size: 2404 byte(s)
Log Message:
- Made all numeric defines use the actual string instead of the numeric value
  which allows to use gcc's printf format attribute
- Remove current message locale implementation

File Contents

# User Rev Content
1 adx 30 /*
2     * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
3     * m_close.c: Closes all unregistered connections.
4     *
5     * Copyright (C) 2002 by the past and present ircd coders, and others.
6     *
7     * This program is free software; you can redistribute it and/or modify
8     * it under the terms of the GNU General Public License as published by
9     * the Free Software Foundation; either version 2 of the License, or
10     * (at your option) any later version.
11     *
12     * This program is distributed in the hope that it will be useful,
13     * but WITHOUT ANY WARRANTY; without even the implied warranty of
14     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15     * GNU General Public License for more details.
16     *
17     * You should have received a copy of the GNU General Public License
18     * along with this program; if not, write to the Free Software
19     * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20     * USA
21     *
22 knight 31 * $Id$
23 adx 30 */
24    
25     #include "stdinc.h"
26 michael 1011 #include "list.h"
27 adx 30 #include "client.h"
28     #include "ircd.h"
29     #include "numeric.h"
30     #include "send.h"
31     #include "parse.h"
32     #include "modules.h"
33    
34    
35     /*
36     * mo_close - CLOSE message handler
37     * - added by Darren Reed Jul 13 1992.
38     */
39     static void
40     mo_close(struct Client *client_p, struct Client *source_p,
41     int parc, char *parv[])
42     {
43 michael 970 dlink_node *ptr = NULL, *ptr_next = NULL;
44     unsigned int closed = dlink_list_length(&unknown_list);
45 adx 30
46 michael 970
47 adx 30 DLINK_FOREACH_SAFE(ptr, ptr_next, unknown_list.head)
48     {
49 michael 970 struct Client *target_p = ptr->data;
50 adx 30
51 michael 1832 sendto_one(source_p, RPL_CLOSING, me.name, source_p->name,
52 adx 30 get_client_name(target_p, SHOW_IP), target_p->status);
53 michael 970
54 michael 1011 /*
55     * exit here is safe, because it is guaranteed not to be source_p
56 adx 30 * because it is unregistered and source_p is an oper.
57     */
58     exit_client(target_p, target_p, "Oper Closing");
59     }
60    
61 michael 1832 sendto_one(source_p, RPL_CLOSEEND,
62 adx 30 me.name, source_p->name, closed);
63     }
64 michael 1230
65     static struct Message close_msgtab = {
66     "CLOSE", 0, 0, 0, MAXPARA, MFLG_SLOW, 0,
67     { m_unregistered, m_not_oper, m_ignore, m_ignore, mo_close, m_ignore }
68     };
69    
70     static void
71     module_init(void)
72     {
73     mod_add_cmd(&close_msgtab);
74     }
75    
76     static void
77     module_exit(void)
78     {
79     mod_del_cmd(&close_msgtab);
80     }
81    
82     struct module module_entry = {
83     .node = { NULL, NULL, NULL },
84     .name = NULL,
85     .version = "$Revision$",
86     .handle = NULL,
87     .modinit = module_init,
88     .modexit = module_exit,
89     .flags = 0
90     };

Properties

Name Value
svn:eol-style native
svn:keywords Id Revision