]> jfr.im git - solanum.git/blobdiff - modules/m_links.c
Combine stats A output parameters (#35)
[solanum.git] / modules / m_links.c
index 92fd2d9887fedbef6ab46847be72a140ec3cc5d8..499dd674ec62d4ba32a5c4d4f78779ca7cf39e3b 100644 (file)
@@ -20,8 +20,6 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  *  USA
- *
- *  $Id: m_links.c 254 2005-09-21 23:35:12Z nenolod $
  */
 
 #include "stdinc.h"
 #include "scache.h"
 #include "s_assert.h"
 
-static int m_links(struct Client *, struct Client *, int, const char **);
-static int mo_links(struct Client *, struct Client *, int, const char **);
+static const char links_desc[] =
+       "Provides the LINKS command to view servers linked to the host server";
+
+static void m_links(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static void mo_links(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
 static char * clean_string(char *dest, const unsigned char *src, size_t len);
 
 struct Message links_msgtab = {
-       "LINKS", 0, 0, 0, MFLG_SLOW,
+       "LINKS", 0, 0, 0, 0,
        {mg_unreg, {m_links, 0}, {mo_links, 0}, mg_ignore, mg_ignore, {mo_links, 0}}
 };
 
@@ -56,43 +57,41 @@ mapi_hlist_av1 links_hlist[] = {
        { NULL, NULL }
 };
 
-DECLARE_MODULE_AV1(links, NULL, NULL, links_clist, links_hlist, NULL, "$Revision: 254 $");
+DECLARE_MODULE_AV2(links, NULL, NULL, links_clist, links_hlist, NULL, NULL, NULL, links_desc);
 
 /*
  * m_links - LINKS message handler
  *      parv[1] = servername mask
  * or
- *      parv[1] = server to query 
+ *      parv[1] = server to query
  *      parv[2] = servername mask
  */
-static int
-m_links(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+static void
+m_links(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        if(ConfigServerHide.flatten_links && !IsExemptShide(source_p))
                scache_send_flattened_links(source_p);
        else
-               mo_links(client_p, source_p, parc, parv);
-
-       return 0;
+               mo_links(msgbuf_p, client_p, source_p, parc, parv);
 }
 
-static int
-mo_links(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+static void
+mo_links(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        const char *mask = "";
        struct Client *target_p;
        char clean_mask[2 * HOSTLEN + 4];
-       hook_data hd;
+       hook_cdata hd;
 
        rb_dlink_node *ptr;
 
        if(parc > 2)
        {
                if(strlen(parv[2]) > HOSTLEN)
-                       return 0;
+                       return;
                if(hunt_server(client_p, source_p, ":%s LINKS %s :%s", 1, parc, parv)
                   != HUNTED_ISME)
-                       return 0;
+                       return;
 
                mask = parv[2];
        }
@@ -117,7 +116,7 @@ mo_links(struct Client *client_p, struct Client *source_p, int parc, const char
                        continue;
 
                /* We just send the reply, as if theyre here theres either no SHIDE,
-                * or theyre an oper..  
+                * or theyre an oper..
                 */
                sendto_one_numeric(source_p, RPL_LINKS, form_str(RPL_LINKS),
                                   target_p->name, target_p->servptr->name,
@@ -127,8 +126,6 @@ mo_links(struct Client *client_p, struct Client *source_p, int parc, const char
 
        sendto_one_numeric(source_p, RPL_ENDOFLINKS, form_str(RPL_ENDOFLINKS),
                           EmptyString(mask) ? "*" : mask);
-
-       return 0;
 }
 
 static char *